Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
cyclus::Material Class Reference

Detailed Description

The material class is primarily responsible for enabling basic material manipulation while helping enforce mass conservation.

It also provides the ability to easily decay a material up to the current simulation time; it does not perform any decay related logic itself.

There are four basic operations that can be performed on materials: create, transmute (change material composition - e.g. fission by reactor), absorb (combine materials), extract (split a material). All material handling/manipulation will be performed using these operations - and all operations performed will be tracked and recorded. Usage examples:

Composition::Ptr nat_u = ...
double qty = 10.0;
Material::Ptr m = Material::Create(qty, nat_u, ctx);
Material::Ptr uf6 = uranium_buf.Pop();
Material::Ptr f = flourine_buf.Pop();
Composition::Ptr burned_comp = ... // fancy code to calculate burned nuclides
Material::Ptr assembly = core_fuel.Pop();
Composition::Ptr comp = ... // fancy code to calculate extracted nuclides
Material::Ptr bucket = spent_fuel.Pop();
double qty = 3.0;
Material::Ptr mox = bucket.ExtractComp(qty, comp);

Definition at line 71 of file material.h.

#include <material.h>

Inheritance diagram for cyclus::Material:
Inheritance graph

Public Types

typedef boost::shared_ptr< MaterialPtr
- Public Types inherited from cyclus::Resource
typedef boost::shared_ptr< ResourcePtr

Public Member Functions

void Absorb (Ptr mat)
virtual Resource::Ptr Clone () const
Composition::Ptr comp ()
Composition::Ptr comp () const
void Decay (int curr_time)
double DecayHeat ()
Ptr ExtractComp (double qty, Composition::Ptr c, double threshold=eps_rsrc())
Ptr ExtractQty (double qty)
virtual Resource::Ptr ExtractRes (double qty)
int prev_decay_time ()
virtual int qual_id () const
virtual double quantity () const
virtual void Record (Context *ctx) const
void Transmute (Composition::Ptr c)
virtual const ResourceType type () const
virtual std::string units () const
virtual ~Material ()
- Public Member Functions inherited from cyclus::Resource
void BumpStateId ()
const int obj_id () const
 Resource ()
const int state_id () const
virtual ~Resource ()

Static Public Member Functions

static Ptr Create (Agent *creator, double quantity, Composition::Ptr c)
static Ptr CreateUntracked (double quantity, Composition::Ptr c)

Static Public Attributes

static const ResourceType kType = "Material"

Protected Member Functions

 Material (Context *ctx, double quantity, Composition::Ptr c)

Member Typedef Documentation

◆ Ptr

typedef boost::shared_ptr<Material> cyclus::Material::Ptr

Definition at line 75 of file material.h.

Constructor & Destructor Documentation

◆ ~Material()

cyclus::Material::~Material ( )

Definition at line 15 of file

◆ Material()

cyclus::Material::Material ( Context ctx,
double  quantity,
Composition::Ptr  c 

Definition at line 221 of file

Member Function Documentation

◆ Absorb()

void cyclus::Material::Absorb ( Material::Ptr  mat)

Combines material mat with this one. mat's quantity becomes zero.

Definition at line 102 of file

◆ Clone()

Resource::Ptr cyclus::Material::Clone ( ) const

Creates an untracked copy of this material object.

Implements cyclus::Resource.

Definition at line 38 of file

◆ comp() [1/2]

Composition::Ptr cyclus::Material::comp ( )

Returns the nuclide composition of this material.

Definition at line 214 of file

◆ comp() [2/2]

Composition::Ptr cyclus::Material::comp ( ) const

DEPRECATED - use non-const comp() function.

Definition at line 209 of file

◆ Create()

Material::Ptr cyclus::Material::Create ( Agent creator,
double  quantity,
Composition::Ptr  c 

Creates a new material resource that is "live" and tracked.

creator is a pointer to the agent creating the resource (usually will be the caller's "this" pointer). All future output data recorded will be done using the creator's context.

Definition at line 17 of file

◆ CreateUntracked()

Material::Ptr cyclus::Material::CreateUntracked ( double  quantity,
Composition::Ptr  c 

Creates a new material resource that does not actually exist as part of the simulation and is untracked.

Definition at line 24 of file

◆ Decay()

void cyclus::Material::Decay ( int  curr_time)

Updates the material's composition by performing a decay calculation.

This is a special case of Transmute where the new composition is calculated automatically. The time delta is calculated as the difference between curr_time and the last time the material's composition was updated with a decay calculation (i.e. prev_decay_time). This may or may not result in an updated material composition. Does nothing if the simulation decay mode is set to "never" or none of the nuclides' decay constants are significant with respect to the time delta.

Definition at line 144 of file

◆ DecayHeat()

double cyclus::Material::DecayHeat ( )

Returns a double with the decay heat of the material in units of W/kg.

Definition at line 196 of file

◆ ExtractComp()

Material::Ptr cyclus::Material::ExtractComp ( double  qty,
Composition::Ptr  c,
double  threshold = eps_rsrc() 

Creates a new material by extracting from this one.

qtythe mass quantity to extract
cthe composition the extracted/returned material
thresholdan absolute mass cutoff below which constituent nuclide quantities of the remaining unextracted material are set to zero.
a new material with quantity qty and composition c

Definition at line 72 of file

◆ ExtractQty()

Material::Ptr cyclus::Material::ExtractQty ( double  qty)

Same as ExtractComp with c = this->comp().

Definition at line 68 of file

◆ ExtractRes()

Resource::Ptr cyclus::Material::ExtractRes ( double  quantity)

Splits the resource and returns the extracted portion as a new resource object.

Allows for things like ResBuf and Traders to split offers/requests of arbitrary resource implementation type.

a new resource object with same state id and quantity == quantity

Implements cyclus::Resource.

Definition at line 64 of file

◆ prev_decay_time()

int cyclus::Material::prev_decay_time ( )

Returns the last time step on which a decay calculation was performed for the material.

This is not necessarily synonymous with the last time step the material's Decay function was called.

Definition at line 144 of file material.h.

◆ qual_id()

int cyclus::Material::qual_id ( ) const

Returns the id of the material's internal nuclide composition.

Implements cyclus::Resource.

Definition at line 30 of file

◆ quantity()

double cyclus::Material::quantity ( ) const

Returns the mass of this material in kg.

Implements cyclus::Resource.

Definition at line 60 of file

◆ Record()

void cyclus::Material::Record ( Context ctx) const

Records the internal nuclide composition of this resource.

Implements cyclus::Resource.

Definition at line 45 of file

◆ Transmute()

void cyclus::Material::Transmute ( Composition::Ptr  c)

Changes the material's composition to c without changing its mass.

Use this method for things like converting fresh to spent fuel via burning in a reactor.

Definition at line 128 of file

◆ type()

const ResourceType cyclus::Material::type ( ) const

Returns Material::kType.

Implements cyclus::Resource.

Definition at line 34 of file

◆ units()

std::string cyclus::Material::units ( ) const

Returns "kg".

Implements cyclus::Resource.

Definition at line 56 of file

Member Data Documentation

◆ kType

const ResourceType cyclus::Material::kType = "Material"

Definition at line 76 of file material.h.

The documentation for this class was generated from the following files: