CYCLUS
|
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:
Definition at line 71 of file material.h.
#include <material.h>
Public Types | |
typedef boost::shared_ptr< Material > | Ptr |
Public Types inherited from cyclus::Resource | |
typedef boost::shared_ptr< Resource > | Ptr |
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) | |
typedef boost::shared_ptr<Material> cyclus::Material::Ptr |
Definition at line 75 of file material.h.
|
virtual |
Definition at line 15 of file material.cc.
|
protected |
Definition at line 221 of file material.cc.
void cyclus::Material::Absorb | ( | Material::Ptr | mat | ) |
Combines material mat with this one. mat's quantity becomes zero.
Definition at line 102 of file material.cc.
|
virtual |
Creates an untracked copy of this material object.
Implements cyclus::Resource.
Definition at line 38 of file material.cc.
Composition::Ptr cyclus::Material::comp | ( | ) |
Returns the nuclide composition of this material.
Definition at line 214 of file material.cc.
Composition::Ptr cyclus::Material::comp | ( | ) | const |
DEPRECATED - use non-const comp() function.
Definition at line 209 of file material.cc.
|
static |
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 material.cc.
|
static |
Creates a new material resource that does not actually exist as part of the simulation and is untracked.
Definition at line 24 of file material.cc.
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 material.cc.
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 material.cc.
Material::Ptr cyclus::Material::ExtractComp | ( | double | qty, |
Composition::Ptr | c, | ||
double | threshold = eps_rsrc() |
||
) |
Creates a new material by extracting from this one.
qty | the mass quantity to extract |
c | the composition the extracted/returned material |
threshold | an absolute mass cutoff below which constituent nuclide quantities of the remaining unextracted material are set to zero. |
Definition at line 72 of file material.cc.
Material::Ptr cyclus::Material::ExtractQty | ( | double | qty | ) |
Same as ExtractComp with c = this->comp().
Definition at line 68 of file material.cc.
|
virtual |
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.
Implements cyclus::Resource.
Definition at line 64 of file material.cc.
|
inline |
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.
|
virtual |
Returns the id of the material's internal nuclide composition.
Implements cyclus::Resource.
Definition at line 30 of file material.cc.
|
virtual |
Returns the mass of this material in kg.
Implements cyclus::Resource.
Definition at line 60 of file material.cc.
|
virtual |
Records the internal nuclide composition of this resource.
Implements cyclus::Resource.
Definition at line 45 of file material.cc.
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 material.cc.
|
virtual |
|
virtual |
|
static |
Definition at line 76 of file material.h.