OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::PengRobinson< T, S > Class Template Reference

#include <interactionPotential.h>

+ Inheritance diagram for olb::PengRobinson< T, S >:
+ Collaboration diagram for olb::PengRobinson< T, S >:

Public Member Functions

 PengRobinson (T G, T acentricFactor=0.334, T a=2./49., T b=2./21., T tr=.8)
 
bool operator() (T psi[], const S rho[])
 has to be implemented for 'every' derived class
 
bool operator() (T psi[], const S rho[], const S t[])
 
- Public Member Functions inherited from olb::AnalyticalF< 1, T, S >
AnalyticalF< D, T, S > & operator- (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator+ (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator* (AnalyticalF< D, T, S > &rhs)
 
AnalyticalF< D, T, S > & operator/ (AnalyticalF< D, T, S > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, S >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Additional Inherited Members

- Public Types inherited from olb::AnalyticalF< 1, T, S >
using identity_functor_type
 
- Public Types inherited from olb::GenericF< T, S >
using targetType = T
 
using sourceType = S
 
- Public Attributes inherited from olb::GenericF< T, S >
std::shared_ptr< GenericF< T, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Static Public Attributes inherited from olb::AnalyticalF< 1, T, S >
static constexpr unsigned dim
 
- Protected Member Functions inherited from olb::AnalyticalF< 1, T, S >
 AnalyticalF (int n)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

template<typename T, typename S>
class olb::PengRobinson< T, S >

Definition at line 248 of file interactionPotential.h.

Constructor & Destructor Documentation

◆ PengRobinson()

template<typename T , typename S >
olb::PengRobinson< T, S >::PengRobinson ( T G,
T acentricFactor = 0.334,
T a = 2./49.,
T b = 2./21.,
T tr = .8 )

Definition at line 64 of file interactionPotential.hh.

64 : AnalyticalF<1,T,S>(1), _G(G), _acentricFactor(acentricFactor), _a(a), _b(b)
65{
66 _R = 1.;
67 //a=0.45724*R*R*tc*tc/pc;
68 //b=0.0778*R*tc/pc;
69 _tc = 0.0778/0.45724*_a/_b/_R;
70 //T pc = 0.0778*_R*tc/_b;
71 //T rhoc = pc/0.307/_R/tc;
72 _t = _tc*tr;
73 //Zc=0.307 Tc=0.072922004 pc=0.059569985 rhoc=2.6609121
74 _alpha = 1. + (0.37464+1.54226*_acentricFactor-0.26992*_acentricFactor*_acentricFactor)*(1.-util::sqrt(_t/_tc));
75 _alpha = _alpha*_alpha;
76 this->getName() = "PengRobinson";
77}
std::string & getName()
read and write access to name
Definition genericF.hh:51
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::GenericF< T, S >::getName(), and olb::util::sqrt().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()() [1/2]

template<typename T , typename S >
bool olb::PengRobinson< T, S >::operator() ( T output[],
const S input[] )
virtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, S >.

Definition at line 80 of file interactionPotential.hh.

81{
82 T p = (rho[0]*_R*_t/(1.-_b*rho[0]))-(_a*_alpha*rho[0]*rho[0]/(1.+2.*_b*rho[0]-_b*_b*rho[0]*rho[0]));
83 psi[0] = util::sqrt(6.*(p-rho[0]/3.)/_G);
84 return true;
85}

References olb::util::sqrt().

+ Here is the call graph for this function:

◆ operator()() [2/2]

template<typename T , typename S >
bool olb::PengRobinson< T, S >::operator() ( T psi[],
const S rho[],
const S t[] )

Definition at line 89 of file interactionPotential.hh.

90{
91 _t = t[0];
92 _alpha = 1. + (0.37464+1.54226*_acentricFactor-0.26992*_acentricFactor*_acentricFactor)*(1.-util::sqrt(_t/_tc));
93 _alpha = _alpha*_alpha;
94 T p = (rho[0]*_R*_t/(1.-_b*rho[0]))-(_a*_alpha*rho[0]*rho[0]/(1.+2.*_b*rho[0]-_b*_b*rho[0]*rho[0]));
95 psi[0] = util::sqrt(6.*(p-rho[0]/3.)/_G);
96 return true;
97}
platform_constant Fraction t[Q]

References olb::util::sqrt().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: