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
10#include "cantera/base/AnyMap.h"
11
12namespace Cantera
13{
14
15class Species;
16class XML_Node;
17
18//! Base class for transport data for a single species
20{
21public:
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
37
38protected:
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.
47{
48public:
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.
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.
95
96 //! Pitzer's acentric factor [dimensionless]. Default 0.0.
98
99 //! dispersion normalized by e^2. [m^5] Default 0.0.
101
102 //! quadrupole. Default 0.0.
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.
110shared_ptr<TransportData> newTransportData(const XML_Node& transport_node);
111
112//! Create a new TransportData object from an AnyMap specification
113unique_ptr<TransportData> newTransportData(const AnyMap& node);
114
115}
116
117#endif
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Transport data for a single gas-phase species which can be used in mixture-averaged or multicomponent...
Definition: TransportData.h:47
double polarizability
The polarizability of the molecule [m^3]. Default 0.0.
Definition: TransportData.h:89
std::string geometry
A string specifying the molecular geometry.
Definition: TransportData.h:77
double diameter
The Lennard-Jones collision diameter [m].
Definition: TransportData.h:80
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.
Definition: TransportData.h:97
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...
Definition: TransportData.h:94
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.
Definition: TransportData.h:86
double well_depth
The Lennard-Jones well depth [J].
Definition: TransportData.h:83
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.
Definition: Species.h:26
Base class for transport data for a single species.
Definition: TransportData.h:20
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.
Definition: TransportData.h:36
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
This file contains definitions of constants, types and terms that are used in internal routines and a...
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
shared_ptr< TransportData > newTransportData(const XML_Node &transport_node)
Create a new TransportData object from a 'transport' XML_Node.