OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::interaction::MCPRpseudoPotential< N_COMPONENTS > Struct Template Reference

#include <interactionPotential.h>

+ Collaboration diagram for olb::interaction::MCPRpseudoPotential< N_COMPONENTS >:

Public Member Functions

template<typename X_I , typename G_JK , typename BETA_JK , typename V = typename X_I::value_t>
G_Excess (const X_I &x_i, const G_JK &g_jk, const BETA_JK &beta_jk) any_platform
 
template<typename X_I , typename B , typename V = typename X_I::value_t>
b_mix (const X_I &x_i, const B &b) any_platform
 
template<typename X_I , typename A_I , typename B , typename V = typename X_I::value_t>
a_mix (const X_I &x_i, const A_I &a_i, const B &b, V b_m, V G_E) any_platform
 
template<typename RHO_FIELD , typename __T , typename K , typename A_C , typename B , typename T_C , typename M , typename ALPHA , typename G_I , typename G_II , typename BIG_M , typename V = typename RHO_FIELD::value_t>
compute (const RHO_FIELD &rhoField, const __T &_T, const K &k, const A_C &a_c, const B &b, const T_C &T_c, const M &m, const ALPHA &alpha, const G_I &g_I, const G_II &g_II, const BIG_M &_M) any_platform
 
template<typename RHO_FIELD , typename A_C , typename B , typename T_C , typename M , typename ALPHA , typename G_I , typename G_II , typename BIG_M , typename V = typename RHO_FIELD::value_t>
computeP (const RHO_FIELD &rhoField, V _T, const A_C &a_c, const B &b, const T_C &T_c, const M &m, const ALPHA &alpha, const G_I &g_I, const G_II &g_II, const BIG_M &_M) any_platform
 

Detailed Description

template<unsigned N_COMPONENTS>
struct olb::interaction::MCPRpseudoPotential< N_COMPONENTS >

Definition at line 115 of file interactionPotential.h.

Member Function Documentation

◆ a_mix()

template<unsigned N_COMPONENTS>
template<typename X_I , typename A_I , typename B , typename V = typename X_I::value_t>
V olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::a_mix ( const X_I & x_i,
const A_I & a_i,
const B & b,
V b_m,
V G_E )
inline

Definition at line 141 of file interactionPotential.h.

141 {
142 V a_sum = 0;
143 for(unsigned i = 0; i < N_COMPONENTS; i++){
144 a_sum = a_sum + x_i[i]*a_i[i]/b[i];
145 }
146 /*double a_m = 0;
147 for(unsigned i = 0; i < N_COMPONENTS; i++){
148 for(unsigned j = 0; j < N_COMPONENTS; j++){
149 a_m += x_i[i]*x_i[j]*util::pow(a_i[i]*a_i[j],0.5);
150 }
151 }
152 return a_m;*/
153 return b_m * (a_sum - G_E / 0.6232252401);
154 };
+ Here is the caller graph for this function:

◆ b_mix()

template<unsigned N_COMPONENTS>
template<typename X_I , typename B , typename V = typename X_I::value_t>
V olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::b_mix ( const X_I & x_i,
const B & b )
inline

Definition at line 132 of file interactionPotential.h.

132 {
133 V b_m = 0;
134 for(unsigned i = 0; i < N_COMPONENTS; i++){
135 b_m += b[i]*x_i[i];
136 }
137 return b_m;
138 };
+ Here is the caller graph for this function:

◆ compute()

template<unsigned N_COMPONENTS>
template<typename RHO_FIELD , typename __T , typename K , typename A_C , typename B , typename T_C , typename M , typename ALPHA , typename G_I , typename G_II , typename BIG_M , typename V = typename RHO_FIELD::value_t>
V olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::compute ( const RHO_FIELD & rhoField,
const __T & _T,
const K & k,
const A_C & a_c,
const B & b,
const T_C & T_c,
const M & m,
const ALPHA & alpha,
const G_I & g_I,
const G_II & g_II,
const BIG_M & _M )
inline

Definition at line 157 of file interactionPotential.h.

157 {
158 Vector<V,N_COMPONENTS> molarRhoField{}, a_i{}, x_i{};
159 Vector<V,N_COMPONENTS*N_COMPONENTS> g_jk{}, beta_jk{};
160 V R = 1;
161 V molarRho = 0;
162 V Rho = 0;
163 for(unsigned i = 0; i < N_COMPONENTS; i++){
164 a_i[i] = a_c[i] * util::pow((1 + m[i] * (1 - util::pow((_T/T_c[i]),0.5))),2);
165 for(unsigned j = 0; j < N_COMPONENTS; j++){
166 g_jk[N_COMPONENTS*i+j] = g_I[N_COMPONENTS*i+j] + g_II[N_COMPONENTS*i+j] * _T;
167 beta_jk[N_COMPONENTS*i+j] = b[j] * util::exp(-alpha[N_COMPONENTS*i+j]*g_jk[N_COMPONENTS*i+j]/(R*_T));
168 }
169 molarRhoField[i] = rhoField[i]/_M[i];
170 molarRho += molarRhoField[i];
171 Rho += rhoField[i];
172 }
173 for(unsigned i = 0; i < N_COMPONENTS; i++){
174 x_i[i] = molarRhoField[i]/molarRho;
175 }
176 V g_E = G_Excess(x_i, g_jk, beta_jk);
177 V b_m = b_mix(x_i, b);
178 V a_m = a_mix(x_i, a_i, b, b_m, g_E);
179 V p = molarRho*R*_T/(1-b_m*molarRho) - a_m*molarRho*molarRho/(1+2*b_m*molarRho-b_m*molarRho*b_m*molarRho);
180 V psi = util::sqrt(-6.*(k*p - Rho/3.));
181 return psi;
182 };
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
ADf< T, DIM > exp(const ADf< T, DIM > &a)
Definition aDiff.h:455
V b_mix(const X_I &x_i, const B &b) any_platform
V a_mix(const X_I &x_i, const A_I &a_i, const B &b, V b_m, V G_E) any_platform
V G_Excess(const X_I &x_i, const G_JK &g_jk, const BETA_JK &beta_jk) any_platform

References olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::a_mix(), olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::b_mix(), olb::util::exp(), olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::G_Excess(), olb::util::pow(), and olb::util::sqrt().

+ Here is the call graph for this function:

◆ computeP()

template<unsigned N_COMPONENTS>
template<typename RHO_FIELD , typename A_C , typename B , typename T_C , typename M , typename ALPHA , typename G_I , typename G_II , typename BIG_M , typename V = typename RHO_FIELD::value_t>
V olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::computeP ( const RHO_FIELD & rhoField,
V _T,
const A_C & a_c,
const B & b,
const T_C & T_c,
const M & m,
const ALPHA & alpha,
const G_I & g_I,
const G_II & g_II,
const BIG_M & _M )
inline

Definition at line 185 of file interactionPotential.h.

185 {
186 olb::Vector<V,N_COMPONENTS> molarRhoField{}, a_i{}, x_i{};
188 V R = 1;
189 V molarRho = 0;
190 for(unsigned i = 0; i < N_COMPONENTS; i++){
191 a_i[i] = a_c[i] * util::pow((1 + m[i] * (1 - util::pow((_T/T_c[i]),0.5))),2);
192 for(unsigned j = 0; j < N_COMPONENTS; j++){
193 g_jk[N_COMPONENTS*i+j] = g_I[N_COMPONENTS*i+j] + g_II[N_COMPONENTS*i+j] * _T;
194 beta_jk[N_COMPONENTS*i+j] = b[j] * util::exp(-alpha[N_COMPONENTS*i+j]*g_jk[N_COMPONENTS*i+j]/(R*_T));
195 }
196 molarRhoField[i] = rhoField[i]/_M[i];
197 molarRho += molarRhoField[i];
198 }
199 for(unsigned i = 0; i < N_COMPONENTS; i++){
200 x_i[i] = molarRhoField[i]/molarRho;
201 }
202 V g_E = G_Excess(x_i, g_jk, beta_jk);
203 V b_m = b_mix(x_i, b);
204 V a_m = a_mix(x_i, a_i, b, b_m, g_E);
205 V p = molarRho*R*_T/(1-b_m*molarRho) - a_m*molarRho*molarRho/(1+2*b_m*molarRho-b_m*molarRho*b_m*molarRho);
206 return p;
207 }
Plain old scalar vector.
Definition vector.h:47

References olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::a_mix(), olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::b_mix(), olb::util::exp(), olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::G_Excess(), and olb::util::pow().

+ Here is the call graph for this function:

◆ G_Excess()

template<unsigned N_COMPONENTS>
template<typename X_I , typename G_JK , typename BETA_JK , typename V = typename X_I::value_t>
V olb::interaction::MCPRpseudoPotential< N_COMPONENTS >::G_Excess ( const X_I & x_i,
const G_JK & g_jk,
const BETA_JK & beta_jk )
inline

Definition at line 117 of file interactionPotential.h.

117 {
118 V G_E = 0;
119 for(unsigned i = 0; i < N_COMPONENTS; i++){
120 V sum1 = 0;
121 V sum2 = 0;
122 for(unsigned j = 0; j < N_COMPONENTS; j++){
123 sum1 = sum1 + x_i[j]*g_jk[i+N_COMPONENTS*j]*beta_jk[i+N_COMPONENTS*j];
124 sum2 = sum2 + x_i[j]*beta_jk[i+N_COMPONENTS*j];
125 }
126 G_E = G_E + x_i[i] * sum1/sum2;
127 }
128 return G_E;
129 };
+ Here is the caller graph for this function:

The documentation for this struct was generated from the following file: