Nektar++
PengRobinsonEoS.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: PengRobinsonEoS.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Peng-Robinson equation of state
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_MISC_PENGROBINSONEOS
36 #define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_MISC_PENGROBINSONEOS
37 
38 #include "EquationOfState.h"
39 
40 namespace Nektar
41 {
42 
43 /**
44 * @brief Peng-Robinson equation of state:
45  * p = RT/(1/rho - b) - a*Alpha(T/Tc) / (1/rho^2 + 2*b/rho - b^2)
46  * with a = 0.45724 * (R*Tc)^2 / Pc
47  * b = 0.0778 * (R*Tc) / Pc
48  * Alpha(T/Tc) = [1 + fw * (1 - sqrt(T/ Tc))]^2
49  * fw = 0.37464 + 1.54226*omega - 0.2699*omega*omega
50 */
52 {
53 public:
55 
56  /// Creates an instance of this class
59  {
62  return p;
63  }
64 
65  /// Name of the class
66  static std::string className;
67 
68 protected:
75 
76  virtual NekDouble v_GetTemperature(const NekDouble &rho,
77  const NekDouble &e);
78 
79  virtual NekDouble v_GetPressure(const NekDouble &rho, const NekDouble &e);
80 
81  virtual NekDouble v_GetEntropy(const NekDouble &rho, const NekDouble &e);
82 
83  virtual NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e);
84 
85  virtual NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e);
86 
87  virtual NekDouble v_GetEFromRhoP(const NekDouble &rho, const NekDouble &p);
88 
89  virtual NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p);
90 
91 private:
93 
94  virtual ~PengRobinsonEoS(void){};
95 
96  // Alpha term of Peng-Robinson EoS
97  NekDouble Alpha(const NekDouble &T);
98 
99  // Log term term of Peng-Robinson EoS
100  NekDouble LogTerm(const NekDouble &rho);
101 };
102 }
103 
104 #endif
NekDouble LogTerm(const NekDouble &rho)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
Encapsulates equations of state allowing us to obtain thermodynamic properties: most relations are in...
virtual NekDouble v_GetEntropy(const NekDouble &rho, const NekDouble &e)
virtual NekDouble v_GetTemperature(const NekDouble &rho, const NekDouble &e)
static EquationOfStateSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
PengRobinsonEoS(const LibUtilities::SessionReaderSharedPtr &pSession)
NekDouble Alpha(const NekDouble &T)
static std::string className
Name of the class.
Peng-Robinson equation of state: p = RT/(1/rho - b) - a*Alpha(T/Tc) / (1/rho^2 + 2*b/rho - b^2) with ...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
double NekDouble
virtual NekDouble v_GetEFromRhoP(const NekDouble &rho, const NekDouble &p)
std::shared_ptr< EquationOfState > EquationOfStateSharedPtr
A shared pointer to an equation of state object.
virtual NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e)
virtual NekDouble v_GetPressure(const NekDouble &rho, const NekDouble &e)
virtual NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e)
virtual ~PengRobinsonEoS(void)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p)