CYCLUS
Loading...
Searching...
No Matches
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:

Definition at line 71 of file material.h.

#include <material.h>

Inheritance diagram for cyclus::Material:
cyclus::Resource

Public Types

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

Public Member Functions

virtual void Absorb (Ptr mat)
 
virtual void ChangePackage (std::string new_package_name=Package::unpackaged_name())
 
virtual Resource::Ptr Clone () const
 
Composition::Ptr comp ()
 
Composition::Ptr comp () const
 
virtual void Decay (int curr_time=-1)
 
double DecayHeat ()
 
Ptr ExtractComp (double qty, Composition::Ptr c, double threshold=eps_rsrc())
 
Ptr ExtractQty (double qty)
 
virtual Resource::Ptr ExtractRes (double qty)
 
virtual std::string package_name ()
 
virtual Resource::Ptr PackageExtract (double qty, std::string new_package_name=Package::unpackaged_name())
 
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
virtual void Absorb (Ptr res)
 
void BumpStateId ()
 
const int obj_id () const
 
template<class T >
std::vector< typename T::Ptr > Package (Package::Ptr pkg)
 
 Resource ()
 
const int state_id () const
 
virtual ~Resource ()
 

Static Public Member Functions

static Ptr Create (Agent *creator, double quantity, Composition::Ptr c, std::string package_name=Package::unpackaged_name())
 
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, std::string package_name=Package::unpackaged_name())
 

Member Typedef Documentation

◆ Ptr

Definition at line 75 of file material.h.

Constructor & Destructor Documentation

◆ ~Material()

cyclus::Material::~Material ( )
virtual

Definition at line 15 of file material.cc.

◆ Material()

cyclus::Material::Material ( Context * ctx,
double quantity,
Composition::Ptr c,
std::string package_name = Package::unpackaged_name() )
protected

Definition at line 263 of file material.cc.

Member Function Documentation

◆ Absorb()

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

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

Definition at line 101 of file material.cc.

◆ ChangePackage()

void cyclus::Material::ChangePackage ( std::string new_package_name = Package::unpackaged_name())
virtual

Changes the package id.

Checks that the resource fits the package type minimum and maximum mass criteria.

Reimplemented from cyclus::Resource.

Definition at line 164 of file material.cc.

◆ Clone()

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

Creates an untracked copy of this material object.

Implements cyclus::Resource.

Definition at line 38 of file material.cc.

◆ comp() [1/2]

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

Returns the nuclide composition of this material.

Definition at line 256 of file material.cc.

◆ comp() [2/2]

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

DEPRECATED - use non-const comp() function.

Definition at line 251 of file material.cc.

◆ Create()

Material::Ptr cyclus::Material::Create ( Agent * creator,
double quantity,
Composition::Ptr c,
std::string package_name = Package::unpackaged_name() )
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.

◆ CreateUntracked()

Material::Ptr cyclus::Material::CreateUntracked ( double quantity,
Composition::Ptr c )
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.

◆ Decay()

void cyclus::Material::Decay ( int curr_time = -1)
virtual

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.

Parameters
curr_timecurrent time to use for the decay calculation (default: -1 forces the decay to the context's current time)

Reimplemented from cyclus::Resource.

Definition at line 186 of file material.cc.

◆ DecayHeat()

double cyclus::Material::DecayHeat ( )

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

Definition at line 238 of file material.cc.

◆ ExtractComp()

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

Creates a new material by extracting from this one.

Parameters
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.
Returns
a new material with quantity qty and composition c

Definition at line 72 of file material.cc.

◆ ExtractQty()

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

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

Definition at line 68 of file material.cc.

◆ ExtractRes()

Resource::Ptr cyclus::Material::ExtractRes ( double quantity)
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.

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

Implements cyclus::Resource.

Definition at line 64 of file material.cc.

◆ package_name()

std::string cyclus::Material::package_name ( )
virtual

Returns the package id.

Reimplemented from cyclus::Resource.

Definition at line 282 of file material.cc.

◆ PackageExtract()

Resource::Ptr cyclus::Material::PackageExtract ( double qty,
std::string new_package_name = Package::unpackaged_name() )
virtual

Implements cyclus::Resource.

Definition at line 143 of file material.cc.

◆ prev_decay_time()

int cyclus::Material::prev_decay_time ( )
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 147 of file material.h.

◆ qual_id()

int cyclus::Material::qual_id ( ) const
virtual

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

Implements cyclus::Resource.

Definition at line 30 of file material.cc.

◆ quantity()

double cyclus::Material::quantity ( ) const
virtual

Returns the mass of this material in kg.

Implements cyclus::Resource.

Definition at line 60 of file material.cc.

◆ Record()

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

Records the internal nuclide composition of this resource.

Implements cyclus::Resource.

Definition at line 45 of file material.cc.

◆ 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 127 of file material.cc.

◆ type()

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

Returns Material::kType.

Implements cyclus::Resource.

Definition at line 34 of file material.cc.

◆ units()

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

Returns "kg".

Implements cyclus::Resource.

Definition at line 56 of file material.cc.

Member Data Documentation

◆ kType

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

Definition at line 76 of file material.h.


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