Documentation 6b54b78464
Loading...
Searching...
No Matches
CPengRobinson.hpp
Go to the documentation of this file.
1/*!
2 * \file CPengRobinson.hpp
3 * \brief Defines the Peng-Robinson model.
4 * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "CIdealGas.hpp"
31
32/*!
33 * \class CPengRobinson
34 * \brief Child class for defining the Peng-Robinson model.
35 * \author: S.Vitale, G. Gori
36 */
37class CPengRobinson final : public CIdealGas {
38 protected:
39 su2double a{0.0}; /*!< \brief model parameter. */
40 su2double b{0.0}; /*!< \brief model parameter. */
41 su2double k{0.0}; /*!< \brief model parameter (computed with acentric factor). */
42 su2double Zed{0.0}; /*!< \brief compressibility factor. */
43 su2double TstarCrit{0.0}; /*!< \brief Critical temperature. */
44
45 public:
46 /*!
47 * \brief Constructor of the class.
48 */
50
51 /*!
52 * \brief Set the Dimensionless State using Density and Internal Energy
53 * \param[in] rho - first thermodynamic variable.
54 * \param[in] e - second thermodynamic variable.
55 */
56 void SetTDState_rhoe(su2double rho, su2double e) override;
57
58 /*!
59 * \brief Set the Dimensionless State using Pressure and Temperature
60 * \param[in] P - first thermodynamic variable.
61 * \param[in] T - second thermodynamic variable.
62 */
63 void SetTDState_PT(su2double P, su2double T) override;
64
65 /*!
66 * \brief Set the Dimensionless State using Pressure and Density
67 * \param[in] P - first thermodynamic variable.
68 * \param[in] rho - second thermodynamic variable.
69 */
70 void SetTDState_Prho(su2double P, su2double rho) override;
71
72 /*!
73 * \brief Set the Dimensionless Energy using Pressure and Density
74 * \param[in] P - first thermodynamic variable.
75 * \param[in] rho - second thermodynamic variable.
76 */
77 void SetEnergy_Prho(su2double P, su2double rho) override;
78
79 /*!
80 * \brief virtual member that would be different for each gas model implemented
81 * \param[in] InputSpec - Input pair for FLP calls ("hs").
82 * \param[in] th1 - first thermodynamic variable (h).
83 * \param[in] th2 - second thermodynamic variable (s).
84 *
85 */
86 void SetTDState_hs(su2double h, su2double s) override;
87
88 /*!
89 * \brief virtual member that would be different for each gas model implemented
90 * \param[in] InputSpec - Input pair for FLP calls ("rhoT").
91 * \param[in] th1 - first thermodynamic variable (rho).
92 * \param[in] th2 - second thermodynamic variable (T).
93 *
94 */
95 void SetTDState_rhoT(su2double rho, su2double T) override;
96
97 /*!
98 * \brief Set the Dimensionless State using Pressure and Entropy
99 * \param[in] th1 - first thermodynamic variable (P).
100 * \param[in] th2 - second thermodynamic variable (s).
101 */
102 void SetTDState_Ps(su2double P, su2double s) override;
103
104 /*!
105 * \brief compute some derivatives of enthalpy and entropy needed for subsonic inflow BC
106 * \param[in] InputSpec - Input pair for FLP calls ("Pv").
107 * \param[in] th1 - first thermodynamic variable (P).
108 * \param[in] th2 - second thermodynamic variable (v).
109 *
110 */
111 void ComputeDerivativeNRBC_Prho(su2double P, su2double rho) override;
112
113 private:
114 /*!
115 * \brief Internal model parameter.
116 */
117 su2double alpha2(su2double T) const;
118
119 /*!
120 * \brief Internal function for the implicit call hs.
121 */
122 su2double T_v_h(su2double v, su2double h);
123
124 /*!
125 * \brief Internal function for the implicit call Ps.
126 */
127 su2double T_P_rho(su2double P, su2double rho);
128};
Defines the ideal gas model.
Child class for defining the ideal gas model.
Definition CIdealGas.hpp:37
Child class for defining the Peng-Robinson model.
Definition CPengRobinson.hpp:37
su2double a
model parameter.
Definition CPengRobinson.hpp:39
su2double b
model parameter.
Definition CPengRobinson.hpp:40
su2double k
model parameter (computed with acentric factor).
Definition CPengRobinson.hpp:41
void SetTDState_rhoe(su2double rho, su2double e) override
Set the Dimensionless State using Density and Internal Energy.
Definition CPengRobinson.cpp:82
su2double TstarCrit
Critical temperature.
Definition CPengRobinson.hpp:43
void SetTDState_Ps(su2double P, su2double s) override
Set the Dimensionless State using Pressure and Entropy.
Definition CPengRobinson.cpp:331
void SetTDState_rhoT(su2double rho, su2double T) override
virtual member that would be different for each gas model implemented
Definition CPengRobinson.cpp:322
su2double Zed
compressibility factor.
Definition CPengRobinson.hpp:42
void SetTDState_hs(su2double h, su2double s) override
virtual member that would be different for each gas model implemented
Definition CPengRobinson.cpp:200
void SetTDState_PT(su2double P, su2double T) override
Set the Dimensionless State using Pressure and Temperature.
Definition CPengRobinson.cpp:146
void ComputeDerivativeNRBC_Prho(su2double P, su2double rho) override
compute some derivatives of enthalpy and entropy needed for subsonic inflow BC
Definition CPengRobinson.cpp:425
void SetTDState_Prho(su2double P, su2double rho) override
Set the Dimensionless State using Pressure and Density.
Definition CPengRobinson.cpp:194
void SetEnergy_Prho(su2double P, su2double rho) override
Set the Dimensionless Energy using Pressure and Density.
Definition CPengRobinson.cpp:293
passivedouble su2double
Definition code_config.hpp:181