Comparison between OpenFOAM, ANSYS and
Experimental Data for Benchmarking
by
Mauricio Tano Retamales
Nuclear Engineer, Instituto Balseiro, 2014
Report Submitted in Partial Fulfillment of the Academic Internship Sponsored by
Phelma, Grenoble INP and Laboratoire de Physique Subatomic et Cosmologie,
Grenoble
in the
Laboratoire de Physique Subatomic et Cosmologie, Grenoble
The rights of this work are reserved to LPSC Laboratory, Grenoble, France.
However this work may be reproduced without authorization under the conditions of
'Fair Dealing'. Therefore, limited reproduction of this work with the purpose of private
studies, research, criticism and review is likely to be in accordance with law if properly
cited.
i
ii
Revision
Name: Mauricio Tano Retamales
Frame: Report of the Academic Internship done in the LPSC
Laboratory under an agreement with Phelma, Grenoble
INP.
Title: Comparison between OpenFOAM, ANSYS and
Experimental Data for Benchmarking
Pablo Rubiolo
Senior Supervisor
Professor Grenoble INP
Date Defended/Approved:
ii
Ethics Statement
3
I declare that the word done in this report is of my authorship and have been done
following the guidelines of:
1. Honesty and general care and precision in activities (research, recording,
presentation and evaluation)
2. Ethically solid information retrieval, research and evaluation methods and
transparency in publication.
3. Taking proper notice of other researchers work and achievements
4. The research plan, realization and reporting must be done following the set
requirements.
5. The position, rights, participation in the work and responsibilities and duties of
each member of the research group must be clearly defined. Also, before
research begins, it must be agreed in writing between the research group and the
research subjects about the ownership of the research results and the storing of
materials.
6. Honest reporting of finances and commitments
7. Good planning practices and personnel and economic planning
Mauricio Tano Retamales
Grenoble 2015
iii
Abstract
As a part of the SWAT project currently being carried in LPSC Laboratory at Grenoble a
development of a multi-physical numerical simulation tool for programing the
experiences is necessary. This tool will then be validated against experience and used to
simulate a Molten Salt Fast Reactor in the frame of the SAMOFAR project. The
numerical tool is being developed in OpenFOAM. The following report describes the
comparison done with benchmark purposes between the OpenFOAM developed tool,
ANSYS Fluent and Experimental Data for the hydraulics simulation in simple study
cases.
Keywords: OpenFOAM, Multi-physics, Benchmark, MSFR, Molten Salts.
iv
Table of Contents
Introduction 1
SQUARE CHANNEL 2D HYDRAULICS – OpenFOAM..................................................
Description of the simulation............................................................................................
Steps for the implementation in OpenFOAM....................................................................
Description for the laminar simulations....................................................................
Description for the turbulent k-epsilon simulations...................................................
Results obtained for the plane Channel 2D....................................................................
Test 0: Velocity profiles..........................................................................................
Laminar Test 1: Friction factor and development length, variating the
number of elements..................................................................................
Laminar Test 2: Friction factor and development length, variating the aspect
ratio of the cells........................................................................................
Turbulent Test: Friction factor and development length..........................................
Appendix OpenFOAM. Main parameters of the simulations...........................................
SQUARE CHANNEL 2D HYDRAULICS – AnsysFluent..............................................
Description of the simulation..........................................................................................
Steps of implementation in ANSYS................................................................................
Description for the laminar simulations..................................................................
Description for the turbulent k-epsilon simulations.................................................
Results obtained for the plane Channel 2D....................................................................
Appendix 1. Guidelines for specification of turbulent boundary and initial
conditions..............................................................................................................
Appendix 2. Wall roughness effects...............................................................................
Appendix 3. Main parameters of the simulations............................................................
SQUARE CHANNEL 3D HYDRAULICS OpenFOAM...................................................
Steps for the implementation in OpenFOAM..................................................................
Description for the laminar simulations..................................................................
Description for the turbulent k-epsilon simulations.................................................
Results obtained for the plane Channel 2D....................................................................
Test 0: Velocity profiles..........................................................................................
Laminar Test 1: Friction factor and development length, variating the
number of elements..................................................................................
Laminar Test 2: Friction factor and development length, variating the aspect
ratio of the cells........................................................................................
Turbulent Test: Friction factor and development length..................................................
Appendix. Main parameters of the simulations...............................................................
v
SQUARE CHANNEL 3D HYDRAULICS ANSYSFluent................................................
Description of the simulation..........................................................................................
Steps of implementation in ANSYS................................................................................
Description for the laminar simulations..................................................................
Description for the turbulent k-epsilon simulations.................................................
Results obtained for the plane Channel 2D....................................................................
Appendix 1. Friction factors and entrance length in non-circular channels.....................
Appendix 2. Effect of corners......................................................................................
Appendix 3. Main parameters of the simulations............................................................
PIPE 3D HYDRAULICS OpenFOAM.............................................................................
Description of the simulation..........................................................................................
Steps for the implementation in OpenFOAM..................................................................
Description for the laminar simulations..................................................................
Description for the turbulent k-epsilon simulations.................................................
Results obtained for the plane Channel 2D....................................................................
Test 0: Velocity profiles..........................................................................................
Laminar Test 1: Friction factor and development length, variating the
number of elements..................................................................................
Laminar Test 2: Friction factor and development length, variating the aspect
ratio of the cells........................................................................................
Turbulent Test: Friction factor and development length..................................................
Appendix. Main parameters of the simulations...............................................................
PIPE 3D HYDRAULICS OpenFOAM.............................................................................
Description of the simulation..........................................................................................
Steps of implementation in ANSYS................................................................................
Description for the laminar simulations..................................................................
Description for the turbulent k-epsilon simulations.................................................
Results obtained for the plane Channel 2D..................................................................
Appendix 1. False diffusion errors................................................................................
Appendix 2. Friction factors and entrance length in a pipe...........................................
Chapter 1.Appendix 3. Main parameters of the simulations...................................
Description of the numerical solver developed in OpenFOAM..............................
Introduction..................................................................................................................
Main structure..............................................................................................................
Solving the fluid field....................................................................................................
Theory 112
Implementation in the code..................................................................................
Solving the fluid region implementation in the code......................................................
Main routine.........................................................................................................
vi
Mesh creation for each region.............................................................................
Creating and setting fields for each region...........................................................
Reading of solution controls................................................................................
Solving the equations for the fluid........................................................................
Solving the momentum equation.........................................................................
Stokes Hypothesis..............................................................................................
Solving the energy equation................................................................................
Solving for the continuity equations.....................................................................
Solving the solid region................................................................................................
Main routine.........................................................................................................
Mesh creation for each region.............................................................................
Creating and setting fields for each region...........................................................
Reading of solution controls................................................................................
Solving the equations for the solid.......................................................................
References 142
vii
List of Acronyms
Term Initial components of the term (examples are below)
CFD Computational Fluid Dynamics
OpenFOAM Open Field Operation and Management – Open Source Computational
Fluid Dynamics Paltform.
AR Aspect Ratio
FV Finite Volumes
viii
Executive Summary
The aim of the following report is to test the tool developed in OpenFOAM
against ANSYS Fluent and experimental data for simple simulation cases. This allowed
us to determine that the tool generated is keen to reproduce accurate results with
respect to ANSYS Fluent and the known experimental data.
The cases tested correspond to closed duct geometries, since this kind of
geometries are the ones to be tested in the SWAT project. In this case, it was determine
that the determination of the entrance length by numerical simulations is a parameter
that is likely to reproduce error sensitive results when evaluated. Therefore, this
parameter was taken as a weak global indicator of accuracy of the simulation. The
determination of the head loss in the geometries is taken as the main global indicator of
accuracy in the numerical solution.
The geometries to be tested are proposed to be the flow between two parallel
plates (2D Square Channel), the flow in an square channel (3D Square Channel) and a
Pipe. An special case was done in ANSYS Fluent for axe-symmetrical simulations of a
Pipe. The results obtained for all this cases show a good agreement with experimental
an theoretical data. The best results obtained for each case, show less than 1% of error
in the head loss when comparing the solution of both ANSYS Fluent and OpenFOAM
with the theoretical and experimental data.
For future work, thermal studies will be performed in the geometries and once
again the results will be compared with theoretical and experimental data. Further more,
a backward facing step geometry will be evaluated, in which the impact of boundary
layer detachment become more evident.
ix
Introduction
Molten salt is salt which is solid at standard temperature and pressure (STP) but
enters the liquid phase due to elevated temperature.
One of the main interests in fluoride chemistry molten salts in the nuclear field
arises from the use of fluoride salts in molten-salt reactors (MSRs). The MSR is one of
the six reactor concepts of the Generation IV initiative, an international collaboration to
study the next-generation nuclear power reactors. The fuel of the MSR is based on the
dissolution of the fissile material(235
U, 233
U, or 239
Pu) in a matrix of a molten salt that must
fulfill several requirements with respect to its physical properties, such as low-melting
temperature (typically below 823 K), low vapor pressure at operating temperatures
(typically in the range 873-1000 K), and thermodynamic stability at high temperatures.
These requirements are very well fulfilled by the various systems containing alkali and
alkali earth metal fluorides.
Currently, there are two main concepts for MSRs. The first one is the actinide
burner and it is characterized by a fast neutron spectrum. The aim of such a system,
beside energy production, is its use for transmutation of the long-lived isotopes coming
from the nuclear waste of current-type reactors. The other concept is a breeder reactor
based on the 232
Th/233
U cycle in a moderated (thermal) or nonmoderated (epithermal to
fast) configuration. This concept is of interest since it produces more fuel than it
consumes. In order to sustain the chain reaction effectively and to keep a positive
breeding ratio in the thermal breeder fuel, the neutron loss must be minimal. Therefore,
the matrix components must have very low neutron capture cross sections. According to
the results of the Molten-Salt Breeder Reactor Experiment from the 1970s, the 7LiF-
BeF2 system seems to be an ideal matrix in that case. For the epithermal concepts, the
choice of the elements of the matrix is not as restricted. This is due to the facts that the
neutron economy in fast reactors is not as sensitive as in case of thermal breeder
1
reactors and that the neutron capture cross section of the heavier alkali metals is
relatively low in the fast spectrum. Therefore, compounds like NaF, KF, or RbF can be
added to the fuel in order to improve its physical properties, e.g., lowering the melting
point.
In addition to these “traditional” MSR concepts, the use of molten salts as
primary reactor coolant, intermediate coolant, or heat-transfer medium is nowadays
considered. For example, the advanced high-temperature reactor uses a molten salt to
cool a core of graphite elements containing coated particle fuel. Especially for such in-
core applications, the LiF-BeF2 and LiF-NaF-BeF2 systems are considered prime
candidates [1].
The properties of the molten salts for this systems are usually study in the
microscopic level numerically by molecular dynamics simulation [2] and by experimental
treatments [3-10]. However, are the macroscopic properties of salts which are interesting
for testing the dynamical behavior of a MSFR. In this case, the microscopic properties
will be plagued as input variables in a fluid dynamics model. This then will be contrasted
against experience.
Being the nature of the continuum model to develop for the salt previously
unknown, a dynamic tool is needed which give us the possibility of arranging the
methods of simulation and the fluid properties while obtained new and more accurate
data during the experiences. Therefore, a new numerical tool have been developed
using the open-source platform of OpenFOAM [11].
The base numerical solver utilized in the development is the
chtMultiRegionSimpleFoam solver. This solver have already successfully been
benchmarked against experimental data. However, as the open-source nature of the
software provides no legal guarantee in the results obtained and the modifications made
for multi-physical process may affect the accuracy of the solution, it is important to be
able to determine the validity of the results obtained.
For this reasons and considering that the experimental setup for validating the
code allows to produce cosed loop experiences (SWAT Project, LPSC, Grenoble),
2
simple geometries have been chosen for validating the tool. The geometries to be tested
are proposed to be the flow between two parallel plates (2D Square Channel), the flow in
an square channel (3D Square Channel) and a Pipe. For all this cases, the results
obtained by the OpenFOAM numerical tool developed will be compared with the results
obtained by the legal license protected ANSYS Fluent and the experimental data
available for the case. The following picture -Figure 1.1-, show schematically the
procedures to be taken during the benchmark study.
Figure 1.1. Procedures for benchmarking the simulation tool developed in
OpenFOAM.
In the following report, the first chapter describes the numerical solver currently
been used for multi-physical CFD simulation as developed in OpenFOAM. Next, the
following chapters compare the solutions obtained for the geometries considered. In all
these chapters the processing and evaluation of experimental data is reported in the
Appendices.
3
SQUARE CHANNEL 2D HYDRAULICS – OpenFOAM
Description of the simulation
The geometry consist in a square channel. The Reynolds numbers will be fixed in
100, 500 and 1000 for the laminar case and 40000 and 500000 for the turbulent cases.
The following Table 21 summarizes the physical parameters used for the resolution of
the channel flow.
Parameter Unit Value
Height m 0.05
Length m 8
Table 2.1. Geometric simulation parameters
We consider the transversal direction to not have influence on the development
of the flow, therefor the flow is 2D. The boundary conditions that need to be specified
include inlet, outlet and wall, as will be described details later. Uniform flow was specified
at inlet, the flow will reach the fully developed regions after a certain distance
downstream. No-slip boundary condition will be used on the wall and constant pressure
for outlet. Symmetric boundary condition will be applied on the pipe axis. Uniform grids
will be used for the laminar flow whereas non-uniform grid will be used for the turbulent
flow.
Experimental, analytical results and simulation results will be compared.
Additionally, detailed verification and validation studies will be conducted. The following
table show the main mesh parameters utilized for the simulations.
Grid/
Mesh
Ty
pe
Number of
divisions AR
#
Cells
X Y
8 Uniform 453 45 0,201333 20385
7 319 32 0,199375 10208
6 226 23 0,196521 5198
5 180 20 0,18 3600
4 113 11 0,205454 1243
4
3 80 8 0,2 640
2 56 6 0,186666 336
0 28 3 0,186666 84
T
Non-
Uniform 564 15 0,752 8460
Table 2.2 provides information about the simulations that are going to be made
during the current study.
For the laminar case we propose in first instance 8 different meshes which
orthogonal elements maintaining an aspect ratio close to 0,2. In this case what we will
evaluate is the effect of the size of the discretization in the element in the final solution
maintaining the rest of the variables constant.
Once the test have been performed, for the amount of elements presented in
mesh 8, we will maintain approximately constant the size of the elements, but variate the
aspect ratio of the orthogonal elements. This is done for evaluating in an independent
form the influence of the aspect ratio in the solution and not other factors. The different
discretization used, named from a to g are provided in table 2.3.
Table 2.3. Provides information about the different aspect ratios that are going to
be used during the study.
In all this laminar cases the mesh is choose to be uniform. This is for
homogenizing the influence of the artificial diffusion errors and evaluating our response
base only on the parameters which influence we want to determine.
For the turbulent case, the k-Epsilon model will be used. The grid is non uiform
refined towards the wall and the inlet and outlet to gain precision in the results. With this
5
Grid/Mesh Type
Number of divisions
AR # Cells
X Y
a
Uniform
453 45 0,2013333333 20385
b 320 64 0,1 20480
c 250 82 0,0609756098 20500
d 100 204 0,0098039216 20400
e 600 34 0,3529411765 20400
f 800 25 0,64 20000
g 1200 17 1,4117647059 20400
discretization we get for the first cell for the Re=40000 case and for the
Re=500000 case. Both resolutions lies between the acceptable standards.
Table 2.4 provide a summary of the simulation matrix for this case, giving
information about the studies that will be conducted and the mesh and model to be used
in each case.
Simuation Matrix
Study Grid Model
Friction factor and development length, variating
the number of elements
0,2,3,4,5,6,
7,8
Laminar
Friction factor and developement length,
variating the aspect ratio
a,b,c,d,e,f,
g
Velocity profile, friction factor and development
length
T Turbulent
Table 2.4. Simulation matrix for the 2D plane channel case
Steps for the implementation in OpenFOAM
Description for the laminar simulations
1. The mesh is generated in ANSYS, exported in <mesh>.msh and ASCII format and
finally imported into fluid by the command fluentMeshToFoam.
2. Change the file changeDictionary to set the initial and the boundary conditions. The
configuration utilized for the current case are shown in the following box.
U
{
internalField uniform (0.0100480866 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0100480866 0 0);
}
outlet
{
type zeroGradient;
6
}
frontAndBackPlanes
{
type empty;
}
wall
{
type fixedValue;
value uniform (0 0 0);
}
}
}
p_rgh
{
internalField uniform 100000;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 100000;
}
frontAndBackPlanes
{
type empty;
}
wall
{
type zeroGradient;
}
}
}
The inlet velocity will be change to fix the Reyolds in the channel. Alternatively, and
inletOutlet boundary condition can be used in the pressure outlet. However, this may
lead to flux oscillations.
3. Following we set the discretization schemes for the solution of the fluid equations. The
utilized schemes are shown in the following box.
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
7
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
p_rgh;
}
The discretization schemes utilized for the current case come as an equilibrium between
velocity and precision use. In this case, low order schemes are used for obtaining fast
results, in consideration that the orthogonal and well behaved meshes will help in the
convergence of the solution.
4. Next, the solution methods for the system of equations have to be specified. The
following box show the configuration selected for the current case.
solvers
{
p_rgh
{
solver GAMG;
tolerance 1e-6;
relTol 0.01;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
"(U)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
}
SIMPLE
{
momentumPredictor on;
nNonOrthogonalCorrectors 0;
8
}
relaxationFactors
{
fields
{
p_rgh 0.7;
}
equations
{
U 0.3;
}
}
In this case, once again we search for velocity in obtaining the results. For assuring the
stability of the method, in the a very stable GAMG solver is choose to solve the Poisson
equation for the pressure with a very effective Gauss Seidel pre-multiplication smoother
for the solution of the system. In this case, the iterations in the method are carried out
until the total residuals are decreased 100 times. However, for the momentum predictor,
a very fast PbiCG solver is choose, since its result is just a predictor for determining the
velocity profile.
The relaxation factors are the commonly used for the pressure and momentum
equations in the SIMPLE method.
5. Finally in the controlDict we select as method of solution the
chtMultiRegionSimpleFoam, which, in this case, corresponds to the modified solution
method shown in the Appendix.
Description for the turbulent k-epsilon simulations
We will describe only the steps that change in the simulations.
2. Change the file changeDictionary to set the initial and the boundary conditions for
k and epsilon. The configuration utilized for the current case are shown in the
following box.
epsilon
{
internalField uniform 0.3008826651; //This is just for starting, will be recalculated in the first step
boundaryField
{
inlet
{
type compressible::turbulentMixingLengthDissipationRateInlet;
mixingLength 0.0038; //Definition of the mixing length
value uniform 1; //This is just a placeHolder
}
outlet
{
type inletOutlet;
9
inletValue uniform 0.3008826651; //In case of reversed flow
value uniform 1; //This is just a placeHolder
}
frontAndBackPlanes
{
type empty;
}
wall
{
type compressible::epsilonWallFunction; //Adjusting epsilon to the wall function
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 1; //This is just a placeHolder
}
}
}
k
{
internalField uniform 0.0364498266; //This is just for starting, will be recalculated in the first step
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.0310; //Definition of the fluctuation intensity -!! Considering iso-tropic turbulence-
value uniform 1; //This is just a placeHolder
}
outlet
{
type inletOutlet;
inletValue uniform 0.0364498266; //Inlet value in case of reversed flow
value uniform 1; //This is just a placeHolder
}
frontAndBackPlanes
{
type empty;
}
wall
{
type compressible::kqRWallFunction; //Adjusting k to the wall function
value uniform 1; //This is just a placeHolder
}
}
}
mut
{
internalField uniform 0; //This will be calculated based on the solution of the kEpsilon equations
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
frontAndBackPlanes
{
type empty;
10
}
wall //This is the only important part
{
type mutkWallFunction; //We are selecting the inclusion of a wall function -k based- in the
model
value uniform 0;
}
}
}
The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92,
Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be
standard and we use standard wall functions for the near-wall treatment.
For the turbulent kinetic energy inlet boundary condition, a model of the type
turbulentIntensityKineticEnergyInlet is specified. The intensity is calclued in accordance
to the releationship in accordance toEntrace Length Re_500(Reference?). For the epsilon
model, in the inlet boundary condition we select a model of the type
turbulentMixingLenthDisipationRateInlet in which the length scale of the larger eddies of
the turbulent field are set as l=0,038∗Dh [See appendix of the Fluent Part for more
information]. Finally, for the walls in the turbulent viscosity boundary condition -mut- we
select a model of the type mutkWallFuntion, which cast the first cell next to the wall with
the value corresponding to the wall function profile.
3. In the discretization schemes for the turbulent equations, we must specify the
discretization schemes for the k-epsilon turbulent equations. The discretization proposed
in shown in the following box.
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,K) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(R) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
11
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
p_rgh;
}
Once again low order methods are used in the discretization schemes for a rapid
solution of the system of equations. The very orthogonal and well oriented mesh help
once again in the stability of the method, allowing us to use low order schemes.
4. We following specify the the solution schemes for the k and epsilon solvers. This
terms come as predictors of the turbulent viscosity and therefore is common practice to
use the same discretization schemes as for the velocity field. In the following box we
specify the discretization use for the current simulation.
"(|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-8;
relTol 0.1;
}
6. Finally in the turbulenceProperties file, we specify the simulation type as RASModel
and in the RASProperties file we specify the RASModel as kEpsilon.
12
Results obtained for the plane Channel 2D
Test 0: Velocity profiles
For starting validating the simulations to be made, we first compare the laminar
velocity profile with the analytical solution obtained for a velocity profile in the channel.
The analytical solution is [Frank White, Fluid Mechanics,
2009]. The results obtained for the comparison between the analytic and the exprimental
velocity profiles are shown in graph 2.1-
0,00E+000 2,00E-002 4,00E-002 6,00E-002
0
0
0
0
0
0
0
0
0
Comparision of anlytic vs simulated velocity profile
U_OpenFOAM
U_analytic
y
u
Graph 2.1. A very good agreement is observed between the OpenFOAM solution
and the analytical one. The average error is calculated in 0,18%.
Following, another ground taste is to observe the profiles obtained for a turbulent
simulation and compare it with the one obtain for a laminar simulation. For doing so we
take the y velocity profile for Reynolds numbers of 100 and 40000, with are laminar and
turbulent respectively. Dividing the velocity profile of the later one by 400, we obtain the
results depicted in Graph 2.2.
xiii
Graph 2.2. Comparison between the laminar and the turbulent profiles simulated
by OpenFOAM. The normal expected behavior is observed in which, the turbulent
velocity profile rise more rapidly next to the wall and is more plane in the middle because
of turbulent mixture.
Laminar Test 1: Friction factor and development length, variating the
number of elements
For the first test we fix the aspect ratio in 0,2 and we variate the
number of elements in the mesh. We perform the simulations for the laminar
Reynolds numbers of 100, 500 and 2000, for the meshes shown in Table 2.
We then compare the non dimensional entrance length and with
the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The
results obtained are shown in Figure 2.3.
xiv
0 1 2 3 4 5 6 7 8 9
0,02
0,02
0,02
0,02
0,02
0,02
Entrance Length Re_100
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
0 1 2 3 4 5 6 7 8 9
0,02
0,02
0,02
0,02
Entrace Length Re_500
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
xv
0 1 2 3 4 5 6 7 8 9
0,02
0,02
0,02
0,02
Entrance Length Reynolds 1000
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_Plus
0 1 2 3 4 5 6 7 8 9
0,21
0,22
0,23
0,24
0,25
Friction factor Re 100
L_plus_OpenFOAM
L_plus_theoric
Mesh
f*Re/100
0 1 2 3 4 5 6 7 8 9
0,2
0,22
0,24
0,26
Friction factor Reynolds 500
L_plus_OpenFOAM
L_plus_theoric
Mesh
f*Re/100
xvi
0 1 2 3 4 5 6 7 8 9
0,23
0,23
0,24
0,24
0,25
Friction factor Re 1000
L_plus_OpenFOAM
L_plus_theoric
Mesh
f*Re/100
Figure 2.3. Development length and friction factor for laminar
Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant
aspect ratio factor variating the number of elements in each mesh.
For the development length, for all Reynolds number, acceptable results are
obtained for mesh of number of elements larger than mesh 4. In all cases, the error
attended are below 3% for mesh 4. It is notable to mention that for meshes 7 and 8 less
than 1% of error are obtained for all cases. Considering that mesh 4 is composed of 113
elements in the x direction and 11 elements in the y direction, a maximum area of 3e-4
m² (for an overall aspect ratio of 0,2) is recommended for the element in order to attain
acceptable errors in the solutions obtained. In a similar case, is an error of less than 1%
in comparison to the theoretical solution wants to be attained in all cases, a maximum
area of 4e-5 m² is recommended for the elements for an aspect ratio of 0,2.
The errors obtained for the friction factor coefficients are smaller than the ones
obtained for the development length. In this case, once again, acceptable results are
obtained for meshes denser than mesh 4. The errors obtained for all the laminar cases
are below 1,5%. It is again notable to mention that for meshes 7 and 8 less than 0,3% of
error is obtained for all cases in the comparison of the friction factor with respect to the
theory. This error is quite close to the average error on resolution in the velocity profile,
which justifies the use of low order methods in the discretization of the problem. Once
xvii
again, if a maximum element area of 3e-4 m² is used less than 1,5% errors will be
obtained and if a maximum area of 4e-5 m² is used the errors will be smaller than 0,3%.
Laminar Test 2: Friction factor and development length, variating the
aspect ratio of the cells
For the test we fix the number of elements in that of mesh 8: 20385.
Then, we perform the simulations for the laminar Reynolds numbers of 100,
500 and 2000, variating the aspect ratio of the cells (as shown in Table 3). We
then compare the non dimensional entrance length and with the
Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The
results obtained are shown in Figure 2.4.
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6
0,02
0,02
0,02
0,02
Entrance length Re 100
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
xviii
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6
0,02
0,02
0,02
0,02
Entrance Length Re 500
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6
0,02
0,02
0,02
0,02
Entrance Length Re 1000
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6
0,2
0,22
0,24
0,26
Friction factor Re 100
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
f*Re/100
xix
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6
0,2
0,22
0,24
0,26
Friction Factor Re 500
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
f*Re/100
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6
0,2
0,22
0,24
0,26
Friction factor Re 1000
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
f*Re/100
Figure 2.4. Development length and friction factor for laminar
Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant
number of elements variating the aspect ratio of them.
For the development length, for all Reynolds number, acceptable results are
obtained for the plateau laying between the aspect ratio of 0,1 and 1. In all cases, the
error attended are below 1% inside this region. This error is coincident with the one
obtained for mesh 8 in the previous case. An aspect ratio smaller than this one, will case
the perturbations introduced in the y direction to be amplified in the x direction, therefore,
obtaining a development of the fluid profile sooner than expected (view ANSYS
xx
Appendix for more details). In a similar form, when the discretization in x becomes
smaller than the discretization in y, the quite big perturbations generated in the stream-
wise direction, influence the form of the velocity profile in the t direction, causing a late
development.
The errors obtained for the friction factor coefficients are smaller than the ones
obtained for the development length. For this case the plateau obtained for attaining an
acceptable result in the simulations is larger than in the previous cases. For this case, it
is determined between 0,05 and 2 for the value of the aspect ratio. The errors obtained
for all the laminar simulations in this region lies below 0,5%. In this case, for determining
the friction factor, a bigger plateau is a consequence of a less recuperating influence in
perturbations near the wall.
Turbulent Test: Friction factor and development length
We simulate turbulent flows for Reynolds numbers of 40000 and 500000. The
rugosity of the wall is assumed to be zero. For computing the turbulent viscosity a RANS
kEpsilon model is utilized. The standard coefficients are used for this model [Reference
Facundo]. The results obtained for the non-dimensional entrance length and for the
Manning turbulent friction factor are computed against the theoretical predictions [view
ANSYS part for theoretical references]. The mesh utilized correspond to the on shown in
table 2. The results obtained are presented in table 2.4.
Table 2.4. Results obtained for the turbulent simulations using the kEpsilon
model.
We observe that the results obtained show an acceptable agreement with the
theoretical predictions for both the entrance length and the friction factor determination.
The errors are observed to decrease their intensity at higher Reynolds since the high
intensity turbulence propose stabilize the perturbation influence in a bigger value
predicted for the turbulent viscosity.
xxi
Re L Lplus Error Skin_Factor_Calculated Skin_Factor_Predicted Error
40000 0,794326 0,5616733 1,09% 0,0056200325 0,0055251724 1,72%
500000 1,52 0,57161167 0,95% 0,0032985321 0,0033339865 1,06%
Appendix OpenFOAM. Main parameters of the simulations
Reynold
s
Inlet velocity
water (m/s)
Inlet velocity air
(m/s)
Turb length
scale
Turbulence
Intensity
100 0,001004809 0,014607347 NA NA
500 0,005024043 0,073036735 NA NA
1000 0,010048087 0,146073469 NA NA
40000 0,401923462 5,842938776 0,0038 4,25%
Factor LD 0,021 Laminar
0,57078 Turbulent
H 0,05 m
Skin_Factor 24 Laminar
0,046 Turbulent
Height of the channel m 0,05
Roughness
Physical Heigth 1,00E-06
Turbulent Intensity 0,10%
k 8,07712E-08
u* 0,000309144
Non-Dimmensional
Heigth 2,12E-05
Reference MIN MAX
Hydrodynamically smooth 0 2,25
Transitional 2,25 90
Fuly Rough 90 1,00E+07
xxii
Initial
Conditi
ons
k 0,00043863
epsilon 0,0003972
Grid/Mes
h
Type
Number of
divisions AR # Cells
X Y
8
Uniform
453 45 0,201333333 20385
7 319 32 0,199375 10208
6 226 23 0,196521739 5198
5 180 20 0,18 3600
4 113 11 0,205454545 1243
3 80 8 0,2 640
2 56 6 0,186666667 336
0 28 3 0,186666667 84
T
Non-
Uniform 564 15 0,752 8460
xxiii
SQUARE CHANNEL 2D HYDRAULICS – AnsysFluent
Description of the simulation
The geometry consist in a square channel. The Reynolds numbers will be fixed in
100, 500 and 1000 for the laminar case and 100000 for the turbulent case. The following
Table 3.1 summarizes the physical parameters.
Parameter Unit Value
Height m 0.05
Length m 8
Table 3.1. Geometric simulation parameters
We consider the transversal direction to not have influence on the development
of the flow, therefor the flow is 2D. Boundary conditions need to be specified include
inlet, outlet and wall, as will be described details later. Uniform flow was specified at
inlet, the flow will reach the fully developed regions after a certain distance downstream.
No-slip boundary condition will be used on the wall and constant pressure for outlet.
Symmetric boundary condition will be applied on the pipe axis. Uniform grids will be
used for the laminar flow whereas non-uniform grid will be used for the turbulent flow.
Experimental, analytical results and simulation results will be compared.
Additionally, detailed verification and validation study will be conducted.
Grid/Mes
h
Type
Number of
divisions AR
#
Cells
X Y
8 Uniform 453 45 0,20133333 20385
7 319 32 0,199375 10208
6 226 23 0,19652174 5198
5 180 20 0,18 3600
4 113 11 0,20545455 1243
3 80 8 0,2 640
xxiv
2 56 6 0,18666667 336
0 28 3 0,18666667 84
T
Non-
Uniform 564 15 0,752 8460
Table 3.3 provides information about the simulations that are going to be made
during the current study.
Simuation Matrix
Study Grid Model
Friction factor and axial velocity profile
2,3,4,
8
Laminar
Friction factor study
6,7
Axial velocity, center-line pressure and centerline
velocity
T Turbulent
Table 3.3. Simulation matrix for the 2D plane channel case
Steps of implementation in ANSYS
Description for the laminar simulations
1. Select the components to be used in the workbench and make the
corresponding connections.
2. Create the geometry. Make the sketch, adjust the dimensions, select
make surface out of the sketch, generate all and save.
3. Create the meshes. Select mapped faces and set quadrilaterals
elements, size the horizontal edges and the vertical ones by number of
divisions and generate the mesh. Do this for the uniform laminar mesh
and the non-uniform turbulent mesh.
4. Performing the simulation.
4.a. Set up double precision in a serial processor and lunch Fluent
4.b. Perform a Mesh Check to see the mesh has been generated all-right
xxv
4.c. Check that in the general settings the Pressure-Based solver, an absolute
velocity formulation a Steady time problem and a planar 2D field are chosen
4.d. Select in Models, a viscous laminar model to be implemented
4.e. Add in material water to the material list
4.f. Set in surface body the element type simulation to fluid and select the
material to be water
4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in
velocity specification method specify “Magnitude, normal to the boundary” and
set the velocity to the magnitude corresponding to each specific Reynolds
number. Check also that the supersonic or initial Gauge Pressure is set equal to
0.
4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in
ANSYS 15) and edit the outlet gauge pressure to 0.
4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the
wall motion equation to be an stationary wall with no slip as shear condition. Also
change the operating conditions to a value of 97225.9 Pa in pressure.
4.h. Set the reference values following the inlet face values. View the adjoint
excel sheet for automatic generation.
4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell
based, the pressure to second order and the momentum to second order upwind.
4.j. Leave the solution control as default
4.k. In monitors, edit the residuals for the continuity, x velocity and y-velocity to
1e-6.
4.l. In initialization choose standard initialization, select the reference frame as
relative to cell zone and put the gauge-pressure = 0 the x velocity equal to the
inlet velocity and the y-velocity =0.
4.m. Initialize the simulation
4.n. In run calculation change the number of iterations to 1000 and lunch the
calculation.
5. Analysis of the results
xxvi
5.1 Plot the velocity in the center line for determining the development length. For
post-processinf use the following criteria. Search for the percentage of the maximum
velocity that betters agrees with the development length. Eg. If the development length
should be 0.021m, search c such that c*Umax determines the velocity value in the
position 0.021m. The error is the described by Error=(c−0,99)/c .
5.2. Extract as wall fluxed the skin coefficients at the walls. Determine a length by
averaging where a fixed value is get for the factors. See excel sheet.
Description for the turbulent k-epsilon simulations
We will describe only the steps that change in the simulations.
4. Performing the simulation.
4.d. Select in Models, k-epsilon 2 equations. The coefficients for the model
should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1,
Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we
use standard wall functions for the near-wall treatement.
4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in
velocity specification method specify “Magnitude, normal to the boundary” and
set the velocity to the magnitude corresponding to each specific Reynolds
number. Check also that the supersonic or initial Gauge Pressure is set equal to
0. Specify the turbulence method to intensity and length scale and set intensity in
4.2%, in accordance to I=0,016 ReDh
−1
8 - , for ReDh=40000 . Set the length
scale for the turbulence as l=0,038∗Dh [See appendix].
4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in
ANSYS 15) and edit the outlet gauge pressure to 400 –not to have absolute
pressures lower than 0 in the calculation-. For the turbulence method select k
and epsilon and specify both values constant and equal to 1.
4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the
wall motion equation to be a stationary wall with no slip as shear condition. Set
the roughness height and the roughness constant equal to 0 [See appendix].
4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell
based, the pressure to second order and the momentum to second order upwind.
xxvii
Also set the turbulent kinetic energy solution method to ‘second order upwind’
and the turbulent dissipation rate to ‘second order upwind’.
4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity, k and
epsilon to 1e-6.
4.l. In initialization choose standard initialization, select the reference frame as
relative to cell zone and put the gauge-pressure = 400 the x velocity equal to the
inlet velocity and the y-velocity =0. Also set the initial values of the initial turbulent
kinetic energy and the initial energy dissipation rate as calculated in the excel
sheet.
4.n. In run calculation change the number of iterations to 1000 and lunch the
calculation.
5. Analysis of the results
5.1 Take the entrance length before the first peak in the center line velocity.
xxviii
Results obtained for the plane Channel 2D
Re L Lplus Error
Value*Uma
x Skin_Factor_Calculated Skin
100
0,21192
1
0,02119
21 1,82% 0,999 0,239676128
500 1,07726
0,02154
52 3,57% 0,9996 0,047954055
1000 2,13687
0,02136
87 2,73% 0,9996 0,023976386
40000
0,79432
6
0,56167
33 1,09% 0,995 0,005620032
xxix
Appendix 1. Guidelines for specification of turbulent
boundary and initial conditions
In this user tip, we discuss how to calculate and set appropriate turbulence values for inflow boundary conditions
(inlets or freestream boundaries). Rather than starting with the turbulence model variables themselves it is often
easier to think of turbulence in terms of the more readily known turbulence intensity, turbulent viscosity ratio, and
turbulence length scale parameters. With these parameters in hand you can calculate the appropriate boundary
values for any RANS turbulence models.
About Turbulence Intensity
The turbulence intensity, I, is defined as the ratio of the root-mean-square of the velocity fluctuations, u`, to the
mean free stream velocity, u.
For internal flows the value of turbulence intensity can be fairly high with values ranging from 1% - 10% being
appropriate at the inlet. The turbulence intensity at the core of a fully developed duct flow can be estimated as:
For external flows the value of turbulent intensity at the freestream can be as low as 0.05% depending on the
flow characteristics. You may have a good estimate of the turbulence intensity at the freestream boundary from
experimentally measured data.
Once you have obtained a reasonable estimate for l you can either use it to calculate the inlet value of
turbulence kinetic energy, k, as described below or you can use it as a boundary value directly. All inlet boundary
condition types allow you to specify the turbulence kinetic energy at the boundary.
About Turbulent Viscosity Ratio
The turbulent viscosity ratio is simply the ratio of turbulent to laminar (molecular) viscosity:
For internal flows  may be scaled with the Reynolds numbers.� Some guidelines (determined with numerical
experiments) for fully developed pipe flows are as follows:
Re 3000 5000 10,000 15,000 20,000
 11.6 16.5 26.7 34.0 50.1
30
For a Reynolds number of 100,000 or greater a constant value of  = 100 is a reasonable estimate. For external
flows the freestream turbulent viscosity will be on the order of laminar viscosity so small values of are
appropriate, say  = 0.1 – 0.2.
About Turbulence Length Scale
Sometimes it is easier to think in terms of turbulence length scale instead of turbulent viscosity ratio. The
turbulence length scale, l, is a physical quantity which represents the size of the large eddies in turbulent flows.
Empirical relationship between the physical size of the obstruction (or characteristic length), L, and the size of
the eddy, l, can be used to get an approximate length scale.
For internal flows you can choose the characteristic length (L) to be inlet duct width or hydraulic diameter (Dh).
Guidelines for choosing Hydraulic Diameter Dh or turbulence length scale l.
1. For fully developed internal flows, choose the Hydraulic Diameter specification method and specify
the physical size of the hydraulic diameter.
2. For wall-bounded flows in which inlet involve a turbulent boundary layer, choose the Turbulent
Intensity and Length Scale specification method and the use the boundary-layer thickness, , to
compute the turbulence length scale, l, from l = 0.4() .
For external flows, it is often not possible to determine a good characteristic length. In using the formulas below,
pick a value of  and a value of u' and use the formulas on the left, the ones not involving the length scale. In
the case of external aerodynamic flows, choose smaller values of  (0.1 to 1), whereas in the case of wind-
tunnel external flows, choose larger values of  (1 to 10).
Calculating Turbulence Boundary Conditions Values
All the turbulence models (except Baldwin-Lomax Algebraic Model) require the specification of certain variable
values at the boundaries. There are several methods used for turbulence specification at the boundaries
available in the codes. For all of the models the user can directly specify the turbulence intensity, turbulence
length scale or the hydraulic diameter. But it is important to know how these quantities are related to primary
turbulence variables like k, epsilon and omega. In this note we address only the RANS turbulence models (LES
turbulence models may be discussed in a future note). For full details of the turbulence models and equations
please see the user manuals.
For the Standard k-epsilon model and variations (RNG, Kato-Launder, Two Layer)
Turbulent Kinetic Energy →
Turbulent Dissipation Rate →� or
For the Spalart-Allmaras Model
Turbulent Kinematic Eddy Viscosity → or
For the k-omega and Menter SST Models
Specific Dissipation Rate → or
NOTE: For external flows it is very important to specify appropriate turbulent quantities at the freestream
boundaries. If the values are unphysical it can cause the solution to be unrealistic and can lead to divergence or
non-convergence. For internal flows the importance of the values is not as critical because usually there is much
31
more turbulence generated internally in the flow field
Appendix 2. Wall roughness effects
Fluid flows over rough surfaces are encountered in diverse situations. Examples are,
among many others, flows over the surfaces of airplanes, ships, turbomachinery, heat
exchangers, and piping systems, and atmospheric boundary layers over terrain of
varying roughness. Wall roughness affects drag (resistance) and heat and mass transfer
on the walls.
If you are modeling a turbulent wall-bounded flow in which the wall roughness effects are
considered to be significant, you can include the wall roughness effects through the law-
of-the-wall modified for roughness.
Law-of-the-Wall Modified for Roughness
Experiments in roughened pipes and channels indicate that the mean velocity
distribution near rough walls, when plotted in the usual semi-logarithmic scale, has the
same slope ( ) but a different intercept (additive constant in the log-law). Thus, the
law-of-the-wall for mean velocity modified for roughness has the form
where and .
Where is a roughness function that quantifies the shift of the intercept due to
roughness effects.
depends, in general, on the type (uniform sand, rivets, threads, ribs, mesh-
wire, etc.) and size of the roughness. There is no universal roughness function valid for
all types of roughness. For a sand-grain roughness and similar types of uniform
roughness elements, however, has been found to be well-correlated with the
nondimensional roughness height,
, where is the physical roughness height and .
Analyses of experimental data show that the roughness function is not a single function
32
of , but takes different forms depending on the value. It has been observed
that there are three distinct regimes:
1. hydrodynamically smooth ( )
2. transitional ( )
3. fully rough ( )
According to the data, roughness effects are negligible in the hydrodynamically smooth
regime, but become increasingly important in the transitional regime, and take full effect
in the fully rough regime.
In FLUENT, the whole roughness regime is subdivided into the three regimes, and the
formulas proposed by Cebeci and Bradshaw based on Nikuradse's data are adopted to
compute for each regime.
For the hydrodynamically smooth regime ( ):
For the transitional regime ( ):
where is a roughness constant, and depends on the type of the roughness.
In the fully rough regime ( ):
In the solver, given the roughness parameters, is evaluated using the
corresponding formula. The modified law-of-the-wall in Equation is then used to evaluate
the shear stress at the wall and other wall functions for the mean temperature and
turbulent quantities.
Setting the Roughness Parameters in Fluent
The roughness parameters are in the Momentum section of the Wall panel, which is
opened from the Boundary Conditions panel. To view the wall roughness parameters,
click the Momentum tab.
33
To model the wall roughness effects, you must specify two roughness parameters:
the Roughness Height, , and the Roughness Constant, . The default
roughness height ( ) is zero, which corresponds to smooth walls. For the roughness
to take effect, you must specify a non-zero value for . For a uniform sand-grain
roughness, the height of the sand-grain can simply be taken for . For a non-uniform
sand-grain, however, the mean diameter ( ) would be a more meaningful roughness
height. For other types of roughness, an "equivalent'' sand-grain roughness height could
be used for . The above approaches are only relevant if the height is considered
constant per surface. However, if the roughness constant or roughness height is not
constant (i.e., flow over a nonuniform surface), then you can specify a boundary profile.
Similarly, user-defined functions may be used to define a wall roughness height that is
not constant. Choosing a proper roughness constant ( ) is dictated mainly by the type
of the given roughness. The default roughness constant ( ) was determined so
that, when used with - turbulence models, it reproduces Nikuradse's resistance data
for pipes roughened with tightly-packed, uniform sand-grain roughness. You may need to
adjust the roughness constant when the roughness you want to model departs much
from uniform sand-grain. For instance, there is some experimental evidence that, for
non-uniform sand-grains, ribs, and wire-mesh roughness, a higher value
( ) is more appropriate. Unfortunately, a clear guideline for
choosing for arbitrary types of roughness is not available.
Note that it is not physically meaningful to have a mesh size such that the wall-adjacent
cell is smaller than the roughness height. For best results, make sure that the distance
from the wall to the centroid of the wall-adjacent cell is greater than .
34
Appendix 3. Main parameters of the simulations
Reynold
s
Inlet velocity
water (m/s)
Inlet velocity air
(m/s)
Turb length
scale
Turbulence
Intensity
100 0,001004809 0,014607347 NA NA
500 0,005024043 0,073036735 NA NA
1000 0,010048087 0,146073469 NA NA
40000 0,401923462 5,842938776 0,0038 4,25%
Factor LD 0,021 Laminar
0,57078 Turbulent
H 0,05 m
Skin_Factor 24 Laminar
0,046 Turbulent
Height of the
channel m 0,05
Roughness
Physical Heigth 1,00E-06
Turbulent Intensity 0,10%
k 8,07712E-08
u* 0,000309144
Non-Dimmensional
Heigth 2,12E-05
35
Reference MIN MAX
Hydrodynamically smooth 0 2,25
Transitional 2,25 90
Fuly Rough 90 1,00E+07
Initial
Conditi
ons
k 0,00043863
epsilon 0,0003972
36
SQUARE CHANNEL 3D HYDRAULICS OpenFOAM
The geometry consist in a square channel. The Reynolds numbers will be fixed in
100, 500 and 1000 for the laminar case and 40000 and 500000 for the turbulent case.
The following Table 4.1 summarizes the physical parameters.
Parameter Unit Value
Side Length m 0.05
Length m 8
Table 4.1. Geometric simulation parameters
In this case both directions perpendicular to the axial direction are assumed to
have an appreciable effect in the dynamics of the fluid. For the simulation made, it was
chosen to work with a quarter of the square channel, this will in turn optimize the mesh
utilized reducing four times the domains. The selection of the laminar mesh is chosen to
respect the same cell size and aspect ratio that was previously simulates in the 2D plane
channel. However, since in this case both development direction are important, is
expected that the dynamics of the development of the boundary layer is changed. This
will in turn, implies different results in the development length and friction factor than for
the 3D square channel. The presence of the corner, and the known wrong resolution of
the kinetic energy and dissipation energy when interacting in corner, make us use a
mesh which density is doubled in the 3D channel, with respect of that used in the 2D
channel, near the corner.
The boundary conditions that need to be specified include inlet, outlet, axis and
wall, as will be described details later. Uniform flow was specified at inlet, the flow will
reach the fully developed regions after a certain distance downstream. No-slip boundary
condition will be used on the wall, constant pressure was used for outlet and axi-
symmetrical boundary conditions were used for the axis. Uniform grids will be used for
the laminar flow whereas non-uniform grid will be used for the turbulent flow. This is for
37
making it possible to study the influence of the aspect ratio in the laminar cases and for
gaining accuracy in the simulation of the skin factor in the turbulent cases. A description
of the domain and boundary conditions used is shown in Figure 4.1.
Figure 4.1. Top: view of the geometry and the boundary conditions, a symmetry
condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet
condition is in the opposite side on the inlet and is not shown in this picture. Bottom: a
picture of the regular, orthogonal, mapped mesh generated for the laminar simulations
to be made.
Experimental, analytical results and simulation results will be compared.
Additionally, detailed verification and validation studies will be conducted. Similar
sensibility studies that where conducted for the 2D case will be performed for the current
case. In the first case, we choose to keep the aspect ratio of the cell constant while
variating the number of elements, the meshes utilized are shown in Table 4.2. For a
second case, we select the number of cells in mesh 6 and proportionally variates the
discretization parameters to obtain different aspects ratios for the elements. Table 4.3
present the meshes used during the simulation. Please note that the discretization in y
and x are variated in a proportional form to induce a similar aspect ratio in the xz and yz
planes. For all the laminar simulations made the the mesh will be uniform. This is for
studying uniquely the influence of the aspect ratio and number of elements in the results
by making uniform the external error influence over the mesh.
38
For the turbulent case, the k-Epsilon model will be used. A bias factor of 3.117
was used for the turbulent mesh generation. The bias is oriented towards the right
superior corner for the z=constant planes and towards the inlet and outlet for y=constant
and x=constant planes. This is for gaigning precision in the results obtained. With this
discretization we get for the first cell for the Re=40000 case and for the
Re=500000 case. Both resolutions lies between the acceptable standards. A schematic
view for the mesh used for turbulent simulations is shown in Figure 4.2.
Grid/Mesh Type
Number of divisions AR # Cells
Z Y X
8
Uniform
453 45 45 0,201333333 917325
7 319 32 32 0,199375 326656
6 226 23 23 0,196521739 119554
5 180 20 20 0,18 72000
4 113 11 11 0,205454545 13673
3 80 8 8 0,2 5120
2 56 6 6 0,186666667 2016
0 28 3 3 0,186666667 252
T
Non-
Uniform 564 15 15 0,752 126900
Table 4.2. Proposed meshes for the sensibility study variating the number of
elements.
Grid/Mesh Type
Number of divisions
AR # Cells
Z Y X
a
Uniform
226 23 23 0,20354 119554
b 300 20 20 0,133333 120000
c 600 14 14 0,046667 117600
d 100 34 34 0,68 115600
e 50 49 49 1,96 120050
Table 4.3. Proposed meshes for the sensibility study variating the aspect ratio
and keeping constant the number of cells.
39
Figure 4.2. View of the meshed utilized for the turbulent simulations, the mesh is
denser towards the corner where the two walls meet and coarser towards the symmetry
planes, the Bias factor utilized in the generation of the mesh is 3.117
Table 4.4 provides information about the proposed simulations to be made during
the study and the correspondent parameters to be extracted and analyzed in each
simulation.
Simuation Matrix
Study Grid Model
Friction factor and development length, variating the
number of elements 0,2,3,4,5,6,7,8
Laminar
Friction factor and development length, variating the aspect
ratio a,b,c,d,e
Velocity profile, friction factor and development length T Turbulent
Table 4.4. Matrix simulation proposed
The methodology for computing the developing length is the same as for the 2D
channel case. For computing the average wall stress, once the fluid is developed we
integrate on the upper wall the local shear stresses and divide the result by the
integration length, this is . This is because this overall
mean shear stress will be the one causing the pressure loss in the channel and,
therefore, is on this bases that the theoretical friction factor is computed.
40
Steps for the implementation in OpenFOAM
Description for the laminar simulations
1. The mesh is generated in ANSYS, exported in <mesh>.msh and ASCII format and
finally imported into fluid by the command fluentMeshToFoam.
2. Change the file changeDictionary to set the initial and the boundary conditions. The
configuration utilized for the current case are shown in the following box.
U
{
internalField uniform (0 0 0.0020096173);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0.0020096173);
}
outlet
{
type zeroGradient;
value uniform ( 0 0 0 );
//inletValue uniform ( 0 0 0 );
}
symetry
{
type symmetry;
}
wall
{
type fixedValue;
value uniform (0 0 0);
}
}
}
p_rgh
{
internalField uniform 100000;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 100000;
}
symetry
{
type symmetry;
}
41
wall
{
//type fixedFluxPressure;
type zeroGradient;
}
}
}
The inlet velocity will be change to fix the Reyolds in the channel. Alternatively, and
inletOutlet boundary condition can be used in the pressure outlet. However, this may
lead to flux oscillations. We observe that for the symmetry plane a symmetry condition is
used, however, internally a a limiter is included in the code for diminishing the error
caused by cross derivatives in the juntion of the two symmetric planes.
3. Following we set the discretization schemes for the solution of the fluid equations. The
utilized schemes are shown in the following box.
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
p_rgh;
}
As in the previous case low order discretization schemes are utilized for aiding a rapid
convergence in the results, since the stability is aided by the regular orthogonal mesh.
42
4. Next, the solution methods for the system of equations have to be specified. The
following box show the configuration selected for the current case.
solvers
{
p_rgh
{
solver GAMG;
tolerance 1e-6;
relTol 0.01;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
"(U)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
}
SIMPLE
{
momentumPredictor on;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
fields
{
p_rgh 0.7;
}
equations
{
U 0.3;
}
}
The solution methods and the relaxation factors for the SIMPLE code are the same than
the utilized for the channel 2D case.
5. Finally in the controlDict we select as method of solution the
chtMultiRegionSimpleFoam, which, in this case, corresponds to the modified solution
method shown in the Appendix.
Description for the turbulent k-epsilon simulations
We will describe only the steps that change in the simulations.
43
2. Change the file changeDictionary to set the initial and the boundary conditions for
k and epsilon. The configuration utilized for the current case are shown in the
following box.
epsilon
{
internalField uniform 0.0003971992; //This is just for starting, will be recalculated in the first step
boundaryField
{
inlet
{
type compressible::turbulentMixingLengthDissipationRateInlet;
mixingLength 0.0038; //Definition of the mixing length
value uniform 1; //This is just a placeHolder
}
outlet
{
type zeroGradient;
//type inletOutlet;
//inletValue uniform 0.0003971992; //In case of reversed flow
//value uniform 1; //This is just a placeHolder
}
symetry
{
type symmetry;
}
wall
{
type compressible::epsilonWallFunction; //Adjusting epsilon to the wall function
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 1; //This is just a placeHolder
}
}
}
k
{
internalField uniform 0.0004386347; //This is just for starting, will be recalculated in the first step
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.0425; //Definition of the fluctuation intensity -!! Considering iso-tropic turbulence-
value uniform 1; //This is just a placeHolder
}
outlet
{
type zeroGradient;
//type inletOutlet;
//inletValue uniform 0.0004386347; //Inlet value in case of reversed flow
//value uniform 1; //This is just a placeHolder
}
symetry
{
type symmetry;
}
wall
{
type compressible::kqRWallFunction; //Adjusting k to the wall function
44
value uniform 1; //This is just a placeHolder
}
}
}
mut
{
internalField uniform 0; //This will be calculated based on the solution of the kEpsilon equations
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
symetry
{
type symmetry;
}
wall //This is the only important part
{
type mutkWallFunction; //We are selecting the inclusion of a wall function -k based- in the
model
value uniform 0;
}
}
}
The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92,
Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be
standard and we use standard wall functions for the near-wall treatment.
The rest of the parameters and models utilized for the turbulent kinetic energy and for
the dissipation rate are similar to the 2D case. As an alternative for rapid stabilization of
the turbulent viscous stresses in this case, inletOutlet conditions may be used for the
output values for the k and epsilon quantities. However, these parameters should only
be used for the initial steps, since then they may result in oscillations for the method.
3. In the discretization schemes for the turbulent equations, we must specify the
discretization schemes for the k-epsilon turbulent equations. The discretization proposed
in shown in the following box.
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
45
divSchemes
{
default none;
div(phi,K) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(R) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
p_rgh;
}
Once again low order methods are used in the discretization schemes for a rapid
solution of the system of equations. The very orthogonal and well oriented mesh help
once again in the stability of the method, allowing us to use low order schemes.
4. We following specify the the solution schemes for the k and epsilon solvers. This
terms come as predictors of the turbulent viscosity and therefore is common practice to
use the same discretization schemes as for the velocity field. In the following box we
specify the discretization use for the current simulation.
"(|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-8;
relTol 0.1;
}
6. Finally in the turbulenceProperties file, we specify the simulation type as RASModel
and in the RASProperties file we specify the RASModel as kEpsilon.
46
Results obtained for the plane Channel 2D
Test 0: Velocity profiles
First, we propose as a ground test to compare the laminar velocity profile with the
analytical solution obtained for a velocity profile in the channel. The analytical solution
for the flow in a square channel, have been developed by manually integrating the
Navier Stokes equations for the 2D developed flow. According to [Viscous fluid flow,
Frank White, p. 120] the analytical solution can be expressed as
For comparing the velocity profiles, we first take a section in a z coordinate
where the profile is already developed. Then in the resulting 2D square section, we plot
the velocity in lines parallel to the y axis for 4 different x coordinates. The x coordinates
with are chosen are x=0m (is the center-line on the channel), x=0.01m, x=0.02m and
x=0.025m (which correspond to the wall) The results are shown in graph 1.
Graph 1. A very good agreement is observed between the OpenFOAM solution
and the analytical one. The average error is calculated in 0,15%, being the maximum
average error of 0,27% in the center-line profile.
Following, another ground taste is to observe the profiles obtained for a turbulent
simulation and compare it with the one obtain for a laminar simulation. For doing so we
take the y velocity profile for Reynolds numbers of 100 and 40000, with are laminar and
turbulent respectively. We then plot both velocities profiles in the lines identified in the
previous case. Multiplying profile of the former profile by 400, we obtain the results
depicted in Graph 4.2.
47
Graph 4.2. Comparison between the laminar and the turbulent profiles simulated
by OpenFOAM.
In this case the presence of the two walls is evidenced by a more abrupt
decrease of the velocity towards the corner. The turbulent diffusion coefficient reaches
its maximum closer to each wall because the presence of the other wall. The results
show flux conservation for both simulations and behave physically as expected for the
case.
48
Laminar Test 1: Friction factor and development length,
variating the number of elements
For the first test we fix the aspect ratio in 0,2 and we variate the
number of elements in the mesh. We perform the simulations for the laminar
Reynolds numbers of 100, 500 and 2000, for the meshes shown in Table 2.
We then compare the non dimensional entrance length and with
the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The
way for computing the theoretical predictions is explain in the ANSYS section
for this case. The results obtained are shown in Figure 4.3.
0 1 2 3 4 5 6 7 8 9
0,05
0,06
0,06
Entrance Length Re_100
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
0 1 2 3 4 5 6 7 8 9
0,05
0,06
0,06
0,07
Entrance Length Re_500
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
49
0 1 2 3 4 5 6 7 8 9
0,05
0,05
0,06
0,06
Entrance Length Re_1000
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
0 1 2 3 4 5 6 7 8 9
0,18
0,2
0,22
0,24
0,26
Friction factor Re_100
Friction_Factor_OpenFoam
Friction_factor_theoretical
Mesh
f*Re/100
0 1 2 3 4 5 6 7 8 9
0
0,1
0,2
0,3
Friction factor Re_500
Friction_Factor_OpenFoa
m
Friction_factor_theoretical
Mesh
f*Re/100
50
0 1 2 3 4 5 6 7 8 9
0,21
0,22
0,23
0,24
0,25
Friction factor Re_1000
Friction_Factor_OpenFoa
m
Friction_factor_theoretical
Mesh
f*Re/100
Figure 4.3. Development length and friction factor for laminar
Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant
aspect ratio factor variating the number of elements in each mesh.
For the development length, for all Reynolds number, acceptable results are
obtained for mesh of number of elements larger than mesh 4. In all cases, the error
attended are below 2% for mesh 4. It is notable to mention that for meshes 7 and 8 less
than 1% of error are obtained for all cases. Considering that mesh 4 is composed of 113
elements in the z direction and, 11 elements in the y and x direction, a maximum volume
of 4e-7 m³ (for an overall aspect ratio of 0,2) is recommended for the element in order to
attain acceptable errors in the solutions obtained. In a similar case, if an error of less
than 1% in comparison to the theoretical solution wants to be attained in all cases, a
maximum volume of 1,5e-8 m³ for the cell is recommended for an aspect ratio of 0,2.
In this case, though the mesh are similar to the 2D case, it is observed that the
errors are decreased from mesh 4 to mesh 6. This is because by modeling a a quadrant
of the channel we are improving the resolution in the mesh for similar discretization.
However, for mesh 7 and 8, the errors obtained for the entrance length in comparison
with the laminar solution are the same. This is because this error is not induced by an
under-discretization in the mesh, but rather by an error of resolution in the velocity profile
(which is very similar for the 2D and 3D cases).
51
The errors obtained for the friction factor coefficients are smaller than the ones
obtained for the development length. In this case, once again, acceptable results are
obtained for meshes denser than mesh 3. In comparison with the 2D case, in which the
acceptable mesh was determined as 4 we justify the difference, once a gain, in a denser
mesh obtained by modeling a quadrant. The errors obtained for all the laminar cases are
below 1,2%. It is again notable to mention that for meshes 7 and 8 less than 0,5% of
error is obtained for all cases in the comparison of the friction factor with respect to the
theory. This error is quite close to the average error on resolution in the velocity profile,
which justifies the use of low order methods in the discretization of the problem. Once
again, if a maximum element volume of 1,5e-8 m³ is used the errors will be smaller than
0,5%.
It is notable in this case, that because of the influence of one wall over the other,
the skin friction factor coefficients for the wall present an error which is slightly larger. In
numerical terms, we justify this in that the perturbations introduced by one wall are more
likely to have influence over the other.
Laminar Test 2: Friction factor and development length,
variating the aspect ratio of the cells
For the test we fix the number of elements in that of mesh 6: 119554,
which was proven in the former case to give accurate results for the case of
an aspact ratio of 0,2. Then, we perform the simulations for the laminar
Reynolds numbers of 100, 500 and 2000, variating the aspect ratio of the
cells (as shown in Table 3). We then compare the non dimensional entrance
length and with the Maning skin friction factor [View Fluid
Mechanics, Frank White, 2009]. The procedures for the determination of the
theoretical values are listed in the ANSYS section of the case. The results
obtained are shown in Figure 4,4.
52
0 0,5 1 1,5 2 2,5
0,05
0,06
0,06
0,07
Entrance Length Re 100
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
0 0,5 1 1,5 2 2,5
0,05
0,06
0,06
0,07
Entrance Length Re 500
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
0 0,5 1 1,5 2 2,5
0,06
0,06
0,06
0,06
0,06
Entrance Length Re 1000
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
53
0 0,5 1 1,5 2 2,5
0,18
0,2
0,22
0,24
0,26
Friction factor Re 100
Friction_Factor_OpenFoam
Friction_factor_theoretical
Aspect Ration
f*Re/100
0 0,5 1 1,5 2 2,5
0,21
0,22
0,23
0,24
0,25
0,26
Friction factor Re 500
Friction_Factor_OpenFoam
Friction_factor_theoretical
Aspect Ratio
f*Re/100
0 0,5 1 1,5 2 2,5
0,2
0,22
0,24
0,26
Friction factor Re 1000
Friction_Factor_OpenFoam
Friction_factor_theoretical
Aspect Ratio
f*Re/100
Figure 4.4. Development length and friction factor for laminar
Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant
number of elements variating the aspect ratio of them.
54
For the development length, for all Reynolds numbers, acceptable results are
obtained for the plateau laying between the aspect ratio of 0,1 and 1. In all cases, the
error attended are below 1,5% inside this region. This error is coincident with the one
obtained for mesh 6 in the previous case. An aspect ratio smaller than this one, will case
the perturbations introduced in the y direction to be amplified in the x direction, therefore,
obtaining a development of the fluid profile sooner than expected (view ANSYS
Appendix for more details). In a similar form, when the discretization in x becomes
smaller than the discretization in y, the quite big perturbations generated in the stream-
wise direction, influence the form of the velocity profile in the t direction, causing a late
development. This last statement which was a hypothesis in the previous 2D simulation,
is supported by the fact that the error is larger in the 3D case for aspect ratios larger
than 1, since there are two transversal directions-
The errors obtained for the friction factor coefficients are smaller than the ones
obtained for the development length. The plateau obtained for attaining an acceptable
result in the simulations is larger than in the previous cases. For this case, it is
determined between 0,05 and 2 for the value of the aspect ratio. Note that the limits of
this region have been obtained by interpolation fitting of the aspect ratios simulated. The
errors obtained for all the laminar simulations in this region lies below 1%. In this case,
for determining the friction factor, a bigger plateau is a consequence of a less
recuperating influence in perturbations near the wall.
Turbulent Test: Friction factor and development length
We simulate turbulent flows for Reynolds numbers of 40000 and 500000. The
rugosity of the wall is assumed to be zero. For computing the turbulent viscosity a RANS
kEpsilon model is utilized. The standard coefficients are used for this model [Reference
Facundo]. The results obtained for the non-dimensional entrance length and for the
Manning turbulent friction factor are computed against the theoretical predictions [view
ANSYS part for theoretical references]. The mesh utilized correspond to the one shown
in table 2. The results obtained are presented in table 4.
55
40000 2,25123 1,59186 0,65% 0,9841487588 0,00500024 0,0049139502 1,76%
500000 4,25315 1,5994409 0,80% 0,993782922 0,00300125 0,0029651642 1,22%
Table 4. Results obtained for the turbulent simulations using the kEpsilon model.
We observe that the results obtained show an acceptable agreement with the
theoretical predictions for both the entrance length and the friction factor determination.
The errors are observed to decrease their intensity at higher Reynolds since the high
intensity turbulence propose stabilize the perturbation influence in a bigger value
predicted for the turbulent viscosity. We observe a further decrease of the error in the 3D
case, compared to the 2D case, since the effect of two wall act as a considerable
dumper for numerical escilations.
Appendix. Main parameters of the simulations
56
Factor LD 0,0586 Laminar
1,592748 Turbulent
H 0,05 m
Skin_Factor 14,23 Laminar
0,04091125 Turbulent
Height of the
channel m 0,05
Roughness
Physical Heigth 1,00E-06
Turbulent Intensity 0,10%
k 8,07712E-08
u* 0,000309144
Non-Dimmensional Heigth 2,12E-05
Reference MIN MAX
Hydrodynamically smooth 0 2,25
Transitional 2,25 90
Fuly Rough 90
1,00E+0
7
Initial
Conditi
ons
k 0,00043863
epsilon 0,0003972
57
Reynolds Inlet velocity water (m/s) Inlet velocity air (m/s) Turb length scale Turbulence Intensity
100 0,0010048087 0,0146073469 NA NA
500 0,0050240433 0,0730367347 NA NA
1000 0,0100480866 0,1460734694 NA NA
40000 0,4019234622 5,8429387755 0,0038 4,25%
500000 5,0240432779 73,0367346939 0,0038 3,10%
Grid/Mes
h
Type
Number of
divisions AR # Cells
X Y
8
Uniform
453 45 0,201333333 20385
7 319 32 0,199375 10208
6 226 23 0,196521739 5198
5 180 20 0,18 3600
4 113 11 0,205454545 1243
3 80 8 0,2 640
2 56 6 0,186666667 336
0 28 3 0,186666667 84
T
Non-
Uniform 564 15 0,752 8460
58
SQUARE CHANNEL 3D HYDRAULICS ANSYSFluent
Description of the simulation
The geometry consist in a square channel. The Reynolds numbers will be fixed in
100, 500 and 1000 for the laminar case and 40000 for the turbulent case. The following
Table 5.1 summarizes the physical parameters.
Parameter Unit Value
Side Length m 0.05
Length m 8
Table 5.1. Geometric simulation parameters
In this case both directions perpendicular to the axial direction are assumed to
have an appreciable effect in the dynamics of the fluid. For the simulation made, it was
chosen to work with a quarter of the square channel, this will in turn optimize the mesh
utilized reducing four times the domains. The selection of the laminar mesh is chosen to
respect the same cell size and aspect ratio that was previously simulates in the 2D plane
channel. However, since in this case both development direction are important, is
expected that the dynamics of the development of the boundary layer is changed. This
will in turn, implies different results in the development length and friction factor than for
the 3D square channel. The presence of the corner, and the known wrong resolution of
the kinetic energy and dissipation energy when interacting in corner, make us use a
mesh which density is doubled in the 3D channel, with respect of that used in the 2D
channel, near the corner.
The boundary conditions that need to be specified include inlet, outlet, axis and
wall, as will be described details later. Uniform flow was specified at inlet, the flow will
reach the fully developed regions after a certain distance downstream. No-slip boundary
condition will be used on the wall, constant pressure was used for outlet and axi-
59
symmetrical boundary conditions were used for the axis. Uniform grids will be used for
the laminar flow whereas non-uniform grid will be used for the turbulent flow. This is for
making it possible to study the influence of the aspect ratio in the laminar cases and for
gaining accuracy in the simulation of the skin factor in the turbulent cases. A description
of the domain and boundary conditions used is shown in Figure 5.1.
Figure 5.1. Top: view of the geometry and the boundary conditions, a symmetry
condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet
condition is in the opposite side on the inlet and is not shown in this picture. Bottom: a
picture of the regular, orthogonal, mapped mesh generated for the laminar simulations
to be made.
Experimental, analytical results and simulation results will be compared.
Additionally, detailed verification and validation studies will be conducted. Table 5.2
shows a tentative mesh sensibility study proposal which provides a uniform aspect ratio
of 0.2 for all the mesh for the laminar cases and a
+¿≈10
y
¿ with the correspondent
wall function imposition. Please note that a bias factor of 3.117 was used for the
turbulent mesh generation. The bias is oriented towards the right superior corner for the
z=constant planes and towards the inlet and outlet for y=constant and x=constant
planes. A schematic view for the mesh used for turbulent simulations is shown in Figure
5.2.
60
Grid/Mesh Type
Number of divisions AR # Cells
Z Y X
8
Uniform
453 45 45 0,201333333 917325
7 319 32 32 0,199375 326656
6 226 23 23 0,196521739 119554
5 180 20 20 0,18 72000
4 113 11 11 0,205454545 13673
3 80 8 8 0,2 5120
2 56 6 6 0,186666667 2016
0 28 3 3 0,186666667 252
T
Non-
Uniform 564 15 15 0,752 126900
Table 5.2. Proposed meshes for the sensibility study. Marked in yellow are the
meshes used for the simulations reported in this document.
Figure 5.2. View of the meshed utilized for the turbulent simulations, the mesh is
denser towards the corner where the two walls meet and coarser towards the symmetry
planes, the Bias factor utilized in the generation of the mesh is 3.117
Table 5.3 provides information about the proposed simulations to be made during
the study and the correspondent parameters to be extracted and analyzed in each
simulation.
Simuation Matrix
Study Grid Model
Friction factor and axial velocity profile 2,3,4,8
LaminarFriction factor study 6,7
Axial velocity, center-line pressure and
centerline velocity
T Turbulent
61
Table 5.3. Simulation matrix proposed for the 2D plane channel case
Steps of implementation in ANSYS
Description for the laminar simulations
1. Select the components to be used in the workbench and make the corresponding
connections.
2. Create the geometry. Make a sketch, adjust the dimensions of the cross section of the
channel, extrude the sketch to get the length of the channel and generate.
3. Create the mesh. Size the vertical and horizontal edges in the inlet face, without a
bias factor. Size the perpendicular edges to the face. Choose a hard or imposed
transition between elements for both cases. Choose a sweep method from the inlet face
to the outlet face for generating the mesh. Generate the mesh. Crate a named selection
for the inlet, outlet, symmetries and walls.
4. Performing the simulation.
4.a. Set up double precision in a serial processor and lunch Fluent
4.b. Perform a Mesh Check to see the mesh has been generated all-right.
Optionally perform Mesh Quality and see that the aspect ratio is lower than 50.
4.c. Check that in the general settings the Pressure-Based solver, an absolute
velocity formulation and a Steady time problem.
4.d. Select in Models, a viscous laminar model to be implemented
4.e. Add in material water to the material list
4.f. Set in surface body the element type simulation to fluid and select the
material to be water
4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in
velocity specification method specify “Magnitude, normal to the boundary” and
set the velocity to the magnitude corresponding to each specific Reynolds
number.
62
4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in
ANSYS 15) and edit the outlet gauge pressure to 0. Check also that the
supersonic or initial Gauge Pressure is set equal to 0
4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the
wall motion equation to be an stationary wall with no slip as shear condition. Also
change the operating conditions to a value of 97225.9 Pa in pressure.
4.g.4. Check that the axis boundary condition is set in axis (ID 14 in ANSYS 15).
4.h. Set the reference values following the inlet face values. [View the adjoin
excel sheet for automatic generation.]
4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell
based, the pressure to second order and the momentum to second order upwind.
4.j. Leave the solution control as default
4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity and z-
velocity to 1e-6.
4.l. In initialization choose standard initialization, select the reference frame as
relative to cell zone and put the gauge-pressure = 0 the x velocity equal to the
inlet velocity, the y-velocity =0 and the z-velocity=0.
4.m. Initialize the simulation.
4.n. In run calculation change the number of iterations to 1000 and lunch the
calculation.
5. Analysis of the results
5.1 Plot the velocity in the center-line where the two symmetry planes meet for
determining the development length. For post-processing use the following criteria.
Search for the percentage of the maximum velocity that betters agrees with the
development length. Eg. If the development length should be 0.05m, search c such that
c*Umax determines the velocity value in the position 0.05m. The error is the described
by Error=(c−0,99)/c .
5.2. Extract as wall fluxed the skin coefficients at the wall. For doing this generate
lines in the top wall and determine the skin friction factor distribution in this lines. The
final friction factor will be equal to the integral of the friction factors over the length of the
63
line, divided by the length of the line. The friction factor should be taken as the integral
over a line in which the flow is already developed. See excel sheet.
Description for the turbulent k-epsilon simulations
We will describe only the steps that change in the simulations.
3. Create the mesh. Size the vertical and horizontal edges in the inlet face, include
the bias factor in the direction shown in Figure 2. Size the perpendicular edges to the
face, with a double bias factor, to get a mesh denser towards the inlet and the outlet.
All Bias factors used have the value of 3.117. Include a sweep method from the inlet
face to the outlet face for generating the mesh. Generate the mesh. Crate a named
selection for the inlet, outlet, symmetries and walls.
4. Performing the simulation.
4.d. Select in Models, k-epsilon 2 equations. The coefficients for the model
should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1,
Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we
use standard wall functions for the near-wall treatement.
4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in
velocity specification method specify “Magnitude, normal to the boundary” and
set the velocity to the magnitude corresponding to each specific Reynolds
number. Check also that the supersonic or initial Gauge Pressure is set equal to
0. Specify the turbulence method to intensity and length scale and set intensity in
4.2%, in accordance to I=0,016 ReDh
−1
8 - , for ReDh=40000 . Set the length
scale for the turbulence as l=0,038∗Dh [See appendix].
4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in
ANSYS 15) and edit the outlet gauge pressure to 400 –not to have absolute
pressures lower than 0 in the calculation-. For the turbulence method select k
and epsilon and specify both values constant and equal to 1.
4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the
wall motion equation to be a stationary wall with no slip as shear condition. Set
the roughness height and the roughness constant equal to 0 [See appendix].
4.g.4. The axis boundary condition remains as axis.
64
4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell
based, the pressure to second order and the momentum to second order upwind.
Also set the turbulent kinetic energy solution method to ‘second order upwind’
and the turbulent dissipation rate to ‘second order upwind’.
4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity, k and
epsilon to 1e-6.
4.l. In initialization choose standard initialization, select the reference frame as
relative to cell zone and put the gauge-pressure = 400 the x velocity equal to the
inlet velocity and the y-velocity =0. Also set the initial values of the initial turbulent
kinetic energy and the initial energy dissipation rate as calculated in the excel
sheet.
4.n. In run calculation change the number of iterations to 1000 and lunch the
calculation.
5. Analysis of the results
5.1 Take the entrance length before the first peak in the center line velocity.
5.2. Take the friction factor for lines after the peak of velocity. For making the
integral of the distributions of friction factor in the line a trapezium rule is utilized. A
Simpson’s rule may be utilized if more precision is required, however for the current
comparisons the little improvement in the results is not be worth the effort. Note: For
determining the theoretical friction factor for the turbulent case, a simple rule is used
taking into account the difference in the laminar coefficients, i.e. f turb
SC
=
f turb
PIPE
∗f lam
SC
f lam
PIPE .
This method is correct if we assume that the same geometrical phenomena that
originates a change in the friction factor for a square channel (SC) and a pipe in the
laminar regime are taking place unchanged in the turbulent regime. The results
observed are improved in agreement when using this simple rule by 7%, taking the error
in the comparison in the simulations and the predicted values for the skin friction factor
from 9% to 2%.
65
Results obtained for the plane Channel 2D
Re L Lplus Error
Value*
Umax
Skin_Factor_C
alculated Skin_Factor_Predicte
100 0,283186 0,0566372 4,36% 0,98 0,140520963 0,1423
500 1,45133 0,0580532 1,74% 0,982 0,028104176 0,02846
1000 2,83186 0,0566372 4,36% 0,98 0,014050847 0,01423
40000 1,13777 1,60904976 1,23% 0,992 0,005026097 0,00491395
lxvi
Appendix 1. Friction factors and entrance length in non-
circular channels
The common parameter for modelling a non-circular channel is the aspect ratio.
The aspect ratio is a factor that describes the cross section of a channel. This one gives
us an idea of the corners existing in this one and the consequent buildup of the shear
stress in this ones. According to the geometrical shape of the cross section, the friction
factor can be defined as expressed by table 1.
Once the aspect ratio of the cross sectional area is defines, there exist different
approaches for identifying the size of this one. The two principal to mention are the one
based in the hydraulic diameter Dh and the one based in the square root of the cross
sectional area √A . Please note that for regular, concave polygons, the two
magnitudes differs by a relatively small amount. Is to mention the case of the square
channel in which both are equal. However the more complex and the less regular the
67
area of the cross section, the more this two factor will differ. The friction factor may be
related to the aspect ratio of the channel by the flowing relationships.
Equation 51 is for the hydraulic diameter and equation 53 for the square root of
the area. Table 2 shows some of the results obtained by this two correlations for
rectangular and elliptical sections.
Table 2. Friction factors for rectangular and elliptical sections as predicted by the
formulas based on the hydraulic diameter and the square root of the area.
In a similar way we can define the relationship of the aspect ratio to the laminar
entrance length in a non-circular duct. It is known that for any enclosure, the entrance
length can be defined as L=f 1(ϵ)ℜDh or L=
~
f 1(ϵ)ℜ√A . We choose to use the
68
relationship based in the hydraulic diameter and we define
+¿=f 1 (ϵ)=
L
ℜ Dh
Lh
¿
. The
functional relationship existing between the non-dimensional homogenized entrance
length (
+¿
Lh
¿ ) and the aspect ratio can expressed by the following equation.
Some results obtained by this equation for rectangular and elliptical sections are
summarized in Table 3.
Table 3. Non-dimensional entrance length as a function of the aspect ratio for
laminar flow.
69
Appendix 2. Effect of corners
In micro-channel fluid flows important effects of the corners of the channel in the
velocity profile distribution of the fluid have been observed. This is mainly because the
added effects of surface tension become important with respect to the inertia forces of
the fluid Eo≈1 . However, for larger channel, when the separation between the
surfaces becomes larger than 1mm, the effects of various corners presented in the fluid
flow can be depreciated. In the current case we proceed in this fashion.
70
Appendix 3. Main parameters of the simulations
Reynold
s
Inlet velocity
water (m/s)
Inlet velocity air
(m/s)
Turb
length
scale
Turbulence
Intensity
100 0,002009617 0,029214694 NA NA
500 0,010048087 0,146073469 NA NA
1000 0,020096173 0,292146939 NA NA
40000 0,803846924 11,68587755 0,0038 4,25%
Factor LD 0,0586 Laminar
1,592748 Turbulent
H 0,05 m
Skin_Fact
or 14,23 Laminar
0,04091125 Turbulent
Roughness
Physical Heigth 1,00E-06
Turbulent Intensity 0,10%
k 3,23085E-07
u* 0,000618287
Non-Dimmensional Heigth 4,23E-05
Initial
Conditions
k 0,00175454
epsilon 0,00317759
yplus
71
y0 0,0025
T_wall 14,8351558
yplus 36,9769585
Grid/Mes
h
Type
Number of divisions AR # Cells
Z Y X
8
Uniform
453 45 45 0,201333333 917325
7 319 32 32 0,199375 326656
6 226 23 23 0,196521739 119554
5 180 20 20 0,18 72000
4 113 11 11 0,205454545 13673
3 80 8 8 0,2 5120
2 56 6 6 0,186666667 2016
0 28 3 3 0,186666667 252
T
Non-
Uniform 564 15 15 0,752 126900
72
73
PIPE 3D HYDRAULICS OpenFOAM
Description of the simulation
The geometry consist in a circular pipe. This case have been selected since
plenty of experience exist in the study of this type of geometry. Previous results have
been successfully obtained for 2D axi-symmetrical simulations in ANSYS. In this case
the influence of a 3D mesh will be studied. The Reynolds numbers will be fixed in 100,
500 and 1000 for the laminar case and 40000 for the turbulent case. The following Table
6.1 summarizes the physical parameters.
Parameter Unit Value
Radius m 0.05
Length m 8
Table 6.1. Geometric simulation parameters
The 3D simulations include the possibility of watching coherent, non-
asymmetrical structures that will not be observable in a 2D simulation. However, for the
current problem, ideally no non-asymmetrical effects will exist. Therefore, the results
expected are similar to those in 2D simulations.
For the simulation made, it was chosen to work with a quarter of the pipe, this
will optimize the number of elements utilized in the mesh by 4 times. This is, for
acquiring the same mesh density, 4 times less elements should be used for a quarter of
the pipe than for the full pipe.
The selection of the laminar mesh is chosen to respect the same cell size and
aspect ratio that was previously simulated in the 2D asymmetrical case in ANSYS.
However, for the sweeping method used a larger density of mesh is observed near the
axis. It is important to observe that, because the cuts in the quarter are imposed
74
symmetrical boundary conditions, no numerical discretization agglomeration is observed,
since there is no source introducing a large numerical error towards the core of the
mesh. Adding this to a small mesh Peclet number, indicates, a priori that no significant
artificial diffusion errors will be introduced [view ANSYS Appendix for the case].
The boundary conditions that need to be specified include inlet, outlet, cyclic and
wall. Uniform flow was specified at inlet, the flow will reach the fully developed regions
after a certain distance downstream. No-slip boundary condition will be used on the wall,
constant pressure was used for outlet and cyclic boundary conditions were used for the
cuts that determine the quarter [view Figure 1]. Please note that also symmetrical
boundary conditions could have been used for this relatively simple case, however due
to better numerical behavior of the code with cyclic boundary conditions, this ones are
chosen.
Experimental, analytical results and simulation results will be compared.
Additionally, detailed verification and validation studies will be conducted. For the
laminar cases (Reynolds number of 100, 500, 1000) radially and azimuthal uniform grids
will be used for the laminar flow. This is for studying uniquely the influence of the aspect
ratio and number of elements in the results by making uniform the external error
influence over the mesh.
In the first case, we choose to keep the aspect ratio of the cell constant while
variating the number of elements, the meshes utilized are shown in Table 6.2. For a
second case, we select the number of cells in mesh 6 and proportionally variates the
discretization parameters to obtain different aspects ratios for the elements. Table 6.3
present the meshes used during the simulation. Please note that the discretization in R
and are variated in a proportional form to induce a similar aspect ratio in the constant
R and constant planes.
75
Figure 6.1. Top: view of the geometry and the boundary conditions, a symmetry
condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet
condition is in the opposite side on the inlet and is not shown in this picture. Bottom:
sweeped, radially uniform mesh, generated for the laminar simulations to be made.
A bias factor of 3.117 was used for the turbulent mesh generation. The bias is
oriented towards the wall off the pipe, as the symmetric conditions suppose a domain
continuation. Also a bias in for generating smaller cells in the inlet and in the outlet is
included. This is for gaining precision in the results obtained. With this discretization we
get for the furthest first cell from the wall for the Re=40000 case and for
the Re=500000 case. Both resolutions lies between the acceptable standards. A
schematic view for the mesh used for turbulent simulations is shown in Figure 6.2.
Grid/Me
sh
Type
Number of divisions
AR # Cells
Z R Perimeter
8
Uniform
453 45 45 0,20133333 917325
7 319 32 32 0,199375 326656
6 226 23 23 0,19652174 119554
5 180 20 20 0,18 72000
4 113 11 11 0,20545455 13673
3 80 8 8 0,2 5120
2 56 6 6 0,18666667 2016
0 28 3 3 0,18666667 252
T
Non-
Uniform 564 15 15 0,752 126900
76
Table 6.2. Proposed meshes for the sensibility study. For the laminar cases the
aspect ratio is fixed while we variate the number of elements.
Figure 6.2. View of the meshed utilized for the turbulent simulations, the mesh is
denser towards the wall of the pipe, the Bias factor utilized in the generation of the mesh
is 3.117
Table 6.3 provides information about the proposed simulations to be made during
the study and the correspondent parameters to be extracted and analyzed in each
simulation.
Simuation Matrix
Study Grid Model
Friction factor and development length, variating the
number of elements 0,2,3,4,5,6,7,8
Laminar
Friction factor and development length, variating the
aspect ratio a,b,c,d,e
Velocity profile, friction factor and development length T Turbulent
Table 6.3. Matrix simulation proposed
The method for computing the development length consist in analyzing the axial
velocity and utilizing the same methodology we have used so far. Additionally, the wall
shear stress for computing the friction factor will be evaluated in a line adjacent to the
pipe wall.
77
Steps for the implementation in OpenFOAM
Description for the laminar simulations
1. The mesh is generated in ANSYS, exported in <mesh>.msh and ASCII format and
finally imported into fluid by the command fluentMeshToFoam.
2. Change the file changeDictionary to set the initial and the boundary conditions. The
configurations utilized for the current case are shown in the following box.
U
{
internalField uniform (0 0 0.0020096173);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0.0020096173);
}
outlet
{
type zeroGradient;
value uniform ( 0 0 0 );
//inletValue uniform ( 0 0 0 );
}
symetry
{
type cyclic;
}
wall
{
type fixedValue;
value uniform (0 0 0);
}
}
}
p_rgh
{
internalField uniform 100000;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 100000;
}
symetry
{
type cyclic;
}
78
wall
{
//type fixedFluxPressure;
type zeroGradient;
}
}
}
The inlet velocity will be change to fix the Reyolds in the channel. Alternatively, and
inletOutlet boundary condition can be used in the pressure outlet. However, this may
lead to flux oscillations. We observe that for the quarter planes cyclic boundary
conditions are used, however, internally a a limiter is included in the code for diminishing
the error caused by cross derivatives in the junction of the two quarter planes.
3. Following we set the discretization schemes for the solution of the fluid equations. The
utilized schemes are shown in the following box.
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded TVD;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
}
In this aspect there are two important measures which deserve some time for attention.
In first place, high order corrected schemes are used, this is because the non orthogonal
and not noble mesh will cause convergence issues for lower order schemes. Also, a
79
limited TVD scheme is included for limiting the perturbations arriving from the small
elements close to the axis to diffusing into the mesh.
4. Next, the solution methods for the system of equations have to be specified. The
following box show the configuration selected for the current case.
solvers
{
p_rgh
{
solver GAMG;
tolerance 1e-6;
relTol 0.01;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
"(U)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
}
SIMPLE
{
momentumPredictor on;
nNonOrthogonalCorrectors 5;
}
relaxationFactors
{
fields
{
p_rgh 0.7;
}
equations
{
U 0.3;
}
}
The only difference presented here with respect to the previous case is the introduction
of non-orthogonal correctors. This in done because due to the non-orthogonality in the
mesh configuration, the linear interpolation of the gradients between cells may be
inaccurate to represent the flux in the interface. The correction is done internally in the
pressure continuity equation [see Appendix for more information].
80
5. Finally in the controlDict we select as method of solution the
chtMultiRegionSimpleFoam, which, in this case, corresponds to the modified solution
method shown in the Appendix.
Description for the turbulent k-epsilon simulations
We will describe only the steps that change in the simulations.
2. Change the file changeDictionary to set the initial and the boundary conditions for
k and epsilon. The configuration utilized for the current case are shown in the
following box.
epsilon
{
internalField uniform 0.0003971992; //This is just for starting, will be recalculated in the first step
boundaryField
{
inlet
{
type compressible::turbulentMixingLengthDissipationRateInlet;
mixingLength 0.0038; //Definition of the mixing length
value uniform 1; //This is just a placeHolder
}
outlet
{
type zeroGradient;
//type inletOutlet;
//inletValue uniform 0.0003971992; //In case of reversed flow
//value uniform 1; //This is just a placeHolder
}
symetry
{
type cyclic;
}
wall
{
type compressible::epsilonWallFunction; //Adjusting epsilon to the wall function
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 1; //This is just a placeHolder
}
}
}
k
{
internalField uniform 0.0004386347; //This is just for starting, will be recalculated in the first step
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
81
intensity 0.0425; //Definition of the fluctuation intensity -!! Considering iso-tropic turbulence-
value uniform 1; //This is just a placeHolder
}
outlet
{
type zeroGradient;
//type inletOutlet;
//inletValue uniform 0.0004386347; //Inlet value in case of reversed flow
//value uniform 1; //This is just a placeHolder
}
symetry
{
type cyclic;
}
wall
{
type compressible::kqRWallFunction; //Adjusting k to the wall function
value uniform 1; //This is just a placeHolder
}
}
}
mut
{
internalField uniform 0; //This will be calculated based on the solution of the kEpsilon equations
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
symetry
{
type cyclic;
}
wall //This is the only important part
{
type mutkWallFunction; //We are selecting the inclusion of a wall function -k based- in the
model
value uniform 0;
}
}
}
The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92,
Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be
standard and we use standard wall functions for the near-wall treatment.
3. In the discretization schemes for the turbulent equations, we must specify the
discretization schemes for the k-epsilon turbulent equations. The discretization proposed
in shown in the following box.
ddtSchemes
{
default steadyState;
}
82
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,K) bounded TVD;
div(phi,k) bounded TVD;
div(phi,epsilon) bounded TVD;
div(phi,R) bounded TVD;
div(R) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
}
Once again high order discretization schemes are used given the non-orthogonality and
possible instantiates introduced by the mesh. For avoiding the rather large perturbation
generated in the axis for propagating into the mesh, TVS discretization schemes are
used.
4. We following specify the the solution schemes for the k and epsilon solvers. This
terms come as predictors of the turbulent viscosity and therefore is common practice to
use the same discretization schemes as for the velocity field. In the following box we
specify the discretization use for the current simulation.
"(|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-8;
relTol 0.1;
}
6. Finally in the turbulenceProperties file, we specify the simulation type as RASModel
and in the RASProperties file we specify the RASModel as kEpsilon.
83
Results obtained for the plane Channel 2D
Test 0: Velocity profiles
First, the ground test consist in comparing the velocity profile obtained
during the simulations with the well known theoretical Poiseulle profile. The
analytical expression for this profile reads as . The
comparison between the results obtain with OpenFOAM and the theoretical
results are presented in Figure 3.
0 0,01 0,02 0,03 0,04 0,05 0,06
0
0
0
0
0
0
Comparision laminar velocity profiles
Velocity_OpenFOAM
Velocity_Theoretical
r
u(z)
84
Graph 1. A very good agreement is observed between the OpenFOAM solution
and the analytical one. The average error is calculated in 0,22%, being the maximum
average error of 0,54% next to the wall of the pipe.
Laminar Test 1: Friction factor and development length,
variating the number of elements
For the first test we fix the aspect ratio in 0,2 and we variate the
number of elements in the mesh. We perform the simulations for the laminar
Reynolds numbers of 100, 500 and 2000, for the meshes shown in Table 2.
We then compare the non dimensional entrance length and with
the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The
way for computing the theoretical predictions is explain in the ANSYS section
for this case. The results obtained are shown in Figure 6.3.
0 1 2 3 4 5 6 7 8 9
0,04
0,05
0,05
0,06
Entrance Length Re 100
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
85
0 1 2 3 4 5 6 7 8 9
0,04
0,04
0,05
0,05
0,05
0,05
Entrance length Re 500
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
0 1 2 3 4 5 6 7 8 9
0,04
0,05
0,05
0,06
Entrance Length Re 1000
L_plus_OpenFOAM
L_plus_theoric
Mesh
L_plus
0 1 2 3 4 5 6 7 8 9
0,12
0,14
0,16
0,18
Friction factor Re 100
Friction_Factor_OpenFoam
Friction_factor_theoretical
Mesh
f*Re/100
86
0 1 2 3 4 5 6 7 8 9
0
0,05
0,1
0,15
0,2
Friction factor Re 500
Friction_Factor_OpenFoam
Friction_factor_theoretical
Mesh
f*Re/100
0 1 2 3 4 5 6 7 8 9
0,12
0,13
0,14
0,15
0,16
0,17
Friction factor Re 1000
Friction_Factor_OpenFoam
Friction_factor_theoretical
Mesh
f*Re/100
Figure 6,3. Development length and friction factor for laminar
Reynolds number of 100, 500 and 1000 for meshes with constant aspect
ratio factor variating the number of elements in each mesh.
For the development length, for all Reynolds number, acceptable results are
obtained for mesh of number of elements larger than mesh 5. In all cases, the error
attended are below 4% for mesh 4. It is notable to mention that for meshes 7 and 8 less
than 1,5% of error are obtained for all cases. In this cases, the higher resolution needed
for attaining better results comes as a result of the non-orthogonality of the mesh and
87
the errors introduced by the iteratively nature of the method in the non-orthogonal
corrections.
The errors obtained for the friction factor coefficients are smaller than the ones
obtained for the development length. In this case, once again, acceptable results are
obtained for meshes denser than mesh 4. The errors obtained for all the laminar cases
are below 2% in this region. It is again notable to mention that for meshes 7 and 8 less
than 1% of error is obtained for all cases in the comparison of the friction factor with
respect to the theory. Once again, for this case a higher resolution needed for attaining
results compared to the other cases is a direct consequence of the non-orthogonality of
the mesh.
It is worth to mention in this point that several non-orthogonal correctors where
needed for producing acceptable results. This is because the mesh quality was not
optimal.
Laminar Test 2: Friction factor and development length,
variating the aspect ratio of the cells
For the test we fix the number of elements in that of mesh 8: 91732,
which was proven in the former case to give accurate results for the case of
an aspect ratio of 0,2. Then, we perform the simulations for the laminar
Reynolds numbers of 100, 500 and 2000, variating the aspect ratio of the
cells (as shown in Table 3). We then compare the non dimensional entrance
length and with the Maning skin friction factor [View Fluid
Mechanics, Frank White, 2009]. The procedures for the determination of the
theoretical values are listed in the ANSYS section of the case. The results
obtained are shown in Figure 6.4.
88
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
0,04
0,05
0,05
0,06
Entrance length Re 100
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
89
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
0
0,02
0,04
0,06
Entrance Length Re 500
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
0,04
0,05
0,05
0,06
Entrance Length Re 1000
L_plus_OpenFOAM
L_plus_theoric
Aspect Ratio
L_plus
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
0,12
0,14
0,16
0,18
Friction factor Re 100
Friction_Factor_OpenFoam
Friction_factor_theoretical
Aspect Ratio
f*Re/100
90
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
0,12
0,14
0,16
0,18
Friction factor Re 500
Friction_Factor_OpenFoam
Friction_factor_theoretical
Aspect Ratio
f*Re/100
0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2
0,14
0,15
0,16
0,17
Friction factor Re 1000
Friction_Factor_OpenFoam
Friction_factor_theoretical
Aspect Ratio
f*Re/100
Figure 6.4. Development length and friction factor for laminar
Reynolds number of 100, 500 and 1000 for non-orthogonal meshes with
constant number of elements variating the aspect ratio of them.
For the development length, for all Reynolds numbers, acceptable results are
obtained for the plateau laying between the aspect ratio of 0,1 and 2. In all cases, the
error attended are below 4% inside this region.
It is observed in this case that when having a large aspect ratio, the mixed
perturbations produced by a smaller discretization in the Z direction than in the R
direction are hide under a smaller magnitude of the perturbations going into the mesh
because of a larger cell size close to the axis. Therefore, fairly good results are obtained
in comparison to the other results obtained. Another important point is that for low aspect
91
ratios, errors as large as 20% are obtained. Comparing this to the previous cases we
observe this error to be much larger than the previously attained. This is a consequence
of the failure of the TVD schemes for blocking the extra flux introduced by perturbations.
The errors obtained for the friction factor coefficients are smaller than the ones
obtained for the development length. The plateau obtained for attaining an acceptable
result in the simulations is once again between 0,1 and 2. The errors obtained for all the
laminar simulations in this region lies below 3%. Once again, good results are obtained
for large aspect ratios and very big errors are obtained for low aspect ratios. This is
again a consequence of the factors listed above.
Turbulent Test: Friction factor and development length
We simulate turbulent flows for Reynolds numbers of 40000 and 500000. The
rugosity of the wall is assumed to be zero. For computing the turbulent viscosity a RANS
kEpsilon model is utilized. The standard coefficients are used for this model [Reference
Facundo]. The results obtained for the non-dimensional entrance length and for the
Manning turbulent friction factor are computed against the theoretical predictions [view
ANSYS part for theoretical references]. The mesh utilized correspond to the one shown
in table 2. The results obtained are presented in table 4.
Table 4. Results obtained for the turbulent simulations using the kEpsilon model.
We observe that the results obtained show an acceptable criteria with respect to
the theoretical predictions. However, the errors obtained with respect to the previous
orthogonal meshes are much larger than the cases before. The situation is maximized
92
Re L Lplus Error Value*Umax Skin_Factor_Calculated Skin_Factor_Predicted Error
40000 1,88528 1,33309427 1,50% 0,994 0,005825 0,0055251724 5,43%
500000 3,52123 1,32419484 2,06% 0,995 0,003521 0,0033339865 5,61%
when determining the friction factor. We explain this once again in the amplification of
perturbations introduced by the fine mesh close to the pipe axis.
Appendix. Main parameters of the simulations
Factor LD 0,05 Laminar
1,359 Turbulent
D 0,1 m
Skin_Factor 16 Laminar
0,046 Turbulent
Height of the
channel m 0,05
Roughness
Physical Heigth 1,00E-06
Turbulent Intensity 0,10%
k 8,07712E-08
u* 0,000309144
Non-Dimmensional
Heigth 2,12E-05
Reference MIN MAX
Hydrodynamically smooth 0 2,25
Transitional 2,25 90
93
Re L Lplus Error Value*Umax Skin_Factor_Calculated Skin_Factor_Predicted Error
100 0,495575 0,0495575 1,79% 0,999 0,1625292456 0,16 1,58%
500 2,51327 0,0502654 0,57% 0,9896 0,0323480684 0,032 1,09%
1000 5,09735 0,0509735 4,37% 0,966 0,0167677414 0,016 4,80%
40000 1,885281,33309427 1,50% 0,994 0,005825 0,0055251724 5,43%
500000 3,521231,32419484 2,06% 0,995 0,003521 0,0033339865 5,61%
Fuly Rough 90 1,00E+07
Initial
Conditions
k 0,00043863
epsilon 0,0003972
94
PIPE 3D HYDRAULICS OpenFOAM
Description of the simulation
The geometry consist in a circular pipe. This case have been selected since
plenty of experience exist in the study of this type of geometry. Previous results have
been successfully obtained for 2D axi-symmetrical simulations. In this case the influence
of a 3D mesh will be studied. The Reynolds numbers will be fixed in 100, 500 and 1000
for the laminar case and 40000 for the turbulent case. The following Table 7.1
summarizes the physical parameters.
Parameter Unit Value
Radius m 0.05
Length m 8
Table 7.1. Geometric simulation parameters
It is observed that the dynamic of the structures generated in 3D simulations
correspond to a wider range than the dynamics generated for 2D simulation. This
include the possibility of watching coherent, non-asymmetrical structures that will not be
observable in a 2D simulation. However, for the current problem, ideally non-
asymmetrical effects will exist. Therefore, the results expected are similar to those in 2D
simulations.
For the simulation made, it was chosen to work with a quarter of the pipe, this
will optimize the number of elements utilized in the mesh by 4 times. This is, for
acquiring the same mesh density, 4 times less elements should be used for a quarter of
the pipe than for the full pipe.
The selection of the laminar mesh is chosen to respect the same cell size and
aspect ratio that was previously simulated in the 2D asymmetrical case. However, for the
95
sweeping method used a larger density of mesh is observed near the axis. It is important
to observe that, because the cuts in the quarter are imposed symmetrical boundary
conditions, no numerical discretization agglomeration is observed, since there is no
source introducing a large numerical error towards the core of the mesh. Adding this to a
small mesh Peclet number, indicates, a priori that no significant artificial diffusion errors
will be introduced [view Appendix].
The boundary conditions that need to be specified include inlet, outlet,
symmetries and wall, as will be described details later. Uniform flow was specified at
inlet, the flow will reach the fully developed regions after a certain distance downstream.
No-slip boundary condition will be used on the wall, constant pressure was used for
outlet and symmetrical boundary conditions were used for the cuts that determine the
quarter [view Figure 7.1]. Radially uniform grids will be used for the laminar flow whereas
non-uniform grid will be used for the turbulent flow. This is for making it possible to study
the influence of the aspect ratio in the laminar cases and for gaining accuracy in the
simulation of the skin factor in the turbulent cases. A description of the domain and
boundary conditions used is shown in Figure 7.1.
Figure 7.1. Top: view of the geometry and the boundary conditions, a symmetry
condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet
condition is in the opposite side on the inlet and is not shown in this picture. Bottom:
sweeped, radially uniform mesh, generated for the laminar simulations to be made.
96
Experimental, analytical results and simulation results will be compared.
Additionally, detailed verification and validation studies will be conducted. Table 2 shows
a tentative mesh sensibility study proposal which provides a uniform aspect ratio of 0.2
for all the mesh for the laminar cases and a
+¿≈10
y¿ with the correspondent wall
function imposition. Please note that a bias factor of 3.117 was used for the turbulent
mesh generation. The bias is oriented towards the wall off the pipe, as the symmetric
conditions suppose a domain continuation. A schematic view for the mesh used for
turbulent simulations is shown in Figure 7.2.
Grid/Me
sh
Type
Number of divisions
AR # Cells
Z R Perimeter
8
Uniform
453 45 45 0,20133333 917325
7 319 32 32 0,199375 326656
6 226 23 23 0,19652174 119554
5 180 20 20 0,18 72000
4 113 11 11 0,20545455 13673
3 80 8 8 0,2 5120
2 56 6 6 0,18666667 2016
0 28 3 3 0,18666667 252
T
Non-
Uniform 564 15 15 0,752 126900
Table 7.2. Proposed meshes for the sensibility study. Marked in yellow are the
meshes used for the simulations reported in this document.
Figure 7.2. View of the meshed utilized for the turbulent simulations, the mesh is
denser towards the wall of the pipe, the Bias factor utilized in the generation of the mesh
is 3.117
97
Table 7.3 provides information about the proposed simulations to be made during
the study and the correspondent parameters to be extracted and analyzed in each
simulation.
Simuation Matrix
Study Grid Model
Friction factor and axial velocity profile 2,3,4,8
LaminarFriction factor study 6,7
Axial velocity, center-line pressure and
centerline velocity
T Turbulent
Table 7.3. Simulation matrix proposed for the 2D plane channel case
Steps of implementation in ANSYS
Description for the laminar simulations
1. Select the components to be used in the workbench and make the corresponding
connections.
2. Create the geometry. Make a sketch of a circular arc, adjust it radius and extrude the
sketch to get the length of the pipe and generate.
3. Create the mesh. Select a sweep method form one symmetrical face into the other
one, selecting the number of divisions to be used in the perimeter. Size the edges
corresponding to the cuts in the inlet and outlet faces. Size the 3 perpendicular edges to
the inlet and outlet faces, corresponding to the length of the pipe. Choose a hard or
imposed criteria of sizing elements for all cases. Generate the mesh. Crate a named
selection for the inlet, outlet, symmetries and wall.
4. Performing the simulation.
4.a. Set up double precision in a serial processor and lunch Fluent
4.b. Perform a Mesh Check to see the mesh has been generated all-right.
Optionally perform Mesh Quality and see that the aspect ratio is lower than 50.
4.c. Check that in the general settings the Pressure-Based solver, an absolute
velocity formulation and a Steady time problem.
4.d. Select in Models, a viscous laminar model to be implemented
4.e. Add in material water to the material list
98
4.f. Set in surface body the element type simulation to fluid and select the
material to be water
4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in
velocity specification method specify “Magnitude, normal to the boundary” and
set the velocity to the magnitude corresponding to each specific Reynolds
number.
4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in
ANSYS 15) and edit the outlet gauge pressure to 0. Check also that the
supersonic or initial Gauge Pressure is set equal to 0
4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the
wall motion equation to be an stationary wall with no slip as shear condition. Also
change the operating conditions to a value of 97225.9 Pa in pressure.
4.g.4. Check that the symmetry boundary condition is set in symmetry planes (ID
14 in ANSYS 15).
4.h. Set the reference values following the inlet face values. [View the adjoin
excel sheet for automatic generation.]
4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell
based, the pressure to second order and the momentum to second order upwind.
4.j. Leave the solution control as default
4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity and z-
velocity to 1e-6.
4.l. In initialization choose standard initialization, select the reference frame as
relative to cell zone and put the gauge-pressure = 0 the x velocity equal to the
inlet velocity, the y-velocity =0 and the z-velocity=0.
4.m. Initialize the simulation.
4.n. In run calculation change the number of iterations to 1000 and lunch the
calculation.
5. Analysis of the results
5.1 Plot the velocity in the center-line where the two symmetry planes meet for
determining the development length. For post-processing use the following criteria.
Search for the percentage of the maximum velocity that betters agrees with the
99
development length. Eg. If the development length should be 0.05m, search c such that
c*Umax determines the velocity value in the position 0.05m. The error is the described
by Error=(c−0,99)/c .
5.2. Extract as wall fluxes the skin coefficients at the superior line of the pipe.
Since the pipe is symmetrical the skin factor will be the same on every line parallel to the
axis of the pipe. Compute the skin friction factor after the fluid profile is developed.
Description for the turbulent k-epsilon simulations
We will describe only the steps that change in the simulations.
3. Create the mesh. Select a sweep method form one symmetrical face into the
other one, selecting the number of divisions to be used in the perimeter, with no
imposed bias factor. Size the edges corresponding to the cuts in the inlet and
outlet faces, impose on them a bias factor of 3,117 directed from the walls
towards the center for each edge –generating a finer mesh at the wall-. Size the
3 perpendicular edges to the inlet and outlet faces, corresponding to the length of
the pipe, imposing a double Bias distribution with factor 3,117, so that the mesh
is denser towards the inlet and outlet faces. Generate the mesh. Crate a named
selection for the inlet, outlet, symmetries and wall.
4. Performing the simulation.
4.b. In case the check mesh states that the wall distance need to be treated for
implementing the wall functions, introduce in the user interface /solve/initialize/repair-
wall-distance
4.d. Select in Models, k-epsilon 2 equations. The coefficients for the model
should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1,
Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we
use standard wall functions for the near-wall treatement.
4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in
velocity specification method specify “Magnitude, normal to the boundary” and
set the velocity to the magnitude corresponding to each specific Reynolds
number. Check also that the supersonic or initial Gauge Pressure is set equal to
0. Specify the turbulence method to intensity and length scale and set intensity in
4.2%, in accordance to I=0,16 ReDh
−1
8 - , for ReDh=40000 . Set the length
scale for the turbulence as l=0,038∗Dh [See appendix].
100
4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in
ANSYS 15) and edit the outlet gauge pressure to 400 –not to have absolute
pressures lower than 0 in the calculation-. For the turbulence method select k
and epsilon and specify both values constant and equal to 1.
4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the
wall motion equation to be a stationary wall with no slip as shear condition. Set
the roughness height and the roughness constant equal to 0 [See appendix].
4.g.4. The symmetry planes boundary condition remains as symmetry (ID 19
ANSYS 15).
4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell
based, the pressure to second order and the momentum to second order upwind.
Also set the turbulent kinetic energy solution method to ‘second order upwind’
and the turbulent dissipation rate to ‘second order upwind’.
4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity, k and
epsilon to 1e-6.
4.l. In initialization choose standard initialization, select the reference frame as
relative to cell zone and put the gauge-pressure = 400 the x velocity equal to the
inlet velocity and the y-velocity =0. Also set the initial values of the initial turbulent
kinetic energy and the initial energy dissipation rate as calculated in the excel
sheet.
4.n. In run calculation change the number of iterations to 1000 and lunch the
calculation.
5. Analysis of the results
5.1 Take the entrance length before the first peak in the center line velocity.
5.2. Take the friction factor the superior line after the peak of velocity.
Attention: The style of mesh proposed may have several problems with the
convergence of the k-epsilon equations near the axis. This is because an artificial source
generated by the small discretization in this equations arriving from the artificial diffusion
of this quantities produce that the error in this two quantities reaches a minimum value
equal to the source of error. For improving the results, central difference schemes may
be used for the k-epsilon equations or a different form of mesh with similar aspect of
elements in the cross section can be tried.
101
Results obtained for the plane Channel 2D
Re L
Lpl
us
E
rror
Valu
e*Umax Skin_Factor_Calculated
10
0
0
,49557
5
0,
0495575
1
,79%
0,99
9 0,162529246
50
0
2
,51327
0,
0502654
0
,57%
0,98
96 0,032348068
10
00
5
,09735
0,
0509735
4
,37%
0,96
6 0,016767741
40
000
1
,88528
1,
3330942
7
1
,50%
0,99
4 0,005682634
102
Appendix 1. False diffusion errors
Usually it is stated that the Central difference scheme is superior to the Upwind
scheme because it is second-order accurate whereas the Upwind scheme is only first-
order accurate. But when we compare the Central difference and Upwind schemes - τ
is the diffusion coefficient for the problem-: τupwind=τcentralDifferences+
ρuδx
2
This added diffusion is considered bad at large Peclet numbers
Pemesh=
Convectiv eflux
Diffusiv eflux
=
ρu
τ /δx
, where the flow is governed by convection fluxes.
However, at small Peclet numbers, the actual diffusion covers for the added artificial
diffusion.
The artificial diffusion in the upwind discretization arrives in the direction
perpendicular to the main flow. This, for the pipe flow studies, will then generate that fluid
profile develops more rapidly than expected in the zone near the axe.
The following Figure shows examples for the false diffusion errors for different
two dimensional meshes in a fixed domain. We observe, that the phenomenon becomes
less important as we increase the size of the mesh, therefore reducing the mesh Peclet
number.
103
Appendix 2. Friction factors and entrance length in a pipe
The friction factor (also sometimes called the Moody friction factor) can be
determined for known values of Reynolds number and ε/D from empirically derived
charts and/or equations. A commonly used chart is the Moody friction factor chart. This
chart helps to illustrate how the friction factor, f, depends upon Reynolds number and
pipe roughness/pipe diameter (ε/D). The straight line at the upper left on the diagram
represents laminar flow, in which f is independent of ε/D and depends only on Re. The
portion of the chart with horizontal lines is called the completely turbulent region, in
which f depends only on ε/D. For the rest of the graph, the transition region, f depends
upon both Re and ε/D. The dark solid line represents "smooth pipe turbulent flow", in
which f depends only on Re.
There are equations available for friction factor for each of the four regions of the
chart identified above as follows.
For laminar flow (Re < 2100): f = 64/Re
For the completely turbulent region: f = [1.14 + 2 log10(D/ε)]-2
For smooth pipe turbulent flow: f = 0.316/Re1/4
For the transition region: f = {-2 log10[(ε/D)/3.7 + 2.51/Re(f1/2
)]}-2
104
This expression are graphically shown in the Moody’s diagram depicted below.
Note that the last equation requires an iterative solution to find f for given values
of ε/D and Re, or "solver" can be used in the Excel spreadsheet.
The entrance length can be expressed with the dimensionless Entrance Length
Number expressed as
El = le / d
where
El = Entrance Length Number
le = length to fully developed velocity profile (m, ft)
d = tube or duct diameter (m, ft)
Entrance Length Number for Laminar Flow
105
The Entrance length number correlation with the Reynolds Number for laminar
flow can be expressed as:
El_laminar = 0.06 Re
where
Re = Reynolds Number
Entrance Length Number for Turbulent Flow
The Entrance length number correlation with the Reynolds Number for turbulent
flow can be expressed as:
Elturbulent = 4.4 Re1/6
106
Chapter 1. Appendix 3. Main parameters of the
simulations
Reynold
s
Inlet velocity
water (m/s)
Inlet velocity air
(m/s)
Turb
length
scale
Turbulence
Intensity
100 0,001004809 0,014607347 NA NA
500 0,005024043 0,073036735 NA NA
1000 0,010048087 0,146073469 NA NA
40000 0,401923462 5,842938776 0,0076 4,25%
Factor LD 0,05 Laminar
1,359 Turbulent
D 0,1 m
Skin_Factor 16 Laminar
0,046 Turbulent
Roughness
Physical Heigth 1,00E-06
Turbulent Intensity 0,10%
k 8,07712E-08
u*
0,00030914
4
Non-Dimmensional
Heigth
2,12E-05
Initial
Conditions
k 0,00043863
epsilon 0,0001986
107
yplus
y0 0,0025
T_wall 3,70878894
yplus 9,24423963
Grid/Mes
h
Type Number of divisions
AR
#
Cells
Z Y X
8
Uniform
453 45 45 0,201333333
91732
5
7 319 32 32 0,199375
32665
6
6 226 23 23 0,196521739
11955
4
5 180 20 20 0,18 72000
4 113 11 11 0,205454545 13673
3 80 8 8 0,2 5120
2 56 6 6 0,186666667 2016
0 28 3 3 0,186666667 252
T
Non-
Uniform 564 15 15 0,752
12690
0
108
Description of the numerical solver developed in
OpenFOAM
Introduction
In the following text we will give a complete description of the per-programed
OpenFOAM solver ChtMultiRegionSimpleFOAM, analyzing its capability to solve
problems concerning the coupling between hydraulics and conjugated heat transfer. We
intend to present in a way as complete as possible the main facts concerning this codes
in order to be able to analyze future problems in our calculations if they exist. The main
objectives for the report are the following:
1. Interpret the algorithm and the classes used in the solver
2. Interpret and analyze the main physical assumptions made in the solution process of
the solver
3. Evaluate the method of solution in multiple pre-selected benchmark cases
4. Compare the physics of the solver with ChtMultiRegionFoam
Main structure
The structure tree of the programmed solver can be regarded in chart 8.1.
.
├── chtMultiRegionSimpleFoam.C
├── chtMultiRegionSimpleFoam.dep
├── fluid
│ ├── compressibleContinuityErrors.H
│ ├── compressibleMultiRegionCourantNo.H
109
│ ├── createFluidFields.H
│ ├── createFluidMeshes.H
│ ├── EEqn.H
│ ├── pEqn.H
│ ├── readFluidMultiRegionSIMPLEControls.H
│ ├── setRegionFluidFields.H
│ ├── solveFluid.H
│ └── UEqn.H
├── Make
│ ├── files
│ ├── linux64GccDPOpt
│ └── options
└── solid
├── createSolidFields.H
├── createSolidMeshes.H
├── readSolidMultiRegionSIMPLEControls.H
├── readSolidTimeControls.H
├── setRegionSolidFields.H
├── solidRegionDiffNo.C
├── solidRegionDiffNo.dep
├── solidRegionDiffNo.H
├── solidRegionDiffusionNo.H
└── solveSolid.H
Chart 8.1. Main structure of the solver ChtMultiRegionSimpleFoam
In the solver we can find 3 different solvers. The fluid folder which have the codes
concerning the read of the parameters and solving the equations for the fluid field, the
solid solver which does the same for the solid and the make folder which build the list of
dependencies for compiling the solver.
The main actions concerning the solver are indicated in the master code
chtMultiRegionSimpleFoam.C. Following we propose to analyze the main structure of
this code (see Chart 8.2).
// Including the base libraries
#include "fvCFD.H"
#include "rhoThermo.H"
#include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H"
110
#include "regionProperties.H"
#include "solidThermo.H"
#include "radiationModel.H"
#include "fvIOoptionList.H"
#include "coordinateSystem.H"
#include "fixedFluxPressureFvPatchScalarField.H"
// Main part of the code
int main(int argc, char *argv[])
{
// Including the main libraries for setting up the case in each region
#include "setRootCase.H"
#include "createTime.H"
regionProperties rp(runTime);
#include "createFluidMeshes.H"
#include "createSolidMeshes.H"
#include "createFluidFields.H"
#include "createSolidFields.H"
#include "initContinuityErrs.H"
// Solving loop
while (runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
111
// Solving for the fluid region
forAll(fluidRegions, i)
{
Info<< "nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionSIMPLEControls.H"
#include "solveFluid.H"
}
// Solving for the solid region
forAll(solidRegions, i)
{
Info<< "nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionSIMPLEControls.H"
#include "solveSolid.H"
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "Endn" << endl;
112
return 0;
}
// ************************************************************************* //
Chart 8.2. Main structure of the coupled solver structure of the solver.
First we set up the basic builded-in libraries for using the CFD tools provided by
OpenFOAM and its the builded-in thermophysical, radiation and turbulence models. This
libraries will be analyzed in depth in the following. Then in the main part of the code, we
set up the geometry of each solid and fluid region and the fields inside each one.
Following, we solve during the runtime for each fluid and solid region in an independent
fashion for each of them. Please notice that, the order of solution of each region is first
all the fluid regions as listed in the fluidRegions Dictionary and then all the soidRegion as
listed in the solidRegion Dictionary. As in this case we solve a stationary case, the order
of the listed regions shouldn't affect the final result. We finally, terminate the main part of
the code.
Solving the fluid field
Theory
We proceed to analyze following the method of solution for the fluid regions. The
equations describing the behavior of the field are the conservation of mass, momentum
and energy (1). These read, for a given volume control, as:
113
(1)
The common notation have been used for the density, velocity and internal
energy respectively. The closing equations for this system consist in the modelization of
the internal energy of the fluid, the stress tensor field and the superficial and volumetric
heat sources.
Assuming and isotropic fluid with homogeneous properties in all the field, we can
define a temperature dependent specific pressure heat Cp(T), which relates the internal
energy of the fluid to its temperature as:
(2)
In a general form the stress tensor may be divided in its component due to an
external and hydrostatic pressure plus the component of pressure arriving as a direct
consequence of the behavior of the fluid:
(3)
Assuming the Stokes hypotheses for the and defining the deformation stress
tensor as we can relate the shear stresses appearing in the fluid to
the rate of deformation of this one as:
(4)
For the superficial heat flux at the surface of a control volume -q-, we can use the
hypothesis that this one arrive because of molecular diffusion. As we have assumed an
isotropic homogeneous medium, we can define a temperature dependent heat
114
conduction coefficient as k(T). We can therefore use Fourier hypothesis to relate the
heat flux at the surface of a control volume to the gradient of temperature as:
(5)
Finally, the volumetric heat source may arrive as a product of the budget of
radiation for a given cell in the control volume. As the radiation field implies a different
type of transport that the field considered so far, this one must be solved in a separate
form. The models included for the radiarion transport in the system will be discussed
later on.
Implementation in the code
For solving the continuity and the momentum equations, in the code we use the
SIMPLE Algorithm (Semi Implicit Method for Pressure Linked Equations). This algorithm
is used for solving the stationary equations for an incompressible fluid field, where the
continuity equation is imposed as a constrain in the solution of the pressure field.
The equations to be solved in the stationary case for the fluid are read as:
(6)
Here an approximation is included in the last term of the second equation.
Assuming that the density variations are not very big spatially we may approximate the
115
density of a point in space as . Please note that this approximation
introduces a second error space approximation in the density. However as the density
will be actualized in every time step this one is compensated during calculation.
We finally obtained mixing the first and last term in the RHS of the second
equation the following term .
Defining
The second equation may be discretized using the finite volume method in the
following matrix equation:
(7)
Where u** is first prediction of the velocity. This system of equations may be
easily solved for u at step n+1 by inverting matrix C, but usually an iterative procedure is
preferred for solving these systems of equations. However, in a general form we can
state that:
(8)
For imposed the restriction of continuity in the fluid, we follow the pressure
implicit method proposed by the SIMPLE algorithm. We first split the matrix C in its
diagonal A and it off diagonal H* (C = A+H*). Once we now the predicted velocity
(Equation 8) we can state the following equation for the velocity at the next step:
(9)
The problem of this equation is that the next predicted pressure -p*- is yet
unknown. Naming which is known from the previous predictor velocity
step, we get the following equation for the next predicted velocity
(10)
116
By imposing the continuity equation for the velocity - -, we get a
Poisson equation that allow us to solve the actualized pressure field. This one reads as:
(11)
We then iterate between equations 10 and 11 until the fields are converged. The
definition of the convergence criteria is founded un the fvSolution in the system folder.
It is important to notice that in this solver the temperature field is solved
independently of the velocity and the pressure field. This means that we will first solve
the velocity and pressure field for a fixed temperature field, then we will correct the
temperature field for the calculated velocity and pressure and finally update the physical
properties of the fluid for the new temperature field, closing an iteration loop. This not
fully coupled nature of the solution, works fine for time stable problems, but may lead to
mistaken results in time evolutive problems. This may motivate us to develop a new fully
couple solver for future studies.
Solving the fluid region implementation in the code
Main routine
As the main routine of ChtMultiRegionSimpleFoam shows, the solution for each
particular fluid region is done in the following fashion.
/ Solving for the fluid region
#include "createFluidMeshes.H" //read the fluid mesh
#include "createFluidFields.H" //create the geometricFields
#include "initContinuityErrs.H" //Reset the continuity errors in the code
forAll(fluidRegions, i)
{
Info<< "nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H" //read the actual fields and bc in each
117
specific Region
#include "readFluidMultiRegionSIMPLEControls.H" //Reads the fvOtions
dictionary for the SIMPLE control setup
#include "solveFluid.H" //Solve the coupled equations for the fluid field
}
We first actualize the fluid mesh, we then create the fluid fields and we initialize
the continuity error counter for all fluid regions. We then, for each fluid region, set the
fluid regions, we then read the fluid multi-region simple controls and finally we solve the
fluid equations. We will now analyze each routine in depth.
Mesh creation for each region
We start from the creation of the mesh for all fluid regions. The file
createFluidMesh.H reads as the following.
PtrList<fvMesh> fluidRegions(fluidNames.size());
forAll(fluidNames, i)
{
Info<< "Create fluid mesh for region " << fluidNames[i]
<< " for time = " << runTime.timeName() << nl << endl;
fluidRegions.set //This is the set of fluid meshes that will be included
(
i,
new fvMesh
(
IOobject
(
fluidNames[i], //The name of the mesh corresponds to the one of the
region
runTime.timeName(), //The mesh is created for each runTime folder
runTime,
Ioobject::MUST_READ //The mesh is read for every time step, allowing
dynamic meshing
)
)
);
118
}
The function returns a list of finite volume meshes associated to the list of fluid
region names that where given to it as an input. The list of returned meshes is in
correspondence to the standard fvMesh class.
Creating and setting fields for each region
We then set the fields for all the fluids in the domain. The file crateFluidFields.H
reads as following.
// Initialise fluid field pointer lists
PtrList<rhoThermo> thermoFluid(fluidRegions.size()); //The properties of the fluid are
defined in a rhoThermoFluid dictionary
PtrList<volScalarField> rhoFluid(fluidRegions.size()); //The properties of the fluid are
defined in a rhoThermoFluid dictionary
PtrList<volVectorField> Ufluid(fluidRegions.size()); //Initialize the velocities of the
fluid regions
PtrList<surfaceScalarField> phiFluid(fluidRegions.size()); //Initialize the phase for the
fluid regions
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size()); //Activate or
deactivate the gravity for each fluid region
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size()); //Read the
turbulent configuration each fluid region
PtrList<volScalarField> p_rghFluid(fluidRegions.size()); //Read the pressure for each
fluid region
PtrList<volScalarField> ghFluid(fluidRegions.size()); //Determine the hydrostatic term
for each specific fluid in the cell center
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); //Determine the hydrostatic
term for each specific fluid cell face
PtrList<radiation::radiationModel> radiation(fluidRegions.size()); //Load the radiation
properties for each fluid region
List<scalar> initialMassFluid(fluidRegions.size()); //Initial mass for each fluid region
List<label> pRefCellFluid(fluidRegions.size(), 0); //Reference pressure for each cell –
min 0
List<scalar> pRefValueFluid(fluidRegions.size(), 0.0); //Reference pressure for each
region – min 0.o
List<bool> frozenFlowFluid(fluidRegions.size(), false); //Available to freeze specific
fluid regions
PtrList<dimensionedScalar> rhoMax(fluidRegions.size()); //Max density for each fluid
region
PtrList<dimensionedScalar> rhoMin(fluidRegions.size()); //Min density for each fluid
region
119
Here we have included the part of the code in witch the headers of the list for
each geometric field are created. After this one, each specific Field for the geometric
fluid region is created following the specific OpenFOAM format. Some remarks are that
the phi and rho field are created internally by the code. The velocity, pressure,
temperature and turbulent files are read from the current time directory.
Once we have create the fluid regions, then we set for each region the values of
the fields in it. This is done by the the file setRegionFluidFields.H. Note that this is done
individually for every region, looped in the main routine. The code for this routine is
included in the following box.
fvMesh& mesh = fluidRegions[i]; //Read the mesh for each fluid region
rhoThermo& thermo = thermoFluid[i]; //Set the rhoThermo model according to the
thermoFluid option
thermo.validate(args.executable(), "h", "e"); // Select the type of rhoThermo fluid
used
volScalarField& rho = rhoFluid[i]; // set rho as the density of each region
volVectorField& U = Ufluid[i]; // set U as the velocity of each region
surfaceScalarField& phi = phiFluid[i]; // set phi as the volumetric flux of each region
compressible::turbulenceModel& turb = turbulence[i]; // set the turbulent model as
the turbulent model for each region
volScalarField& K = Kfluid[i]; // set K as the turbulent kinetic energy of each region
volScalarField& dpdt = dpdtFluid[i]; // set dpdt as the temporal pressure derivative of
each region
volScalarField& p = thermo.p(); // set p as the pressure of each region
const volScalarField& psi = thermo.psi(); // set psi as the compressibility of each
region
volScalarField& p_rgh = p_rghFluid[i]; // set p_rgh as the dynamic pressure of each
region
const volScalarField& gh = ghFluid[i]; // set gh as the hydrostatic term in the center of
each cell for each fluid region
const surfaceScalarField& ghf = ghfFluid[i]; // set ghf as the hydrostatic term in the
faces of each cell for each fluid region
radiation::radiationModel& rad = radiation[i]; // set rad as the radiation model of each
region
120
fv::IOoptionList& fvOptions = fluidFvOptions[i]; // read the fvOptions for each region
const dimensionedScalar initialMass // determine the initial mass for each fluid
region
(
"initialMass",
dimMass,
initialMassFluid[i]
);
const bool frozenFlow = frozenFlowFluid[i]; // determine if the fluid have been frozen
The characteristics variables of each fluid region, are stored in generic variables
for the solver. This means, the same format is used for characterizing each fluid
simulation
Reading of solution controls
Following, the solution controls are are read for each fluid region. This means,
determining the way in which the Navier Stokes and energy equations are going to be
solved for each region. This is done in the code in the routine
readFluidMultiRegionSIMPLEControls.H. The code is listed in the following box.
const dictionary& simple = fluidRegions[i].solutionDict().subDict("SIMPLE");
const int nNonOrthCorr =
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
In this routine the solver is set as SIMPLE (Semi-Implicit Method for Pressure-
Linked Equations) and the number of non-orthogonal correctors is read in the simple
solver configuration. The basic steps for the simple solver are listed below.
The basic steps in the solution update are as follows -See the introduction for more
information-:
1. Set the boundary conditions.
2. Compute the gradients of velocity and pressure.
121
3. Solve the discretized momentum equation to compute the intermediate velocity
field .
4. Compute the uncorrected mass fluxes at faces .
5. Solve the pressure correction equation to produce cell values of the pressure
correction .
6. Update the pressure field: where urf is the under-
relaxation factor for pressure.
7. Update the boundary pressure corrections .
8. Correct the face mass fluxes:
9. Correct the cell velocities: ; where is the gradient of
the pressure corrections, is the vector of central coefficients for the discretized
linear system representing the velocity equation and Vol is the cell volume.
10.Update density due to pressure changes.
Solving the equations for the fluid
The standard solution that will be used in the solver is indicated in the
solveFluid.H routine. The code of solution of the routine is explained below.
// Pressure-velocity SIMPLE corrector
{
if (frozenFlow)
{
#include "EEqn.H"
}
else
{
p_rgh.storePrevIter();
rho.storePrevIter();
#include "UEqn.H"
#include "EEqn.H"
#include "pEqn.H"
122
turb.correct();
}
}
The structure of the main routine is easy to explain. Is the fluid is frozen, is
treated as a solid and we only solve the energy equation. Is the fluid is un-frozen we
store the previous iteration dynamic pressure and density, we predict the velocity in the
next step, we predict energy and the density in the next step and finally we correct the
fields following the SIMPLE algorithm iterating until the pressure field satisfy the modified
continuity equation -view introduction-.
Following we present the equations solved and the reason for solving each one.
Solving the momentum equation
The average in time momentum conservation equation reads as (2) -note that here
because of the compressibility nature of the medium, we assume .
(
2)
Where is the gravity acceleration vector, is the turbulent stress tensor, and is
the resolved or mean stress tensor due to molecular viscosity and is given by
(
3)
where is the molecular viscosity. Note that we have dropped for know the bar over the velocity,
assuming that all the quantities that we will be working on are averaged in time. Here we have
used the Stokes hypothesis -described in the following chart- which states a linear relationship
between the strain deformation tensor and the stress tensor. Note that in a more general form, for
a fluid the relationship should be stated as , where is the strain
deformation tensor, the residual stress in the fluid at rest and the fourth order tensor
123
which states the linear relationship. Assuming the lack of microscopic surface moments and no
preferred directions in the fluid, the 81 coefficients of reduce to two linearly independent
coefficients the dynamic coefficient of viscosity -shear- and the second coefficient of viscosity
-dilatational-. Stokes hypothesis will simply assume that , which may cease to be valid
if the frequency associated to pressure waves in the fluid is higher than the molecular relaxation
time of it. This may be a problem for gases, but rarely for fluids. View -STOKES’ HYPOTHESIS
FOR A NEWTONIAN, ISOTROPIC FLUID, Mohamed Gad-el-Hak, 1995- for more details.
124
Stokes Hypothesis
Stokes extended Newton's idea from simple 1-D flows (where only one component of
velocity is present) to multidimensional flows. He developed the following relations, collectively
known as Stokes relations, which in cartesian coordinates reads as:
The quantity is called molecular viscosity, and is a function of temperature.
The coefficient was chosen by Stokes so that the sum of the normal stresses are
zero.
Then
125
Introducing the definition of the stress tensor into the Navier Stokes equation and
renaming (as commonly founded in the literature, we get the following expression for
the equation:
The turbulent stress tensor is the well known Reynolds stress tensor -RST-. In RANS
simulations it will be the 'Reynolds Stress Tensor' and in LES simulations it will be the 'Sub-Grid-
Scale Reynolds Stress Tensor' (which form depends upon which method is used in the simulation
and the scale of the sub-grid). The general form of the tensor is defied by the coupling of the
turbulent fluctuations in the form . Therefore in DNS simulations, the RST will be a
product of the simulation and no a pre-modeled input parameter.
We can further split the RST into its isotropic and deviatoric part in the form:
Where K is the turbulent kinetic energy of the fluid, defined as:
where u,v and w are the velocities in the
chosen principal axes.
For developing a closure relationship for the equations a model have to be used
for . There are several proposed models according to the kind of phenomena the
fluid is subjected to, watch -ON EXPLICIT ALGEBRAIC STRESS MODELS FOR
COMPLEX TURBULENT FLOWS, Gatski, Speziale, 1992, NASA-, -ANALYTICAL
METHODS FOR THE DEVELOPMENT OF REYNOLDS STRESS CLOSURES IN
TURBULENCE, Speziale, NASA- and -The determination of turbulence-model statistics
from the velocity–acceleration correlation, Pope, 2014-.
In this case, we will make the assumption of linear turbulent viscosity (RANS) or
linear sub-grid-scale viscosity (LES). This implies that the same assumptions used for
the molecular transport in the Stoke's hypothesis are used for the turbulent transport.
This means that the properties of the turbulence have to be homogeneous all over the
126
fluid domain and that the is not preferred direction for the turbulent transport. This is the
definition of a special case in turbulence known as homogeneous turbulence. Further
more, if we assume also that the dissipation to the Kolmogrov's scale is dissipative
enough so that the information of which large eddy is generating the smaller eddies is
lost during the cascade process, which is generally the case, the turbulence is called
isotropic.
The deviatoric part of the Reynolds stress tensor then may be modeled as:
The final momentum conservation equation then reads as:
where we have defined . Please note that by assuming
homogeneous turbulent, the turbulent diffusion is acting in all directions as molecular
diffusion. Therefore, in this situation, the difference of a quantity transported by
molecular diffusion or by turbulent diffusion is indistinguishable.
There is one further observation that is necessary to make. As observed by
-Freziger-, introducing a source term of momentum directly in the momentum equations
may result in check-board oscillations. For stabilizing the method, OpenFOAM
introduces an option called fvOptions. This option introduces and external source or
constrain in the form of faces fluxes, avoiding check mesh oscillations.
However, we re-chose in this case to change the momentum equation observing
that:
127
Therefore, in this formulation the flux of the magnitude can be computed in the
cell faces and then then interpolated back to the center of the cells for performing the
gradients. Recasting , the final Navier Stokes equations read
as:
Following we present the coding of the momentum 'U' equation in the solver.
// Solve the Momentum equation
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U) //Convection Term
+ turb.divDevRhoReff(U) //Turbulence introduced through an external class taking U as input
==
fvOptions(rho, U) //For introducing an external momentum source or internal constrain
);
Ueqn().relax(); //Include the relaxation factors in the initial discretization of U
fvOptions.constrain(UEqn()); //Include the constrains into the discretized U system
solve
(
UEqn()
==
fvc::reconstruct //reconstruct a volumetric field from discretized face fluxes
(
(
- ghf*fvc::snGrad(rho) //Including the buoyant force in the RHS of the LSE
- fvc::snGrad(p_rgh) //Including the gradient pressure form the RHS of the LSE
)*mesh.magSf()
)
);
fvOptions.correct(U); //apply a correction on a field usually different from the field used to
generate the source
We note than the non-liniear convection term is linearized in the form
where and is computed in the start of the solver a left constant during the
128
iterations made when solving the momentum equation. This linearizion of the convection
term is a common practice in CFD.
The mathematics implicated in the way in which the buoyant and pressure
gradient terms are introduced it is worth expending some time of explanation. The code
introducing the finite volume options in the following:
tmp<GeometricField<GradType, fvPatchField, volMesh> > treconField //treconField is donating
the output
(
new GeometricField<GradType, fvPatchField, volMesh>
(
IOobject
(
"volIntegrate("+ssf.name()+')',
ssf.instance(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
inv(surfaceSum(SfHat*mesh.Sf()))&surfaceSum(SfHat*ssf),
zeroGradientFvPatchField<GradType>::typeName
)
);
In this case the input argument ssf which will be passed is the velocity buoyant
body force and the pressure gradient force. This arguments will be transformed
according to the Weller's tensorial relationship into the following form:
Please note that in this expression is the flux of a quantity over the
boundary of the finite volume cell. In the present case quantity represents the external
volume force introduced by the pressure gradient or by the buoyancy force. Also,
which is the value of this quantities at the center of the cell is performed in a fashion so
that the total volume flux of the quantity through the boundary of the cell is conserved.
In this case, conserving the total force excreted in the cell.
129
Solving the energy equation
In differential form, the conservation of energy equation reads as:
The LHS term is the material derivative of the volumetric energy of the fluid . The first
term in the RHS of the equation corresponds to the work done by the pressure term, the second
to the work done by the stress term and corresponds to the heat fluxes in the faces of the cells
due to molecular diffusion and due to turbulent mixture . Finally S correspond to
an external volumetric heat source to be added into the domain.
The turbulent heat flux comes as a consequence of the non-zero average time coupling
of the fluctuations in energy and in velocity. This one can be written in the form:
The first term in the RHS correspond to the time average of the average energy
transported by the fluctuations of velocity, the second term is the average in time of the
fluctuations in energy transported by the average velocity and the final term correspond to the
convective transport induced by the coupling of fluctuations in energy and velocity.
In this case we chose to split the specific internal energy into specific thermal internal
energy and specific kinetic energy , in the form . Under constant pressure
conditions, for the dilatating liquid, the internal thermal energy can be expressed as the product of
the constant pressure heat capacity and the temperature:
For modeling the heat flux per unit mass due to molecular diffusion, we use Fourier law in
the form:
Where . In a similar form, by assuming the validity of turbulent
Boussinesq assumption and by assuming the universal convection – diffusion gradient
turbulent hypothesis [view Pope, Turbulence, 2004] we can model the turbulent heat flux
in the form:
130
Defining , we get that the effective heat flux can be defined as
.
In our simulations, the Birkman nuber (heat generated by viscous heating over
heat conducted by the fluid) is usually very small, therefore is a common practice to
neglect viscous heating in the fluid [Ferziger, Computational Fluid Dynamics, 2008].
Taking this into consideration, the final energy conservation equation will read as:
Defining the enthalpy as and taking into account the
incompressibility of the fluid, the above equation can be recasted into enthalpy terms in
the form
The energy equation is programmed in an hybrid format, in which the internal
energy or the enthalpy is modeled depending on the rhoThermoFluid model selected for
the fluid as an input. For example, if a constant enthalpy model is selected for the fluid,
then the energy equation will be solved in enthalpy terms.
The SIMPLE algorithms search for a stationary solution, therefore the derivatives
with respect to time are equal to zero. The following box provides the commented code
for the energy equation.
131
{
volScalarField& he = thermo.he(); // Reading the thermoFluid model
fvScalarMatrix EEqn // Energy Equation
(
fvm::div(phi, he) // Convective term
+ (
he.name() == "e" // Selection between internal energy or enthalpy model
? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) // Internal energy
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) // Enthalpy
)
- fvm::laplacian(turb.alphaEff(), he) // turb.alphaEff calculated externally, reads the velocity
==
rad.Sh(thermo) // Radiation introduced as heat source
+ fvOptions(rho, he) // Including an external source as fvOptions
);
EEqn.relax(); // Relaxation of the energy equation matrix
fvOptions.constrain(EEqn); // Imposition of the constrains in the matrix
Eeqn.solve(); // Solution of the system of equations
fvOptions.correct(he); // Correction of the constrains imposed
thermo.correct(); // Actualization of the physical properties of the fluid
rad.correct(); // Actualization of the radiation sources and medium
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
}
We observe that the relaxation of the system of equations is done intermediately
after the equations are defined. At the final steps the density, heat capacity and radiation
properties of the fluid are updated according to the new internal energy field.
Solving for the continuity equations
As mention in the introduction the continuity equation is included into the fluid as
a laplacian equation for the pressure field. The equation for the pressure field read as:
A rigorous demonstration of the SIMPLE corrector was given in the introduction.
Here we will just limit the explanation to understand the steps implemented in the code
132
which are in accordance to the previously explained. For doing this we provide the
comments while describing the code in the following box.
{
rho = thermo.rho(); // Relaxation of the energy equation matrix
rho = max(rho, rhoMin[i]); // Setting as rhoMin the values of rho below rhoMin
rho = min(rho, rhoMax[i]); // Setting as rhoMax the values of rho above rhoMax
rho.relax(); // Computing the density according to the relaxation parameters
volScalarField rAU("rAU", 1.0/Ueqn().A()); //
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); //
volVectorField HbyA("HbyA", U); //
HbyA = rAU*UEqn().H(); //
Ueqn.clear(); // Clearing the results of UEqn
surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); //
surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(rho*HbyA) & mesh.Sf()) //
);
fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); // Perform the density in the surfaces
for introducing later constrains
bool closedVolume = adjustPhi(phiHbyA, U, p_rgh); // Boolean option with adjust the mass
fluxes at the fixed Pressure boundaries for conserving the mass of the system
phiHbyA += phig; //
// Update the fixedFluxPressure BCs to ensure flux consistency
setSnGrad<fixedFluxPressureFvPatchScalarField>
(
133
p_rgh.boundaryField(), // Adjusting the pressure in the fixed flux boundary fields
(
phiHbyA.boundaryField()
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
*rho.boundaryField()
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) //
);
dimensionedScalar compressibility = fvc::domainIntegrate(psi); // Define the compressibility
as the integral over the domain of the fluid, in case it is not constant
bool compressible = (compressibility.value() > SMALL); //Determine if the compressibility
value is bigger than small for trating the fluid as compressible
// Solve pressure
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA) //
);
p_rghEqn.setReference //Set a reference pressure for not getting a singular system
(
pRefCell, // If it is not compressible, the reference pressure is read
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue // If compressible, the
reference pressure is defined internally as the calculated pressure of the cell and in the
boundaries as the reference pressure
);
p_rghEqn.solve(); // Solve the system of equations
if (nonOrth == nNonOrthCorr) // For the last step of the corrector
{
134
// Calculate the conservative fluxes
phi = phiHbyA – p_rghEqn.flux(); //
// Explicitly relax pressure for momentum corrector
p_rgh.relax(); // Introduce the relaxation factors in the pressure for the next step in the
corrector
// Compute the velocity
U = HbyA + rAU*fvc::reconstruct((phig – p_rghEqn.flux())/rhorAUf); //
U.correctBoundaryConditions(); // Actualize the boundary conditions for the velocity
fvOptions.correct(U); // Actualize the constrains for the velocity field
}
}
p = p_rgh + rho*gh; / /Calculate the final pressure
#include "continuityErrs.H" / /Compute the continuity errors
// For closed-volume and compressible cases adjust the pressure level to obey overall mass
continuity
if (closedVolume && compressible)
{
p += (initialMass - fvc::domainIntegrate(thermo.rho()))
/compressibility; // Perform the correction in the pressure for conserving the mass
p_rgh = p – rho*gh; // Performing p_rgh
}
// Checking the new limits of the density after the overall pressure correction
rho = thermo.rho();
rho = max(rho, rhoMin[i]);
135
rho = min(rho, rhoMax[i]);
rho.relax();
Info<< "Min/max rho:" << min(rho).value() << ' '
<< max(rho).value() << endl;
}
The main structure of the corrector process begins by computing the quantities to
be needed for solving the Poisson equation for pressure. Then it correct the mass flux in
the fixed pressure boundaries and the pressure in the fixed flux boundaries to the
actualize parameter.
After this, the solution process begin. First for every non-orthogonal corrector
step, the coefficients of the equation are redefined to the actualize values of density at
the cell faces and the actualize values of pressure at the boundary cell faces. Then we
set the reference pressure for the solution of the system (this will impose a Dirichlet
condition in at least 1 cell for the LSE to be determined). Following we proceed to the
solution of the system of equations. Here the properties of the solution class are inherit
by the equation, being this properties defined in the fvSolution dictionary for each fluid
region.
In case we arrive to the final steps of the non-orthogonal correction process, we
compute the volumetric fluxes at the cell boundaries and the velocity as stated by the
SIMPLE algorithm.
Finally, in case the fluid is compressible, we correct manually the overall pressure
of the system to maintain the overall mass of it. This is done by adding or subtracting to
each cell the amount of necessary pressure for keeping the total mass of the system
constant. Following the dynamic pressure is computed from the corrected pressure
value for each cell and the density of each cell is re-performed and checked to be within
the specified limits.
136
Solving the solid region
Main routine
As the main routine of ChtMultiRegionSimpleFoam shows, the solution for each
particular solid region is done in the following fashion.
//Create the solid mesh and the solid fields
#include "createSolidMeshes.H"
#include "createSolidFields.H"
//Solving according to the controlDict
while (runTime.loop())
{
...
//Solving for every solid region
forAll(solidRegions, i)
{
Info<< "nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionSIMPLEControls.H"
#include "solveSolid.H"
}
...
}
First we first actualize the solid mesh, then we create the solid fields and we
initialize the continuity error counter for all solid regions. We then, for each solid region,
set the values of the fields in the solid region, we then read the solid multi-region simple
controls and finally we solve the solid equations. We will now analyze each routine in
depth.
137
Mesh creation for each region
We start from the creation of the mesh for all solid regions. The file
createsolidMesh.H reads as the following.
PtrList<fvMesh> solidRegions(solidNames.size());
forAll(solidNames, i)
{
Info<< "Create solid mesh for region " << solidNames[i]
<< " for time = " << runTime.timeName() << nl << endl;
solidRegions.set //This is the set of solid meshes that will be included
(
i,
new fvMesh
(
IOobject
(
solidNames[i], //The name of the mesh corresponds to the one of the region
runTime.timeName(), //The mesh is created for each runTime folder
runTime,
Ioobject::MUST_READ //The mesh is read for every time step, allowing dynamic
meshing
)
)
);
}
The function returns a list of finite volume meshes associated to the list of solid
region names that where given to it as an input. The list of returned meshes is in
correspondence to the standard fvMesh class. Each solid mesh is treated independently
as defined by the definition of the solid regions.
138
Creating and setting fields for each region
We then set the fields for all the solids in the domain. The file cratesolidFields.H
reads as following.
// Initialise solid field pointer lists
PtrList<coordinateSystem> coordinates(solidRegions.size()); //Define Basic coordinate
system for solving in each
PtrList<solidThermo> thermos(solidRegions.size()); //The properties of the solid are defined in
a themroPhysicalProperties dictionary
PtrList<radiation::radiationModel> radiations(solidRegions.size()); //Class containing the
radiation models for each solid region
PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size()); //Class containing the heat
sources presented in the fluid, they are read from the fvOptions dictionary
PtrList<volScalarField> betavSolid(solidRegions.size()); // Correction factor for rapid difussion
of heat in the solid region
PtrList<volSymmTensorField> aniAlphas(solidRegions.size()); //Class containing the
definitions of the alphas for each solid region: alpha=kappa/Cp
Here we have included the part of the code in witch the headers of the list for
each geometric field are created. After this one, each specific Field for the geometric
solid region is created following the specific OpenFOAM format. The alpha field is
created by the code and the temperature, and radiation properties for the solid are read
from the current time directory.
Once we have create the solid regions, then we set for each region the values of
the fields in it. This is done by the the file setRegionsolidFields.H. Note that this is done
individually for every region, looped in the main routine. The code for this routine is
included in the following box.
fvMesh& mesh = solidRegions[i]; //Setting the mesh
solidThermo& thermo = thermos[i]; //Setting the thermophysical properties directory
const radiation::radiationModel& radiation = radiations[i]; //Setting the radiation model
directory
139
tmp<volScalarField> trho = thermo.rho(); //Setting trho as the read density
const volScalarField& rho = trho(); //Setting rho as the read density
tmp<volScalarField> tcp = thermo.Cp(); //Setting tcp as the read specific heat
const volScalarField& cp = tcp(); //Setting cp as the read specific heat
tmp<volSymmTensorField> taniAlpha; //Setting tanialpha for the case the solid is not
isotropic, previously it was defined for the isotropic case when creating the flieds
if (!thermo.isotropic())
{
volSymmTensorField& aniAlpha = aniAlphas[i]; //Anysotropic field
tmp<volVectorField> tkappaByCp = thermo.Kappa()/cp; //aniAlpha = Kappa/Cp
const coordinateSystem& coodSys = coordinates[i]; //Setting the local coordinate system
for the tensor
aniAlpha.internalField() =
coodSys.R().transformVector(tkappaByCp());
aniAlpha.correctBoundaryConditions(); //Setting the tenor in the direction of the local
coordinates system
taniAlpha = tmp<volSymmTensorField>
(
new volSymmTensorField(aniAlpha) //Setting anialpha from tanialpha
);
}
volScalarField& h = thermo.he(); //Setting the enthalpy of the solid
const volScalarField& betav = betavSolid[i]; //Setting the beta field of the solid
fv::IOoptionList& fvOptions = solidHeatSources[i]; //Setting the fvOption list
The characteristics variables of each solid region, are stored in generic variables
for the solver. This means, the same format is used for characterizing each solid
140
simulation. This brings the possibility of programing a generic solver for the solids
regions.
Reading of solution controls
Following, the solution controls are are read for each solid region. This means,
determining the way in which the Navier Stokes and energy equations are going to be
solved for each region. This is done in the code in the routine
readsolidMultiRegionSIMPLEControls.H. The code is listed in the following box.
const dictionary& simple = solidRegions[i].solutionDict().subDict("SIMPLE");
const int nNonOrthCorr =
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
In this routine the solver is set as SIMPLE and the number of non-orthogonal
correctors is read in the simple solver configuration. For solving in a solid domain, the
methodology simply consist in solving the heat diffusion equation, performing the
correction of the fluxes in the cell face and iterating.
Solving the equations for the solid
For the solid domain it will be solved the equation of conservation of energy. In
differential form, the conservation of energy equation for a solid reads as:
First of all, note that for the solid the enthalpy and the internal energy attain the
same value, as we consider it to be not expansible. The LHS term is the rate of change
of the internal energy in the solid . The first term in the RHS corresponds to the
heat flux in the faces of the cells due to molecular diffusion. Finally S correspond to an
external volumetric heat source to be added into the domain.
141
For modeling the heat flux per unit mass due to molecular diffusion, we use
Fourier 'slaw. In case the solid medium is isotropic, its conductivity is the same in all
directions and Fourier's law can be written as:
Where .
In case the solid is anisotropic, a specific variant coordinate system can be
defined for the solid region in which the conductivity properties of the solid are
measured in each direction. In this case, alpha can be defined as a second order tensor
relating the heat flux and and the enthalpy gradients. The relation reads as following:
Where . With the exception of very particular cases, the tensor is
usually symetric [Incropera].
Taking this aspects into consideration, the final equation of conservation of
energy for the in a general form reads as:
The alpha tensor reduce to a constant diagonal one in case the solid is isotropic.
In this case, for the solution by the solid SIMPLE algorithm, we will search the
stationary temperature field in the solid. Therefore, the derivatives with respect to time
are set equal to zero.
142
The standard solution that will be used in the solver is indicated in the
solvesolid.H routine. The code of solution of the routine is explained below.
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) //Iterating in the number of
non-othogonal correctors
{
fvScalarMatrix hEqn //Definition of the conservation of energy equation
(
(
thermo.isotropic() //Solving the diffusion laplacian term of temperature
? -fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") //isotropic
case
: -fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)") //anisotropic case
)
==
fvOptions(rho, h) //Including of external heat sources and constrains
);
hEqn.relax(); //Introducing the relaxation factors in the matrix
fvOptions.constrain(hEqn); //Adding the constrains to the system of equations
hEqn.solve(); //Solving the equation according to the parameters in fvSolution for
each solid region directory
fvOptions.correct(h); // Introducing the corrections due to the constrains
}
}
thermo.correct(); //Actualizing the thermophysical properties
143
The structure of the main routine is easy to explain. First, we define the
coefficients of the LSE for every non orthogonal corrector time step. Then, we introduce
the relaxation factors in the discretization matrix and we solve the LSE. We then iterate
as the number of non-orthogonal correctors we have indicated.
(We are missing the radiation modifications and the
turbulent models implemented).
144
References
[1] O. Beneš and R.J.M. Konings, 4 - Thermodynamic Calculations of Molten-
Salt Reactor Fuel Systems, In Molten Salts Chemistry, edited by Frédéric
LantelmeHenri Groult, Elsevier, Oxford, 2013, Pages 49-78, ISBN
9780123985385
[2] M. Salanne, C. Simon, P. Turq, N. Ohtori and P.A. Madden, 1 - Modeling of
Molten Salts, In Molten Salts Chemistry, edited by Frédéric LantelmeHenri
Groult, Elsevier, Oxford, 2013, Pages 1-16, ISBN 9780123985385
[3] Rollet, A.-L., Bessada, C., Auger, Y., Melin, P., Gailhanou, M., Thiaudie`re,
D. (2004). A new cell for high temperature EXAFS measurements in molten
rare earth fluorides. Nucl. Instrum. Methods Phys. Res. B, 226, 447–452.
[4] Bessada, C., Rakhmatullin, A., Rollet, A.-L., Zanghi, D. (2007). Lanthanide
and actinide speciation in molten fluorides: a structural approach by NMR and
EXAFS spectroscopies. J. Nucl. Mater., 360, 43–48.
[5] Rollet, A.-L., Sarou-Kanian, V., Bessada, C. (2009). Measuring self-diffusion
coefficients up to 1500 K: a powerful tool to investigate the dynamics and the
local structure of inorganic melts. Inorg. Chem., 48, 10972–10975.
[6] Benes, O., Zeller, P., Salanne, M., Konings, R.J.M. (2009). Density functional
theory, molecular dynamics, and differential scanning calorimetry study of
the RbF-CsF phase diagram. J. Chem. Phys., 130, 134716.
[7] Benes, O., Konings, R.J.M. (2009). Thermodynamic properties and phase
diagrams of fluoride salts for nuclear applications. J. Fluorine Chem., 130, 22–
29.
[8] Robelin, C., Chartrand, P. (2013). Thermodynamic evaluation and
optimization of the (NaF þ AlF3 þ CaF2 þ BeF2 þ Al2O3 þ BeO) system. J.
Chem. Thermodyn., 57, 387–403.
[9] El Ghallali, H., Groult, H., Barhoun, A., Draoui, K., Krulic, D., Lantelme, F.
(2009). Electrochemical synthesis of Ni-Sn alloys in molten LiCl-KCl.
Electrochim. Acta, 54, 3152–3160.
[10] Taxil, P., Massot, L., Nourry, C., Gibilaro, M., Chamelot, P., Cassayre, L.
(2009). Lanthanides extraction processes in molten fluoride media:
145
application to nuclear spent fuel reprocessing. J. Fluorine Chem., 130, 94–101.
[11] http://www.openfoam.com/
[12] Maaike van der Tempel, A chtMultiRegionSimpleFoam Tutorial, Chalmers
University of Technology, 2012
[13] Chapter 5 / Forced Convection: Internal Flows /Adrian BEJAN / Department of
Mechanical Engineering and Materials Science, Duke University, Durham, Nort Carolina
[14] Turbulence modeling for beginners / Tony SAAD / University of Tennessee Space
Institute
[15] Pressure Drop in Laminar Developing Flow in Noncircular Ducts: A Scaling and
Modeling Approach / Y.S Muzychka, M.M Yovanovich / Journals of Fluids Engineering,
November 2009
[16] Forced Turbulent Heat Convection in a Rectangular Duct with Non-Uniform Wall
Temperature/ G.A Rivas, E.C Garcia and M. Assato/ INTECH 2012
[17] Heat Transfer and Friction in Turbulent Pipe Flow with Variable Physical Properties /
B.S Petukhov/ High Temperature Institute, Academy of Science of the
USSR,Moscov,USSR
[18] Conjugate heat transfer study of backward-facing step flow –A benchmark
problem /P. Rajesh Kanna, Manab Kumar Das/ International Journal of Heat and Mass
Transfer/ 2006.
146

