Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
chemistry::UnitSystem Class Reference

Default units of a YAML file (its units: map; Cantera's defaults otherwise) and conversion of values to Mallard's units: SI with quantities in kmol, as Cantera uses internally. More...

#include <units.h>

Public Member Functions

 UnitSystem ()=default
 
 UnitSystem (const YAML::Node &units)
 Defaults from a units: map; keys not given keep Cantera's defaults.
 
double convert (const YAML::Node &value, const Dimension &dimension, const std::string &what) const
 Value of a node in SI (kmol) units.
 
double convert_activation_energy (const YAML::Node &value, const std::string &what) const
 Activation energy divided by the gas constant, in K: a temperature, a molar energy or an energy per molecule.
 

Detailed Description

Default units of a YAML file (its units: map; Cantera's defaults otherwise) and conversion of values to Mallard's units: SI with quantities in kmol, as Cantera uses internally.

A value is a number in the default units or a string "<number> <units>", with units a product of known units and their SI prefixes, each optionally raised to a power, joined by '*' and '/' (e.g. "cm^3/mol/s", "kJ/mol").

Constructor & Destructor Documentation

◆ UnitSystem() [1/2]

chemistry::UnitSystem::UnitSystem ( )
default

◆ UnitSystem() [2/2]

chemistry::UnitSystem::UnitSystem ( const YAML::Node &  units)
explicit

Defaults from a units: map; keys not given keep Cantera's defaults.

Member Function Documentation

◆ convert()

double chemistry::UnitSystem::convert ( const YAML::Node &  value,
const Dimension &  dimension,
const std::string &  what 
) const

Value of a node in SI (kmol) units.

Parameters
valueNumber or "<number> <units>" string.
dimensionDimension of the value, for numbers in default units and to check the units of strings.
whatDescription of the value for error messages.

◆ convert_activation_energy()

double chemistry::UnitSystem::convert_activation_energy ( const YAML::Node &  value,
const std::string &  what 
) const

Activation energy divided by the gas constant, in K: a temperature, a molar energy or an energy per molecule.


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