Cantera  4.0.0a1
Loading...
Searching...
No Matches
PDSS_ConstVol.cpp
Go to the documentation of this file.
1/**
2 * @file PDSS_ConstVol.cpp
3 * Implementation of a pressure dependent standard state
4 * virtual function.
5 */
6
7// This file is part of Cantera. See License.txt in the top-level directory or
8// at https://cantera.org/license.txt for license and copyright information.
9
12#include "cantera/base/global.h"
13
14namespace Cantera
15{
16
18{
20 if (m_input.hasKey("density")) {
21 setMolarVolume(m_mw / m_input.convert("density", "kg/m^3"));
22 } else if (m_input.hasKey("molar-density")) {
23 setMolarVolume(1.0 / m_input.convert("molar-density", "kmol/m^3"));
24 } else if (m_input.hasKey("molar-volume")) {
25 setMolarVolume(m_input.convert("molar-volume", "m^3/kmol"));
26 }
27 m_minTemp = m_spthermo->minTemp();
28 m_maxTemp = m_spthermo->maxTemp();
29 m_p0 = m_spthermo->refPressure();
32}
33
35{
36 PDSS::getParameters(eosNode);
37 eosNode["model"] = "constant-volume";
38 // Output volume information in a form consistent with the input
39 if (m_input.hasKey("density")) {
40 eosNode["density"].setQuantity(m_mw / m_constMolarVolume, "kg/m^3");
41 } else if (m_input.hasKey("molar-density")) {
42 eosNode["molar-density"].setQuantity(1.0 / m_constMolarVolume, "kmol/m^3");
43 } else {
44 eosNode["molar-volume"].setQuantity(m_constMolarVolume, "m^3/kmol");
45 }
46}
47
49{
50 double pV = (m_pres * m_Vss);
51 return m_h0_RT * GasConstant * m_temp - pV;
52}
53
55{
56 return cp_mole();
57}
58
59double PDSS_ConstVol::dVdT() const
60{
61 return 0.0;
62}
63
64double PDSS_ConstVol::dVdP() const
65{
66 return 0.0;
67}
68
70{
71 m_pres = p;
72 double del_pRT = (m_pres - m_p0) / (GasConstant * m_temp);
73 m_hss_RT = m_h0_RT + del_pRT * m_Vss;
75}
76
78{
79 m_temp = temp;
80 m_spthermo->updatePropertiesTemp(temp, m_cp0_R, m_h0_RT, m_s0_R);
82
83 double del_pRT = (m_pres - m_p0) / (GasConstant * m_temp);
84
85 m_hss_RT = m_h0_RT + del_pRT * m_Vss;
89}
90
91void PDSS_ConstVol::setState_TP(double temp, double pres)
92{
93 setTemperature(temp);
94 setPressure(pres);
95}
96
98{
99 return 1.0E-200;
100}
101
102}
Declarations for the class PDSS_ConstVol (pressure dependent standard state) which handles calculatio...
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1477
double convert(const string &key, const string &units) const
Convert the item stored by the given key to the units specified in units.
Definition AnyMap.cpp:1595
void setPressure(double pres) override
Sets the pressure in the object.
void setTemperature(double temp) override
Set the internal temperature.
void initThermo() override
Initialization routine.
double dVdP() const override
Return the pressure derivative of the standard state molar volume at constant temperature [m³/kmol/Pa...
double cv_mole() const override
Return the molar const volume heat capacity in units of J kmol-1 K-1.
void setMolarVolume(double v)
Set the (constant) molar volume [m3/kmol] of the species.
void getParameters(AnyMap &eosNode) const override
Store the parameters needed to reconstruct a copy of this PDSS object.
double intEnergy_mole() const override
Return the molar internal Energy in units of J kmol-1.
void setState_TP(double temp, double pres) override
Set the internal temperature and pressure.
double m_constMolarVolume
Value of the constant molar volume for the species.
double dVdT() const override
Return the temperature derivative of the standard state molar volume at constant pressure [m³/kmol/K]...
double satPressure(double t) override
saturation pressure
double m_sss_R
Standard state entropy divided by R.
Definition PDSS.h:479
double m_cpss_R
Standard state heat capacity divided by R.
Definition PDSS.h:478
double m_h0_RT
Reference state enthalpy divided by RT.
Definition PDSS.h:472
double m_g0_RT
Reference state Gibbs free energy divided by RT.
Definition PDSS.h:475
double m_s0_R
Reference state entropy divided by R.
Definition PDSS.h:474
double m_gss_RT
Standard state Gibbs free energy divided by RT.
Definition PDSS.h:480
double m_cp0_R
Reference state heat capacity divided by R.
Definition PDSS.h:473
double cp_mole() const override
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Definition PDSS.cpp:225
double m_Vss
Standard State molar volume (m^3/kmol)
Definition PDSS.h:481
double m_hss_RT
Standard state enthalpy divided by RT.
Definition PDSS.h:477
double m_V0
Reference state molar volume (m^3/kmol)
Definition PDSS.h:476
virtual void initThermo()
Initialization routine.
Definition PDSS.h:397
double m_p0
Reference state pressure of the species.
Definition PDSS.h:418
double m_temp
Current temperature used by the PDSS object.
Definition PDSS.h:412
shared_ptr< SpeciesThermoInterpType > m_spthermo
Pointer to the species thermodynamic property manager.
Definition PDSS.h:435
double m_pres
State of the system - pressure.
Definition PDSS.h:415
double m_maxTemp
Maximum temperature.
Definition PDSS.h:424
double m_minTemp
Minimum temperature.
Definition PDSS.h:421
double m_mw
Molecular Weight of the species.
Definition PDSS.h:427
AnyMap m_input
Input data supplied via setParameters.
Definition PDSS.h:431
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
Definition PDSS.h:406
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:123
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595