Cantera 2.6.0
PDSS_IdealGas.cpp
Go to the documentation of this file.
1/**
2 * @file PDSS_IdealGas.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
10#include "cantera/base/ctml.h"
13
14using namespace std;
15
16namespace Cantera
17{
18
20{
21}
22
24{
26 m_p0 = m_spthermo->refPressure();
27 m_minTemp = m_spthermo->minTemp();
28 m_maxTemp = m_spthermo->maxTemp();
29}
30
32{
33 PDSS::getParameters(eosNode);
34 eosNode["model"] = "ideal-gas";
35}
36
38{
39 return (m_h0_RT - 1.0) * GasConstant * m_temp;
40}
41
42doublereal PDSS_IdealGas::cv_mole() const
43{
44 return cp_mole() - GasConstant;
45}
46
47doublereal PDSS_IdealGas::pressure() const
48{
49 throw NotImplementedError("PDSS_IdealGas::pressure");
50}
51
53{
54 m_sss_R = m_s0_R - log(m_pres/m_p0);
57}
58
59void PDSS_IdealGas::setTemperature(doublereal temp)
60{
61 m_temp = temp;
62 m_spthermo->updatePropertiesTemp(temp, &m_cp0_R, &m_h0_RT, &m_s0_R);
67 m_sss_R = m_s0_R - log(m_pres/m_p0);
70}
71
72void PDSS_IdealGas::setState_TP(doublereal temp, doublereal pres)
73{
74 m_pres = pres;
75 setTemperature(temp);
76}
77
78void PDSS_IdealGas::setState_TR(doublereal temp, doublereal rho)
79{
80 m_pres = GasConstant * temp * rho / m_mw;
81 setTemperature(temp);
82}
83
84}
Declarations for the class PDSS_IdealGas (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:399
An error indicating that an unimplemented function has been called.
Definition: ctexceptions.h:187
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
virtual doublereal pressure() const
Returns the pressure (Pa)
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
virtual void setTemperature(doublereal temp)
Set the internal temperature.
virtual void initThermo()
Initialization routine.
PDSS_IdealGas()
Default Constructor.
virtual void setState_TR(doublereal temp, doublereal rho)
Set the internal temperature and density.
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
double m_sss_R
Standard state entropy divided by R.
Definition: PDSS.h:522
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Definition: PDSS.cpp:262
double m_cpss_R
Standard state heat capacity divided by R.
Definition: PDSS.h:521
double m_h0_RT
Reference state enthalpy divided by RT.
Definition: PDSS.h:515
double m_g0_RT
Reference state Gibbs free energy divided by RT.
Definition: PDSS.h:518
double m_s0_R
Reference state entropy divided by R.
Definition: PDSS.h:517
double m_gss_RT
Standard state Gibbs free energy divided by RT.
Definition: PDSS.h:523
double m_cp0_R
Reference state heat capacity divided by R.
Definition: PDSS.h:516
double m_Vss
Standard State molar volume (m^3/kmol)
Definition: PDSS.h:524
double m_hss_RT
Standard state enthalpy divided by RT.
Definition: PDSS.h:520
double m_V0
Reference state molar volume (m^3/kmol)
Definition: PDSS.h:519
virtual void initThermo()
Initialization routine.
Definition: PDSS.h:415
doublereal m_pres
State of the system - pressure.
Definition: PDSS.h:458
shared_ptr< SpeciesThermoInterpType > m_spthermo
Pointer to the species thermodynamic property manager.
Definition: PDSS.h:478
doublereal m_temp
Current temperature used by the PDSS object.
Definition: PDSS.h:455
doublereal m_maxTemp
Maximum temperature.
Definition: PDSS.h:467
doublereal m_p0
Reference state pressure of the species.
Definition: PDSS.h:461
doublereal m_mw
Molecular Weight of the species.
Definition: PDSS.h:470
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
Definition: PDSS.h:424
doublereal m_minTemp
Minimum temperature.
Definition: PDSS.h:464
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113