Professional Documents
Culture Documents
Disclaimer: This is a student project work, done as part of a course where OpenFOAM and some
other OpenSource software are introduced to the students. Any reader should be aware that it
might not be free of errors. Still, it might be useful for someone who would like learn some details
similar to the ones presented in the report and in the accompanying files. The material has gone
through a review process. The role of the reviewer is to go through the tutorial and make sure that
it works, that it is possible to follow, and to some extent correct the writing. The reviewer has no
responsibility for the contents.
The main requirements of a tutorial in the course is that it should teach the four points: How to
use it, The theory of it, How it is implemented, and How to modify it. Therefore the list of learning
outcomes is organized with those headers.
How to use the new MhdPisoFoam solver for coupled solid/fluid domains: tutorial for electro-
conductive walls flow.
The theory of it:
How it is implemented:
Base-solver conjugateHeatFoam features. How the coupling between solid and fluid domain is
enforced.
How to modify it:
How to modify the base-solver to include the MHD effect within the Navier-Stokes equations.
How to implement an additional volume scalar fields (electric potential and electrical conduc-
tivity) to the solid and fluid domain.
1
Prerequisites
The reader is expected to know the following in order to get maximum benefit out of this report:
Basic knowledge about hydrodynamics. Suggested material: G.K. Batchelor, An introduction
to fluid dynamics, 2000, Cambridge University Press.
Fundamental knowledge about the finite volume method and computational fluid dynamics
codes. Suggested source: H.K. Versteeg & W. Malalasekhara, An Introduction to Computa-
tional Fluid Dynamics: The finite volume method, 2007, Longman Scientific and Technical.
The reader should be familiar with elementary OpenFOAM features and their usage (top-level
programming and running tutorials).
Access to the latest version of foam-extend (4.1) and other OpenFOAM distributions.
2
Contents
1 Introduction 5
2 Magnetohydrodynamics 7
2.1 MHD equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Fundamental parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Implementation 11
3.1 Implementation strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Derivation of MhdPisoFoam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Validation tutorial 17
4.1 Geometry and mesh grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Boundary conditions and run control . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 Running the tutorial and post-processes using BASH scripts . . . . . . . . . . . . . . 24
3
Nomenclature
Greek symbols
β Thermal expansion coefficient
δ Wall thickness
κ Thermal conductivity
µ Dynamic viscosity
ν Kinematic viscosity
ρ Density
σ Electric conductivity
φ Electric potential
Latin symbols
a Half-width of rectangular duct parallel to magnetic field direction
B Magnetic field
g Gravity acceleration
J Current density
L Generic characteristic length
n Normal direction
p Pressure, poloidal coordinate
T Temperature
u Characteristic/average velocity
Dimensionless groups
c Wall conductance ratio
Ha Hartmann number
N Interaction parameter or Stuart number
Pr Prandtl number
Re Reynolds number
Rm Magnetic Reynolds number
4
Chapter 1
Introduction
The main purpose of this report is to set the base for the implementation of a new OpenFOAM
(foam-extend 4.1) solver, that could handle all the relevant phenomena occurring in incompressible
confined 3D magnetohydrodynamic (MHD) flows.
The general characterization of MHD effects is pivotal for many reasons and, in particular, for a
reliable and efficient design of magnetic confinement nuclear fusion reactors, where magnetohydrody-
namic effects arise due to the interaction between magnetic field and liquid metals (electro-conductive
materials), that are foreseen to be used as working fluids in breeding blankets.
Unfortunately, current OpenFOAM distributions provide applications that, despite being well-
functioning and solidly validated, have limited modelling capabilities. As a matter of fact the
built-in solver, referred as mhdFoam, is able to treat only a limited spectrum of MHD cases of study,
namely isothermal and laminar flows. Moreover the solver cannot simulate MHD flows within chan-
nels that have a finite electrical conductivity.
It would be ideal to develop a tool that can overcome these limitations and that could model MHD
flows under fusion-relevant conditions. Thus, in this report will be given preliminary guidelines on
how such a numerical tool could be developed. The focus of the tutorial is to show how the influence
of the electrical conductivity of the wall on a incompressible, laminar and confined MHD flow could
be taken into account. This is done implementing a specific set of magnetohydrodynamic equations
in the foam-extend solver conjugateHeatFoam, which is originally developed for the characterization
of thermal-hydraulic coupled (fluid-solid) problems. Moreover,conjugateHeatFoam is able to treat
also turbulent regimes and buoyancy phenomena, thus, it could be further modified with ease to
model those effects in MHD flows. It is worth mentioning that the conjugateHeatFoam solver has
been exclusively implemented for the foam-extend distribution. As discussed in Mas de les Valls’s
Ph.D. thesis [1], such a solver provides a resolution approach (referred as grid coupling strategy) to
treat coupled study cases, that has several upsides respect to the standard conjugated OpenFOAM
solvers (e.g. chtMultiRegionFoam). The newly derived solver has been named MhdPisoFoam.
The reader interested in the topics discussed in this project might find useful information in other
works, carried out in the framework of this course, where alternative MHD solvers have been de-
scribed. In particular, Tassone [2] derived a new solver, epotFoam, that employs a convenient
formulation of the MHD Navier-Stokes equations along with other approximations that make it way
more stable and faster than mhdFoam. Unfortunately, such a tool does not allow to take into account
the influence of the channel walls on the flow. Moreover, in the study performed by Iraola [3], a 2-
dimensional solver has been derived to model natural MHD convective flows. Such a solver, referred
as Q2DmhdFoam, uses a simplified approach to take into account MHD phenomena on the liquid
flow and, again, it does not deal with the effect of the duct walls electrical conductivity. Therefore,
it has a narrow range of application, i.e. it is less general than the mhdFoam (and consequently than
MhdPisoFoam) solver but it allows the analysis of buoyant phenomena with a low computational
effort.
In chapter 2 of this report, fundamentals of magnetohydrodynamic theory are presented. Basic
equations are described (Navier-Stokes and Maxwell sets), along with a discussion about pivotal
5
Chapter 1. Introduction
6
Chapter 2
Magnetohydrodynamics
In this chapter, the equations and the parameters governing a laminar and incompressible MHD
flow are presented. First, the equations according to the magnetic induction formulation are de-
rived by the combination of the Navier-Stokes’ and Maxwell’s ones. Therefore, the induction-less
approximation is introduced and the MHD set is reformulated accordingly. A different form of the
MHD equations, called electric potential formula, is also presented in which the fundamental elec-
tromagnetic variable considered is the electric potential φ instead of magnetic field B. This latter
formulation is the one used to derive the MhdPisoFoam implementation. Fundamental parameters
and boundary conditions of MHD flows are briefly discussed.
Du
= −∇(p/ρ) + ν∇2 u + (J × B)/ρ + Sm (2.3)
Dt
DT k
= ∇T 2 + J 2 /σ + St (2.4)
Dt cp ρ
The symbols ρ, ν, cp , k and σ represent density, kinematic viscosity, specific heat capacity, thermal
and electrical conductivity. The term (J × B)/ρ in Eq. (2.3) accounts for the retarding effect of
the Lorentz force or electromagnetic drag, whereas the group J 2 /σ in Eq. (2.4) represents the heat
7
2.2. Fundamental parameters Chapter 2. Magnetohydrodynamics
generation in the fluid due to the Joule effect. However, the above set lacks equations to determine
J and B. For this purpose, equations are introduced to give closure to the system together with
the magnetic permeability µ. From the Ohm’s and Ampere’s law the magnetic induction equation
is deduced
∂B 1 2
= ∇ × (u × B) + ∇ B (2.5)
∂t µσ
that can be used to calculate the magnetic field distribution, which must satisfy the Gauss’ law for
magnetism
∇·B=0 (2.6)
In turn, the current density distribution is obtained from the Ampere’s law
1
J= ∇×B (2.7)
µ
The flow considered is described completely by Eqs.(2.1)-(2.5), which is known as the magnetic
induction formulation of the MHD equations. The non-linear and mutual coupling between the
velocity and magnetic field is evident in the first term on the right-hand side of Eq. (2.5).
It is possible to reduce the MHD problem complexity by employing some assumptions. One of
the most widely employed is the induction-less approximation. The coupling intensity between the
velocity and magnetic field can be represented by the magnetic Reynolds number, which is defined
as
Momentum advection
Rem = = µσu0 L (2.8)
Magnetic diffusivity
Here, u0 is the reference bulk velocity. If Rem 1, the magnetic field is not dependent from the
flow velocity distribution and determined exclusively by the boundary conditions. In other terms,
the induced field b in Eq. (2.1) can be neglected and we can declare that B ' B0 . Therefore, Eq.
(2.5) is simplified accordingly in a pure diffusive one
∂B 1 2
= ∇ B (2.9)
∂t µσ
If the induction-less approximation is valid, the MHD equations can be casted in a different
formulation. Employing Ohm’s law and the charge conservation condition (DJ/Dt = 0), a Poisson
equation for the electric potential φ is given by
∇2 φ = ∇ · (u × B) (2.10)
J = σ(−∇φ + u × B) (2.11)
If Eq.(2.10) is substituted to Eq.(2.9), the electric potential formulation of the MHD equations
is obtained where the electric potential φ is considered as the fundamental electromagnetic vari-
able instead of the magnetic induction B. Both formulas can be implemented into computational
magneto-hydrodynamic numerical codes, although the electric potential one is generally preferred
due to reasons that would be discussed in section 3. In the following, we will always assume that
the induction-less approximation is valid, considering that we will treat a liquid metal flow with a
low fluid velocity and magnetic permeability.
8
2.3. Boundary conditions Chapter 2. Magnetohydrodynamics
The Hartmann number expresses the relation between electromagnetic and viscous forces acting
on the fluid, hence representing the magnetic field intensity and the deviation from the ordinary
hydrodynamic behavior. In a typical fusion reactor blanket, this parameter can reach up to 104 . It
is formulated as 1/2 r
Electromagnetic forces σ
Ha = = BL (2.12)
Viscous forces ρν
The characteristic length L for a rectangular duct is the half-length in the magnetic field direction.
The boundary layer structure is dependent on the associated wall orientation with the magnetic
field. An Hartmann layer is formed for perpendicular walls, whereas a Shercliff layer occurs for
parallel walls. The scaling of these layers depends on the Hartmann number according to the
relations
δH = 1/Ha (2.13a)
1/2
δS = 1/Ha (2.13b)
Therefore, we define Hartmann walls those where the former condition applies and, conversely, side
walls for the latter. In the more general case where the magnetic field direction is arbitrary (i.e.
not aligned with any pair of walls), the Hartmann layer behavior is dominant wherever it exists a
non-null normal component of the magnetic field to the wall.
The interaction parameter measures the relative strength of the electromagnetic and inertial
forces. Thus, it is correlated to both the Hartmann and Reynolds number through the relation
The group ρ/σB 2 is called magnetic damping time τ and represents the characteristic time in which
the magnetic field dissipates the kinetic energy carried by the flow. If N 1, then τ is big and
the flow is unaffected by the electromagnetic drag. Otherwise, the flow is dominated by the Lorentz
force and it can be considered as inertia-less. The turbulence structures are largely suppressed and
the existence region of the laminar regime is extended. In a typical fusion reactor blanket, this
parameter can reach up to 104 .
The electromagnetic drag is not uniformly distributed on the duct cross-section but is dependent
on the induced current paths inside the fluid. Mean path resistivity influences the MHD pressure
drops severity, whereas the path geometry can create local areas where the Lorentz force is reduced,
hence causing the onset of jets. Therefore, the flow features are influenced by the relative conductivity
between the duct wall and the fluid, which is expressed by the wall conductance ratio
σw t
c= (2.15)
σ L
A value of c → 0 characterizes a duct with poorly conductive walls, whereas a duct with c > 1
is associated to well conducting walls. Even small variations for the value of this parameter can
drastically change the flow features, i.e. triggering the onset of turbulence or high velocity jets, as
it is observed in section 4.
9
2.3. Boundary conditions Chapter 2. Magnetohydrodynamics
perfectly conducting wall the current density flux is conserved at the fluid/solid interface Γ and the
tangential component JΓ must be zero, hence from the Ampere’s law Eq.(2.7) we obtain that the
magnetic induction gradient normal to the wall must be equal to zero. Otherwise, for a perfectly
insulating wall JΓ 6= 0 and the interface can be considered as an isosurface of the magnetic field.
Thus, the value can be set to the applied field intensity B0 . The BCs for the B-formulation can be
summarized as
∂B
=0 (valid for c = ∞) (2.16a)
∂n
B(Γ) = B0 (valid for c = 0) (2.16b)
In an analog way, for the φ-formula BCs can be expressed for the cases discussed with the relations
JΓ0 = 0 (2.18a)
J · n = Jw · n (2.18b)
φ = φw (2.18c)
For the φ-formula, it is possible to employ these conditions to solve the Poisson equation in both
the fluid and solid domains. For the latter the Eq.(2.11) is employed, whereas for the former
If the wall thickness tw is much lower than the characteristic length L, it can be assumed that the
currents in the wall turns in a quasi bi-dimensional way in the tangential direction. Therefore the
Jw,t and φw are constant across the wall. The component of Jw normal to the wall can be obtained
by a balance on the wall element, leading to
J · n = Jw · n = ∇T · (tw σw ∇T φw ) (2.20)
This is called the thin wall approximation and can be used to represent the effect of a finite conduc-
tivity wall without solving Eq. 2.19 in the solid domain. [6].
For the B-formulation it is not possible to define easily a local BC at the duct external surface
since we have to consider the magnetic field in the space surrounding the duct. From Eq.(2.18a),
the Eq. (2.7) takes the form
∇×B=0 (2.21)
It is then possible to define B as the gradient of a magnetic scalar potential ψ. A fixed value of
ψ must therefore be provided at Γ, in order to ensure the magnetic field divergence-free condition,
whereas in the outside space it must be true the condition
∇2 ψ = 0 (2.22)
10
Chapter 3
Implementation
In order to obtain the J distribution, a scalar Eq.(2.10) must be solved instead of a vectorial
Eq.(2.9) reducing the overall scheme complexity and thus improving its velocity [8].
Only the current density J is influenced by the velocity u, whereas the magnetic field B is
11
3.2. Derivation of MhdPisoFoam Chapter 3. Implementation
determined just by the boundary conditions. The MHD coupling non-linearity is lessened and
the numerically stability is improved [9].
Boundary conditions are easier to implement even for complex geometries and non-uniform
magnetic fields [6].
For the design of fusion reactor blankets, the inductionless approximation is always applicable and
almost the totality of the studies in the literature employs the electric potential formula. However,
this approach is not without drawbacks.
For a collocated mesh, a conservative and consistent numerical scheme was developed in 2007
by Ni et al. for both structured [8] and unstructured [9] grids in order to address these issues. The
authors demonstrated the capability of the scheme to correctly simulate 2D and 3D MHD flows and
since then it is considered as the state-of-the-art, being employed in the development of codes for
fusion reactor blanket design [10, 11]. In our implementation, the Lorentz force is treated as a source
term but, thanks to the consistent interpolation technique employed for the J reconstruction at the
cell center, it can ensure the conservation of both momentum and charge. The general four step
projection method for MHD flows developed by Ni [8] was modified in order to employ a PISO loop
for a stronger pressure-velocity coupling as described by De Les Valls [1].
The modification of the base solver can be done following the steps reported below:
Step 1: At first, the new variables (i.e. electric potential and electric conductivity) must be
inserted in the createFields files of both solid and fluid.
12
3.2. Derivation of MhdPisoFoam Chapter 3. Implementation
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Those quantities are associated to the mesh domain of both materials, it is compulsory to
initialize their values (option IOObject::MUST-READ), and they will be written in the output
file (option IOObject::AUTO-WRITE)
Step 2: The magnetic field vector, which is supposed to be constant property, has to be added
to the readTransportProperties.H file.
Step 3: Adding a source term for Lorentz body forces (lorentz) to the UEqn.H files.
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff()
- (1.0/rho) * lorentz
);
UEqn.relax();
13
3.2. Derivation of MhdPisoFoam Chapter 3. Implementation
Step 4: Now that all the main parameters have been declared, the coupling of the electric
potential field between solid and fluid can be coded. That is made implementing the following
set of equations in the header file solvePotE.H:
1. Evaluation of magnetic flux term on cell faces
χ = (u × B) · Sf
2. Solve Poisson equation for electric potential in fluid and solid regions, respectively:
∇2 (σφ) − σ∇ · χ = 0
∇2 (σw φ) = 0
3. Computation of current density flux from normal gradient of electric potential on cell
faces and magnetic flux. The value at the center of the face is considered.
jf = −∇sn φ · Sf + χ
5. The final, conservative, current density distribution is employed for the Lorentz force
calculation
lorentz = σ(Jc × B)
Where Ωp stands for the single cell volume whereas Sf points the single cell external sur-
face. The terms rp and rr are the coordinate vectors of the cell center and the face centre,
respectively. The resulting file is shown below:
solvePotE.H
{
while (simpleSolid.correctNonOrthogonal())
{
coupledFvScalarMatrix PotEqns(2);
14
3.2. Derivation of MhdPisoFoam Chapter 3. Implementation
)
);
PotEqns.solve();
}
//consistent and conservative scheme for current density (Ni, 2007)
surfaceScalarField jn = -(fvc::snGrad(PotE) * mesh.magSf()) + psiub;
jfinal.correctBoundaryConditions();
Step 5: At last, few additions are necessary to the final MhdPisoFoam.C file, namely the
initialization of the lorentz term (see Eq.2.11) and the inclusion of the solvePotE.H files, as
it is done in the snippet below:
while (runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readTimeControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"
# include "UEqn.H"
p_rgh.storePrevIter();
while (piso.correct())
{
# include "pEqn.H"
}
radiation->correct();
rhoCpsolid.oldTime();
rhoCpsolid = solidThermo.rho()*solidThermo.C();
15
3.2. Derivation of MhdPisoFoam Chapter 3. Implementation
kappaEff.correctBoundaryConditions();
ksolid.correctBoundaryConditions();
# include "solveEnergy.H"
# include "solvePotE.H"
runTime.write();
16
Chapter 4
Validation tutorial
In the following Section is described a tutorial case, that could help the reader understanding what
is needed to run (and test) MhdPisoFoam. The model studied is three-dimensional and it consists
in a fully developed MHD flow confined in a straight duct with square cross-section. The channel
side-walls are assumed to be perfectly insulated, consequently they are simulated just as boundary
patches. Conversely, the Hartmann-walls are set as electrically conductive and for this reason they
are modelled as separated bodies. Isothermal flow conditions are enforced (reference temperature
273.15K), hence all the materials physical properties are imposed as constant. The fluid is assumed
to be incompressible and under laminar regime and the magnetic field is treated as one-dimensional,
always perpendicular to the duct axis (therefore perpendicular to the main velocity component). At
last is worth mentioning that both the solid and the liquid are “dummy”, i.e. their properties do not
correspond to existing materials. All the quantities of the tutorial cases are expressed in SI units.
The aforementioned configuration (insulated side-walls and conductive Hartmann-walls) has been
chosen because it is the one that presents the most prominent alterations of the flow velocity, there-
fore it is ideal to showcase the effects of Lorentz forces and evaluate their proper implementation [5].
The tutorial is set to compare the results, in terms of velocity profiles, of three different cases: a
classical hydrodynamic flow and two MHD flows at the same Hartmann number (Ha) but different
walls conductance ratio c. In Figure 4.1a is reported the main structure of the tutorial direc-
tory (bash command: tree -L 1): the usage of the files (in green) will be discussed in the next
sections. Furthermore, in Figure 4.1b is shown the tree-diagram of the directory (bash command:
tree -d -L 3). It is important to notice that the folders that contains the files for handling the fluid
region (0,constant,system) also hosts the directories (solid) for the solid domain. Eventually,
Figure 4.1c, the internal structure of a single case directory (bash command: tree -L 4 Ha50c04)
is outlined: files for geometry, mesh, boundary conditions and control of the calculation will be
discussed in the following.
17
4.1. Geometry and mesh grid Chapter 4. Validation tutorial
(a)
(b) (c)
Figure 4.2: Scheme of the channel. In light grey is depicted the fluid region, whereas in green the
solid domain. The red vector points the magnetic field. The walls perpendicular to the field are
addressed as Hartmann walls, the parallel ones instead as Side walls.
18
4.1. Geometry and mesh grid Chapter 4. Validation tutorial
convertToMeters 1;
vertices
(
//topWall
( 0 1.2 0)
(10 1.2 0)
(10 1.4 0)
( 0 1.4 0)
( 0 1.2 1)
(10 1.2 1)
(10 1.4 1)
( 0 1.4 1)
//Botwall
(0 0 0)
(10 0 0)
(10 0.2 0)
(0 0.2 0)
(0 0 1)
(10 0 1)
(10 0.2 1)
(0 0.2 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (60 30 70) simpleGrading (1 1 ((50 50 36.17701855)(50 50 0.02764)))
hex (8 9 10 11 12 13 14 15) (60 30 70) simpleGrading (1 1 ((50 50 36.17701855)(50 50 0.02764)))
);
edges
(
);
boundary
(
topInter
{
type regionCouple;
shadowRegion region0;
shadowPatch topWall;
attached off;
isWall on;
zone topInterZone;
master off;
bridgeOverlap off;
faces
(
(1 5 4 0)
);
}
botInter
{
type regionCouple;
shadowRegion region0;
shadowPatch bottomWall;
attached off;
isWall on;
zone botInterZone;
master off;
bridgeOverlap off;
faces
19
4.1. Geometry and mesh grid Chapter 4. Validation tutorial
(
(10 14 15 11)
);
}
outsidePatchSolid
{
type patch;
faces
(
(3 7 6 2)
(9 13 12 8)
(0 4 7 3)
(11 15 12 8)
(2 6 5 1)
(9 13 14 10)
(0 3 2 1)
(8 11 10 9)
(4 5 6 7)
(15 14 13 12)
);
}
);
The solid domain is divided in two bodies (the top and bottom Hartmann walls) that have the
same extension along each direction, but do not have any patches in common: they are indeed
separated by the fluid region (also region0 in the dictionaries).
The channel is therefore 10m long in the axial direction (x ), and 1m wide along both the toroidal
(y) and poloidal (z ) direction. The characteristic length of the channel is therefore a = 0.5m. The
thickness of the walls is varied, in order to change the conductance ratio from c = 0.1 for the first
MHD case to c = 0.4 for the second one (see Eq. 2.15).
The blocks constructor is utilized for declaring the number of the volumes that belong to the solid
domain (2 in this case), the shape of the bodies (hexahedral) and the number of cells along each axis.
Moreover, a grid grading option (simpleGrading) is employed to refine the mesh, within the thin
boundary layers, for the MHD cases. All the edges are straight and they are assumed to connect only
vertices that have exactly two common coordinates, that is the default option thus the edges field is
left empty. At last it is compulsory to define the boundary patches of the domain, specifying their
role (type) and their location (using 4 of the existing vertices). Each part of the solid domain has
a total of 6 faces, 5 of them being external patches and 1 being the interface (type regionCouple)
with the fluid body. The definition of an interface boundary is of paramount importance for a con-
jugate solver: it is indeed necessary a sub-dictionary where the user must declare the domain this
patch is linked to and the interface boundary of the other region (shadowRegion and shadowPatch
respectively). To properly set a functioning coupled-domains case, it is important to define right
nomenclature for the all the interfaces patches, as it is further discussed in Section 4.3. In the next
snippet of code is reported the blockMeshDict for the fluid region (or region0).
The main differences with the walls dictionary are that there is only one fluid body, as obvious, and
the non-interface patches are named in order to make clearer the definition of the boundary condi-
tions on them (inlet,outlet,side1,side2). Moreover, the reader can notice the non-uniformity
of the mesh is extended also to the poloidal direction in this case: this is a pivotal feature for the
tutorial that is mandatory to explain. As will be presented in the next Section, the MHD flows
simulated are at the same Hartmann number i.e. Ha = 50. To accurately detect the fluid behaviour
within the thin boundary layers close to both side and Hartmann walls, it is known that is needed
a number of cells that goes from a minimum of 5 to a maximum of 10 [12]. However, the thickness
of those layers is relatively small compared with the channel characteristic length (remember Eqs.
2.13). Therefore, to guarantee a mesh grid that is reliable and efficient in terms of computational
effort, a total expansion ratio is applied to the cells in both z and y direction. In Figure 4.3 is de-
picted the resulting mesh employed for the calculations. The grid is computed to obtain 7 elements
within the thinner layer (Hartmann layer).
Nevertheless, the simpleGrading functionality it is not fully supported by foam-extend. A simple
20
4.1. Geometry and mesh grid Chapter 4. Validation tutorial
Figure 4.3: Fluid domain mesh grid. The cells expansion ratio allows to obtain the desired reso-
lution, in terms of element numbers, within the thin boundary layers. Parameter a = 0.5m is the
characteristic length.
workaround to solve this issue is to generate the mesh with another distribution of OpenFOAM (e.g.
OpenFOAM v.9).
convertToMeters 1;
vertices
(
( 0 0.2 0)
(10 0.2 0)
(10 1.2 0)
( 0 1.2 0)
( 0 0.2 1)
(10 0.2 1)
(10 1.2 1)
( 0 1.2 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (60 70 70) simpleGrading (1 ((50 50 36.17701855)(50 50 0.02764)) ((50 50
36.17701855)(50 50 0.02764)))
);
edges
(
);
boundary
(
topWall
{
21
4.1. Geometry and mesh grid Chapter 4. Validation tutorial
type regionCouple;
shadowRegion solid;
shadowPatch topInter;
attached off;
isWall on;
zone topWallZone;
master on;
bridgeOverlap off;
faces
(
(3 7 6 2)
);
}
inlet
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet
{
type patch;
faces
(
(2 6 5 1)
);
}
bottomWall
{
type regionCouple;
shadowRegion solid;
shadowPatch botInter;
attached off;
isWall on;
zone bottomWallZone;
master on;
bridgeOverlap off;
faces
(
(1 5 4 0)
);
}
side1
{
type wall;
faces
(
(0 3 2 1)
);
}
side2
{
type wall;
faces
(
(4 5 6 7)
);
}
);
22
4.2. Boundary conditions and run control Chapter 4. Validation tutorial
(a) (b)
the derivative terms of the balance equations (fvSchemes), the solution of the discretized system
(fvSolution) and the general control of the run (controlDict). The second-order central difference
scheme is applied for both convective and diffusive terms of discretized equation, whereas the first-
order Euler scheme is used for time integration. The convergence of the solution can be controlled
run-time by the user changing the time- step in the controlDict. If the reader is not familiar with
Third-Party utilities that can plot the residuals and the Courant number of the calculations (such
as the one provided by the pyFoam package), a workaround for controlling the right behaviour of
the simulation is to print the run-summary (log file for this tutorial) on screen (bash command:
tail -f log). The Courant number and the maximum velocity are evaluated automatically by
OpenFOAM and the user can control that the increasing of the time-interval do not cause the
divergence of those parameters.
The tutorial is thought for parallel-running the three cases simultaneously. The default number of
processor is 3 for each MHD simulation and 2 for the hydrodynamic model. A decomposeParDict
is needed to divide the domain (either solid and liquid) in all the non-virtual processors that the
working-machines owns. An example of such a file is reported below, where can be noticed that the
simple decomposition method has been adopted and the domain is divided in 3 sub-domains along
the x -direction.
23
4.3. Running the tutorial and post-processes using BASH scripts Chapter 4. Validation tutorial
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 3;
method simple;
simpleCoeffs
{
n (3 1 1);
delta 0.001;
}
// ************************************************************************* //
Step1: source the OpenFOAM distribution that you prefer (remember not foam-extend.x)
and, from the tutorial folder, run the TopoMesh script that is shown below.
Tut="
Ha50c01
Ha50c04
Hydro
"
for folder in $Tut;
do
cd $folder;
blockMesh -region solid;
setSet -region solid -batch solid.setSet;
setsToZones -region solid -noFlipMap;
blockMesh;
setSet -batch fluid.setSet;
setsToZones -noFlipMap;
cd ..;
done
# ----------------------------------------------------------------- end-of-file
The script is designed to run the blockMesh utility in each case folders (variable name in
bash: Tut), then using the setSet and setToZone functions objects that are needed to detect
24
4.3. Running the tutorial and post-processes using BASH scripts Chapter 4. Validation tutorial
and name the interface regions in accordance with what is required by the regionCoupling
boundary condition. Notice that the program will complain because it does not recognize
the solver library liblduSolvers.so that is called in the controlDict but the mesh will be
computed anyway. It is suggested to control the status of the mesh using the paraFoam utility.
If the mesh has to be re-generated for whatever reason, the AllCaseClean script can be run
and the step1 must be repeated.
Step2: after the domain has been meshed, the user can exit the current terminal window and
open a new one where foam-extend version should be sourced. The following ParaRun script
has to be run in order to start the calculation.
Tut="
Ha50c01
Ha50c04
"
decomposePar -case Hydro;
decomposePar -case Hydro -region solid;
mpirun -np 2 MhdPisoFoam -case Hydro -parallel > Hydro/log &
# ----------------------------------------------------------------- end-of-file
The script launches the decomposePar in each folders for each domain and then initializes
the parallel run through the command mpirun, being np the flag that establishes the number
of processors to be used. The reader can notice that for the hydrodynamic case solution are
used only 2 processes, since it will be generally faster than the others (because the electric
potential field it is not solved). The calculations are put in background and their information
are collected in a log file. As already mentioned in previous Section, the user must control the
speed of the run changing the time-step from the controlDict, paying attention that this will
not cause a divergent trend. The default value chosen is 1 · 10−3 s, but the Author found that
it has to be increased up to 7 · 10−3 s during the run to reach the fully-developed condition
within the specified end time.
Step3: after the simulations reach their end-time, the post-processing script can be launched.
cases="
Ha50c01
Ha50c04
Hydro
"
mkdir Results
25
4.3. Running the tutorial and post-processes using BASH scripts Chapter 4. Validation tutorial
GraphName="Velocity Pofiles_$folder.png"
gnuplot<<Velocity
set terminal pngcairo font "helvetica,20" size 1000, 1000
set output 'Results/$GraphName'
set key center top outside
set key horizontal
set xlabel "non-dimensional channel height z/2a"
set ylabel "non-dimensional velocity U/U0"
set grid
plot \
"$folder/postProcessing/sets/$latestTime/SideLayerProfiles_U.xy" u 1:(\$2/$Uref) w lines
lw 2 lc rgb "red" title "foam-extend", \
"SloanSol$folder" u 1:2 w points pt 7 ps 1.5 lc rgb "midnight-blue" title "Analytical"
Velocity
done
GraphName="Electric Potential.png"
gnuplot<<POT
set terminal pngcairo font "helvetica,20" size 1000, 1000
set output 'Results/$GraphName'
set key center top outside
set key horizontal
set xlabel "non-dimensional channel height z/2a"
set ylabel "Electric Potential"
set grid
plot \
"Ha50c01/postProcessing/sets/$latestTimeA/SideLayerProfiles_PotE.xy" u 1:2 w lines lw 2
lc rgb "red" title "Conductance ratio c = 0.1", \
"Ha50c04/postProcessing/sets/$latestTimeB/SideLayerProfiles_PotE.xy" u 1:2 w lines lw 2
lc rgb "green" title "Conductance ratio c = 0.4"
POT
The script is designed to make a new folder Tutorial/Results where will be gathered the
outcomes of the calculations. Then, the cases are re-built from the parallel-running set-up
employing the reconstructPar utility and the latest time folder is selected so its name can
be used as a variable in the rest of the file. After, the sample utility is run to collect the data
along the sampling regions that have been defined within system/sampleDict.
26
4.3. Running the tutorial and post-processes using BASH scripts Chapter 4. Validation tutorial
class dictionary;
object sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
interpolationScheme cellPoint;
setFormat raw;
sets
(
SideLayerProfiles
{
type uniform;
axis distance;
start (5 0.6999999 0);
end (5 0.6999999 1);
nPoints 1000;
}
CentralVelocity
{
type uniform;
axis distance;
start (5 0.6999999 0.49);
end (5 0.6999999 0.51);
nPoints 2;
}
);
fields
(
U
PotE
);
// ************************************************************************* //
Two sets of data are sampled along two lines (z -direction) with the specified length and
locations: the first set samples the velocity and the electric potential between the side walls,
whereas the second is used to extract the velocity at the center of the channel which will be
assigned to the script variable Uref .
At last the application gnuplot is called, to make the final graphs that serve as a benchmark
solver performances.
In Figure 4.5 are shown the velocity profiles computed at the centre of the duct for the hydrodynamic
and the magnetohydrodynamic flows. As expected, the classical parabolic-shaped trend of the
velocity is deeply altered in the MHD flows: the Lorentz forces (caused by the electrical currents
arising in the fluid) brake the liquid in the core region of the channel, conveying a substantial fraction
of the mass flow rate towards the side layers. When the conductivity of the walls is increased (from
c = 0.1 to c = 0.4) also the currents intensity grows, magnifying the velocity imbalance between
the core and the side. The dots in the MHD graph represent the analytical solution provided by
Sloan [13] for a MHD flow in rectangular channel with electrical conductive walls. It is clear that
MhdPisoFoam is able to model with a good accuracy those kind of flows. Moreover, in Figure 4.6
is also depicted the electric potential along z -direction. It can be noticed how much it is strictly
linked with the mass flow rate, presenting a more irregular profile whenever the velocity in side
layers increases.
27
4.3. Running the tutorial and post-processes using BASH scripts Chapter 4. Validation tutorial
Figure 4.5: Scaled velocity profile along non-dimensional z-coordinate plotted on the plane x = 5m.
28
4.3. Running the tutorial and post-processes using BASH scripts Chapter 4. Validation tutorial
29
Bibliography
[1] E. de les Valls, Development of a simulation tool for MHD flows under nuclear fusion conditions.
PhD thesis, Dept. of Physics and Nuclear Engineering, Universitat Politecnica de Catalunya,
2011.
[2] A. Tassone, “Magnetic induction and electric potential solvers for incompressible mhd flows.,”
In Proceedings of CFD with OpenSource Software, 2016, Edited by Nilsson. H., available online.,
2016.
[3] E. Iraola, “Implementation of quasi-2d magnetohydrodynamic mixed convection solver for in-
compressible flows in liquid metal channels.,” In Proceedings of CFD with OpenSource Software,
2020, Edited by Nilsson. H., available online., 2020.
[4] P. Davidson, An introduction to magnetohydrodynamics, vol. 25. Cambridge university press,
2001.
[5] U. Müller and L. Bühler, Magnetofluiddynamics in channels and containers. Springer Science
& Business Media, 2013.
[6] C. Mistrangelo, “Simulation of magneto-hydrodynamic (MHD) flows in OpenFOAM.”
Presentation at NUMAP-FOAM Summer School University of Zagreb, available online
at: http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/SummerSchool2010/Chiara.pdf, Septem-
ber 2010.
[7] T. Valikangas, “Conjugate heat transfer in openfoam.,” In Proceedings of CFD with OpenSource
Software, 2016, Edited by Nilsson. H., available online., 2016.
[8] J. Ni et al., “A current density conservative scheme for incompressible MHD flows at a low
magnetic reynolds number. Part I: On a rectangular collocated grid system,” Journal of Com-
putational Physics, vol. 227, no. 1, pp. 174–204, 2007.
[9] J. Ni et al., “A current density conservative scheme for incompressible MHD flows at a low
magnetic reynolds number. Part II: On an arbitrary collocated mesh,” Journal of Computational
Physics, vol. 227, no. 1, pp. 205–228, 2007.
[10] C. Mistrangelo and L. Bühler, “Development of a numerical tool to simulate magnetohydro-
dynamic interactions of liquid metals with strong applied magnetic fields,” Fusion Science and
Technology, vol. 60, no. 2, pp. 798–803, 2011.
[11] J. Feng, H. Chen, Q. He, and M. Ye, “Further validation of liquid metal MHD code for un-
structured grid based on OpenFOAM,” Fusion Engineering and Design, vol. 100, pp. 260–264,
2015.
[12] A. Blishchik, “An extensive numerical benchmark of the various magnetohydrodynamic flows,”
International Journal of Heat and Fluid Flow, vol. 90, no. 108800, 2021.
[13] D. Sloan, “Magnetohydrodynamic flow in a rectangular pipe between conducting plates,”
ZAMM, vol. 46, no. 7, 1966.
30
Study questions
31
Appendix A
In the following are shown the dictionaries (in alphabetical order) for the tutorials settings.
gravitational acceleration g
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 0 0); // (0 -9.81 0);
// ************************************************************************* //
32
Appendix A. Boundary conditions and parameters dictionaries
dimensions [1 1 -3 -1 0 0 0];
boundaryField
{
botInter
{
type chtRcThermalDiffusivity;
remoteField kappaEff;
value uniform 1e-10;
}
topInter
{
type chtRcThermalDiffusivity;
remoteField kappaEff;
value uniform 1e-10;
}
outsidePatchSolid
{
type zeroGradient;
}
// ************************************************************************* //
dimensions [1 1 -3 -1 0 0 0];
boundaryField
{
topWall
{
type chtRcThermalDiffusivity;
remoteField k;
value uniform 1e-10;
}
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
bottomWall
{
33
Appendix A. Boundary conditions and parameters dictionaries
type chtRcThermalDiffusivity;
remoteField k;
value uniform 1e-10;
}
side1
{
type zeroGradient;
}
side2
{
type zeroGradient;
}
}
// ************************************************************************* //
pressure
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
topWall
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
bottomWall
{
type zeroGradient;
}
side1
{
type zeroGradient;
}
side2
{
type zeroGradient;
}
}
34
Appendix A. Boundary conditions and parameters dictionaries
// ************************************************************************* //
buoyant pressure
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
topWall
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
bottomWall
{
type zeroGradient;
}
side1
{
type zeroGradient;
}
side2
{
type zeroGradient;
}
}
/* type buoyantPressure;
rho rhok;
*/
// ************************************************************************* //
35
Appendix A. Boundary conditions and parameters dictionaries
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object PotE;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 2 -3 0 0 -1 0];
boundaryField
{
topWall
{
type regionCoupling;
value uniform 0.0;
remoteField PotE;
}
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
bottomWall
{
type regionCoupling;
value uniform 0.0;
remoteField PotE;
}
side1
{
type zeroGradient;
}
side2
{
type zeroGradient;
}
}
// ************************************************************************* //
36
Appendix A. Boundary conditions and parameters dictionaries
radiation on;
radiationModel none;
noRadiation
{
}
// ************************************************************************* //
RASModel laminar;
turbulence on;
printCoeffs on;
// ************************************************************************* //
boundaryField
{
topWall
{
type regionCoupling;
value uniform 50000;
remoteField sigma_w;
37
Appendix A. Boundary conditions and parameters dictionaries
}
inlet
{
type fixedValue;
value uniform 50000;
}
outlet
{
type fixedValue;
value uniform 50000;
}
bottomWall
{
type regionCoupling;
value uniform 50000;
remoteField sigma_w;
}
side1
{
type fixedValue;
value uniform 50000;
}
side2
{
type fixedValue;
value uniform 50000;
}
}
// ************************************************************************* //
boundaryField
{
botInter
{
type regionCoupling;
value uniform 50000;
remoteField sigma;
}
topInter
{
type regionCoupling;
value uniform 50000;
remoteField sigma;
38
Appendix A. Boundary conditions and parameters dictionaries
}
outsidePatchSolid
{
type fixedValue;
value uniform 50000;
}
// ************************************************************************* //
fluid temperature
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
boundaryField
{
topWall
{
type chtRcTemperature;
radiation off;
K kappaEff;
remoteField T;
value uniform 273;
}
inlet
{
type fixedValue;
value uniform 273;
}
outlet
{
type fixedValue;
value uniform 273;
}
bottomWall
{
type chtRcTemperature;
radiation off;
K kappaEff;
remoteField T;
value uniform 273;
}
side1
{
type fixedValue;
value uniform 273;
}
side2
39
Appendix A. Boundary conditions and parameters dictionaries
{
type fixedValue;
value uniform 273;
}
}
// ************************************************************************* //
solid temperature
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
boundaryField
{
topInter
{
type chtRcTemperature;
radiation off;
K k;
remoteField T;
value uniform 273;
}
botInter
{
type chtRcTemperature;
radiation off;
K k;
remoteField T;
value uniform 273;
}
outsidePatchSolid
{
type fixedValue;
value uniform 273;
}
}
// ************************************************************************* //
40
Appendix A. Boundary conditions and parameters dictionaries
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object thermalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermal
{
type constant;
rho rho [1 -3 0 0 0] 10000;
C C [0 2 -2 -1 0] 1e-10;
k k [1 1 -3 -1 0] 1e-10;
gaps
(
);
sources
(
);
}
// ************************************************************************* //
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 0.001;
Cp Cp [0 2 -2 -1 0 0 0] 1e-10;
Pr Pr [0 0 0 0 0 0 0] 1e-10;
B0 B0 [1 0 -2 0 0 -1 0] (0 0 0);
41
Appendix A. Boundary conditions and parameters dictionaries
// ************************************************************************* //
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 0.001;
Cp Cp [0 2 -2 -1 0 0 0] 1e-10;
Pr Pr [0 0 0 0 0 0 0] 1e-10;
B0 B0 [1 0 -2 0 0 -1 0] (0 0.45 0);
// ************************************************************************* //
turbulent properties
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RASModel;
// ************************************************************************* //
42
Appendix A. Boundary conditions and parameters dictionaries
Velocity
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
boundaryField
{
topWall
{
type fixedValue;
value uniform (0 0 0);
}
inlet
{
type fixedValue;
value uniform (1e-3 0 0);
}
outlet
{
type zeroGradient;
}
bottomWall
{
type fixedValue;
value uniform (0 0 0);
}
side1
{
type fixedValue;
value uniform (0 0 0);
}
side2
{
type fixedValue;
value uniform (0 0 0);
}
}
// ************************************************************************* //
43
Appendix B
Here are listed (in alphabetical order) the dictionaries and scripts employed for the simulations
management and run control.
Tut="
Ha50c01
Ha50c04
"
for folder in $Tut;
do
cd $folder;./Allclean;cd ..;
done
control dictionary
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.1 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs
(
"liblduSolvers.so"
)
application MhdPisoFoam;
44
Appendix B. System and run control dictionaries
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 16;
deltaT 1e-3;
writeControl adjustableRunTime;
writeInterval 2;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep off;
maxCo 0.5;
// ************************************************************************* //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default Gauss linear;
div(phi,U) Gauss linear;
div(phi,T) Gauss upwind;
div(phi,k) Gauss upwind;
45
Appendix B. System and run control dictionaries
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default Gauss harmonic uncorrected;
laplacian(k,T) Gauss harmonic uncorrected;
}
interpolationSchemes
{
default harmonic;
interpolate(k) harmonic;
}
snGradSchemes
46
Appendix B. System and run control dictionaries
{
default corrected;
}
// ************************************************************************* //
solvers
{
"p_rgh|p"
{
solver PCG;
preconditioner DIC;
minIter 0;
maxIter 1000;
tolerance 1e-7;
relTol 0.01;
}
p_rghFinal
{
solver PCG;
preconditioner DIC;
minIter 0;
maxIter 1000;
tolerance 1e-7;
relTol 0;
}
U
{
solver BiCGStab;
preconditioner DILU;
minIter 0;
maxIter 1000;
tolerance 1e-7;
relTol 0; //0.01;
}
T_T
{
solver BiCGStab;
preconditioner Cholesky;
minIter 0;
maxIter 1000;
tolerance 1e-7;
relTol 0.001;
47
Appendix B. System and run control dictionaries
}
PotE_PotE
{
solver BiCGStab;
preconditioner Cholesky;
minIter 1;
maxIter 1000;
tolerance 1e-7;
relTol 0;//0.0001;
}
G
{
solver PCG;
preconditioner DIC;
minIter 1;
maxIter 1000;
tolerance 1e-7;
relTol 0.1;
}
epsilon
{
solver BiCGStab;
preconditioner DILU;
minIter 1;
maxIter 100;
tolerance 1e-7;
relTol 0.01;
}
k
{
solver BiCGStab;
preconditioner DILU;
minIter 1;
maxIter 100;
tolerance 1e-7;
relTol 0.01;
}
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
p_rghRefCell 0;
p_rghRefValue 0;
}
relaxationFactors
{
}
// ************************************************************************* //
48
Appendix B. System and run control dictionaries
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
}
SIMPLE
{
}
relaxationFactors
{
T 0.9;
PotE 0.3;
}
// ************************************************************************* //
49
Appendix B. System and run control dictionaries
0.360699554 0.980841436
0.380163294 0.987720409
0.400552569 0.987857988
0.420941844 0.987995567
0.440404334 0.988126893
0.461720394 0.988270726
0.480256098 0.988395799
0.499719838 0.995274771
0.521037149 1.002166251
0.541425173 0.995556184
0.561814448 0.995693763
0.580350152 0.995818835
0.601666212 0.995962668
0.621128702 0.996093994
0.641516726 0.989483927
0.661907251 0.996369153
0.681370992 1.003248126
0.701759016 0.996638058
0.711031871 1.023691182
0.72122901 1.037255265
0.740697753 1.071124825
0.761097034 1.125243578
0.781501317 1.206352919
0.800980066 1.294203653
0.820465069 1.41579262
0.832280157 1.479781694
0.840880609 1.557630782
0.852435299 1.626463319
0.861299901 1.719711884
0.871505795 1.780509494
0.881712939 1.848054752
0.892843117 1.895363322
0.902118473 1.935911739
0.921583464 1.949538358
0.93300154 1.920098201
0.941952728 1.84171359
0.9507242 1.718871487
0.957219786 1.630402991
0.961357684 1.531453164
0.966059072 1.410859705
0.970602915 1.286757601
0.974303549 1.176154991
0.977835971 1.070579773
0.981639397 0.951293122
0.984302359 0.824584795
0.987242583 0.71792804
0.99123521 0.540088819
0.993698652 0.416260021
0.995452546 0.297023945
0.99720511 0.170604251
0.999080719 0.047227274
50
Appendix B. System and run control dictionaries
0.012775633 1.581800864
0.01358977 1.715626733
0.014795739 1.83416442
0.01600051 1.946236851
0.017209475 2.080937679
0.018412647 2.184389768
0.019615421 2.285686772
0.021762568 2.415801375
0.022287721 2.558630638
0.024546472 2.69928042
0.02563488 2.822342988
0.026838852 2.930105248
0.029238739 3.10216888
0.03163603 3.260224455
0.034031324 3.407504604
0.03642542 3.548319497
0.038935811 3.677785072
0.041485208 3.819443228
0.044197442 3.958556018
0.047297623 4.076100782
0.051175966 4.194225485
0.054327076 4.312776297
0.057890257 4.373142657
0.061995803 4.474102544
0.067570272 4.54836418
0.077773664 4.595666497
0.091655278 4.486974137
0.10090077 4.366402848
0.10640864 4.235544747
0.112307462 4.121365165
0.116436278 4.039499882
0.119361431 3.961669114
0.122128029 3.88746376
0.124681128 3.806806581
0.129867873 3.683570847
0.134446207 3.563040255
0.137056391 3.500868337
0.140573681 3.401758265
0.144711638 3.281101554
0.14848142 3.178545054
0.151779147 3.084318354
0.156103432 2.992397337
0.160864149 2.86883175
0.164741829 2.75367246
0.170048572 2.639057866
0.175354676 2.520995137
0.179311052 2.389873902
0.18596241 2.260732721
0.19127107 2.156462538
0.196581329 2.060812696
0.20147135 1.944679302
0.207786867 1.83187485
0.213691149 1.747148102
0.220878808 1.64791417
0.230221793 1.502657756
0.240290017 1.371391979
0.250308826 1.281897317
0.260645523 1.189343096
0.281012285 1.068023033
0.300459766 0.987182598
0.320840285 0.94008665
0.340300273 0.926722682
0.359764014 0.933601655
0.381081324 0.940493135
0.400546315 0.954119754
0.421866128 0.974506528
0.440403083 0.981379247
0.460794859 0.995012119
51
Appendix B. System and run control dictionaries
0.481185385 1.001897346
0.500647874 1.002028672
0.521037149 1.002166251
0.541425173 0.995556184
0.560885161 0.982192216
0.581270684 0.962086855
0.600730672 0.948722887
0.621118696 0.94211282
0.640579935 0.935496499
0.660042425 0.935627825
0.68228652 0.942525559
0.701759016 0.996638058
0.720307227 1.064239598
0.730392352 1.134280956
0.740720266 1.192582466
0.752324557 1.286721459
0.762071346 1.381660409
0.771308117 1.500382333
0.776645798 1.552679106
0.782508148 1.638208565
0.789116399 1.761087917
0.795051905 1.844817013
0.802029422 1.955479289
0.806342276 2.073547474
0.811688805 2.173579389
0.817035335 2.273611303
0.822501244 2.400961555
0.826552384 2.516768853
0.83190107 2.628438229
0.837251194 2.747865912
0.842055037 2.893671095
0.847619298 3.019845739
0.852240043 3.128123644
0.855694092 3.238487187
0.859258471 3.305318802
0.862541868 3.420125122
0.867846343 3.554442739
0.872467088 3.662720645
0.875920537 3.769851559
0.879483518 3.829140376
0.882100663 3.939825249
0.887221853 4.05763136
0.892569621 4.16434404
0.897322193 4.253812042
0.90164445 4.378553615
0.911574418 4.492583622
0.922074998 4.601363537
0.934118203 4.574454247
0.941516226 4.486784868
0.946477874 4.360604813
0.95102174 4.236625856
0.954248165 4.122736111
0.957543549 4.015866244
0.959422874 3.93456047
0.96178418 3.832400711
0.963525259 3.710100368
0.965870287 3.586198935
0.968212719 3.448289446
0.970554353 3.306069787
0.97289279 3.146609444
0.975228786 2.973979135
0.977309388 2.792282072
0.978723105 2.662832713
0.979885466 2.546106908
0.980982768 2.40877857
0.983386198 2.26956158
0.984548626 2.153194957
0.984825319 2.049034492
52
Appendix B. System and run control dictionaries
0.986873282 1.919384167
0.987915113 1.791163775
0.989192746 1.657557267
0.989469514 1.553807295
0.990629802 1.425895571
0.992086033 1.297677975
0.993241031 1.141226762
0.994407293 1.045548959
0.994976723 0.923790627
0.995740424 0.785511305
0.996702589 0.653339391
0.997228399 0.053962413
0.997265162 0.494585426
0.997823873 0.314998969
53
Index
54