Go to the documentation of this file.
16 GasTransportData::GasTransportData()
21 , rotational_relaxation(0.0)
22 , acentric_factor(0.0)
23 , dispersion_coefficient(0.0)
24 , quadrupole_polarizability(0.0)
28 GasTransportData::GasTransportData(
29 const std::string& geometry_,
30 double diameter_,
double well_depth_,
double dipole_,
31 double polarizability_,
double rot_relax,
double acentric,
32 double dispersion,
double quad_polar)
35 , well_depth(well_depth_)
37 , polarizability(polarizability_)
38 , rotational_relaxation(rot_relax)
39 , acentric_factor(acentric)
40 , dispersion_coefficient(dispersion)
41 , quadrupole_polarizability(quad_polar)
46 const std::string& geometry_,
47 double diameter_,
double well_depth_,
double dipole_,
48 double polarizability_,
double rot_relax,
double acentric,
49 double dispersion,
double quad_polar)
67 nAtoms += elem.second;
74 "invalid geometry for species '{}'. 'atom' specified, but "
75 "species contains multiple atoms.", sp.
name);
80 "invalid geometry for species '{}'. 'linear' specified, but "
81 "species does not contain multiple atoms.", sp.
name);
83 }
else if (
geometry ==
"nonlinear") {
86 "invalid geometry for species '{}'. 'nonlinear' specified, but "
87 "species only contains {} atoms.", sp.
name, nAtoms);
91 "invalid geometry for species '{}': '{}'.", sp.
name,
geometry);
96 "negative well depth for species '{}'.", sp.
name);
101 "negative or zero diameter for species '{}'.", sp.
name);
106 "negative dipole moment for species '{}'.", sp.
name);
111 "negative polarizability for species '{}'.", sp.
name);
116 "negative rotation relaxation number for species '{}'.", sp.
name);
121 "negative dispersion coefficient for species '{}'.", sp.
name);
126 "negative quadrupole polarizability for species '{}'.", sp.
name);
132 std::string geometry, dummy;
133 getString(tr_node,
"geometry", geometry, dummy);
135 double diam =
getFloat(tr_node,
"LJ_diameter");
136 double welldepth =
getFloat(tr_node,
"LJ_welldepth");
146 double acentric = 0.0;
149 double dispersion = 0.0;
156 rot, acentric, dispersion, quad);
159 void setupGasTransportData(GasTransportData& tr,
const AnyMap& node)
161 std::string geometry = node[
"geometry"].asString();
162 double welldepth = node[
"well-depth"].asDouble();
163 double diameter = node[
"diameter"].asDouble();
164 double dipole = node.getDouble(
"dipole", 0.0);
165 double polar = node.getDouble(
"polarizability", 0.0);
166 double rot = node.getDouble(
"rotational-relaxation", 0.0);
167 double acentric = node.getDouble(
"acentric-factor", 0.0);
168 double dispersion = node.getDouble(
"dispersion-coefficient", 0.0);
169 double quad = node.getDouble(
"quadrupole-polarizability", 0.0);
171 tr.setCustomaryUnits(geometry, diameter, welldepth, dipole, polar,
172 rot, acentric, dispersion, quad);
179 std::string model = transport_node[
"model"];
180 if (model ==
"gas_transport") {
181 auto tr = make_shared<GasTransportData>();
182 setupGasTransportData(*tr, transport_node);
186 return make_shared<TransportData>();
192 if (node.
getString(
"model",
"") ==
"gas") {
194 setupGasTransportData(*tr, node);
195 return unique_ptr<TransportData>(move(tr));
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.
const double Boltzmann
Boltzmann constant [J/K].
double polarizability
The polarizability of the molecule [m^3]. Default 0.0.
double diameter
The Lennard-Jones collision diameter [m].
double dispersion_coefficient
dispersion normalized by e^2. [m^5] Default 0.0.
Base class for transport data for a single species.
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,...
double dipole
The permanent dipole moment of the molecule [Coulomb-m]. Default 0.0.
compositionMap composition
The elemental composition of the species.
std::string geometry
A string specifying the molecular geometry.
double rotational_relaxation
The rotational relaxation number (the number of collisions it takes to equilibrate the rotational deg...
double acentric_factor
Pitzer's acentric factor [dimensionless]. Default 0.0.
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 lightSpeed
Speed of Light in a vacuum [m/s].
Class XML_Node is a tree-based representation of the contents of an XML file.
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
std::string name
The name of the species.
double well_depth
The Lennard-Jones well depth [J].
double quadrupole_polarizability
quadrupole. Default 0.0.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Contains data about a single chemical species.
A map of string keys to values whose type can vary at runtime.
Transport data for a single gas-phase species which can be used in mixture-averaged or multicomponent...
Base class for exceptions thrown by Cantera classes.
shared_ptr< TransportData > newTransportData(const XML_Node &transport_node)
Create a new TransportData object from a 'transport' XML_Node.
Namespace for the Cantera kernel.
virtual void validate(const Species &species)
Check transport data for invalid parameters such as a geometry inconsistent with the atomic compositi...
const std::string & getString(const std::string &key, const std::string &default_) const
If key exists, return it as a string, otherwise return default_.