Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
utils.cpp
Go to the documentation of this file.
1
//! @file utils.cpp
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
#include "
cantera/tpx/utils.h
"
7
#include "
cantera/base/stringUtils.h
"
8
#include "
cantera/base/global.h
"
9
10
#include "
CarbonDioxide.h
"
11
#include "
Heptane.h
"
12
#include "
HFC134a.h
"
13
#include "
Hydrogen.h
"
14
#include "
Methane.h
"
15
#include "
Nitrogen.h
"
16
#include "
Oxygen.h
"
17
#include "
Water.h
"
18
19
namespace
tpx
20
{
21
Substance
*
newSubstance
(
const
std::string& name)
22
{
23
std::string lcname =
Cantera::toLowerCopy
(name);
24
if
(lcname ==
"water"
) {
25
return
new
water
;
26
}
else
if
(lcname ==
"nitrogen"
) {
27
return
new
nitrogen
;
28
}
else
if
(lcname ==
"methane"
) {
29
return
new
methane
;
30
}
else
if
(lcname ==
"hydrogen"
) {
31
return
new
hydrogen
;
32
}
else
if
(lcname ==
"oxygen"
) {
33
return
new
oxygen
;
34
}
else
if
(lcname ==
"hfc-134a"
|| lcname ==
"hfc134a"
) {
35
return
new
HFC134a
;
36
}
else
if
(lcname ==
"carbon-dioxide"
|| lcname ==
"carbondioxide"
) {
37
return
new
CarbonDioxide
;
38
}
else
if
(lcname ==
"heptane"
) {
39
return
new
Heptane
;
40
}
else
{
41
throw
Cantera::CanteraError
(
"tpx::newSubstance"
,
"No Substance"
42
" definition known for '{}'."
, name);
43
}
44
}
45
46
}
CarbonDioxide.h
HFC134a.h
Heptane.h
Hydrogen.h
Methane.h
Nitrogen.h
Oxygen.h
Water.h
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition
ctexceptions.h:66
tpx::CarbonDioxide
Pure species representation of carbon dioxide.
Definition
CarbonDioxide.h:17
tpx::HFC134a
Equation of state for HFC-134a.
Definition
HFC134a.h:18
tpx::Heptane
Pure species representation of heptane.
Definition
Heptane.h:16
tpx::Substance
Base class from which all pure substances are derived.
Definition
Sub.h:37
tpx::hydrogen
Pure species representation of hydrogen.
Definition
Hydrogen.h:17
tpx::methane
Pure species representation of methane.
Definition
Methane.h:17
tpx::nitrogen
Pure species representation of nitrogen.
Definition
Nitrogen.h:17
tpx::oxygen
Pure species representation of oxygen.
Definition
Oxygen.h:16
tpx::water
Pure species representation of water.
Definition
Water.h:16
global.h
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Cantera::toLowerCopy
string toLowerCopy(const string &input)
Convert to lower case.
Definition
stringUtils.cpp:222
stringUtils.h
Contains declarations for string manipulation functions within Cantera.
tpx::newSubstance
Substance * newSubstance(const std::string &name)
Create a new Substance object corresponding to the specified name.
Definition
utils.cpp:21
utils.h
src
tpx
utils.cpp
Generated by
1.17.0