Cantera  3.2.0a5
Loading...
Searching...
No Matches
Transport.cpp
Go to the documentation of this file.
1/**
2 * @file Transport.cpp
3 * Mixture-averaged transport properties for ideal gas mixtures.
4 */
5
6// This file is part of Cantera. See License.txt in the top-level directory or
7// at https://cantera.org/license.txt for license and copyright information.
8
10#include "cantera/base/AnyMap.h"
12
13namespace Cantera
14{
15
16shared_ptr<Transport> Transport::clone(shared_ptr<ThermoPhase> thermo) const
17{
19}
20
21size_t Transport::checkSpeciesIndex(size_t k) const
22{
23 if (k < m_nsp) {
24 return k;
25 }
26 throw IndexError("Transport::checkSpeciesIndex", "species", k, m_nsp);
27}
28
30{
31 warn_deprecated("Transport::checkSpeciesArraySize",
32 "To be removed after Cantera 3.2. Only used by legacy CLib.");
33 if (m_nsp > kk) {
34 throw ArraySizeError("Transport::checkSpeciesArraySize", kk, m_nsp);
35 }
36}
37
39{
40 AnyMap out;
42 if (name != "") {
43 out["transport"] = name;
44 }
45 return out;
46}
47
48}
Header file defining class TransportFactory (see TransportFactory)
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
Array size error.
string canonicalize(const string &name)
Get the canonical name registered for a type.
Definition FactoryBase.h:94
An array index is out of range.
static TransportFactory * factory()
Return a pointer to a TransportFactory instance.
virtual string transportModel() const
Identifies the model represented by this Transport object.
Definition Transport.h:101
AnyMap parameters() const
Return the parameters for a phase definition which are needed to reconstruct an identical object usin...
Definition Transport.cpp:38
size_t m_nsp
Number of species in the phase.
Definition Transport.h:456
shared_ptr< Transport > clone(shared_ptr< ThermoPhase > thermo) const
Create a new Transport object using the same transport model and species transport properties as this...
Definition Transport.cpp:16
ThermoPhase & thermo()
Phase object.
Definition Transport.h:111
void checkSpeciesArraySize(size_t kk) const
Check that an array size is at least m_nsp.
Definition Transport.cpp:29
size_t checkSpeciesIndex(size_t k) const
Check that the specified species index is in range.
Definition Transport.cpp:21
shared_ptr< Transport > newTransport(shared_ptr< ThermoPhase > thermo, const string &model)
Create a new Transport instance.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
Definition AnyMap.cpp:1997