Go to the documentation of this file.
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);
void initialize(ThermoPhase *phase, Transport *gastr)
Initialization routine called by TransportFactory.
XML_Node & xml() const
Returns a const reference to the XML_Node that describes the phase.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
Factory class for creating new instances of classes derived from Transport.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Class MultiTransport implements transport properties for high pressure gas mixtures.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
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...
Class UnityLewisTransport implements the unity Lewis number approximation for the mixture-averaged sp...
Class IonGasTransport implements Stockmayer-(n,6,4) model for transport of ions.
Class MultiTransport implements multicomponent transport properties for ideal gas mixtures.
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...
TransportDBError(size_t linenum, const std::string &msg)
Default constructor.
const AnyMap & input() const
Access input data associated with the phase description.
Transport Parameters for pure water.
virtual void init(thermo_t *thermo, int mode=0, int log_level=0)
Initialize a transport manager.
Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures.
Class XML_Node is a tree-based representation of the contents of an XML file.
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 transport property managers.
Base class for a phase with thermodynamic properties.
Class DustyGasTransport implements the Dusty Gas model for transport in porous media.
A map of string keys to values whose type can vary at runtime.
Base class for exceptions thrown by Cantera classes.
Transport * newDefaultTransportMgr(thermo_t *thermo, int loglevel)
Create a new transport manager instance.
Namespace for the Cantera kernel.
Exception thrown if an error is encountered while reading the transport database.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.