Final_Report_Tano_Retamales

  • 1.
    Comparison between OpenFOAM,ANSYS and Experimental Data for Benchmarking by Mauricio Tano Retamales Nuclear Engineer, Instituto Balseiro, 2014 Report Submitted in Partial Fulfillment of the Academic Internship Sponsored by Phelma, Grenoble INP and Laboratoire de Physique Subatomic et Cosmologie, Grenoble in the Laboratoire de Physique Subatomic et Cosmologie, Grenoble The rights of this work are reserved to LPSC Laboratory, Grenoble, France. However this work may be reproduced without authorization under the conditions of 'Fair Dealing'. Therefore, limited reproduction of this work with the purpose of private studies, research, criticism and review is likely to be in accordance with law if properly cited. i
  • 2.
  • 3.
    Revision Name: Mauricio TanoRetamales Frame: Report of the Academic Internship done in the LPSC Laboratory under an agreement with Phelma, Grenoble INP. Title: Comparison between OpenFOAM, ANSYS and Experimental Data for Benchmarking Pablo Rubiolo Senior Supervisor Professor Grenoble INP Date Defended/Approved: ii
  • 4.
    Ethics Statement 3 I declarethat the word done in this report is of my authorship and have been done following the guidelines of: 1. Honesty and general care and precision in activities (research, recording, presentation and evaluation) 2. Ethically solid information retrieval, research and evaluation methods and transparency in publication. 3. Taking proper notice of other researchers work and achievements 4. The research plan, realization and reporting must be done following the set requirements. 5. The position, rights, participation in the work and responsibilities and duties of each member of the research group must be clearly defined. Also, before research begins, it must be agreed in writing between the research group and the research subjects about the ownership of the research results and the storing of materials. 6. Honest reporting of finances and commitments 7. Good planning practices and personnel and economic planning Mauricio Tano Retamales Grenoble 2015 iii
  • 5.
    Abstract As a partof the SWAT project currently being carried in LPSC Laboratory at Grenoble a development of a multi-physical numerical simulation tool for programing the experiences is necessary. This tool will then be validated against experience and used to simulate a Molten Salt Fast Reactor in the frame of the SAMOFAR project. The numerical tool is being developed in OpenFOAM. The following report describes the comparison done with benchmark purposes between the OpenFOAM developed tool, ANSYS Fluent and Experimental Data for the hydraulics simulation in simple study cases. Keywords: OpenFOAM, Multi-physics, Benchmark, MSFR, Molten Salts. iv
  • 6.
    Table of Contents Introduction1 SQUARE CHANNEL 2D HYDRAULICS – OpenFOAM.................................................. Description of the simulation............................................................................................ Steps for the implementation in OpenFOAM.................................................................... Description for the laminar simulations.................................................................... Description for the turbulent k-epsilon simulations................................................... Results obtained for the plane Channel 2D.................................................................... Test 0: Velocity profiles.......................................................................................... Laminar Test 1: Friction factor and development length, variating the number of elements.................................................................................. Laminar Test 2: Friction factor and development length, variating the aspect ratio of the cells........................................................................................ Turbulent Test: Friction factor and development length.......................................... Appendix OpenFOAM. Main parameters of the simulations........................................... SQUARE CHANNEL 2D HYDRAULICS – AnsysFluent.............................................. Description of the simulation.......................................................................................... Steps of implementation in ANSYS................................................................................ Description for the laminar simulations.................................................................. Description for the turbulent k-epsilon simulations................................................. Results obtained for the plane Channel 2D.................................................................... Appendix 1. Guidelines for specification of turbulent boundary and initial conditions.............................................................................................................. Appendix 2. Wall roughness effects............................................................................... Appendix 3. Main parameters of the simulations............................................................ SQUARE CHANNEL 3D HYDRAULICS OpenFOAM................................................... Steps for the implementation in OpenFOAM.................................................................. Description for the laminar simulations.................................................................. Description for the turbulent k-epsilon simulations................................................. Results obtained for the plane Channel 2D.................................................................... Test 0: Velocity profiles.......................................................................................... Laminar Test 1: Friction factor and development length, variating the number of elements.................................................................................. Laminar Test 2: Friction factor and development length, variating the aspect ratio of the cells........................................................................................ Turbulent Test: Friction factor and development length.................................................. Appendix. Main parameters of the simulations............................................................... v
  • 7.
    SQUARE CHANNEL 3DHYDRAULICS ANSYSFluent................................................ Description of the simulation.......................................................................................... Steps of implementation in ANSYS................................................................................ Description for the laminar simulations.................................................................. Description for the turbulent k-epsilon simulations................................................. Results obtained for the plane Channel 2D.................................................................... Appendix 1. Friction factors and entrance length in non-circular channels..................... Appendix 2. Effect of corners...................................................................................... Appendix 3. Main parameters of the simulations............................................................ PIPE 3D HYDRAULICS OpenFOAM............................................................................. Description of the simulation.......................................................................................... Steps for the implementation in OpenFOAM.................................................................. Description for the laminar simulations.................................................................. Description for the turbulent k-epsilon simulations................................................. Results obtained for the plane Channel 2D.................................................................... Test 0: Velocity profiles.......................................................................................... Laminar Test 1: Friction factor and development length, variating the number of elements.................................................................................. Laminar Test 2: Friction factor and development length, variating the aspect ratio of the cells........................................................................................ Turbulent Test: Friction factor and development length.................................................. Appendix. Main parameters of the simulations............................................................... PIPE 3D HYDRAULICS OpenFOAM............................................................................. Description of the simulation.......................................................................................... Steps of implementation in ANSYS................................................................................ Description for the laminar simulations.................................................................. Description for the turbulent k-epsilon simulations................................................. Results obtained for the plane Channel 2D.................................................................. Appendix 1. False diffusion errors................................................................................ Appendix 2. Friction factors and entrance length in a pipe........................................... Chapter 1.Appendix 3. Main parameters of the simulations................................... Description of the numerical solver developed in OpenFOAM.............................. Introduction.................................................................................................................. Main structure.............................................................................................................. Solving the fluid field.................................................................................................... Theory 112 Implementation in the code.................................................................................. Solving the fluid region implementation in the code...................................................... Main routine......................................................................................................... vi
  • 8.
    Mesh creation foreach region............................................................................. Creating and setting fields for each region........................................................... Reading of solution controls................................................................................ Solving the equations for the fluid........................................................................ Solving the momentum equation......................................................................... Stokes Hypothesis.............................................................................................. Solving the energy equation................................................................................ Solving for the continuity equations..................................................................... Solving the solid region................................................................................................ Main routine......................................................................................................... Mesh creation for each region............................................................................. Creating and setting fields for each region........................................................... Reading of solution controls................................................................................ Solving the equations for the solid....................................................................... References 142 vii
  • 9.
    List of Acronyms TermInitial components of the term (examples are below) CFD Computational Fluid Dynamics OpenFOAM Open Field Operation and Management – Open Source Computational Fluid Dynamics Paltform. AR Aspect Ratio FV Finite Volumes viii
  • 10.
    Executive Summary The aimof the following report is to test the tool developed in OpenFOAM against ANSYS Fluent and experimental data for simple simulation cases. This allowed us to determine that the tool generated is keen to reproduce accurate results with respect to ANSYS Fluent and the known experimental data. The cases tested correspond to closed duct geometries, since this kind of geometries are the ones to be tested in the SWAT project. In this case, it was determine that the determination of the entrance length by numerical simulations is a parameter that is likely to reproduce error sensitive results when evaluated. Therefore, this parameter was taken as a weak global indicator of accuracy of the simulation. The determination of the head loss in the geometries is taken as the main global indicator of accuracy in the numerical solution. The geometries to be tested are proposed to be the flow between two parallel plates (2D Square Channel), the flow in an square channel (3D Square Channel) and a Pipe. An special case was done in ANSYS Fluent for axe-symmetrical simulations of a Pipe. The results obtained for all this cases show a good agreement with experimental an theoretical data. The best results obtained for each case, show less than 1% of error in the head loss when comparing the solution of both ANSYS Fluent and OpenFOAM with the theoretical and experimental data. For future work, thermal studies will be performed in the geometries and once again the results will be compared with theoretical and experimental data. Further more, a backward facing step geometry will be evaluated, in which the impact of boundary layer detachment become more evident. ix
  • 11.
    Introduction Molten salt issalt which is solid at standard temperature and pressure (STP) but enters the liquid phase due to elevated temperature. One of the main interests in fluoride chemistry molten salts in the nuclear field arises from the use of fluoride salts in molten-salt reactors (MSRs). The MSR is one of the six reactor concepts of the Generation IV initiative, an international collaboration to study the next-generation nuclear power reactors. The fuel of the MSR is based on the dissolution of the fissile material(235 U, 233 U, or 239 Pu) in a matrix of a molten salt that must fulfill several requirements with respect to its physical properties, such as low-melting temperature (typically below 823 K), low vapor pressure at operating temperatures (typically in the range 873-1000 K), and thermodynamic stability at high temperatures. These requirements are very well fulfilled by the various systems containing alkali and alkali earth metal fluorides. Currently, there are two main concepts for MSRs. The first one is the actinide burner and it is characterized by a fast neutron spectrum. The aim of such a system, beside energy production, is its use for transmutation of the long-lived isotopes coming from the nuclear waste of current-type reactors. The other concept is a breeder reactor based on the 232 Th/233 U cycle in a moderated (thermal) or nonmoderated (epithermal to fast) configuration. This concept is of interest since it produces more fuel than it consumes. In order to sustain the chain reaction effectively and to keep a positive breeding ratio in the thermal breeder fuel, the neutron loss must be minimal. Therefore, the matrix components must have very low neutron capture cross sections. According to the results of the Molten-Salt Breeder Reactor Experiment from the 1970s, the 7LiF- BeF2 system seems to be an ideal matrix in that case. For the epithermal concepts, the choice of the elements of the matrix is not as restricted. This is due to the facts that the neutron economy in fast reactors is not as sensitive as in case of thermal breeder 1
  • 12.
    reactors and thatthe neutron capture cross section of the heavier alkali metals is relatively low in the fast spectrum. Therefore, compounds like NaF, KF, or RbF can be added to the fuel in order to improve its physical properties, e.g., lowering the melting point. In addition to these “traditional” MSR concepts, the use of molten salts as primary reactor coolant, intermediate coolant, or heat-transfer medium is nowadays considered. For example, the advanced high-temperature reactor uses a molten salt to cool a core of graphite elements containing coated particle fuel. Especially for such in- core applications, the LiF-BeF2 and LiF-NaF-BeF2 systems are considered prime candidates [1]. The properties of the molten salts for this systems are usually study in the microscopic level numerically by molecular dynamics simulation [2] and by experimental treatments [3-10]. However, are the macroscopic properties of salts which are interesting for testing the dynamical behavior of a MSFR. In this case, the microscopic properties will be plagued as input variables in a fluid dynamics model. This then will be contrasted against experience. Being the nature of the continuum model to develop for the salt previously unknown, a dynamic tool is needed which give us the possibility of arranging the methods of simulation and the fluid properties while obtained new and more accurate data during the experiences. Therefore, a new numerical tool have been developed using the open-source platform of OpenFOAM [11]. The base numerical solver utilized in the development is the chtMultiRegionSimpleFoam solver. This solver have already successfully been benchmarked against experimental data. However, as the open-source nature of the software provides no legal guarantee in the results obtained and the modifications made for multi-physical process may affect the accuracy of the solution, it is important to be able to determine the validity of the results obtained. For this reasons and considering that the experimental setup for validating the code allows to produce cosed loop experiences (SWAT Project, LPSC, Grenoble), 2
  • 13.
    simple geometries havebeen chosen for validating the tool. The geometries to be tested are proposed to be the flow between two parallel plates (2D Square Channel), the flow in an square channel (3D Square Channel) and a Pipe. For all this cases, the results obtained by the OpenFOAM numerical tool developed will be compared with the results obtained by the legal license protected ANSYS Fluent and the experimental data available for the case. The following picture -Figure 1.1-, show schematically the procedures to be taken during the benchmark study. Figure 1.1. Procedures for benchmarking the simulation tool developed in OpenFOAM. In the following report, the first chapter describes the numerical solver currently been used for multi-physical CFD simulation as developed in OpenFOAM. Next, the following chapters compare the solutions obtained for the geometries considered. In all these chapters the processing and evaluation of experimental data is reported in the Appendices. 3
  • 14.
    SQUARE CHANNEL 2DHYDRAULICS – OpenFOAM Description of the simulation The geometry consist in a square channel. The Reynolds numbers will be fixed in 100, 500 and 1000 for the laminar case and 40000 and 500000 for the turbulent cases. The following Table 21 summarizes the physical parameters used for the resolution of the channel flow. Parameter Unit Value Height m 0.05 Length m 8 Table 2.1. Geometric simulation parameters We consider the transversal direction to not have influence on the development of the flow, therefor the flow is 2D. The boundary conditions that need to be specified include inlet, outlet and wall, as will be described details later. Uniform flow was specified at inlet, the flow will reach the fully developed regions after a certain distance downstream. No-slip boundary condition will be used on the wall and constant pressure for outlet. Symmetric boundary condition will be applied on the pipe axis. Uniform grids will be used for the laminar flow whereas non-uniform grid will be used for the turbulent flow. Experimental, analytical results and simulation results will be compared. Additionally, detailed verification and validation studies will be conducted. The following table show the main mesh parameters utilized for the simulations. Grid/ Mesh Ty pe Number of divisions AR # Cells X Y 8 Uniform 453 45 0,201333 20385 7 319 32 0,199375 10208 6 226 23 0,196521 5198 5 180 20 0,18 3600 4 113 11 0,205454 1243 4
  • 15.
    3 80 80,2 640 2 56 6 0,186666 336 0 28 3 0,186666 84 T Non- Uniform 564 15 0,752 8460 Table 2.2 provides information about the simulations that are going to be made during the current study. For the laminar case we propose in first instance 8 different meshes which orthogonal elements maintaining an aspect ratio close to 0,2. In this case what we will evaluate is the effect of the size of the discretization in the element in the final solution maintaining the rest of the variables constant. Once the test have been performed, for the amount of elements presented in mesh 8, we will maintain approximately constant the size of the elements, but variate the aspect ratio of the orthogonal elements. This is done for evaluating in an independent form the influence of the aspect ratio in the solution and not other factors. The different discretization used, named from a to g are provided in table 2.3. Table 2.3. Provides information about the different aspect ratios that are going to be used during the study. In all this laminar cases the mesh is choose to be uniform. This is for homogenizing the influence of the artificial diffusion errors and evaluating our response base only on the parameters which influence we want to determine. For the turbulent case, the k-Epsilon model will be used. The grid is non uiform refined towards the wall and the inlet and outlet to gain precision in the results. With this 5 Grid/Mesh Type Number of divisions AR # Cells X Y a Uniform 453 45 0,2013333333 20385 b 320 64 0,1 20480 c 250 82 0,0609756098 20500 d 100 204 0,0098039216 20400 e 600 34 0,3529411765 20400 f 800 25 0,64 20000 g 1200 17 1,4117647059 20400
  • 16.
    discretization we getfor the first cell for the Re=40000 case and for the Re=500000 case. Both resolutions lies between the acceptable standards. Table 2.4 provide a summary of the simulation matrix for this case, giving information about the studies that will be conducted and the mesh and model to be used in each case. Simuation Matrix Study Grid Model Friction factor and development length, variating the number of elements 0,2,3,4,5,6, 7,8 Laminar Friction factor and developement length, variating the aspect ratio a,b,c,d,e,f, g Velocity profile, friction factor and development length T Turbulent Table 2.4. Simulation matrix for the 2D plane channel case Steps for the implementation in OpenFOAM Description for the laminar simulations 1. The mesh is generated in ANSYS, exported in <mesh>.msh and ASCII format and finally imported into fluid by the command fluentMeshToFoam. 2. Change the file changeDictionary to set the initial and the boundary conditions. The configuration utilized for the current case are shown in the following box. U { internalField uniform (0.0100480866 0 0); boundaryField { inlet { type fixedValue; value uniform (0.0100480866 0 0); } outlet { type zeroGradient; 6
  • 17.
    } frontAndBackPlanes { type empty; } wall { type fixedValue; valueuniform (0 0 0); } } } p_rgh { internalField uniform 100000; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 100000; } frontAndBackPlanes { type empty; } wall { type zeroGradient; } } } The inlet velocity will be change to fix the Reyolds in the channel. Alternatively, and inletOutlet boundary condition can be used in the pressure outlet. However, this may lead to flux oscillations. 3. Following we set the discretization schemes for the solution of the fluid equations. The utilized schemes are shown in the following box. ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss upwind; div((muEff*dev2(T(grad(U))))) Gauss linear; } 7
  • 18.
    laplacianSchemes { default Gauss linearuncorrected; } interpolationSchemes { default linear; } snGradSchemes { default uncorrected; } fluxRequired { default no; p_rgh; } The discretization schemes utilized for the current case come as an equilibrium between velocity and precision use. In this case, low order schemes are used for obtaining fast results, in consideration that the orthogonal and well behaved meshes will help in the convergence of the solution. 4. Next, the solution methods for the system of equations have to be specified. The following box show the configuration selected for the current case. solvers { p_rgh { solver GAMG; tolerance 1e-6; relTol 0.01; smoother GaussSeidel; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } "(U)" { solver PBiCG; preconditioner DILU; tolerance 1e-6; relTol 0.1; } } SIMPLE { momentumPredictor on; nNonOrthogonalCorrectors 0; 8
  • 19.
    } relaxationFactors { fields { p_rgh 0.7; } equations { U 0.3; } } Inthis case, once again we search for velocity in obtaining the results. For assuring the stability of the method, in the a very stable GAMG solver is choose to solve the Poisson equation for the pressure with a very effective Gauss Seidel pre-multiplication smoother for the solution of the system. In this case, the iterations in the method are carried out until the total residuals are decreased 100 times. However, for the momentum predictor, a very fast PbiCG solver is choose, since its result is just a predictor for determining the velocity profile. The relaxation factors are the commonly used for the pressure and momentum equations in the SIMPLE method. 5. Finally in the controlDict we select as method of solution the chtMultiRegionSimpleFoam, which, in this case, corresponds to the modified solution method shown in the Appendix. Description for the turbulent k-epsilon simulations We will describe only the steps that change in the simulations. 2. Change the file changeDictionary to set the initial and the boundary conditions for k and epsilon. The configuration utilized for the current case are shown in the following box. epsilon { internalField uniform 0.3008826651; //This is just for starting, will be recalculated in the first step boundaryField { inlet { type compressible::turbulentMixingLengthDissipationRateInlet; mixingLength 0.0038; //Definition of the mixing length value uniform 1; //This is just a placeHolder } outlet { type inletOutlet; 9
  • 20.
    inletValue uniform 0.3008826651;//In case of reversed flow value uniform 1; //This is just a placeHolder } frontAndBackPlanes { type empty; } wall { type compressible::epsilonWallFunction; //Adjusting epsilon to the wall function Cmu 0.09; kappa 0.41; E 9.8; value uniform 1; //This is just a placeHolder } } } k { internalField uniform 0.0364498266; //This is just for starting, will be recalculated in the first step boundaryField { inlet { type turbulentIntensityKineticEnergyInlet; intensity 0.0310; //Definition of the fluctuation intensity -!! Considering iso-tropic turbulence- value uniform 1; //This is just a placeHolder } outlet { type inletOutlet; inletValue uniform 0.0364498266; //Inlet value in case of reversed flow value uniform 1; //This is just a placeHolder } frontAndBackPlanes { type empty; } wall { type compressible::kqRWallFunction; //Adjusting k to the wall function value uniform 1; //This is just a placeHolder } } } mut { internalField uniform 0; //This will be calculated based on the solution of the kEpsilon equations boundaryField { inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } frontAndBackPlanes { type empty; 10
  • 21.
    } wall //This isthe only important part { type mutkWallFunction; //We are selecting the inclusion of a wall function -k based- in the model value uniform 0; } } } The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we use standard wall functions for the near-wall treatment. For the turbulent kinetic energy inlet boundary condition, a model of the type turbulentIntensityKineticEnergyInlet is specified. The intensity is calclued in accordance to the releationship in accordance toEntrace Length Re_500(Reference?). For the epsilon model, in the inlet boundary condition we select a model of the type turbulentMixingLenthDisipationRateInlet in which the length scale of the larger eddies of the turbulent field are set as l=0,038∗Dh [See appendix of the Fluent Part for more information]. Finally, for the walls in the turbulent viscosity boundary condition -mut- we select a model of the type mutkWallFuntion, which cast the first cell next to the wall with the value corresponding to the wall function profile. 3. In the discretization schemes for the turbulent equations, we must specify the discretization schemes for the k-epsilon turbulent equations. The discretization proposed in shown in the following box. ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,K) bounded Gauss upwind; div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; div(phi,R) bounded Gauss upwind; div(R) Gauss linear; } laplacianSchemes { default Gauss linear uncorrected; } interpolationSchemes 11
  • 22.
    { default linear; } snGradSchemes { default uncorrected; } fluxRequired { defaultno; p_rgh; } Once again low order methods are used in the discretization schemes for a rapid solution of the system of equations. The very orthogonal and well oriented mesh help once again in the stability of the method, allowing us to use low order schemes. 4. We following specify the the solution schemes for the k and epsilon solvers. This terms come as predictors of the turbulent viscosity and therefore is common practice to use the same discretization schemes as for the velocity field. In the following box we specify the discretization use for the current simulation. "(|k|epsilon)" { solver PBiCG; preconditioner DILU; tolerance 1e-8; relTol 0.1; } 6. Finally in the turbulenceProperties file, we specify the simulation type as RASModel and in the RASProperties file we specify the RASModel as kEpsilon. 12
  • 23.
    Results obtained forthe plane Channel 2D Test 0: Velocity profiles For starting validating the simulations to be made, we first compare the laminar velocity profile with the analytical solution obtained for a velocity profile in the channel. The analytical solution is [Frank White, Fluid Mechanics, 2009]. The results obtained for the comparison between the analytic and the exprimental velocity profiles are shown in graph 2.1- 0,00E+000 2,00E-002 4,00E-002 6,00E-002 0 0 0 0 0 0 0 0 0 Comparision of anlytic vs simulated velocity profile U_OpenFOAM U_analytic y u Graph 2.1. A very good agreement is observed between the OpenFOAM solution and the analytical one. The average error is calculated in 0,18%. Following, another ground taste is to observe the profiles obtained for a turbulent simulation and compare it with the one obtain for a laminar simulation. For doing so we take the y velocity profile for Reynolds numbers of 100 and 40000, with are laminar and turbulent respectively. Dividing the velocity profile of the later one by 400, we obtain the results depicted in Graph 2.2. xiii
  • 24.
    Graph 2.2. Comparisonbetween the laminar and the turbulent profiles simulated by OpenFOAM. The normal expected behavior is observed in which, the turbulent velocity profile rise more rapidly next to the wall and is more plane in the middle because of turbulent mixture. Laminar Test 1: Friction factor and development length, variating the number of elements For the first test we fix the aspect ratio in 0,2 and we variate the number of elements in the mesh. We perform the simulations for the laminar Reynolds numbers of 100, 500 and 2000, for the meshes shown in Table 2. We then compare the non dimensional entrance length and with the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The results obtained are shown in Figure 2.3. xiv
  • 25.
    0 1 23 4 5 6 7 8 9 0,02 0,02 0,02 0,02 0,02 0,02 Entrance Length Re_100 L_plus_OpenFOAM L_plus_theoric Mesh L_plus 0 1 2 3 4 5 6 7 8 9 0,02 0,02 0,02 0,02 Entrace Length Re_500 L_plus_OpenFOAM L_plus_theoric Mesh L_plus xv
  • 26.
    0 1 23 4 5 6 7 8 9 0,02 0,02 0,02 0,02 Entrance Length Reynolds 1000 L_plus_OpenFOAM L_plus_theoric Mesh L_Plus 0 1 2 3 4 5 6 7 8 9 0,21 0,22 0,23 0,24 0,25 Friction factor Re 100 L_plus_OpenFOAM L_plus_theoric Mesh f*Re/100 0 1 2 3 4 5 6 7 8 9 0,2 0,22 0,24 0,26 Friction factor Reynolds 500 L_plus_OpenFOAM L_plus_theoric Mesh f*Re/100 xvi
  • 27.
    0 1 23 4 5 6 7 8 9 0,23 0,23 0,24 0,24 0,25 Friction factor Re 1000 L_plus_OpenFOAM L_plus_theoric Mesh f*Re/100 Figure 2.3. Development length and friction factor for laminar Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant aspect ratio factor variating the number of elements in each mesh. For the development length, for all Reynolds number, acceptable results are obtained for mesh of number of elements larger than mesh 4. In all cases, the error attended are below 3% for mesh 4. It is notable to mention that for meshes 7 and 8 less than 1% of error are obtained for all cases. Considering that mesh 4 is composed of 113 elements in the x direction and 11 elements in the y direction, a maximum area of 3e-4 m² (for an overall aspect ratio of 0,2) is recommended for the element in order to attain acceptable errors in the solutions obtained. In a similar case, is an error of less than 1% in comparison to the theoretical solution wants to be attained in all cases, a maximum area of 4e-5 m² is recommended for the elements for an aspect ratio of 0,2. The errors obtained for the friction factor coefficients are smaller than the ones obtained for the development length. In this case, once again, acceptable results are obtained for meshes denser than mesh 4. The errors obtained for all the laminar cases are below 1,5%. It is again notable to mention that for meshes 7 and 8 less than 0,3% of error is obtained for all cases in the comparison of the friction factor with respect to the theory. This error is quite close to the average error on resolution in the velocity profile, which justifies the use of low order methods in the discretization of the problem. Once xvii
  • 28.
    again, if amaximum element area of 3e-4 m² is used less than 1,5% errors will be obtained and if a maximum area of 4e-5 m² is used the errors will be smaller than 0,3%. Laminar Test 2: Friction factor and development length, variating the aspect ratio of the cells For the test we fix the number of elements in that of mesh 8: 20385. Then, we perform the simulations for the laminar Reynolds numbers of 100, 500 and 2000, variating the aspect ratio of the cells (as shown in Table 3). We then compare the non dimensional entrance length and with the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The results obtained are shown in Figure 2.4. 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 0,02 0,02 0,02 0,02 Entrance length Re 100 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus xviii
  • 29.
    0 0,2 0,40,6 0,8 1 1,2 1,4 1,6 0,02 0,02 0,02 0,02 Entrance Length Re 500 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 0,02 0,02 0,02 0,02 Entrance Length Re 1000 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 0,2 0,22 0,24 0,26 Friction factor Re 100 L_plus_OpenFOAM L_plus_theoric Aspect Ratio f*Re/100 xix
  • 30.
    0 0,2 0,40,6 0,8 1 1,2 1,4 1,6 0,2 0,22 0,24 0,26 Friction Factor Re 500 L_plus_OpenFOAM L_plus_theoric Aspect Ratio f*Re/100 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 0,2 0,22 0,24 0,26 Friction factor Re 1000 L_plus_OpenFOAM L_plus_theoric Aspect Ratio f*Re/100 Figure 2.4. Development length and friction factor for laminar Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant number of elements variating the aspect ratio of them. For the development length, for all Reynolds number, acceptable results are obtained for the plateau laying between the aspect ratio of 0,1 and 1. In all cases, the error attended are below 1% inside this region. This error is coincident with the one obtained for mesh 8 in the previous case. An aspect ratio smaller than this one, will case the perturbations introduced in the y direction to be amplified in the x direction, therefore, obtaining a development of the fluid profile sooner than expected (view ANSYS xx
  • 31.
    Appendix for moredetails). In a similar form, when the discretization in x becomes smaller than the discretization in y, the quite big perturbations generated in the stream- wise direction, influence the form of the velocity profile in the t direction, causing a late development. The errors obtained for the friction factor coefficients are smaller than the ones obtained for the development length. For this case the plateau obtained for attaining an acceptable result in the simulations is larger than in the previous cases. For this case, it is determined between 0,05 and 2 for the value of the aspect ratio. The errors obtained for all the laminar simulations in this region lies below 0,5%. In this case, for determining the friction factor, a bigger plateau is a consequence of a less recuperating influence in perturbations near the wall. Turbulent Test: Friction factor and development length We simulate turbulent flows for Reynolds numbers of 40000 and 500000. The rugosity of the wall is assumed to be zero. For computing the turbulent viscosity a RANS kEpsilon model is utilized. The standard coefficients are used for this model [Reference Facundo]. The results obtained for the non-dimensional entrance length and for the Manning turbulent friction factor are computed against the theoretical predictions [view ANSYS part for theoretical references]. The mesh utilized correspond to the on shown in table 2. The results obtained are presented in table 2.4. Table 2.4. Results obtained for the turbulent simulations using the kEpsilon model. We observe that the results obtained show an acceptable agreement with the theoretical predictions for both the entrance length and the friction factor determination. The errors are observed to decrease their intensity at higher Reynolds since the high intensity turbulence propose stabilize the perturbation influence in a bigger value predicted for the turbulent viscosity. xxi Re L Lplus Error Skin_Factor_Calculated Skin_Factor_Predicted Error 40000 0,794326 0,5616733 1,09% 0,0056200325 0,0055251724 1,72% 500000 1,52 0,57161167 0,95% 0,0032985321 0,0033339865 1,06%
  • 32.
    Appendix OpenFOAM. Mainparameters of the simulations Reynold s Inlet velocity water (m/s) Inlet velocity air (m/s) Turb length scale Turbulence Intensity 100 0,001004809 0,014607347 NA NA 500 0,005024043 0,073036735 NA NA 1000 0,010048087 0,146073469 NA NA 40000 0,401923462 5,842938776 0,0038 4,25% Factor LD 0,021 Laminar 0,57078 Turbulent H 0,05 m Skin_Factor 24 Laminar 0,046 Turbulent Height of the channel m 0,05 Roughness Physical Heigth 1,00E-06 Turbulent Intensity 0,10% k 8,07712E-08 u* 0,000309144 Non-Dimmensional Heigth 2,12E-05 Reference MIN MAX Hydrodynamically smooth 0 2,25 Transitional 2,25 90 Fuly Rough 90 1,00E+07 xxii
  • 33.
    Initial Conditi ons k 0,00043863 epsilon 0,0003972 Grid/Mes h Type Numberof divisions AR # Cells X Y 8 Uniform 453 45 0,201333333 20385 7 319 32 0,199375 10208 6 226 23 0,196521739 5198 5 180 20 0,18 3600 4 113 11 0,205454545 1243 3 80 8 0,2 640 2 56 6 0,186666667 336 0 28 3 0,186666667 84 T Non- Uniform 564 15 0,752 8460 xxiii
  • 34.
    SQUARE CHANNEL 2DHYDRAULICS – AnsysFluent Description of the simulation The geometry consist in a square channel. The Reynolds numbers will be fixed in 100, 500 and 1000 for the laminar case and 100000 for the turbulent case. The following Table 3.1 summarizes the physical parameters. Parameter Unit Value Height m 0.05 Length m 8 Table 3.1. Geometric simulation parameters We consider the transversal direction to not have influence on the development of the flow, therefor the flow is 2D. Boundary conditions need to be specified include inlet, outlet and wall, as will be described details later. Uniform flow was specified at inlet, the flow will reach the fully developed regions after a certain distance downstream. No-slip boundary condition will be used on the wall and constant pressure for outlet. Symmetric boundary condition will be applied on the pipe axis. Uniform grids will be used for the laminar flow whereas non-uniform grid will be used for the turbulent flow. Experimental, analytical results and simulation results will be compared. Additionally, detailed verification and validation study will be conducted. Grid/Mes h Type Number of divisions AR # Cells X Y 8 Uniform 453 45 0,20133333 20385 7 319 32 0,199375 10208 6 226 23 0,19652174 5198 5 180 20 0,18 3600 4 113 11 0,20545455 1243 3 80 8 0,2 640 xxiv
  • 35.
    2 56 60,18666667 336 0 28 3 0,18666667 84 T Non- Uniform 564 15 0,752 8460 Table 3.3 provides information about the simulations that are going to be made during the current study. Simuation Matrix Study Grid Model Friction factor and axial velocity profile 2,3,4, 8 Laminar Friction factor study 6,7 Axial velocity, center-line pressure and centerline velocity T Turbulent Table 3.3. Simulation matrix for the 2D plane channel case Steps of implementation in ANSYS Description for the laminar simulations 1. Select the components to be used in the workbench and make the corresponding connections. 2. Create the geometry. Make the sketch, adjust the dimensions, select make surface out of the sketch, generate all and save. 3. Create the meshes. Select mapped faces and set quadrilaterals elements, size the horizontal edges and the vertical ones by number of divisions and generate the mesh. Do this for the uniform laminar mesh and the non-uniform turbulent mesh. 4. Performing the simulation. 4.a. Set up double precision in a serial processor and lunch Fluent 4.b. Perform a Mesh Check to see the mesh has been generated all-right xxv
  • 36.
    4.c. Check thatin the general settings the Pressure-Based solver, an absolute velocity formulation a Steady time problem and a planar 2D field are chosen 4.d. Select in Models, a viscous laminar model to be implemented 4.e. Add in material water to the material list 4.f. Set in surface body the element type simulation to fluid and select the material to be water 4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in velocity specification method specify “Magnitude, normal to the boundary” and set the velocity to the magnitude corresponding to each specific Reynolds number. Check also that the supersonic or initial Gauge Pressure is set equal to 0. 4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in ANSYS 15) and edit the outlet gauge pressure to 0. 4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the wall motion equation to be an stationary wall with no slip as shear condition. Also change the operating conditions to a value of 97225.9 Pa in pressure. 4.h. Set the reference values following the inlet face values. View the adjoint excel sheet for automatic generation. 4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell based, the pressure to second order and the momentum to second order upwind. 4.j. Leave the solution control as default 4.k. In monitors, edit the residuals for the continuity, x velocity and y-velocity to 1e-6. 4.l. In initialization choose standard initialization, select the reference frame as relative to cell zone and put the gauge-pressure = 0 the x velocity equal to the inlet velocity and the y-velocity =0. 4.m. Initialize the simulation 4.n. In run calculation change the number of iterations to 1000 and lunch the calculation. 5. Analysis of the results xxvi
  • 37.
    5.1 Plot thevelocity in the center line for determining the development length. For post-processinf use the following criteria. Search for the percentage of the maximum velocity that betters agrees with the development length. Eg. If the development length should be 0.021m, search c such that c*Umax determines the velocity value in the position 0.021m. The error is the described by Error=(c−0,99)/c . 5.2. Extract as wall fluxed the skin coefficients at the walls. Determine a length by averaging where a fixed value is get for the factors. See excel sheet. Description for the turbulent k-epsilon simulations We will describe only the steps that change in the simulations. 4. Performing the simulation. 4.d. Select in Models, k-epsilon 2 equations. The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we use standard wall functions for the near-wall treatement. 4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in velocity specification method specify “Magnitude, normal to the boundary” and set the velocity to the magnitude corresponding to each specific Reynolds number. Check also that the supersonic or initial Gauge Pressure is set equal to 0. Specify the turbulence method to intensity and length scale and set intensity in 4.2%, in accordance to I=0,016 ReDh −1 8 - , for ReDh=40000 . Set the length scale for the turbulence as l=0,038∗Dh [See appendix]. 4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in ANSYS 15) and edit the outlet gauge pressure to 400 –not to have absolute pressures lower than 0 in the calculation-. For the turbulence method select k and epsilon and specify both values constant and equal to 1. 4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the wall motion equation to be a stationary wall with no slip as shear condition. Set the roughness height and the roughness constant equal to 0 [See appendix]. 4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell based, the pressure to second order and the momentum to second order upwind. xxvii
  • 38.
    Also set theturbulent kinetic energy solution method to ‘second order upwind’ and the turbulent dissipation rate to ‘second order upwind’. 4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity, k and epsilon to 1e-6. 4.l. In initialization choose standard initialization, select the reference frame as relative to cell zone and put the gauge-pressure = 400 the x velocity equal to the inlet velocity and the y-velocity =0. Also set the initial values of the initial turbulent kinetic energy and the initial energy dissipation rate as calculated in the excel sheet. 4.n. In run calculation change the number of iterations to 1000 and lunch the calculation. 5. Analysis of the results 5.1 Take the entrance length before the first peak in the center line velocity. xxviii
  • 39.
    Results obtained forthe plane Channel 2D Re L Lplus Error Value*Uma x Skin_Factor_Calculated Skin 100 0,21192 1 0,02119 21 1,82% 0,999 0,239676128 500 1,07726 0,02154 52 3,57% 0,9996 0,047954055 1000 2,13687 0,02136 87 2,73% 0,9996 0,023976386 40000 0,79432 6 0,56167 33 1,09% 0,995 0,005620032 xxix
  • 40.
    Appendix 1. Guidelinesfor specification of turbulent boundary and initial conditions In this user tip, we discuss how to calculate and set appropriate turbulence values for inflow boundary conditions (inlets or freestream boundaries). Rather than starting with the turbulence model variables themselves it is often easier to think of turbulence in terms of the more readily known turbulence intensity, turbulent viscosity ratio, and turbulence length scale parameters. With these parameters in hand you can calculate the appropriate boundary values for any RANS turbulence models. About Turbulence Intensity The turbulence intensity, I, is defined as the ratio of the root-mean-square of the velocity fluctuations, u`, to the mean free stream velocity, u. For internal flows the value of turbulence intensity can be fairly high with values ranging from 1% - 10% being appropriate at the inlet. The turbulence intensity at the core of a fully developed duct flow can be estimated as: For external flows the value of turbulent intensity at the freestream can be as low as 0.05% depending on the flow characteristics. You may have a good estimate of the turbulence intensity at the freestream boundary from experimentally measured data. Once you have obtained a reasonable estimate for l you can either use it to calculate the inlet value of turbulence kinetic energy, k, as described below or you can use it as a boundary value directly. All inlet boundary condition types allow you to specify the turbulence kinetic energy at the boundary. About Turbulent Viscosity Ratio The turbulent viscosity ratio is simply the ratio of turbulent to laminar (molecular) viscosity: For internal flows  may be scaled with the Reynolds numbers.� Some guidelines (determined with numerical experiments) for fully developed pipe flows are as follows: Re 3000 5000 10,000 15,000 20,000  11.6 16.5 26.7 34.0 50.1 30
  • 41.
    For a Reynoldsnumber of 100,000 or greater a constant value of  = 100 is a reasonable estimate. For external flows the freestream turbulent viscosity will be on the order of laminar viscosity so small values of are appropriate, say  = 0.1 – 0.2. About Turbulence Length Scale Sometimes it is easier to think in terms of turbulence length scale instead of turbulent viscosity ratio. The turbulence length scale, l, is a physical quantity which represents the size of the large eddies in turbulent flows. Empirical relationship between the physical size of the obstruction (or characteristic length), L, and the size of the eddy, l, can be used to get an approximate length scale. For internal flows you can choose the characteristic length (L) to be inlet duct width or hydraulic diameter (Dh). Guidelines for choosing Hydraulic Diameter Dh or turbulence length scale l. 1. For fully developed internal flows, choose the Hydraulic Diameter specification method and specify the physical size of the hydraulic diameter. 2. For wall-bounded flows in which inlet involve a turbulent boundary layer, choose the Turbulent Intensity and Length Scale specification method and the use the boundary-layer thickness, , to compute the turbulence length scale, l, from l = 0.4() . For external flows, it is often not possible to determine a good characteristic length. In using the formulas below, pick a value of  and a value of u' and use the formulas on the left, the ones not involving the length scale. In the case of external aerodynamic flows, choose smaller values of  (0.1 to 1), whereas in the case of wind- tunnel external flows, choose larger values of  (1 to 10). Calculating Turbulence Boundary Conditions Values All the turbulence models (except Baldwin-Lomax Algebraic Model) require the specification of certain variable values at the boundaries. There are several methods used for turbulence specification at the boundaries available in the codes. For all of the models the user can directly specify the turbulence intensity, turbulence length scale or the hydraulic diameter. But it is important to know how these quantities are related to primary turbulence variables like k, epsilon and omega. In this note we address only the RANS turbulence models (LES turbulence models may be discussed in a future note). For full details of the turbulence models and equations please see the user manuals. For the Standard k-epsilon model and variations (RNG, Kato-Launder, Two Layer) Turbulent Kinetic Energy → Turbulent Dissipation Rate →� or For the Spalart-Allmaras Model Turbulent Kinematic Eddy Viscosity → or For the k-omega and Menter SST Models Specific Dissipation Rate → or NOTE: For external flows it is very important to specify appropriate turbulent quantities at the freestream boundaries. If the values are unphysical it can cause the solution to be unrealistic and can lead to divergence or non-convergence. For internal flows the importance of the values is not as critical because usually there is much 31
  • 42.
    more turbulence generatedinternally in the flow field Appendix 2. Wall roughness effects Fluid flows over rough surfaces are encountered in diverse situations. Examples are, among many others, flows over the surfaces of airplanes, ships, turbomachinery, heat exchangers, and piping systems, and atmospheric boundary layers over terrain of varying roughness. Wall roughness affects drag (resistance) and heat and mass transfer on the walls. If you are modeling a turbulent wall-bounded flow in which the wall roughness effects are considered to be significant, you can include the wall roughness effects through the law- of-the-wall modified for roughness. Law-of-the-Wall Modified for Roughness Experiments in roughened pipes and channels indicate that the mean velocity distribution near rough walls, when plotted in the usual semi-logarithmic scale, has the same slope ( ) but a different intercept (additive constant in the log-law). Thus, the law-of-the-wall for mean velocity modified for roughness has the form where and . Where is a roughness function that quantifies the shift of the intercept due to roughness effects. depends, in general, on the type (uniform sand, rivets, threads, ribs, mesh- wire, etc.) and size of the roughness. There is no universal roughness function valid for all types of roughness. For a sand-grain roughness and similar types of uniform roughness elements, however, has been found to be well-correlated with the nondimensional roughness height, , where is the physical roughness height and . Analyses of experimental data show that the roughness function is not a single function 32
  • 43.
    of , buttakes different forms depending on the value. It has been observed that there are three distinct regimes: 1. hydrodynamically smooth ( ) 2. transitional ( ) 3. fully rough ( ) According to the data, roughness effects are negligible in the hydrodynamically smooth regime, but become increasingly important in the transitional regime, and take full effect in the fully rough regime. In FLUENT, the whole roughness regime is subdivided into the three regimes, and the formulas proposed by Cebeci and Bradshaw based on Nikuradse's data are adopted to compute for each regime. For the hydrodynamically smooth regime ( ): For the transitional regime ( ): where is a roughness constant, and depends on the type of the roughness. In the fully rough regime ( ): In the solver, given the roughness parameters, is evaluated using the corresponding formula. The modified law-of-the-wall in Equation is then used to evaluate the shear stress at the wall and other wall functions for the mean temperature and turbulent quantities. Setting the Roughness Parameters in Fluent The roughness parameters are in the Momentum section of the Wall panel, which is opened from the Boundary Conditions panel. To view the wall roughness parameters, click the Momentum tab. 33
  • 44.
    To model thewall roughness effects, you must specify two roughness parameters: the Roughness Height, , and the Roughness Constant, . The default roughness height ( ) is zero, which corresponds to smooth walls. For the roughness to take effect, you must specify a non-zero value for . For a uniform sand-grain roughness, the height of the sand-grain can simply be taken for . For a non-uniform sand-grain, however, the mean diameter ( ) would be a more meaningful roughness height. For other types of roughness, an "equivalent'' sand-grain roughness height could be used for . The above approaches are only relevant if the height is considered constant per surface. However, if the roughness constant or roughness height is not constant (i.e., flow over a nonuniform surface), then you can specify a boundary profile. Similarly, user-defined functions may be used to define a wall roughness height that is not constant. Choosing a proper roughness constant ( ) is dictated mainly by the type of the given roughness. The default roughness constant ( ) was determined so that, when used with - turbulence models, it reproduces Nikuradse's resistance data for pipes roughened with tightly-packed, uniform sand-grain roughness. You may need to adjust the roughness constant when the roughness you want to model departs much from uniform sand-grain. For instance, there is some experimental evidence that, for non-uniform sand-grains, ribs, and wire-mesh roughness, a higher value ( ) is more appropriate. Unfortunately, a clear guideline for choosing for arbitrary types of roughness is not available. Note that it is not physically meaningful to have a mesh size such that the wall-adjacent cell is smaller than the roughness height. For best results, make sure that the distance from the wall to the centroid of the wall-adjacent cell is greater than . 34
  • 45.
    Appendix 3. Mainparameters of the simulations Reynold s Inlet velocity water (m/s) Inlet velocity air (m/s) Turb length scale Turbulence Intensity 100 0,001004809 0,014607347 NA NA 500 0,005024043 0,073036735 NA NA 1000 0,010048087 0,146073469 NA NA 40000 0,401923462 5,842938776 0,0038 4,25% Factor LD 0,021 Laminar 0,57078 Turbulent H 0,05 m Skin_Factor 24 Laminar 0,046 Turbulent Height of the channel m 0,05 Roughness Physical Heigth 1,00E-06 Turbulent Intensity 0,10% k 8,07712E-08 u* 0,000309144 Non-Dimmensional Heigth 2,12E-05 35
  • 46.
    Reference MIN MAX Hydrodynamicallysmooth 0 2,25 Transitional 2,25 90 Fuly Rough 90 1,00E+07 Initial Conditi ons k 0,00043863 epsilon 0,0003972 36
  • 47.
    SQUARE CHANNEL 3DHYDRAULICS OpenFOAM The geometry consist in a square channel. The Reynolds numbers will be fixed in 100, 500 and 1000 for the laminar case and 40000 and 500000 for the turbulent case. The following Table 4.1 summarizes the physical parameters. Parameter Unit Value Side Length m 0.05 Length m 8 Table 4.1. Geometric simulation parameters In this case both directions perpendicular to the axial direction are assumed to have an appreciable effect in the dynamics of the fluid. For the simulation made, it was chosen to work with a quarter of the square channel, this will in turn optimize the mesh utilized reducing four times the domains. The selection of the laminar mesh is chosen to respect the same cell size and aspect ratio that was previously simulates in the 2D plane channel. However, since in this case both development direction are important, is expected that the dynamics of the development of the boundary layer is changed. This will in turn, implies different results in the development length and friction factor than for the 3D square channel. The presence of the corner, and the known wrong resolution of the kinetic energy and dissipation energy when interacting in corner, make us use a mesh which density is doubled in the 3D channel, with respect of that used in the 2D channel, near the corner. The boundary conditions that need to be specified include inlet, outlet, axis and wall, as will be described details later. Uniform flow was specified at inlet, the flow will reach the fully developed regions after a certain distance downstream. No-slip boundary condition will be used on the wall, constant pressure was used for outlet and axi- symmetrical boundary conditions were used for the axis. Uniform grids will be used for the laminar flow whereas non-uniform grid will be used for the turbulent flow. This is for 37
  • 48.
    making it possibleto study the influence of the aspect ratio in the laminar cases and for gaining accuracy in the simulation of the skin factor in the turbulent cases. A description of the domain and boundary conditions used is shown in Figure 4.1. Figure 4.1. Top: view of the geometry and the boundary conditions, a symmetry condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet condition is in the opposite side on the inlet and is not shown in this picture. Bottom: a picture of the regular, orthogonal, mapped mesh generated for the laminar simulations to be made. Experimental, analytical results and simulation results will be compared. Additionally, detailed verification and validation studies will be conducted. Similar sensibility studies that where conducted for the 2D case will be performed for the current case. In the first case, we choose to keep the aspect ratio of the cell constant while variating the number of elements, the meshes utilized are shown in Table 4.2. For a second case, we select the number of cells in mesh 6 and proportionally variates the discretization parameters to obtain different aspects ratios for the elements. Table 4.3 present the meshes used during the simulation. Please note that the discretization in y and x are variated in a proportional form to induce a similar aspect ratio in the xz and yz planes. For all the laminar simulations made the the mesh will be uniform. This is for studying uniquely the influence of the aspect ratio and number of elements in the results by making uniform the external error influence over the mesh. 38
  • 49.
    For the turbulentcase, the k-Epsilon model will be used. A bias factor of 3.117 was used for the turbulent mesh generation. The bias is oriented towards the right superior corner for the z=constant planes and towards the inlet and outlet for y=constant and x=constant planes. This is for gaigning precision in the results obtained. With this discretization we get for the first cell for the Re=40000 case and for the Re=500000 case. Both resolutions lies between the acceptable standards. A schematic view for the mesh used for turbulent simulations is shown in Figure 4.2. Grid/Mesh Type Number of divisions AR # Cells Z Y X 8 Uniform 453 45 45 0,201333333 917325 7 319 32 32 0,199375 326656 6 226 23 23 0,196521739 119554 5 180 20 20 0,18 72000 4 113 11 11 0,205454545 13673 3 80 8 8 0,2 5120 2 56 6 6 0,186666667 2016 0 28 3 3 0,186666667 252 T Non- Uniform 564 15 15 0,752 126900 Table 4.2. Proposed meshes for the sensibility study variating the number of elements. Grid/Mesh Type Number of divisions AR # Cells Z Y X a Uniform 226 23 23 0,20354 119554 b 300 20 20 0,133333 120000 c 600 14 14 0,046667 117600 d 100 34 34 0,68 115600 e 50 49 49 1,96 120050 Table 4.3. Proposed meshes for the sensibility study variating the aspect ratio and keeping constant the number of cells. 39
  • 50.
    Figure 4.2. Viewof the meshed utilized for the turbulent simulations, the mesh is denser towards the corner where the two walls meet and coarser towards the symmetry planes, the Bias factor utilized in the generation of the mesh is 3.117 Table 4.4 provides information about the proposed simulations to be made during the study and the correspondent parameters to be extracted and analyzed in each simulation. Simuation Matrix Study Grid Model Friction factor and development length, variating the number of elements 0,2,3,4,5,6,7,8 Laminar Friction factor and development length, variating the aspect ratio a,b,c,d,e Velocity profile, friction factor and development length T Turbulent Table 4.4. Matrix simulation proposed The methodology for computing the developing length is the same as for the 2D channel case. For computing the average wall stress, once the fluid is developed we integrate on the upper wall the local shear stresses and divide the result by the integration length, this is . This is because this overall mean shear stress will be the one causing the pressure loss in the channel and, therefore, is on this bases that the theoretical friction factor is computed. 40
  • 51.
    Steps for theimplementation in OpenFOAM Description for the laminar simulations 1. The mesh is generated in ANSYS, exported in <mesh>.msh and ASCII format and finally imported into fluid by the command fluentMeshToFoam. 2. Change the file changeDictionary to set the initial and the boundary conditions. The configuration utilized for the current case are shown in the following box. U { internalField uniform (0 0 0.0020096173); boundaryField { inlet { type fixedValue; value uniform (0 0 0.0020096173); } outlet { type zeroGradient; value uniform ( 0 0 0 ); //inletValue uniform ( 0 0 0 ); } symetry { type symmetry; } wall { type fixedValue; value uniform (0 0 0); } } } p_rgh { internalField uniform 100000; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 100000; } symetry { type symmetry; } 41
  • 52.
    wall { //type fixedFluxPressure; type zeroGradient; } } } Theinlet velocity will be change to fix the Reyolds in the channel. Alternatively, and inletOutlet boundary condition can be used in the pressure outlet. However, this may lead to flux oscillations. We observe that for the symmetry plane a symmetry condition is used, however, internally a a limiter is included in the code for diminishing the error caused by cross derivatives in the juntion of the two symmetric planes. 3. Following we set the discretization schemes for the solution of the fluid equations. The utilized schemes are shown in the following box. ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss upwind; div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear uncorrected; } interpolationSchemes { default linear; } snGradSchemes { default uncorrected; } fluxRequired { default no; p_rgh; } As in the previous case low order discretization schemes are utilized for aiding a rapid convergence in the results, since the stability is aided by the regular orthogonal mesh. 42
  • 53.
    4. Next, thesolution methods for the system of equations have to be specified. The following box show the configuration selected for the current case. solvers { p_rgh { solver GAMG; tolerance 1e-6; relTol 0.01; smoother GaussSeidel; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } "(U)" { solver PBiCG; preconditioner DILU; tolerance 1e-6; relTol 0.1; } } SIMPLE { momentumPredictor on; nNonOrthogonalCorrectors 0; } relaxationFactors { fields { p_rgh 0.7; } equations { U 0.3; } } The solution methods and the relaxation factors for the SIMPLE code are the same than the utilized for the channel 2D case. 5. Finally in the controlDict we select as method of solution the chtMultiRegionSimpleFoam, which, in this case, corresponds to the modified solution method shown in the Appendix. Description for the turbulent k-epsilon simulations We will describe only the steps that change in the simulations. 43
  • 54.
    2. Change thefile changeDictionary to set the initial and the boundary conditions for k and epsilon. The configuration utilized for the current case are shown in the following box. epsilon { internalField uniform 0.0003971992; //This is just for starting, will be recalculated in the first step boundaryField { inlet { type compressible::turbulentMixingLengthDissipationRateInlet; mixingLength 0.0038; //Definition of the mixing length value uniform 1; //This is just a placeHolder } outlet { type zeroGradient; //type inletOutlet; //inletValue uniform 0.0003971992; //In case of reversed flow //value uniform 1; //This is just a placeHolder } symetry { type symmetry; } wall { type compressible::epsilonWallFunction; //Adjusting epsilon to the wall function Cmu 0.09; kappa 0.41; E 9.8; value uniform 1; //This is just a placeHolder } } } k { internalField uniform 0.0004386347; //This is just for starting, will be recalculated in the first step boundaryField { inlet { type turbulentIntensityKineticEnergyInlet; intensity 0.0425; //Definition of the fluctuation intensity -!! Considering iso-tropic turbulence- value uniform 1; //This is just a placeHolder } outlet { type zeroGradient; //type inletOutlet; //inletValue uniform 0.0004386347; //Inlet value in case of reversed flow //value uniform 1; //This is just a placeHolder } symetry { type symmetry; } wall { type compressible::kqRWallFunction; //Adjusting k to the wall function 44
  • 55.
    value uniform 1;//This is just a placeHolder } } } mut { internalField uniform 0; //This will be calculated based on the solution of the kEpsilon equations boundaryField { inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } symetry { type symmetry; } wall //This is the only important part { type mutkWallFunction; //We are selecting the inclusion of a wall function -k based- in the model value uniform 0; } } } The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we use standard wall functions for the near-wall treatment. The rest of the parameters and models utilized for the turbulent kinetic energy and for the dissipation rate are similar to the 2D case. As an alternative for rapid stabilization of the turbulent viscous stresses in this case, inletOutlet conditions may be used for the output values for the k and epsilon quantities. However, these parameters should only be used for the initial steps, since then they may result in oscillations for the method. 3. In the discretization schemes for the turbulent equations, we must specify the discretization schemes for the k-epsilon turbulent equations. The discretization proposed in shown in the following box. ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } 45
  • 56.
    divSchemes { default none; div(phi,K) boundedGauss upwind; div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; div(phi,R) bounded Gauss upwind; div(R) Gauss linear; } laplacianSchemes { default Gauss linear uncorrected; } interpolationSchemes { default linear; } snGradSchemes { default uncorrected; } fluxRequired { default no; p_rgh; } Once again low order methods are used in the discretization schemes for a rapid solution of the system of equations. The very orthogonal and well oriented mesh help once again in the stability of the method, allowing us to use low order schemes. 4. We following specify the the solution schemes for the k and epsilon solvers. This terms come as predictors of the turbulent viscosity and therefore is common practice to use the same discretization schemes as for the velocity field. In the following box we specify the discretization use for the current simulation. "(|k|epsilon)" { solver PBiCG; preconditioner DILU; tolerance 1e-8; relTol 0.1; } 6. Finally in the turbulenceProperties file, we specify the simulation type as RASModel and in the RASProperties file we specify the RASModel as kEpsilon. 46
  • 57.
    Results obtained forthe plane Channel 2D Test 0: Velocity profiles First, we propose as a ground test to compare the laminar velocity profile with the analytical solution obtained for a velocity profile in the channel. The analytical solution for the flow in a square channel, have been developed by manually integrating the Navier Stokes equations for the 2D developed flow. According to [Viscous fluid flow, Frank White, p. 120] the analytical solution can be expressed as For comparing the velocity profiles, we first take a section in a z coordinate where the profile is already developed. Then in the resulting 2D square section, we plot the velocity in lines parallel to the y axis for 4 different x coordinates. The x coordinates with are chosen are x=0m (is the center-line on the channel), x=0.01m, x=0.02m and x=0.025m (which correspond to the wall) The results are shown in graph 1. Graph 1. A very good agreement is observed between the OpenFOAM solution and the analytical one. The average error is calculated in 0,15%, being the maximum average error of 0,27% in the center-line profile. Following, another ground taste is to observe the profiles obtained for a turbulent simulation and compare it with the one obtain for a laminar simulation. For doing so we take the y velocity profile for Reynolds numbers of 100 and 40000, with are laminar and turbulent respectively. We then plot both velocities profiles in the lines identified in the previous case. Multiplying profile of the former profile by 400, we obtain the results depicted in Graph 4.2. 47
  • 58.
    Graph 4.2. Comparisonbetween the laminar and the turbulent profiles simulated by OpenFOAM. In this case the presence of the two walls is evidenced by a more abrupt decrease of the velocity towards the corner. The turbulent diffusion coefficient reaches its maximum closer to each wall because the presence of the other wall. The results show flux conservation for both simulations and behave physically as expected for the case. 48
  • 59.
    Laminar Test 1:Friction factor and development length, variating the number of elements For the first test we fix the aspect ratio in 0,2 and we variate the number of elements in the mesh. We perform the simulations for the laminar Reynolds numbers of 100, 500 and 2000, for the meshes shown in Table 2. We then compare the non dimensional entrance length and with the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The way for computing the theoretical predictions is explain in the ANSYS section for this case. The results obtained are shown in Figure 4.3. 0 1 2 3 4 5 6 7 8 9 0,05 0,06 0,06 Entrance Length Re_100 L_plus_OpenFOAM L_plus_theoric Mesh L_plus 0 1 2 3 4 5 6 7 8 9 0,05 0,06 0,06 0,07 Entrance Length Re_500 L_plus_OpenFOAM L_plus_theoric Mesh L_plus 49
  • 60.
    0 1 23 4 5 6 7 8 9 0,05 0,05 0,06 0,06 Entrance Length Re_1000 L_plus_OpenFOAM L_plus_theoric Mesh L_plus 0 1 2 3 4 5 6 7 8 9 0,18 0,2 0,22 0,24 0,26 Friction factor Re_100 Friction_Factor_OpenFoam Friction_factor_theoretical Mesh f*Re/100 0 1 2 3 4 5 6 7 8 9 0 0,1 0,2 0,3 Friction factor Re_500 Friction_Factor_OpenFoa m Friction_factor_theoretical Mesh f*Re/100 50
  • 61.
    0 1 23 4 5 6 7 8 9 0,21 0,22 0,23 0,24 0,25 Friction factor Re_1000 Friction_Factor_OpenFoa m Friction_factor_theoretical Mesh f*Re/100 Figure 4.3. Development length and friction factor for laminar Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant aspect ratio factor variating the number of elements in each mesh. For the development length, for all Reynolds number, acceptable results are obtained for mesh of number of elements larger than mesh 4. In all cases, the error attended are below 2% for mesh 4. It is notable to mention that for meshes 7 and 8 less than 1% of error are obtained for all cases. Considering that mesh 4 is composed of 113 elements in the z direction and, 11 elements in the y and x direction, a maximum volume of 4e-7 m³ (for an overall aspect ratio of 0,2) is recommended for the element in order to attain acceptable errors in the solutions obtained. In a similar case, if an error of less than 1% in comparison to the theoretical solution wants to be attained in all cases, a maximum volume of 1,5e-8 m³ for the cell is recommended for an aspect ratio of 0,2. In this case, though the mesh are similar to the 2D case, it is observed that the errors are decreased from mesh 4 to mesh 6. This is because by modeling a a quadrant of the channel we are improving the resolution in the mesh for similar discretization. However, for mesh 7 and 8, the errors obtained for the entrance length in comparison with the laminar solution are the same. This is because this error is not induced by an under-discretization in the mesh, but rather by an error of resolution in the velocity profile (which is very similar for the 2D and 3D cases). 51
  • 62.
    The errors obtainedfor the friction factor coefficients are smaller than the ones obtained for the development length. In this case, once again, acceptable results are obtained for meshes denser than mesh 3. In comparison with the 2D case, in which the acceptable mesh was determined as 4 we justify the difference, once a gain, in a denser mesh obtained by modeling a quadrant. The errors obtained for all the laminar cases are below 1,2%. It is again notable to mention that for meshes 7 and 8 less than 0,5% of error is obtained for all cases in the comparison of the friction factor with respect to the theory. This error is quite close to the average error on resolution in the velocity profile, which justifies the use of low order methods in the discretization of the problem. Once again, if a maximum element volume of 1,5e-8 m³ is used the errors will be smaller than 0,5%. It is notable in this case, that because of the influence of one wall over the other, the skin friction factor coefficients for the wall present an error which is slightly larger. In numerical terms, we justify this in that the perturbations introduced by one wall are more likely to have influence over the other. Laminar Test 2: Friction factor and development length, variating the aspect ratio of the cells For the test we fix the number of elements in that of mesh 6: 119554, which was proven in the former case to give accurate results for the case of an aspact ratio of 0,2. Then, we perform the simulations for the laminar Reynolds numbers of 100, 500 and 2000, variating the aspect ratio of the cells (as shown in Table 3). We then compare the non dimensional entrance length and with the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The procedures for the determination of the theoretical values are listed in the ANSYS section of the case. The results obtained are shown in Figure 4,4. 52
  • 63.
    0 0,5 11,5 2 2,5 0,05 0,06 0,06 0,07 Entrance Length Re 100 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 0 0,5 1 1,5 2 2,5 0,05 0,06 0,06 0,07 Entrance Length Re 500 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 0 0,5 1 1,5 2 2,5 0,06 0,06 0,06 0,06 0,06 Entrance Length Re 1000 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 53
  • 64.
    0 0,5 11,5 2 2,5 0,18 0,2 0,22 0,24 0,26 Friction factor Re 100 Friction_Factor_OpenFoam Friction_factor_theoretical Aspect Ration f*Re/100 0 0,5 1 1,5 2 2,5 0,21 0,22 0,23 0,24 0,25 0,26 Friction factor Re 500 Friction_Factor_OpenFoam Friction_factor_theoretical Aspect Ratio f*Re/100 0 0,5 1 1,5 2 2,5 0,2 0,22 0,24 0,26 Friction factor Re 1000 Friction_Factor_OpenFoam Friction_factor_theoretical Aspect Ratio f*Re/100 Figure 4.4. Development length and friction factor for laminar Reynolds number of 100, 500 and 1000 for orthogonal meshes with constant number of elements variating the aspect ratio of them. 54
  • 65.
    For the developmentlength, for all Reynolds numbers, acceptable results are obtained for the plateau laying between the aspect ratio of 0,1 and 1. In all cases, the error attended are below 1,5% inside this region. This error is coincident with the one obtained for mesh 6 in the previous case. An aspect ratio smaller than this one, will case the perturbations introduced in the y direction to be amplified in the x direction, therefore, obtaining a development of the fluid profile sooner than expected (view ANSYS Appendix for more details). In a similar form, when the discretization in x becomes smaller than the discretization in y, the quite big perturbations generated in the stream- wise direction, influence the form of the velocity profile in the t direction, causing a late development. This last statement which was a hypothesis in the previous 2D simulation, is supported by the fact that the error is larger in the 3D case for aspect ratios larger than 1, since there are two transversal directions- The errors obtained for the friction factor coefficients are smaller than the ones obtained for the development length. The plateau obtained for attaining an acceptable result in the simulations is larger than in the previous cases. For this case, it is determined between 0,05 and 2 for the value of the aspect ratio. Note that the limits of this region have been obtained by interpolation fitting of the aspect ratios simulated. The errors obtained for all the laminar simulations in this region lies below 1%. In this case, for determining the friction factor, a bigger plateau is a consequence of a less recuperating influence in perturbations near the wall. Turbulent Test: Friction factor and development length We simulate turbulent flows for Reynolds numbers of 40000 and 500000. The rugosity of the wall is assumed to be zero. For computing the turbulent viscosity a RANS kEpsilon model is utilized. The standard coefficients are used for this model [Reference Facundo]. The results obtained for the non-dimensional entrance length and for the Manning turbulent friction factor are computed against the theoretical predictions [view ANSYS part for theoretical references]. The mesh utilized correspond to the one shown in table 2. The results obtained are presented in table 4. 55
  • 66.
    40000 2,25123 1,591860,65% 0,9841487588 0,00500024 0,0049139502 1,76% 500000 4,25315 1,5994409 0,80% 0,993782922 0,00300125 0,0029651642 1,22% Table 4. Results obtained for the turbulent simulations using the kEpsilon model. We observe that the results obtained show an acceptable agreement with the theoretical predictions for both the entrance length and the friction factor determination. The errors are observed to decrease their intensity at higher Reynolds since the high intensity turbulence propose stabilize the perturbation influence in a bigger value predicted for the turbulent viscosity. We observe a further decrease of the error in the 3D case, compared to the 2D case, since the effect of two wall act as a considerable dumper for numerical escilations. Appendix. Main parameters of the simulations 56
  • 67.
    Factor LD 0,0586Laminar 1,592748 Turbulent H 0,05 m Skin_Factor 14,23 Laminar 0,04091125 Turbulent Height of the channel m 0,05 Roughness Physical Heigth 1,00E-06 Turbulent Intensity 0,10% k 8,07712E-08 u* 0,000309144 Non-Dimmensional Heigth 2,12E-05 Reference MIN MAX Hydrodynamically smooth 0 2,25 Transitional 2,25 90 Fuly Rough 90 1,00E+0 7 Initial Conditi ons k 0,00043863 epsilon 0,0003972 57 Reynolds Inlet velocity water (m/s) Inlet velocity air (m/s) Turb length scale Turbulence Intensity 100 0,0010048087 0,0146073469 NA NA 500 0,0050240433 0,0730367347 NA NA 1000 0,0100480866 0,1460734694 NA NA 40000 0,4019234622 5,8429387755 0,0038 4,25% 500000 5,0240432779 73,0367346939 0,0038 3,10%
  • 68.
    Grid/Mes h Type Number of divisions AR# Cells X Y 8 Uniform 453 45 0,201333333 20385 7 319 32 0,199375 10208 6 226 23 0,196521739 5198 5 180 20 0,18 3600 4 113 11 0,205454545 1243 3 80 8 0,2 640 2 56 6 0,186666667 336 0 28 3 0,186666667 84 T Non- Uniform 564 15 0,752 8460 58
  • 69.
    SQUARE CHANNEL 3DHYDRAULICS ANSYSFluent Description of the simulation The geometry consist in a square channel. The Reynolds numbers will be fixed in 100, 500 and 1000 for the laminar case and 40000 for the turbulent case. The following Table 5.1 summarizes the physical parameters. Parameter Unit Value Side Length m 0.05 Length m 8 Table 5.1. Geometric simulation parameters In this case both directions perpendicular to the axial direction are assumed to have an appreciable effect in the dynamics of the fluid. For the simulation made, it was chosen to work with a quarter of the square channel, this will in turn optimize the mesh utilized reducing four times the domains. The selection of the laminar mesh is chosen to respect the same cell size and aspect ratio that was previously simulates in the 2D plane channel. However, since in this case both development direction are important, is expected that the dynamics of the development of the boundary layer is changed. This will in turn, implies different results in the development length and friction factor than for the 3D square channel. The presence of the corner, and the known wrong resolution of the kinetic energy and dissipation energy when interacting in corner, make us use a mesh which density is doubled in the 3D channel, with respect of that used in the 2D channel, near the corner. The boundary conditions that need to be specified include inlet, outlet, axis and wall, as will be described details later. Uniform flow was specified at inlet, the flow will reach the fully developed regions after a certain distance downstream. No-slip boundary condition will be used on the wall, constant pressure was used for outlet and axi- 59
  • 70.
    symmetrical boundary conditionswere used for the axis. Uniform grids will be used for the laminar flow whereas non-uniform grid will be used for the turbulent flow. This is for making it possible to study the influence of the aspect ratio in the laminar cases and for gaining accuracy in the simulation of the skin factor in the turbulent cases. A description of the domain and boundary conditions used is shown in Figure 5.1. Figure 5.1. Top: view of the geometry and the boundary conditions, a symmetry condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet condition is in the opposite side on the inlet and is not shown in this picture. Bottom: a picture of the regular, orthogonal, mapped mesh generated for the laminar simulations to be made. Experimental, analytical results and simulation results will be compared. Additionally, detailed verification and validation studies will be conducted. Table 5.2 shows a tentative mesh sensibility study proposal which provides a uniform aspect ratio of 0.2 for all the mesh for the laminar cases and a +¿≈10 y ¿ with the correspondent wall function imposition. Please note that a bias factor of 3.117 was used for the turbulent mesh generation. The bias is oriented towards the right superior corner for the z=constant planes and towards the inlet and outlet for y=constant and x=constant planes. A schematic view for the mesh used for turbulent simulations is shown in Figure 5.2. 60
  • 71.
    Grid/Mesh Type Number ofdivisions AR # Cells Z Y X 8 Uniform 453 45 45 0,201333333 917325 7 319 32 32 0,199375 326656 6 226 23 23 0,196521739 119554 5 180 20 20 0,18 72000 4 113 11 11 0,205454545 13673 3 80 8 8 0,2 5120 2 56 6 6 0,186666667 2016 0 28 3 3 0,186666667 252 T Non- Uniform 564 15 15 0,752 126900 Table 5.2. Proposed meshes for the sensibility study. Marked in yellow are the meshes used for the simulations reported in this document. Figure 5.2. View of the meshed utilized for the turbulent simulations, the mesh is denser towards the corner where the two walls meet and coarser towards the symmetry planes, the Bias factor utilized in the generation of the mesh is 3.117 Table 5.3 provides information about the proposed simulations to be made during the study and the correspondent parameters to be extracted and analyzed in each simulation. Simuation Matrix Study Grid Model Friction factor and axial velocity profile 2,3,4,8 LaminarFriction factor study 6,7 Axial velocity, center-line pressure and centerline velocity T Turbulent 61
  • 72.
    Table 5.3. Simulationmatrix proposed for the 2D plane channel case Steps of implementation in ANSYS Description for the laminar simulations 1. Select the components to be used in the workbench and make the corresponding connections. 2. Create the geometry. Make a sketch, adjust the dimensions of the cross section of the channel, extrude the sketch to get the length of the channel and generate. 3. Create the mesh. Size the vertical and horizontal edges in the inlet face, without a bias factor. Size the perpendicular edges to the face. Choose a hard or imposed transition between elements for both cases. Choose a sweep method from the inlet face to the outlet face for generating the mesh. Generate the mesh. Crate a named selection for the inlet, outlet, symmetries and walls. 4. Performing the simulation. 4.a. Set up double precision in a serial processor and lunch Fluent 4.b. Perform a Mesh Check to see the mesh has been generated all-right. Optionally perform Mesh Quality and see that the aspect ratio is lower than 50. 4.c. Check that in the general settings the Pressure-Based solver, an absolute velocity formulation and a Steady time problem. 4.d. Select in Models, a viscous laminar model to be implemented 4.e. Add in material water to the material list 4.f. Set in surface body the element type simulation to fluid and select the material to be water 4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in velocity specification method specify “Magnitude, normal to the boundary” and set the velocity to the magnitude corresponding to each specific Reynolds number. 62
  • 73.
    4.g.2. Select theboundary condition of the outlet to pressure outlet (ID 7 in ANSYS 15) and edit the outlet gauge pressure to 0. Check also that the supersonic or initial Gauge Pressure is set equal to 0 4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the wall motion equation to be an stationary wall with no slip as shear condition. Also change the operating conditions to a value of 97225.9 Pa in pressure. 4.g.4. Check that the axis boundary condition is set in axis (ID 14 in ANSYS 15). 4.h. Set the reference values following the inlet face values. [View the adjoin excel sheet for automatic generation.] 4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell based, the pressure to second order and the momentum to second order upwind. 4.j. Leave the solution control as default 4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity and z- velocity to 1e-6. 4.l. In initialization choose standard initialization, select the reference frame as relative to cell zone and put the gauge-pressure = 0 the x velocity equal to the inlet velocity, the y-velocity =0 and the z-velocity=0. 4.m. Initialize the simulation. 4.n. In run calculation change the number of iterations to 1000 and lunch the calculation. 5. Analysis of the results 5.1 Plot the velocity in the center-line where the two symmetry planes meet for determining the development length. For post-processing use the following criteria. Search for the percentage of the maximum velocity that betters agrees with the development length. Eg. If the development length should be 0.05m, search c such that c*Umax determines the velocity value in the position 0.05m. The error is the described by Error=(c−0,99)/c . 5.2. Extract as wall fluxed the skin coefficients at the wall. For doing this generate lines in the top wall and determine the skin friction factor distribution in this lines. The final friction factor will be equal to the integral of the friction factors over the length of the 63
  • 74.
    line, divided bythe length of the line. The friction factor should be taken as the integral over a line in which the flow is already developed. See excel sheet. Description for the turbulent k-epsilon simulations We will describe only the steps that change in the simulations. 3. Create the mesh. Size the vertical and horizontal edges in the inlet face, include the bias factor in the direction shown in Figure 2. Size the perpendicular edges to the face, with a double bias factor, to get a mesh denser towards the inlet and the outlet. All Bias factors used have the value of 3.117. Include a sweep method from the inlet face to the outlet face for generating the mesh. Generate the mesh. Crate a named selection for the inlet, outlet, symmetries and walls. 4. Performing the simulation. 4.d. Select in Models, k-epsilon 2 equations. The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we use standard wall functions for the near-wall treatement. 4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in velocity specification method specify “Magnitude, normal to the boundary” and set the velocity to the magnitude corresponding to each specific Reynolds number. Check also that the supersonic or initial Gauge Pressure is set equal to 0. Specify the turbulence method to intensity and length scale and set intensity in 4.2%, in accordance to I=0,016 ReDh −1 8 - , for ReDh=40000 . Set the length scale for the turbulence as l=0,038∗Dh [See appendix]. 4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in ANSYS 15) and edit the outlet gauge pressure to 400 –not to have absolute pressures lower than 0 in the calculation-. For the turbulence method select k and epsilon and specify both values constant and equal to 1. 4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the wall motion equation to be a stationary wall with no slip as shear condition. Set the roughness height and the roughness constant equal to 0 [See appendix]. 4.g.4. The axis boundary condition remains as axis. 64
  • 75.
    4.i. Set thesolution method to SIMPLE. Set the gradient to Green-Gauss cell based, the pressure to second order and the momentum to second order upwind. Also set the turbulent kinetic energy solution method to ‘second order upwind’ and the turbulent dissipation rate to ‘second order upwind’. 4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity, k and epsilon to 1e-6. 4.l. In initialization choose standard initialization, select the reference frame as relative to cell zone and put the gauge-pressure = 400 the x velocity equal to the inlet velocity and the y-velocity =0. Also set the initial values of the initial turbulent kinetic energy and the initial energy dissipation rate as calculated in the excel sheet. 4.n. In run calculation change the number of iterations to 1000 and lunch the calculation. 5. Analysis of the results 5.1 Take the entrance length before the first peak in the center line velocity. 5.2. Take the friction factor for lines after the peak of velocity. For making the integral of the distributions of friction factor in the line a trapezium rule is utilized. A Simpson’s rule may be utilized if more precision is required, however for the current comparisons the little improvement in the results is not be worth the effort. Note: For determining the theoretical friction factor for the turbulent case, a simple rule is used taking into account the difference in the laminar coefficients, i.e. f turb SC = f turb PIPE ∗f lam SC f lam PIPE . This method is correct if we assume that the same geometrical phenomena that originates a change in the friction factor for a square channel (SC) and a pipe in the laminar regime are taking place unchanged in the turbulent regime. The results observed are improved in agreement when using this simple rule by 7%, taking the error in the comparison in the simulations and the predicted values for the skin friction factor from 9% to 2%. 65
  • 76.
    Results obtained forthe plane Channel 2D Re L Lplus Error Value* Umax Skin_Factor_C alculated Skin_Factor_Predicte 100 0,283186 0,0566372 4,36% 0,98 0,140520963 0,1423 500 1,45133 0,0580532 1,74% 0,982 0,028104176 0,02846 1000 2,83186 0,0566372 4,36% 0,98 0,014050847 0,01423 40000 1,13777 1,60904976 1,23% 0,992 0,005026097 0,00491395 lxvi
  • 77.
    Appendix 1. Frictionfactors and entrance length in non- circular channels The common parameter for modelling a non-circular channel is the aspect ratio. The aspect ratio is a factor that describes the cross section of a channel. This one gives us an idea of the corners existing in this one and the consequent buildup of the shear stress in this ones. According to the geometrical shape of the cross section, the friction factor can be defined as expressed by table 1. Once the aspect ratio of the cross sectional area is defines, there exist different approaches for identifying the size of this one. The two principal to mention are the one based in the hydraulic diameter Dh and the one based in the square root of the cross sectional area √A . Please note that for regular, concave polygons, the two magnitudes differs by a relatively small amount. Is to mention the case of the square channel in which both are equal. However the more complex and the less regular the 67
  • 78.
    area of thecross section, the more this two factor will differ. The friction factor may be related to the aspect ratio of the channel by the flowing relationships. Equation 51 is for the hydraulic diameter and equation 53 for the square root of the area. Table 2 shows some of the results obtained by this two correlations for rectangular and elliptical sections. Table 2. Friction factors for rectangular and elliptical sections as predicted by the formulas based on the hydraulic diameter and the square root of the area. In a similar way we can define the relationship of the aspect ratio to the laminar entrance length in a non-circular duct. It is known that for any enclosure, the entrance length can be defined as L=f 1(ϵ)ℜDh or L= ~ f 1(ϵ)ℜ√A . We choose to use the 68
  • 79.
    relationship based inthe hydraulic diameter and we define +¿=f 1 (ϵ)= L ℜ Dh Lh ¿ . The functional relationship existing between the non-dimensional homogenized entrance length ( +¿ Lh ¿ ) and the aspect ratio can expressed by the following equation. Some results obtained by this equation for rectangular and elliptical sections are summarized in Table 3. Table 3. Non-dimensional entrance length as a function of the aspect ratio for laminar flow. 69
  • 80.
    Appendix 2. Effectof corners In micro-channel fluid flows important effects of the corners of the channel in the velocity profile distribution of the fluid have been observed. This is mainly because the added effects of surface tension become important with respect to the inertia forces of the fluid Eo≈1 . However, for larger channel, when the separation between the surfaces becomes larger than 1mm, the effects of various corners presented in the fluid flow can be depreciated. In the current case we proceed in this fashion. 70
  • 81.
    Appendix 3. Mainparameters of the simulations Reynold s Inlet velocity water (m/s) Inlet velocity air (m/s) Turb length scale Turbulence Intensity 100 0,002009617 0,029214694 NA NA 500 0,010048087 0,146073469 NA NA 1000 0,020096173 0,292146939 NA NA 40000 0,803846924 11,68587755 0,0038 4,25% Factor LD 0,0586 Laminar 1,592748 Turbulent H 0,05 m Skin_Fact or 14,23 Laminar 0,04091125 Turbulent Roughness Physical Heigth 1,00E-06 Turbulent Intensity 0,10% k 3,23085E-07 u* 0,000618287 Non-Dimmensional Heigth 4,23E-05 Initial Conditions k 0,00175454 epsilon 0,00317759 yplus 71
  • 82.
    y0 0,0025 T_wall 14,8351558 yplus36,9769585 Grid/Mes h Type Number of divisions AR # Cells Z Y X 8 Uniform 453 45 45 0,201333333 917325 7 319 32 32 0,199375 326656 6 226 23 23 0,196521739 119554 5 180 20 20 0,18 72000 4 113 11 11 0,205454545 13673 3 80 8 8 0,2 5120 2 56 6 6 0,186666667 2016 0 28 3 3 0,186666667 252 T Non- Uniform 564 15 15 0,752 126900 72
  • 83.
  • 84.
    PIPE 3D HYDRAULICSOpenFOAM Description of the simulation The geometry consist in a circular pipe. This case have been selected since plenty of experience exist in the study of this type of geometry. Previous results have been successfully obtained for 2D axi-symmetrical simulations in ANSYS. In this case the influence of a 3D mesh will be studied. The Reynolds numbers will be fixed in 100, 500 and 1000 for the laminar case and 40000 for the turbulent case. The following Table 6.1 summarizes the physical parameters. Parameter Unit Value Radius m 0.05 Length m 8 Table 6.1. Geometric simulation parameters The 3D simulations include the possibility of watching coherent, non- asymmetrical structures that will not be observable in a 2D simulation. However, for the current problem, ideally no non-asymmetrical effects will exist. Therefore, the results expected are similar to those in 2D simulations. For the simulation made, it was chosen to work with a quarter of the pipe, this will optimize the number of elements utilized in the mesh by 4 times. This is, for acquiring the same mesh density, 4 times less elements should be used for a quarter of the pipe than for the full pipe. The selection of the laminar mesh is chosen to respect the same cell size and aspect ratio that was previously simulated in the 2D asymmetrical case in ANSYS. However, for the sweeping method used a larger density of mesh is observed near the axis. It is important to observe that, because the cuts in the quarter are imposed 74
  • 85.
    symmetrical boundary conditions,no numerical discretization agglomeration is observed, since there is no source introducing a large numerical error towards the core of the mesh. Adding this to a small mesh Peclet number, indicates, a priori that no significant artificial diffusion errors will be introduced [view ANSYS Appendix for the case]. The boundary conditions that need to be specified include inlet, outlet, cyclic and wall. Uniform flow was specified at inlet, the flow will reach the fully developed regions after a certain distance downstream. No-slip boundary condition will be used on the wall, constant pressure was used for outlet and cyclic boundary conditions were used for the cuts that determine the quarter [view Figure 1]. Please note that also symmetrical boundary conditions could have been used for this relatively simple case, however due to better numerical behavior of the code with cyclic boundary conditions, this ones are chosen. Experimental, analytical results and simulation results will be compared. Additionally, detailed verification and validation studies will be conducted. For the laminar cases (Reynolds number of 100, 500, 1000) radially and azimuthal uniform grids will be used for the laminar flow. This is for studying uniquely the influence of the aspect ratio and number of elements in the results by making uniform the external error influence over the mesh. In the first case, we choose to keep the aspect ratio of the cell constant while variating the number of elements, the meshes utilized are shown in Table 6.2. For a second case, we select the number of cells in mesh 6 and proportionally variates the discretization parameters to obtain different aspects ratios for the elements. Table 6.3 present the meshes used during the simulation. Please note that the discretization in R and are variated in a proportional form to induce a similar aspect ratio in the constant R and constant planes. 75
  • 86.
    Figure 6.1. Top:view of the geometry and the boundary conditions, a symmetry condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet condition is in the opposite side on the inlet and is not shown in this picture. Bottom: sweeped, radially uniform mesh, generated for the laminar simulations to be made. A bias factor of 3.117 was used for the turbulent mesh generation. The bias is oriented towards the wall off the pipe, as the symmetric conditions suppose a domain continuation. Also a bias in for generating smaller cells in the inlet and in the outlet is included. This is for gaining precision in the results obtained. With this discretization we get for the furthest first cell from the wall for the Re=40000 case and for the Re=500000 case. Both resolutions lies between the acceptable standards. A schematic view for the mesh used for turbulent simulations is shown in Figure 6.2. Grid/Me sh Type Number of divisions AR # Cells Z R Perimeter 8 Uniform 453 45 45 0,20133333 917325 7 319 32 32 0,199375 326656 6 226 23 23 0,19652174 119554 5 180 20 20 0,18 72000 4 113 11 11 0,20545455 13673 3 80 8 8 0,2 5120 2 56 6 6 0,18666667 2016 0 28 3 3 0,18666667 252 T Non- Uniform 564 15 15 0,752 126900 76
  • 87.
    Table 6.2. Proposedmeshes for the sensibility study. For the laminar cases the aspect ratio is fixed while we variate the number of elements. Figure 6.2. View of the meshed utilized for the turbulent simulations, the mesh is denser towards the wall of the pipe, the Bias factor utilized in the generation of the mesh is 3.117 Table 6.3 provides information about the proposed simulations to be made during the study and the correspondent parameters to be extracted and analyzed in each simulation. Simuation Matrix Study Grid Model Friction factor and development length, variating the number of elements 0,2,3,4,5,6,7,8 Laminar Friction factor and development length, variating the aspect ratio a,b,c,d,e Velocity profile, friction factor and development length T Turbulent Table 6.3. Matrix simulation proposed The method for computing the development length consist in analyzing the axial velocity and utilizing the same methodology we have used so far. Additionally, the wall shear stress for computing the friction factor will be evaluated in a line adjacent to the pipe wall. 77
  • 88.
    Steps for theimplementation in OpenFOAM Description for the laminar simulations 1. The mesh is generated in ANSYS, exported in <mesh>.msh and ASCII format and finally imported into fluid by the command fluentMeshToFoam. 2. Change the file changeDictionary to set the initial and the boundary conditions. The configurations utilized for the current case are shown in the following box. U { internalField uniform (0 0 0.0020096173); boundaryField { inlet { type fixedValue; value uniform (0 0 0.0020096173); } outlet { type zeroGradient; value uniform ( 0 0 0 ); //inletValue uniform ( 0 0 0 ); } symetry { type cyclic; } wall { type fixedValue; value uniform (0 0 0); } } } p_rgh { internalField uniform 100000; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 100000; } symetry { type cyclic; } 78
  • 89.
    wall { //type fixedFluxPressure; type zeroGradient; } } } Theinlet velocity will be change to fix the Reyolds in the channel. Alternatively, and inletOutlet boundary condition can be used in the pressure outlet. However, this may lead to flux oscillations. We observe that for the quarter planes cyclic boundary conditions are used, however, internally a a limiter is included in the code for diminishing the error caused by cross derivatives in the junction of the two quarter planes. 3. Following we set the discretization schemes for the solution of the fluid equations. The utilized schemes are shown in the following box. ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded TVD; div((muEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p_rgh; } In this aspect there are two important measures which deserve some time for attention. In first place, high order corrected schemes are used, this is because the non orthogonal and not noble mesh will cause convergence issues for lower order schemes. Also, a 79
  • 90.
    limited TVD schemeis included for limiting the perturbations arriving from the small elements close to the axis to diffusing into the mesh. 4. Next, the solution methods for the system of equations have to be specified. The following box show the configuration selected for the current case. solvers { p_rgh { solver GAMG; tolerance 1e-6; relTol 0.01; smoother GaussSeidel; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } "(U)" { solver PBiCG; preconditioner DILU; tolerance 1e-6; relTol 0.1; } } SIMPLE { momentumPredictor on; nNonOrthogonalCorrectors 5; } relaxationFactors { fields { p_rgh 0.7; } equations { U 0.3; } } The only difference presented here with respect to the previous case is the introduction of non-orthogonal correctors. This in done because due to the non-orthogonality in the mesh configuration, the linear interpolation of the gradients between cells may be inaccurate to represent the flux in the interface. The correction is done internally in the pressure continuity equation [see Appendix for more information]. 80
  • 91.
    5. Finally inthe controlDict we select as method of solution the chtMultiRegionSimpleFoam, which, in this case, corresponds to the modified solution method shown in the Appendix. Description for the turbulent k-epsilon simulations We will describe only the steps that change in the simulations. 2. Change the file changeDictionary to set the initial and the boundary conditions for k and epsilon. The configuration utilized for the current case are shown in the following box. epsilon { internalField uniform 0.0003971992; //This is just for starting, will be recalculated in the first step boundaryField { inlet { type compressible::turbulentMixingLengthDissipationRateInlet; mixingLength 0.0038; //Definition of the mixing length value uniform 1; //This is just a placeHolder } outlet { type zeroGradient; //type inletOutlet; //inletValue uniform 0.0003971992; //In case of reversed flow //value uniform 1; //This is just a placeHolder } symetry { type cyclic; } wall { type compressible::epsilonWallFunction; //Adjusting epsilon to the wall function Cmu 0.09; kappa 0.41; E 9.8; value uniform 1; //This is just a placeHolder } } } k { internalField uniform 0.0004386347; //This is just for starting, will be recalculated in the first step boundaryField { inlet { type turbulentIntensityKineticEnergyInlet; 81
  • 92.
    intensity 0.0425; //Definitionof the fluctuation intensity -!! Considering iso-tropic turbulence- value uniform 1; //This is just a placeHolder } outlet { type zeroGradient; //type inletOutlet; //inletValue uniform 0.0004386347; //Inlet value in case of reversed flow //value uniform 1; //This is just a placeHolder } symetry { type cyclic; } wall { type compressible::kqRWallFunction; //Adjusting k to the wall function value uniform 1; //This is just a placeHolder } } } mut { internalField uniform 0; //This will be calculated based on the solution of the kEpsilon equations boundaryField { inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } symetry { type cyclic; } wall //This is the only important part { type mutkWallFunction; //We are selecting the inclusion of a wall function -k based- in the model value uniform 0; } } } The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we use standard wall functions for the near-wall treatment. 3. In the discretization schemes for the turbulent equations, we must specify the discretization schemes for the k-epsilon turbulent equations. The discretization proposed in shown in the following box. ddtSchemes { default steadyState; } 82
  • 93.
    gradSchemes { default Gauss linear; } divSchemes { defaultnone; div(phi,K) bounded TVD; div(phi,k) bounded TVD; div(phi,epsilon) bounded TVD; div(phi,R) bounded TVD; div(R) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p_rgh; } Once again high order discretization schemes are used given the non-orthogonality and possible instantiates introduced by the mesh. For avoiding the rather large perturbation generated in the axis for propagating into the mesh, TVS discretization schemes are used. 4. We following specify the the solution schemes for the k and epsilon solvers. This terms come as predictors of the turbulent viscosity and therefore is common practice to use the same discretization schemes as for the velocity field. In the following box we specify the discretization use for the current simulation. "(|k|epsilon)" { solver PBiCG; preconditioner DILU; tolerance 1e-8; relTol 0.1; } 6. Finally in the turbulenceProperties file, we specify the simulation type as RASModel and in the RASProperties file we specify the RASModel as kEpsilon. 83
  • 94.
    Results obtained forthe plane Channel 2D Test 0: Velocity profiles First, the ground test consist in comparing the velocity profile obtained during the simulations with the well known theoretical Poiseulle profile. The analytical expression for this profile reads as . The comparison between the results obtain with OpenFOAM and the theoretical results are presented in Figure 3. 0 0,01 0,02 0,03 0,04 0,05 0,06 0 0 0 0 0 0 Comparision laminar velocity profiles Velocity_OpenFOAM Velocity_Theoretical r u(z) 84
  • 95.
    Graph 1. Avery good agreement is observed between the OpenFOAM solution and the analytical one. The average error is calculated in 0,22%, being the maximum average error of 0,54% next to the wall of the pipe. Laminar Test 1: Friction factor and development length, variating the number of elements For the first test we fix the aspect ratio in 0,2 and we variate the number of elements in the mesh. We perform the simulations for the laminar Reynolds numbers of 100, 500 and 2000, for the meshes shown in Table 2. We then compare the non dimensional entrance length and with the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The way for computing the theoretical predictions is explain in the ANSYS section for this case. The results obtained are shown in Figure 6.3. 0 1 2 3 4 5 6 7 8 9 0,04 0,05 0,05 0,06 Entrance Length Re 100 L_plus_OpenFOAM L_plus_theoric Mesh L_plus 85
  • 96.
    0 1 23 4 5 6 7 8 9 0,04 0,04 0,05 0,05 0,05 0,05 Entrance length Re 500 L_plus_OpenFOAM L_plus_theoric Mesh L_plus 0 1 2 3 4 5 6 7 8 9 0,04 0,05 0,05 0,06 Entrance Length Re 1000 L_plus_OpenFOAM L_plus_theoric Mesh L_plus 0 1 2 3 4 5 6 7 8 9 0,12 0,14 0,16 0,18 Friction factor Re 100 Friction_Factor_OpenFoam Friction_factor_theoretical Mesh f*Re/100 86
  • 97.
    0 1 23 4 5 6 7 8 9 0 0,05 0,1 0,15 0,2 Friction factor Re 500 Friction_Factor_OpenFoam Friction_factor_theoretical Mesh f*Re/100 0 1 2 3 4 5 6 7 8 9 0,12 0,13 0,14 0,15 0,16 0,17 Friction factor Re 1000 Friction_Factor_OpenFoam Friction_factor_theoretical Mesh f*Re/100 Figure 6,3. Development length and friction factor for laminar Reynolds number of 100, 500 and 1000 for meshes with constant aspect ratio factor variating the number of elements in each mesh. For the development length, for all Reynolds number, acceptable results are obtained for mesh of number of elements larger than mesh 5. In all cases, the error attended are below 4% for mesh 4. It is notable to mention that for meshes 7 and 8 less than 1,5% of error are obtained for all cases. In this cases, the higher resolution needed for attaining better results comes as a result of the non-orthogonality of the mesh and 87
  • 98.
    the errors introducedby the iteratively nature of the method in the non-orthogonal corrections. The errors obtained for the friction factor coefficients are smaller than the ones obtained for the development length. In this case, once again, acceptable results are obtained for meshes denser than mesh 4. The errors obtained for all the laminar cases are below 2% in this region. It is again notable to mention that for meshes 7 and 8 less than 1% of error is obtained for all cases in the comparison of the friction factor with respect to the theory. Once again, for this case a higher resolution needed for attaining results compared to the other cases is a direct consequence of the non-orthogonality of the mesh. It is worth to mention in this point that several non-orthogonal correctors where needed for producing acceptable results. This is because the mesh quality was not optimal. Laminar Test 2: Friction factor and development length, variating the aspect ratio of the cells For the test we fix the number of elements in that of mesh 8: 91732, which was proven in the former case to give accurate results for the case of an aspect ratio of 0,2. Then, we perform the simulations for the laminar Reynolds numbers of 100, 500 and 2000, variating the aspect ratio of the cells (as shown in Table 3). We then compare the non dimensional entrance length and with the Maning skin friction factor [View Fluid Mechanics, Frank White, 2009]. The procedures for the determination of the theoretical values are listed in the ANSYS section of the case. The results obtained are shown in Figure 6.4. 88
  • 99.
    0 0,2 0,40,6 0,8 1 1,2 1,4 1,6 1,8 2 0,04 0,05 0,05 0,06 Entrance length Re 100 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 89
  • 100.
    0 0,2 0,40,6 0,8 1 1,2 1,4 1,6 1,8 2 0 0,02 0,04 0,06 Entrance Length Re 500 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 0,04 0,05 0,05 0,06 Entrance Length Re 1000 L_plus_OpenFOAM L_plus_theoric Aspect Ratio L_plus 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 0,12 0,14 0,16 0,18 Friction factor Re 100 Friction_Factor_OpenFoam Friction_factor_theoretical Aspect Ratio f*Re/100 90
  • 101.
    0 0,2 0,40,6 0,8 1 1,2 1,4 1,6 1,8 2 0,12 0,14 0,16 0,18 Friction factor Re 500 Friction_Factor_OpenFoam Friction_factor_theoretical Aspect Ratio f*Re/100 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 0,14 0,15 0,16 0,17 Friction factor Re 1000 Friction_Factor_OpenFoam Friction_factor_theoretical Aspect Ratio f*Re/100 Figure 6.4. Development length and friction factor for laminar Reynolds number of 100, 500 and 1000 for non-orthogonal meshes with constant number of elements variating the aspect ratio of them. For the development length, for all Reynolds numbers, acceptable results are obtained for the plateau laying between the aspect ratio of 0,1 and 2. In all cases, the error attended are below 4% inside this region. It is observed in this case that when having a large aspect ratio, the mixed perturbations produced by a smaller discretization in the Z direction than in the R direction are hide under a smaller magnitude of the perturbations going into the mesh because of a larger cell size close to the axis. Therefore, fairly good results are obtained in comparison to the other results obtained. Another important point is that for low aspect 91
  • 102.
    ratios, errors aslarge as 20% are obtained. Comparing this to the previous cases we observe this error to be much larger than the previously attained. This is a consequence of the failure of the TVD schemes for blocking the extra flux introduced by perturbations. The errors obtained for the friction factor coefficients are smaller than the ones obtained for the development length. The plateau obtained for attaining an acceptable result in the simulations is once again between 0,1 and 2. The errors obtained for all the laminar simulations in this region lies below 3%. Once again, good results are obtained for large aspect ratios and very big errors are obtained for low aspect ratios. This is again a consequence of the factors listed above. Turbulent Test: Friction factor and development length We simulate turbulent flows for Reynolds numbers of 40000 and 500000. The rugosity of the wall is assumed to be zero. For computing the turbulent viscosity a RANS kEpsilon model is utilized. The standard coefficients are used for this model [Reference Facundo]. The results obtained for the non-dimensional entrance length and for the Manning turbulent friction factor are computed against the theoretical predictions [view ANSYS part for theoretical references]. The mesh utilized correspond to the one shown in table 2. The results obtained are presented in table 4. Table 4. Results obtained for the turbulent simulations using the kEpsilon model. We observe that the results obtained show an acceptable criteria with respect to the theoretical predictions. However, the errors obtained with respect to the previous orthogonal meshes are much larger than the cases before. The situation is maximized 92 Re L Lplus Error Value*Umax Skin_Factor_Calculated Skin_Factor_Predicted Error 40000 1,88528 1,33309427 1,50% 0,994 0,005825 0,0055251724 5,43% 500000 3,52123 1,32419484 2,06% 0,995 0,003521 0,0033339865 5,61%
  • 103.
    when determining thefriction factor. We explain this once again in the amplification of perturbations introduced by the fine mesh close to the pipe axis. Appendix. Main parameters of the simulations Factor LD 0,05 Laminar 1,359 Turbulent D 0,1 m Skin_Factor 16 Laminar 0,046 Turbulent Height of the channel m 0,05 Roughness Physical Heigth 1,00E-06 Turbulent Intensity 0,10% k 8,07712E-08 u* 0,000309144 Non-Dimmensional Heigth 2,12E-05 Reference MIN MAX Hydrodynamically smooth 0 2,25 Transitional 2,25 90 93 Re L Lplus Error Value*Umax Skin_Factor_Calculated Skin_Factor_Predicted Error 100 0,495575 0,0495575 1,79% 0,999 0,1625292456 0,16 1,58% 500 2,51327 0,0502654 0,57% 0,9896 0,0323480684 0,032 1,09% 1000 5,09735 0,0509735 4,37% 0,966 0,0167677414 0,016 4,80% 40000 1,885281,33309427 1,50% 0,994 0,005825 0,0055251724 5,43% 500000 3,521231,32419484 2,06% 0,995 0,003521 0,0033339865 5,61%
  • 104.
    Fuly Rough 901,00E+07 Initial Conditions k 0,00043863 epsilon 0,0003972 94
  • 105.
    PIPE 3D HYDRAULICSOpenFOAM Description of the simulation The geometry consist in a circular pipe. This case have been selected since plenty of experience exist in the study of this type of geometry. Previous results have been successfully obtained for 2D axi-symmetrical simulations. In this case the influence of a 3D mesh will be studied. The Reynolds numbers will be fixed in 100, 500 and 1000 for the laminar case and 40000 for the turbulent case. The following Table 7.1 summarizes the physical parameters. Parameter Unit Value Radius m 0.05 Length m 8 Table 7.1. Geometric simulation parameters It is observed that the dynamic of the structures generated in 3D simulations correspond to a wider range than the dynamics generated for 2D simulation. This include the possibility of watching coherent, non-asymmetrical structures that will not be observable in a 2D simulation. However, for the current problem, ideally non- asymmetrical effects will exist. Therefore, the results expected are similar to those in 2D simulations. For the simulation made, it was chosen to work with a quarter of the pipe, this will optimize the number of elements utilized in the mesh by 4 times. This is, for acquiring the same mesh density, 4 times less elements should be used for a quarter of the pipe than for the full pipe. The selection of the laminar mesh is chosen to respect the same cell size and aspect ratio that was previously simulated in the 2D asymmetrical case. However, for the 95
  • 106.
    sweeping method useda larger density of mesh is observed near the axis. It is important to observe that, because the cuts in the quarter are imposed symmetrical boundary conditions, no numerical discretization agglomeration is observed, since there is no source introducing a large numerical error towards the core of the mesh. Adding this to a small mesh Peclet number, indicates, a priori that no significant artificial diffusion errors will be introduced [view Appendix]. The boundary conditions that need to be specified include inlet, outlet, symmetries and wall, as will be described details later. Uniform flow was specified at inlet, the flow will reach the fully developed regions after a certain distance downstream. No-slip boundary condition will be used on the wall, constant pressure was used for outlet and symmetrical boundary conditions were used for the cuts that determine the quarter [view Figure 7.1]. Radially uniform grids will be used for the laminar flow whereas non-uniform grid will be used for the turbulent flow. This is for making it possible to study the influence of the aspect ratio in the laminar cases and for gaining accuracy in the simulation of the skin factor in the turbulent cases. A description of the domain and boundary conditions used is shown in Figure 7.1. Figure 7.1. Top: view of the geometry and the boundary conditions, a symmetry condition is imposed in the planes ‘yz’ and ‘xz’ in order to reduce the domain, the outlet condition is in the opposite side on the inlet and is not shown in this picture. Bottom: sweeped, radially uniform mesh, generated for the laminar simulations to be made. 96
  • 107.
    Experimental, analytical resultsand simulation results will be compared. Additionally, detailed verification and validation studies will be conducted. Table 2 shows a tentative mesh sensibility study proposal which provides a uniform aspect ratio of 0.2 for all the mesh for the laminar cases and a +¿≈10 y¿ with the correspondent wall function imposition. Please note that a bias factor of 3.117 was used for the turbulent mesh generation. The bias is oriented towards the wall off the pipe, as the symmetric conditions suppose a domain continuation. A schematic view for the mesh used for turbulent simulations is shown in Figure 7.2. Grid/Me sh Type Number of divisions AR # Cells Z R Perimeter 8 Uniform 453 45 45 0,20133333 917325 7 319 32 32 0,199375 326656 6 226 23 23 0,19652174 119554 5 180 20 20 0,18 72000 4 113 11 11 0,20545455 13673 3 80 8 8 0,2 5120 2 56 6 6 0,18666667 2016 0 28 3 3 0,18666667 252 T Non- Uniform 564 15 15 0,752 126900 Table 7.2. Proposed meshes for the sensibility study. Marked in yellow are the meshes used for the simulations reported in this document. Figure 7.2. View of the meshed utilized for the turbulent simulations, the mesh is denser towards the wall of the pipe, the Bias factor utilized in the generation of the mesh is 3.117 97
  • 108.
    Table 7.3 providesinformation about the proposed simulations to be made during the study and the correspondent parameters to be extracted and analyzed in each simulation. Simuation Matrix Study Grid Model Friction factor and axial velocity profile 2,3,4,8 LaminarFriction factor study 6,7 Axial velocity, center-line pressure and centerline velocity T Turbulent Table 7.3. Simulation matrix proposed for the 2D plane channel case Steps of implementation in ANSYS Description for the laminar simulations 1. Select the components to be used in the workbench and make the corresponding connections. 2. Create the geometry. Make a sketch of a circular arc, adjust it radius and extrude the sketch to get the length of the pipe and generate. 3. Create the mesh. Select a sweep method form one symmetrical face into the other one, selecting the number of divisions to be used in the perimeter. Size the edges corresponding to the cuts in the inlet and outlet faces. Size the 3 perpendicular edges to the inlet and outlet faces, corresponding to the length of the pipe. Choose a hard or imposed criteria of sizing elements for all cases. Generate the mesh. Crate a named selection for the inlet, outlet, symmetries and wall. 4. Performing the simulation. 4.a. Set up double precision in a serial processor and lunch Fluent 4.b. Perform a Mesh Check to see the mesh has been generated all-right. Optionally perform Mesh Quality and see that the aspect ratio is lower than 50. 4.c. Check that in the general settings the Pressure-Based solver, an absolute velocity formulation and a Steady time problem. 4.d. Select in Models, a viscous laminar model to be implemented 4.e. Add in material water to the material list 98
  • 109.
    4.f. Set insurface body the element type simulation to fluid and select the material to be water 4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in velocity specification method specify “Magnitude, normal to the boundary” and set the velocity to the magnitude corresponding to each specific Reynolds number. 4.g.2. Select the boundary condition of the outlet to pressure outlet (ID 7 in ANSYS 15) and edit the outlet gauge pressure to 0. Check also that the supersonic or initial Gauge Pressure is set equal to 0 4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the wall motion equation to be an stationary wall with no slip as shear condition. Also change the operating conditions to a value of 97225.9 Pa in pressure. 4.g.4. Check that the symmetry boundary condition is set in symmetry planes (ID 14 in ANSYS 15). 4.h. Set the reference values following the inlet face values. [View the adjoin excel sheet for automatic generation.] 4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell based, the pressure to second order and the momentum to second order upwind. 4.j. Leave the solution control as default 4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity and z- velocity to 1e-6. 4.l. In initialization choose standard initialization, select the reference frame as relative to cell zone and put the gauge-pressure = 0 the x velocity equal to the inlet velocity, the y-velocity =0 and the z-velocity=0. 4.m. Initialize the simulation. 4.n. In run calculation change the number of iterations to 1000 and lunch the calculation. 5. Analysis of the results 5.1 Plot the velocity in the center-line where the two symmetry planes meet for determining the development length. For post-processing use the following criteria. Search for the percentage of the maximum velocity that betters agrees with the 99
  • 110.
    development length. Eg.If the development length should be 0.05m, search c such that c*Umax determines the velocity value in the position 0.05m. The error is the described by Error=(c−0,99)/c . 5.2. Extract as wall fluxes the skin coefficients at the superior line of the pipe. Since the pipe is symmetrical the skin factor will be the same on every line parallel to the axis of the pipe. Compute the skin friction factor after the fluid profile is developed. Description for the turbulent k-epsilon simulations We will describe only the steps that change in the simulations. 3. Create the mesh. Select a sweep method form one symmetrical face into the other one, selecting the number of divisions to be used in the perimeter, with no imposed bias factor. Size the edges corresponding to the cuts in the inlet and outlet faces, impose on them a bias factor of 3,117 directed from the walls towards the center for each edge –generating a finer mesh at the wall-. Size the 3 perpendicular edges to the inlet and outlet faces, corresponding to the length of the pipe, imposing a double Bias distribution with factor 3,117, so that the mesh is denser towards the inlet and outlet faces. Generate the mesh. Crate a named selection for the inlet, outlet, symmetries and wall. 4. Performing the simulation. 4.b. In case the check mesh states that the wall distance need to be treated for implementing the wall functions, introduce in the user interface /solve/initialize/repair- wall-distance 4.d. Select in Models, k-epsilon 2 equations. The coefficients for the model should be Cmu=0.09, C1-Epsilon=1.44, C2-Epsilon=1.92, Kinetic Pr Number = 1, Dissipative Pr Number = 1.3. The k-epsilon model should be standard and we use standard wall functions for the near-wall treatement. 4.g.1. Change the inlet boundary condition to inlet velocity (ID 6 in ANSYS 15), in velocity specification method specify “Magnitude, normal to the boundary” and set the velocity to the magnitude corresponding to each specific Reynolds number. Check also that the supersonic or initial Gauge Pressure is set equal to 0. Specify the turbulence method to intensity and length scale and set intensity in 4.2%, in accordance to I=0,16 ReDh −1 8 - , for ReDh=40000 . Set the length scale for the turbulence as l=0,038∗Dh [See appendix]. 100
  • 111.
    4.g.2. Select theboundary condition of the outlet to pressure outlet (ID 7 in ANSYS 15) and edit the outlet gauge pressure to 400 –not to have absolute pressures lower than 0 in the calculation-. For the turbulence method select k and epsilon and specify both values constant and equal to 1. 4.g.3. Select the wall boundary condition to wall (ID 5 in ANSYS 15) and edit the wall motion equation to be a stationary wall with no slip as shear condition. Set the roughness height and the roughness constant equal to 0 [See appendix]. 4.g.4. The symmetry planes boundary condition remains as symmetry (ID 19 ANSYS 15). 4.i. Set the solution method to SIMPLE. Set the gradient to Green-Gauss cell based, the pressure to second order and the momentum to second order upwind. Also set the turbulent kinetic energy solution method to ‘second order upwind’ and the turbulent dissipation rate to ‘second order upwind’. 4.k. In monitors, edit the residuals for the continuity, x velocity, y-velocity, k and epsilon to 1e-6. 4.l. In initialization choose standard initialization, select the reference frame as relative to cell zone and put the gauge-pressure = 400 the x velocity equal to the inlet velocity and the y-velocity =0. Also set the initial values of the initial turbulent kinetic energy and the initial energy dissipation rate as calculated in the excel sheet. 4.n. In run calculation change the number of iterations to 1000 and lunch the calculation. 5. Analysis of the results 5.1 Take the entrance length before the first peak in the center line velocity. 5.2. Take the friction factor the superior line after the peak of velocity. Attention: The style of mesh proposed may have several problems with the convergence of the k-epsilon equations near the axis. This is because an artificial source generated by the small discretization in this equations arriving from the artificial diffusion of this quantities produce that the error in this two quantities reaches a minimum value equal to the source of error. For improving the results, central difference schemes may be used for the k-epsilon equations or a different form of mesh with similar aspect of elements in the cross section can be tried. 101
  • 112.
    Results obtained forthe plane Channel 2D Re L Lpl us E rror Valu e*Umax Skin_Factor_Calculated 10 0 0 ,49557 5 0, 0495575 1 ,79% 0,99 9 0,162529246 50 0 2 ,51327 0, 0502654 0 ,57% 0,98 96 0,032348068 10 00 5 ,09735 0, 0509735 4 ,37% 0,96 6 0,016767741 40 000 1 ,88528 1, 3330942 7 1 ,50% 0,99 4 0,005682634 102
  • 113.
    Appendix 1. Falsediffusion errors Usually it is stated that the Central difference scheme is superior to the Upwind scheme because it is second-order accurate whereas the Upwind scheme is only first- order accurate. But when we compare the Central difference and Upwind schemes - τ is the diffusion coefficient for the problem-: τupwind=τcentralDifferences+ ρuδx 2 This added diffusion is considered bad at large Peclet numbers Pemesh= Convectiv eflux Diffusiv eflux = ρu τ /δx , where the flow is governed by convection fluxes. However, at small Peclet numbers, the actual diffusion covers for the added artificial diffusion. The artificial diffusion in the upwind discretization arrives in the direction perpendicular to the main flow. This, for the pipe flow studies, will then generate that fluid profile develops more rapidly than expected in the zone near the axe. The following Figure shows examples for the false diffusion errors for different two dimensional meshes in a fixed domain. We observe, that the phenomenon becomes less important as we increase the size of the mesh, therefore reducing the mesh Peclet number. 103
  • 114.
    Appendix 2. Frictionfactors and entrance length in a pipe The friction factor (also sometimes called the Moody friction factor) can be determined for known values of Reynolds number and ε/D from empirically derived charts and/or equations. A commonly used chart is the Moody friction factor chart. This chart helps to illustrate how the friction factor, f, depends upon Reynolds number and pipe roughness/pipe diameter (ε/D). The straight line at the upper left on the diagram represents laminar flow, in which f is independent of ε/D and depends only on Re. The portion of the chart with horizontal lines is called the completely turbulent region, in which f depends only on ε/D. For the rest of the graph, the transition region, f depends upon both Re and ε/D. The dark solid line represents "smooth pipe turbulent flow", in which f depends only on Re. There are equations available for friction factor for each of the four regions of the chart identified above as follows. For laminar flow (Re < 2100): f = 64/Re For the completely turbulent region: f = [1.14 + 2 log10(D/ε)]-2 For smooth pipe turbulent flow: f = 0.316/Re1/4 For the transition region: f = {-2 log10[(ε/D)/3.7 + 2.51/Re(f1/2 )]}-2 104
  • 115.
    This expression aregraphically shown in the Moody’s diagram depicted below. Note that the last equation requires an iterative solution to find f for given values of ε/D and Re, or "solver" can be used in the Excel spreadsheet. The entrance length can be expressed with the dimensionless Entrance Length Number expressed as El = le / d where El = Entrance Length Number le = length to fully developed velocity profile (m, ft) d = tube or duct diameter (m, ft) Entrance Length Number for Laminar Flow 105
  • 116.
    The Entrance lengthnumber correlation with the Reynolds Number for laminar flow can be expressed as: El_laminar = 0.06 Re where Re = Reynolds Number Entrance Length Number for Turbulent Flow The Entrance length number correlation with the Reynolds Number for turbulent flow can be expressed as: Elturbulent = 4.4 Re1/6 106
  • 117.
    Chapter 1. Appendix3. Main parameters of the simulations Reynold s Inlet velocity water (m/s) Inlet velocity air (m/s) Turb length scale Turbulence Intensity 100 0,001004809 0,014607347 NA NA 500 0,005024043 0,073036735 NA NA 1000 0,010048087 0,146073469 NA NA 40000 0,401923462 5,842938776 0,0076 4,25% Factor LD 0,05 Laminar 1,359 Turbulent D 0,1 m Skin_Factor 16 Laminar 0,046 Turbulent Roughness Physical Heigth 1,00E-06 Turbulent Intensity 0,10% k 8,07712E-08 u* 0,00030914 4 Non-Dimmensional Heigth 2,12E-05 Initial Conditions k 0,00043863 epsilon 0,0001986 107
  • 118.
    yplus y0 0,0025 T_wall 3,70878894 yplus9,24423963 Grid/Mes h Type Number of divisions AR # Cells Z Y X 8 Uniform 453 45 45 0,201333333 91732 5 7 319 32 32 0,199375 32665 6 6 226 23 23 0,196521739 11955 4 5 180 20 20 0,18 72000 4 113 11 11 0,205454545 13673 3 80 8 8 0,2 5120 2 56 6 6 0,186666667 2016 0 28 3 3 0,186666667 252 T Non- Uniform 564 15 15 0,752 12690 0 108
  • 119.
    Description of thenumerical solver developed in OpenFOAM Introduction In the following text we will give a complete description of the per-programed OpenFOAM solver ChtMultiRegionSimpleFOAM, analyzing its capability to solve problems concerning the coupling between hydraulics and conjugated heat transfer. We intend to present in a way as complete as possible the main facts concerning this codes in order to be able to analyze future problems in our calculations if they exist. The main objectives for the report are the following: 1. Interpret the algorithm and the classes used in the solver 2. Interpret and analyze the main physical assumptions made in the solution process of the solver 3. Evaluate the method of solution in multiple pre-selected benchmark cases 4. Compare the physics of the solver with ChtMultiRegionFoam Main structure The structure tree of the programmed solver can be regarded in chart 8.1. . ├── chtMultiRegionSimpleFoam.C ├── chtMultiRegionSimpleFoam.dep ├── fluid │ ├── compressibleContinuityErrors.H │ ├── compressibleMultiRegionCourantNo.H 109
  • 120.
    │ ├── createFluidFields.H │├── createFluidMeshes.H │ ├── EEqn.H │ ├── pEqn.H │ ├── readFluidMultiRegionSIMPLEControls.H │ ├── setRegionFluidFields.H │ ├── solveFluid.H │ └── UEqn.H ├── Make │ ├── files │ ├── linux64GccDPOpt │ └── options └── solid ├── createSolidFields.H ├── createSolidMeshes.H ├── readSolidMultiRegionSIMPLEControls.H ├── readSolidTimeControls.H ├── setRegionSolidFields.H ├── solidRegionDiffNo.C ├── solidRegionDiffNo.dep ├── solidRegionDiffNo.H ├── solidRegionDiffusionNo.H └── solveSolid.H Chart 8.1. Main structure of the solver ChtMultiRegionSimpleFoam In the solver we can find 3 different solvers. The fluid folder which have the codes concerning the read of the parameters and solving the equations for the fluid field, the solid solver which does the same for the solid and the make folder which build the list of dependencies for compiling the solver. The main actions concerning the solver are indicated in the master code chtMultiRegionSimpleFoam.C. Following we propose to analyze the main structure of this code (see Chart 8.2). // Including the base libraries #include "fvCFD.H" #include "rhoThermo.H" #include "turbulenceModel.H" #include "fixedGradientFvPatchFields.H" 110
  • 121.
    #include "regionProperties.H" #include "solidThermo.H" #include"radiationModel.H" #include "fvIOoptionList.H" #include "coordinateSystem.H" #include "fixedFluxPressureFvPatchScalarField.H" // Main part of the code int main(int argc, char *argv[]) { // Including the main libraries for setting up the case in each region #include "setRootCase.H" #include "createTime.H" regionProperties rp(runTime); #include "createFluidMeshes.H" #include "createSolidMeshes.H" #include "createFluidFields.H" #include "createSolidFields.H" #include "initContinuityErrs.H" // Solving loop while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; 111
  • 122.
    // Solving forthe fluid region forAll(fluidRegions, i) { Info<< "nSolving for fluid region " << fluidRegions[i].name() << endl; #include "setRegionFluidFields.H" #include "readFluidMultiRegionSIMPLEControls.H" #include "solveFluid.H" } // Solving for the solid region forAll(solidRegions, i) { Info<< "nSolving for solid region " << solidRegions[i].name() << endl; #include "setRegionSolidFields.H" #include "readSolidMultiRegionSIMPLEControls.H" #include "solveSolid.H" } runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "Endn" << endl; 112
  • 123.
    return 0; } // *************************************************************************// Chart 8.2. Main structure of the coupled solver structure of the solver. First we set up the basic builded-in libraries for using the CFD tools provided by OpenFOAM and its the builded-in thermophysical, radiation and turbulence models. This libraries will be analyzed in depth in the following. Then in the main part of the code, we set up the geometry of each solid and fluid region and the fields inside each one. Following, we solve during the runtime for each fluid and solid region in an independent fashion for each of them. Please notice that, the order of solution of each region is first all the fluid regions as listed in the fluidRegions Dictionary and then all the soidRegion as listed in the solidRegion Dictionary. As in this case we solve a stationary case, the order of the listed regions shouldn't affect the final result. We finally, terminate the main part of the code. Solving the fluid field Theory We proceed to analyze following the method of solution for the fluid regions. The equations describing the behavior of the field are the conservation of mass, momentum and energy (1). These read, for a given volume control, as: 113
  • 124.
    (1) The common notationhave been used for the density, velocity and internal energy respectively. The closing equations for this system consist in the modelization of the internal energy of the fluid, the stress tensor field and the superficial and volumetric heat sources. Assuming and isotropic fluid with homogeneous properties in all the field, we can define a temperature dependent specific pressure heat Cp(T), which relates the internal energy of the fluid to its temperature as: (2) In a general form the stress tensor may be divided in its component due to an external and hydrostatic pressure plus the component of pressure arriving as a direct consequence of the behavior of the fluid: (3) Assuming the Stokes hypotheses for the and defining the deformation stress tensor as we can relate the shear stresses appearing in the fluid to the rate of deformation of this one as: (4) For the superficial heat flux at the surface of a control volume -q-, we can use the hypothesis that this one arrive because of molecular diffusion. As we have assumed an isotropic homogeneous medium, we can define a temperature dependent heat 114
  • 125.
    conduction coefficient ask(T). We can therefore use Fourier hypothesis to relate the heat flux at the surface of a control volume to the gradient of temperature as: (5) Finally, the volumetric heat source may arrive as a product of the budget of radiation for a given cell in the control volume. As the radiation field implies a different type of transport that the field considered so far, this one must be solved in a separate form. The models included for the radiarion transport in the system will be discussed later on. Implementation in the code For solving the continuity and the momentum equations, in the code we use the SIMPLE Algorithm (Semi Implicit Method for Pressure Linked Equations). This algorithm is used for solving the stationary equations for an incompressible fluid field, where the continuity equation is imposed as a constrain in the solution of the pressure field. The equations to be solved in the stationary case for the fluid are read as: (6) Here an approximation is included in the last term of the second equation. Assuming that the density variations are not very big spatially we may approximate the 115
  • 126.
    density of apoint in space as . Please note that this approximation introduces a second error space approximation in the density. However as the density will be actualized in every time step this one is compensated during calculation. We finally obtained mixing the first and last term in the RHS of the second equation the following term . Defining The second equation may be discretized using the finite volume method in the following matrix equation: (7) Where u** is first prediction of the velocity. This system of equations may be easily solved for u at step n+1 by inverting matrix C, but usually an iterative procedure is preferred for solving these systems of equations. However, in a general form we can state that: (8) For imposed the restriction of continuity in the fluid, we follow the pressure implicit method proposed by the SIMPLE algorithm. We first split the matrix C in its diagonal A and it off diagonal H* (C = A+H*). Once we now the predicted velocity (Equation 8) we can state the following equation for the velocity at the next step: (9) The problem of this equation is that the next predicted pressure -p*- is yet unknown. Naming which is known from the previous predictor velocity step, we get the following equation for the next predicted velocity (10) 116
  • 127.
    By imposing thecontinuity equation for the velocity - -, we get a Poisson equation that allow us to solve the actualized pressure field. This one reads as: (11) We then iterate between equations 10 and 11 until the fields are converged. The definition of the convergence criteria is founded un the fvSolution in the system folder. It is important to notice that in this solver the temperature field is solved independently of the velocity and the pressure field. This means that we will first solve the velocity and pressure field for a fixed temperature field, then we will correct the temperature field for the calculated velocity and pressure and finally update the physical properties of the fluid for the new temperature field, closing an iteration loop. This not fully coupled nature of the solution, works fine for time stable problems, but may lead to mistaken results in time evolutive problems. This may motivate us to develop a new fully couple solver for future studies. Solving the fluid region implementation in the code Main routine As the main routine of ChtMultiRegionSimpleFoam shows, the solution for each particular fluid region is done in the following fashion. / Solving for the fluid region #include "createFluidMeshes.H" //read the fluid mesh #include "createFluidFields.H" //create the geometricFields #include "initContinuityErrs.H" //Reset the continuity errors in the code forAll(fluidRegions, i) { Info<< "nSolving for fluid region " << fluidRegions[i].name() << endl; #include "setRegionFluidFields.H" //read the actual fields and bc in each 117
  • 128.
    specific Region #include "readFluidMultiRegionSIMPLEControls.H"//Reads the fvOtions dictionary for the SIMPLE control setup #include "solveFluid.H" //Solve the coupled equations for the fluid field } We first actualize the fluid mesh, we then create the fluid fields and we initialize the continuity error counter for all fluid regions. We then, for each fluid region, set the fluid regions, we then read the fluid multi-region simple controls and finally we solve the fluid equations. We will now analyze each routine in depth. Mesh creation for each region We start from the creation of the mesh for all fluid regions. The file createFluidMesh.H reads as the following. PtrList<fvMesh> fluidRegions(fluidNames.size()); forAll(fluidNames, i) { Info<< "Create fluid mesh for region " << fluidNames[i] << " for time = " << runTime.timeName() << nl << endl; fluidRegions.set //This is the set of fluid meshes that will be included ( i, new fvMesh ( IOobject ( fluidNames[i], //The name of the mesh corresponds to the one of the region runTime.timeName(), //The mesh is created for each runTime folder runTime, Ioobject::MUST_READ //The mesh is read for every time step, allowing dynamic meshing ) ) ); 118
  • 129.
    } The function returnsa list of finite volume meshes associated to the list of fluid region names that where given to it as an input. The list of returned meshes is in correspondence to the standard fvMesh class. Creating and setting fields for each region We then set the fields for all the fluids in the domain. The file crateFluidFields.H reads as following. // Initialise fluid field pointer lists PtrList<rhoThermo> thermoFluid(fluidRegions.size()); //The properties of the fluid are defined in a rhoThermoFluid dictionary PtrList<volScalarField> rhoFluid(fluidRegions.size()); //The properties of the fluid are defined in a rhoThermoFluid dictionary PtrList<volVectorField> Ufluid(fluidRegions.size()); //Initialize the velocities of the fluid regions PtrList<surfaceScalarField> phiFluid(fluidRegions.size()); //Initialize the phase for the fluid regions PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size()); //Activate or deactivate the gravity for each fluid region PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size()); //Read the turbulent configuration each fluid region PtrList<volScalarField> p_rghFluid(fluidRegions.size()); //Read the pressure for each fluid region PtrList<volScalarField> ghFluid(fluidRegions.size()); //Determine the hydrostatic term for each specific fluid in the cell center PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); //Determine the hydrostatic term for each specific fluid cell face PtrList<radiation::radiationModel> radiation(fluidRegions.size()); //Load the radiation properties for each fluid region List<scalar> initialMassFluid(fluidRegions.size()); //Initial mass for each fluid region List<label> pRefCellFluid(fluidRegions.size(), 0); //Reference pressure for each cell – min 0 List<scalar> pRefValueFluid(fluidRegions.size(), 0.0); //Reference pressure for each region – min 0.o List<bool> frozenFlowFluid(fluidRegions.size(), false); //Available to freeze specific fluid regions PtrList<dimensionedScalar> rhoMax(fluidRegions.size()); //Max density for each fluid region PtrList<dimensionedScalar> rhoMin(fluidRegions.size()); //Min density for each fluid region 119
  • 130.
    Here we haveincluded the part of the code in witch the headers of the list for each geometric field are created. After this one, each specific Field for the geometric fluid region is created following the specific OpenFOAM format. Some remarks are that the phi and rho field are created internally by the code. The velocity, pressure, temperature and turbulent files are read from the current time directory. Once we have create the fluid regions, then we set for each region the values of the fields in it. This is done by the the file setRegionFluidFields.H. Note that this is done individually for every region, looped in the main routine. The code for this routine is included in the following box. fvMesh& mesh = fluidRegions[i]; //Read the mesh for each fluid region rhoThermo& thermo = thermoFluid[i]; //Set the rhoThermo model according to the thermoFluid option thermo.validate(args.executable(), "h", "e"); // Select the type of rhoThermo fluid used volScalarField& rho = rhoFluid[i]; // set rho as the density of each region volVectorField& U = Ufluid[i]; // set U as the velocity of each region surfaceScalarField& phi = phiFluid[i]; // set phi as the volumetric flux of each region compressible::turbulenceModel& turb = turbulence[i]; // set the turbulent model as the turbulent model for each region volScalarField& K = Kfluid[i]; // set K as the turbulent kinetic energy of each region volScalarField& dpdt = dpdtFluid[i]; // set dpdt as the temporal pressure derivative of each region volScalarField& p = thermo.p(); // set p as the pressure of each region const volScalarField& psi = thermo.psi(); // set psi as the compressibility of each region volScalarField& p_rgh = p_rghFluid[i]; // set p_rgh as the dynamic pressure of each region const volScalarField& gh = ghFluid[i]; // set gh as the hydrostatic term in the center of each cell for each fluid region const surfaceScalarField& ghf = ghfFluid[i]; // set ghf as the hydrostatic term in the faces of each cell for each fluid region radiation::radiationModel& rad = radiation[i]; // set rad as the radiation model of each region 120
  • 131.
    fv::IOoptionList& fvOptions =fluidFvOptions[i]; // read the fvOptions for each region const dimensionedScalar initialMass // determine the initial mass for each fluid region ( "initialMass", dimMass, initialMassFluid[i] ); const bool frozenFlow = frozenFlowFluid[i]; // determine if the fluid have been frozen The characteristics variables of each fluid region, are stored in generic variables for the solver. This means, the same format is used for characterizing each fluid simulation Reading of solution controls Following, the solution controls are are read for each fluid region. This means, determining the way in which the Navier Stokes and energy equations are going to be solved for each region. This is done in the code in the routine readFluidMultiRegionSIMPLEControls.H. The code is listed in the following box. const dictionary& simple = fluidRegions[i].solutionDict().subDict("SIMPLE"); const int nNonOrthCorr = simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0); In this routine the solver is set as SIMPLE (Semi-Implicit Method for Pressure- Linked Equations) and the number of non-orthogonal correctors is read in the simple solver configuration. The basic steps for the simple solver are listed below. The basic steps in the solution update are as follows -See the introduction for more information-: 1. Set the boundary conditions. 2. Compute the gradients of velocity and pressure. 121
  • 132.
    3. Solve thediscretized momentum equation to compute the intermediate velocity field . 4. Compute the uncorrected mass fluxes at faces . 5. Solve the pressure correction equation to produce cell values of the pressure correction . 6. Update the pressure field: where urf is the under- relaxation factor for pressure. 7. Update the boundary pressure corrections . 8. Correct the face mass fluxes: 9. Correct the cell velocities: ; where is the gradient of the pressure corrections, is the vector of central coefficients for the discretized linear system representing the velocity equation and Vol is the cell volume. 10.Update density due to pressure changes. Solving the equations for the fluid The standard solution that will be used in the solver is indicated in the solveFluid.H routine. The code of solution of the routine is explained below. // Pressure-velocity SIMPLE corrector { if (frozenFlow) { #include "EEqn.H" } else { p_rgh.storePrevIter(); rho.storePrevIter(); #include "UEqn.H" #include "EEqn.H" #include "pEqn.H" 122
  • 133.
    turb.correct(); } } The structure ofthe main routine is easy to explain. Is the fluid is frozen, is treated as a solid and we only solve the energy equation. Is the fluid is un-frozen we store the previous iteration dynamic pressure and density, we predict the velocity in the next step, we predict energy and the density in the next step and finally we correct the fields following the SIMPLE algorithm iterating until the pressure field satisfy the modified continuity equation -view introduction-. Following we present the equations solved and the reason for solving each one. Solving the momentum equation The average in time momentum conservation equation reads as (2) -note that here because of the compressibility nature of the medium, we assume . ( 2) Where is the gravity acceleration vector, is the turbulent stress tensor, and is the resolved or mean stress tensor due to molecular viscosity and is given by ( 3) where is the molecular viscosity. Note that we have dropped for know the bar over the velocity, assuming that all the quantities that we will be working on are averaged in time. Here we have used the Stokes hypothesis -described in the following chart- which states a linear relationship between the strain deformation tensor and the stress tensor. Note that in a more general form, for a fluid the relationship should be stated as , where is the strain deformation tensor, the residual stress in the fluid at rest and the fourth order tensor 123
  • 134.
    which states thelinear relationship. Assuming the lack of microscopic surface moments and no preferred directions in the fluid, the 81 coefficients of reduce to two linearly independent coefficients the dynamic coefficient of viscosity -shear- and the second coefficient of viscosity -dilatational-. Stokes hypothesis will simply assume that , which may cease to be valid if the frequency associated to pressure waves in the fluid is higher than the molecular relaxation time of it. This may be a problem for gases, but rarely for fluids. View -STOKES’ HYPOTHESIS FOR A NEWTONIAN, ISOTROPIC FLUID, Mohamed Gad-el-Hak, 1995- for more details. 124
  • 135.
    Stokes Hypothesis Stokes extendedNewton's idea from simple 1-D flows (where only one component of velocity is present) to multidimensional flows. He developed the following relations, collectively known as Stokes relations, which in cartesian coordinates reads as: The quantity is called molecular viscosity, and is a function of temperature. The coefficient was chosen by Stokes so that the sum of the normal stresses are zero. Then 125
  • 136.
    Introducing the definitionof the stress tensor into the Navier Stokes equation and renaming (as commonly founded in the literature, we get the following expression for the equation: The turbulent stress tensor is the well known Reynolds stress tensor -RST-. In RANS simulations it will be the 'Reynolds Stress Tensor' and in LES simulations it will be the 'Sub-Grid- Scale Reynolds Stress Tensor' (which form depends upon which method is used in the simulation and the scale of the sub-grid). The general form of the tensor is defied by the coupling of the turbulent fluctuations in the form . Therefore in DNS simulations, the RST will be a product of the simulation and no a pre-modeled input parameter. We can further split the RST into its isotropic and deviatoric part in the form: Where K is the turbulent kinetic energy of the fluid, defined as: where u,v and w are the velocities in the chosen principal axes. For developing a closure relationship for the equations a model have to be used for . There are several proposed models according to the kind of phenomena the fluid is subjected to, watch -ON EXPLICIT ALGEBRAIC STRESS MODELS FOR COMPLEX TURBULENT FLOWS, Gatski, Speziale, 1992, NASA-, -ANALYTICAL METHODS FOR THE DEVELOPMENT OF REYNOLDS STRESS CLOSURES IN TURBULENCE, Speziale, NASA- and -The determination of turbulence-model statistics from the velocity–acceleration correlation, Pope, 2014-. In this case, we will make the assumption of linear turbulent viscosity (RANS) or linear sub-grid-scale viscosity (LES). This implies that the same assumptions used for the molecular transport in the Stoke's hypothesis are used for the turbulent transport. This means that the properties of the turbulence have to be homogeneous all over the 126
  • 137.
    fluid domain andthat the is not preferred direction for the turbulent transport. This is the definition of a special case in turbulence known as homogeneous turbulence. Further more, if we assume also that the dissipation to the Kolmogrov's scale is dissipative enough so that the information of which large eddy is generating the smaller eddies is lost during the cascade process, which is generally the case, the turbulence is called isotropic. The deviatoric part of the Reynolds stress tensor then may be modeled as: The final momentum conservation equation then reads as: where we have defined . Please note that by assuming homogeneous turbulent, the turbulent diffusion is acting in all directions as molecular diffusion. Therefore, in this situation, the difference of a quantity transported by molecular diffusion or by turbulent diffusion is indistinguishable. There is one further observation that is necessary to make. As observed by -Freziger-, introducing a source term of momentum directly in the momentum equations may result in check-board oscillations. For stabilizing the method, OpenFOAM introduces an option called fvOptions. This option introduces and external source or constrain in the form of faces fluxes, avoiding check mesh oscillations. However, we re-chose in this case to change the momentum equation observing that: 127
  • 138.
    Therefore, in thisformulation the flux of the magnitude can be computed in the cell faces and then then interpolated back to the center of the cells for performing the gradients. Recasting , the final Navier Stokes equations read as: Following we present the coding of the momentum 'U' equation in the solver. // Solve the Momentum equation tmp<fvVectorMatrix> UEqn ( fvm::div(phi, U) //Convection Term + turb.divDevRhoReff(U) //Turbulence introduced through an external class taking U as input == fvOptions(rho, U) //For introducing an external momentum source or internal constrain ); Ueqn().relax(); //Include the relaxation factors in the initial discretization of U fvOptions.constrain(UEqn()); //Include the constrains into the discretized U system solve ( UEqn() == fvc::reconstruct //reconstruct a volumetric field from discretized face fluxes ( ( - ghf*fvc::snGrad(rho) //Including the buoyant force in the RHS of the LSE - fvc::snGrad(p_rgh) //Including the gradient pressure form the RHS of the LSE )*mesh.magSf() ) ); fvOptions.correct(U); //apply a correction on a field usually different from the field used to generate the source We note than the non-liniear convection term is linearized in the form where and is computed in the start of the solver a left constant during the 128
  • 139.
    iterations made whensolving the momentum equation. This linearizion of the convection term is a common practice in CFD. The mathematics implicated in the way in which the buoyant and pressure gradient terms are introduced it is worth expending some time of explanation. The code introducing the finite volume options in the following: tmp<GeometricField<GradType, fvPatchField, volMesh> > treconField //treconField is donating the output ( new GeometricField<GradType, fvPatchField, volMesh> ( IOobject ( "volIntegrate("+ssf.name()+')', ssf.instance(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), inv(surfaceSum(SfHat*mesh.Sf()))&surfaceSum(SfHat*ssf), zeroGradientFvPatchField<GradType>::typeName ) ); In this case the input argument ssf which will be passed is the velocity buoyant body force and the pressure gradient force. This arguments will be transformed according to the Weller's tensorial relationship into the following form: Please note that in this expression is the flux of a quantity over the boundary of the finite volume cell. In the present case quantity represents the external volume force introduced by the pressure gradient or by the buoyancy force. Also, which is the value of this quantities at the center of the cell is performed in a fashion so that the total volume flux of the quantity through the boundary of the cell is conserved. In this case, conserving the total force excreted in the cell. 129
  • 140.
    Solving the energyequation In differential form, the conservation of energy equation reads as: The LHS term is the material derivative of the volumetric energy of the fluid . The first term in the RHS of the equation corresponds to the work done by the pressure term, the second to the work done by the stress term and corresponds to the heat fluxes in the faces of the cells due to molecular diffusion and due to turbulent mixture . Finally S correspond to an external volumetric heat source to be added into the domain. The turbulent heat flux comes as a consequence of the non-zero average time coupling of the fluctuations in energy and in velocity. This one can be written in the form: The first term in the RHS correspond to the time average of the average energy transported by the fluctuations of velocity, the second term is the average in time of the fluctuations in energy transported by the average velocity and the final term correspond to the convective transport induced by the coupling of fluctuations in energy and velocity. In this case we chose to split the specific internal energy into specific thermal internal energy and specific kinetic energy , in the form . Under constant pressure conditions, for the dilatating liquid, the internal thermal energy can be expressed as the product of the constant pressure heat capacity and the temperature: For modeling the heat flux per unit mass due to molecular diffusion, we use Fourier law in the form: Where . In a similar form, by assuming the validity of turbulent Boussinesq assumption and by assuming the universal convection – diffusion gradient turbulent hypothesis [view Pope, Turbulence, 2004] we can model the turbulent heat flux in the form: 130
  • 141.
    Defining , weget that the effective heat flux can be defined as . In our simulations, the Birkman nuber (heat generated by viscous heating over heat conducted by the fluid) is usually very small, therefore is a common practice to neglect viscous heating in the fluid [Ferziger, Computational Fluid Dynamics, 2008]. Taking this into consideration, the final energy conservation equation will read as: Defining the enthalpy as and taking into account the incompressibility of the fluid, the above equation can be recasted into enthalpy terms in the form The energy equation is programmed in an hybrid format, in which the internal energy or the enthalpy is modeled depending on the rhoThermoFluid model selected for the fluid as an input. For example, if a constant enthalpy model is selected for the fluid, then the energy equation will be solved in enthalpy terms. The SIMPLE algorithms search for a stationary solution, therefore the derivatives with respect to time are equal to zero. The following box provides the commented code for the energy equation. 131
  • 142.
    { volScalarField& he =thermo.he(); // Reading the thermoFluid model fvScalarMatrix EEqn // Energy Equation ( fvm::div(phi, he) // Convective term + ( he.name() == "e" // Selection between internal energy or enthalpy model ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) // Internal energy : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) // Enthalpy ) - fvm::laplacian(turb.alphaEff(), he) // turb.alphaEff calculated externally, reads the velocity == rad.Sh(thermo) // Radiation introduced as heat source + fvOptions(rho, he) // Including an external source as fvOptions ); EEqn.relax(); // Relaxation of the energy equation matrix fvOptions.constrain(EEqn); // Imposition of the constrains in the matrix Eeqn.solve(); // Solution of the system of equations fvOptions.correct(he); // Correction of the constrains imposed thermo.correct(); // Actualization of the physical properties of the fluid rad.correct(); // Actualization of the radiation sources and medium Info<< "Min/max T:" << min(thermo.T()).value() << ' ' << max(thermo.T()).value() << endl; } We observe that the relaxation of the system of equations is done intermediately after the equations are defined. At the final steps the density, heat capacity and radiation properties of the fluid are updated according to the new internal energy field. Solving for the continuity equations As mention in the introduction the continuity equation is included into the fluid as a laplacian equation for the pressure field. The equation for the pressure field read as: A rigorous demonstration of the SIMPLE corrector was given in the introduction. Here we will just limit the explanation to understand the steps implemented in the code 132
  • 143.
    which are inaccordance to the previously explained. For doing this we provide the comments while describing the code in the following box. { rho = thermo.rho(); // Relaxation of the energy equation matrix rho = max(rho, rhoMin[i]); // Setting as rhoMin the values of rho below rhoMin rho = min(rho, rhoMax[i]); // Setting as rhoMax the values of rho above rhoMax rho.relax(); // Computing the density according to the relaxation parameters volScalarField rAU("rAU", 1.0/Ueqn().A()); // surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); // volVectorField HbyA("HbyA", U); // HbyA = rAU*UEqn().H(); // Ueqn.clear(); // Clearing the results of UEqn surfaceScalarField phig(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); // surfaceScalarField phiHbyA ( "phiHbyA", (fvc::interpolate(rho*HbyA) & mesh.Sf()) // ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); // Perform the density in the surfaces for introducing later constrains bool closedVolume = adjustPhi(phiHbyA, U, p_rgh); // Boolean option with adjust the mass fluxes at the fixed Pressure boundaries for conserving the mass of the system phiHbyA += phig; // // Update the fixedFluxPressure BCs to ensure flux consistency setSnGrad<fixedFluxPressureFvPatchScalarField> ( 133
  • 144.
    p_rgh.boundaryField(), // Adjustingthe pressure in the fixed flux boundary fields ( phiHbyA.boundaryField() - fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField()) *rho.boundaryField() )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) // ); dimensionedScalar compressibility = fvc::domainIntegrate(psi); // Define the compressibility as the integral over the domain of the fluid, in case it is not constant bool compressible = (compressibility.value() > SMALL); //Determine if the compressibility value is bigger than small for trating the fluid as compressible // Solve pressure for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix p_rghEqn ( fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA) // ); p_rghEqn.setReference //Set a reference pressure for not getting a singular system ( pRefCell, // If it is not compressible, the reference pressure is read compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue // If compressible, the reference pressure is defined internally as the calculated pressure of the cell and in the boundaries as the reference pressure ); p_rghEqn.solve(); // Solve the system of equations if (nonOrth == nNonOrthCorr) // For the last step of the corrector { 134
  • 145.
    // Calculate theconservative fluxes phi = phiHbyA – p_rghEqn.flux(); // // Explicitly relax pressure for momentum corrector p_rgh.relax(); // Introduce the relaxation factors in the pressure for the next step in the corrector // Compute the velocity U = HbyA + rAU*fvc::reconstruct((phig – p_rghEqn.flux())/rhorAUf); // U.correctBoundaryConditions(); // Actualize the boundary conditions for the velocity fvOptions.correct(U); // Actualize the constrains for the velocity field } } p = p_rgh + rho*gh; / /Calculate the final pressure #include "continuityErrs.H" / /Compute the continuity errors // For closed-volume and compressible cases adjust the pressure level to obey overall mass continuity if (closedVolume && compressible) { p += (initialMass - fvc::domainIntegrate(thermo.rho())) /compressibility; // Perform the correction in the pressure for conserving the mass p_rgh = p – rho*gh; // Performing p_rgh } // Checking the new limits of the density after the overall pressure correction rho = thermo.rho(); rho = max(rho, rhoMin[i]); 135
  • 146.
    rho = min(rho,rhoMax[i]); rho.relax(); Info<< "Min/max rho:" << min(rho).value() << ' ' << max(rho).value() << endl; } The main structure of the corrector process begins by computing the quantities to be needed for solving the Poisson equation for pressure. Then it correct the mass flux in the fixed pressure boundaries and the pressure in the fixed flux boundaries to the actualize parameter. After this, the solution process begin. First for every non-orthogonal corrector step, the coefficients of the equation are redefined to the actualize values of density at the cell faces and the actualize values of pressure at the boundary cell faces. Then we set the reference pressure for the solution of the system (this will impose a Dirichlet condition in at least 1 cell for the LSE to be determined). Following we proceed to the solution of the system of equations. Here the properties of the solution class are inherit by the equation, being this properties defined in the fvSolution dictionary for each fluid region. In case we arrive to the final steps of the non-orthogonal correction process, we compute the volumetric fluxes at the cell boundaries and the velocity as stated by the SIMPLE algorithm. Finally, in case the fluid is compressible, we correct manually the overall pressure of the system to maintain the overall mass of it. This is done by adding or subtracting to each cell the amount of necessary pressure for keeping the total mass of the system constant. Following the dynamic pressure is computed from the corrected pressure value for each cell and the density of each cell is re-performed and checked to be within the specified limits. 136
  • 147.
    Solving the solidregion Main routine As the main routine of ChtMultiRegionSimpleFoam shows, the solution for each particular solid region is done in the following fashion. //Create the solid mesh and the solid fields #include "createSolidMeshes.H" #include "createSolidFields.H" //Solving according to the controlDict while (runTime.loop()) { ... //Solving for every solid region forAll(solidRegions, i) { Info<< "nSolving for solid region " << solidRegions[i].name() << endl; #include "setRegionSolidFields.H" #include "readSolidMultiRegionSIMPLEControls.H" #include "solveSolid.H" } ... } First we first actualize the solid mesh, then we create the solid fields and we initialize the continuity error counter for all solid regions. We then, for each solid region, set the values of the fields in the solid region, we then read the solid multi-region simple controls and finally we solve the solid equations. We will now analyze each routine in depth. 137
  • 148.
    Mesh creation foreach region We start from the creation of the mesh for all solid regions. The file createsolidMesh.H reads as the following. PtrList<fvMesh> solidRegions(solidNames.size()); forAll(solidNames, i) { Info<< "Create solid mesh for region " << solidNames[i] << " for time = " << runTime.timeName() << nl << endl; solidRegions.set //This is the set of solid meshes that will be included ( i, new fvMesh ( IOobject ( solidNames[i], //The name of the mesh corresponds to the one of the region runTime.timeName(), //The mesh is created for each runTime folder runTime, Ioobject::MUST_READ //The mesh is read for every time step, allowing dynamic meshing ) ) ); } The function returns a list of finite volume meshes associated to the list of solid region names that where given to it as an input. The list of returned meshes is in correspondence to the standard fvMesh class. Each solid mesh is treated independently as defined by the definition of the solid regions. 138
  • 149.
    Creating and settingfields for each region We then set the fields for all the solids in the domain. The file cratesolidFields.H reads as following. // Initialise solid field pointer lists PtrList<coordinateSystem> coordinates(solidRegions.size()); //Define Basic coordinate system for solving in each PtrList<solidThermo> thermos(solidRegions.size()); //The properties of the solid are defined in a themroPhysicalProperties dictionary PtrList<radiation::radiationModel> radiations(solidRegions.size()); //Class containing the radiation models for each solid region PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size()); //Class containing the heat sources presented in the fluid, they are read from the fvOptions dictionary PtrList<volScalarField> betavSolid(solidRegions.size()); // Correction factor for rapid difussion of heat in the solid region PtrList<volSymmTensorField> aniAlphas(solidRegions.size()); //Class containing the definitions of the alphas for each solid region: alpha=kappa/Cp Here we have included the part of the code in witch the headers of the list for each geometric field are created. After this one, each specific Field for the geometric solid region is created following the specific OpenFOAM format. The alpha field is created by the code and the temperature, and radiation properties for the solid are read from the current time directory. Once we have create the solid regions, then we set for each region the values of the fields in it. This is done by the the file setRegionsolidFields.H. Note that this is done individually for every region, looped in the main routine. The code for this routine is included in the following box. fvMesh& mesh = solidRegions[i]; //Setting the mesh solidThermo& thermo = thermos[i]; //Setting the thermophysical properties directory const radiation::radiationModel& radiation = radiations[i]; //Setting the radiation model directory 139
  • 150.
    tmp<volScalarField> trho =thermo.rho(); //Setting trho as the read density const volScalarField& rho = trho(); //Setting rho as the read density tmp<volScalarField> tcp = thermo.Cp(); //Setting tcp as the read specific heat const volScalarField& cp = tcp(); //Setting cp as the read specific heat tmp<volSymmTensorField> taniAlpha; //Setting tanialpha for the case the solid is not isotropic, previously it was defined for the isotropic case when creating the flieds if (!thermo.isotropic()) { volSymmTensorField& aniAlpha = aniAlphas[i]; //Anysotropic field tmp<volVectorField> tkappaByCp = thermo.Kappa()/cp; //aniAlpha = Kappa/Cp const coordinateSystem& coodSys = coordinates[i]; //Setting the local coordinate system for the tensor aniAlpha.internalField() = coodSys.R().transformVector(tkappaByCp()); aniAlpha.correctBoundaryConditions(); //Setting the tenor in the direction of the local coordinates system taniAlpha = tmp<volSymmTensorField> ( new volSymmTensorField(aniAlpha) //Setting anialpha from tanialpha ); } volScalarField& h = thermo.he(); //Setting the enthalpy of the solid const volScalarField& betav = betavSolid[i]; //Setting the beta field of the solid fv::IOoptionList& fvOptions = solidHeatSources[i]; //Setting the fvOption list The characteristics variables of each solid region, are stored in generic variables for the solver. This means, the same format is used for characterizing each solid 140
  • 151.
    simulation. This bringsthe possibility of programing a generic solver for the solids regions. Reading of solution controls Following, the solution controls are are read for each solid region. This means, determining the way in which the Navier Stokes and energy equations are going to be solved for each region. This is done in the code in the routine readsolidMultiRegionSIMPLEControls.H. The code is listed in the following box. const dictionary& simple = solidRegions[i].solutionDict().subDict("SIMPLE"); const int nNonOrthCorr = simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0); In this routine the solver is set as SIMPLE and the number of non-orthogonal correctors is read in the simple solver configuration. For solving in a solid domain, the methodology simply consist in solving the heat diffusion equation, performing the correction of the fluxes in the cell face and iterating. Solving the equations for the solid For the solid domain it will be solved the equation of conservation of energy. In differential form, the conservation of energy equation for a solid reads as: First of all, note that for the solid the enthalpy and the internal energy attain the same value, as we consider it to be not expansible. The LHS term is the rate of change of the internal energy in the solid . The first term in the RHS corresponds to the heat flux in the faces of the cells due to molecular diffusion. Finally S correspond to an external volumetric heat source to be added into the domain. 141
  • 152.
    For modeling theheat flux per unit mass due to molecular diffusion, we use Fourier 'slaw. In case the solid medium is isotropic, its conductivity is the same in all directions and Fourier's law can be written as: Where . In case the solid is anisotropic, a specific variant coordinate system can be defined for the solid region in which the conductivity properties of the solid are measured in each direction. In this case, alpha can be defined as a second order tensor relating the heat flux and and the enthalpy gradients. The relation reads as following: Where . With the exception of very particular cases, the tensor is usually symetric [Incropera]. Taking this aspects into consideration, the final equation of conservation of energy for the in a general form reads as: The alpha tensor reduce to a constant diagonal one in case the solid is isotropic. In this case, for the solution by the solid SIMPLE algorithm, we will search the stationary temperature field in the solid. Therefore, the derivatives with respect to time are set equal to zero. 142
  • 153.
    The standard solutionthat will be used in the solver is indicated in the solvesolid.H routine. The code of solution of the routine is explained below. { for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) //Iterating in the number of non-othogonal correctors { fvScalarMatrix hEqn //Definition of the conservation of energy equation ( ( thermo.isotropic() //Solving the diffusion laplacian term of temperature ? -fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") //isotropic case : -fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)") //anisotropic case ) == fvOptions(rho, h) //Including of external heat sources and constrains ); hEqn.relax(); //Introducing the relaxation factors in the matrix fvOptions.constrain(hEqn); //Adding the constrains to the system of equations hEqn.solve(); //Solving the equation according to the parameters in fvSolution for each solid region directory fvOptions.correct(h); // Introducing the corrections due to the constrains } } thermo.correct(); //Actualizing the thermophysical properties 143
  • 154.
    The structure ofthe main routine is easy to explain. First, we define the coefficients of the LSE for every non orthogonal corrector time step. Then, we introduce the relaxation factors in the discretization matrix and we solve the LSE. We then iterate as the number of non-orthogonal correctors we have indicated. (We are missing the radiation modifications and the turbulent models implemented). 144
  • 155.
    References [1] O. Benešand R.J.M. Konings, 4 - Thermodynamic Calculations of Molten- Salt Reactor Fuel Systems, In Molten Salts Chemistry, edited by Frédéric LantelmeHenri Groult, Elsevier, Oxford, 2013, Pages 49-78, ISBN 9780123985385 [2] M. Salanne, C. Simon, P. Turq, N. Ohtori and P.A. Madden, 1 - Modeling of Molten Salts, In Molten Salts Chemistry, edited by Frédéric LantelmeHenri Groult, Elsevier, Oxford, 2013, Pages 1-16, ISBN 9780123985385 [3] Rollet, A.-L., Bessada, C., Auger, Y., Melin, P., Gailhanou, M., Thiaudie`re, D. (2004). A new cell for high temperature EXAFS measurements in molten rare earth fluorides. Nucl. Instrum. Methods Phys. Res. B, 226, 447–452. [4] Bessada, C., Rakhmatullin, A., Rollet, A.-L., Zanghi, D. (2007). Lanthanide and actinide speciation in molten fluorides: a structural approach by NMR and EXAFS spectroscopies. J. Nucl. Mater., 360, 43–48. [5] Rollet, A.-L., Sarou-Kanian, V., Bessada, C. (2009). Measuring self-diffusion coefficients up to 1500 K: a powerful tool to investigate the dynamics and the local structure of inorganic melts. Inorg. Chem., 48, 10972–10975. [6] Benes, O., Zeller, P., Salanne, M., Konings, R.J.M. (2009). Density functional theory, molecular dynamics, and differential scanning calorimetry study of the RbF-CsF phase diagram. J. Chem. Phys., 130, 134716. [7] Benes, O., Konings, R.J.M. (2009). Thermodynamic properties and phase diagrams of fluoride salts for nuclear applications. J. Fluorine Chem., 130, 22– 29. [8] Robelin, C., Chartrand, P. (2013). Thermodynamic evaluation and optimization of the (NaF þ AlF3 þ CaF2 þ BeF2 þ Al2O3 þ BeO) system. J. Chem. Thermodyn., 57, 387–403. [9] El Ghallali, H., Groult, H., Barhoun, A., Draoui, K., Krulic, D., Lantelme, F. (2009). Electrochemical synthesis of Ni-Sn alloys in molten LiCl-KCl. Electrochim. Acta, 54, 3152–3160. [10] Taxil, P., Massot, L., Nourry, C., Gibilaro, M., Chamelot, P., Cassayre, L. (2009). Lanthanides extraction processes in molten fluoride media: 145
  • 156.
    application to nuclearspent fuel reprocessing. J. Fluorine Chem., 130, 94–101. [11] http://www.openfoam.com/ [12] Maaike van der Tempel, A chtMultiRegionSimpleFoam Tutorial, Chalmers University of Technology, 2012 [13] Chapter 5 / Forced Convection: Internal Flows /Adrian BEJAN / Department of Mechanical Engineering and Materials Science, Duke University, Durham, Nort Carolina [14] Turbulence modeling for beginners / Tony SAAD / University of Tennessee Space Institute [15] Pressure Drop in Laminar Developing Flow in Noncircular Ducts: A Scaling and Modeling Approach / Y.S Muzychka, M.M Yovanovich / Journals of Fluids Engineering, November 2009 [16] Forced Turbulent Heat Convection in a Rectangular Duct with Non-Uniform Wall Temperature/ G.A Rivas, E.C Garcia and M. Assato/ INTECH 2012 [17] Heat Transfer and Friction in Turbulent Pipe Flow with Variable Physical Properties / B.S Petukhov/ High Temperature Institute, Academy of Science of the USSR,Moscov,USSR [18] Conjugate heat transfer study of backward-facing step flow –A benchmark problem /P. Rajesh Kanna, Manab Kumar Das/ International Journal of Heat and Mass Transfer/ 2006. 146