Cantera  3.1.0a4
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
11
12namespace Cantera
13{
14
15PDSSFactory* PDSSFactory::s_factory = 0;
17
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
35 std::unique_lock<std::mutex> lock(thermo_mutex);
36 if (!s_factory) {
38 }
39 return s_factory;
40}
41
43 std::unique_lock<std::mutex> lock(thermo_mutex);
44 delete s_factory;
45 s_factory = 0;
46}
47
48PDSS* PDSSFactory::newPDSS(const string& model)
49{
50 return create(model);
51}
52
53PDSS* newPDSS(const string& model)
54{
55 return PDSSFactory::factory()->newPDSS(model);
56}
57
58}
Declarations for the class PDSS_ConstVol (pressure dependent standard state) which handles calculatio...
Declarations for the class PDSS_HKFT (pressure dependent standard state) which handles calculations f...
Declarations for the class PDSS_SSVol (pressure dependent standard state) which handles calculations ...
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
PDSS * create(const string &name, Args... args)
Create an object using the object construction function corresponding to "name" and the provided cons...
Definition FactoryBase.h:75
void reg(const string &name, function< PDSS *(Args...)> f)
Register a new object construction function.
Definition FactoryBase.h:80
void addDeprecatedAlias(const string &original, const string &alias)
Add a deprecated alias for an existing registered type.
void deleteFactory() override
delete the static instance of this factory
PDSSFactory()
Private constructors prevents usage.
static std::mutex thermo_mutex
Decl for locking mutex for thermo factory singleton.
Definition PDSSFactory.h:42
static PDSSFactory * factory()
Static function that creates a static instance of the factory.
static PDSSFactory * s_factory
static member of a single instance
Definition PDSSFactory.h:36
PDSS * newPDSS(const string &model)
Create a new thermodynamic property manager.
Class for pressure dependent standard states that use a constant volume model.
Class for pressure dependent standard states corresponding to ionic solutes in electrolyte water.
Definition PDSS_HKFT.h:28
Class for pressure dependent standard states that uses a standard state volume model of some sort.
Definition PDSS_SSVol.h:112
Class for the liquid water pressure dependent standard state.
Definition PDSS_Water.h:50
Virtual base class for a species with a pressure dependent standard state.
Definition PDSS.h:140
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595