Cantera  3.1.0b1
Loading...
Searching...
No Matches
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;
16
17//! Base class for transport data for a single species
19{
20public:
21 TransportData() = default;
22 virtual ~TransportData() = default;
23
24 virtual void validate(const Species& species) {}
25
26 //! Return the parameters such that an identical species transport object
27 //! could be reconstructed using the newTransportData() function. Behavior
28 //! specific to derived classes is handled by the getParameters() method.
29 //! @param withInput If true, include additional input data fields associated
30 //! with the object, such as user-defined fields from a YAML input file, as
31 //! stored in the #input attribute.
32 AnyMap parameters(bool withInput) const;
33
34 //! Input data used for specific models
36
37protected:
38 //! Store the parameters needed to reconstruct a TransportData object. Does
39 //! not include user-defined fields available in #input.
40 virtual void getParameters(AnyMap& transportNode) const;
41};
42
43//! Transport data for a single gas-phase species which can be used in
44//! mixture-averaged or multicomponent transport models.
46{
47public:
48 GasTransportData() = default;
49
50 //! Construct a GasTransportData object using MKS units for all parameters.
51 GasTransportData(const string& geometry, double diameter,
52 double well_depth, double dipole=0.0,
53 double polarizability=0.0, double rot_relax=0.0,
54 double acentric=0.0, double dispersion=0.0,
55 double quad_polar=0.0);
56
57 //! Set the parameters using "customary" units: diameter in Angstroms, well
58 //! depth in Kelvin, dipole in Debye, and polarizability in Angstroms^3.
59 //! These are the units used in in CK-style input files.
60 void setCustomaryUnits(const string& geometry, double diameter,
61 double well_depth, double dipole=0.0,
62 double polarizability=0.0, double rot_relax=0.0,
63 double acentric=0.0, double dispersion=0.0,
64 double quad_polar=0.0);
65
66 //! Check transport data for invalid parameters such as a geometry
67 //! inconsistent with the atomic composition, non-positive diameter, or
68 //! negative values for well depth, dipole, polarizability, or
69 //! rotational relaxation number.
70 void validate(const Species& species) override;
71
72 void getParameters(AnyMap& transportNode) const override;
73
74 //! A string specifying the molecular geometry. One of `atom`, `linear`, or
75 //! `nonlinear`.
76 string geometry;
77
78 //! The Lennard-Jones collision diameter [m]
79 double diameter = 0.0;
80
81 //! The Lennard-Jones well depth [J]
82 double well_depth = 0.0;
83
84 //! The permanent dipole moment of the molecule [Coulomb-m]. Default 0.0.
85 double dipole = 0.0;
86
87 //! The polarizability of the molecule [m^3]. Default 0.0.
88 double polarizability = 0.0;
89
90 //! The rotational relaxation number (the number of collisions it takes to
91 //! equilibrate the rotational degrees of freedom with the temperature).
92 //! Default 0.0.
94
95 //! Pitzer's acentric factor [dimensionless]. Default 0.0.
96 double acentric_factor = 0.0;
97
98 //! dispersion normalized by e^2. [m^5] Default 0.0.
100
101 //! quadrupole. Default 0.0.
103};
104
105//! Create a new TransportData object from an AnyMap specification
106unique_ptr<TransportData> newTransportData(const AnyMap& node);
107
108}
109
110#endif
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
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.
Definition Species.h:25
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.
This file contains definitions of constants, types and terms that are used in internal routines and a...
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
unique_ptr< TransportData > newTransportData(const AnyMap &node)
Create a new TransportData object from an AnyMap specification.