BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_GM_HelmholtzTransport_LemmonJacobsen.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_CL_GM_HELMHOLTZTRANSPORT_LEMMONJACOBSEN_HPP
13#define BELFEM_CL_GM_HELMHOLTZTRANSPORT_LEMMONJACOBSEN_HPP
14
15#include "typedefs.hpp"
16#include "cl_Vector.hpp"
17#include "cl_Bitset.hpp"
18#include "en_Helmholtz.hpp"
20
21#define BELFEM_LJTRANS_T 0
22#define BELFEM_LJTRANS_P 1
23#define BELFEM_LJTRANS_V 2
24#define BELFEM_LJTRANS_TAU 3
25#define BELFEM_LJTRANS_DELTA 4
26#define BELFEM_LJTRANS_ETA0 5
27#define BELFEM_LJTRANS_ETA 6
28#define BELFEM_LJTRANS_LAMBDA 7
29#define BELFEM_LJTRANS_NUMVALS 8
30
31namespace belfem
32{
33 namespace gasmodels
34 {
35//----------------------------------------------------------------------------
36
66 {
67//----------------------------------------------------------------------------
68 private:
69//----------------------------------------------------------------------------
70
72 const HelmholtzModel mModel ;
73
75 real mTcrit ;
76
78 real mPcrit ;
79
81 real mRhocrit ;
82
85 real mM ;
86
88 real mEpsilonKb ;
89
91 real mSigma ;
92
96
98 Vector< real > mEtaN ;
99 Vector< real > mEtaT ;
100 Vector< real > mEtaD ;
101 Vector< real > mEtaL ;
102
104 real mLambdaN1 ;
105 real mLambdaN2 ;
106 real mLambdaT2 ;
107 real mLambdaN3 ;
108 real mLambdaT3 ;
109
111 Vector< real > mLambdaN ;
112 Vector< real > mLambdaT ;
113 Vector< real > mLambdaD ;
114 Vector< real > mLambdaL ;
115
117 real mXi0 ;
118 real mGammaC ;
119 real mQd ;
120 real mTref ;
121
123 real mConstEta0 ;
124
126 mutable real mVals[ BELFEM_LJTRANS_NUMVALS ] = { 0.0 };
128
129//----------------------------------------------------------------------------
130 public:
131//----------------------------------------------------------------------------
132
138 Gas & aParent,
139 const HelmholtzModel aModel );
140
142
143//----------------------------------------------------------------------------
144
148 real
149 mu( const real T, const real p ) const ;
150
151//----------------------------------------------------------------------------
152
156 real
157 lambda( const real T, const real p ) const ;
158
159//----------------------------------------------------------------------------
160 private:
161//----------------------------------------------------------------------------
162
164 void
165 init_tables() ;
166
167//----------------------------------------------------------------------------
168
170 real
171 omega( const real T ) const ;
172
173//----------------------------------------------------------------------------
174
176 real
177 eta_0( const real T ) const ;
178
179//----------------------------------------------------------------------------
180
182 real
183 eta_r() const ;
184
185//----------------------------------------------------------------------------
186
188 real
189 lambda_0( const real T ) const ;
190
191//----------------------------------------------------------------------------
192
194 real
195 lambda_r() const ;
196
197//----------------------------------------------------------------------------
198
203 real
204 lambda_c( const real T, const real p ) const ;
205
206//----------------------------------------------------------------------------
207
209 real
210 chi( const real T, const real v ) const ;
211
212//----------------------------------------------------------------------------
213
214 void
215 update_Tp( const real T, const real p ) const ;
216
217 bool
218 test( const index_t aIndex ) const ;
219
220 void
221 set( const index_t aIndex, const real aValue ) const ;
222
223 const real &
224 get( const index_t aIndex ) const ;
225
226//----------------------------------------------------------------------------
227 } ;
228
229//----------------------------------------------------------------------------
230
231 inline bool
232 HelmholtzTransport_LemmonJacobsen::test( const index_t aIndex ) const
233 {
235 "Invalid Lemmon-Jacobsen state index: %u",
236 ( unsigned int ) aIndex );
237
238 return mBits.test( aIndex );
239 }
240
241//----------------------------------------------------------------------------
242
243 inline void
244 HelmholtzTransport_LemmonJacobsen::set(
245 const index_t aIndex, const real aValue ) const
246 {
248 "Invalid Lemmon-Jacobsen state index: %u",
249 ( unsigned int ) aIndex );
250
251 mVals[ aIndex ] = aValue;
252 mBits.set( aIndex );
253 }
254
255//----------------------------------------------------------------------------
256
257 inline const real &
258 HelmholtzTransport_LemmonJacobsen::get( const index_t aIndex ) const
259 {
261 "Invalid Lemmon-Jacobsen state index: %u",
262 ( unsigned int ) aIndex );
263
264 return mVals[ aIndex ];
265 }
266
267//----------------------------------------------------------------------------
268
269 inline void
270 HelmholtzTransport_LemmonJacobsen::update_Tp(
271 const real T, const real p ) const
272 {
273 BELFEM_ASSERT( T > 0, "Invalid temperature" );
274 BELFEM_ASSERT( p > 0, "Invalid pressure" );
275
276 if( T != mVals[ BELFEM_LJTRANS_T ]
277 || p != mVals[ BELFEM_LJTRANS_P ] )
278 {
279 mBits.reset();
280
281 mVals[ BELFEM_LJTRANS_V ] = mEoS.v( T, p );
282
283 mVals[ BELFEM_LJTRANS_T ] = T ;
284 mVals[ BELFEM_LJTRANS_P ] = p ;
285 mVals[ BELFEM_LJTRANS_TAU ] = mTcrit / T ;
286 mVals[ BELFEM_LJTRANS_DELTA ] =
287 1.0 / ( mVals[ BELFEM_LJTRANS_V ] * mRhocrit ) ;
288
289 mBits.set( BELFEM_LJTRANS_T );
290 mBits.set( BELFEM_LJTRANS_P );
291 mBits.set( BELFEM_LJTRANS_V );
292 mBits.set( BELFEM_LJTRANS_TAU );
293 mBits.set( BELFEM_LJTRANS_DELTA );
294 }
295 }
296
297//----------------------------------------------------------------------------
298 }
299}
300#endif //BELFEM_CL_GM_HELMHOLTZTRANSPORT_LEMMONJACOBSEN_HPP
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
#define BELFEM_LJTRANS_V
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.hpp:23
#define BELFEM_LJTRANS_T
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.hpp:21
#define BELFEM_LJTRANS_TAU
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.hpp:24
#define BELFEM_LJTRANS_DELTA
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.hpp:25
#define BELFEM_LJTRANS_P
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.hpp:22
#define BELFEM_LJTRANS_NUMVALS
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.hpp:29
void set(const index_t aIndex)
set a bit to true
Definition cl_Bitset.hpp:92
bool test(const index_t aIndex) const
test if a bit is set
Definition cl_Bitset.hpp:138
The gas class that provides the fluid model.
Definition cl_Gas.hpp:81
real v(const real T, const real p) const
specific volume in m^3/kg
Definition cl_GM_Helmholtz.cpp:237
real mu(const real T, const real p) const
dynamic viscosity in Pa*s
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.cpp:306
HelmholtzTransport_LemmonJacobsen(Gas &aParent, const HelmholtzModel aModel)
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.cpp:25
real lambda(const real T, const real p) const
thermal conductivity in W/(m*K)
Definition cl_GM_HelmholtzTransport_LemmonJacobsen.cpp:323
HelmholtzTransport(Gas &aParent)
Definition cl_GM_HelmholtzTransport.cpp:35
Helmholtz & mEoS
Definition cl_GM_HelmholtzTransport.hpp:47
USER GUIDES:
Definition cl_Capacitor.cpp:16
HelmholtzModel
Definition en_Helmholtz.hpp:18
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
T
Definition test_curve_frame.py:108
p
Definition test_curve_frame.py:64