Cantera 2.6.0

TransportData.h
Go to the documentation of this file.
1//! @file TransportData.h
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#ifndef CT_TRANSPORTDATA_H
7#define CT_TRANSPORTDATA_H
8
9#include "cantera/base/ct_defs.h"
10#include "cantera/base/AnyMap.h"
11
12 namespace Cantera
13{
14
15 class Species;
16 class XML_Node;
17
18//! Base class for transport data for a single species
19 class TransportData
20{
21 public:
22 TransportData() {}
23 virtual ~TransportData() {}
24
25 virtual void validate(const Species& species) {}
26
27 //! Return the parameters such that an identical species transport object
28 //! could be reconstructed using the newTransportData() function. Behavior
29 //! specific to derived classes is handled by the getParameters() method.
30 //! @param withInput If true, include additional input data fields associated
31 //! with the object, such as user-defined fields from a YAML input file, as
32 //! stored in the #input attribute.
33 AnyMap parameters(bool withInput) const;
34
35 //! Input data used for specific models
36 AnyMap input;
37
38 protected:
39 //! Store the parameters needed to reconstruct a TransportData object. Does
40 //! not include user-defined fields available in #input.
41 virtual void getParameters(AnyMap& transportNode) const;
42};
43
44//! Transport data for a single gas-phase species which can be used in
45//! mixture-averaged or multicomponent transport models.
46 class GasTransportData : public TransportData
47{
48 public:
49 GasTransportData();
50
51 //! Construct a GasTransportData object using MKS units for all parameters.
52 GasTransportData(const std::string& geometry, double diameter,
53 double well_depth, double dipole=0.0,
54 double polarizability=0.0, double rot_relax=0.0,
55 double acentric=0.0, double dispersion=0.0,
56 double quad_polar=0.0);
57
58 //! Set the parameters using "customary" units: diameter in Angstroms, well
59 //! depth in Kelvin, dipole in Debye, and polarizability in Angstroms^3.
60 //! These are the units used in in CK-style input files.
61 void setCustomaryUnits(const std::string& geometry, double diameter,
62 double well_depth, double dipole=0.0,
63 double polarizability=0.0, double rot_relax=0.0,
64 double acentric=0.0, double dispersion=0.0,
65 double quad_polar=0.0);
66
67 //! Check transport data for invalid parameters such as a geometry
68 //! inconsistent with the atomic composition, non-positive diameter, or
69 //! negative values for well depth, dipole, polarizability, or
70 //! rotational relaxation number.
71 virtual void validate(const Species& species);
72
73 virtual void getParameters(AnyMap& transportNode) const;
74
75 //! A string specifying the molecular geometry. One of `atom`, `linear`, or
76 //! `nonlinear`.
77 std::string geometry;
78
79 //! The Lennard-Jones collision diameter [m]
80 double diameter;
81
82 //! The Lennard-Jones well depth [J]
83 double well_depth;
84
85 //! The permanent dipole moment of the molecule [Coulomb-m]. Default 0.0.
86 double dipole;
87
88 //! The polarizability of the molecule [m^3]. Default 0.0.
89 double polarizability;
90
91 //! The rotational relaxation number (the number of collisions it takes to
92 //! equilibrate the rotational degrees of freedom with the temperature).
93 //! Default 0.0.
94 double rotational_relaxation;
95
96 //! Pitzer's acentric factor [dimensionless]. Default 0.0.
97 double acentric_factor;
98
99 //! dispersion normalized by e^2. [m^5] Default 0.0.
100 double dispersion_coefficient;
101
102 //! quadrupole. Default 0.0.
103 double quadrupole_polarizability;
104};
105
106//! Create a new TransportData object from a 'transport' XML_Node.
107//!
108//! @deprecated The XML input format is deprecated and will be removed in
109//! Cantera 3.0.
110 shared_ptr<TransportData> newTransportData(const XML_Node& transport_node);
111
112//! Create a new TransportData object from an AnyMap specification
113 unique_ptr<TransportData> newTransportData(const AnyMap& node);
114
115}
116
117#endif
AnyMap.h
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Cantera::GasTransportData
Transport data for a single gas-phase species which can be used in mixture-averaged or multicomponent...
Definition: TransportData.h:47
Cantera::GasTransportData::polarizability
double polarizability
The polarizability of the molecule [m^3]. Default 0.0.
Definition: TransportData.h:89
Cantera::GasTransportData::geometry
std::string geometry
A string specifying the molecular geometry.
Definition: TransportData.h:77
Cantera::GasTransportData::diameter
double diameter
The Lennard-Jones collision diameter [m].
Definition: TransportData.h:80
Cantera::GasTransportData::setCustomaryUnits
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,...
Definition: TransportData.cpp:60
Cantera::GasTransportData::getParameters
virtual void getParameters(AnyMap &transportNode) const
Store the parameters needed to reconstruct a TransportData object.
Definition: TransportData.cpp:145
Cantera::GasTransportData::acentric_factor
double acentric_factor
Pitzer's acentric factor [dimensionless]. Default 0.0.
Definition: TransportData.h:97
Cantera::GasTransportData::quadrupole_polarizability
double quadrupole_polarizability
quadrupole. Default 0.0.
Definition: TransportData.h:103
Cantera::GasTransportData::rotational_relaxation
double rotational_relaxation
The rotational relaxation number (the number of collisions it takes to equilibrate the rotational deg...
Definition: TransportData.h:94
Cantera::GasTransportData::dispersion_coefficient
double dispersion_coefficient
dispersion normalized by e^2. [m^5] Default 0.0.
Definition: TransportData.h:100
Cantera::GasTransportData::dipole
double dipole
The permanent dipole moment of the molecule [Coulomb-m]. Default 0.0.
Definition: TransportData.h:86
Cantera::GasTransportData::well_depth
double well_depth
The Lennard-Jones well depth [J].
Definition: TransportData.h:83
Cantera::GasTransportData::validate
virtual void validate(const Species &species)
Check transport data for invalid parameters such as a geometry inconsistent with the atomic compositi...
Definition: TransportData.cpp:77
Cantera::Species
Contains data about a single chemical species.
Definition: Species.h:26
Cantera::TransportData
Base class for transport data for a single species.
Definition: TransportData.h:20
Cantera::TransportData::parameters
AnyMap parameters(bool withInput) const
Return the parameters such that an identical species transport object could be reconstructed using th...
Definition: TransportData.cpp:17
Cantera::TransportData::getParameters
virtual void getParameters(AnyMap &transportNode) const
Store the parameters needed to reconstruct a TransportData object.
Definition: TransportData.cpp:27
Cantera::TransportData::input
AnyMap input
Input data used for specific models.
Definition: TransportData.h:36
Cantera::XML_Node
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
ct_defs.h
This file contains definitions of constants, types and terms that are used in internal routines and a...
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::newTransportData
shared_ptr< TransportData > newTransportData(const XML_Node &transport_node)
Create a new TransportData object from a 'transport' XML_Node.
Definition: TransportData.cpp:223