31GasTransportData::GasTransportData()
36 , rotational_relaxation(0.0)
37 , acentric_factor(0.0)
38 , dispersion_coefficient(0.0)
39 , quadrupole_polarizability(0.0)
43GasTransportData::GasTransportData(
44 const std::string& geometry_,
45 double diameter_,
double well_depth_,
double dipole_,
46 double polarizability_,
double rot_relax,
double acentric,
47 double dispersion,
double quad_polar)
50 , well_depth(well_depth_)
52 , polarizability(polarizability_)
53 , rotational_relaxation(rot_relax)
54 , acentric_factor(acentric)
55 , dispersion_coefficient(dispersion)
56 , quadrupole_polarizability(quad_polar)
61 const std::string& geometry_,
62 double diameter_,
double well_depth_,
double dipole_,
63 double polarizability_,
double rot_relax,
double acentric,
64 double dispersion,
double quad_polar)
82 nAtoms += elem.second;
89 "invalid geometry for species '{}'. 'atom' specified, but "
90 "species contains multiple atoms.", sp.
name);
95 "invalid geometry for species '{}'. 'linear' specified, but "
96 "species does not contain multiple atoms.", sp.
name);
98 }
else if (
geometry ==
"nonlinear") {
101 "invalid geometry for species '{}'. 'nonlinear' specified, but "
102 "species only contains {} atoms.", sp.
name, nAtoms);
106 "invalid geometry for species '{}': '{}'.", sp.
name,
geometry);
111 "negative well depth for species '{}'.", sp.
name);
116 "negative or zero diameter for species '{}'.", sp.
name);
121 "negative dipole moment for species '{}'.", sp.
name);
126 "negative polarizability for species '{}'.", sp.
name);
131 "negative rotation relaxation number for species '{}'.", sp.
name);
136 "negative dispersion coefficient for species '{}'.", sp.
name);
141 "negative quadrupole polarizability for species '{}'.", sp.
name);
148 transportNode[
"model"] =
"gas";
149 transportNode[
"geometry"] =
geometry;
150 transportNode[
"diameter"] =
diameter * 1e10;
178 std::string geometry, dummy;
179 getString(tr_node,
"geometry", geometry, dummy);
181 double diam =
getFloat(tr_node,
"LJ_diameter");
182 double welldepth =
getFloat(tr_node,
"LJ_welldepth");
192 double acentric = 0.0;
195 double dispersion = 0.0;
202 rot, acentric, dispersion, quad);
205void setupGasTransportData(GasTransportData& tr,
const AnyMap& node)
207 std::string geometry = node[
"geometry"].asString();
208 double welldepth = node[
"well-depth"].asDouble();
209 double diameter = node[
"diameter"].asDouble();
210 double dipole = node.getDouble(
"dipole", 0.0);
211 double polar = node.getDouble(
"polarizability", 0.0);
212 double rot = node.getDouble(
"rotational-relaxation", 0.0);
213 double acentric = node.getDouble(
"acentric-factor", 0.0);
214 double dispersion = node.getDouble(
"dispersion-coefficient", 0.0);
215 double quad = node.getDouble(
"quadrupole-polarizability", 0.0);
217 tr.setCustomaryUnits(geometry, diameter, welldepth, dipole, polar,
218 rot, acentric, dispersion, quad);
225 std::string model = transport_node[
"model"];
226 if (model ==
"gas_transport") {
227 auto tr = make_shared<GasTransportData>();
228 setupGasTransportData(*tr, transport_node);
232 return make_shared<TransportData>();
238 if (node.
getString(
"model",
"") ==
"gas") {
240 setupGasTransportData(*tr, node);
241 return unique_ptr<TransportData>(move(tr));
Declaration for class Cantera::Species.
A map of string keys to values whose type can vary at runtime.
const std::string & getString(const std::string &key, const std::string &default_) const
If key exists, return it as a string, otherwise return default_.
void update(const AnyMap &other, bool keepExisting=true)
Add items from other to this AnyMap.
Base class for exceptions thrown by Cantera classes.
Transport data for a single gas-phase species which can be used in mixture-averaged or multicomponent...
double polarizability
The polarizability of the molecule [m^3]. Default 0.0.
std::string geometry
A string specifying the molecular geometry.
double diameter
The Lennard-Jones collision diameter [m].
void setCustomaryUnits(const std::string &geometry, double diameter, double well_depth, double dipole=0.0, double polarizability=0.0, double rot_relax=0.0, double acentric=0.0, double dispersion=0.0, double quad_polar=0.0)
Set the parameters using "customary" units: diameter in Angstroms, well depth in Kelvin,...
virtual void getParameters(AnyMap &transportNode) const
Store the parameters needed to reconstruct a TransportData object.
double acentric_factor
Pitzer's acentric factor [dimensionless]. Default 0.0.
double quadrupole_polarizability
quadrupole. Default 0.0.
double rotational_relaxation
The rotational relaxation number (the number of collisions it takes to equilibrate the rotational deg...
double dispersion_coefficient
dispersion normalized by e^2. [m^5] Default 0.0.
double dipole
The permanent dipole moment of the molecule [Coulomb-m]. Default 0.0.
double well_depth
The Lennard-Jones well depth [J].
virtual void validate(const Species &species)
Check transport data for invalid parameters such as a geometry inconsistent with the atomic compositi...
Contains data about a single chemical species.
compositionMap composition
The elemental composition of the species.
std::string name
The name of the species.
Base class for transport data for a single species.
AnyMap parameters(bool withInput) const
Return the parameters such that an identical species transport object could be reconstructed using th...
virtual void getParameters(AnyMap &transportNode) const
Store the parameters needed to reconstruct a TransportData object.
AnyMap input
Input data used for specific models.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
Namespace for the Cantera kernel.
void getString(const XML_Node &node, const std::string &titleString, std::string &valueString, std::string &typeString)
This function reads a child node with the name string with a specific title attribute named titleStri...
const double Boltzmann
Boltzmann constant [J/K].
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type="")
Get a floating-point value from a child element.
bool getOptionalFloat(const XML_Node &parent, const std::string &name, doublereal &fltRtn, const std::string &type="")
Get an optional floating-point value from a child element.
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
const double lightSpeed
Speed of Light in a vacuum [m/s].
shared_ptr< TransportData > newTransportData(const XML_Node &transport_node)
Create a new TransportData object from a 'transport' XML_Node.
Contains declarations for string manipulation functions within Cantera.