Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
PDSSFactory.cpp
Go to the documentation of this file.
1
//! @file PDSSFactory.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/thermo/PDSSFactory.h
"
7
#include "
cantera/thermo/PDSS_Water.h
"
8
#include "
cantera/thermo/PDSS_ConstVol.h
"
9
#include "
cantera/thermo/PDSS_SSVol.h
"
10
#include "
cantera/thermo/PDSS_HKFT.h
"
11
12
namespace
Cantera
13
{
14
15
PDSSFactory
*
PDSSFactory::s_factory
= 0;
16
std::mutex
PDSSFactory::thermo_mutex
;
17
18
PDSSFactory::PDSSFactory
()
19
{
20
reg
(
"constant-volume"
, []() {
return
new
PDSS_ConstVol
(); });
21
addDeprecatedAlias
(
"constant-volume"
,
"constant_incompressible"
);
22
addDeprecatedAlias
(
"constant-volume"
,
"constant-incompressible"
);
23
reg
(
"liquid-water-IAPWS95"
, []() {
return
new
PDSS_Water
(); });
24
addDeprecatedAlias
(
"liquid-water-IAPWS95"
,
"waterPDSS"
);
25
addDeprecatedAlias
(
"liquid-water-IAPWS95"
,
"waterIAPWS"
);
26
addDeprecatedAlias
(
"liquid-water-IAPWS95"
,
"water"
);
27
reg
(
"molar-volume-temperature-polynomial"
, []() {
return
new
PDSS_SSVol
(); });
28
addDeprecatedAlias
(
"molar-volume-temperature-polynomial"
,
"temperature_polynomial"
);
29
reg
(
"density-temperature-polynomial"
, []() {
return
new
PDSS_SSVol
(); });
30
addDeprecatedAlias
(
"density-temperature-polynomial"
,
"density_temperature_polynomial"
);
31
reg
(
"HKFT"
, []() {
return
new
PDSS_HKFT
(); });
32
}
33
34
PDSSFactory
*
PDSSFactory::factory
() {
35
std::unique_lock<std::mutex> lock(
thermo_mutex
);
36
if
(!
s_factory
) {
37
s_factory
=
new
PDSSFactory
;
38
}
39
return
s_factory
;
40
}
41
42
void
PDSSFactory::deleteFactory
() {
43
std::unique_lock<std::mutex> lock(
thermo_mutex
);
44
delete
s_factory
;
45
s_factory
= 0;
46
}
47
48
PDSS
*
PDSSFactory::newPDSS
(
const
string
& model)
49
{
50
return
create
(model);
51
}
52
53
PDSS
* newPDSS(
const
string
& model)
54
{
55
return
PDSSFactory::factory
()->
newPDSS
(model);
56
}
57
58
}
PDSSFactory.h
PDSS_ConstVol.h
Declarations for the class PDSS_ConstVol (pressure dependent standard state) which handles calculatio...
PDSS_HKFT.h
Declarations for the class PDSS_HKFT (pressure dependent standard state) which handles calculations f...
PDSS_SSVol.h
Declarations for the class PDSS_SSVol (pressure dependent standard state) which handles calculations ...
PDSS_Water.h
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
Cantera::Factory< PDSS >::create
PDSS * create(const string &name, Args... args)
Definition
FactoryBase.h:75
Cantera::Factory< PDSS >::reg
void reg(const string &name, function< PDSS *(Args...)> f)
Definition
FactoryBase.h:80
Cantera::Factory< PDSS >::addDeprecatedAlias
void addDeprecatedAlias(const string &original, const string &alias)
Definition
FactoryBase.h:116
Cantera::PDSSFactory
Definition
PDSSFactory.h:17
Cantera::PDSSFactory::deleteFactory
void deleteFactory() override
delete the static instance of this factory
Definition
PDSSFactory.cpp:42
Cantera::PDSSFactory::PDSSFactory
PDSSFactory()
Private constructors prevents usage.
Definition
PDSSFactory.cpp:18
Cantera::PDSSFactory::thermo_mutex
static std::mutex thermo_mutex
Decl for locking mutex for thermo factory singleton.
Definition
PDSSFactory.h:42
Cantera::PDSSFactory::factory
static PDSSFactory * factory()
Static function that creates a static instance of the factory.
Definition
PDSSFactory.cpp:34
Cantera::PDSSFactory::s_factory
static PDSSFactory * s_factory
static member of a single instance
Definition
PDSSFactory.h:36
Cantera::PDSSFactory::newPDSS
PDSS * newPDSS(const string &model)
Create a new thermodynamic property manager.
Definition
PDSSFactory.cpp:48
Cantera::PDSS_ConstVol
Class for pressure dependent standard states that use a constant volume model.
Definition
PDSS_ConstVol.h:23
Cantera::PDSS_HKFT
Class for pressure dependent standard states corresponding to ionic solutes in electrolyte water.
Definition
PDSS_HKFT.h:28
Cantera::PDSS_SSVol
Class for pressure dependent standard states that uses a standard state volume model of some sort.
Definition
PDSS_SSVol.h:111
Cantera::PDSS_Water
Class for the liquid water pressure dependent standard state.
Definition
PDSS_Water.h:50
Cantera::PDSS
Virtual base class for a species with a pressure dependent standard state.
Definition
PDSS.h:140
Cantera
Namespace for the Cantera kernel.
Definition
AnyMap.cpp:595
src
thermo
PDSSFactory.cpp
Generated by
1.17.0