Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
.
Lecture within
CFD with open source 2013
(TME050)
Klas Jareteg
Chalmers University of Technology
2013-09-17
DISCLAIMER: This oering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks. Following the trademark policy.
DISCLAIMER: The ideas and code in this presentation and all appended
les are distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE
Pressure-velocity
Theory
OpenFOAM code basics
Mesh
Matrices
Coupled solvers
Basic idea
Coupled format
Example solver
Pressure-velocity coupling
Coupled model
Implementing pressure-velocity
coupling
Tutorial case
Miscallaneous
Git
Better software development
Python scripting
Learning objectives
.
At the end of this lesson you should (hopefully):
better understand the basics of the pressure-velocity implementation
in OpenFOAM
be acquainted with the ideas of the block coupled format in
OpenFOAM-1.6-ext
have basic practical experience with git
increased understanding of templating and object orientation in
C++
Pressurevelocity
Pressure-velocity
Theory
OpenFOAM code basics
Mesh
Matrices
Coupled solvers
Basic idea
Coupled format
Example solver
Pressure-velocity coupling
Coupled model
Implementing pressure-velocity
coupling
Tutorial case
Miscallaneous
Git
Better software development
Python scripting
Incompressible ow
Acknowledgement for description: Professor Hrvoje Jasak
(U) = 0
(1)
U
1
+ (UU) (U) = p
t
(2)
.
Pressure equation retrieved from the continuity equation.
Start by a semi-discretized form of the momentum equation:
aP UP = H(U) P
where:
H(U) =
aU
N UN
(3)
(4)
(5)
.
Eq. (5) is then substituted in to the continuity equation:
1
1
((aU
P) = ((aU
H(U))
P)
P)
(6)
(7)
SIMPLE
4.
5.
Iterate
2.
3.
Rhie-Chow correction
.
Rhie and Chow introduced a correction in order to be able to use
collocated grids
This is used also in OpenFOAM, but not in an explicit manner
The Rhie-Chow like correction will occur as a dierence to how the
10
{ }
.
OpenFOAM tips
When you are writing your own solvers study the available utilities:
nd how to read variables from dicts scalars, booleans and lists
nd out how to add an argument to the argument list
11
OpenFOAM
code basics
Pressure-velocity
Theory
OpenFOAM code basics
Mesh
Matrices
Coupled solvers
Basic idea
Coupled format
Example solver
Pressure-velocity coupling
Coupled model
Implementing pressure-velocity
coupling
Tutorial case
Miscallaneous
Git
Better software development
Python scripting
12
Meshes in OpenFOAM
Mesh:
Based on an unstructured mesh format
Collocated mesh (Rhie-Chow equivalent already mentioned)
polyMesh and fvMesh: Face based computational cell:
Sf
OWNER
cell i
NEIGHBOUR
face f
cell j
No zeros stored
Only neighbouring cells will give a contribution
14
lduMatrix
// C o e f f i c i e n t s ( not i n c l u d i n g i n t e r f a c e s )
scalarField *lowerPtr_ , *diagPtr_ , *upperPtr_ ;
Listing 1: lduMatrix.H
faces.
1
2
3
c o n s t surfaceVectorField& Sf = p . mesh ( ) . Sf ( ) ;
c o n s t unallocLabelList& owner = mesh . owner ( ) ;
c o n s t unallocLabelList& neighbour = mesh . neighbour ( ) ;
15
A = Ai,j
(8)
16
.
fvMatrix
Specialization for nite volume
Adds source and reference to eld
Helper functions:
3
volScalarField AU = UEqn ( ) . A ( ) ;
17
{ }
.
Lazy evaluation
unnecessary data
Example lduMatrix:
Used for returning the upper part of the matrix (upper())
If upper part does not exist it will be created
If it already exists it is simply returned
18
Coupled solvers
Pressure-velocity
Theory
OpenFOAM code basics
Mesh
Matrices
Coupled solvers
Basic idea
Coupled format
Example solver
Pressure-velocity coupling
Coupled model
Implementing pressure-velocity
coupling
Tutorial case
Miscallaneous
Git
Better software development
Python scripting
19
.
Coupling on many levels:
Model level (example: couple a turbulence model to your steady
state solver)
Equation level (example: couple the pressure equation to the
velocity equation)
Matrix level (example: GGI and regionCoupling)
Dier between:
explicit coupling: solve one matrix for each equation, use x values
from all the other equations
implicit coupling: directly couple linear dependencies in equations
by including multiple equations in the same matrix system
20
Explicit coupling
Examples:
Velocity components in simpleFoam and pisoFoam
Turbulence and momentum equations in simpleFoam and pisoFoam
Regions in chtMultiRegionFoam
Advantages:
Requires less memory than implicit coupling
Sometimes easier to implement (each equation solved separately)
21
Implicit coupling
Examples:
Regions in regionCoupling (OpenFOAM-1.6-ext)
Advantages:
Can increase convergence rates as fewer iterations are anticipated
Sometimes necessary in order for the system to converge
Minimizing underrelaxation
Disadvantages:
Increased memory cost, each matrix coecient a tensor (rank two)
instead of a scalar
Convergence properties changed
Optional: Study the regionCouple boundary condition to see how the implicit
coupling between dierent regions is achieved.
22
A(y)x = a
(9)
B(x)y = b
(10)
A0
Bx
Ay
B0
][ ] [ ]
a
x
=
b
y
(11)
(12)
23
.
Extend the size of each coecient in the matrix:
(13)
(14)
(15)
(16)
24
.
Implementation in OpenFOAM-1.6-ext:
Sparsity pattern preserved, each coecient a tensor
25
{ }
.
C++ templates I
functions)
specic types
26
{ }
.
C++ templates II
Example: List
needed
during compile-time)
Example: BlockLduMatrix
compile-time)
27
{ }
.
Tips on templates
Read the basics (and more):
http://www.cplusplus.com/doc/tutorial/templates/
Eective C++: 50 Specic Ways to Improve Your Programs and
Designs
C++ Templates: The Complete Guide
28
Studying blockCoupledScalarTransportFoam I
.
Example solver in OpenFOAM-1.6-ext:
blockCoupledScalarTransportFoam
Theory behind solver: coupled two phase heat transfer1 :
(UT) (D T) = (Ts T)
(17)
(DTs Ds ) = (T Ts )
(18)
temperatures
29
Studying blockCoupledScalarTransportFoam II
.
Study blockCoupledScalarTransportFoam to nd:
vector and matrix formats used,
how the scalar equations are coupled in the block-coupled matrix,
how the boundary conditions are transfered and
how the system is solved
Run the blockCoupledSwirlTest
1 Henrik Rusche and Hrvoje Jasak. Implicit solution techniques for coupled multi-eld problems Block Solution, Coupled Matrices. June
2010; Ivor Cliord. Block-Coupled Simulations Using OpenFOAM. June 2011.
30
Pressurevelocity
coupling
Pressure-velocity
Theory
OpenFOAM code basics
Mesh
Matrices
Coupled solvers
Basic idea
Coupled format
Example solver
Pressure-velocity coupling
Coupled model
Implementing pressure-velocity
coupling
Tutorial case
Miscallaneous
Git
Better software development
Python scripting
31
Implicit model
(U) = 0
(19)
1
(UU) (U) = p
(20)
Semi-discretized form:
Uf S f = 0
faces
[UU U]f Sf =
faces
Modied pressure:
(21)
Pf Sf
(22)
faces
p
=P
(23)
[
(
)]
Uf Df Pf Pf Sf = 0
faces
(24)
32
{ }
.
Meanings:
fvm: nite volume method, results in an implicit discretization (a
system of equations)
fvc: nite volume calculus, results in an explicit discretization
(source terms)
Types:
fvm: returns fvMatrix<Type>
fvc: returns geometricField<Type>
[A][x] = [b]
(25)
33
Pressure-velocity discretization
.
Eqs. (24) and (22) in OpenFOAM format:
1
fvm : : div ( U )
2 fvm : : laplacian ( D , p )
3 ==
4 fvc : : div ( D*fvc : : grad ( p ) )
1
fvm : : div ( phi , U )
2 + turbulence>divDevReff ( U )
3 ==
4 fvm : : grad ( p )
Problem:
Implicit div and grad not generally desired implementations not
existing
34
117
118
119
120
121
122
123
124
125
126
127
128
129
130
uP
vP
xP = xP
l = wP
PP l
(26)
35
36
AF xF = bP
(27)
(28)
F{N}
[ ]
AX = aX
k,l i
// Matrix b l o c k
BlockLduMatrix<vector4> B ( mesh ) ;
Retrieve elds:
191
192
193
194
195
196
// D iagonal i s s e t s e p a r a t e l y
Field<tensor4>& d = B . diag ( ) . asSquare ( ) ;
// Offd i a g o n a l a l s o as s q u a r e
Field<tensor4>& u = B . upper ( ) . asSquare ( ) ;
Field<tensor4>& l = B . lower ( ) . asSquare ( ) ;
Source:
198
199
37
202
203
204
205
// Add s o u r c e boundary c o n t r i b u t i o n
vectorField& source = UEqnLHS ( ) . source ( ) ;
UEqnLHS ( ) . addBoundarySource ( source , f a l s e ) ;
38
Pf Sf = 0
(29)
faces
Interpolation weights:
218
219
220
221
222
223
224
225
226
227
// I n t e r p o l a t i o n scheme f o r the p r e s s u r e w e i g h t s
tmp<surfaceInterpolationScheme<scalar> >
tinterpScheme_
(
surfaceInterpolationScheme<scalar >:: New
(
p . mesh ( ) ,
p . mesh ( ) . interpolationScheme ( grad ( p ) )
)
);
218
219
wN = 1 wP
(30)
39
// P r e s s u r e g r a d i e n t c o n t r i b u t i o n s c o r r e s p o n d s to an i m p l i c i t
// g r a d i e n t o p e r a t o r
tmp<vectorField> tpUv = tmp<vectorField>
(
new vectorField ( upper . size ( ) , pTraits<vector >:: zero )
);
vectorField& pUv = tpUv ( ) ;
tmp<vectorField> tpLv = tmp<vectorField>
(
new vectorField ( lower . size ( ) , pTraits<vector >:: zero )
);
vectorField& pLv = tpLv ( ) ;
tmp<vectorField> tpSv = tmp<vectorField>
(
new vectorField ( source . size ( ) , pTraits<vector >:: zero )
);
vectorField& pSv = tpSv ( ) ;
tmp<vectorField> tpDv = tmp<vectorField>
(
new vectorField ( diag . size ( ) , pTraits<vector >:: zero )
);
vectorField& pDv = tpDv ( ) ;
40
Boundary contribution:
271
272
273
274
275
276
277
278
279
280
281
282
283
p . boundaryField ( ) . updateCoeffs ( ) ;
forAll ( p . boundaryField ( ) , patchI )
{
// P r e s e n t f v P a t c h F i e l d
fvPatchField<scalar> & fv = p . boundaryField ( ) [ patchI ] ;
// R e t r i e v e the w e i g h t s f o r the boundary
c o n s t fvsPatchScalarField& pw = weights . boundaryField ( ) [ patchI ] ;
// C o n t r i b u t i o n s from the boundary c o e f f i c i e n t s
tmp<Field<scalar> > tic = fv . valueInternalCoeffs ( pw ) ;
Field<scalar>& ic = tic ( ) ;
tmp<Field<scalar> > tbc = fv . valueBoundaryCoeffs ( pw ) ;
41
Field<scalar>& bc = tbc ( ) ;
// Get the fvPatch o n l y
c o n s t fvPatch& patch = fv . patch ( ) ;
// S u r f a c e normals f o r t h i s patch
tmp<Field<vector> > tsn = patch . Sf ( ) ;
Field<vector> sn = tsn ( ) ;
// Manually add the c o n t r i b u t i o n s from the boundary
// This what happens with addBoundaryDiag , addBoundarySource
forAll ( fv , facei )
{
label c = patch . faceCells ( ) [ facei ] ;
pDv [ c]+=ic [ facei ] * sn [ facei ] ;
pSv [ c]=bc [ facei ] * sn [ facei ] ;
}
}
42
forAll ( d , i )
{
d [ i ] ( 0 , 0 ) = diag [ i ] ;
d [ i ] ( 1 , 1 ) = diag [ i ] ;
d [ i ] ( 2 , 2 ) = diag [ i ] ;
d [ i ] ( 0 , 3 ) = pDv [ i ] . x ( ) ;
d [ i ] ( 1 , 3 ) = pDv [ i ] . y ( ) ;
d [ i ] ( 2 , 3 ) = pDv [ i ] . z ( ) ;
}
forAll ( l , i )
{
l [ i ] ( 0 , 0 ) = lower [ i ] ;
l [ i ] ( 1 , 1 ) = lower [ i ] ;
l [ i ] ( 2 , 2 ) = lower [ i ] ;
l [ i ] ( 0 , 3 ) = pLv [ i ] . x ( ) ;
l [ i ] ( 1 , 3 ) = pLv [ i ] . y ( ) ;
l [ i ] ( 2 , 3 ) = pLv [ i ] . z ( ) ;
}
forAll ( u , i )
{
u [ i ] ( 0 , 0 ) = upper [ i ] ;
u [ i ] ( 1 , 1 ) = upper [ i ] ;
u [ i ] ( 2 , 2 ) = upper [ i ] ;
u [ i ] ( 0 , 3 ) = pUv [ i ] . x ( ) ;
u [ i ] ( 1 , 3 ) = pUv [ i ] . y ( ) ;
u [ i ] ( 2 , 3 ) = pUv [ i ] . z ( ) ;
}
forAll ( s , i )
43
.
348
349
350
351
352
{
s [ i ] ( 0 ) = source [ i ] . x()+pSv [ i ] . x ( ) ;
s [ i ] ( 1 ) = source [ i ] . y()+pSv [ i ] . y ( ) ;
s [ i ] ( 2 ) = source [ i ] . z()+pSv [ i ] . z ( ) ;
}
44
{ }
.
Use of tmp
In general C++ will create objects in local scope, return a copy and
This is undesired for large objects which gives lots of data transfer
To avoid the local object to be out of scope the tmp container is
used
45
tmp<volScalarField> tA = UEqnLHS ( ) . A ( ) ;
volScalarField& A = tA ( ) ;
442
443
444
445
446
447
448
449
450
451
452
tmp<volVectorField>
volVectorField& exp
tmp<volVectorField>
volVectorField exp2
454
455
456
457
458
459
460
461
462
463
464
tmp<fvScalarMatrix> MEqnLHSp
(
fvm : : laplacian (1/ A , p )
==
fvc : : div ( exp2 )
);
// Add d i a g o n a l boundary c o n t r i b u t i o n
MEqnLHSp ( ) . addBoundaryDiag ( pMdiag , 0 ) ;
// Add s o u r c e boundary c o n t r i b u t i o n
scalarField& pMsource = MEqnLHSp ( ) . source ( ) ;
MEqnLHSp ( ) . addBoundarySource ( pMsource , f a l s e ) ;
46
47
);
vectorField& MSource = tMSource ( ) ;
48
tmp<Field<vector>
Field<vector>& ic
tmp<Field<vector>
Field<vector>& bc
>
=
>
=
tic = fv . valueInternalCoeffs ( Mw ) ;
tic ( ) ;
tbc = fv . valueBoundaryCoeffs ( Mw ) ;
tbc ( ) ;
49
forAll ( d , i )
{
d [ i](3 ,0)
d [ i](3 ,1)
d [ i](3 ,2)
d [ i](3 ,3)
}
forAll ( l , i )
{
l [ i](3 ,0)
l [ i](3 ,1)
l [ i](3 ,2)
l [ i](3 ,3)
}
forAll ( u , i )
{
u [ i](3 ,0)
u [ i](3 ,1)
u [ i](3 ,2)
u [ i](3 ,3)
}
forAll ( s , i )
{
s[i](3) =
=
=
=
=
MDiag [ i ] . x ( ) ;
MDiag [ i ] . y ( ) ;
MDiag [ i ] . z ( ) ;
pMdiag [ i ] ;
=
=
=
=
MLower [ i ] . x ( ) ;
MLower [ i ] . y ( ) ;
MLower [ i ] . z ( ) ;
pMlower [ i ] ;
=
=
=
=
MUpper [ i ] . x ( ) ;
MUpper [ i ] . y ( ) ;
MUpper [ i ] . z ( ) ;
pMupper [ i ] ;
MSource [ i ] . x ( )
+MSource [ i ] . y ( )
+MSource [ i ] . z ( )
+pMsource [ i ] ;
50
{ }
.
51
Miscallaneous
Pressure-velocity
Theory
OpenFOAM code basics
Mesh
Matrices
Coupled solvers
Basic idea
Coupled format
Example solver
Pressure-velocity coupling
Coupled model
Implementing pressure-velocity
coupling
Tutorial case
Miscallaneous
Git
Better software development
Python scripting
52
Git
.
Version control system2 - meant to manage changes and dierent
versions of codes
Distributed - each directory is a fully functioning repository without
2 Many more version control systems exists, e.g. Subversion and Mercurial
53
Git - Hands on I
Basics:
Initialize a repository in the current folder:
1
git init
git status
git status
git log
54
Git - Hands on II
Branches:
git branch
55
.
Ignore le:
Avoid including compiled les and binary les in the revision tree.
Add a .gitignore le. The les and endings listed in the le will
be ignored. Example:
1 # Skip a l l the f i l e s end in g with . o ( o b j e c t f i l e s )
2 *.o
3
4 # Skip a l l dependency f i l e s
5 * . dep
When looking at the status of the repository the above les will be
ignored.
56
available at:
https://github.s3.amazonaws.com/media/progit.en.pdf)
Code School - Try Git:
http://try.github.io/levels/1/challenges/1
... google!
Examples of software:
Meld - merging tool, can be used to merge dierent branches and
commits (http://meldmerge.org/)
Giggle - example of a GUI for git
(https://wiki.gnome.org/Apps/giggle)
57
.
Write small, separable segments of code
Test each unit in the code, test the code often
Setup a test case structure to continuously test the code
Comment your code
Use a version control system
Use tools that you are used to, alternatively get used to them!
58
Python
scripting
Pressure-velocity
Theory
OpenFOAM code basics
Mesh
Matrices
Coupled solvers
Basic idea
Coupled format
Example solver
Pressure-velocity coupling
Coupled model
Implementing pressure-velocity
coupling
Tutorial case
Miscallaneous
Git
Better software development
Python scripting
59
60
Python basics
.
Interpreted language, no compilation by the user
Run in interactive mode or using scripts
Dynamically typed language: type of a variable set during runtime
1
2
foo = 1
bar = 5
61
Python syntax I
i f 1==1:
p r i n t Yes , 1=1
p r i n t W i l l alw a ys be w r i t t e n
>>>
>>>
>>>
1
>>>
[1 ,
>>>
[2]
>>>
4
>>>
>>>
[1 ,
foo = [ 1 , a ]
bar = [ 1 , 2 , 3 , 4 ]
p r i n t foo [ 0 ]
p r i n t bar [ : ]
2 , 3 , 4]
p r i n t bar [ 1 : 2 ]
p r i n t bar[1]
bar . append ( 4 )
p r i n t bar
2 , 3 , 4 , 4]
62
Python syntax II
Tuples:
1 >>> foo = ( 1 , 2 , 3 )
2 >>> p r i n t Test %d use %d o f t u p l e %d % foo
3 Test 1 use 2 of tuple 3
Dictionaries:
1
2
3
4
5
>>> test = {}
>>> test [ v a l u e ]=4
>>> test [ name ]= t e s t
>>> p r i n t test
{ name : t e s t , v a l u e : 4}
63
Python modules I
.
Auxiliary code can be included from modules. Examples:
os: Operating system interface. Example:
1 import os
2
3 # Run a command
4 os . system ( run command )
64
65
running time
1 #! / u s r / b i n / python
2
3 import os
4 import shutil
5
6 presweeps = [ 2 , 4 ]
7 cycles = [ W , V ]
8
9 f o r p i n presweeps :
10
f o r c i n cycles :
11
os . system ( rm r f r u n f o l d e r )
12
shutil . copytree ( t e m p l a t e , r u n f o l d e r )
13
14
os . chdir ( r u n f o l d e r )
15
os . system ( sed i s /PRESWEEPS/%d / system / f v S o l u t i o n %p )
16
os . system ( sed i s /CYCLETYPE/%s / system / f v S o l u t i o n %c )
17
os . system ( mpirun np 8 steadyNavalFoam p a r a l l e l > l o g . steadyNavalFoam )
18
f = open ( l o g . steadyNavalFoam , r )
19
f o r line i n f :
20
linsplit = line . rsplit ( )
21
i f len ( linsplit >7):
22
i f ls[0]== ExecutionTime :
23
exectime = float ( ls [ 2 ] )
24
clocktime = float ( ls [ 6 ] )
25
f . close ( )
26
p r i n t C y c l e=%s , presweeps=%d , e x e c u t i o n time=%f , c l o c k t i m e=%f %(c , p , exectime , clocktime )
27
os . chdir ( . . )
66
#! / u s r / b i n / python
# Klas J a r e t e g
# 20130830
# Desc :
#
S e t t i n g up the a c a s e with a box
################################################################################
######################### CLEAN UP ##########################################
################################################################################
i f options . clean :
os . system ( rm f r 0 )
os . system ( rm f r [09]* )
67
.
34
35 ################################################################################
36 ######################### SETUP #############################################
37 ################################################################################
38
39 i f options . setup :
40
shutil . copy ( MESH , c o n s t a n t / polyMesh / blockMeshDict )
41
42
p = subprocess . Popen ( [ blockMesh ] , \
43
stdout=subprocess . PIPE , stderr=subprocess . PIPE )
44
out , error = p . communicate ( )
45
46
i f error :
47
p r i n t bcolors . FAIL + ERROR: blockMesh f a i l i n g + bcolors . ENDC
48
p r i n t bcolors . ENDC + ERROR MESSAGE: %s %error + bcolors . ENDC
49
50
try :
51
shutil . rmtree ( 0 )
52
e x c e p t OSError :
53
pass
54
55
shutil . copytree ( FIELDS , 0 )
68
.
Test of matplotlib
4.0
1 #! / u s r / b i n / python
2
3 import matplotlib . pyplot as plt
4 import numpy as np
5
6 x = np . linspace ( 0 , 1 )
7 y = np . linspace ( 0 , 2 )
8 y = y**2
9
10 plt . figure ( )
11 plt . plot ( x , y )
12 plt . title ( Test o f m a t p l o t l i b )
13 plt . xlabel ( x )
14 plt . ylabel ( y )
15 plt . savefig ( Test . pdf , format= pdf )
3.5
3.0
2.5
y
2.0
1.5
1.0
0.5
0.00.0
0.2
0.4
0.6
0.8
1.0
69
More on plotting
.
matplotlib (http://matplotlib.org/):
Plotting package with MATLAB equivalent syntax
Primarily 2D plots
MayaVi2 (http://code.enthought.com/projects/mayavi/):
Plots 3D
Works with VTK, possible complement to ParaView
70
Read more
.
Python introduction material:
Python tutorial: http://docs.python.org/2/tutorial/
Python and high performance computing:
http://www.c3se.chalmers.se/index.php/Python_and_High_
Performance_Computing
71
PyFoam
From documentation:
http://openfoamwiki.net/index.php/Contrib_PyFoam
72
More modules
http://docs.python.org/2/library/optparse.html:
1
2
3
4
5
6
7
8
9
10
http://wiki.scipy.org/Tentative_NumPy_Tutorial
73
.
Library of objects and functions to read a cong le and produce a
74
.
Needed for simulation:
All meshes (16x4+1+1=66)
All elds (400)
All coupled patches
Reasons to automatize:
Changes in mesh congurations (mesh independence tests etc.)
Change in geometrical congurations
Change in eld initial and boundary conditions
....
75
[ general ]
dimensions : 3
convert : 0 . 0 1
time : 0
[ GeneralAssembly ]
name : Generalized assembly mesh
symmetry : 4
nx : 7
lattice :
guid pin0 guid pin0
pin0 pin0 pin0 pin0
guid pin0 guid pin0
pin0 pin0 pin0 pin0
dphi : 8
pitch : 1 . 2 5
H : 1.0
dz : 1 . 0
gz : 1 . 0
ref : 0 . 0
ref_dz : 1 . 0
ref_gz : 1 . 0
moderatorfields : T p K k epsilon U G
modinnfields : T p K k epsilon U G
neutronicsmultiples : Phi Psi
fuefields : T rho K h p
clafields : T rho K h p
gapfields : T p_gap K k_gap epsilon_gap U_gap G
76
.
30
31
32
33
34
35
36
[ pin0 ]
type : FuelPin
fue_ro : 0 . 4 1
fue_ri : 0 . 1 2
fue_dr : 4
....
77
blockMeshDict
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
....
convertToMeters 0 . 0 1 0 0 0 0 ;
vertices
(
(0.000000 0.000000 0.000000)
(0.070711 0.070711 0.000000)
(0.055557 0.083147 0.000000)
....
(4.375000 4.167612 0.000000)
(4.375000 4.167612 1.000000)
(1000.000000 1000.000000 1000.000000)
);
blocks
(
hex
hex
hex
hex
hex
hex
hex
(
(
(
(
(
(
(
0
0
0
0
0
0
0
1 2 2 5 6 7 7 ) ( 1 1
2 10 10 5 7 13 13 ) (
10 16 16 5 13 19 19 )
16 22 22 5 19 25 25 )
166 172 172 5 169 175
172 178 178 5 175 181
178 184 184 5 181 187
1 )
1 1
( 1
( 1
175
181
187
....
78
.
Summary:
Using blockMesh for structured meshes with many regions
Need for a script in order to be able to reproduce fast and easy
Object oriented librray written in Python
79