28GasTransportData::GasTransportData(
29 const 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 string& geometry_,
47 double diameter_,
double well_depth_,
double dipole_,
48 double polarizability_,
double rot_relax,
double acentric,
49 double dispersion,
double quad_polar)
65 for (
const auto& [eName, stoich] : sp.
composition) {
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);
133 transportNode[
"model"] =
"gas";
134 transportNode[
"geometry"] =
geometry;
135 transportNode[
"diameter"] =
diameter * 1e10;
163 string geometry = node[
"geometry"].asString();
164 double welldepth = node[
"well-depth"].asDouble();
165 double diameter = node[
"diameter"].asDouble();
166 double dipole = node.
getDouble(
"dipole", 0.0);
167 double polar = node.
getDouble(
"polarizability", 0.0);
168 double rot = node.
getDouble(
"rotational-relaxation", 0.0);
169 double acentric = node.
getDouble(
"acentric-factor", 0.0);
170 double dispersion = node.
getDouble(
"dispersion-coefficient", 0.0);
171 double quad = node.
getDouble(
"quadrupole-polarizability", 0.0);
174 rot, acentric, dispersion, quad);
181 if (node.
getString(
"model",
"") ==
"gas") {
182 auto tr = make_unique<GasTransportData>();
183 setupGasTransportData(*tr, node);
187 auto tr = make_unique<TransportData>();
Declaration for class Cantera::Species.
A map of string keys to values whose type can vary at runtime.
double getDouble(const string &key, double default_) const
If key exists, return it as a double, otherwise return default_.
const string & getString(const string &key, const 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.
double diameter
The Lennard-Jones collision diameter [m].
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.
void getParameters(AnyMap &transportNode) const override
Store the parameters needed to reconstruct a TransportData object.
double well_depth
The Lennard-Jones well depth [J].
void setCustomaryUnits(const 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,...
void validate(const Species &species) override
Check transport data for invalid parameters such as a geometry inconsistent with the atomic compositi...
string geometry
A string specifying the molecular geometry.
Contains data about a single chemical species.
Composition composition
The elemental composition of the species.
string name
The name of the 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.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
bool caseInsensitiveEquals(const string &input, const string &test)
Case insensitive equality predicate.
const double Boltzmann
Boltzmann constant [J/K].
const double lightSpeed
Speed of Light in a vacuum [m/s].
Namespace for the Cantera kernel.
unique_ptr< TransportData > newTransportData(const AnyMap &node)
Create a new TransportData object from an AnyMap specification.
Contains declarations for string manipulation functions within Cantera.