| Cantera 3.0.0

Loading...
Searching...
No Matches
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/thermo/PDSS_IdealGas.h"
11#include "cantera/thermo/VPStandardStateTP.h"
12#include "cantera/base/global.h"
13
14 namespace Cantera
15{
16
17 PDSS_IdealGas::PDSS_IdealGas()
18{
19 warn_deprecated("class PDSS_IdealGas", "To be removed after Cantera 3.0");
20}
21
22 void PDSS_IdealGas::initThermo()
23{
24 PDSS::initThermo();
25 m_p0 = m_spthermo->refPressure();
26 m_minTemp = m_spthermo->minTemp();
27 m_maxTemp = m_spthermo->maxTemp();
28}
29
30 void PDSS_IdealGas::getParameters(AnyMap &eosNode) const
31{
32 PDSS::getParameters(eosNode);
33 eosNode["model"] = "ideal-gas";
34}
35
36 double PDSS_IdealGas::intEnergy_mole() const
37{
38 return (m_h0_RT - 1.0) * GasConstant * m_temp;
39}
40
41 double PDSS_IdealGas::cv_mole() const
42{
43 return cp_mole() - GasConstant;
44}
45
46 double PDSS_IdealGas::pressure() const
47{
48 throw NotImplementedError("PDSS_IdealGas::pressure");
49}
50
51 void PDSS_IdealGas::setPressure(double p)
52{
53 m_sss_R = m_s0_R - log(m_pres/m_p0);
54 m_gss_RT = m_hss_RT - m_sss_R;
55 m_Vss = GasConstant * m_temp / m_pres;
56}
57
58 void PDSS_IdealGas::setTemperature(double temp)
59{
60 m_temp = temp;
61 m_spthermo->updatePropertiesTemp(temp, &m_cp0_R, &m_h0_RT, &m_s0_R);
62 m_g0_RT = m_h0_RT - m_s0_R;
63 m_V0 = GasConstant * m_temp / m_p0;
64 m_hss_RT = m_h0_RT;
65 m_cpss_R = m_cp0_R;
66 m_sss_R = m_s0_R - log(m_pres/m_p0);
67 m_gss_RT = m_hss_RT - m_sss_R;
68 m_Vss = GasConstant * m_temp / m_pres;
69}
70
71 void PDSS_IdealGas::setState_TP(double temp, double pres)
72{
73 m_pres = pres;
74 setTemperature(temp);
75}
76
77 void PDSS_IdealGas::setState_TR(double temp, double rho)
78{
79 warn_deprecated("PDSS_IdealGas::setState_TR", "To be removed after Cantera 3.0");
80 m_pres = GasConstant * temp * rho / m_mw;
81 setTemperature(temp);
82}
83
84}
PDSS_IdealGas.h
Declarations for the class PDSS_IdealGas (pressure dependent standard state) which handles calculatio...
VPStandardStateTP.h
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Cantera::NotImplementedError
An error indicating that an unimplemented function has been called.
Definition ctexceptions.h:195
Cantera::PDSS_IdealGas::setPressure
void setPressure(double pres) override
Sets the pressure in the object.
Definition PDSS_IdealGas.cpp:51
Cantera::PDSS_IdealGas::setTemperature
void setTemperature(double temp) override
Set the internal temperature.
Definition PDSS_IdealGas.cpp:58
Cantera::PDSS_IdealGas::pressure
double pressure() const override
Returns the pressure (Pa)
Definition PDSS_IdealGas.cpp:46
Cantera::PDSS_IdealGas::initThermo
void initThermo() override
Initialization routine.
Definition PDSS_IdealGas.cpp:22
Cantera::PDSS_IdealGas::cv_mole
double cv_mole() const override
Return the molar const volume heat capacity in units of J kmol-1 K-1.
Definition PDSS_IdealGas.cpp:41
Cantera::PDSS_IdealGas::setState_TR
void setState_TR(double temp, double rho) override
Set the internal temperature and density.
Definition PDSS_IdealGas.cpp:77
Cantera::PDSS_IdealGas::getParameters
void getParameters(AnyMap &eosNode) const override
Store the parameters needed to reconstruct a copy of this PDSS object.
Definition PDSS_IdealGas.cpp:30
Cantera::PDSS_IdealGas::intEnergy_mole
double intEnergy_mole() const override
Return the molar internal Energy in units of J kmol-1.
Definition PDSS_IdealGas.cpp:36
Cantera::PDSS_IdealGas::PDSS_IdealGas
PDSS_IdealGas()
Default Constructor.
Definition PDSS_IdealGas.cpp:17
Cantera::PDSS_IdealGas::setState_TP
void setState_TP(double temp, double pres) override
Set the internal temperature and pressure.
Definition PDSS_IdealGas.cpp:71
Cantera::PDSS_Nondimensional::m_sss_R
double m_sss_R
Standard state entropy divided by R.
Definition PDSS.h:516
Cantera::PDSS_Nondimensional::m_cpss_R
double m_cpss_R
Standard state heat capacity divided by R.
Definition PDSS.h:515
Cantera::PDSS_Nondimensional::m_h0_RT
double m_h0_RT
Reference state enthalpy divided by RT.
Definition PDSS.h:509
Cantera::PDSS_Nondimensional::m_g0_RT
double m_g0_RT
Reference state Gibbs free energy divided by RT.
Definition PDSS.h:512
Cantera::PDSS_Nondimensional::m_s0_R
double m_s0_R
Reference state entropy divided by R.
Definition PDSS.h:511
Cantera::PDSS_Nondimensional::m_gss_RT
double m_gss_RT
Standard state Gibbs free energy divided by RT.
Definition PDSS.h:517
Cantera::PDSS_Nondimensional::m_cp0_R
double m_cp0_R
Reference state heat capacity divided by R.
Definition PDSS.h:510
Cantera::PDSS_Nondimensional::cp_mole
double cp_mole() const override
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Definition PDSS.cpp:256
Cantera::PDSS_Nondimensional::m_Vss
double m_Vss
Standard State molar volume (m^3/kmol)
Definition PDSS.h:518
Cantera::PDSS_Nondimensional::m_hss_RT
double m_hss_RT
Standard state enthalpy divided by RT.
Definition PDSS.h:514
Cantera::PDSS_Nondimensional::m_V0
double m_V0
Reference state molar volume (m^3/kmol)
Definition PDSS.h:513
Cantera::PDSS::initThermo
virtual void initThermo()
Initialization routine.
Definition PDSS.h:418
Cantera::PDSS::m_p0
double m_p0
Reference state pressure of the species.
Definition PDSS.h:455
Cantera::PDSS::m_temp
double m_temp
Current temperature used by the PDSS object.
Definition PDSS.h:449
Cantera::PDSS::m_spthermo
shared_ptr< SpeciesThermoInterpType > m_spthermo
Pointer to the species thermodynamic property manager.
Definition PDSS.h:472
Cantera::PDSS::m_pres
double m_pres
State of the system - pressure.
Definition PDSS.h:452
Cantera::PDSS::m_maxTemp
double m_maxTemp
Maximum temperature.
Definition PDSS.h:461
Cantera::PDSS::m_minTemp
double m_minTemp
Minimum temperature.
Definition PDSS.h:458
Cantera::PDSS::m_mw
double m_mw
Molecular Weight of the species.
Definition PDSS.h:464
Cantera::PDSS::getParameters
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
Definition PDSS.h:427
global.h
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Cantera::warn_deprecated
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
Definition AnyMap.cpp:1926