23 TransportFactory* TransportFactory::s_factory = 0;
26 std::mutex TransportFactory::transport_mutex;
39 CanteraError(
"getTransportData",
"error reading transport data: " + msg +
"\n") {
41 "Unused. To be removed after Cantera 2.5.");
47 TransportFactory::TransportFactory()
49 reg(
"", []() {
return new Transport(); });
52 addAlias(
"unity-Lewis-number",
"UnityLewis");
53 reg(
"mixture-averaged", []() {
return new MixTransport(); });
54 addAlias(
"mixture-averaged",
"Mix");
55 reg(
"mixture-averaged-CK", []() {
return new MixTransport(); });
56 addAlias(
"mixture-averaged-CK",
"CK_Mix");
58 addAlias(
"multicomponent",
"Multi");
60 addAlias(
"multicomponent-CK",
"CK_Multi");
62 addAlias(
"ionized-gas",
"Ion");
64 addAlias(
"water",
"Water");
66 addAlias(
"high-pressure",
"HighP");
67 m_CK_mode[
"CK_Mix"] = m_CK_mode[
"mixture-averaged-CK"] =
true;
68 m_CK_mode[
"CK_Multi"] = m_CK_mode[
"multicomponent-CK"] =
true;
71 void TransportFactory::deleteFactory()
73 std::unique_lock<std::mutex> transportLock(transport_mutex);
78 Transport* TransportFactory::newTransport(
const std::string& transportModel,
79 thermo_t* phase,
int log_level,
int ndim)
82 warn_deprecated(
"TransportFactory::newTransport",
"The 'ndim' parameter"
83 " is unused and will be removed after Cantera 2.5.");
89 if (transportModel ==
"DustyGas") {
92 gastr->
init(phase, 0, log_level);
96 tr = create(transportModel);
97 int mode = m_CK_mode[transportModel] ? CK_Mode : 0;
98 tr->
init(phase, mode, log_level);
106 std::string transportModel =
"None";
109 if (input.
hasKey(
"transport")) {
110 transportModel = input[
"transport"].asString();
111 }
else if (phaseNode.
hasChild(
"transport")) {
112 transportModel = phaseNode.
child(
"transport").
attrib(
"model");
114 return newTransport(transportModel, phase,log_level);
120 return f->
newTransport(transportModel, thermo, loglevel, ndim);
125 return TransportFactory::factory()->newTransport(thermo, loglevel);
Headers for the DustyGasTransport object, which models transport properties in porous media using the...
Interface for class HighPressureGasTransport.
Headers for the MixTransport object, which models transport properties in ideal gas solutions using a...
Interface for class MultiTransport.
Header file defining class TransportFactory (see TransportFactory)
Headers for the UnityLewisTransport object, which models transport properties in ideal gas solutions ...
Header file defining class WaterTransport.
A map of string keys to values whose type can vary at runtime.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Base class for exceptions thrown by Cantera classes.
Class DustyGasTransport implements the Dusty Gas model for transport in porous media.
void initialize(ThermoPhase *phase, Transport *gastr)
Initialization routine called by TransportFactory.
Class MultiTransport implements transport properties for high pressure gas mixtures.
Class IonGasTransport implements Stockmayer-(n,6,4) model for transport of ions.
Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures.
Class MultiTransport implements multicomponent transport properties for ideal gas mixtures.
XML_Node & xml() const
Returns a const reference to the XML_Node that describes the phase.
void saveState(vector_fp &state) const
Save the current internal state of the phase.
void restoreState(const vector_fp &state)
Restore a state saved on a previous call to saveState.
Base class for a phase with thermodynamic properties.
const AnyMap & input() const
Access input data associated with the phase description.
Exception thrown if an error is encountered while reading the transport database.
TransportDBError(size_t linenum, const std::string &msg)
Default constructor.
Factory class for creating new instances of classes derived from Transport.
virtual Transport * newTransport(const std::string &model, thermo_t *thermo, int log_level=0, int ndim=-99)
Build a new transport manager using a transport manager that may not be the same as in the phase desc...
Base class for transport property managers.
virtual void init(thermo_t *thermo, int mode=0, int log_level=0)
Initialize a transport manager.
Class UnityLewisTransport implements the unity Lewis number approximation for the mixture-averaged sp...
Transport Parameters for pure water.
Class XML_Node is a tree-based representation of the contents of an XML file.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Transport * newDefaultTransportMgr(thermo_t *thermo, int loglevel)
Create a new transport manager instance.
Namespace for the Cantera kernel.
Transport * newTransportMgr(const std::string &transportModel, thermo_t *thermo, int loglevel, int ndim)
Build a new transport manager using a transport manager that may not be the same as in the phase desc...
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...