Class ThermochemistryVariable

Inheritance Relationships

Base Type

Class Documentation

class ThermochemistryVariable : public SciantixVariable

A specialized variable class that extends SciantixVariable with the additional physical attributes needed by the thermochemistry module: manifest index, chemical state and location, phase composition, and theoretical density.

Value bookkeeping (UOM, initial/final values, rescaling, output flag) is inherited from SciantixVariable rather than reimplemented here.

Author

E. Cappellari

Public Functions

inline ThermochemistryVariable(int index, std::string name, std::string uom, double initial_value, double final_value, std::string phase, std::string location, bool output, double theoretical_density = 0.0)
inline void setIndex(int i)
inline int getIndex()
void setLocation(std::string loc)

Sets the location for this variable.

Parameters:

loc – The string representing the location.

std::string getLocation()

Retrieves the location of the compounds.

Returns:

The unit compound location as a string.

void setPhase(std::string ph)

Sets the phase for this variable.

Parameters:

ph – The string representing the phase of the compound.

std::string getPhase()

Retrieves the compound phase.

Returns:

The phase as a string.

void setComposition(std::map<std::string, double> composition_map)

Sets the dynamic composition for the compound from thermochemistry outputs.

Parameters:

composition_map – The map representing composition ratios per element.

std::map<std::string, double> getComposition()

Retrieves the dynamic composition of the compound.

Returns:

The composition as a map.

void setSublatticeComposition(std::map<int, std::map<std::string, double>> composition_map)

Sets the dynamic constituent fractions by sublattice.

Parameters:

composition_map – The map from sublattice index to constituent fractions.

std::map<int, std::map<std::string, double>> getSublatticeComposition()

Retrieves the dynamic constituent fractions by sublattice.

Returns:

The sublattice composition map.

double getMolarMass()

Calculates the molar mass from the compound stoichiometry.

Returns:

The molar mass in g/mol.

double getMass()

Retrieves the tracked mass stored in the variable.

Returns:

The mass concentration in g/m3.

inline void setTheoreticalDensity(double density)

Sets the theoretical (crystallographic) density of the compound.

Parameters:

density – The theoretical density in g/m3.

inline double getTheoreticalDensity()

Retrieves the theoretical (crystallographic) density of the compound.

Returns:

The theoretical density in g/m3, or 0.0 if not provided in the manifest.

inline ThermochemistryVariable()

Constructor.

inline ~ThermochemistryVariable()

Destructor.

Protected Attributes

int index
std::string location
std::string phase
std::map<std::string, double> composition
std::map<int, std::map<std::string, double>> sublattice_composition
double theoretical_density