The TransAT User Manual is a self-sufficient document that provides step-by-step instructions on how
to interact with TransAT software, in particular how to setup the simulation, create a grid, setup
boundary and initial conditions. It also provides insights on how to execute a simulation and
postprocess its output. Furthermore, user defined functions, run time intervention and run quality
analysis tools are briefly described herein.
In this chapter the basic steps required to run a simulation using TransAT will be very briefly outlined.
The following chapters will then explore these steps in further detail, including descriptions of input
parameters, etc.
1.1 Basic Steps
Start the TransAT user interface TransATUI from the terminal with the follwing command:
transatui.py
Click to create a new project, then click to select the folder where the project files will be
stored or create a new project folder by clicking and specifying its name. Set the ProjectName field with the name of the project, e.g. myproject then click to save the
project.
Please note: It is highly recommended to create a new project folder for each project, as some
files will always have the same name. (Starting TransAT GUI)
Objects: In the Geo tab, create an object or import a CAD file. (Objects)
Grid generation: In the Mesh & BCs Set the mesh properties and boundary conditions. (Grid
Generation)
Physical and numerical parameters: Use the Input tab and navigate inside it to define physical
models, phase properties, simulation parameters, initial conditions and the simulation outputs.
(Simulation Parameters)
Create the project files: Use the Files menu in the top left corner of the TransATUI window to
create the output files containing the mesh properties and the simulation parameters by clicking
Prepare Simulation Files. This menu can be used to save the project as well by clicking Save. The
preparation of simulation files is also available from the Execute tab. (Preparing the Simulation
Files)
Initial conditions: For setting basic initial conditions use the sub-tab Initial Conditions in the
main-tab Input. In order to use advanced initial conditions create a file called initialconditions.cxx
(e.g. two–phase flow, where the interface between the two fluids has to be specified) and create the
initial conditions by using the dedicated button in the Initial Conditions tab (Advanced Initial
Conditions)
Run TransAT in the Execute tab. Residuals and other run-time indicators are directly available in
TransAT. Post-processing of two- or three-dimensional data can be done using software packages
such as Tecplot or freely available Paraview (www.paraview.org). (Execution and Post
processing)
1.2 Starting TransAT
TransAT always uses the same names for input files and creates a folder RESULT for the outputs. It is
therefore recommended to create a dedicated folder when starting a new simulation.
To create a new project and run TransAT, launch the TransAT user interface TransATUI by
executing the following command in the terminal
transatui.py
A description of the available TransAT commands can be found in the Command Line Options
chapter.
Click to create a new project
Click to select the folder where the project will be saved
To create a new project folder,
Use the browser to go to the desired parent folder then click in the top right corner
of the window
In the window that popped up, enter a project folder name, say myproject, then click
Click to close the browser
Set Project Name to define the name for the project file, e.g. myproject, then click
The simulation files (grid, boundary conditions,...) will automatically be assigned the given project
name when they will be saved later on. Note that the extension of TransAT project files is
.stt.
For more information about the creation of projects or files handling, refer to the Project Management
chapter.
1.3 Objects
Create Shape Simple shapes can be created in the Create Shape sub-tab. Also, CAD files can be
loaded using . The geometry files must be in either STL or GTS format. Please note: the CAD files must describe volumes (i.e. closed surfaces where an interior and an
exterior can be defined).
Database Different objects from applications ranging from aerodynamics to nuclear engineering can
be found in the Database subtab. An object from the database can be loaded in TransAT by selecting
the said object in the database and clicking .
Objects In the Objects sub-tab, properties of the object can be adjusted. To do so,
click the object in the browser window on the left side. An existing object in the Objects
sub-tab can be transformed (rotated, translated or rescaled). As well, CAD files can be
loaded directly into the mesh using . The geometry files must be in either STL or GTS
format. Please note: the CAD files must describe volumes (i.e. closed surfaces where an interior and an
exterior can be defined).
1.4 Grid Generation
The domain is defined and the mesh is created in the Mesh & BCs tab. In the Mesh &BCs tab at the top of the GUI, several sub-tabs can be selected to set the grid parameters.
Domain & Grid In the Domain & Grid sub-tab the limits of the computational domain along
with the number of cells in the mesh and refinement zones are defined. To define refinement zones, check
the Customized Refinement check-box, then set the parameters.
Blocks In the Blocks sub-tab, the domain can be split into several blocks. This allows for parallel
computation and speeds up the process, and allows to define more complex domains.
BCs The boundary conditions are specified in BCs sub-tab.
For more information about mesh generation using TransATUI, please read the Chapter Grid
Generation.
1.5 Simulation Parameters
The simulation parameters are defined in the Input tab at the top of the GUI. In the Input tab, the physical properties of the flow to be simulated, as well as the numerical
parameters of the simulation are set.
For more information about the Input tab, the reader is referred to the chapter Physics and Numerics
Inputs.
1.6 Preparing the Simulation Files
To save a project,
Click Files in the top left corner of the TransATUI window then select Save.
Saving the project stores the current status of the user interface. This does not require much space and is
fast. In order to run a simulation from this state, the solver needs additional data files, which are also
generated by the user interface. To do so,
Click Files then select Prepare Simulation Files.
The Prepare Simulation Files option creates the necessary data files (grid, boundary conditions,...)
to run a simulation, which require more disk space, depending on the size of the domain.
For more information about the files needed by the solver, please refer to the Project Management
chapter.
1.7 Initial conditions
Initial conditions can be set:
through the Initial Conditions sub-tab to set:
constant initial fields
automatic initial fields (divergence-free initial velocity field; only for incompressible
flows)
initial pressure field based on the source terms (only for incompressible flows)
through an xml file(initialconditions.xml) edited by the user (this option is particularly useful to
define shapes with the Level-Set method)
through a C++ routine (initialconditions.cxx) for complex problems (e.g. inflow velocity with a
profile that is not readily available in TransAT, complex initial quantity distributions,
...)
For the initial velocity field, the default behaviour is to make it divergence-free if the fluids are
incompressible. The default initial pressure field is based on the source terms if the fluids are
incompressible.
To specify basic interface shapes at the initial state with Level-Set method,
Edit the Level-Set node of initialconditions.xml generated by TransATUI to initialise the
interface between the two fluids. Samples of xml initial conditions files initialising interfaces
are available in <TransAT_Installation_folder>/transatMB/input/initialconditions_templates
and can be used as templates to set this kind of initial conditions.
To specify problem-specific initial conditions,
Copy the C++ initial conditions template file initialconditions.cxx from the folder
transatMB/input to the new project folder, e.g. myproject
Edit the C++ template file to set the initial conditions for variables that are being solved
for (e.g. u, v, w, p, T, Level Set function ϕ, etc..)
Click Input at the top of the GUI, then Initial Conditions on the side.
Activate by checking Advanced Initial Conditions
Click to check the compilation of the file (optional).
Continue the setup of the simulation.
Once in the Exectue window, click to initialise the variables in the domain.
An output file in the format specified in the Input tab will be written in the folder RESULT. This
can be viewed using visualisation software and then verified to be valid before proceeding with the
simulation. (For more details: see Chapter Running a Simulation)
1.8 Execution and Post processing
In the Execute tab, click to launch the simulation
Residuals and run-time data can be visualized in real time in the Residuals section on the right-hand side.
The full 2D or 3D results can be viewed using software such as Tecplot or Paraview (www.paraview.org);
results can be found in the RESULT folder.
Project management is performed from the opening window of the TransATUI (Fig. 2.1) or by using
the options offered by the Files button.
In the opening TransAT window projects can be created and loaded. Files provides the same options
with the addition of the possibility to create the files that are needed to run the TransAT
solver.
2.1 Creating a Project
After starting TransATUI,
Click to create a new project. In the next window, select the folder where the project
files will be stored and click .
Set the Project Name field with the name of the project, e.g. myproject then click to
save the project.
If the Project Name field is not modified before clicking , the default project name newproject will be
used.
After clicking , the Mesh & BCs tab will be opened and several tabs will be accessible. To make
the simulation ready to run, the simulation files (also called setup files) need to be created. To do
so,
Click the Files button in the top left corner then select Prepare Simulation Files.
2.2 Saving and Loading a Project
Once modifications have been made to a project, they can be saved for future use by clicking Files then
selecting Save.
This will not change the simulation files. They need to be re-generated if changes are done in the Mesh& BCs tab. To do so,
Click Files then select Prepare Simulation Files.
A project can also be renamed by clicking Files then selecting Save As.
Please note: The input file transat_mb.inp and the material property file properties.dat, as well as some
grid-related files, will always have the same names, independently from the project name. It is therefore
recommended to have only one project in a folder everytime.
To load an existing project,
Click Files then select Open Project.
If the simulation files were not generated, it will not be possible to run the simulation directly. The
simulation files need to be created in the project folder by clicking Files then selecting PrepareSimulation Files.
2.3 Solver Output Files Management
Before running a simulation, the simulation files must be created for the TransAT solver. The list of
simulation files includes:
the corner grid file (extension: .grda), where the cell properties are stored.
the boundary conditions file (extension: .bc), where all the boundary conditions are defined.
the input file (transat_mb.inp), which includes all the numerical parameters as well as the
physical models used for the simulation.
the initial conditions file (initialconditions.xml), which includes the parameters that are set
in the Initial Conditions tab.
If a CAD file is used to define a geometry inside the mesh domain, an extra file, which is created
automatically, is needed to run the simulation:
a solid properties file (properties.dat), where different solid related properties are defined for
each solid in the domain.
In case of coupling TransAT with another software, the Coupling properties file Coupling_parameters.cfg is
also written.
A visualisation file is written at the same time as the other simulation files. Its format depends on the
visualization software (i.e. either Paraview or Tecplot) chosen in the Output Management sub-tab in
the Input tab. Its name is automatically set.
This visualization file is particulary useful to verify the geometry and the simulation domain before
running a simulation.
The simulation files can be saved at any time when preparing a simulation, by clicking Files then
selecting Save or Prepare Simulation Files.
Please note: All the files are saved in the Project Folder, where the stt file has been saved.
2.4 Recovering Input Files
When running a simulation (See Chapter Running a Simulation), a reference file named transat_mb.out
is created, saving all input options in the RESULT folder.
Chapter 3 Grid Generation
Only cartesian meshes can be created using TransATUI. The Mesh & BCs tab gives access to the grid
generation modules. There are four tabs on the left-hand side, where all the grid properties can be
set.
Geometries in either STL or GTS format can be read by TransAT to generate a 3D mesh with
refinements. In TransAT, the meshes are structured per block. The TransAT mesher can
be used to generate multi–block meshes, with or without Block-based Mesh Refinement
(BMR).
Figure 3.1 shows the tab for grid generation, which contains a preview of the mesh on the right side.
Figure 3.1: Mesh tab
3.1 3D Viewer
The 3D graphics viewer on the right shows the mesh and the surfaces either in a 3D perspective or in
2D planes, adjustable by the user.
The view icons at the bottom left corner of the visualisation panel offer the options to choose between
the 3D view and 2D slices in the x-, y- or z-plane.
To reset the view, click in the bottom left of the window. This will return the mesh to the default
view in the current perspective or plane selected. This is useful especially if the mesh is away or outside
of the current viewing space. Or, if the mesh is zoomed in or out, the reset view will return the entire
mesh within the viewing space.
In 2D view mode, when Cut is activated, the intersection between the grid plane and objects is shown
in red.
Note that the Cut option is available only in 2D view mode and is displayed after clicking
in the top left corner of the visualisation panel. Once Cut is activated, the grid plane
can be changed by using the scroller at the top right corner of the graphical view window.
Other view buttons are also available in the top left corner of the visualization pane by clicking
to show or hide them. An image of the mesh can be exported in either JPG or TIFF formats by clicking
.
By clicking in the top left corner, the mesh will be reset. This can be used to reset the current
domain bounds, reset and remove extra blocks and to reset the mesh around CAD objects. For example,
if an object was loaded into the mesh, but the object is not shown, clicking in the top left will
rebound the domain around the object.
3.2 Create a geometry
TransAT provides a small geometry module to create simple geometries, that can be used afterwards as
solid objects in the setup of the simulation to be run.
3.2.1 Creating a geometry
The geometry creation modules is accessible by clicking Geo at the top of the TransAT
window.
The Geo module has three tabs where geometries can be created and modified:
The Create Shape tab enables the user to create simple geometries.
Database enables one to load pre-existing geometries in TransATUI.
Objects is used for modifying the properties of objects and enables one to load a geometry
file that has been already created. Objects can also be transformed in this tab.
Several shapes can be used to create geometries with TransAT. The shapes of the objects to be
created are selected in the drop-down list below the list of objects (dark grey area). The following
shapes can be chosen:
Cube
Cylinder or cylinder array
Cone
Pipe or pipe array
Sphere
Plate
Bend
T-Junction
A specific name can be given to the geometry to be created by filling in the text field below the
shape-selection drop-down list. The geometry is created after clicking . Once the shape is created it is sent directly to the mesh. The Objects tab can be used to transform
objects and modify the properties.
3.2.2 Load a geometry from the TransAT database
To load objects from the TransAT database of objects
Click Database
Open a folder and select an object to be imported in the list GTS Object Library
Click to import the objects
the object is sent directly into the mesh
3.2.3 Load a geometry from an external source
GTS and STL files can be loaded in the Geo tab. To load a geometry created with an external
software
Click
Select the geometry (.gts or .stl file) to be loaded with the file browser that popped up then
click
The object is loaded directly into the mesh.
In the Objects sub-tab some transformations can be applied, and properties can be defined for the
Objects.
3.2.4 Object operations
Once a geometry has been loaded to the mesh, simple geometric operations can be applied to it:
Rotation, Translation and Rescaling.
To apply geometric operations to a geometry
Click the Objects tab.
Select an object from the list
Find the Object Transformation input and choose the transformation type from the
drop-down list.
Click to define the transformation
Enter the position, rotation, or scale values and click
The values are saved and can be modified later by the same procedure
3.2.5 Object Motion
Motion can be specified for a CAD file under the Objects sub-tab. This motion can consist of
translation or rotation. The user has two options for defining the motion, either as Specified Motion
or Flow Coupled.
Specified Motion forces the Object to move with the given translational or rotational velocity. The
fluid will be impacted and react to this motion. It is possible to set translational and rotational
simultaneously, as well as multiple directions and axes of motion.
Coupled Motion, as the name suggests, couples the movement of the object to the flow of the
fluid. A fluid flow impacting the Object will transfer moment and cause motion in the Object. Again, it
is possible to have translational coupling and rotational coupling. Both types of coupling can be
activated simultaneously.
To define motion to a geometry
Click the Objects tab.
Select an object from the list
Find the Type of Object Motion
In the drop-down list, Fixed is the default type that keeps an object stationary
To specify motion, switch the type to Specified Motion. Click to set constant values for
translation or rotation
To define coupled motion, switch the type to Flow Coupled. Click to activate
Translational and/or Rotational Coupling.
3.2.6 Properties of Solid Objects
The physical properties of solid objects are available for modification in the Objects sub-tab. Figure
3.2 shows what this tab looks like. To adjust the properties for an object, select an object in
the list of objects loaded in the mesh (dark grey area). For problems not involving heat
transfer, default values may be used. Figure 3.3 shows the window where object properties are
set.
Figure 3.2: Object tab
Figure 3.3: Solid Properties Window.
To modify properties of a specific object,
Highlight the object to be modified in the list of loaded object (dark grey area) then set
the properties in the fields below it.
If the CAD file contains several objects, the properties of the different objects can be set individually. To do
so,
Click the cross to the left of the CAD file in the list of loaded objects (dark grey surface
area) to make all the objects it includes appear (See Fig. 3.3).
Select the object to be modified then set its properties
The changes to the properties are automatically saved.
For each solid, the following properties can be defined :
Heat Source: Volumetric heat source in the solid (available only with conjugate
temperature model)
Heat Capacity
Thermal conductivity
Density
Roughness: Roughness of the solid walls
Porosity: Value must be between 0 (only solid is present) and 1 (only fluid is present).
Pore Size: Size (in meters) of pores if porosity between 0 and 1
Forchheimer Coef.: Flow coefficient in Forchheimer equation for porous objects
Contact Angle: Angle between the interface and the wall passing through the heavier
phase. It can be defined between 10o and 170o. If a film thickness is defined, this value is
ignored.
Surface coverage: Number of adsorption sites, in mole per square meter. A value greater
than zero enables surface reaction.
Temperature model and Concentration model define the boundary condition at the fluid-solid
interface. They can be of the following types:
Neumann: a constant flux is assumed at the fluid-solid interface. The flux value needs to be
defined with that boundary condition
Dirichlet: a constant value is assumed at the fluid-solid interface. The temperature or scalar
value need to be defined with this model.
Conjugate: this option is only available for the temperature equation. With this boundary
condition, on top of being solved in the fluid domain, the temperature equation is also
solved in the solid.
Each object is considered as an immersed surface and mesh refinements are applied around each one
of them by default. These options can be deactivated.
To disable the representation of an object as an immersed surface and hide it, uncheck
Enable for IS computation when setting the properties of said object.
To remove the automatic refinements around an object, uncheck Enable for GridRefinement when setting the properties of said objects.
The deactivation of the Enable for IS Computation option is very useful when several geometries are
present and one object hides another.
Note the objects for which Enable for IS computation is deactivated are not exported to new GTS
files (see next paragraph). However, they are still taken into account when creating the simulation
files.
With the deactivation of the Enable for Grid Refinement option no automatic refinement will be
created when selecting Edges Refinement or Blocks Refinement in the Domain & Grid tab (see
sections Grid Properties and Multi-Block).
Solve Temperature in Solid can be activated to solve for temperature within an object. Solving for
solid temperature is not possible for Conjugate temperature boundary conditions (Dirichlet or Neumann
required) Please note: Ensure to activate Temperature under Equations in the Inputs when
defining the physics for the simulation.
Optimize Graphics improves the rendering speed for objects loaded into the mesh. This is activated
by default, ensuring fast visualization of the object. Un-checking Optimize Graphics will show all details
of the object, in case some features were smoothened.
Set CAD as Solid can be used to set Objects as solids (flow obstruction) or fluids (flow domain). This
is only possible with one CAD file loaded to the mesh. For the basic use of TransAT, multiple CAD files
must all be set as solids. To work around this issue, merge the solids together using a CAD software.
Please note: For advanced techniques to set multiple CAD files as solids or fluids, please contact
support at ams@poyry.com
Representation of the Object
Immersed Surfaces is a technique applied for objects in the flow, and applies to all
objects for which Enable for IS computation is activated. Immersed Surfaces must be
activated if any objects are Enabled for IS computation and properties can be adjusted by
clicking . For more information on Immersed Surfaces, refer to the Immersed Surfaces
section.
In TransAT, geometries of CAD files are considered as solids by default. This is displayed by the SetCAD as Solid check box. If the CAD file actually represents the fluid domain and not the solid
domain, the Set CAD as Solid check box should be de-activated.
For the basic use of TransAT, multiple CAD files must all be set as solids. The check box will be
hidden if more than one CAD file is imported into the mesh. To work around this issue, merge the solids
together using a CAD software. Please note: For advanced techniques to set multiple CAD files as solids or fluids, please contact
support at ams@poyry.com
Immersed Surfaces
Figure 3.4: Immersed Surface window
Immersed Surface will enable the use of the Immersed Surface Technology (IST, see Equations andAlgorithms manual, Section Immersed Surface Equations ). It is automatically checked when at least one
solid object loaded into the computational domain has the Enable for IS computation option
activated.
Clicking opens a window to set advanced parameters (Fig. 3.4):
Surface file format defines the type of the .ls file. Currently, only ASCII file format can
be used.
EI smoothing formulation defines the type of the smoothing near to embedded interface.
Two options are available: Smooth and Sharp. Please note: Sharp formulation is still beta
released.
Thicken factor option is useful when the geometry is too thin compared to the mesh: it
thickens the object by a width equal to the thicken factor times the minimum cell size.
Hembed Support: if the fluid region occupies less than this fraction of the cell volume,
it is considered that the cell is fully occupied by the solid.
Apply Initial Embedded Interface: if it is turned on, then properties of the solids are
applied at initialization of the simulation.
3.3 CAD File Management
Geometry files can be added or removed from TransAT using the Geo tab. Objects can be
added through any of the subtabs Create Shape, Database or Objects directly into the
mesh.
CAD File Requirements
Given the particularity of the IST technique applied for solids (See the Equations and Algorithms Manual,
Section Immersed Surface Equations ), TransAT has some specific requirements with regards to the CAD
geometries that can be imported.
Two CAD formats are supported by TransAT, namely GTS and STL formats, with the latter being the
widely used format in which geometries are exported by CAD software.
Note that the geometry file must be written in ASCII format to be usable by TransAT. Also, when
using TransATUI on a Linux platform, make sure that the geometry file format is appropriate for
Linux.
The geometry must respect the following properties:
The geometry must represent volumes, or closed surfaces. Open surfaces cannot be loaded
in TransAT.
Two volumes must not be adjacent if they are in the same stl-format file, i.e. they should not
have a common surface. If you are in such a case, either merge your volumes with your CAD
tool, or save them into two different files, which will be loaded separately, but do not patch
different stl-format files together into a single file if they have common surfaces, otherwise
TransAT will identify it as an open surface. However, different volumes can overlap.
With the same idea in mind, several volumes cannot share a single edge if they are saved
in the same file. Once again, save the volumes into different files if you find yourself in this
case.
A cell can take into account only one fluid-solid interface with classical Immersed Surface
Technology.
If there is a small gap between the different objects be aware that a fluid flow may
develop between the two objects because of possible rounding errors, and this might cause
instabilities in the solver.
If you have troubles importing your CAD files, please contact support (ams@poyry.com).
Adding Objects
The button opens a file chooser starting from the current directory to select a geometry file.
After selecting the geometry file and clicking , a window will pop up where units of the objects can
be set. Also, the domain boundaries can be adapted for the Object by checking the box Resize Mesharound Geometry.
After the object is loaded, TransAT checks if the object geometry is a Closed surfaces. The Immersed
Surfaces Technique in TransAT requiring objects with non-zero thickness, a warning will be displayed if
the objects geometry happens to be opened.
Please note: objects representing open surfaces will not be loaded by TransAT.
Removing Objects
The button removes a selected object from the mesh. To do so, select an Object from the list to be
removed. Once selected, the is shown above the object list. Clicking this button will remove the
selected Object from the mesh.
3.4 Definition of the Domain
The boundaries of the domain are set in the Domain & Grid tab. The domain can then be adjusted
thanks to the Multiblock options (See Section Multi-Block). Figure 3.6 shows this Tab. There are
several options to modify the boundaries of the domain:
The first option is to simply enter the domain boundaries in the fields of the domain section
The second option consists in clicking then moving the sliders to the desired position
or filling in the fields in the Define Domain window that popped up after clicking . Click
to confirm the changes and close the define domain window
In the Define Domain window, the button resets the domain boundaries back to the default
calculated values and the , or can be clicked to change the view.
Also note that the fields are changed accordingly to the position of the sliders and vice versa.
Figure 3.5: Define Domain window
Please note: Be aware that the boundaries of the domain bounding box must be set before the
setting the Blocks parameters. After modifications in the Domain & Grid tab, changes done in the
Blocks tab are lost.
3.5 Grid
In Figure 3.6, the Domain & Grid tab, in which cell sizes are set, is shown.
Figure 3.6: Domain & Grid tab
In this tab the grid density is set by either giving the minimal cell size or the number of cell (Nx,
Ny, Nz) corners for each direction. Furthermore, the Cell Ratio between two neighbouring cells
(when refining) and the Maximal Ratio between the smallest and largest cell can also be
set.
When setting the number of corners, bear in mind that it is advised to to have Nx- 1, Ny - 1, Nz - 1
divisible by 2 many times over. Such numbers of cells give the possibility for Multigrid preconditioning
at several levels.
The three check-boxes at the bottom are used to set the type of refinement applied to the grid. The grid
can be refined over the whole bounding box of each surface with the Blocks Refinement option as
shown in Fig. 3.7, or it can be refined only around the edges of the bounding boxes with the EdgesRefinement option as in Fig. 3.8.
After activating the Customized Refinement check-box, the user can choose to refine in the x, y, or z
directions from the options shown, as in Fig. 3.9.
To create a refinement zone
Select a direction (X-axis, Y-axis or Z-axis) in the tree located below the CustomizedRefinement check-box.
Click to create a new refinement zone. A drop-down list and several fields will be
displayed below the tree.
Refinements can be done around a point by choosing the Point option or over a Range. in the drop-down
menu.
Coordinates for a point or range can be directly entered.
Using the button, the ”click-on” grid value can be taken. These are the coordinates
shown in the lower right view of the mesh.
If the ”click-on” grid value is taken, then the corresponding x, y or z value is copied into
the input box.
Once the parameters of the refinement zone have been set, click to the right of the tree
to save them.
Figure 3.7: Refinement over whole Objects.
Figure 3.8: Refinement over Object Edges.
Figure 3.9: Customized refinement parameters
3.6 Blocks
Defining and setting up multi–block meshes is done in the Blocks tab. There, one can
split the grid into several blocks of different sizes, which can then be distributed to several
CPUs.
3.6.1 Mesh Information
To obtain general information on the mesh, such as the number of cells or the size of the
domain, the user can refer to the information in the Mesh Info panel. To display the mesh
information,
Click the icon at the bottom right of the TransATUI.
In the Mesh Info panel that appears after clicking (see Fig. 3.10), the user can find:
The BMR level of the selected block,
the number of cells of the selected block in x, y and z direction (denoted by Nx, Ny and
Nz, respectively) and its total number of cells,
the dimensions of the selected block,
the total number of cells of the mesh.
Figure 3.10: Blocks tab
3.6.2 Block decomposition
The block decomposition is done thanks to the Select Block field, the , , and
icons.
Select Block This box allows the user to select a block among the ones that were already
created, either by clicking on the arrows or by directly entering the block number.
Please note: Selecting a block with the mouse is possible: Ctrl + left click will select the
block, Ctrl + right click will display options to do block operations (Modify, Split, Split andShrink, Add Son Block and Delete)
The Modify Block icon, , opens a new window that enables modifying the dimensions
of the block that is currently selected. The block size can be modified either by dragging
the boundary sliders in the desired direction (switching between different 2D views is done
by toggling either of the x/y, x/z or y/z view options at the bottom of the window), or
by directly specifying the coordinates of the block’s corners on the right-hand side of the
window. The coordinates will be automatically rounded off to the nearest grid corner.
Figure 3.11: Modifying the dimensions of a selected block. In this example, the modifications
are applied to block number 5 of Fig. 3.13.
The Split Block icon, , allows the user to split the selected block in each direction. The split
location can be defined either by dragging the boundary sliders in the desired direction (switching
between different 2D views is done by toggling either of the x/y, x/z or y/z view options at the
bottom of the window), or by directly specifying the coordinates of the split planes on the
right-hand side of the window. The coordinates will be automatically rounded off to the nearest
grid corner.
The Split and Shrink Blocks icon, , opens a window with option boxes to specify:
Number of new blocks Indicates in how many parts the current block should be
split for each direction. An example is shown in Fig. 3.12 where the whole grid is
split into 12 blocks in the XY plane.
Figure 3.12: Creating a 4x3 block decomposition
Shrink outside Objects Specifies to remove blocks during the split operation. Outside
indicates that blocks entirely outside of the Object will be deleted. This is helpful in
automatically reducing the number of cells and blocks around an object. It is possible to
remove blocks closer or further away from the object by adjusting the Distance.
Shrink inside Objects Specifies to remove blocks during the split operation. Inside
indicates that blocks entirely within the Object will be deleted. This is helpful in
automatically reducing the number of cells and blocks around an object. It is possible to
remove blocks closer or further away from the object by adjusting the Distance.
Fast Shrink This option signifies to use a fast algorithm in removing blocks while splitting.
This is only available if either Shrink outside Objects or Shrink inside Objects is
checked. The algorithm implemented will only remove relevant blocks, while maintaining the
default size. In contrast, Detailed Shrink would also shrink the size of blocks near the
Object.
Detailed Shrink This option activates an advanced algorithm for deleting and shrinking
blocks. Detailed Shrink is independent from a Fast Shrink, and accordingly, will
deactivate Fast Shrink once selected. Along with deleting blocks outside of the shrink region,
the Detailed Shrink will also reduce the size of blocks near the Object. This can also be
controlled with the Distance input, by giving a smaller distance to reduce the blocks sizes
closer to the Object. Hint: For large domains, use Fast shrink to quickly test different block decompositions (Nx,
Ny, Nz and distance parameters). Optionally, once ideal parameters are found, undo
and repeat with detailed shrink to more closely wrap the blocks around the
object.
Distance The Distance input controls (if Shrink inside and/or outside activated) how close
to delete and/or shrink blocks near the Object. A small shrink distance will remove blocks
and cells close to the Object. While entering a larger shrink distance will keep more blocks
and cells. Hint: Typically, a distance value 4 times the minimum cell size provides a reasonable buffer
zone of cells around the object.
By default, the positions and sizes of newly created blocks do not depend on the
immersed objects present in the domain. There are cases, however, where the
computational domain of interest is mainly inside or outside immersed objects of
irregular shapes. To avoid manually deleting and resizing blocks, one can use the
shrinking options to directly ignore the inside and/or outside of the objects and
shrink the new blocks by a factor or distance. The Distance value is the distance
away from the Object to keep cells. All cells located past this distance (inside or
outside of Objects according to check-boxes) will be deleted. Deleting unnecessary
cells far away from the object will minimize the number of computational cells and
hence computational cost. Also, a fast or detailed shrink method can be selected. A
Fast Shrink simply deletes blocks, without further shrinking. Using DetailedShrink, will also shrink blocks so that fewer cells fall outside the shrink distance. An
example is provided in Fig. 3.13.
Figure 3.13: Shrinking options. Use the Shrink inside/outside Object option to create blocks
fitted around an object’s boundaries. The Distance specifies how close to the Object interface
newly created blocks are shrunk.
The Delete Block icon, , deletes the currently selected block. This leaves a hole in the
computational domain with symmetry boundary conditions on its boundaries. This can be used to
create a (cuboid) obstacle, or to reduce the size of the computational domain (e.g. by removing
cells inside solids where no equations are to be solved).
3.7 Block Mesh Refinement
For a BMR grid there are some starting parameters for the initialisation and then some tools to
modify the resulting grid as needed.
The starting parameters are:
Number of initial levels: the number of refinement levels.
Ratio level 2. In the BMR the refinement is done starting from the existing grid and
splitting its cells into n parts in each direction (i.e. n3 new cells for each old one). Here one
can specify the ratio n between the initial grid and the second level grid. This ratio can also
be modified after the initialisation.
Initialize BMR: this button initialises the BMR framework and builds the BMR grids.
If there is at least one object loaded, TransAT will create new refined grid around it. To
exclude an object from the BMR refinement or to reduce the refinement levels for a single
object, disable it in the properties window (in Objects→Properties).
The initial dimensions of the grids are calculated automatically after clicking . They can be
further modified. In fact, once the BMR is initialised, all the other tools can be used. In
particular:
Select block: go through all the grids (all are identified by an index), the selected one is
showed in a different colour. The selected grid can be modified in different ways as explained
below
Show BMR Level: makes the selected grid visible/invisible
: opens a new window in which the selected block can be modified. In particular
ratio of refinement can be modified separately for each direction,
size of the block can be modified using the slider and the preview window or modifying
manually the coordinates of the sub-domain.
: add a new refined block inside the selected one specifying ratio and boundaries.
: using this button one can split a block into any number of parts. Splitting a block in either
x, y , or z will divide that block uniformly into the given value i.e. giving x direction a value of 3
will result in the one initial block being split into 3 separate blocks of uniform dimensions aligned
along the x plane. Shrink enables a user to remove unnecessary split blocks around an embedded
object by defining a distance or shrink factor and applying. This feature can be very useful in
reducing the number of excess highly resolved blocks around an embedded so as to
cheapen the simulation considerably without the user having to manually remove said
blocks.
: delete the selected block if it does not contain son blocks.
3.8 Boundary Conditions (BCs)
The BCs tab is used to set boundary conditions on surfaces. To define boundary conditions on objects
go to the Object sub-tab in the Geo tab. The BCs tab is shown in Figure 3.14.
A boundary surface is defined as boundary cell faces oriented in the same direction AND being
located on the same plane. As an example, Figure 3.15 shows three different boundary surfaces
highlighted, where independent boundary conditions can be applied.
Figure 3.14: BCs tab
Figure 3.15: Domain BCs
The top part of the BCs tab contains the list of boundary surfaces in the form of a tree. It is used to
list and select boundary surfaces. Modify the value in the drop-down list above the boundary surfaces
tree to display the boundary surfaces only in a given direction. The boundary surfaces in all
directions can be displayed in the list by selecting All surfaces in the Boundary drop-down
list.
3.8.1 Assigning a boundary condition to a surface
With a click on the icon, the user can create a new boundary condition. It can then be given a
name, and defined as one of the basic types consisting of:
Inflow
Outflow
Wall
Symmetry
OlgaCoupling
Cyclic
Properties of these boundary conditions can then be defined by clicking on . A description of boundary
condition property panels is available in the Section Boundary conditions properties.
Once the boundary condition is defined, it can be assigned to a boundary surfaces. To do
this,
Select the boundary condition by clicking the light grey square next to it in the list of
boundary conditions.
The little square will become orange when the selection is effective.
In the list of boundary surfaces, select the boundary surfaces to which the bounadry
condition is to be applied then click
Note that a boundary condition can also be assigned to several surfaces at once. To do so
Select the surfaces of interest at once by pressing the Ctrl key while selecting them
Check the boundary condition to be assigned in the boundary conditions table
Click assign to complete the assignment of the boundary condition
After the assignment is complete, the surfaces are colored with the color associated to the boundary
condition in the boundary condition table.
To see which surfaces have a given boundary condition assigned, select the boundary condition and click
.
Please note: boundaries can be directly selected in the view window on the right using Ctrl + left
click.
Also note that one boundary condition can be assigned to several surfaces, but a boundary surface can
have only one condition assigned. To define different boundary conditions on the same boundary
surface, sub-boundary conditions need to be created. Their use is described in the next
section.
3.8.2 SubBCs
To create a boundary condition that does not span the full boundary surface,
In the surface tree, select the boundary surface where the sub-boundary surface will be
added (e.g. XMIN 0).
Click to create a subBC. The button is visible next to the other buttons once a surface
is selected.
A new window will be opened where boundary patches can be defined (Fig 3.16). With this tool,
boundary patches can be specified on each of the boundary surfaces.
Please note: The SubBC takes precedence over the larger boundary condition and SubBCs
cannot intersect each other.
SubBCs can however be created inside another patch (See Figure 3.17). In this case, the
smallest SubBC will have precedence over the bigger ones.
Figure 3.16: Sub-BCs window
Figure 3.17: BC patches within each other. The smallest patches have precedence over the bigger
one, which has precedence over the general BC.
3.8.3 Boundary conditions properties
3.8.4 Inflow boundary conditions
Basic properties for inflow boundary conditions are the temperature of the fluid at the inflow, the bulk
velocity and the velocity profile. Other, more specific inflow conditions can be applied. They are
described in the following section.
Inflow Properties
Several options exist to specify inflow conditions. Depending on the nature of the inflow, the choices can
be narrowed down. They can be accessed by clicking at the corresponding line in the boundary
conditions table.
Figure 3.18: Window for Inflow Properties
Basic
In the Basic tab the essential inflow variables can be set.
Inflow Data Source, From BC will let the user define all inflow properties in the
current window, From Initial Conditions will apply the inflow properties as defined in initial
conditions.
Inflow Type defines the type of inflow boundary: velocity based (the velocity magnitude)
or total pressure based (the total pressure is fixed). In the case of compressible single-phase
flows, fixing the total temperature or the Mach number is also possible. For both
compressible and incompressible flows an inflow From BC of type Total P and T based
(total pressure and total temperature based) is also available.
Inflow Profile sets the velocity profile for velocity based inflow type (only for velocity-based
inflow; inflow can be set by velocity components or volume/mass flow rates). For
incompressible flow the choices are: constant, laminar and turbulent. In case of compressible
flow two velocity profiles at the inflow are available: constant and laminar.
Flow direction normal to boundary by default normal flow direction is used, however
user may set the flow diection by specifying velocity vector components here (this option
is available for pressure based inflow). The magnitude of Flow direction vector is
unimportant because TransAT will normalize it.
Inflow Total Pressure is the total pressure at inflow.
Inflow Total Temperature is the total temperature at inflow.
Inflow Static Pressure is the static pressure at inflow, to be used only for supersonic
flows, where the pressure must be defined at the inflow. Defining the inflow and outflow
static pressure for a subsonic flow may lead to an ill-posed problem.
Flowrate specification Default is Velocity. This choice drop-down defines the specification
type for the inflow. Available options are Velocity, Volume flowrate or Mass flowrate. Details
for these specifications are described below in the next three items.
Inflow Velocity Components provide the vector components for the velocity based
inflow.
Inflow Volume Flow Rate can be given in case the volume flow rate is known. This
option is limited to single phase flow and multiphase homogeneous flow (no slip between
phases).
Inflow Mass Flow Rate can be given in case the mass flow rate is known. This option is
limited to single phase flow and multiphase homogeneous flow (no slip between phases).
Inflow Concentration is the value of the scalar at the inflow.
Inflow Temperature is the static temperature of the flow at the inflow.
Boundary Layer Thickness is the thickness of the boundary layer in SI units (only for
velocity-based inflow).
Turbulence (RANS)
Turbulence(RANS) has two variables.
Turbulence Intensity is the ratio of the root mean square of the velocity fluctuations to
the Reynolds averaged mean velocity.
Mu_t/Mu is the ratio of the turbulent (eddy) viscosity to the fluid (dynamic) viscosity.
The values described above are used for velocity or pressure based inflow with data source from BC or
initial conditions.
Oscillatory Inflow
Oscillatory Inflow has three variables.
Oscillation Period specifies the time required for one oscillation to complete
Oscillation Phase Angle is the starting point (angular) at time zero
Oscillation Relative Velocity provide the factors of the oscillation velocity. The factors
are given in terms of relative values to the current inflow velocity components.
Please note: Default values of -1010 mean that the feature is deactivated. If values are specified, than the
formula for the inflow velocity is:
(3.1)
where is the oscillatory inflow velocity, in is the inflow velocity specified in the basic tab, is
Oscillation Relative Velocity, Ω is the Oscillation Period and Θ is the Oscillation Phase
Angle.
Unsteady Inflow Generator
Autocorrelation Length is the spatial autocorrelation length of turbulence.
Reynolds Stress Tensor gives the components of the Reynolds Stress Tensor.
Please note: Default values of -1010 mean that the feature is deactivated.
Lagrangian Particle Tracking
Particle Volume Fraction gives the fraction of the volume at the inflow occupied by the
particles.
Particle Temperature can be used to specify the temperature of all the particles at that
inflow.
Particle Velocity provides the directional components of the particle velocity at the inflow.
N-Phase Algebraic Slip Model
In this tab, Volume fractions and Velocities can be defined for each phase, separately.
Velocities will only be used if the drift velocity model has been enabled (See Section Phase
Average Model), otherwise they are ignored and the basic inflow velocity vector will be
used.
Inflow Conditions from Data File
Number of Points gives the number of probe locations at which data is measured.
Coordinates File locates the file which has the co-ordinates of all the probes.
Number of Time Instants gives the number of time instances at which the variable
values are given (default value is 2).
Time Index File has the information of the time instants for the variables.
Read <Variable> From File checks whether to enable or disable the reading of a particular
variable from the data file. If disabled, TransAT will use the value defined by the basic BC
definitions.
<Variable> File is the name of the data file for the variable.
When using inputs from data file, the probe coordinates file is compulsory. It stores the coordinates of
each probe. These coordinates are given in two dimensions, the third dimension is given by the face
location. Thus the y- and z-coordinates must be given for ”west/xmin” and ”east/xmax” faces,
x- and z-coordinates for ”north/ymax” and ”south/ymin” faces and x- and y-coordinates
for ”top/zmax” and ”bottom/zmin” faces. An example of probe coordinates file is given
below:
where each line corresponds to the coordinates of one probe.
The time index file is also compulsory. It stores the time instances at which the values are given for each
variables. An example of such a file is given:
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Finally, the data files include values of the different variables for each probe at each time instance. It
must be written by giving first the values for each probe at the first time point, then the values for the
second time point.
where each line corresponds to a time instance and each column corresponds to a probe.
If a data file is not found, initial values will be used as boundary conditions.
The boundary conditions will be interpolated in space and time from the data files. If the simulation
time is smaller than the first time point, values of this first time point are used. In the same
way, if the simulation time exceeds the last time point, values of the last time point are
used. Space interpolation is performed using the four probes bordering the cell centre. If no
space interpolation can be performed, the value defined by the basic BC definitions will be
used.
Chemical Species
Full chemical species inputs are only available if Species and Reaction is enabled.
Depending on the components involved in the reactions, which have been defined in the Reactive Flow
Modelling window (see Section 4.1.4), the user can enter the compositions based on one of the following
options:
For multiphase flow simulations with the Phase Average model activated, one of the following inflow
Topology Types can be selected (By default None is selected):
Horizontal Slug
Vertical Slug
Annular Flow
Stratified Flow
For the Horizontal\Vertical Slug the following input parameters need to be specified:
Start Time specifies the time, at which the first slug enters the domain.
Number of Slugs specifies the total number of slugs entering the domain.
Film Height specifies the film thickness of liquid between slugs.
Slug Height specifies the peak height of the slug, with respect to the pipe/channel wall.
Slug Normal Direction (Horizontal Slug only) specifies which coordinate axis is parallel
to gravity.
Slug Rise Time specifies the amount of time taken by the slug to reach its peak height
(assuming a linear increase in height over time).
Slug Peak Time specifies the amount of time spent by the slug at peak height.
Slug Drop Time specifies the amount of time taken by the slug to drop back to the film
height (assuming a linear decrease in height over time).
Time Between Slugs specifies the time passing between two consecutive slugs.
Bulk Film Velocity specifies the bulk velocity of the liquid film between slugs.
Bulk Slug Velocity specifies bulk velocity of the slug while it is at peak height.
Bulk Gas Velocity specifies the bulk velocity of the gas between slugs.
Gas velocity at Slug specifies the bulk velocity of gas while the slug is at peak height.
Please note: Horizontal Slug flow or Vertical Slug flow is only available for unsteady simulations.
For the Annular Flow the following input parameters need to be specified:
Film Height specifies the film thickness of the annular flow.
Bulk Film Velocity specifies the bulk velocity of the liquid film.
Bulk Gas Velocity specifies the bulk velocity of the gas.
For the Stratified Flow the following input parameters need to be specified:
Height of Liquid Layer specifies the height of liquid, with respect to the pipe/channel
wall.
Bulk Film Velocity specifies the bulk velocity of the liquid layer.
Bulk Gas Velocity specifies the bulk velocity of the gas.
For each type of multiphase flow topology a general liquid (slug) part and a general gas part is
distinguished, however it is possible to freely choose the composition of each part in terms
of phase volume fractions using the inputs under Film\Liquid Composition and GasComposition. E.g. an annular inflow with liquid droplets entrapped in the bulk gas stream can be
defined by specifying some volume fraction of a liquid phase under Gas Composition.
Please note: When using the TransATUI to set up a simulation, for each type of multiphase flow
topology a descriptive schematic is displayed describing all parameters that need to be set.
Pump type
A pump type boundary is also available in TransAT. This is particularly useful if the user wants to
define an outflow type with known fixed velocity. In order to activate it an inflow should have negative
velocity defined (or negative volume/mass flow rate). For the homogeneous model mixture velocity is
used to define pump discharge rate, whereas for Algebraic Slip Model both mixture or Phase Velocities
can be used to do so. In both cases the void fractions for the pump boundary condition should be set to
zero, since they are extrapolated from the domain side. Turbulence parameters are therefore
also set based on the values from domain side, and there is no need to define them for the
pump.
Please note: For a pump boundary condition the Multiphase Flow Topology option is not
available.
3.8.5 Outflow boundary conditions
For outflow boundary conditions, two types of outflows are used:
Velocity outflows behave as a non-reflective outflow. All variables will be extrapolated, using the
Neumann condition
(3.2)
where ϕ is the solved variables and n is the direction normal to the boundary.
In the case of Pressure outflow boundary conditions, pressure will be set to the value
given by the user. The boundary behaves as a non-reflective outflow for the other
variables.
General
For the Velocity outflow, no further options need to be set.
For the Pressure outflow, two options are available for the Outflow Data Source input:
From Initial Conditions takes the pressure values initialised at the outflow boundary as
boundary conditions for the rest of the simulation. This is especially useful if spatially
varying pressure boundary conditions are desired, which can be set using Advanced Initial
Conditions.
From Boundary Conditions lets the user define a constant pressure value for the outflow
boundary. Optionally a pressure loss coefficient ζ can be defined.
If a non-zero Pressure loss coefficient is defined TransAT will adjust the boundary pressure value pBC
during the simulation according to the following relation
(3.3)
where p∞ is the pressure value set for Outflow Pressure, ζ is the value set for Pressure losscoefficient, ρ is the fluid density and u is the bulk outflow velocity, i.e. the average outflow velocity
accounting for all the cells that are part of the same outflow.
Please note: The Pressure loss coefficient should be set only for outflows without backflow.
Backflow properties
Backflow properties should be defined for pressure outflow boundary. These are particularly:
Backflow volume fractions used for N-phase model. If the fields are not defined (zero), then
only the first phase is allowed to enter due to backflow.
Backflow total temperature
Backflow turbulence intensity
Backflow eddy viscosity ratio
3.8.6 Wall boundary conditions
Wall boundary conditions usually set no-slip boundary conditions.
When the temperature equation is solved, the user can define the Temperature or Heat Flux at the wall
choice.
Basic
Basic lists the essential wall values.
Wall Velocity fixes the directional components of the wall velocity.
Temperature/ Heat Flux choice allows the choice of two methods to set the boundary
temperature.
The Temperature option gives the possibility to fix a constant temperature at the wall. The
temperature value should be set in Kelvin in the Temperature / Heat Flux Value field.
With the Heat Flux option, the heat flux through the wall is fixed. Its value should be in
W∕m2 in the Temperature / Heat Flux Value
Temperature/ Heat Flux value gives the value temperature or heat flux.
Similarly to temperature, there are two choices of methods for concentration.
Concentration/ Flux Choice allows the user to set either the concentration value at the
wall or the flux of the scalar through the wall.
Concentration/ Flux Value stores the value of the concentration or the flux.
Interface Tracking
Interface Tracking inputs are only for Level-Set model.
Contact Angle is the angle made between the interface and the wall passing through the
phase 2 (in degrees).
A liquid Film Thickness can be specified for low Capillary Number flows where a sub-grid
film always exists between the wall and the gas phase. Positive value defines a film for phase
2, negative value for phase 1. The film boundary condition does not impose a film, e.g. if a
gas film BC has been defined but initially there is no gas near the wall, the film BC will not
create a gas film. However, if during the simulation, gas is touching once a wall cell with
gas film BC defined, a gas film will remain in this cell for the rest of the simulation.
Please note: The film thickness should be less than the grid size near the wall.
Wall Conditions from Data File
Number of Points gives the number of probe locations at which the wall data is measured.
Coordinates File locates the file which has the coordinates of all the wall probes.
Number of Time Instants gives the number of time points at which the wall values are
given.
Time Index File has the information of the time instants for the wall variables.
Read <Variable> From File checks whether to enable or disable the reading of a particular
variable from the data file. If disabled values from basic wall BC definitions are used.
<Variable> File is the name of the data file for the variable.
When using inputs from data file, the probe coordinates file is compulsory, and includes the coordinates
of each probe. These coordinates are given in two dimensions, the third dimension is given by the face
location. Thus the y- and z-coordinates must be given for “east/xmax” and “west/xmin” faces, x- and
z-coordinates for “north/ymax” and “south/ymin” faces and x- and y-coordinates for “top/zmax” and
“bottom/zmin” faces.
An example of probe coordinates file is given below:
where each line corresponds to the coordinates of one probe.
The time index file is also compulsory, and includes the time points at which the values are given for
each variables. An example of such a file is given:
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Finally, the data files include the value of the different variables for each probe and each time point.
It must be written by giving first the values for each probe at the first time point, then the values for
the second time point. Below is an example of such a data file.
where each line corresponds to a time point and each column corresponds to a probe.
If a data file is not found, initial values will be used as boundary conditions.
The boundary conditions will be interpolated in space and time from the data files. If the simulation
time is smaller than the first time point, values of this first time point are used. In the same way, if the
simulation time exceeds the last time point, values of the last time point are used. Space interpolation is
performed using the four probes bordering the cell centre. If no space interpolation can be performed,
initial values are used.
Surface Reactions
Surface Coverage provides the concentration of the catalyst (in per m2) on the surface. The higher
the surface coverage, the higher the intensity of reaction.
3.8.7 Symmetry boundary conditions
The symmetry boundary condition is a slip boundary condition. Velocity normal to the boundary is set
to zero, and homogeneous Dirichlet boundary conditions are applied to all the other variables
ϕ:
(3.4)
where n is the direction normal to the boundary.
3.8.8 OLGA Coupling boundary conditions
An OLGA coupling boundary condition must be defined giving three different set of parameters:
OLGA properties:
1D-code filename which is the name of the file where OLGA writes the physical
data corresponding to the coupling interface.
TransAT filename which is the name of the file where TransAT writes the physical
data corresponding to the coupling interface.
1D-code Boundary tag which is the tag to be defined in OLGA for reading the
coupling boundary value. Typically, in OLGA, this is the tag of the position closest
possible to the coupling interface.
1D-code Oil Source tag which is the tag to be defined in OLGA for communicating
the value of the Oil mass flux crossing the coupling interface.
1D-code Gas Source tag which is the tag to be defined in OLGA for communicating
the value of the Gas mass flux crossing the coupling interface.
1D-code Water Source tag which is the tag to be defined in OLGA for
communicating the value of the Water mass flux crossing the coupling interface.
Geometry properties:
Pipe diameter defines the diameter of the pipe at the coupling interface. This has
to be consistent with the OLGA definition of the pipe diameter.
Pipe length defines the length of the pipe as it is in OLGA.
Pipe roughness defines the roughness of the pipe as it is in OLGA.
Pipe inclination defines the inclination of the pipe as it is in OLGA.
Coupling scheme properties(irrelevant when Learning method is selected):
Pressure equation tolerance The coupling algorithm needs to solve an equation
involving the pressure at the boundary and the mass fluxes crossing that boundary.
This is the tolerance used for the pressure–fluxes equation. The default value of 1.0e-5
is usually a good setup.
Outflow velocity tolerance The coupling algorithm needs to know the convergence
status of the outflow velocity at the boundary, before checking the convergence of the
pressure–fluxes equation. This tolerance is used for that. The value can be 0.01 (as
default), or even higher in some cases.
Mass flux tolerance The coupling algorithm needs to know the convergence status
of the fluxes at the boundary, before checking the convergence of the pressure–fluxes
equation. This tolerance is used for that. The value can be 0.01 (as default), or even
higher in some cases.
3.8.9 Cyclic boundary conditions
Cyclic (periodic) boundary conditions will copy the values of all variables at one boundary to the cells
of the other boundary (see Fig. 3.20). Pressure forcing can be set in the Physical Models tab by
activating the Periodic Conditions check-box and opening its properties window. Details about
pressure forcing settings for periodic BCs are available in the section Periodic Conditions.
The settings take effect for surfaces where cyclic BCs have been set. Cyclic BCs must be assigned on
all surfaces in the directions where the pressure forcing term is enabled. Cyclic BCs require careful setup
and in general are applied to domains with simple geometries.
Figure 3.20: Cyclic boundary conditions
Chapter 4 Physics and Numerics Inputs
In the Input Tab, all the inputs concerning Physical Models, Phase Properties, Phase Interactions,
Simulation Parameters and Output Management are defined, using the different available
pages.
4.1 Physical Models
Clicking the Physical Models button enables the user to choose the equations to be solved,
and the physical models to be used. A view of the Physical models page is presented in
Figure 4.1.
Figure 4.1: Physical Models Page
The tab is split into five sections.
Basic Equations enables the user to select which basic variables are solved in the
simulation: pressure, temperature, concentration, velocities.
Models and Properties enables the user to select which base models are to be used to
run the simulation: Turbulence, Compressibility, Gravity and Reference Properties. Gravity
is used for defining the gravity vector and Reference Properties is used for the definition of
values used for non-dimensional numbers.
Multiphase allows the user to choose advanced physical models that involve multiple
phases during the simulation. These models are shown by clicking Multiphase.
Multiphysics allows the user to choose advanced physical models that involve more
physics, such as radiation or viscoelasticity. These models are shown by clicking
Multiphysics.
Additional Features provides more models and features available in TransAT. These
features are shown by clicking Additional Features.
4.1.1 Basic Equations
The first thing to do is to select the equations to be solved for during the simulation. This is done
in the Basic Equations section. The following equations can be selected by checking the
small squares next to them (they are colored in light grey when deactivated and in orange
otherwise):
Pressure
U velocity
V velocity
W velocity
Temperature: Solving the temperature equation is equivalent to solving the energy
conservation equation.
Concentration: This solves the transport equation for a passive scalar.
4.1.2 Models and Properties
The base models are found in the Models and Properties section. These include Turbulence Modelling,
Compressibility, Gravity and Reference Properties.
Turbulence Modelling
Clicking the Turbulence Modelling check-box activates a model for turbulent flows. Three families of
methods are available: RANS (Reynolds-Averaged Navier Stokes), LES (Large Eddy Simulation) and
V-LES (Very Large Eddy Simulation). For more information on the theories underlying these methods,
the user can read the Turbulence Theory Manual, Chapters Two-Equation Turbulence Models and Scale
Resolving Strategies: LES and V-LESRANS To use a RANS model, the user should choose RANS in the Turbulence Modelling
list.
Clicking opens a new window (Fig. 4.2) where the different parameters of the model can be
defined.
Figure 4.2: RANS Parameters window
For the description of the K-Epsilon Model, see the Turbulence Theory Manual, Chapter
Two-Equation Turbulence Models .
With the k - ε model, one must choose:
the Formulation: - High-Reynolds number, - Low-Reynolds number or - Two-layer model - High-Reynolds RNG model (See Turbulence Theory Manual, Chapter Near-Wall Modelling for more information).
the Wall treatment Method: - Standard Wall Function is available for High-Reynolds number formulation. - None (no treatment) is available for Low-Reynolds number formulation. (See the Turbulence Theory Manual, Section Near–Wall Treatment in High–Re Flows for
more information).
Extensions to the basic two-equation model can be chosen if necessary. Details of the extensions are
available in the Turbulence Theory Manual, Section Extensions to k - ε Turbulence Model
.
The Yap correction is active in non-equilibrium flows and tends to reduce the departure of
the turbulence length scale from its local equilibrium level. The correction improved results
with the k - ε model in separated flows.
The swirl correction adjusts the turbulent eddy viscosity for strongly swirling flows because
the standard k - ε models tend to overestimate turbulent diffusion for such flows.
The compressible dilatation dissipation correction accounts for the reduction in turbulence
levels at moderate to high Mach numbers.
The different k-epsilon model constants can then be set. Defaults values for σk, σε, Cμ, Cε,1 and
Cε,2 are the values proposed by Launder & Spalding (1974). Value for cε,3 is determined by the stability
of flow stratification, and is between 0.8 and 1.0 for stable stratification and close to 0 for
unstable ones (See the Turbulence Theory Manual, Chapter Buoyancy-Driven Turbulent Flows ).
Default Inflow Conditions values must be defined for the following properties:
Eddy Viscosity Ratio
Turbulence Intensity
If the value has already been defined for an inflow BC, this value will have precedence over the value
defined here. Default Wall properties may also be defined in this window. The user can define the default inflow wallroughness (default roughness at the inflow) and the wall roughness.
LES To perform a LES simulation, the user should choose LES in the Turbulence Modelling list.
Clicking opens a new window (Fig. 4.3) with the available options for LES. For theory on
LES, the reader is referred to the Turbulence theory manual, Section Large Eddy Simulation The first step is to choose the Subgrid Scale Model (SGS) that must be used. The following models
are available in TransAT:
None
Smagorinsky model. When using the Smagorinsky model, the user must give values for the
constant Cs (Smagorinsky model constant). For more information about the Smagorinsky model and all its components, the reader is
referred to the Turbulence Theory Manual, Section The Smagorinsky Model
WALE model. The user may also choose to use the WALE model, described in the TurbulenceTheory Manual Section, The WALE Model . The Cw value (WALE constant) is calculated
automatically from the Cs (Smagorinsky model constant), please refer to Turbulence theorymanual.
Dynamic LES Dynamic model is also available in TransAT. For the theory, please refer to
the Turbulence Theory Manual, Section The Dynamic Approach .
With this model, one must choose the type of Filter Averaging to be applied (volume,
plane or line), and the type of averaging for the and tensors (volume, plane or noaveraging). Constraints can be then applied to the subgrid scale viscosity, namely positivelocal SGS viscosity or positive total SGS viscosity. Finally, a relaxation factor must be set
when no averaging is applied for the and tensors. The value is very low, because the
dynamic model can be very noisy when no averaging is performed.
Figure 4.3: LES Parameters window
For more information about these models, the reader is referred to the Turbulence Theory Manual,
Chapter Large Eddy Simulation and Very-Large Eddy Simulation Turbulent Prandtl number Turbulent Prandtl number can be computed using either the
Dynamic model or Kays model. It can also be set as a constant. In this case, the constant value must be
given as an input. The dynamic model for the Prandtl number is only available if the dynamic subgrid
model is used. For more information, the reader is referred to the Turbulence Theory Manual, Section
Turbulent Prandtl Number .
Near-Wall Treatment A Wall Force Calculation can be applied for the LES simulations.
One can choose if mean velocities or instantaneous velocities should be used for the near-wall treatment.
The available wall boundary type functions are:
No slip
Werner-Wengle wall function
For more information about these functions, the reader is referred to the Turbulence Theory Manual, Section
Wall-functions in LES .
With the Smagorinsky model, one can choose a near-wall damping, using Deardorff-Werner model or
the Schmidt and Schumann model. In the latter case, the constants C2inh and kappa must be
given.
Other Parameters In some cases, the flow tends to become laminar at the beginning of LES
simulations. To avoid this behaviour, the user may uncheck the Recalculate Wall shear box. In this
case, initial wall shear is used during all the simulation. Another possibility is to give a
Recalculation interval: a value of n means that the wall shear is recalculated every nth step.
Initial Perturbation: Checking this box will enable the initial velocity field to be perturbed using a
random signal, which may enable the flow to reach the statistical steady-state faster. The amplitude of
the perturbation is specified with the input variable Perturbation Amplitude, which is in
m/s.
V-LES To use the V-LES model, the user should choose V-LES in the Turbulence Modelling
list.
Clicking opens a new window, pretty similar to the Fig. 4.2, specific to RANS model. The only
difference is that a V-LES filter width can be given, which is used to filter the k -ε equations. A lower
value will make it closer to Large Eddy Simulation (although with a different subgrid model) while a
large value will make the solver use standard k - ε equations.
For more information, see the Turbulence Theory Manual, Section Very-Large Eddy Simulation Concept
.
Turbulent Heat Flux Modelling When solving for temperature along with the RANS turbulence
model, a Turbulent Heat Flux (THF) model must be chosen. The different models and available
parameters can be chosen and tuned by clicking .
In the Turbulent Heat Flux properties window several models can be chosen from:
Algebraic Turbulent Heat Flux Model with θ′2 equation (ATHFM-kT)
Algebraic Turbulent Heat Flux Model with θ′2 and εθ′ equations (ATHFM-kTeT)
Turbulent Heat Flux Model (THFM)
The models can be sorted by increasing complexity (based on the number of additional equations to
be solved) as shown in Figure 4.4.
Figure 4.4: Turbulent heat flux modelling overview, where kT represent the variance of the
temperature fluctuati ons θ′2 and eT represent the dissipation rate of the heat fluxes εθ′.
SGDH, GGDH and WET models do not require any additional equation to be solved even if the θ′2
equation can be solved based on user-choice. The THFM model requires the solution of 5 equations to
solve for the turbulent heat flux explicitely. A more comprehensive description of the different models
and required inputs or parameters can be found in the Turbulence Theory Manual, Chapter Turbulent
Heat Flux Modelling.
When any of the aforementioned models is activated, some additional simulation outputs can be
chosen, namely the turbulent heat flux, the intensity of the temperature fluctuations and the dissipation
rate of the temperature fluctuations.
Compressible flows
The Compressibility check-box in the Physical Models page activates the compressible solver of
TransAT.
The window where compressibility parameters are set is displayed after clicking (Fig. 4.5).
Figure 4.5: Compressible Flow window
The drop-down list at the top sets the Density interpolation method. First-order upwind method
is more adapted to high-speed flows, while second order central method is better for low-speed
flows.
The next input is the Contrast factor for Schlieren image. TransAT can output numerical Schlieren
variable for compressible flow, and this factor sets the contrast resolution. Numerical Schlieren images
are evaluated by
(4.1)
where κ is the contrast factor and |δρ| is the magnitude of the numerical density gradient. To enable the
output of Schlieren images: go to the Output Management tab (Fig. 4.36), then click
Output Variables > . This opens the Output Variables window (Fig. 4.35). Finally, check
Numerical Schlieren Image.
In the window to set the compressibility model parameters The user can also set the SystemPressure. Indeed, unlike incompressible solver, compressible solver must use the absolute pressure. The
pressure defined at the boundaries has to be set as gauge pressure. System pressure ps can then be used
as a differential pressure: we have the equation
(4.2)
where pabsolute is the absolute pressure and pnumerical is the pressure that is used and output by
TransAT. If the user wants to output the pressure values around average numerical pressure, he can check the box
Automatically adjust system pressure. With this option, the system pressure evolves with time.
This is useful when one wants to track small pressure variations, for example when solving acoustic
waves.
Recommendations
For compressible simulations, it is better to use a Auto-relaxation coefficient between 0.5
and 0.77 for relaxation. Out of this interval the simulation may not converge.
Use a pressure convergence threshold of 10-2 or less to reduce the total number of pressure
iterations.
When the pattern of the flow is not known, using the inlet velocity as initial velocity and
defining an initial pressure gradient as initial conditions may improve the stability of the
first iterations.
Gravity
Activating the Gravity check-box allows for adjusting the Gravity vector. Clicking
at the right of Gravity opens the gravity sub-window. This allows the user to define the
components of the gravity vector. Its components must be given in S.I. units. When gravity is
non-zero, the Hydrostatic pressure source term will be automatically enabled for multiphase
flows.
Reference Properties
Reference Properties can be activated with the check-box. Clicking at the right
opens the reference properties sub-window. Reference values for different variables can be
defined:
Reference Pressure
Reference Temperature
Reference Velocity
Reference Length
With the exception of the reference temperature, which is used when the Boussinesq approximation is
applied (section 4.2.7), these values are not used for numerical simulations, only for evaluating the
non-dimensional numbers of the simulations and for post-processing. All the values are given in S.I.
units.
When the user does not provide a reference value for a property, a default value is automatically set.
In the case of the reference length, the automatic default value is -1. Then a length scale
is automatically computed from the simulation files at the beginning of any simulation.
This automatic value will be used only if no user value has been specified. A message is
displayed when launching a simulation which summarizes the different length scales and
specifies which one will be used. The automatic length scale is computed as the minimum
of:
the size of the domain
the maximum distance observed from a cell to a wall (if applicable)
the maximum distance from a solid cell to the immersed interface (if applicable, gives an
estimate of the solid length scale)
the maximum distance from a fluid cell to the immersed interface (if applicable, gives an
estimate of the fluid length scale)
Reference Concentration is also available. It is used to determine the buoyancy effects when
solving the concentration of a scalar.
4.1.3 Multiphase
By default on opening TransAT, the Multiphase models will be displayed. If this is not the
case, clicking Multiphase will display these models. The models available in the Multiphase
section includes Interface Tracking, Phase Average, Phase Change, and Lagrangian Particle
Tracking.
Interface Tracking
The check-box Interface Tracking enables using an Interface Tracking Method (Level Set). The user
should first activate the Interface Tracking check-box then click to define the parameters of the
model. More information is available in the Multiphase Theory Manual, Section The Level Set
Method for Level-Set and The VOF methodology for Volume Of Fluid (VOF). Please note:
when using a multiphase flow method, initial conditions must be defined for the interface
or for the initial volume fractions. See Section Creating Initial Conditions to define initial
conditions.
Level Set Method The more feature-rich interface tracking method in TransAT is the Level Set
method. The window where its properties are set is shown in Fig. 4.6
Figure 4.6: Level Set properties window
Interface calculation parameters Several numerical parameters are available for the
Level-Set computation:
Interface Width Factor is the ratio between the minimum cell size and the width of the
interface.
H smooth is the type of function to be used in the smooth interface region for defining
the proportion of gas and liquid. Choices are tanh (use of a hyperbolic tangent function),
linear or sharp (Sharp interface).
Delta Type is the method used to calculate the Dirac delta function at the interface. It
is expressed as the norm of the gradient of the H smooth function. Analytical uses the
analytical expression, while Discrete uses discretised differential operators.
LS Narrowband: If this option is selected, the Level Set function is updated only in a
region around the interface, instead of the whole domain.
Implicit Treatment of Surface Tension: For surface tension dominated flows, typically
small-scale flows, the time step restriction arising due to explicit treatment of the surface tension
source is too severe. This is combined with the issue of parasitic velocities, which finally results in
a low effective CFL condition and the solution proceeding very slowly. The implicit curvature
treatment reduces the parasitic currents by a significant amount resulting in larger
effective CFL numbers. The method proposed by Hysing (2006) has been implemented
and can be turned on by checking the corresponding box. This method allows the
surface tension time step criterion (See Section Control Parameters) to be set as high as:
Surface Tension
Min = 5.0
Max=10.0
For the explicit treatment, the maximum surface tension criterion should be kept lower than
1.0.
Please note: For BMR grids the implicit surface tension treatment will be automatically
disabled.
Dynamic Contact Angle Model
TransAT has both static and dynamic contact angle modelling capabilities. The equilibrium
contact angle can be defined in the current window. If the dynamic contact angle model is
deactivated, the value of the equilibrium contact angle will be used as static contact
angle. To specify different values for each wall boundary, please refer to the Boundary
conditions section. The maximum contact angle that can be specified is 170∘ and the
minimum is 10∘. This limit is imposed due to the way the contact angle boundary
condition is implemented. For situations very close to fully wetting or fully non–wetting,
the thin film boundary condition can be used, see Section Wall Boundary Conditions.
To activate the dynamic contact angle, check the Dynamic Contact Angle Model checkbox.
Output Dynamic Contact Angle can be selected to output the diagnostic file for contact angle
(RESULT/dyn_contact_angle.dat).
For more information about these methods, the reader is referred to the Multiphase Theory Manual,
Section The Level Set Method .
Interfacial eddy viscosity damping: When using the k -ε model, turbulent viscosity can be
damped in the interface region. Indeed, turbulent viscosity is usually over-estimated in this region,
which results in a damping of the surface movements. Available methods are none, delete,
smoothsign and cubic which suppress turbulent viscosity at the interface.
Surface Tension defines the surface tension between Phase 1 and Phase 2.
Bubble Nucleation Model Bubbles can be inserted during the simulation at a given time by
the user.
To insert bubbles, click . This will open the bubble generator window.
In the Bubble Table the relevant parameters of the bubbles, such as the position and the time where they
should appear, are stored.
Click below the Bubble Table to create a new bubble, then set the time at which it
should appear, its radius and the coordinates of its center.
TransAT will automatically modify the level-set field to add this bubble when the nucleation time is
reached.
A second table, Mdot Table is present in this window. It allows for defining regions with different rates
of phase change. This is available only when the phase change correlation is set to fixed (see MultiphaseTheory Manual, Section Phase Change Modelling ).
Click below the Mdot Table to define a new region.
The first column stores the mdot value that must be assigned to this region, and the next columns store the
parameters to locate the boundary of the regions.
Marangoni Model The Marangoni model enables a temperature-dependent surface-tension
model. One must specify the temperature T weber at which the reference surface tension (as defined in
the Level Set Properties window) is given and the temperature at which surface tension is zero
(T crit). For more information, see Multiphase Theory Manual, Section Marangoni Effect
.
Redistancing
Redistancing Method. The methods available for reinitialisation of the Level Set
functions are: - WENO - Fast Marching 1st order - Fast Marching 2nd order For more information about these methods, the reader is referred to the Equations andAlgorithms Manual, Section The Level Set Method .
Redistancing Steps is the maximum number of cycles to be performed for Level Set
function reinitialisation.
Mass conservation: Two methods are available for mass conservation with Level Set, a
Local method and a Global method. For more information, see the Equations and AlgorithmsManual, Section The Level Set Method . Option Local + Global will use both methods.
Cmin and Cmax are the minimum and maximum values for the mass conservation
coefficient.
Recommendations
Level-Set method can be activated only for unsteady simulations.
Initial value of the Level-Set function must be defined using initialconditions.cxx or
initialconditions.xml. If the distance to the interface is not known everywhere, the user may
give an arbitrary positive or negative value (to define the phase) and use the RedistanceLevel Set function of the initial conditions page (See Section Initial Conditions Input).
When the ratio between density of the phases is high, it is advised to use First-Order Euler
scheme. (See Section Numerical Schemes).
Volume Of Fluid The window where VOF properties are set is shown in Fig. 4.7. Currently the
user only needs to set the surface tension value in the VOF properties window. Features such as
Marangoni effects and phase change are not available for the VOF method.
For more information on VOF method, see the Multiphase Theory Manual, Section The VOF
methodology .
Figure 4.7: VOF properties window
Recommendations
Use the VOF method only for unsteady simulations.
Phase Average
The check-box Phase Average enables using the Homogeneous model or Algebraic Slip model (ASM).
The user should first activate the Phase Average check-box then click to define the parameters of
the model. The Algebraic Slip model adds Drift Velocities to the Homogeneous model. More
information is available in the Multiphase Theory Manual, Section Phase-Average Multiphase Flow
Modelling for the Homogeneous model and ASM.
Please note: when using a multiphase flow method, initial conditions must be defined for the initial
volume fractions. See Section Creating Initial Conditions to define initial conditions.
Homogeneous Model To enable the Homogeneous model,
Select Homogeneous in the Phase Average drop-down menu.
With this model, up to ten different phases can be modelled.
Click to open the dedicated window to set the Homogeneous model parameters Fig. 4.8.
Figure 4.8: Homogeneous Model window
A turbulent dispersion term can be added, which adds to the drift velocity a term due to turbulence.
This term allows for a better description of mixing for turbulent flows.
Please note: The turbulent dispersion term is only available when turbulence is being modelled.
Additionally, it is enabled by default if turbulence modelling is activated.
For more information on the Phase Average Mixture Model, please refer to the Multiphase TheoryManual, Section Phase-Average Mixture Models
Suspension viscosity model can be turned on in order to modify the viscosity of the mixture as an
effect of the phase volume fractions. The user has to give the state of each phase of the mixture.
Suspension viscosity model has then to be defined for each type of dispersed phases: bubbles, droplets
and/or particles. Choices are as follows:
Averaged (only for bubbles and droplets) means that a default volume fraction based
averaging is used for mixture viscosity computation.
None (only for particles) means that the impact of dispersed phase on viscosity is not taken
into account.
Ishii-Zuber
Hydrates enables the hydrate rheology if hydrates model is enabled.
Mooney (only for particles)
Mills (only for particles)
The Maximum packing volume fraction must also be given, which is the maximum volume fraction that can
be occupied by the particles phase, For more information, see the Multiphase Theory ManualMixture
viscosity .
ASM Model An extension to the homogeneous model is the algebraic slip model. To enable ASM,
Select Algebraic Slip Model in the Phase Average drop-down menu.
The window as in Fig. 4.9 is used to set the general parameters for ASM. Some of the parameters are
the same as in the homogeneous model (turbulent dispersion and suspension viscosity model). By
choosing the algebraic slip model, drift velocities will be activated which will make the velocities of the
phases different from each other. Drift velocity will then be computed as a function of the pressure
gradient. This can be set in the Pressure gradient approximation drop-down menu. If
Hydrostatic is selected instead, the pressure gradient is computed by ρg, allowing for faster
computations.
Figure 4.9: ASM Window
For ASM, drag, lift and wall lubrication models need to be defined. These models are
chosen within the Phases Interactions tab, Momentum Transfer section. Refer to 4.3.1
for information about defining the interphase slip models. Examples of the interphase slip
models include; drag models of stokes, clift, tomiyama and schiller; lift models of auton
and tomiyama; and wall lubrication models of antal, frank, hosokawa and tomiyama. The
slip models are described in the Multiphase Theory Manual, Section Algebraic Slip Model
.
Phase Change Modelling
This section describes the Phase change modelling capabilities of TransAT. Phase change modelling is
turned on by clicking the corresponding check-box. Currently, phase change is available with Level-Set
and Phase-Average multiphase models.
Clicking opens the Phase Change Parameters window.
Please note: The options displayed in the Phase Change Parameters window depend on the type
of Multiphase Flow Method selected (i.e. Level-Set or Phase Average).
For the Level-Set method (Fig. 4.10) the following phase change correlations are available:
Figure 4.10: Phase Change Properties window with Level-Set multiphase model
None: the mass transfer rate ṁ is directly calculated from the energy/temperature equation.
Values for Latent Heat and Saturation temperature must be given by the user.
Fixed: the value of ṁ should be specified in the input file via the variable Rate in SI units
. Moreover, it must be set whether evaporation or condensation occurs using the
Phase Change list.
Hiemenz, Lim wavy and Lim smooth are global correlations for phase Change. They are
explained in the Multiphase Theory Manual, section Phase change modelling . Values for
Latent Heat and Saturation temperature must be given by the user, as well as velocity
and length scales for gas and liquid phases.
Interface Mass Transfer models are local correlations for phase change, explained in the
Multiphase Theory Manual, section Phase change modelling . Values for Latent Heat and
Saturation temperature must be given by the user. The type of interface mass transfer
model must also be selected, as well as the way of computing the turbulent Reynolds number
and the reference phase to compute it.
Curvature correction of saturation temperature will adjust the saturation temperature as a
function of liquid-gas curvature and surface tension (available only for Level-Set).
Meniscus model accounts for heat transfer near the triple point (solid-liquid-gas point). It can only be
used when the Correlation is set to none.
When using the Phase Average multiphase model, the following options are available (Fig. 4.11):
Please note: With the Phase Average model, phase change occurs between phase 1 and 2 only. This
means that if the phase change model is activated, the state of the first two phases must be Liquid and
Gas.
Please note: With the Phase Average model, wall phase change will not be applied for immersed
surfaces of conjugate objects.
Figure 4.11: Phase Change Properties window with Phase Average multiphase model
The Latent Heat Method input offers two options for the value of the latent heat:
constant: a value needs to be specified
variable: in this case a scrolling list appear at the botton of the window and the user must
choose between the available materials (water and ammonia).
The Thermally Limited Phase Change option is available only if solving for Temperature. It
contains the following entries:
Dispersed phase Nusselt correlation: possible options are Ranz-Marshall or None. Refer
to the Multiphase Theory Manual, section Dispersed-phase phase change for more details.
Interfacial Shear HTC (heat transfer coefficient) model: possible options are
Banerjee model or None.
Interfacial diffusion HTC model: Schrage, Relaxation and None are the possible options.
Tsat method: two options are possible: either Constant or Variable. In the first case a value
must be entered, in the latter a saturation curve must be defined. See 4.1.3 below for details
about saturation curve.
Activate wall boiling model with or without Condensation Inside.
Deactivate Condensation Inside turns condensation ON or OFF in the bulk of the
flow in the scenario of Subcooled Boiling Flows.
The Inertial Phase Change / Cavitation model section is available for both compressible and
incompressible flows. Two cavitation models are available:
Sauer correlation: the two model parameters nucleate density and minimum radius
must be given. Refer to the Multiphase Theory Manual, section Sauer cavitation model for
more details.
Singhal correlation: can only be used if Turbulence Modelling is activated. Refer to
the Multiphase Theory Manual, section Singhal cavitation model for more details
The Psat method can either be
Constant: a value needs to be entered
Variable: a saturation curve must be defined. See 4.1.3 below for details about saturation
curve.
For more information on Phase change models, please refer to the Multiphase Theory Manual,
sections Phase change modelling (for Level-Set method) and Phase change in the bulk (for PhaseAverage method).
Saturation Curve The saturation curve is defined within the Phase Properties. Phase 1 and 2
will have a Saturation Curve method available to choose from. This allows pre-defined curves from
Ammonia or Water. Also, the Antoine equation is available, with the corresponding A, B and C
model parameters. If using the Antoine equation, model parameters for various materials can
be found in literature or reference material. The saturation curve for phase 1 and 2 must
be the same (i.e. same Antoine model parameters, or defined from the same phase). More
information about defining the Saturation Curve is available in the Phase Properties section
4.2.14.
Lagrangian Particle Tracking
It can be used by selecting the Lagrangian Particle Tracking Model in the Physical Model tab.
The particle positions and velocities are updated at each time step in conjunction with the carrier flow
field which evolves in time. Particle Tracking theory is available in the Multiphase Theory Manual,
Chapter Particle Tracking Models .
Properties Here is a list of available parameters that can be set by the user in the Properties tab
of the Lagrangian Particle Tracking window.
Particle density: density of particle material.
Heat Capacity: heat capacity of particle material.
Thermal Conductivity: thermal conductivity capacity of particle material.
Computational ratio: decides how many particles are computationally tracked as
compared to the real number of particles dictated by the volume fraction. This factor is
important only for two-way coupled cases. It is an integer ≥ 1.
Volume fraction: Total initial volume fraction occupied by particles.
Number of particle size bins: number of particle diameter groups
Diameter Discretization : the distribution of diameters between minimum and maximum
diameters (Linear or Logarithmic law).
Diameters: Minimum and maximum particle diameters
The parameter Size PDF Function decides how the number of particles in each size group is
computed. The option Constant Mass divides the total volume fraction equally for each group
resulting in less particles in the large size groups. Constant NP results in equal number of particles
in each group, and the Log normal distribution option uses the standard log-normal distribution
Apte et al. (2003).
(4.3)
where dp+ = dp∕(dpmax- dp), and Dnm+ = Dnm∕(dpmax- Dnm) are the normalised particle
diameters , dpmax is the upper limit of particle diameter(Log Normal Dmax), Dnm the mean
(Log Normal Dmean), σ0 the standard deviation (Log Normal Sigma), and a0 a factor used
to normalise the distribution.
Physics Here is a list of available physical models that can be set by the user in the Physics tab of
the Lagrangian Particle Tracking window.
Momentum Coupling: Particle-fluid coupling (One-way or Two-way).
Two-way Coupling: provides two ways in which the fluid-particle interaction force is
distributed back to the fluid grid. When it is set to Particles in Cell the force on each particle
is distributed to the cell in which the particle is located. When set to SundaramSundaram
& Collins (1999) the force is put back on to all the nodes which formed the interpolation
stencil to obtain the fluid velocity at the particle position.
Hold Particles Fixed: do not move particles
Strong F-P Coupling: recalculate fluid-particle force inside implicit iterations
Solve Temperature: solve for particle temperature
Solve Angular Velocity: solve for the angular velocity of particles
Dense Particles Method: account for non-dilute particle suspension
Volume Fraction Method: method to calculate volume fraction of particles
Particle Sources: introduce particle sources
Forces Here is a list of forces that can be calculated by TransAT. They are available in Forces
panel.
Drag force, with Shiller-Naumann or Clift Gauvin Model.
Max. Particle Re denotes the maximum particle Reynolds number that is allowed by the
user. If at any time a particle acquires a higher value the program is stopped. This is based
on the limitations imposed by the equations governing the particle motion.
Buoyancy force
Lift force with Auton or Saffman Model. For Auton model, the Lift Coefficient must be
given.
Added-mass force
Fluid force
Basset forcePlease note: This module is currently deactivated.
ThermophoresisPlease note: This module is currently deactivated.
Axisymmetric SwirlPlease note: This module is currently deactivated.
Convective heat transfer
Magnus lift force for the angular velocity model.
Shear Torque for the angular velocity model.
Collision pressure model can be used using Snider (2001) or Johnson & Jackson (1987)
model. For both of these models, the close packing volume fraction and particlerestitution must be given.
Langevin particle dispersion model can be applied. The user must give the Intensityfactor and fluid time scale factor for this model
Approximate deconvolution for LES of particle-laden flows.
Please note: The forces that are to be included are to be explicitly chosen by the user based on the
relevant physics of the problem at hand. None of the forces are hard-wired. For example, in the case of
bubbles it is left to the user to turn on the added-mass force.
Numerical The Interpolation method is the order of interpolation to evaluate the fluids
properties, such as velocity, temperature, …at the location of the particle.
The Time integration provides methods to solve the particle variables such as velocity, position,
temperature, angular velocity. Time stepping control is the method of controlling the time step: fluid
CFL number or response time can be used.
The parameter Response time factor is used to return the maximum allowable time-step from the
particle side. The smallest particle response time (τp,min) is multiplied by this value to arrive at the
maximal time-step. Response time factor can be as high as 0.9 for 4th order Runge-Kutta time
integration and should be maintained below 0.4 for the Adams-Bashforth and 2nd order Runge-Kutta
methods.
Initialise In Initial Particle Location, the user can define the initial position of particles as the
intersection of Primary and Secondary Volumes.
The parameter Random Series with the option fixed allows repeatability when using random numbers
(to initialise the particle positions). The geometrical properties of these volumes has then to be
defined.
In this intersection, the Particle Distribution can then be defined. If it is random, defining the
Random series as fixed, allows repeatability when using random numbers to initialise the
particle positions. Changing Random seed changes the random distribution for fixed random
series.
In the panel Initial Variable Values, checking Velocity equilibrium will initialise particle
velocity equal to the fluid velocity. Otherwise, Mean velocity and RMS velocity must begiven.
Temperature equilibrium uses fluid temperature as initial particle temperature. If it is not checked,
Initial temperature can be defined for particles.
Angular velocity equilibrium uses fluid angular velocity as initial particle angular velocity. If it is
not checked, Initial angular velocity can be defined for particles.
Read particle data from file initialises particles with parameters defined in read_particle.ini. Each
line represents the set of parameters used to initialise a particle. The set of parameters that must be
defined are:
the time of particle initialisation tinit,p
the particle diameter d
the particle initial position (xp,yp,zp)
the particle initial velocity (up,vp,wp)
the particle initial temperature Tp (when solving for particle temperature only)
read_particle.ini should be formatted as such:
tinit_pdx_py_pz_pu_pv_pw_p(T_p) ...
Example
In the following example, two particles with the following parameters are initialised through
read_particle.ini:
Particle 1
tinit,p = 0.0s
d = 0.5mm
(xp,yp,zp) = (2.0,0.0,0.0)m
(up,yp,zp) = (0.0,0.0,1.0)m.s-1
Tp = 300K
Particle 2
tinit,p = 5.2s
d = 1mm
(xp,yp,zp) = (0.0,3.0,1.0)m
(up,yp,zp) = (0.5,0.5,0.0)m.s-1
Tp = 350K
The corresponding read_particle.ini file consists of the following lines:
Particle 1 will be initialised at the beginning of the simulation (t = 0s). Particle 2 will be added
at the specified location with the specified properties after the simulation has reached a time
of t = 5.2s. Particles with negative time values will be initialised at the beginning of the
simulation.
Boundary Conditions The Wall interaction defines the behaviour of particles when they hit a
wall. They can be Reflected or Absorbed. Wall friction coefficient and coefficient of restitution can
also be given.
Symmetry interaction defines the behaviour of particles when they hit a symmetry boundary, in the
same way as for a wall. Particles can be Reflected or Absorbed.
Particle Inflow Type is used for inflow condition. If Per cell is selected, particle volume fraction for
the inflow will be verified for each cell. With Per boundary, only the average for the boundary will be
verified, and volume fraction can vary from cell to cell.
The parameter Random Series with the option fixed allows repeatability when using random
distribution of particles for boundary conditions. Changing Random seed changes the random
distribution for fixed random series.
Output In Variables for Output, Particle Step defines the ratio between simulated particles and
output particles. If the value is more than 1, Random Output enables one to select particles
randomly. The particles variables to be output have then to be defined.
The following options can be selected:
Write Old Velocity: writes the particle velocity at the previous time step.
Write Particle cell: writes the cell that contains the particle.
Write Fluid Velocity at Particle Position: writes the velocity of the surrounding fluid
interpolated onto the particle position.
Write Particle Temperature: writes the particle temperature.
Write Particle Rotation: writes the particle rotational velocity.
Write Particle Torque: writes the particle torque.
Finally, Post Processing provides several outputs to be written as functions of time during
simulations.
Store collision data: logs all collision events of particles with a wall boundary or an
embedded interface and writes corresponding information to the file collision_data.dat in the
RESULT folder of the simulation.
Store particles leaving: stores information for each particle that is leaving the domain
through any permeable boundary (time, diameter, position and velocity) and writes it to
the particles_leaving.dat in the RESULT folder of the simulation.
Please note: The format of the particles_leaving.dat file written by selecting the Store particles leaving
postprocessing option is compatible with the feature Read particle data from file in the Initialise
tab. These files can be used for example to simulate the transition of particles into an adjacent
domain
4.1.4 Multiphysics
The Multiphysics section of the Physical Models contains more physics models. Clicking Multiphysics
will show these available models. The Multiphysics models include the Species and Reaction, the
Hydrate Model, the Radiation Model and the Viscoelasticity Model.
Reactive Flow Modelling
Activating the reactive flow solver of TransAT is done by checking the box Species and Reaction. The
window for the model properties (Fig. 4.12) opens after clicking .
Please note: As of TransAT version 5.7 the surface and porous interface reaction modules are
deprecated and not available anymore in TransATUI.
The Cantera library can be used with TransAT to evaluate material properties and import complex
reaction mechanisms. If the Cantera database is used an input file (cantera_input.cti) has to be in the
working directory. The syntax of the Cantera input file is described in the section Cantera Input File
document Cantera_Input_Manual. Theory for reactive flow modelling is available in the Equations &Algorithms Handbook, Chapter Reactive Flow Modelling
Figure 4.12: Reactive Flow Properties window
The definition of a reaction in a mixture consists in three main steps:
setting the general parameters for reactive flows
defining the components with their properties
defining the reactions
Reaction Model The reaction rate is modelled using the finite chemistry approach with Arrhenius
reaction constants, called Mass Action Kinetics. The reaction rate is proportional to the reaction
constant and the reactant concentrations raised to the reaction order. More detail can be found in the
Define the reactions section.
Number of Subiterations is the number of subiterations over all the species transport equations in
every global iteration. This should be increased if the species are strongly coupled, or for problems with
fast reaction and high heat release (i.e. combustion). Constraint Species If this check-box is activated, a transport equation is solved for each
of the species. If this box is deactivated the mass fraction of the species with the highest
average mass fraction is calculated as one minus the sum of the remaining species mass
fractions.
Cantera Phases The Cantera Database checkbox has to be activated if the Cantera
database is used for evaluating properties or importing reaction mechanisms. In this case an additional
input file cantera_input.cti has to be present in the working directory. (See also section cantera input
file). If the Cantera database is activated the text input fields in the Cantera Phases frame have
to be completed. For homogeneous reactions it is sufficient to add a name in the Fluid
field.
The Cantera input file For most cases the syntax of the Cantera input file is simple. Here, we
will consider a case with one reaction and three components. First an ideal gas mixture
needs to be created. It should use the same name that was used in the TransATUI (MixtureInput) for the fluid phase in the frame Cantera phases. In this example the name ‘gas’ was
chosen.
ideal_gas(name = "gas",
elements = "H O",
species = "gri30:O2 H2 H2O"
transport = "Mix"
)
The mixture contains the species O2, H2, H2O which contain the elements H and O. The elements
always have to be the element name in uppercase letters because some data (e.g. molar weights) are
directly linked to these elements. The term gri30 in front of the species names indicates that the
thermodynamic data and the transport properties are imported from the gri30 (gri30.xml)
mechanism.
Note that species can be imported from any mechanism that is present in the folder
transatMB/properties_database/cantera_data in the xml format.
The transport keyword defines the transport manager used for the transport properties. The mixture
transport model is the appropriate model to be used with TransAT. To define the reaction
add:
reaction( "2 H2 + O2 => 2 H2O", [1.0, 0, 45])
The terms in square brackets specify the Arrhenius reaction constant ([“pre-exponential
factor”,“temperature exponent”, “Activation Energy”]).
Several sample input files are present in the aforementioned folder cantera_data.
Diffusion Model The simplest model is to use the same coefficient for all species: set the
Diffusion Model to Constant, and set the constant value of the Diffusion Coefficient.
A more accurate model available is the mixture model. The mixture model can only be used in
conjunction with Cantera. The diffusion coefficient of species k is evaluated under the assumption that
all other species have equal diffusion velocity. This leads to a mixture diffusion coefficient
Dkm for every species. As unequal diffusion coefficients do not guarantee conservation of
mass (the mass weighted diffusion velocities do not sum to zero), a correction has to be
applied to ensure mass conservation. This can be done by constraining one species, which
is particularly convenient when one species is always in excess (see Solve constrainedcomponent).
Define the components and their properties The components can be added by clicking the
button below the Components table. A new line will appear in the component table where one can
enter the component name in the first column and specify the molar weight in the second column.
By default the properties of the mixture are constant and set in the Phase Properties
window.
Define the Reactions Having defined all the components the next step is to define the
reactions. Note that only simple homogeneous reactions can be defined with TransATUI. Homogeneous
reactions with a more complex reaction rate expression such as pressure-dependent reactions can only
be specified in the Cantera input file. To learn how to define reactions in the Cantera input file refer to
the document Cantera_Input_Manual.
If the Cantera database is used (i.e activation of Cantera Database), all the reactions have to be
defined in the Cantera input file.
To define a new reaction,
Click the button below the reaction table which opens the Reaction Creator window
(Fig. 4.13).
In Reaction Creator window, click to add reactants and products in the bottom left
corner of the corresponding frame.
Use the drop-down menu in the Name column to choose the reactant/product from the
list of components.
Fill in the Stoichiometric Coefficient and the Reaction Order in the corresponding
columns. Note that the default value for Reaction Order is -1, meaning that the Reaction Order
is equal to the Stoichiometric Coefficient.
For volumetric reactions with the reaction model Mass Action Kinetics, the reaction rate
coefficients have to be provided (Temperature Exponent, Pre-exponential Factor,
Activation Energy).
If Cantera Database is switched off and Activate Chemical Heat Source is activated
the Reaction Enthalpy has to be specified. If Cantera Database is activated, the
reaction enthalpy will be calculated automatically from the enthalpies of the components.
Once all the parameters are set, click to save the settings and close the ReactionCreator window.
The reaction definition should now appear in the Reaction column.
Figure 4.13: Reaction Creator Window
To delete a component or a reaction, check the delete check-box at the lines corresponding to the items
to be removed then click below the table.
Reactions can also be edited by clicking edit at the corresponding lines in the list of reactions.
Hydrate Model
The Hydrate Model can be used to define interactions between phases. Activating Hydrate Model
will allow the user to edit the Phase Interactions. In order to activate the Hydrate Model, PhaseAverage needs to be activated with at least three phases. More information can be found in the Phase
Interactions section.
Radiation
This section describes the Radiation modelling in TransAT. Radiation is activated by clicking on the
checkbox adjacent to it.
There is one option only: Rosseland model.
In the Phase Properties, the user can enter the coefficients for all phases and specify the different
radiation bands to be taken into account. For a particular band, a separate set of coefficients can be
entered, making the formulation flexible to accurately calculate the Rosseland Extinction
Coefficient.
Note that solving for the temperature equation is required to activate the radiation model, and that for
multiphase problems, the homogeneous or Algebraic Slip models have to be used, whereas it is not
possible to use the level-set model.
Viscoelasticity
This section describes the viscoelasticity modelling capabilities in TransAT. Viscoelasticity is activated
by clicking on the checkbox adjacent to it.
There are several model options to choose from: Oldroyd-B., linear PTT and exponential PTT. The model
choice will determine the complexity of the modelling and the number of model parameters
required. In addition, the user must specify the number of viscoelastic modes considered in the
problem, and specify if the LCT formulation (Logarithm of Conformation Method) is to be
used.
In the Phase Properties, the user can enter the model parameters for each phase and each
viscoelastic mode, by selecting Non-Newtonian in the viscosity method, and Viscoelasticity in the
drop-down lists. Depending on the choice of the model, the following model parameters may be
required:
the elastic relaxation time λ (all models)
the polymeric viscosity μp (all models)
ϵ (PTT models)
ξ (PTT models)
In addition, it is possible to include a temperature dependence of the polymeric viscosity to the
temperature by activating the Arrhenius Tmperature Dependence model.
4.1.5 Additional Features
Additional Features
contains supplementary geometric and physical models. The Additional Features include
Axisymmetry, Vibrating Body Force, Point Sources, 1-D Coupling, and Rotating Reference
Frame.
Axisymmetry
Axisymmetric flows can be solved for with TransAT by checking the Axisymmetry check-box.
In axisymmetric setups, cylindrical coordinates are used instead of Cartesian ones. Note that
axisymmetric simulations are limited to the x-y plane, with y representing the radial component and x
the axial component. The axis of symmetry is defined at the line y = 0 (and therefore along the
x-axis).
For more information, please report to the Equations and Algorithms Manual, Section Axisymmetry .
Vibrating Body Force
An oscillating force can be applied with TransAT by using the Vibrating Body Force capability. To
apply an oscillating force,
Check Vibrating Body Force then click to open the window where the body force
parameters are set (Fig. 4.14).
The following parameters can be set in that window
The Frequency of the oscillation (in Hz)
The Phase of the oscillation (in deg)
The Amplitude of the displacement (in m)
The coordinates of the point where the oscillating force is to be applied
The Start Time and End Time for the application of the body force.
Click to save the settings and close the Body Force Properties window
Figure 4.14: Body force window
Periodic Conditions
When cyclic boundary conditions are used, a pressure source term can be added. This is
done in the Periodic conditions panel (Fig. 4.15). To apply pressure forcing to cyclic
BCs,
Check Periodic Conditions
Then click to open the window
From the first choice, choose whether to define the superficial velocity or pressure gradient
Choose which phase(s) to define pressure forcing for (if multiple phases)
Define parameters in the X, Y or Z directions
A choice drop-down can choose between defining a superficial velocity or pressure gradient. Next, a spinner
shows for which phase to set a velocity or pressure gradient. It is therefore possible to have a different
magnitude and direction of pressure forcing for each phase.
Superficial velocity specifies a bulk velocity in the fluid domain, i.e. the space-average velocity over
the whole fluid domain. It is not possible to define a velocity profile. However, a fully developed flow will
naturally occur from periodicity during a transient phase early in the simulation. This profile is
dependent on the geometry for the flow.
If defining pressure gradient instead of the superficial velocity the pressure source term is
directly set. The user must define the components of the source term in the desired directions.
The settings take effect for surfaces where cyclic BCs have been set. Cyclic BCs must be assigned on
all surfaces in the directions where the pressure forcing term is enabled. Cyclic BCs require careful setup
and in general are applied to domains with simple geometries. To assign cyclic boundary
conditions to surfaces the reader is referred to Assigning a boundary condition to a surface.
Figure 4.15: Periodic Pressure Forcing Panel
Point sources
Point sources can be positioned in the domain by activating the Point sources. After activating Pointsources, the icon will appear.
To create point sources and set their parameters
Click opens a window where you can define point source for mass, momentum, heat or
concentration.
In the window that popped up, click to create a point source.
To define a point source, the following parameters need to be set:
Coordinates of the point (X coor, Y coor, Z coor)
Start Time and End Time are the times at which the point source is activated and
deactivated.
Other values, depending on the type of the source, must be defined. When a mass source is
created, the velocity and temperature at which the phase is injected must be defined.
Also note that a point source can be deleted by clicking Delete at the end of the corresponding line in the
point source table.
Coupling modelling
The Coupling modelling of TransAT can be enabled by clicking the corresponding check-box. The
coupled code has to be chosen among the list:
OLGA (supported version is 7.2)
When coupling modelling is enabled, next the coupling parameters need to be set.
Click to open the Coupling Model properties window.
The coupling algorithm parameters are listed as follows:
Shared location folder defines the location of the folder where the coupling data is
written.
Learning method determines which method to be applied for computing a new pressure
guess. If it is checked, history points are taken into account to predict the pressure value,
otherwise the pressure constraint method is employed.
Number of history points is shown only when Learning method is checked. It defines
how many history points are involved in the learning method.
Max global number of iteration factor is shown only when Learning method is
unchecked. It defines the factor for internal coupling boundary pressure iterations. A value
of 5 is usually a good trade-off between simulation-speed and stability of the coupling model.
Time stepping coupling tolerance defines the tolerance when the two solvers read the
data of the other solver. The default value of 1.0e-5 was found to give good results.
TransAT oil phase index defines the numbering of the oil phase defined in PhaseProperties.
TransAT gas phase index defines the numbering of the gas phase defined in PhaseProperties.
TransAT water phase index defines the numbering of the water phase defined in PhaseProperties.
The exclusive parameters for OLGA(Fig. 4.16) are listed as follows:
Module name is the name of the module specified in OLGA.
Model name is the name of the model specified in OLGA.
Time step can be forced to be in a specific range compared to TransAT time step. If the
1D-code is freely allowed to choose its own time-step, regardless what it chosen by TransAT,
the coupling model can become unstable. A good suggestion is to take the 1D-code time
step being in the range [0.5 - 2] * TransAT time step.
Figure 4.16: OLGA coupling Model window
Rotating Reference Frame
A rotating reference frame can be defined with TransAT by checking the Rotating reference frame
check-box.
Opening the properties window for defining a rotating reference frame, inputs are available to define
the center of rotation as well as the angular velocities for the rotation. The angular velocity is defined in
radians per second. After clicking to save and close the settings, the rotating reference frame will be
applied once the simulation is executed.
4.2 Phase Properties
When clicking the Phase Properties button, the Phase Properties page is opened, as shown in
Fig. 4.17.
Figure 4.17: Phase Properties
The properties of the phases are defined in that page. It is separated in two sub-windows:
A catalog of phase properties, represented within a tree structure, as shown in Fig. 4.19
The sheet related to the item chosen on the catalog, as shown in Fig. 4.18
The sheet provides input boxes to enter in values of the various properties. The catolog gives an overview of
all the phases and properties per phase. By default, the tree is collapsed, but can be expanded by
clicking on the plus box per item in the tree.
Figure 4.18: Sheet
Figure 4.19: Catalog
4.2.1 Material Library
The user can enter pre-defined properties using the catalog displayed for each phase on the sheet, as
shown in Fig. 4.20
Figure 4.20: Choice of a pre-defined material
4.2.2 Density
For incompressible simulations, a fixed density can be defined for each fluid. For a compressible setup,
an equation of state can be chosen for defining the density. For more details on the equation of state and
possible settings refer to section 4.2.11.
4.2.3 Viscosity
Assuming that the simulation solves for velocity, viscosity can be defined through several methods. A
fixed viscosity can be defined by choosing a constant viscosity for a fluid. For a temperature dependent
viscosity, the curve fit option can be selected. For more details on defining viscosity in this manner, refer
to section 4.2.8. Another possibility is to define viscosity by Sutherland’s Law, which is described in
section 4.2.9. Or, fluids can be set as Non Newtonian, through various methods such as Bingham, a PowerLaw, Carreau or others. Viscosity through Non-Newtonian models are described in section
4.2.10.
4.2.4 Temperature related fluid properties
For simulations that solve for temperature, corresponding properties need to be defined for the fluid.
These include thermal conductivity, thermal expansion, and heat capacity. Each of
these can be set with a fixed value. Thermal conductivity can instead be defined by curve fit
method or Sutherland’s Law. For heat capacity, curve-fit method is the only additional method
available.
4.2.5 Concentration Diffusivity
Solving for a passive scalar (activated by concentration, under equations), it is necessary to
define a diffusivity. For multiple phases, the diffusivity can be defined uniquely for each
phase.
4.2.6 Species Diffusivity
Additional to Concentration, TransAT can also add species to a simulation for reactions. These species
also need a value for the diffusivity. Unlike concentration, multiphase simulations are not possible with
species. For species defined in a simulation, the diffusivity is defined by the transporting fluid, i.e. the
only phase in the Phase Properties tab.
4.2.7 Boussinesq Approximation
The Boussinesq approximation can be used to solve natural convection problems without having to solve
the full compressible Navier-Stokes equations. The Boussinesq approximation is applied in
TransAT by setting the value of the thermal expansion coefficient for each phase and the
reference temperature in the reference properties under Physical Models (see also section
4.1.2). Please note: The Boussinesq approximation only affects the gravity term in the Navier Stokes
equation and will have no effect on any other terms.
4.2.8 Curve-Fit
Viscosity, heat capacity or thermal conductivity can be defined by the user as a function of the
temperature. To do this, the curve fit method must first be selected in the drop-down list next to the
corresponding property. The file defining the property as a function of the temperature must then be
selected. To select the file with the temperature-dependent values of the physical properties, click
>.
The data file should be in the project folder. Its format is as follows:
# T viscosity --- Use this line for comments
200 7.0e-6
300 11.0e-6
400 14.0e-6
500 17.0e-6
where the first column gives the temperatures and the second column gives the corresponding value of
the property. At least two rows must be present. Hermite interpolation method (cited in Sarfraz (2003))
will then be used. If the data available in the file shows a monotonic behaviour, the method proposed by
Sarfraz (2003) is used to keep monotonicity.
If temperature lies outside the temperature range given in the file, the property will have the same value
as the one given for the lowest or highest temperature.
4.2.9 Sutherland Law
The user may also choose to apply Sutherland’s law for viscosity or thermal conductivity,
instead of setting a constant value for this quantity, by checking the corresponding check-box.
Parameters for this model become accessible by this action. The following properties can be
modified:
The reference viscosity or thermal conductivity
The reference temperature
The Sutherland temperature
Sutherland’s law is described in the Equations and Algorithms Manual, Section Sutherland’s Law
.
4.2.10 Non Newtonian Fluid
In Non-Newtonian fluids, the viscosity, defined by the ratio of stress-to-strain, is not a constant
anymore. A Non-Newtonian model can be used in TransAT to take this behaviour into account. To do
so, Non-Newtonian needs to be selected in the viscosity model drop-down list next to the viscosity
label. Non-Newtonian models can be selected in the new drop-down list will be displayed to the right of
the viscosity model drop-down list.
The following models are currently available:
Bingham: adapted to plastic materials.
Casson: adapted to plastic materials.
Power Law: for pseudoplastic or dilatant fluids.
Carreau: for polymeric liquids.
Cross: for generalized fluids that behave as Newtonian fluids at low shear rates and follow
a power law at higher shear rates.
Carreau-Yesuda: for polymers.
Thixotropic Flows: for fluids with time-dependent rheology like clays, drilling muds, etc...
Hershel Bulkley: generic three-parameter model.
When choosing a model, the corresponding constants that must be set appear in the panel. All
these models are presented in the Algorithms Handbook, Chapter Non-Newtonian Models .
Note that non-Newtonian models are implemented per phase.
4.2.11 Compressible Flows
For compressible flow models, the Equation of state (EOS) of the fluids has to be specified. Several
choices are possible:
The Perfect Gas EOS is adapted for gas. Ratio of specific heats γ must be given, as well as
the Molecular Weight and the Heat capacityCp in the Phase Properties page (See
Fig. 4.17).
The Stiffened Gas EOS is adapted for a liquid. Ratio of specific heats γ, cohesion pressure
p∞ and heat capacity Cp in the Fluid Properties page (See Fig. 4.17) become parameters
to define the fluid density. The fluid will behave as a perfect gas at a pressure of p∞.
The Tait Water equation has been specifically designed for liquid water.
The Tait Ammonia equation has been specifically designed for liquid ammonia.
The Incompressible option enables a user to have an incompressible phase (constant density).
This is useful for mixtures where a phase is compressible but not the other.
Peng-Robinson enables the use of the generic Peng-Robinson equation of state, where by
the user can specify Acentric Factor, Volume Translation, Critical Pressure and Critical
Temperature. Typical inputs for various materials can be found in reference literature.
For pre-defined Peng-Robinson parameters, the Peng-Robinson-Water equation of state for
liquid or vapour -water can be enabled.
TransAT also offers the possibility to calculate the Heat Capacity of a phase using the selected equation of
state (this option is not accessible if the selected equation of state is Incompressible). To use this option
the entry Eq. of State must be chosen in the drop-down list of the Heat Capacity property.
Note that the Ideal Gas, Stiffened Gas and Incompressible equations of state are general in the sense that
a user-input is required. The Tait equation of state for ammonia or water is specific as all the numerical
parameters are pre-entered in TransAT. The user can also select the option Resolution of pressure waves. When this option is turned on,
pressure wave velocities are taken into account when calculating the CFL criterion. This enables
TransAT to capture acoustic waves. Note that the timestep Δt will be much lower when this option is
activated. This option is not accessible if the selected equation of state is Incompressible.
For more information on the equations, models and algorithms for compressible flow, the reader is
referred to the Equations and Algorithms Manual, section Equations of State .
4.2.12 Radiation Rosseland model
If Radiation is activated, then the inputs for the Rosseland model have to be specified for each phase.
This is done in the Rosseland properties window as shown in Fig. 4.21
Figure 4.21: Rosseland model window for radiative properties
The inputs required from the user are the Refraction Index of the phase and the RosselandCoefficients. TransAT’s radiation model uses the extinction coefficient to calculate the radiative
component of the heat transfer, and the Rosseland model allows the user to give either a constant value
of the extinction coefficient (this is when the a0 coefficient is non-zero, and a1 ... a5 are
zero) or a polynomial fit (up to fourth order) to take the temperature dependence of the
extinction coefficient into account. In addition, it is also possible to take into account the
dependence of the extinction coefficient on the wavelength. This is done using the definition of
Radiation Bands. Each band corresponds to an interval between two wavelengths where the
Rosseland coefficients a0 ... a5 can be defined. At least 1 and up to 10 bands are allowed in
TransAT.
For each new band, the maximum wavelength of the band must be provided (in meters). The first
band always starts at 0, and the last one will go up to infinity by default (when the maximumwavelength is defined as -1). Bands must be defined in increasing order of the maximumwavelength.
4.2.13 Viscoelastic model
If Viscoelasticity is activated, then the inputs for the different models have to be specified for each
phase. This is done in the viscoelasticity properties window as shown in Fig. 4.22
The inputs required from the user are the values of the model parameters and the temperature
dependence for each phase.
4.2.14 Phase Change
For simulations including Phase Change between two phases, it is possible to define the saturation curve
between the phases, based on pre-defined phases (available is either Ammonia or Water), or based on
the Antoine equation.
To define the saturation curves from the Phase Properties, set the Tsat method or Psat method
to variable while defining Phase Change settings under the Physical Models, before changing Phase
Properties.
4.3 Phase Interactions
Interactions between phases are defined in the Phases Interactions tab. MomentumTransfer is used to define phase interactions (drag, lift and wall lubrication) for the algebraic
slip model (ASM). In Hydrate Reactions a hydrate formation and dissociation model is
available.
4.3.1 Momentum Transfer
When ASM is activated for the Phase Average, Momentum Transfer between phases becomes
available. This is necessary for the proper definition of miscibility, drag, lift and wall lubrication. Before
these relations are defined, it is first necessary to ensure that the state of each phase is
correctly set to the desired solid, liquid or gas, in the Phase Properties tab, because the
momentum transfer mechanisms depend on this. After setting the state of each phase, the phase
interaction will be automatically initialized to the recommended models for each pair of
phases.
Please note: Modifying the State of Phase input in the Phase Properties tab, resets all
Interphase Slip Relations. Please make sure that state of phases are set correctly, before modifying
the phase interaction tables.
The Momentum Transfer section of TransAT is shown in Fig. 4.23. the drop-down
choice below the title ”Interphase Slip Relations” can be used to switch between each of the
six parameters (miscibility, drag, lift, wall lubrication, lift coefficient and surface tension).
The default table displayed on opening the Phases Interactions is the Miscibility table.
Each of the tables is setup in a similar fashion, with each row representing a dispersed phase and
each column representing a continuous phase. For example in Fig. 4.23, five phases have been defined:
two liquids, two gases and a solid. The row and column labels are each displayed with the name set for
each phase from the Phase Properties tab. Notice also, that the row labels are given with the proper
dispersed phase characteristic (bubble/drop/particle), versus the continuous phases which are labeled as
either gas, liquid or solid.
Figure 4.23: Momentum Transfer
Miscibility Table
Fig. 4.23 shows the Miscibility table, where miscibility is displayed and defined. If two phases are
miscible, the ASM will not calculate a slip between them and their respective phase velocities are equal.
The majority of relations within the table are not available to be set by the user; miscibility can only be
defined for liquid-liquid interactions, thus miscibility is not available to be set by the user for other state
of phase combinations. When phases are of a different state (e.g. gas-liquid, liquid-solid, etc.) the
phases are by default immiscible with each other. The implemented slip model does not
consider direct gas-gas or solid-solid interactions, thus these relations are displayed as ”N/A”.
Shown in the example for the five phases, the liquids have been set to be miscible with each
other.
Some conditions on miscibility include reciprocity and consistency between phases. If one phase is
miscible in a second, then the second is also miscible in the first. Therefore, the miscibility table will be
symmetric. Miscibility must also be consistent between a group of phases. Given three phases, if the first
and second phases are miscible, and the second and third phases are miscible, then the first and third
phases must also be miscible. Breaking this consistency between groups will display a warning and
prevent a simulation from running.
Drag Model Table
The definition of the drag model between phases is available by selecting Drag Model in the InterphaseSlip Relations drop-down menu. The table for defining drag models has a similar structure as the
miscibility table. Rows define the dispersed phase and columns define the continuous phase. The drag
table is shown in Fig. 4.24 for the example setup.
Figure 4.24: Drag Table
Possible drag models to choose from include Stokes, Clift, Tomiyama Contaminated, TomiyamaSlightly Contaminated, Tomiyama Pure and Schiller relations. The various Tomiyama relations
were empirically determined for bubbles in liquids, as such these models are unavailable for
other state of phase pairs. Tomiyama models also refer to the conditions of the liquid, for
example, pure refers to a liquid that has been distilled several times to remove impurities. A
contaminated liquid would not have been distilled, and a slightly contaminated liquid is
inbetween a contaminated and pure liquid. Choosing a drag model from the table is shown in
Fig.4.24
There are certain phase interactions where drag relations are not permitted. This includes miscible
phases, and solids as the continuous phase. Miscible phases do not have a slip and no drag is applied
between them. When the solid is the continuous phase, fluids become trapped inside and there is no
drag relation possible.
Lift Model Table and Coefficient
The definition of the lift model between phases is available by selecting Lift Model in the InterphaseSlip Relations drop-down menu. The usage and restrictions of the lift model table are analogous
to the drag model table. Possible models to choose from are either Auton or Tomiyama.
Tomiyama is again only valid for gas bubbles dispersed in a liquid. For miscible phases,
and solids as the continuous phase, there is no slip and a lift model cannot be applied. The
auton lift model requires a coefficient to be defined. This is accomplished by choosing LiftCoefficient in the Interphase Slip Relations drop-down menu. In the lift coefficient table, the
lift coefficient can only be set for phase interactions where Auton was defined as the lift
model.
Wall Lubrication
The definition of the wall lubrication model between phases is available by selecting Wall LubricationModel in the Interphase Slip Relations drop-down menu. Wall lubrication is a model only applied to
bubbles in a liquid, so the choice of model is only available for corresponding pairs of phases. Models to
choose from are Antal, Frank, Hosokawa and Tomiyama.
Surface Tension
The definition of surface tension between phases is available by selecting Surface Tension in the
Interphase Slip Relations drop-down menu. Surface tension is required for Frank, Hosokawa, and all
Tomiyama models. If one of these models has been selected within any of the model tables, then an
input for surface tension becomes available in the surface tension table. Surface tension must be given a
value greater than zero.
4.3.2 Hydrate Properties
Please note: The Hydrate Reactions can only be activated when Phase Average is chosen as
Multiphase Flow method, with at least three phases defined given that water, hydrocarbon and
hydrate phases are needed to simulate hydrate formation.
The parameters that can be set in the Phase Properties tab are the following:
Hydrate Reactions. The choice is between Bishnoi and infinite. These model are explained
in the Multiphase Theory Manual, Section Hydrates modelling .
Water Phase: defines the phase which corresponds to the water phase, according to
your definition in the Phase Properties tab. Please note: This input is compulsory, as
previously said. Moreover, the phase selected for this input cannot be used in any other
input in the Hydrate Reactions, e.g. in the hydrate phase definition. If the input is not
correctly set, an error message will be displayed in red.
Methanol Phase: defines the phase which corresponds to the methanol phase, according to
your definition in the Phase Properties tab. Please note: This input is not compulsory:
the selection can remain empty, but it must be defined uniquely.
Margins to thermodynamic equilibrium: defines the temperature limits for hydrate
reactions. In the range between the above equilibrium and below equilibrium, there
are no hydrate reactions.
Please note: the model is built such that the user is not allowed to assign the same phase defined in
Phase Properties tab to different inputs of the hydrate model. For instance “Phase1” cannot be the
hydrate model water phase and the hydrate model methanol phase at the same time. The same is true
for the hydrate phases and for the hydrocarbons phases to be defined in the hydrate reactions. Red error
messages of “incompatible values” will be displayed if there is a conflict in the hydrate models
inputs.
In fact, many hydrate reactions can then be defined in the same simulation. One can add a hydrate
reaction by clicking .
To modify a hydrate reaction click edit at the corresponding line.
For deletion of hydrate reactions, click the delete check-boxes of the reactions to be deleted in the
hydrate reaction table then click .
Hydrate Reaction
When adding a hydrate reaction, a sub-window Hydrate Reaction Creator will open. The
parameters to be set in this window are the following:
Hydrate: defines the phase that corresponds to the hydrate phase, according to your
definition in the Phase Properties tab. Please note: The Hydrate input is compulsory. Moreover, the phase chosen cannot be
used in any other inputs in the hydrate model.
Hydrocarbons material: Available materials are:
Methane
Ethane
Propane
Isobutane
Hydrate formation enthalpy: is the heat released for the formation, in Joule.
Hydration number: is the number of molecules of water for each molecule of hydrocarbon
needed for hydrate formation).
The user can then select one or several hydrocarbon phases from which hydrate will form, and one of the
forming phases can be selected as dissociation phase.
One can add a hydrocarbon by clicking .
For deletion of hydrocarbons, click the delete check-boxes of the hydrocarbons to be deleted in the
hydrocarbons table then click .
For information on hydrate formation and dissociation models, please refer to the Multiphase TheoryManual, Section Hydrates modelling .
4.4 Simulation Parameters
The page Simulation Parameters can be accessed by clicking the button of the same
name (Fig. 4.25). This is where the numerics are set. The page is divided in three different
sections:
Simulation Type. In that section, the user can choose between a steady simulation, in
which case the equations are solved to steady-state without taking into account the time
terms, and unsteady simulation.
Control Parameters. In that section, the user can specify more detailed parameters
depending on the simulation type chosen. Please note: Advanced Options in the middle of the window shows all the options for this
section.
Equations Parameters. The user can specify different solver parameters for each of the
equation solved by TransAT. Please note: Solver Options at the bottom of the page shows all the options for the
equations which can be selected in the equation tree to the left. The set of equations is split
into Pressure and Other Variables).
Figure 4.25: Simulation Parameters tab
4.4.1 Control parameters
In this section, one defines the control parameters of the simulation. Most of them depend on the
Simulation Type specified, as described in the following sections.
Steady Simulation Control Parameters
When running a steady simulation, the Number of Iterations must be defined. It corresponds to the
maximum number of iterations to be performed if convergence thresholds are not reached. If the
simulation reaches this number of iterations, it is automatically stopped.
Total simulation time defines the maximum time that is simulated. The simulation stops
when this time is reached. Please note: Start time is 0s.
Max Number of Time Steps is the maximum number of time-steps performed in an
unsteady simulation. It is always useful to fix a maximum number of time-step, so that the
simulation stops even if the total simulation time has not yet been reached.
Initial time step defines the time-step for the first iteration. If adaptive time stepping is
enabled, TransAT will automatically calculate a time step which satisfies the stability limits
and replace the given time step if too large.
Max Number of iterations per Time Step defines the maximum number of iterations
to be performed within a time-step, if the convergence threshold is not reached for all the
variables.
Time Stepping strategy is available to choose from. If Fixed is selected, the time-step will be the
same during the entire simulation, and is defined by the Initial Time Step value. If Adaptive is
chosen, lower and upper bounds for the following non dimensional parameters must be
given:
CFL number is a convection parameter, defined by
(4.4)
It should be noted that the CFL bounds are also used as bounds for the Gravity and
Phase-Change non-dimensional numbers:
(4.5)
(4.6)
Diffusion is a non-dimensional number which takes into account diffusion phenomena. It is
expressed as
(4.7)
where μeff includes material viscosity plus turbulent viscosity or other modifications to local
viscosity.
Surface Tension non-dimensional number is defined by
(4.8)
where δI is the interfacial Dirac Delta function, and ni is the normal to the interface. This
expression is obtained by deriving a surface tension based velocity . (See also Section
Level Set Method)
Fourier non-dimensional number is in relation with thermal phenomena. It reads
(4.9)
Fluid Particle Force criterion is related to Lagrangian particles tracking. It
reads
(4.10)
where fpf is the particle-fluid force, αp is the particle volume fraction and Δx is the cell
size.
Chemical Reaction criterion is applied when mixture reaction is enabled. The criterion is
defined as
(4.11)
where i is the source term due to chemical reactions applied on component i, and Yi is the
mass fraction of this component.
Other Control Parameters
Regardless of the Simulation Type, two more options can be specified:
the Autorelaxation button can be checked to set the relaxation factor for all equations at
once. Lower relaxation parameters mean a more stable simulation, but also a larger number
of iterations before convergence. If Autorelaxation is not used, under-relaxation parameters must be set directly for all the
equations that will be solved. This is done in the Equations section. The effect of the relaxation number is described in the Equations and Algorithms Manual,
Section Final form of discretised equations .
the Pressure-velocity coupling scheme can also be chosen. TransAT currently proposes
the Simple and SimpleC procedures. For more details about these procedures or about
the pressure solvers, see the Equations and Algorithms Manuals, Section Pressure-Velocity
Coupling .
SArP (Smart Adaptive run Parametrisation)
The SArP module is a controller for simulation convergence. The SArP module may stabilise a
simulation and optimise numerical parameters of a simulation to make it converge faster. These
objectives are achieved by tuning:
adaptive time-stepping inputs for unsteady simulations
Autorelaxation
numerical parameters of the solvers (except Convergence Tolerance and RelativeSolver Tolerance) defined in the Equations section of the Simulation Parameters tab
The whole set of these numerical parameters is referred as Chromosome in the present document and in
TransATUI. Likewise, every individual parameter from the numerical parameter set is referred as a
Gene.
The SArP module has two modes which are depicted in Figure 6.1 and Figure 6.2:
Optimisation: call to the SArP module from the start of the simulation to optimise
parameters
Stability: call to the SArP module when convergence issues are detected
Figure 4.26: SArP Stability Mode
Figure 4.27: SArP Optimisation Mode
When triggered, the SArP module automatically sets the numerical parameters by means of an
optimising and learning iterative process (genetic algorithm).
The SArP module can be activated by checking the SArP check-box. The corresponding mode is set
accordingly to the entry selected in the drop-down menu.
SArP triggers
In stability mode, the SArP module can be triggered if either one of the following issues are encountered
while running a simulation:
Residuals are not decreasing over a window of iterations (steady simulations) or at a specific
time step (unsteady simulation)
Solver of an equation does not converge for several consecutive unconverged iterations
The rate of unconverged iterations over a window of iterations (steady simulations) or other
a time step (unsteady simulations) is too high
Slope of time step duration is decreasing (only for unsteady simulations)
Time step becomes too small (only for unsteady simulations)
A jump in the residuals is detected
Note that in optimisation mode, SArP is triggered right from the beginning of the simulation. After the
first execution the SArP module remains activated in stability mode to monitor the convergence of the
simulation.
SArP Advanced Parameters
By clicking , the advanced parameters of the SArP module can be accessed as shown in Figure 4.28.
The advanced parameters are classified into two sections corresponding to the two main
features of SArP, namely a Monitoring section and a Correction and Optimisation
section.
The Monitoring section has one subsection where non-convergence of a simulation is set. The
Correction and Optimisation section has 4 different subsections:
Main Algorithm Properties
Convergence
Genetic Operations
Fitness Approximation
Figure 4.28: SArP Advanced Parameters window for an unsteady simulation
Monitoring The Monitoring section contains the parameters of the convergence monitoring
feature of SArP.
Convergence is monitored over an analysis window whose size can be set in the Analysis WindowSize field. This parameter is used in several settings of the monitoring and correction features of SArP
which will be expanded on in the next paragraphs.
The Residual Analysis Window Size field is only available for steady simulations. This field specifies
the window over which the residuals must be decreasing overall.
Please note: if residuals fluctuate, low values of Residual Analysis Window Size may result in
triggering the correction module of SArP too often hence slowing down the simulation. Using higher
values of Residual Analysis Window Size avoids this potential issue. However it may delay the
triggering of the correction module.
Non-convergence Thresholds The non-convergence thresholds are the set of thresholds that
are used to define the convergence quality of a simulation. They are based on residuals, iteration
convergence and time steps. The set of non-convergence thresholds is the following:
Consecutive Unconverged Iterations: number
of equation-wise consecutive unconverged iterations above which the simulation is deemed
non-converging
Unconverged Iteration Rate rate of unconverged iterations over analysis window
(steady) or time step (unsteady) above which the simulation is deemed non-converging
Max. Residual Ratio: ratio of residuals between current iteration and previous iteration
above which the simulation is deemed non-converging
Unconverged Time Steps: (unsteady only) number of consecutive non-converged time
steps above which the simulation is deemed non-converging
Min. Time Step: (unsteady only) time step value below which the simulation is deemed
non-converging
Min. Time Step Drop Factor: (unsteady only) value of the ratio between the time step
value at the end of the analysis window and the time step value at the beginning of the
analysis window below which the simulation is deemed non-converging
Correction and Optimisation The correction and optimisation of the numerical parameters
is handled by a genetic algorithm. The process of the genetic algorithm is illustrated by
Figure 6.7.
Figure 4.29: Genetic Algorithm Process
If SArP is activated for the sole purpose of monitoring the convergence of a simulation,
the correction module should be deactivated by uncheking Enable Genetic AlgorithmCorrection/Optimisation.
Main Algorithm Properties This subsection groups the main parameters of the genetic
algorithm which are the following:
Configuration: pre-defined settings of the correction module
Evaluations Per Generation: number of fitness evaluations to be performed at every
generation
Max. Generations: maximum number of generations to be evaluated at every call of the
correction module
Max. Parallel Fitness Evaluations: number of fitness evaluations to be performed in
parallel
Max. Genetic Algorithm Runs: maximum number of times the correction module may
be run during one simulation
Enable Roll-Back: perform the correction before the last time step/ iteration where the
non-convergence of the simulation was verified
Two pre-defined configurations can be selected in the Configuration drop-down menu: the fast
configuration and the normal configuration. Fitness Evaluations Per Generation, Max.Generations and Analysis Window Size are greater with the normal configuration. With this
configuration, the space of the parameters is more thoroughly explored. This may lead to better
convergence of the genetic algorithm and make the computational cost of the SArP module
higher.
An evaluation or fitness evaluation consists of a simulation run from the point where the
correction module is triggered. The simulation is run over a number of iterations/time steps
corresponding to Analysis Window Size. A steady simulation evaluation is illustrated in
Figure 6.9.
Figure 4.30: Steady Simulation Evaluation Example
The Enable Roll-Back option for an unsteady simulation is depicted in Figure 4.31. The principle is
exactly the same for steady simulations. As shown in Figure 4.31, the Enable Roll-Back option runs
some preliminary steps before correcting numerical parameters:
restart simulation using the latest restart backup file
stop simulation before the time step/iteration where convergence issues have been detected
launch the SArP module from that point
The offset is determined depending on the detected convergence issue. Depending on the value of
the offset, the simulation may be restarted from an earlier point than the backup restart
file.
Figure 4.31: SArP roll back option
Please note: the frequency of restart backup file can be set in the Output Management sub-tab by
the modifying the Frequency of Restart Backup entry.
Convergence This subsection contains the convergence criteria of the correction module which
are the following:
Stagnating Generations: number of consecutive generations with a stagnating best
solution
Residual Drop Factor: (steady only) value of the ratio between residuals at the end of
the analysis window and the maximum residual at the beginning of the analysis window
Genetic Operations The parameters of the Genetic Operations section determine how the sets
of parameters evolve from one generation of the genetic algorithm to another:
Altered Inputs Proportion: Proportion of numerical parameters to be changed from one
generation to another
Input Variability: rate at which numerical parameter may vary from one generation to
another
Selection Operator: operator for the selection of the best solution
The Selection Operator may be one of the following:
elitism
roulette
tournament
nsga2
spea2
More information can be found on the selection operators in the SArP section of the TransAT AlgorithmsHandbook .
Fitness Approximation Approximation of the optimal set of parameters can be
activated by checking the Fitness Approximation check-box and selecting the corresponding
Learning Method in the drop-down list. The approximation method can be one of the
following:
bagging
decision trees
extra trees
random forest
When Fitness Approximation is activated, the number of evaluation is divided by 2 from the second
generations onwards. Five other sets of parameters are evaluated using the learning fitness
approximation algorithm.
More information can be found on the learning methods in the SArP section of the TransAT AlgorithmsHandbook .
4.4.2 Equations
In the bottom part of the Simulation Parameters tab, the equations properties are shown. On the
left, the available equations can be selected (depending on the setting in the Physical Models
tab).
Equations are divided into subgroups. Clicking the Solver Options check-box at the bottom of the page,
will expand Other Variables into different subgroups, depending on the models used and on the basic
equations solved for.
Multiple selection is allowed using Ctrl + left click. Moreover, when selecting a tree node (symbolised
with a folder in the equation tree), all its subnodes are automatically selected. This is done in order to
facilitate applying changes to similar equations. If you want to unselect one or more subnodes, just use
Ctrl + left click again on these subnodes.
Whenever the user does a selection on a node, the corresponding equation properties are shown on the
right. When using multiple selections, a warning symbol is displayed for the inputs for which there is a
conflict of values.
Please note: the conflict of values for an input simply means that every input is not the same for all
the equations that have been selected.
In order to apply changes on one of the parameters on the right, e.g. the Convergence Tolerance,
the user must first select the equations in the tree, then change the desired value on the
right.
Please note: If one wants to apply the same parameters to all the equations, the root node AllQuantities can just be selected. With All Quantities selected, all the parameters modification will be
applied to all the equations.
Please note: The same parameters can be set for all the equations except for the pressure equation.
For the pressure equation has the same parameters as the other equation except the ConvectionScheme option which is not available for it.
All the Equation Parameters on the right of the Equations panel are described in detail in the
following section.
Equation Parameters
Here, a full description of the equation parameters is given.
Convection Scheme: the convection schemes available in TransAT are
Hybrid: 1st order central/upwind scheme
Quick: 3rd order unbounded scheme
Central: 2nd order accuracy
HLPA: 2nd order bounded scheme
Note that not all the convection schemes are available for each equation. For more information on
the convection scheme, the reader is referred to the Equations and Algorithms Manual, Section
Approximation of convection terms
Convergence Tolerance: it fixes the convergence threshold for each equation.
For steady implicit simulations, the convergence parameter for Other Equations is
suggested to be set at 10-6 or below, and the convergence parameter for Pressure
should be set at 10-2 or below.
For unsteady simulations, it is recommended to use 10-2 for all the equation
convergence parameters.
Relaxation: if Autorelaxation is not selected in the Control Parameters section, then
a different relaxation value can be chosen for each equation by setting the value of
Relaxation.
Solver: the solver can be selected among the following:
GMRES Generalized Minimal RESidual method
SIP Stone’s Implicit Procedure
BiCG Biconjugate gradient method
BiCGSTAB Biconjugate gradient stabilized method
AMG R-cycle, adaptive
AMG R-cycle, geometric
AMG F-cycle, adaptive
AMG F-cycle, geometric
AMG W-cycle, adaptive
AMG W-cycle, geometric
AMG V-cycle, adaptive
AMG V-cycle, geometric
The AMG solvers can be run in different modes (geometric/adaptive) and with different
cycles (V/W/F/R). Adaptive is more expensive than geometric but it can result in a
faster convergence for difficult problems, the same is true for the cycle type (from
simple to complex: V/W/F/R-cycle). For instance, for simple grids and single phase
flows it is recommended to select V-/W-cycle, geometric, same for compressible flows.
F-/R-cycle, adaptive are recommended for incompressible multiphase problems or complex
grids.
Preconditioner: it sets a preconditioner for the solver with the aim of accelerating convergence.
Available preconditioners are
Jacobi
Block Jacobi
ILU: Incomplete LU factorization
AMG: Algebraic Multigrid
AMG cluster: Algebraic Multigrid configured for distributed memory machines like
clusters.
Additive Schwarz
Please note: the Preconditioner option is available only when the selected solver is GMRES or
BiCG or BiCGSTAB. Moreover, AMG, AMG cluster and Additive Schwarz are available only when
GMRES solver is chosen.
Subpreconditioner: a subpreconditioner can also be selected, depending on the solver and on
the preconditioner. Possible options are:
None
Jacobi
ILU
Please note: Subpreconditioners are available only when Block Jacobi or Additive Schwarz
preconditioner is selected.
Max Number of Solver Iterations: for all types of solvers, the maximum number of iterations
when solving a linear system can be defined. This value defines the maximum number of inner
cycles to be performed by the solver if it does not manage to converge. This will not affect the
solver for the other variables.
BMR Iterations: this defines the number of coupling iterations between BMR grid levels.
Please note: It is recommended to use a value of 5 for all the equations except for the pressure
equation, for which it is suggested to use 10.
Relative Solver Tolerance: this parameter defines the relative target tolerance for solving the
linear system of the equation per inner iteration. A value range between 10-2 and 10-3 is
recommended.
Normalised Residue: the activation of this option normalises the residues of the solutions with
respect to the residues at the first iteration.
Relax Linear System: if activated, the linear system is first relaxed and then solved (Patankar
relaxation), otherwise the system is solved unrelaxed.
4.5 Initial Conditions
In the Initial Conditions tab (see Fig. 4.32), initial conditions can be set for variables to be solved
for. Simple initial conditions can be set here, along with advanced initial conditions. Variables defined
with advanced initial conditions will overwrite any basic initial conditions defined. Basic
initial conditions not overwritten will still be used together with advanced initial conditions.
4.5.1 Methods
Basic initial interfaces with the interface-tracking method can be defined in initialconditions.xml. Please
refer to the User-defined Initial Conditions section. For more complex initial conditions, please refer to
the Advanced Initial Conditions section.
The basic set of initial conditions that can be set in the Initial Conditions tab comprises the following
methods:
Automatic
Constant
Userdefined
For velocity components, the Automatic option consists in making the initial velocity field
divergence-free if the fluid is incompressible. For pressure the Automatic option consists in setting the initial pressure field based on the source
terms.
Note that the default Method for all variables is Automatic.
When Method is set to Constant for a variable, the variable field is initialised with a constant value
throughout the domain. The value that is used is the one given in the Value field.
When Method is set to Userdefined for a variable, the variable field needs to be specified directly in the
initialconditions.xml file created by TransATUI.
Please note: an extra input, Sub Method, is available for the phase variables when the Constant
method is chosen and the Species and Reactions option is activated in the Physical Model tab. The
Sub Method option allows the user to specify either mass or mole fractions for initial values of the
species variables.
Please note: the Userdefined method can only be set by editing initialconditions.xml by hand.
Please note: the values set using Advanced Initial Conditions overwrite the basic values set in the
Initial Conditions tab.
4.5.2 Variable tree
In the tree on the left, the available variables can be selected (depending on the models enabled in the
Physical Models tab). The variables in the tree are divided into subgroups.
Multiple selection is allowed using Ctrl + left click or by dragging the mouse. Moreover, when selecting
a tree node (symbolised with a folder in the variable tree), all its subnodes are automatically
selected. This is done in order to facilitate applying changes to one set of variables in one
go. If you want to unselect one or more subnodes, just use Ctrl + left click again on these
subnodes.
4.5.3 Setting parameters
Whenever a user selects a node, the corresponding initial conditions parameters are shown on the right.
When using multiple selections, a warning symbol is displayed for the inputs for which there is a conflict
of values. The warning symbol is displayed in orange for the Method and Value inputs. It is displayed
in red for the Sub Method input.
Please note: the conflict of values for an input simply means that the value for that very input is not
the same for all the variables that have been selected.
In order to apply changes on one of the parameters on the right, e.g. the Method, the user must first
select the variables in the tree, then change the desired value and sub-method (if available) on the
right.
Please note: If one wants to apply the same parameters to all the variables, the root node AllQuantities can just be selected. With All Quantities selected, all the parameter modifications will be
applied to all the variables.
Figure 4.32: Initial Conditions tab
4.5.4 File structure
All the information relevant to the parameters of the Initial Conditions tab are written in the file
initialconditions.xml.
4.5.5 Advanced Initial Conditions
The user can set more advanced initial conditions using the C++ interface to TransAT’s code. The
method to do so consists in creating a C++ subroutine, called initialconditions.cxx.
If variables are to be initialised using advanced initial condtions
Put/copy the file initialconditions.cxx in the project folder if available
Open the project with TransATUI if that is not already the case
In the sub-tab Initial Conditions of the Inputs main-tab, select the Advanced InitialConditions.
The initialconditions.cxx can be opened with an editor from here. If there is not
initialconditions file in the project folder, a template will be copied. After editing the
initialconditions, save and close the file.
Click to test that the file can be compiled (without initializing flow conditions)
Setup the remaining inputs for the simulation.
Once in the Execute window, click to initialize the ICs from initialconditions.cxx
4.6 User Defined Functions
In the User Defined Functions tab (see Fig. 4.33), user defined functions (UDFs) can be defined. A
brief description of how to define UDFs is given in this section, for greater detail and explanation of
UDFs refer to the User-Defined Functions section.
4.6.1 Creating UDFs
Click on the button to define a new UDF. A window will open to define the basic features of the
UDF. First a name for the UDF must be defined. This name must be a valid C++ file name (no special
characters and cannot begin with a number). The UDF name, file name and class name must all be the
same.
After defining the UDF name, a type must be selected. The types of UDFs are organized with
templates. By choosing a template, the UDF will be set with the same type (the type is shown by the
folder that the template is in). If a template is not desired, the choice ”None” can be selected, which
exists within each folder. This is helpful if the file for the UDF already exists in the usercompile folder,
to prevent it from being overwritten.
Once finished defining the UDF, click to create the UDF. If a template was selected, the
implementation (.cxx) and header (.h) files will be copied from the installation directory into the
usercompile folder of the project directory. The UDF can be edited by clicking the button.
A UDF can be removed by clicking . This will not delete any of the files, but prevent it from
being compiled or used during a simulation. Only the UDFs activated in the table of the User DefinedFunctions tab will be compiled and executed. When a UDF is not desired during a certain
run, it can be deactivated using the checkbox, there is no need to delete it from the table.
4.6.2 Compiling and Executing UDFs
To test that a UDF was written properly, click the button. This will compile UDFs activated by the
orange check-box. The text output at the bottom of the tab will display the results of compilation. An
error will display if UDFs failed to compile.
Activated UDFs are compiled automatically at the start of a simulation. This will ensure that
changes to a UDF file will be included.
Please note: UDFs regarding drag models, lift models, and wall lubrication models require
additional steps in order to be executed. Refer to Extended UDF Types for more information.
Figure 4.33: User Defined Functions tab
4.7 Output Management
The last page of the Input Tab revolves around Output Management and Post-Processing
(Fig. 4.36). It is divided into three sections:
Visualization Files sets the parameters for visualization files
Post-Processing defines some post-processing outputs.
Restart Parameters sets the parameters for reading/writing restart files.
4.7.1 Visualization Files
The output of the visualization files and of the restart/backup files are controlled in the OutputManagement tab.
Output File Format input sets the output format for visualization. Two visualization formats are
supported by TransAT: Tecplot files, and vtk file format, which is the standard format for Paraview. The
default option for Paraview is point-data. For further information, please refer to the Paraview User
Manual.
Frequency of output files sets the interval at which visualization files are saved: a value of n means
that visualization files are written every nth iteration/timestep. For unsteady simulation the output
frequency can also be set based on time interval. These files are stored in the RESULT subfolder of the
project folder.
In the file names, xxxx represents the iteration/time-step index, and ext is the file extension, namely dat
for Tecplot files and vtm for Paraview files.
The second part of the tab deals with extra parameters for the visualization files.
These extra parameters are the following:
Averaging If this option is selected, some variables are averaged over time and written
into files. These variables are listed in the Statistics group of Output Variables (note
that this group is greyed out unless the Averaging box is checked)
Clicking opens a dialog window (Fig. 4.34) to set up the following parameters:
Time Step to Start Averaging Before this time step, it is considered that the
system has not reached statistical steady-state, and values are not taken into account.
Sampling Interval determines the number of time steps between samples: a value of
1 means that each time step is taken into account, whereas a value of 10 means that
9 time steps out of 10 are skipped.
Figure 4.34: Averaging
Geometric Series Output: The output is written every 2n timestep / iteration until it reaches
the iteration number reaches the frequency output.
Managing which variables are written in the output files is done in the Output Variables dialog
window, which opens by clicking Output Variables.
Choice of Output Variables
Clicking Output Variables opens the Output Variables window (Fig. 4.35). The variables are
grouped for better readability.
Primary Variables Group The Primary Variables group is always activated.
Pressure: P in the visualization file.
U-Velocity: U in the visualization file.
V-Velocity: V in the visualization file.
W-Velocity: W in the visualization file.
Temperature: T in the visualization file.
Concentration: C in the visualization file. This gives the concentration of a passive scalar,
or the particle volume fraction for settling models.
Material Properties Group
Density: DEN in the visualization file.
Viscosity: VISC in the visualization file. This is the Dynamic viscosity
Heat Capacity: Cp in the visualization file.
Thermal Conductivity: Lambda in the visualization file.
In this group of variables, only Density and Viscosity are always activated. Heat Capacity and Thermal
Conductivity are activated only if temperature is solved for.
Geometry Group
Wall Distance: WallDistance in the visualization file.
Solid Step Function: HEmbI in the visualization file.
In this group, only Wall Distance is always activated. Solid Step Function is activated only if
Immersed Surfaces in Objects is enabled.
Miscellaneous Group The variables of the Miscellaneous group are available only if Compressibility is activated in the
Models and Properties section of the Input tab.
Mach Number: MACH in the visualization file. Only for compressible flows.
Speed of Sound: SOUNDSPEED in the visualization file. Only for compressible flows.
The speed of sound depends on the equation of state that is used to model the fluids. See
the Equations & Algorithms theory manual, Section Equations of state for more details.
Numerical Schlieren Image: SCHLIEREN in the visualization file. Only for
compressible flows. Please refer to Section Compressible Flows for a description of its
evaluation.
Particle Tracking Group The Particle Tracking group of variables is activated only if Lagrangian Particle Tracking is
selected in Multiphase section of the Input tab.
Particle Volume Fraction: Pvf in the visualization file.
Particle Eulerian U-Velocity: Pu in the visualization file.
Particle Eulerian V-Velocity: Pv in the visualization file.
Particle Eulerian W-Velocity: Pw in the visualization file.
Fluid-Particle X-Force: Fluid-Particle X-force in the visualization file.
Fluid-Particle Y-Force: Fluid-Particle Y-force in the visualization file.
Fluid-Particle Z-Force: Fluid-Particle Z-force in the visualization file.
Interface Tracking Group The Interface Tracking group of variables is activated only if Interface Tracking is activated and
Level-Set is selected in the Multiphase section of the Physical Models tab.
Level Set: PHI in the visualization file. This writes the distance to the interface, with
positive value in phase 2 and negative values in phase 1. Only for Level Set method.
Liquid Indicator: HLIQ in the visualization file.
Interface Marker: markerGL in the visualization file.
Interfacial area: IFaceArea in the visualization file.
Interface Curvature: curv in the visualization file.
Multiphase Model Group The Multiphase Model group of variables is activated only if Phase Average is activated and in the
Multiphase section of the Physical Models tab.
Phase Volume Fractions: PhaseAlpha in the visualization file.
Phase Densities: RhoPhase in the visualization file
Phase Velocity: UPhase, VPhase and Wphase in the visualization file
Drift Velocity: Udrift, Vdrift and Wdrift in the visualization file
Phase Change Group The Phase Change group of variables is activated only if Phase Change is activated in the
Multiphysics section of the Physical Models tab.
Phase Change Rate: Mdot in the visualization file.
Reactions Group The Reaction group of variables is activated only if Species and Reaction is selected in the
Multiphysics section of the Physical Model tab.
Mass Fraction: Massfrac:(component name) in the visualization file.
Reaction Rates: rr in the visualization file.
Molar Fraction: Molefrac:(component name) in the visualization file.
Statistics Group The Statistics group is only activated if Averaging is selected in Output Management. The list
of variables displayed depends on the type of model chosen for Turbulence Modelling in the Modelsand Properties section of the Physical Models tab. If Turbulence Modelling is not
activated, or if LES is selected as Turbulence Modelling model, only three variables are
available:
Mean flow: this enables averages for basic properties: PM, UM, VM, WM, TM, CONM,
and also for drift velocities (if any) PhaseUDM, PhaseVDM and PhaseWDM, and mean
phase volume fraction PhaseAlphaM
Normal Stress: U’U’, V’V’, W’W’, P’P’, T’T’ in the visualization file.
Cross Stress: U’V’, U’W’ and V’W’ in the visualization file, and also U’T’, V’T’ and
W’T’.
If the Turbulence model selected is RANS or V-LES, three other output variables are available:
Mean Turb. Kinetic Energy: TKEM in the visualization file.
Mean Turb. Dissipation Rate: EpsM in the visualization file.
Mean Eddy Viscosity Ratio: MutM in the visualization file.
Turbulence Modeling Group The Turbulence Modeling group of variables is activated only if Turbulence Modelling is selected
in the Models and Properties section of the Physical Models tab. The Variables displayed depend
on the Turbulence Modelling choice.
When RANS or V-LES is selected in the Turbulence Modelling drop-down list:
Turbulent Kinetic Energy: TKE in the visualization file.
Turbulent Dissipation Rate: EPS in the visualization file.
Eddy Viscosity Ratio: MUT in the visualization file. Turbulent viscosity ratio ;
Turbulence Production: TProd in the visualization file.
If LES is chosen in the Turbulence Modelling drop-down list:
SGS Viscosity Ratio: SgVis in the visualization file. (SGS= Subgrid Scale)
Turbulent Prandtl Number: TPrandtl in the visualization file.
Turbulent Prandtl Number is available only if Turbulent Prandtl Number Model is not constant
in LES model properties.
Hydrates Group The Hydrates group of variables is activated only if Hydrate Model is selected in the
Multiphysics section of Physical Models tab.
Please note: Hydrate Model is only available when Phase Average is selected as Multiphase Flow
method and when the number of phases is bigger than 2.
The list of variables for this group is the following:
Formation Rate: Hydrate Formation Rate in the visualization file.
Equilibrium Temperature: Teq in the visualization file.
Figure 4.35: Output Variables Window
4.7.2 Post-processing panel
This section enables the user to set post-processing parameters and outputs. Their use is described later
in the Section Data Processing.
4.7.3 Restart Parameters
In the third section, Restart Parameters of the restart files which allow restarting simulations are
set.
Frequency of restart files and Frequency of Backup files gives the interval at which
restart files should be saved: a value of n means that restart files are written every nth
iteration.
Restart files are stored in the project folder. They are named <project_name>.runa for
ASCII format or <project_name>.runb for binary format. The restart file is overwritten
as soon as another restart file is produced.
A restart file called properties.dat.runb is also created for restart properties of objects.
This is always saved with the extension runb; the format cannot be changed.
Backup files are stored in the same folder. They are named <project_name>.xxxx.runa
and <project_name>.xxxx.runb for ASCII and binary format respectively. “xxxx”
represents the time-step index. Note that these files are stored and not overwritten.
A backup file is also stored for the object properties, named properties.dat.xxxx.runb.
Restart Read Format and Restart Write Format lists enable choosing the format
of the restart file that can be read and that of the restart and backup files written
during the simulation. ASCII format is larger but can be used on any machine, while
binary format produces more compact files which might not be readable on an other
machine.
Figure 4.36: Output Management tab
Chapter 5 Running a Simulation
The last tab of the GUI is the Execute tab. Fig. 5.1 gives an example of how this tab looks like
when a simulation is running. There are mainly 4 elements displayed which will be further discussed in
this chapter:
This part of the execute window controls the solver. Simulations can be started, stopped and
restarted.
5.1.1 Running TransAT
To run simulations, it is important the project is saved and all solver input files generated. The
manual way to do this:
to save project and models parameters, click Files then select Save. Every change in the
TransATUI - Input tab requires this step before a simulation can be started.
to write the necessary files to run the simulation such as the mesh and the boundary
conditions file, click Files then select Prepare Simulation Files. Every change in the
TransATUI - Geo/Mesh tab requires this step before a simulation can be started.
The automatic way to do exactly the same is to keep the checkbox ”Save and Prepare Simulation Files”
ticked. This will automatically write all necessary files whenever a simulation is started. This is the
default behavior and recommended to keep. Expert users might disable this option and manually save
model parameters or remaining files.
Clicking the button will start the simulation. Runtime messages output by TransAT solver are
shown in the output field.
Please note: Before starting a simulation, make sure that:
All the project files have been saved and setup files written or the checkbox to automatically
generate them is ticked.
All desired outputs are configured. The possible outputs with TransAT are available in
Section Output Management for the visualisation, and Section Data Processing.
Initial conditions have been defined/created, particularly for multiphase flows
Warning and error messages might appear at the beginning of the simulation. It is strongly
recommended to read these messages and to correct the input parameters to comply with the given
advise. Otherwise, the solver may not run properly.
Fig. 5.2 and 5.3 show typical outputs of the solver for different types of simulation.
Figure 5.2: Typical output for an unsteady simulation
Figure 5.3: Typical output for a steady simulation
5.1.2 Stopping a Simulation
Clicking stops the current simulation. The stop occurs only at the end of the time-step (or iteration
for a steady simulation), so there may be a lag between the moment is clicked and the actual stop
of TransAT.
A restart file is then written, called <project_name>.runa or <project_name>.runb (depending on the
restart file format, see Section Output Management). It can be used for a future restart of
the simulation. Another restart file is also written called properties.dat.runb. This contains
properties for any objects in the mesh (such as center of mass, velocity, rotation, and others).
Please note: This restart file overwrites any restart file that could have been saved previously.
5.1.3 Restarting a Simulation
Restarting a previous simulation is done by clicking and selecting restart file(s) (Fig. 5.4).
Restart files have the extension .runa or .rsta for ASCII format, and .runb or .rstb for binary
format.
The solution file is mandatory, and loads all the simulation values for the various variables in the
cells. The Object properties file is optional, and is important if the object properties have changed
during the simulation. For example, if the object was specified with motion, then the simulation must be
restarted with the current position. The restart file for objects is always called properties.dat, with the
extension .runb set.
Figure 5.4: Restart Dialog box
TransAT can also be restarted (initialised) using a restart file from a coarser or finer grid. It is
assumed that the geometry is exactly the same (or almost the same). The results from this solution and
grid will be interpolated on the current grid. An exact restart is not guaranteed in this case since the
grid itself is different.
To do this,
Select Nonmatching in the Restart method drop-down list
Specify both the restart solution file name, restart properties file for embedded objects and
grid file name by clicking and selecting the corresponding file using the file browser.
Please note: Old and new grids must have the same format, i.e. both files must be in ASCII format or
binary format. Also, the new grid cannot be outside of the old grid boundaries (but it can be
smaller).
5.2 Runtime information
In the left window of the execute tab below the buttons to run a simulation, there are several
elements accessible to display important information while running a simulation. The dropdown
menu gives access to all runtime information which will be displayed in the box below the
menu.
Detailed information from the running simulation are displayed in the text window on
the left side of the Execute tab of the TransATUI (”Runtime information” in Fig. 5.1).
Five information views are possible:
Simulation Info: detailed information on the current iteration/timestep
- contains information about residuals and other info, for example simulation time
remaining
Figure 5.5: Simulation information (timing and convergence)
License Info: license data
- displays license information
Figure 5.6: License information
Warnings Info: all the warning messages collected from the current simulation
Figure 5.7: Warning messages
Errors Info: all the error messages collected from the current simulation
Figure 5.8: Error messages
Other Info: additional information from the current simulation
Figure 5.9: Other messages
Every time the simulation is started all the info content is cleared. However when TransATUI loads a
project of a simulation that has already run and finished, the runtime information will display the
information from the previous run. To the right of the runtime information selection menu there is
another output displaying the current run-state of the simulation:
Ready Displayed when the simulation is not running (before/after simulation).
Preparing Displayed while the simulation input files are prepared (grid/boundary/... files)
Running Displayed while the simulation is running.
Stopping Displayed after clicking on the stop butten while the simulation is running. The simulation
will not stop immediately. Only after reaching a point where a restart file can be written. For
unsteady simulations this is at the end of a time step. For steady simulation the simulation
can be stop after every outer iteration.
Info: Timing and convergence
Figure 5.10: Runtime Information sections
As shown in Fig. 5.10 the runtime information window can be split in 3 sections:
Timing information (section 1): In the first section timinig information is displayed. For iterations/time steps current and
average walltime is displayed.
Inner iterations (section 2): For each equation solved, the convergence of solving the linear system in the current outer
iteration is displayed. The number of solver iterations used compared to the maximum allowed is
displayed. The equations are marked as:
(green) → ok when the linear system converges to the target Relative Solver Tolerance
within the Maximum number of Solver Iterations as defined in TransatUI → Input →
Equations → Advanced Solver Options
(green) → converged if the equation is already satisfied (nothing to solve, residual
below numerical minimum limit)
(yellow) → problematic if the linear system could not be converged to the target.
Please note: It is good practice to always converge the linear system. However, if the linear
system does not reach the target convergence in every outer iteration it is still possible to
converge the equation in the outer iteration to the target. This behavior is not ideal but
acceptable.
Outer iterations (section 3): For each equation solved, the convergence within the segregated solver is displayed. Current and
target residual are displayed. The equations are marked as:
(green) → converged when the equation has reached the target ConvergenceTolerance as defined in TransatUI → Input → Equations
(yellow) → stagnating when residual is not decreasing with respect to the previous
outer iteration
(red) → NOT converged if the equation did not reach the target Convergence Tolerance
within the maximum number of outer iterations defined in
”steady simulation”: Number of iterations in TransatUI → Input → Simulation Parameters →
Advanced Options
”unsteady simulation”: Max number of iterations per Time Step in TransatUI → Input → Simulation
Parameters → Control Parameters → Advanced Options
Figure 5.11: Runtime Information for BMR
Fig. 5.11 shows timing and convergence info for a BMR simulation.
inner iterations
LDC (Local Defect Correction) - sweeps are iterations between the different grid levels.
For one LDC sweep all grid levels are solved, correction terms are calculated. After each
sweep a composite solution (fine + coarse) is constructed for the residual calculation.
Solver sweeps are now the average number of sweeps for the solvers. The number
displayed here is the average for all BMR-levels and LDC sweeps. Therefore is possible to see here 0 like in the picture. This happens in the current
example since one of the 2 BMR levels is solved within 1 solver sweep, the other is
already below the target residual.
outer iterations
same output as before, however the residual displayed is the residual of the composite
residual (for the combined fine/coarse solution)
Expert information
All the information printed in the runtime info window can be also found in the following files in the
project directory where the simulation is running:
simInfo.txt: file containing Simulation Info data, it is updated per each iteration for
steady/unsteady simulation therefore only last status is written
licenseInfo.txt: contains License Info data
warningsInfo.txt: contains Warnings Info data
errorsInfo.txt: contains Errors Info data
sarpInfo.txt: contains SArP Info data which consist of:
information relative to the progress of SArP’s genetic algorithm when it is running
the number of SArP launches
the history of the SArP launches during the simulation
Info.txt: contains Other Info data
Running on clusters using a job system these files will be created as well, except simInfo.txt. The files are
useful to check for info/warning/error messages of a simulation.
5.3 Screen output
The runtime information as described in the previous sections is a summary of the solver screen output
in the ”Simulation screen output” part of the execute window as shown in Fig. 5.1. Information,
warnings, errors and convergence information are displayed in the solver output window. The
information and the coloring displayed is slightly different however and it will also code all
convergence information if colors are disabled using markers. The coloring differs for the following
events:
convergence
last iteration
normal iteration
For convergence or last iteration the residual line is separated from the other lines and marked
with ”-” characters in green (if colors enabled) for reaching convergence
with ”*” characters in red (if colors enabled) for reaching the last iteration without
convergence
Figure 5.12: Simulation convergence screen output
The screen output gives a lot of information about convergence already without the additional
simulation info of the GUI. Depending if colors are enabled or not, colors or markers are
used to give additional information. See Fig. 5.13 for screen output with and without colors
displaying:
As soon as a variable has reached its convergence criterion, it will be either displayed in
green or with the marker ”>”. In this example, e has converged after 5 outer iterations.
The equation solving t is displayed in yellow or with the ”!” marker which indicates a
problem to converge the linear system Ax=b. The relative solver tolerance cannot be reached
with chosen solver and number of inner iterations.
In the second iteration the equations for variable u and v are displayed in capital letters
plus ”?” in the output without colors. This indicates the reference residual for normalisation
had been reset.
Figure 5.13: Color- and marker-based convergence information
5.4 Visualization of residuals
Residuals of the simulation are displayed in the Graphs section of the Execute tab.
Clicking Custom opens a window where one can output data of interest written in the RESULT folder
in real time.
5.4.1 Unsteady simulations
For unsteady simulations, the relative residuals for each time step are written in files L1_resnorm.dat,
L2_resnorm.dat and Linf_resnorm.dat, using norms L1, L2 and L∞, respectively. These files can be
selected in the Graphs section of the Execute tab of the TransATUI
5.5 Run-time Intervention
Run-time intervention is available when using TransAT. However, this is not available in TransATUI yet
except for the simulation-stopping and SArP-module-stopping buttons. During a simulation, the user can click to stop it. Inputs can then be changed and saved
before re-running the simualtion or restarting it by clicking . See Section 5.1.3 for restart
options.
When the SArP module is running, the SArP module can be stopped by clicking . After stopping
the simulation, the simuation is restarted with the parameters of the best solution found by the SArP
algorithm.
The run-time behaviour of TransAT can be changed by creating run-time intervention file transat_mb.rti
in the project folder.
5.5.1 Inputs for run-time intervention
The file transat_mb.rti is made up of the first line which indicates the action to be taken on reading the
file and the Namelist Run_Time_Control. The following strings are accepted in the first line:
output, reread_input, stop, noaction.
output: writes out an output file immediately after the file is read.
reread_input: reads the new input given in the Namelist Run_Time_Control in the
file.
stop: stops the simulation and writes a restart file.
stop_sarp: stops the SArP algorithm and restarts the simulation with the parameters of
the best solution found.
noaction: does not do anything. This option can be used while editing the Namelist in
transat_mb.rti. After the appropriate inputs are specified, noaction can be changed to
reread_input.
Below is a sample of the Namelist Run_Time_Control input variables:
&RUN_TIME_CONTROL
!------------------------
! Adaptive time stepping
! Sample values
!------------------------
RT_ADAPTTIME = T, ! use adaptive step (.true. or .false.)
RT_CFLMAX = 1.0 ! Maximum and minimum CFL value
RT_CFLMIN = 0.8
RT_DIFMIN = 1.0 ! Maximum and minimum diffusion criterion
RT_DIFMAX = 0.8
RT_STNMAX = 1.0 ! Maximum and minimum surface tension criterion
RT_STNMIN = 0.8
RT_FOUMAX = 1.0 ! Maximum and minimum Fourier criterion
RT_FOUMIN = 0.8
!---------------
! Output files
! Sample values
!---------------
rt_l3dplot = .true. or .false. ! Write 3D output files
rt_data_format = "paraview" or "tecplot" ! Output file format
rt_l2dplot = .true. or .false. ! Write 2D output files
rt_write_iplane = .true. or .false. ! Write xy, xz ,or yz plane
rt_write_jplane = .true. or .false.
rt_write_kplane = .true. or .false.
rt_iplane = 3 ! Index of the plane to be written
rt_jplane = 3
rt_kplane = 3
!--------------------
! Time steps
! Sample values
!--------------------
rt_ntimet = 1000 ! Maximum number of time step
rt_ctimet = 1.0 ! Final time of the simulation
rt_ntimp1 = 100 ! Frequency of outputs (number of iterations/timesteps)
rt_ctimp1 = 1 ! Frequency of outputs (time interval [s])
rt_maxit = 5 ! Maximum number of iterations in a time step
rt_nsave = 100 ! Frequency of restart files writing
The number of iterations to be run can be changed without stopping the code using the above
transat_mb.rti file.
Another option would be to stop the simulation using , change inputs as needed, save the project
and restart the simulation.
5.6 Quitting the GUI
Clicking Files then selecting Exit closes the GUI. If a simulation is running at the same time, a dialog
box pops up, as shown in Fig. 5.14. The following choices are possible:
Stop and restart the simulation in xterm: the GUI closes, stops TransAT cleanly and restarts
it in a terminal.
Stop and restart the simulation “nohup”: the GUI closes, stops TransAT cleanly and restarts
in “nohup” mode, without any terminal to control it.
Stop simulation and exit: the GUI closes, stops TransAT cleanly and saves a restart file.
Kill simulation and exit: the GUI stops immediately, without creating any restart file.
Click to keep the GUI open and the simulation running.
Figure 5.14: Exit window
Chapter 6 Settings Guides
6.1 SArP Guide
6.1.1 When to use SArP
The SArP module has two modes which are depicted in Figure 6.1 and Figure 6.2:
Optimisation: call to the SArP module from the start of the simulation to optimise
parameters
Stability: call to the SArP module when convergence issues are detected
Figure 6.1: SArP Stability Mode
Figure 6.2: SArP Optimisation Mode
Before using the optimisation mode, it is advised to first run the simulation without it as the
optimisation process can be costly. If the simulation can be completed in an acceptable time, it is
advised not to use the optimisation mode. Otherwise the optimisation mode can be used to correct and
accelerate the simulation.
The typical use cases for the optimisation mode are:
simulations that have trouble converging from the very start. Convergence issues can be
stagnating or oscillating residuals, time-steps reaching the maximum number of iterations,
etc.
simulations that are crashing from the very start
simulations that may require a lot of time to reach the target residuals or physical time i.e.
cases where the residuals decrease very slowly or where the time steps are low
There is no specific restriction regarding the use of the stability mode.
Please note: the optimisation can be accelerated by tuning some parameters or exiting the
optimisation process early. See the Speeding up SArP section to get more information.
Please note: after the initial SArP launch in optimisation mode, the simulation runs in stability mode
in the remainder of the simulation.
6.1.2 Detection of convergence issues
To use the SArP module optimally, it is important to understand how it operates to detect convergence
issues. The parameters that are used to detect convergence issues can be tuned so that the SArP module
is only triggered when necessary. Convergence issues can be detected by the SArP module by monitoring
the following quantities:
residuals
solver iterations
time steps
Residuals based issues
Residuals trend A simulation may be deemed non-converging if its residuals stagnate or increase.
To measure this, the average slope of the residuals over a sliding monitoring window (or analysis
window) is computed. For unsteady simulations the monitoring windows are whole time steps. The
trend of the residuals is measured in each time step. For steady simulations, the size of the monitoring
window is set by the Residual Analysis Window Size input in Advanced Parameters window of
SArP.
The ideal value of the Residual Analysis Window Size input depends on the test case at hand. Low
values of Residual Analysis Window Size make the SArP module more reactive but may trigger the
correction module too much especially in cases such as Figure 6.3 where residuals are decreasing while
oscillating. High values of Residual Analysis Window Size would not trigger the SArP module in
that case however they will be slower to react in case where residuals stagnate or increase such as in
Figure 6.4.
Figure 6.3: Oscillating residuals
Figure 6.4: Stagnating residuals
Residuals ratio The ratios of residuals at the current iterations over the residuals at the previous
iterations for each equation are also monitored. High ratios indicate discontinuities and convergence
issues. The SArP module is triggered as soon as the ratio of residuals of one of the equations reaches a
threshold value. This threshold value is set in the Max. Residual Ratio field in the Advanced
Parameters window of SArP in TransATUI.
Unconverged Time Steps Unconverged time steps are time steps where the target residual is not
reached for at least one equation. The target residual of each equation is the Convergence Tolerance
parameter in the Equations section of the Simulation Parameters tab. Figure 6.5 shows the
typical TransAT output of a simulation with unconverged time steps. The residuals of the
last iteration of each time step are coloured in red which indicates that the time steps are
unconverged.
Figure 6.5: Simulation with unconverged time steps
The SArP module is triggered as soon as the number of consecutive unconverged time steps is above
a threshold value. The threshold value is set in the Unconverged Time Steps field in the Advanced
Parameters window of SArP in TransATUI.
Solver based issues
In a given simulation, each equation is solved iteratively at each iteration. The iterative solvers have a
maximum number of iterations parameter. This parameter can be set in the Equations section of the
Simulation Parameters tab after activating Advanced Solver Options. The parameter is called
Max Number of Solver Iterations. Figure 6.6 is a typical TransAT output shown in the
Execute tab of a simulation with unconverged iterations. In this example there are residuals
that are coloured in orange indicating that the solver of the corresponding equation did not
converge.
Figure 6.6: Simulation with unconverged iterations
Whenever the solver of an equation reaches the maximum number of solver iterations, it indicates
convergence issues especially in cases where this happens frequently. In the remainder of this section we
will refer to iterations where the maximum number of solver iterations is reached as unconverged
iterations.
Consecutive unconverged iterations One way to check convergence issues down to solvers is to
monitor the number of consecutive unconverged iterations for each equation. The SArP module is
triggered as soon as the number of consecutive unconverged iterations reaches a threshold value. This
threshold value is set in the Consecutive Unconverged Iterations field in the Advanced Parameters
window of SArP in TransATUI.
Unconverged iterations rate Another way to check convergence issues down to solvers is to
monitor the rate of unconverged iterations. For steady simulations, the unconverged iterations rate is
measured over the SArP analysis window while it is measured over whole time steps for unsteady
simulations. The SArP module is triggered as soon as rate of unconverged iterations reaches a threshold
value. This threshold value is set in the Unconverged Iterations Rate field in the Advanced
Parameters window of SArP in TransATUI.
Time step based issues
Decreasing time step duration Simulations for which the time step duration keeps on decreasing
will run slowly and may eventually crash. That is why the ratio of the time step duration at the current
time step over the time step duration at the beginning of the analysis window is also monitored. A low
ratio indicates sharp time step duration drop and convergence issues. The SArP module is triggered as
soon as the ratio of time step duration is below a threshold value. This threshold value is
set in the Min. Time Step Drop field in the Advanced Parameters window of SArP in
TransATUI.
Low time step duration The SArP module may be triggered as soon as the time step duration
drops below a threshold value. This threshold value is set in the Min. Time Step Drop field in the
Advanced Parameters window of SArP in TransATUI.
6.1.3 Correction And Optimisation
Evaluations
For a given simulation, the SArP module can be launched only a limited amount of times. The limit of
SArP launches is the value in the Max. Genetic Algorithm Runs field in the Advanced Parameters
window of SArP in TransATUI.
In the SArP module, solutions – set of random parameters – are evaluated. A solution evaluation is
done in two steps. Firstly, a simulation is run for n iterations/time steps, with n the value in the
Analysis Window Size field in the Advanced Parameters window of SArP in TransATUI. Secondly,
the results are analysed to determine the validity status and the score of the solution.
Unless a stopping criterion is met, each SArP launch evaluates neval solutions for gmax generations as
shown in the diagram of Figure 6.7. gmax and neval are respectively the Max. Generation and
the Evaluations Per Generation fields in the Advanced Parameters window of SArP in
TransATUI.
Figure 6.7: Evaluation Process
Roll-back option
The roll-back option which is activated by the Enable Roll-Back check box in the Advanced
Parameters window of SArP in TransATUI. With this option, preliminary steps are run before correcting
numerical parameters:
restart simulation using the latest restart backup file
stop simulation before the time step/iteration where convergence issues have been detected
launch the SArP module from that point
Figure 6.8 depicts the roll-back option for an unsteady simulation. The principle is exactly the same for
steady simulations. The offset shown in Figure 6.8 is determined depending on the detected convergence
issue. Depending on the value of the offset, the simulation may be restarted from an earlier point than
the closest backup restart file.
Figure 6.8: SArP roll back option
Stopping criteria
The SArP module stops when one of the stopping criteria is met. Setting appropriate stopping criteria
of the SArP module is recommended The stopping criteria vary accordingly to the nature of the
simulation, steady or unsteady. The stopping criteria are described below.
Steady simulations For steady simulations, the SArP module stops if:
the best solution found has not been improved upon for n consecutive generations with n
the value in the Stagnating Generations field in the Advanced Parameters window of
SArP in TransATUI
the ratio between residuals at the end of the analysis window and the maximum residual
at the beginning of the analysis window is less than a user-defined ratio. On top of this
condition, the residuals of each equation must be overall decreasing or below the target
residuals to exit the SArP module
the maximum number of generations, nmax, set by the user is reached with none of the
SArP module convergence criteria being met (nmax is the value in the Max. Generation
field in the Advanced Parameters window of SArP in TransATUI). In that case if at least
one valid solution has been found during the process, the valid solution with the highest
score is selected. If no valid solution is found, the simulation is stopped
A typical steady simulation evaluation is shown in Figure 6.9. In that example the residuals exit condition
is met by the variable represented with red disks and green crosses since their residuals drop below
γResmax where γ is the user-defined residual drop factor. The exit condition is however not met by the
variable represented with purple diamonds.
Figure 6.9: Steady Simulation Evaluation Example
Unsteady simulations For unsteady cases, the SArP module stops if:
a solution for which the last time step has reached the target residual has been found
the best solution found has not been improved upon for n consecutive generations with n
the value in the Stagnating Generations field in the Advanced Parameters window of
SArP in TransATUI
the maximum number of generations, nmax, is reached with with none of the SArP module
convergence criteria being met (nmax is the value in the Max. Generation field in the
Advanced Parameters window of SArP in TransATUI). In that case if at least one valid
solution has been found during the process, the valid solution with the highest score is
selected. If no valid solution is found, the simulation is stopped
6.1.4 Speeding up SArP
Tuning SArP parameters The main strategy to speed up the SArP module is to reduce the
number of evaluations performed during the correction and optimisation process. This can be done by
setting parameters of the Advanced Parameters window of SArP in TransATUI. There are four main
options which can be used in combination to do this:
Option 1: set Configuration to fast
Option 2: adjust the genetic algorithm parameters by:
reducing Analysis Window Size
reducing Evaluations Per Generation
reducing Max. Generation
Option 3: adjust the genetic algorithm convergence criteria to exit the SArP module early
by
reducing Stagnating Generation
increasing Residual drop factor (only for steady cases)
Option 4: activate Enable Fitness Approximation
Please note: with these options the space of the parameters is searched less. It makes finding the optimal
set of parameters less likely. This is usually not an issue especially when acceptable or reasonably fast
set of parameters can be found with less effort compared to the deeper search required to find the
optimal set of parameters.
User intervention Alternatively, the SArP module can be stopped in the middle of the process if a
satisfactory solution has been found. This can be done by clicking in the Execute tab of TransATUI
or creating the file transat_mb.rti and setting its content to stop_sarp (only one word in the
file).
To check whether a solution is satisfactory the SArP Info tab of the simulation information panel along
with the simulation output can be checked.
The simulation information panel contains information related to the SArP module progress and
selection process. During the SArP module run, a table with the validity status and the score of the
evaluated solution is displayed in the SArP Info tab. The validity status of a given solution indicates
whether the solution has convergence issues. Valid solutions are coloured in green while invalid ones are
coloured in orange.
The score is a metric of the convergence of the simulation based on the residuals. The higher the score
the better the convergence. To get a more detailed view of the convergence quality, the simulation
output can be looked at. For steady simulations, the residuals of the best solution at the previous
generation can be directly checked in the simulation information panel. Figure 6.10 shows a typical
SArP Info tab of a steady simulation.
Figure 6.10: SArP info tab of a steady simulation
For unsteady simulations, the time step score is also displayed and takes precedence over the score.
The time step score indicates which solution is to reach the target physical time the fastest. The time
step score is based on the time step duration and the actual time required to evaluate a solution. The
fastest running solutions are the solutions with the highest time step scores. Figure 6.11 shows a typical
SArP Info tab of an unsteady simulation.
Figure 6.11: SArP info tab of an unsteady simulation
Please note: it is advised to hit the button only if a solution with a validity status of true has
been found. Failing that, the SArP module will be immediately triggered again after clicking since
the selected solution will present convergence issues (as indicated by a validity status of
false).
Chapter 7 Post-Processing
7.1 Output Files
7.1.1 SArP
When the SArP module is activated, the following ouptut files are generated:
simulation folder
sarpInfo.txt: contains history of the SArP launches
sarp_log.log: contains log of SArP runs
sarp_result folder
transat_mb.XXXXX.inp: TransAT input file used after the ith run of SArP
diff.XXXXX.txt: contains the input changes in the input file after the ith run of SArP
7.2 Visualisation with ParaView
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the TransATParaview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
7.3 Visualisation with Tecplot
Start Tecplot in you working directory by: tecplot Open your result file: File → Load Data File(s)... Tecplot Data Loader Choose your result file and click ’OK’. When asked to select your Initial Plot Type, select the (default) 3D Cartesian type and click ’OK’. Now
the tecplot window should look like in Fig. (7.1).
Figure 7.1: Tecplot window after loading the result file.
Define Variables
Open the window to define variables (see Fig. (7.2)).
Figure 7.2: Define variables C1 and C2.
Define variable C1 to be Temperature and C2 to be EmbI, which is the function representing the
immersed surfaces. Close this window. Define Isosurface Enable and define the isosurface representing the immersed objects (see Fig. (7.3)).
Figure 7.3: Define isosurface.
Define the Interface using variable C2:EmbI at 1 specific value which is zero. By default, the
interface is coloured by variable C1 which should be the temperature. Define Slice Enable and define the slice like in Fig. (7.4).
Figure 7.4: Define slice.
7.4 Data Processing
This section describes the various post-processing utilities available in TransAT. All input files
related to the post–processing utilities are created in the project folder, and all results are written in the
RESULT folder by default.
Please note: Some post-processing utilities are not available in the GUI yet. To enable them, the user
may have to edit and modify directly the input file transat.inp, which is located in the project
folder.
7.4.1 Non-dimensional numbers
Non-dimensional numbers can be evaluated by TransAT during the simulation. This feature is turned on
by default.
It can be activated or deactivated in the Output Management sub-tab of the Input tab. One simply
needs to check or uncheck the Non Dimensional Numbers box in the Postprocessing section
(Fig. 4.36).
This utility calculates a variety of non-dimensional numbers and writes them to the file
RESULT/ND_numbers.dat.
The reference length scale and reference velocities are taken from the value given in the PhysicalModels sub-tab of the Input tab (See Section Physical Models).
Depending on the physical models used, the available non-dimensional numbers can be the
following
The gas and liquid Reynolds numbers give the ratio of the inertial and viscous forces.
(7.1)
where reference length and velocity are given in the Reference State panel of the PhysicalModels tab.
If the maximum velocity magnitude exceeds twice the reference velocity, maximum Reynolds
number is also written.
The Froude number gives the ratio of inertial and gravitational forces.
(7.2)
where reference length and velocity are given in the Reference State panel of the PhysicalModels tab, and g is the gravity magnitude.
The gas and liquid Prandtl numbers are the ratios of momentum and thermal diffusivities (printed
if temperature equation is solved).
(7.3)
The gas and liquid Rayleigh are associated with buoyancy driven flows (printed if temperature
equation is solved).
(7.4)
where β is the thermal expansion coefficient, ΔT = 2, with Tmax the maximum
temperature in the domain. ref subscripts refer to values given in the Reference State panel of
the Physical Models tab.
The Weber number is the ratio of inertia to surface tension forces (printed for two-phase
flow).
(7.5)
with σ the surface tension and ref subscripts denoting reference values given in the ReferenceState panel of the Physical Models tab.
The Eotvos number is the ratio of gravitational forces to surface forces (printed for two-phase
flow).
(7.6)
with σ the surface tension and Lref the reference length given in the Reference State panel of
the Physical Models tab.
The Morton number characterizes the shape of bubbles or drops
(7.7)
The gas and liquid Capillary numbers are ratios of viscous forces to surface tension forces (printed
for two-phase flow).
(7.8)
with uref the reference velocity given in the Reference State panel of the Physical Models
tab.
The Rossby number is the ratio of inertial to Coriolis forces (printed for rotating frames).
(7.9)
with Ω the angular velocity. Two Rossby numbers are written: one with L = Lref given in the
Reference State panel of the Physical Models tab, and one with L = LD the domain
size.
A typical output of this utility is shown below.
==========================================
= Non-dimensional numbers at: begin
==========================================
Length (m) : 1.000
Velocity (m/s) : 1.000
Velocity Max (m/s) : 1.444
Density Gas (kg/m^3): 1.205
Viscosity Gas (Pa s) : 0.1511E-04
Kin. Visc. Gas (m^2/s) : 0.1254E-04
Heat Capa. Gas (J/kg K): 1005.
Therm. Cond. Gas (W/m K) : 0.2570E-01
Reynolds number (Re) = Rho*RefL*RefU/Visc
Re(G): 0.7975E+05
Re(L): 0.1021E+07
Froude number (Fr) = RefU^2/(g*RefL)
Fr(ReferenceL): 0.1019
Fr(Domainsize): 0.1014
Prandtl number (Pr) = Visc*Cp/Lambda
Pr(G): 0.5909
Pr(L): 6.587
Rayleigh number (Ra) = Beta*DeltaT*g*(Rho^2)*(RefL^3)*Pr/(Visc^2)
Ra(G): 0.000
Ra(L): 0.000
Weber number (We) = RhoL*RefL*(RefU^2)/Sigma
We(L): 0.1386E+05
Eotvos number (Eo) = g*(RhoL-RhoG)*(RefL^2)/Sigma
Eo: 0.1358E+06
Morton number (Mo) = g*(Visc^4)*(RhoL-RhoG)/((RhoL^2)*(Sigma^3))
Mo: 0.2399E-10
Capillary number (Ca) = Visc*RefU/Sigma
Ca(L): 0.1357E-01
Ca(G): 0.2099E-03
Checking the ND_numbers.dat file at the beginning of every simulation and specifying a reasonable
value of the reference length and velocity is part of the best practice guidelines for using
TransAT.
7.4.2 Time signals probes
This utility saves time signals at a given set of points in the domain. The points do not have to match
with a grid point, values are interpolated.
This feature can be turned on by creating an input file named timesignalxyz.dat in the project folder.
The input file contains coordinates of points at which data has to be extracted. Each line should have 4
columns: viz. probe number (integer), x–coordinate, y–coordinate, z–coordinate.
1 0.1 0.5 0.7
2 1.0 2.5 3.7
3 0.95 0.3 0.89
The output file is stored in the RESULT folder and has a name of the type timesignal.yyyy.,
with y the index of the time signal (Note: If ”blockfile” is set by hand to true in the input
file transat_mb.inp then y represents the block number and can contain several time signal
points). The signal is stored at every time step. The following variables are written in timesignal.yyyy, depending
on different equations solved:
Monitor point index
Time
Pressure
System pressure (Compressible flows)
Velocities
Temperature
Subgrid viscosity (LES)
7.4.3 Section Output
This utility saves output on a given section plane. The plane could be aligned to the grid or can be
defined at an arbitrary angle. The utility can also be used to extract ouput on a sub-section of a plane.
An example of a section plane is shown in Fig. (7.5).
Figure 7.5: A section plane.
This feature can be turned on by creating an input file named sectionsxyz.dat in the project folder.
The input file contains definitions of section planes. Each plane is defined by its normal and a point on
the plane. A sub-section in a given plane can also be defined by defining the extents of the sub-section in the
plane. Each line in the input file should have either 6 columns: viz. plane–normal (x–axis),
plane–normal (y–axis), plane–normal (z–axis), x–coordinate, y–coordinate, z–coordinate
or 12 columns: viz. plane–normal (x–axis), plane–normal (y–axis), plane–normal (z–axis),
x–coordinate, y–coordinate, z–coordinate, xmin, xmax, ymin, ymax, zmin, zmax, where
xmin, xmax, ymin, ymax, zmin and zmax defines the extents of a sub-section in a given
plane.
First line defines a plane with normal in x-direction through point (0.1,0.0,0.0). The second line defines
a plane rotated by 450 around the z-axis and through point (0.0,0.3,0.0). The last line finally has the
same definition as the first one. The section is further limited by x/y/z-plane integration limits.
The output file is stored in the RESULT folder and has a name of the type section.y., with y the index of
the plane. The section output is stored at every iteration for steady simulation and at every time step for unsteady
simulation. The following variables are written in section.y, depending on different equations
solved:
Time step number, time step and simulated time for unsteady simulations and iterations
for steady simulations
Area per phase - activated by default
Mass flux per phase - activated if either U-velocity, V-velocity or W-velocity equation is
solved.
Mass flux and area weighted static and dynamic pressure if pressure equation is solved.
Heat capacity flux weighted temperature and cross-sectional wall averaged temperature if
temperature equation is solved.
Cross-sectional immersed surface wall averaged temperature if temperature equation is
solved and immersed surfaces is enabled.
Massflow averaged mass fractions, wall averaged mass fractions, Sherwood number and
averaged reaction rates if mixture equation is solved and immersed surfaces are enabled.
Massflow averaged mass fractions, wall averaged mass fractions, and averaged reaction rates
if mixture equation is solved, immersed surfaces and write mole fractions are enabled.
Area weighting of a variable ϕ is defined as:
(7.10)
Mass flux weighting of a variable ϕ is defined as:
(7.11)
Heat capacity flux weighting of a variable ϕ is defined as:
(7.12)
Chapter 8 Command Line Options
Multiple TransAT operations such as the generation of simulation files, setting of initial conditions
and simulation execution can be directly launched in command line. The command line
options of TransAT are of particular use to run multiple simulations. Indeed, scripts can be
created using the TransAT command lines to run large number of simulations without user
intervention.
8.1 Environment variables setting
Some of the operations supported by TransATUI can be directly executed in command line. TransAT
commands can be directly executed if the PATH environment variable contains the following
folders:
<TransAT_Installation_directory>/transatMB/bin
<TransAT_Installation_directory>/transatUI/bin
To check if the first folder is in the PATH environment variable, execute the following command in a
terminal:
whichtmb_run.py
It should point to a file located in <TransAT_Installation_directory>/transatMB/bin. If that is not the
case, execute the following command
Please note: to keep these settings permanently add the export commands to /.bashrc or
/.cshrc if the bash or c-shell is used.
Please note: it is assumed in the following sections that the environment variables have been set
accordingly to the present section. Full path to executable should be used if that is not the
case.
8.2 Generation of simulation files
Please note: the generation of simulation files requires executing the transatui.py script which runs a
graphical programme. If the generation of simulation files is done remotely, the X11 port forwarding
should be enabled when connecting to the host
ssh-Xusername@host
To generate the simulation files, execute the following command in a terminal
transatui.py--Graphicsbash--Project<project_file>
where <project_file> refers to the TransAT project file i.e. the *.stt file.
8.3 Running TransAT on a workstation in command line
8.3.1 Advanced initial conditions
If advanced initial conditions are used to initialise a simulation, the advanced initial conditions file,
initialconditions.cxx, must first be compiled and run.
To do so, execute the following command
tmb_init_compile.py-n<nprocs>
with <nprocs> the number of processors to be used to run the initial conditions which should be no
greater than the number of blocks defined in the setup of the simulation.
Note that if the -n option is not specified the initial conditions executable will be created but not
executed. In that case re-run the tmb_init_compile.py command with the specified number of
processors.
To display the number of blocks directly in command line
execute the following command in a terminal
head<projectname>.grda
The first line displayed by the command corresponds to the number of blocks in the domain.
8.3.2 Running a simulation
To run a simulation in command line, execute the following command
tmb_run.py-n<nprocs>
with <nprocs> the number of processors to be used to run the simulation which should be no greater
than the number of blocks defined in the setup of the simulation.
Note that if the -n option is not specified the number of processors used to run the simulation will be set
to 1.
Options
Some simulation options can be set to run simulations for a fixed number of time steps and/or
iterations. The corresponding arguments are --maxiterations and --ntimesteps.
Simulations can also be run with user-defined functions by calling tmb_run.py with the -u
option.
Please note: if user-defined functions are to be called, the command
create a file called transat_mb.rti with a text editor in the project folder (rti stands for
runtime information, see Run-time intervention section for more details)
write ”STOP” in the file then save it.
These operations can be done in command line by executing the following command from the project
folder:
echoSTOP>transat_mb.rti
Once transat_mb.rti has been saved, the simulation should be stopped after completing the current
iteration or time step depending on whether the simulation is steady or unsteady. The file
<project_name>.runb should be created upon stopping the simulation. This file can be used to restart
the simulation from where it has been stopped.
8.3.4 Restarting a simulation
There are two methods to restart simulations with TransAT:
matching restart: the simulation is restarted from the state stored in a given restart file (i.e.
*.runb file)
non-matching restart: the simulation is restarted from the state stored in a given restart
file from a setup using a similar domain but a different grid
Matching restart
To restart a simulation with the matching restart method, run tmb_run.py with the following arguments:
<restart_file> can be any restart solution file generated by the setup of the simulation or any setup
that uses the same domain and grid. Usually it will have the same name as the project file, an optional
time step number and a .runa or .runb file ending.
The <restart_properties_file> contains the restart properties of all the embedded solids, if present. It is
especially important for simulations with rigid body motion. For simulations without embedded solids
this argument can be omitted. Usually it will have the name properties.dat. ….runb with an optional time
step number in place of the ….
Note that a simulation can be restarted in combination with any argument of the tmb_run.py
script.
Examples
<restart_file> can be any setup that uses the same domain including restart files generated with a
different grid. <grid_file> is the corresponding grid file (*.grda) in the setup that was used to generate
the restart file. The <restart_properties_file> contains restart information for embedded solids and is
essential for simulations with rigid body motion. For simulations without embedded solids this argument
can be omitted. See section Matching restart for examples of typical solution and solid properties restart
file designations.
Note that a simulation can be restarted in combination with any argument of the tmb_run.py
script.
Examples
Contrary to workstations, computational resources are not immediately available on clusters. The
allocation of the resources and the launch of parallel jobs is managed by a queuing system (Grid
Engine, PBS, etc. ). Simulations must be run by submitting jobs to the queuing system of the
cluster. In this section the different steps to set up a job running TransAT on a cluster are
detailed.
8.4.1 Settings
To run simulations on a cluster, the path <TransAT_Installation_directory>/transatMB/bin must be
added to the execution path for all the nodes. Please contact your System Administrator to apply these
settings.
8.4.2 Advanced initial conditions
If advanced initial conditions are used to initialise a simulation to be run on a cluster, the advanced
initial conditions file, initialconditions.cxx, must first be compiled.
To do so, execute the following command
tmb_init_compile.py
This command will generate the executable transatmbinitialDP in the project folder.
To initialise the simulation, the following line needs to be executed in the job submission script
<parallel_exec_command>./transatmbinitialDP
with <parallel_exec_command> the command to run an executable in parallel on the cluster, e.g. mpirun-np <nprocs> with <nprocs> the number of processors to be used to run the simulation. Please refer
to your cluster documentation to get the corresponding command to run an executable in
parallel.
8.4.3 Running a simulation
To run a simulation on a cluster without user-defined function, the following line should be present in
the job submission script
<parallel_exec_command>transatmbDP
If the simulation is to be run with user-defined functions, the following command must first be run
tmb_link.py-u
This command will generate the executable uitransatmbDP in the project folder.
Please note: This command does not create the files uifilelist.py, registerfunctors.cxx, or
registerfunctors.h, which are required for UDF compilation. To create these, compile from the UserDefined Functions tab of TransATUI, after which tmb_link.py-u can be used from the command
line. To run a simulation with user-defined function on a cluster, the following line should be present in the
job submission script
<parallel_exec_command>./uitransatmbDP
8.4.4 Stopping a simulation
To stop a simulation,
create a file called transat_mb.rti with a text editor in the project folder
write ”STOP” in the file then save it.
These operations can be done in command line by executing the following command from the project
folder:
echoSTOP>transat_mb.rti
Once transat_mb.rti has been saved, the simulation should be stopped after completing the current
iteration or time step depending on whether the simulation is steady or unsteady. The file
<project_name>.runb should be created upon stopping the simulation. This file can be used to restart
the simulation from where it has been stopped.
8.4.5 Restarting a simulation
There are two methods to restart simulations with TransAT:
matching restart: the simulation is restarted from the state stored in a given restart file (i.e.
*.runb file)
non-matching restart: the simulation is restarted from the state stored in a given restart
file from a setup using a similar domain but a different grid
Matching restart
To restart a simulation with the matching restart method,
open the file transat_mb.inp
look for the entry restart_method and change its value to ”restart”
if embedded solids are present in the setup, add the following line below the restart_method
entry. Make sure to specify the correct properties restart file to use.
where <path_to_restart_file> is the path to the folder containing the restart file to use and
<restart_properties_file> is the file storing the properties of the embedded solids from which the
simulation is supposed to restart (e.g. properties.dat.runb).
save and close the file
make a copy of the restart file and name said copy <projectname>.rstb with <projectname> the
name of the TransAT project file
Alternatively, the restart file can be specified in transat_mb.inp instead of using the *.rstb file. (i.e. ignoring
the third and fourth step in the set of instructions given above). To do so:
open the file transat_mb.inp
look for the entry restart_method
add the following line below the restart_method entry
where <path_to_restart_file> is the path to the folder containing the restart file and
<restart_file> is the file storing the state from which the simulation is supposed to
restart.
if embedded solids are present in the setup, add the following line below the restart_filename
entry. Specify the solid properties restart files as described above for matching restarts.
Please note: that for restart files located inside the project folder, relative file paths can also be specified.
The simulation is completely set to restart after doing these operations. To restart the simulation,
execute the job submission script which should be the same as the one used to run TransAT i.e. either of
the following lines depending on the use of user-defined functions or not should be present in the script
to run the simulation
<parallel_exec_command>transatmbDP
<parallel_exec_command>./uitransatmbDP
Non-matching restart
To restart a simulation with the non-matching restart method,
open the file transat_mb.inp
look for the entry restart_method and change its value to ”nonmatching”
add the following lines below the restart_method entry
where <path_to_restart_file> and <path_to_restart_grid_file> are respectively the paths to the
folders containing the restart files and the grid file. <restart_file>, <restart_properties_file> and
<grid_file> are respectively the files storing the solution from which the simulation is supposed
to restart, the properties of embedded solids and the grid file corresponding to that
setup
save and close the file
Please note: that for restart files located inside the project folder, relative file paths can also be specified.
The simulation is completely set to restart after doing these operations. To restart the simulation,
execute the job submission script which should be the same as the one used to run TransAT i.e. either of
the following lines depending on the use of user-defined functions or not should be present in the script
to run the simulation
<parallel_exec_command>transatmbDP
<parallel_exec_command>./uitransatmbDP
Chapter 9 Custom Features
Several TransAT tools give user more control on the simulation settings and access to data produced by
TransAT during the simulation. These tools are particularly useful to set custom initial conditions and
for the definition of user defined functions. Note that these tools are not directly available in the user
interface.
9.1 TransAT Tools
A set of tools are available to access and post-process the data produced by TransAT. These tools consist
of
the TransAT properties module
Interfaces to the TransAT data structure
Parallel post-processing tools
9.1.1 Properties Module
The thermodynamic variables such as pressure, temperature, etc... can be set and read using the
properties module of TransAT. On top of including cppinterface.h, the following steps have to
be followed to use the properties module in advanced initial conditions file or user-defined
functions:
Initialise the module at a certain block number, nb, and cell index, ii, inside the for loop for the
block and cell indices using:
properties_initialize(nb, ii);
To set the value of a thermodynamic variable, e.g. pressure, for the first phase equal to 150.0
use:
properties_set_state("pressure", 150.0, 0);
To set the value of a thermodynamic variable, e.g. temperature, at the mixture level equal to
273.0 use:
properties_set_state("temperature", 273.0);
One can get the value of different thermodynamic variables using the get function at the phase
and the mixture level. Please note that either the value will be computed based on the
variables which were set or the value of the variable which was set would be returned
directly.
The following section is a template for the use of properties module in the initialconditions.cxx
file:
for (int nb=0; ii < nblocks; nb++) {
for (int ii=0; ii < nijk; ii++) {
properties_initialize(nb, ii);
properties_set_state("pressure", 0.0);
properties_set_state("temperature", 273.0);
double density_mixture = properties_get("density");
double density_phase = properties_get("density", 0);
properties_set_back();
}
9.1.2 Interfaces to TransAT data structure
A set of interfaces are available to access elements of the data structure generated by TransAT for
simulations. The main use of these interfaces is to define advanced initial conditions and user-defined
functions (run-time processing and post-processing). The elements that can be accessed consist
of
parameters
arrays storing values of variables in each cell
internal TransAT functions.
Please note: the header file cppinterface.h needs to be included int the user-defined function to access the
interfaces.
Accessing parameters
It is often required to read simulation parameters or some other global variables to set the initial
conditions or post-process simulations. For example, the number of blocks in the domain is one such
variable and it is often needed. Indeed, TransAT being a multiblock code, it is required to loop over all
the blocks in the domain to access and set values over the domain. In some other cases, one may need to
use the components of the gravity vector or the saturation temperature to initialise variables or to
compute quantities in user-defined functions for instance. All these TransAT parameters can be accesed.
To access them, depending on the type of variable (integer, real or logical) specific functions can be
called.
Getting an Integer
To get a global parameter of type integer the get_integer function can be called
int get_integer(const char *string)
int get_integer(const char *string, int index)
with
string: keyword
index : local or global index depending on the keyword
For example, the time-step index is obtained in the following code excerpt:
The list of accessible parameters and keywords is available here.
List of accessible parameters
Simulation parameters can be accessed in advanced initial conditions or user-defined functions by calling
the corresponding function as in the following example where the gravity vector component in the
x-direction is used to set the pressure.
Number of blocks : "nblocks"
Number of phases : "nphases"
Number of particle classes : "nclasses"
-------------------------------------------------------------
Integer Variables Valid Keywords
-------------------------------------------------------------
(global and indexed, accessible by: get_integer("keyword",index)
BMR level to global block index : "bmr_block_level_global"
BMR level to local block index : "bmr_block_level_local"
Processor holding global block : "global_block_to_proc"
Local index of global block : "global_block_to_local"
-------------------------------------------------------------
Integer Variables Valid Keywords
-------------------------------------------------------------
(per block, accessible by: get_integer(nb,"keyword")
Global block index : "gnb", "glob_nb"
Number of Grid points in I : "ni"
Number of Grid points in J : "nj"
Number of Grid points in K : "nk"
Number of Grid points I*J : "nij"
Number of Grid points I*J*K : "nijk"
-------------------------------------------------------------
Double Variables Valid Keywords
-------------------------------------------------------------
Time interval: "dtime", "delt"
Current time: "time" , "ctime"
Particle sub-step time interval: "particle_dtsubstep"
Gravity in X direction: "xgravity"
Gravity in Y direction: "ygravity"
Gravity in Z direction: "zgravity"
Density of Phase 1: "rhog"
Viscosity of Phase 1: "viscg"
Heatcapacity of Phase 1: "cpg"
Thermal conductivity of Phase 1: "lambg"
Molecular weight of Phase 1: "mwg"
Scalar diffusivity of Phase 1: "c_diffg"
Thermal expansion of Phase 1: "texpg"
Density of Phase 2: "rhol"
Viscosity of Phase 2: "viscl"
Heatcapacity of Phase 2: "cpl"
Thermal conductivity of Phase 2: "lambl"
Molecular weight of Phase 2: "mwl"
Scalar diffusivity of Phase 2: "c_diffl"
Thermal expansion of Phase 2: "texpl"
Real constant zero: "zero"
Real constant one: "one"
Real constant Pi: "pi"
Real constant small: "small"
Real constant infinity: "infty"
-------------------------------------------------------------
Logical Variables Valid Keywords
-------------------------------------------------------------
If solving pressure: "solve_pressure"
If solving u-velocity: "solve_uvelocity"
If solving u-velocity: "solve_vvelocity"
If solving u-velocity: "solve_wvelocity"
If solving temperature: "solve_temperature"
If solving solid temperature: "solve_tsolid"
If solving concentration: "solve_concentration"
If solving Level Set: "solve_levelset"
If solving VoF: "solve_vof"
If solving immersed surfaces: "activate_embedded_interface"
Accessing variables
Arrays storing values of variables that are set and solved for by TransAT can be accessed through
pointers in advanced initial conditions or user-defined functions. The access to these arrays is done
block-wise by calling the set_pointer function.
void set_pointer(int nb, int **aptr, const char *string)
The following is the list of arrays, integers, reals, and logicals that are accessible in advanced initial
conditions files and user-defined functions:
Radiative Heat Transfer X: "radheatfluxx"
Radiative Heat Transfer Y: "radheatfluxy"
Radiative Heat Transfer Z: "radheatfluxz"
Area component cell center 11: "areacellcenter11"
Area component cell center 12: "areacellcenter12"
Area component cell center 13: "areacellcenter13"
Area component cell center 21: "areacellcenter21"
Area component cell center 22: "areacellcenter22"
Area component cell center 33: "areacellcenter23"
Area component cell center 31: "areacellcenter31"
Area component cell center 32: "areacellcenter32"
Area component cell center 33: "areacellcenter33"
-------------------------------------------------------------
Array Pointers Valid Keywords
-------------------------------------------------------------
(per block and phase component, accessible by: set_pointer(nb,aptr,"keyword",arg1,arg2)
Phase component mass fraction: "component_massfraction"
Converting 1D/3D index
In a block-structured cartesian grid a cell is defined by the block number and the index i/j/k, where
i/j/k is the spatial index in x/y/z-direction. TransAT is storing arrays linearily, therefore the
i/j/k index is converted to a 1D index ii. The 1D index can be simply calculated from i/j/k
as
ii = i + j*ni + k*ni*nj
where number of cells in i/j-direction (ni/nj) can be extracted using the get_integer function. To do the
opposite and convert a 1D to a 3D index there is a TransAT function available:
void convert1DindexTo3D(int nb, int ii, int &i3d,int &j3d,int &k3d)
with
nb: (integer) block index
ii: (integer) 1D index to be converted
i3d,j3d,k3d: (integer) 3D index of cell ii
See an example converting a 1D to 3D index and back in the Code block in Listing 9.1.
Getting the number of wall cells
The number of cell faces in a certain direction can be obtained by calling the following function
int getWallBoundaryNFaces(int nb, const char *direction)
with
nb: (integer) block index
direction: (string) direction keyword
Valid keywords for the direction argument are:
north, south, east, west, top, bottom;
n, s, e, w, t, b;
ymax, ymin, xmax, xmin, zmax, zmin
This function is particularly useful to loop over cells of a specific wall to evaluate wall quantities.
In the following code excerpt the number of cells on the ymax face is obtained for block 0:
The following piece of code makes use of the getWallBoundaryNFaces and getWallBoundaryValue
functions to print several wall quantities for each wall face in the domain.
Using the properties module then the cell center quantities can be used together with the wall values. Below
is as small example how to use this. The example loops over wall boundaries, extracting the wall
temperature and the corresponding cell center temperature. Using finite differences, the temperature
gradient and the corresponding heat flux is calculated and compared to the heat flux used in TransAT.
Furthermore the example also shows the function convert1DindexTo3D converting 1D-index ii to
3D-index i,j,k.
When lagrangian particle tracking is applied access to particle data is provided to the user by
user-defined functions and the particle interface class, defined in Particle.h.
Some general particle-modelling information can be accessed with the following methods
unsigned getNumParticlesLocal(const unsigned& iblock): returns the number of
particles inside a specified local block.
unsigned getNumParticlesLocal(): returns the number of particles inside the local
processor.
void convertPindex(const unsigned& globalPindex, unsigned& blockPindex,unsigned& blockIndex): returns the block-local particle index and the block index of the
block in which the particle is contained given its block-independent index.
unsigned convertPindex(const unsigned& blockPindex, constunsigned& blockIndex): returns the block-independent particle index for a specified
block-local particle index.
In order to get access to the properties and paramters of a specific particle, a particle object must first be
created using its block-independent particle index
tmb::Particle p( unsigned globalIndex )
The properties and parameters of a specific particle can be accessed through the following get
functions:
Eigen::Vector3d getPosition(): returns the particle x,y and z-coordinates in an array.
Eigen::Vector3d getVelocity(): returns the particle u,v and w velocity components in
an array.
Eigen::Vector3d getOldVelocity(): returns the particle velocity at the previous time
step.
Eigen::Vector3i getCellIndex(): returns the I,J and K-indices of the cell containing
the particle in an array.
double getDiameter(): returns the particle diameter.
unsigned getLocalBlockIndex(): returns the local block index of the particle.
unsigned getGlobalBlockIndex(): returns the global block index of the particle.
Please note: the particle interface class and its member functions belong to the tmb namespace.
In the following code excerpt, particle properties and parameters are accessed using the get functions
described above.
get_heaviside: returns the smooth Heaviside function at a point, given the Level Set value
and other input parameters. This function is deprecated. Use the properties module to
extract volume fraction ”alpha” for the second phase.
9.1.3 Cell-data access and filtering
Grid
At each end of the domain and in each direction there is a padding of two cells around the internal cells.
The padded cells either store boundary conditions or a copy of cell data from neighbouring
blocks.
The full TransAT grid is illustrated with a typical example in Figure 9.1. It is the third layer of cells in
the z-direction of a 2D-grid with a resolution of Nx× Ny× Nz = 4 × 4 × 2 cell corners (i.e. 3 × 3 × 1
cells).
Figure 9.1: TransAT grid with cell types and indices
In the subsequent examples, ni = Nx + 4, nj = Ny + 4 and nk = Nz + 4 refer to the number of cells in
the three principal directions. nij = ni× nj is the number of cells in the xy-planes. In the example
depicted in Figure 9.1, (ni,nj,nk) = (8,8,6) and nij = 64.
The computational domain is coloured in blue while the padded cells are coloured in orange. In terms of
cell coordinates, the computational domain always ranges from i = 2 to i = ni- 4, from j = 2 to
j = nj- 4 and from k = 2 to k = nk- 4 as shown in Figure 9.1. In this case, the range of internal cell
indices is [2,4] × [2,4] × [2,2].
Please note: including the padded cells, all grids have at least 5 cells in each direction. The example of
Figure 9.1 represents the third layer of cells in the normal direction to the plane (i.e. the z-direction
in this case) which contains all the internal cells for this two-dimensional example. The
first, second, fourth and fifth layer of cells in the z-direction are only made of padded cells.
Please note: the index ii of a cell of coordinates (i,j,k) is
(9.1)
The cell-indexing has been purposefully shifted in Figure 9.1 to simplify the understanding
of the cell padding concept. For this specific case 2nij = 128 should be added to each of
the cell-indices in Figure 9.1. This comes from Eq. 9.1 as k = 3 in the plane illustrated in
Figure 9.1.
Please note: the cell-coordinates always start from 0 as shown in Figure 9.1.
Cell-markers
Cell-markers are available in initial conditions or in user-defined functions to distinguish the
different types of cells (internal, boundary, etc.) and regions (fluid or solid). These markers
operates as indicator functions i.e. equal to 0 or 1 depending on the type of cells. They
can all be accessed using the set_pointer method described in the Accessing variables
section.
There are 4 cell-markers to differentiate cell types implemented in TransAT:
kblk: value of 1 for internal cells, value of 0 otherwise
kblkmb: value of 1 internal and overlapping cells, value of 0 otherwise
kblkbmr: value of 1 for internal cell that are not overlapped with BMR grids, value of
0 otherwise. This marker is particularly useful to avoid accounting for data in the main
grid/BMR grid overlap twice e.g. for volume computation, averaging, etc.
filter_mask: value of 1 for internal, overlapping and boundary cells, value of 0 otherwise
The different cell-markers are illustrated in the example of Figure 9.2 which represents a grid of 3 blocks
with Block 3 a BMR block.
Figure 9.2: TransAT cell markers
To distinguish fluid or solid region, the Hembed marker may be used. Contrary to the markers
mentioned above, this one can take any value between 0 and 1 as it is continuous. It represents the
proportion of fluid in a cell. It is equal to 1 in the fluid region and 0 in the solid region. The value varies
smoothly from 0 to 1 at the interface between fluid and solid. Please refer to the ImmersedSurfaces Technique section in the TransAT Equations and Algortithms handbook for more
details.
In porous regions, Hembed’s value is equal to the porosity of the solid.
Cell-indexing and looping
To access and/or set values of a variable array at a specific cell, a cell-index must be given. The
cell-indexing is usually done through loops over regions of interest. The looping can be done through the
use of either one-dimensional or three-dimensional indices.
One-dimensional looping
The one-dimensional index-looping is particularly useful when data is accessed or set globally for
instance to initialise, integrate or find an extremum of a variable over the whole domain.
The main data required for the looping is the range of indices covering the set of cells of
interest.
Looping over internal cells To strictly loop over the whole set of internal cells i.e. the blue cells in
Figure 9.1, the delimiting indices should be iis_inside and iie_inside which are respectively the indices of
the first and last internal cells. In Figure 9.1, the cells in the set ranging from iis_inside to iie_inside are
numbered in red. On top of that, the kblk cell-marker should be used to skip the non-internal cells in the
iis_inside and iie_inside range.
A loop over internal cells would then be constructed as follows:
/* nb: block index
iis_inside: index of first internal cell
iie_inside: index of last internal cell */
int* kblk;
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// access block specific parameters such as grid properties
iis_inside = get_integer(nb,"iis_inside");
iie_inside = get_integer(nb,"iie_inside");
set_pointer(nb, &kblk,"kblk");
/* ii: cell index */
// Loop over the cells of block nb
for (int ii=iis_inside; ii < iie_inside; ii++) {
// Exclude padded cells
if(kblk[ii] == 0){
continue;
}
...
}
}
Looping over internal and overlapping cells To strictly loop over the whole set of internal cells
along with block-overlapping cells the whole set of cells should be used for the looping in combination
with the kblkmb cell-marker. The delimiting indices of the loop should then range from 0 to nijk with
nijk the total number of cells in the block.
The loop would be constructed as follows:
/* nb: block index
nijk: number of cells in block nb
kblkmb: block array storing cell-marker values */
int* kblkmb;
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// access block specific parameters
nijk = get_integer(nb,"nijk");
set_pointer(nb, &kblkmb,"kblkmb");
/* ii: cell index */
// Loop over the cells of block nb
for (int ii=0; ii < nijk; ii++) {
// Exclude non-internal or non-overlapping cells
if(kblkmb[ii] == 0){
continue;
}
...
}
}
Looping over internal, overlapping and boundary cells To strictly loop over the whole set of
internal cells along with block-overlapping cells and boundary cells, the whole set of cells
should be used for the looping in combination with the filter_mask cell-marker. The delimiting
indices of the loop should then range from 0 to nijk with nijk the total number of cells in the
block.
The loop would be constructed as follows:
/* nb: block index
nijk: number of cells in block nb
filter_mask: block array storing cell-marker values */
int* filter_mask;
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// access block specific parameters such as grid properties
nijk = get_integer(nb,"nijk");
set_pointer(nb, &filter_mask,"filter_mask");
/* ii: cell index */
// Loop over the cells of block nb
for (int ii=0; ii < nijk; ii++) {
// Exclude non-internal, non-overlapping or non-boundary cells
if(filter_mask[ii] == 0){
continue;
}
...
}
}
Three-dimensional looping
Three-dimensional index-looping should be used when more control is required for example to get data
over a boundary, do some post-processing along a specific direction, plane or line, etc. The main step in
this case resides in creating a one-dimensional index to access the data using the cell coordinates in the
three principal directions in terms of index.
The data at a cell located at (i,j,k) can be accessed at the following ii index of the data
array:
/* ni : number of cells in x-direction obtained by calling get_integer(nb,"ni")
nij : number of cells in xy-plane obtained by calling get_integer(nb,"nij") */
ii = i + j*ni + k*nij;
The i, j and k coordinates respectively range from 0 to ni- 1, 0 to nj - 1 and 0 to nk - 1 with ni, nj
and nk the total number of cells in the x-, y- and z-directions.
For internal cells, the ranges of i, j and k are 2 to ni - 4, 2 to nj - 4 and 2 to nk - 4 as illustrated in
Figure 9.1.
Looping over internal cells Using three-dimensional indexing, a loop exclusively over the internal
cells would read as such:
/* nb : block index
ni : number of cells in x-direction
nj : number of cells in y-direction
nk : number of cells in z-direction
nij : number of cells in xy-plane */
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// get grid properties
nij = get_integer(nb,"nij");
ni = get_integer(nb,"ni");
nj = get_integer(nb,"nj");
nk = get_integer(nb,"nk");
/* i: cell index in x-direction
j: cell index in y-direction
k: cell index in z-direction
ii: 1D cell index */
// Loop over the cells of block nb
for (int k=2; k < nk-3; k++) {
for (int j=2; j < nj-3; j++) {
for (int i=2; i < ni-3; i++) {
// convert 3D to 1D index
ii = i + j*ni + k*nij;
...
}
}
}
}
Looping over the whole set of cells Using three-dimensional indexing, a loop over all the cells
would be constructed as follows:
/* nb : block index
ni : number of cells in x-direction
nj : number of cells in y-direction
nk : number of cells in z-direction
nij : number of cells in xy-plane */
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// get grid properties
nij = get_integer(nb,"nij");
ni = get_integer(nb,"ni");
nj = get_integer(nb,"nj");
nk = get_integer(nb,"nk");
/* i: cell index in x-direction
j: cell index in y-direction
k: cell index in z-direction
ii: 1D cell index */
// Loop over the cells of block nb
for (int k=0; k < nk; k++) {
for (int j=0; j < nj; j++) {
for (int i=0; i < ni; i++) {
// convert 3D to 1D index
ii = i + j*ni + k*nij;
...
}
}
}
}
Similarly to the one-dimensional indexing examples above, cell-markers can also be used to filter the
dataset further.
9.1.4 Parallel post-processing
Parallel toolbox
When a simulation is running in parallel (with more than one processor), the UDFs are executed
simultaneously by all the processors. The data from each processor needs to be gathered then sorted
after the processors have operated the tasks they have been assigned. After this operation, the sorted
data can be written to a file. To do the parallel data-processing, MPI (Message Passing Interface) is
required. It allows communication between processors. In TransAT, a set of functions built around MPI
are available to perform parallel post-processing operations. To access these functions, toolbox.h needs to
be included. Please note: the file toolbox.h is located in <TransAT_Installation_folder>/transatMB/inc.
Gathering data from processors
In the case of a multiblock simulation, several blocks can be assigned to one processor. When more than
one processor is used to run a simulation, the workload along with the data is spread over the
processors. To gather the spread data, the user can call the following function:
localVector is a pointer to a vector where the data collected on each processor is stored.
root (set at 0 if not specified) is the rank of the processor (i.e. index identifying the
processor) collecting the data.
The function returns a pointer to a vector of double. Sorting data
The order of the gathered data depends on the block distributon over processors and the time required
for each processor to execute the operations it has been assigned. As a result, the gathered data is not
ordered and it is necessary to sort it.
The data needs to be sorted with a coordinate vector in increasing order. Once every vector of data is added in a single pointer to a vector of vector, the sorted dataset can be
obtained by calling the following function:
The MPI_Allreduce method combines values from all processors and distributes the result back to
all processors. To use it, mpi.h must be included. The MPI_Allreduce method is called as
follows:
sendbuf: starting address of sent in value/array/vector
recvbuf: starting address of receiving value/array/vector
count: number of elements in sendbuf/recvbuf
datatype: data type of elements of the communicated value array/vector (int, double, ...)
op: combination operator
comm: communicator
If a value or an array, say var_local, is to be combined into the single_value/array var_global, sendbuf and
recvbuf should respectively be set to &var_local and &var_global.
If vectors are to be combined into other vectors, sendbuf and recvbuf should respectively be set to
&var_local.front() and &var_global.front().
The count value should be set to 1 if values are to be combined. Otherwise, for arrays and vectors it
should be the size of the var_local array/vector. Note that arrays/vectors must all at least be of size
count.
Depending on the type of the &var_local and &var_global variables, the the corresponding MPI data
type should be sent in as the datatype argument. Some of the most useful datatype for post-processing
data from TransAT are:
MPI_INT for integers
MPI_UNSIGNED for unsigned integers
MPI_FLOAT for floating numbers
MPI_DOUBLE for double precision floating numbers
Some of the combination operators that are commonly used to post-process TransAT data are:
MPI_MIN: sets the values of var_global as the minimum of all var_local values collected from
each processor
MPI_MAX: sets the values of var_global as the maximum of all var_local values collected
from each processor
MPI_SUM: sets the values of var_global as the sums of all var_local values collected from
each processor
MPI_PROD: sets the values of var_global as the sums the product of all var_local values
collected from each processor
For post-processing with TransAT, it is sufficient to always set comm to MPI_COMM_WORLD.
Example 1: value combinations Let us assume that an executable runs on two processors.
Processors 1 and 2 respectively set the var_local to 1.2 and 2.5.
To store the maximum of all the var_local in var_global, one would call MPI_Allreduce as
follows
This would set var_global to 3.7.
Example 2: array values combinations Let us assume that an executable runs on
two processors. Processors 1 and 2 respectively set the var_local array to and
.
To store the minimum of all the var_local into the var_global array, one would call MPI_Allreduce as
follows
This would set var_global to . Example 3: vector values combinations Let us assume that an executable runs
on two processors. Processors 1 and 2 respectively set the var_local vector to and
. To get the product of all the var_local values into the var_global vector, one would call MPI_Allreduce as
follows
// Header with parallel post-processing functions
#include <toolbox.h>
UserGlobal::UserGlobal(){
printf("\n--------\nUDF INIT\n--------\n");
}
UserGlobal::~UserGlobal(){
printf("\n--------\nUDF DESTRUCT\n--------\n");
}
// end of simulation
void UserGlobal::User_processing_end() //processing at the end of the simulation
{
int nblocks = get_integer("nblocks");
int ncellsblock;
char direction[] = "ymin";
double Uinf=20.0;
double rho=1.205;
// local coordinate vector (i.e. specific to processor)
std::vector <double>* x = new std::vector <double> ();
// Global coordinate vector gathering data from all the processors
std::vector <double>* xtotal = new std::vector <double> ();
// Local vector (i.e. specific to processor) with values of Reynolds number
std::vector <double>* Re_x = new std::vector <double> ();
// Global vector gathering values of Reynolds number from all the processor
std::vector <double>* Re_xtotal = new std::vector <double> ();
//get the rank (index) of the processor executing the programm
int glob_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &glob_rank);
//---------Collecting the data and add them to locals vectors ---------//
for (int iblock=0; iblock<nblocks; iblock++)
{
ncellsblock = getWallBoundaryNFaces(iblock, direction);
//number of cells at the wall, in the block
//here we calculate Re_x
(*Re_x).push_back(rho*Uinf*getWallBoundaryValue(iblock,
icell,
"x",
direction)/mu));
}
}
//Gather data from all processors to the root
xtotal = tmb::toolbox::parallel_collectVector(x);
Re_xtotal = tmb::toolbox::parallel_collectVector(Re_x);
if (glob_rank==0) //executed only by the root processor
{
// Store all the data in a matrix
std::vector<std::vector<double> >* dataMatrix
= new std::vector<std::vector<double> > ();
dataMatrix->push_back(*xtotal);
dataMatrix->push_back(*Re_xtotal);
// Sorting data with coordinate vector
std::vector<std::vector<double> >* dataMatrixSorted
= new std::vector<std::vector<double> > ();
dataMatrixSorted = tmb::toolbox::getDataVectorsSortedByIndexMap(xtotal, dataMatrix);
// Store the names of the variables to put them in the header of the file
std::vector<std::string> varnames;
varnames.push_back("x");
varnames.push_back("Re_x");
It is sometimes necessary to define initial conditions that are more complex than the ones that are
currently available in the TransAT user interface. Setting more complex initial conditions can be done in
two ways:
by setting Userdefined nodes in initialconditions.xml by editing the file by hand
by creating, compiling and running a C++ routine called initialconditions.cxx
9.2.1 User-defined Initial Conditions
The Userdefined method in initialconditions.xml is of particular use to define shapes for interface-tracking
simulations (i.e. with the Level-Set method). Multiple shapes can be initialised in the computational
domain by specifying the relevant properties in the Level-Set node of initialconditions.xml.
Shape definitions
The available shapes for initialisation are:
Circle
Sphere
Plane
Rectangle
Cuboid
To initialise a shape in the domain, the shape definition needs to be added to the level-set node in
the initialconditions.xml. For each shape, specific attributes need to be specified for its definition. Below,
attributes and examples for each available shape in TransAT are described.
Circle
The following attributes can be set to initialise a circular interface (for 2D cases only) through
initialconditions.xml
<attribute name="center"> for the coordinates of the center
<attribute name="radius" value="<value>" /> for the radius of the circle
The coordinates of the center are set by setting coordinate nodes in the center node. The coordinate
nodes are defined as follows:
with <direction> and <value> replaced by the corresponding direction (x, y or z) and value.
The dimensions of the rectangle in the principal directions are set by setting coordinate nodes in the
dimensions node. The coordinate nodes are defined as follows:
with <direction> and <value> replaced by the corresponding direction (x, y or z) and value.
The rectangular interface can be rotated around the normal axis of the domain by setting coordinate
nodes in the rotation node. The coordinate nodes are defined as follows:
with <direction> and <value> replaced by the corresponding direction (x, y or z) and value.
The dimensions of the cuboid in the principal directions are set by setting coordinate nodes in the
dimensions node. The coordinate nodes are defined as follows:
with <direction> and <value> replaced by the corresponding direction (x, y or z) and value.
The cuboid-shaped interface can be rotated around the axes in the principal directions by setting
coordinate nodes in the rotation node. The coordinate nodes are defined as follows:
The sign attribute is an attribute common to all the shapes that can be initialised with
initialconditions.xml. It belongs to the Method node.
For closed shapes the sign attribute designates the sign of the distance function inside the shape. For
planes, it designates the sign of the distance function under the planes (i.e. in the opposite direction of
the normal vector).
By default the sign attribute is set to negative (distance function negative inside shapes/under
planes ). The sign of the distance function can be flipped by setting the sign attribute to
positive
<attribute name="sign" value="positive" />
Example
The following example is an xml file to set the initial fields in a two-dimensional simulation of a
two-phase flow using the Level-Set method. The pressure and velocity field are automatically
initialised whilst the volume fraction fields are constant over the domain.The initial shape of the
interface between the two fluids is a 1m by 0.2m rectangle which centre is located at (0.5, 0.1).
This file is read at runtime and all variables are initialized before the actual iterating/time-stepping
process.
Samples of initial conditions in the xml format initialising various shapes for the Level-Set method are
available in the following folder: <TransAT_installation_folder>/transatMB/input/initialconditions_templates
9.2.2 Advanced Initial Conditions
In very simple cases, initial conditions can be set directly in the Initial Conditions tab. However, in
more complex cases where a greater degree of influence is required by the user over the initial settings of
the simulation, it may become necessary to set advanced initial conditions using a C++
routine.
The general workflow to set advanced initial conditions consists of creating the advanced initial
conditions file initialconditions.cxx then compiling it and running it.
Initial conditions template
An initial conditions file template is available at the following location:
Setting advanced initial conditions in the graphical user interface
Editing, compiling and running the initial conditions can be done through the graphical user interface.
These functionalities are available after selecting the Input and Initial Conditions sub-tab, enabling
Advanced Initial Conditions.
Clicking opens an initial conditions file. If an initial conditions file was already available
in the project folder, that very file will be opened in the default text editor after clicking
.
If no initial conditions file is available in the project folder, clicking copies the template initial
conditions file to the project folder then opens the copy in the default text editor. It can be modified to
suit the need of the simulation.
Once the initial conditions file is ready, will compile the initial conditions to check that the file
is written properly. This step is optional, but is helpful for debugging the compilation of
the initialconditions.cxx file. Continue setting the remaining simulation parameters, and
initialise the flow before execution. To initialize the flow, go to the Execute window and click
Creating advanced initial conditions file
With TransAT, initial conditions are set in the initialconditions.cxx file.
Several steps need to be followed to set the initial conditions:
listing of variables to be initialised and the required parameters for initialisation
declaration of variables
setting/accessing global parameters
looping over blocks
setting/accessing block-specific parameters
looping over cells for each block
setting/accessing values in cells
To illustrate this, a couple of advanced initial conditions examples are described in the following
sections.
Example 1: Wallboiling tutorial
This example is based on the wallboiling test case that is available in the tutorial manual. In the
tutorial manual, the variables are initialised through the Initial Condtions tab. In this
example, the initial conditions from the user interface will be reproduced using advanced initial
conditions.
Initialisation methods
There are two methods to initially set variables with advanced initial conditions. The first method
consists in getting access to the arrays containing the values of the variables to be set and
modifying the entries of these arrays. The second method uses the properties module of
TransAT. It is only available for thermodynamic quantities such as pressure, temperature and
densities. More details can be found in the properties module section of the of the Transat User
Manual.
In this example both methods will be used to set the initial conditions.
Preliminary work
The first step when setting advanced initial conditions is to list the variables to be initialised. An
exhaustive list of variables that should cover the equations that are solved for.
Once the variables have been listed, one should list the variables and parameters on which the variables
to be initialised depend on. For instance, one may initialise quantities that depend on the position in the
domain.
Writing the initial conditions file
Declaration of variables After the listing of the variables is done, the arrays storing
the values of the variables over the domain should be declared in the initialcondtions.cxx
file.
In the wallboiling tutorial, only the velocities, pressure, temperature and volume fractions are
initialised.
Note that for this case, arrays are declared only for the velocities. The remaining variables
are initialised with the properties module with which arrays do not need to be declared.
Accessing global parameters It is often required to read simulation parameters or some other
global variables to set the initial conditions in the domain. These parameters should usually be read
before doing any loop on the blocks and the cells of the computational grid. For example, one may need
to use the components of the gravity vector or the saturation temperature to initialise the
variables.
One very important parameter is the number of blocks in the domain. Indeed, TransAT being a
multiblock code, it is required to loop over all the blocks in the domain set the values in all the
cells.
Here, extra print statements were added. They can be useful to display information or
debugging. Loops over blocks and cells The next step consists in setting the values of the variables in all the
cells. Given the multiblock structure of the TransAT grids, one must loop over the blocks then over the
cells of each block to initialise variables over the whole domain.
/* nb: block index
nijk: number of cells in block nb */
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// access block specific parameters such as grid properties
nijk = get_integer(nb,"nijk");
/* ii: cell index */
// Loop over the cells of block nb
for (int ii=0; ii < nijk; ii++) {
...
}
}
Equivalently, one can also loop over the cells using a 3D index of the cells as follows
/* nb : block index
ni : number of cells in x-direction
nj : number of cells in y-direction
nk : number of cells in z-direction
nij : number of cells in xy-plane */
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// get grid properties
nij = get_integer(nb,"nij");
ni = get_integer(nb,"ni");
nj = get_integer(nb,"nj");
nk = get_integer(nb,"nk");
/* i: cell index in x-direction
j: cell index in y-direction
k: cell index in z-direction
ii: 1D cell index */
// Loop over the cells of block nb
for (int k=0; k < nk; k++) {
for (int j=0; j < nj; j++) {
for (int i=0; i < ni; i++) {
// convert 3D to 1D index
ii = i + j*ni + k*nij;
...
}
}
}
}
In the remainder of this example the first formulation of the looping over cells is used. The second
formulation could have also been used to yield the same results.
Setting initial velocities To set the velocities, the arrays storing the values must be accessed
through the use of the set_pointer function.
To use the set_pointer function, a block index, a pointer and a keyword are required for 1D arrays. For
2D arrays which store phase and component specific variables such as mass and volume
fractions, the phase or component index is required on top of a block index, a pointer and a
keyword.
Note that the arrays accessed through the set_pointer function are block-specific meaning that
the set_pointer function should be called in the block loops and before the loop over the
cells.
For this example, the only variables initialised by getting access to the arrays are the velocity
components in the x- and y-directions. In the following excerpt of the initial conditions file, the arrays
containing the values of the velocity components are accessed. The values of the velocity components are
then set over the domain (i.e. in the loop over the cells)
/* nb: block index
nijk: number of cells in block nb */
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// get grid properties
nijk = get_integer(nb,"nijk");
// set pointer to U/V-velocity array
// for block "nb"
set_pointer(nb,&u,"uvelocity");
set_pointer(nb,&v,"vvelocity");
/* ii: cell index */
// Loop over the cells of block nb
for (int ii=0; ii < nijk; ii++) {
Initialising variables with the properties module Now the pressure, temperature and volume
fractions will be initialised using the properties module. There are three steps to set values of variables
with the properties module
Step 1: Initialise the properties module with the properties_initialize function which take
for argument a block index and a cell index
Step 2: Set the values of the variables at the cell that was used to initialise the properties
module with the properties_set_state function. The properties_set_state takes for
argument a keyword and a value. For multiphasic variables such as the volume fractions, an
extra argument for the phase index is also required. For more information, see the Properties
Module section in the User Manual .
Step 3: Apply the new values with the properties_set_back function which does not
require arguments.
/* nb: block index
nijk: number of cells in block nb */
// Loop over the blocks
for (int nb=0; nb < nblocks; nb++){
// get grid properties
nijk = get_integer(nb,"nijk");
// set pointer to U/V-velocity array
// for block "nb"
set_pointer(nb,&u,"uvelocity");
set_pointer(nb,&v,"vvelocity");
/* ii: cell index */
// Loop over the cells of block nb
for (int ii=0; ii < nijk; ii++) {
// initialise properties module in block "nb" and cell "ii"
properties_initialize(nb, ii);
// using properties module to set pressure, temperature and volume fractions
properties_set_state("pressure", 0.0);
properties_set_state("temperature", 345.8);
properties_set_state("alpha", 0.003, 0);
properties_set_state("alpha", 0.997, 1);
// apply changes in properties for given cell
properties_set_back();
}
}
Please note: Note that the phase index starts at 0 meaning that 0 is the index of the first phase, 1 is
the index of the second phase and so on and so forth.
The whole initial conditions file is available at the following location
For Level-Set, phase 1 should have ϕ < 0 and phase 2 should have ϕ > 0.
For incompressible flow, pressure is usually set to zero. For compressible flow, absolute value
must be used, except if the system pressure has been set to a positive value (See Section
Compressible Flows). Temperature must also be initialised. Its values must be given in
Kelvin.
To specify an initial velocity to the heavier phase, the smoothed H function should be
first calculated. The smooth H function is equal to one in phase 2 and zero in phase
1:
for (int nb=0; nb < nblocks; nb++){
for (int ii=0; ii < nijk; ii++) {
properties_initialize(nb, ii);
h2 = get_heaviside(properties_get("levelset"),delta,ismooth);
u[ii] = u2*h2 + (1.0 - h2)*u1;
}
}
In this example, phase 2 is set to an x-velocity of 1.2 and phase 1 is set to an x-velocity of
0.2. Please note: In this example it is assumed that the levelset value has already been
set.
Running advanced initial conditions
Put the file initialconditions.cxx in the project folder
Open the project with TransATUI if that is not already the case
In the sub-tab Initial Conditions of the Input tab, select Advanced Initial Conditions.
Please note: if initialconditions.cxx is not available, a template of the initial conditions file,
will be copied to the project folder after clicking . The template file can be found in
<TransAT_Installation_folder>/transatMB/input.
Once the initial conditions file is ready,
Click
When is clicked, the C++ file is compiled. To initialize the flow, go to the Execute window and
click . This can be done after finishing the remaining setup, directly before running the simulation.
When is clicked, an executable named transatmbinitialDP is created in the project folder and then
run. If there are errors in the initial conditions file, the C++ compiler will show the errors report in
TransATUI text panel.
If everything is correct in initialconditions.cxx, a file named <projectname>.ini is created , as well as an
initial solution file in folder RESULT.
Hint: To check that the initial conditions have been properly set, check the output produced in the
RESULT folder with ParaView or Tecplot after running the initial conditions.
9.3 User-defined functions
TransAT enables the user to create user-defined functions (UDFs) by writing C++ routines to interact
with its data structure. Several steps need to be undertaken to use such functions. They need to be
implemented and compiled before use.
Template files for user-defined functions are available in the usercompile/udf_templates directory of the
installation folder. More easily, templates can be opened and edited through TransATUI.
9.3.1 Creating user-defined functions
To create user-defined functions, the user can load a template through the TransATUI. Settings for
UDFs are found in the User Defined Functions window under the Input main tab. This window is
shown in Fig. 9.3.
Click to define a new UDF
Settings are defined in the udf properties window (Fig. 9.4)
Figure 9.3: User Defined Functions Window
Figure 9.4: UDF Properties Window
The name for the UDF will be the same as the UDF file name and C++ class name. Therefore, the
name cannot contain any special characters or spaces, and cannot begin with a number. Each UDF has
an associated type, which determines the context in which the UDF is called. Each folder in
the UDF properties window represents a different type of UDF. The type will be assigned
automatically by TransATUI, when the desired template is chosen. Possible types of UDFs
include:
Drag Coefficient for ASM
Lift Coefficient for ASM
Wall Lubrication Coefficient for ASM
Paraview Output
Entry Point
Before Solver
Begin Iteration
End Iteration
Every Iteration
Every Particle Sub-Step
Every Time Step
Initialization
Output Frequency
Simulation Begin
Simulation End
Source Term
Alpha Rho
Concentration
Epsilon
Levelset
Mass Fraction
Pressure
Temperature
TKE
U Velocity
V Velocity
W Velocity
Once finished defining the properties of a UDF, click , and a folder called usercompile is
created in the project directory, where the UDF template is copied to. The file name and class
name will automatically be saved with the name defined in the properties window. The
UDF template consists of two C++ files, the implementation file (.cxx) and header file (.h).
If ”none” was selected for the template, no files will be copied to the usercompile folder. It is
necessary to ensure that the UDF is written properly so that the UDF will be found. To do so, the
names of the files (.cxx and .h) must match with the name defined for the UDF. The class name of the
UDF must also match with the defined name (UdfClassName::operator()() {...function...}).
A table is created in the User Defined Function window, listing the active UDFs. The table has
columns for the UDF name, UDF type, edit button and delete button. UDFs activated in the table by
the check-box will be included for compilation and execution in the simulation. To prevent a
UDF from being compiled and executed during a simulation, un-check it in the list. UDFs
can be deleted from the table by clicking , however the files will not be removed from
the usercompile folder. If a UDF file exists in the usercompile folder, but is not listed in the
table for active UDFs, it can be introduced into the simulation by clicking . Set the
UDF name defined in the UDF properties window the same as the .cxx and .h files that are
in the usercompile folder. Choose the proper type of UDF by selecting ”none” within the
proper folder. This will prevent the existing UDF from being overwritten by a template.
Click to open the UDF. The default text editor is launched to edit both the C++
implementation and header files. The main code and implementation of the UDF should go into the .cxx
file operator method. The .h file is reserved for declarations only and does not need to
be modified. The function executed can be found within the operator()() block of code.
9.3.2 Basic UDF Types
Some basic type of UDFs are only required to be defined in the User Defined Functions window.
Once written and included in the list of active UDFs, these UDFs are automatically executed during the
simulation. This includes Paraview Output, Entry Point and Source Term UDFs.
Paraview Output
Custom variables can be output for post processing in Paraview through the Paraview Output type
UDF. The structure of the operator is as follows:
Where var_out is the variable to be output to paraview.
Entry Point
The entry points are the following functions:
Begin Iteration calls UDFs before every iteration of the solver.
End Iteration calls UDFs after every iteration of the solver.
Initialization calls UDFs during initialization of Initial Conditions for the simulation.
Initialization is done when running advanced initial condtions. Therefore, this UDF
entrypoint is called directly after advanced initial conditions are initialized. To (re-)apply
the UDF, it would be necessary to initialize the flow (by clicking the IC button in the
Execution)
Simulation Begin calls UDFs at the beginning of the simulation, right before the solver
loop.
Simulation End calls UDFs at the end of the simulation.
Output Frequency calls UDFs every n iterations/time-steps with n corresponding to the
Frequency of output files input in the Output Management sub-tab of TransATUI.
Before Solver calls UDFs after the initialisation of forces, mass transfer rate, etc. before
the first steady-state iteration or time step.
Every Time Step calls UDFs at every time steps (for unsteady simulations only).
Every Particle Substep calls UDFs at every particle sub-step (for lagrangian particle
tracking only).
Every Iteration calls UDFs at every iteration (for steady simulations only).
Source Terms
Source Term UDFs allow the specification of an arbitrary source term to be added when solving
for equations. These UDFs are similar to entry point UDFs, and in fact are created by the same
factory in C++. Source terms can be added through UDFs for the following equations using entry
points:
alpha rho phase equation: Alpharho Source Term
concentration equation: Concentration Source Term
epsilon (turbulence) equation: Epsilon Source Term
level-set equation: Level-Set Source Term
component (mass fraction) equation: Massfraction Source Term
pressure equation: Pressure Source Term
tke (turbulence) equation: TKE Source Term
solid temperature equation: TSolid Source Term
temperature equation: Temperature Source Term
velocity component in x-direction equation: U-Velocity Source Term
velocity component in y-direction equation: V-Velocity Source Term
velocity component in z-direction equation: W-Velocity Source Term
Please note: the source terms are set by accessing and setting values of the right-hand side of the
specified equation. To access the array containing the values of the right-hand side of the
equations, the set_pointer method needs to be called with block index and the rhs keyword in the
definition if any source term UDF.
Figure 9.5 and Figure 9.6 depict the flowcharts of the steady and unsteady solving process of
TransAT with the entry points of the UDFs.
Figure 9.5: Flowchart of steady solver with UDF entry points
Figure 9.6: Flowchart of unsteady solver with UDF entry points
Extended Paraview Output
It is also possible to output Paraview fields without using the Paraview Output type UDF. As part of
any UDF type (Entry Point, Source Term, ...) a new vector to be written in the Paraview output
can be declared. Using the syntax detailed below, the vector will be shared between all UDFs and then
written to a Paraview format. This can be used for example in a Source Term to output the source
term field.
This will add to the Paraview output files a new variable called yourName. Since the
vtk_vector can be accessed from several UDFs, the output value can updated by several UDF
routines.
9.3.3 Extended UDF Types
The basic UDF types of Paraview Output, Entry Points and Source Terms are only defined once in the
User Defined Functions window. Other UDFs need to be activated elsewhere in TransATUI to
be used. This includes UDFs for the interphase models of drag, lift and wall lubrication.
Please note: Interphase UDFs (drag, lift and wall lubrication) need to be activated. Refer to the
following sections.
Drag Model UDF
After setting the type of a UDF to ”drag_coefficient”, it can be selected in the drag model
table. Click the Phases Interactions and the button. Now, select Drag Model from the
Interphase Slip Relations. In the drag model table, the UDF name will be available to choose
from.
Lift Model UDF
After setting the type of a UDF to ”lift_coefficient”, it can be selected in the lift model
table. Click the Phases Interactions and the button. Now, select Lift Model from the
Interphase Slip Relations. In the lift model table, the UDF name will be available to choose
from.
Wall LubricationModel UDF
After setting the type of a UDF to ”wall_lubrication_coefficient”, it can be selected in the wall
lubrication model table. Click the Phases Interactions and the button. Now, select WallLubrication Model from the Interphase Slip Relations. In the wall lubrication model table, the UDF
name will be available to choose from.
9.3.4 Compiling UDFs
While in the User Defined Functions window, UDFs can be compiled by clicking .
Only UDFs activated by the checkbox will be compiled. Furthermore, once the simulation
is run, only those activated UDFs will be executed during the simulation. Output of the
compilation will be shown below in the black text box. This is helpful for debugging the UDFs.
When executing a simulation, activated UDFs will automatically be compiled. To prevent any UDFs
from being included in a simulation, deactivate or delete them from the table in the User DefinedFunctions window.
9.3.5 Compiling UDFs through a terminal
It is recommended to compile UDFs through TransATUI because several unique files are created in the
compilation process. These files are:
uifilelist.py: contains a list of all files to be compiled
registerfunctors.cxx: registers the UDFs as pointers into TransAT
registerfunctors.h: header file for registerfunctors.cxx
To create these files without TransATUI, a template can be copied from the usercompile in the
installation directory. For the custom file myfile.cxx the user must add the following line to
uifilelist.py:
filelist.append(sfile(gl,"myfile.cxx"))
The file registerfunctors.cxx depends on the UDF file names and types, but could be as
follows:
EntryPoint_Factory (also used for Source Term UDFs)
Paraview_Factory
Using a terminal, UDFs are compiled with the following command
tmb_link.py -u
9.3.6 Running TransAT with user-defined functions
Once UDFs are written and defined in the appropriate locations of TransATUI, TransAT
can be run as usual to use the UDFs. UDFs will compile automatically at the start of a
simulation.
If running TransAT through the command line, UDFs can first be compiled either through TransATUI
or the command line. Next, the user can run the simulation with user-defined functions using the
following command in a terminal
tmb_run.py -n <procs_number> -u
Do not forget to initialize the flow with advanced initial conditions first, if there are any. If the -u option
is not used, TransAT will run without user-defined functions.
9.3.7 Adding Additional Files
If it is desired to use any additional files that are called by a UDF, extra steps are required for proper
compilation. Any additional files to be compiled must be saved in the usercompile folder and added to
uifilelist.py, manually. Once any additional files are added to uifilelist.py, UDFs can no longer be compiled
with TransATUI, because during compilation through TransATUI, files are re-written, including
uifilelist.py.
The proper method to include an additional file along with UDFs includes the following
steps:
First, define all UDFs available in TransATUI.
Click to compile UDFs. This will create required files in the usercompile folder.
After successful compilation place the additional files in the usercompile folder
Manually add the additional files to uifilelist.py, located in the usercompile folder.
Compile additional files through the command line: tmb_link.py-u (refer to Chapter
Command Line Options for complete details).
Run initial conditions (optional) : tmb_init_compile.py-n1
UDF can also be compiled simultaneously with Advanced Initial Conditions :
tmb_init_compile.py-u
Run TransAT through the command line: tmb_run.py-u
9.3.8 Backwards Compatability
Previous to TransAT version 5.5, UDFs were written with a different structure. The former UDF format
(using userglobal.cxx and userglobal.h) is deprecated and is not supported by TransATUI.
It is not recommended to apply former UDF and current UDF simultaneously, but it is
possible, however only when compiling and running simulations from the command line.
Compiling through TransATUI creates and rewrites files required for current UDFs (uifilelist.py,
registerfunctors.cxx and registerfunctors.h). Files userglobal.cxx and userglobal.h are required for UDFs in
TransAT previous to version 5.5. Additionally, uifilelist.py is not updated for older UDFs.
Please note: It is recommended to convert any old UDFs to the new format.
9.3.9 Example of a user-defined function
Below is an example of a user-defined function, where we want to print the maximum temperature of
the domain. The folder usercompile contains the UDF called get_maxtemp.cxx. This file is also available
as a template for the UDF type Every Iteration in TransATUI.
Notice in the example for get_maxtemp, that there is no direct reference to the type of entry point
(Every Iteration, Every Time Step, Simulation Begin,...) inside the source file. The type is defined in
TransATUI, and no other reference to type is required. This particular UDF could be added to any
particular entry point. It is most likely, however, that this should be of type ”Every Time Step”,
that the maximum temperature over the entire duration of the simulation would be found.
Alternatively, this UDF could be used at ”End Simulation” for a steady state simulation.
9.3.10 Data output along a straight line
Some post-processing task may require the output of selected variables along a straight line. The access
to this data with a user-defined function is facilitated with the line_output class, which is provided in
line_output.h.
A line_output object can be initialised using one of the following options
precision: number of digits after the decimal point
out_format: format string to be used by ’fprintf’ (e.g. ”%21.13e”)
The file contains the coordinates of the extracted data along the line direction and the specified output data
in a column-wise format.
Example 1: standard use
The following code excerpt demonstrates how the velocity component u in x-direction and the
temperature can be extracted along a line in the z-direction at x = 0.5m and y = 0.05m with the help of
the line_output class. The velocity and temperature values along the line will be interpolated using a
bilinear interpolation method. There are also UDF templates available in TransATUI that use the
line_output feature, including crossflow_output, begin_iteration_lineoutput and end_iteration_lineoutput.
It is sometimes desired to get the output of a variable that is not stored the arrays of TransAT but can
be computed using them. For instance one may want to combine several variables or do some form of
filtering then plot the new variable along a straight line. The line_output feature has an option that
allows register variables for this exact purpose.
The following code excerpt demonstrates how the Reynolds number can be extracted along a line
in the z-direction at x = 0.5m and y = 0.05m with the help of the line_output class. The
properties module and pointers to access the TransAT arrays are used to compute the Reynolds
number. There are also UDF templates available in TransATUI that use the line_output
feature, including crossflow_output, begin_iteration_lineoutput and end_iteration_lineoutput.
TransAT provides some additional advanced user-defined functions (UDF) tools. These UDF are
implemented in order to facilitate the addition of multifunctional objects into a simulation and let the
user interact with these objects through an easy-to-use interface in C++.
The following advanced UDF are available:
Embedded Fan
Fire Source
Template files for user-defined functions using these advanced features are available in the usercompile/udf_templates directory of the installation folder. More easily, templates can be opened and
edited through TransATUI.
The following sections contain more information on the advanced UDF provided.
9.4.1 Embedded Fan
The embedded fan UDF corresponds to a lumped parameter representation of a jet fan and allows for
the placement of a virtual jet fan anywhere inside the simulated domain. The fan action will be introduced into the flow by means of volumetric momentum source terms. Fan
parameters to be specified by the user are location, dimensions and the volumetric flow rate delivered by
the fan during operation. The fan can also be given a name to identify it among several individual jet
fan objects. If needed the user can implement any variation of the fan volumetric flow rate or its dependence on
other parameters such as time or any other available parameters through the UDF.
Creating an embedded jet fan
Start using the embedded fan UDF by selecting the corresponding template file in the TransATUI. For a guide on how to add UDFs from templates see section Creating user-defined functions.
Please note: The fan UDF should always be used with the embedded_fan UDF type. For the
compilation of UDF that use fan objects the corresponding header needs to be included.
#include‘‘Fan.h’’
A new fan object is created using the appropriate call to the constructor. For each fan the user needs to
specify
a name
fan radius
fan length
a vector with the fan centroid coordinates
a vector specifying the axis direction
the fan volumetric flow rate
E.g. in order to specify a fan named “Fan1” of 0.4 m radius, 1.5 m length, with its centroid located at
(2.5,0,0), its axis parallel to the X-axis and a volumetric flow rate of 10m3∕s, one would write the
following lines of code.
Please note: The centroid coordinates refer to the geometrical centre of the cylinder, i.e. the mid-point
of the cylinder axis of length L.
Alternatively it is possible to set up the fan with an already existing CylinderRegion object
as follows (Note: the fan constructor expects a C++ pointer to a CylinderRegion object).
Please note: The actual fan cross section area and volume depend on how well the fan is resolved
by the mesh. The resolution however will not have any effect on the fan jet exit velocity.
The actual volume of the fan can always be retrieved from the fan object CylinderRegion member as
follows.
myFan.getFanRegion()->getVolume();
Modifying fan volumetric flow rate
After setting up the fan object the volumetric flow rate can be modified arbitrarily within the UDF
using the setVolumetricFlowRate interface. E.g. if one wants to change the volumetric flow rate of the
example fan “Fan1” to 20m3∕s, one does the following
myFan.setVolumetricFlowRate(20);
9.4.2 Fire source
The fire source UDF combines several features of a typical fire into a single UDF feature. With a fire
source UDF the fire is described as a combined heat and concentration source, which corresponds to the
heat and smoke/pollutant added to the system by a fire. The extent of the fire as a heat and concentration source can be specified by either a box or a cylinder
of arbitrary dimensions. The fan can also be given a name to identify it among several individual fire source objects. If needed the user can implement any variation of the fire heat and concentration source strength or
their respective dependence on other parameters such as time, temperature, or any other available
parameters through the UDF.
Creating a fire source
Start using the fire source UDF by selecting the corresponding template file in the TransATUI. For a guide on how to add UDFs from templates see section Creating user-defined functions.
Please note: The fire source UDF should always be used with the fire_source UDF type. For the
compilation of UDF that use fire source objects the corresponding header needs to be included.
#include‘‘FireSource.h’’
A new fire source is created using the appropriate call to the constructor. For each fire the user needs to
specify
a name
an extent (box or cylinder)
the fire volumetric heat source strength
the fire volumetric concentration source strength
E.g. in order to specify a fire named “Fire1” inside a box of extent [0.0,1.0] × [0.0,1.0] × [0.0,1.0], rotated
about the Z-axis by 45∘ (=π∕4) with a volumetric heat source strength of 100kW and a
volumetric concentration source strength of 0.1[C]∕s, one would write the following lines of code:
For fire sources inside a box a dedicated constructor exists. Thus for box shaped extents exclusively,
the fire source can also be constructed directly without the need to create a separate BoxRegion object
as demonstrated below.
For the same fire with a cylindrical extent instead of a box, e.g. with a radius of 0.5m, a length of
1.5m, centroid location at (10,15,0) and an axis parallel to the Z-axis the fire source constructor can be
called as follows
Please note: The actual fire volume depends on how well the fire source is resolved by the mesh.
The heat release rate can be specified either by volume or in total. In the latter case the actual volume
will be taken into consideration.
Please note: The fire source can also be used to represent a pure heat or pure concentration source.
This can be achieved by simply setting the heat release rate or concentration source to zero. In the
TransATUI appropriate templates exist for both cases.
Modifying fire source heat release rate
After setting up the fire source the volumetric heat relase rate can be modified arbitrarily
within the UDF using the setVolumetricHeatPower and setTotalHeatPower interfaces. With the
setTotalHeatPower the fire source will automatically scale the volumetric heat release with the actual fire
source volume to ensure the total heat release rate is matched. E.g. if one wants to change
the volumetric flow rate of the example fire “Fire1” to 1MW∕m3, one does the following
fire.setVolumetricHeatPower(1000000);
Modifying fire source concentration production rate
After setting up the fire source the concentration production rate can be modified arbitrarily within the
UDF using the setVolumetricSmokeSource and setTotalSmokeSource interfaces. With the
setTotalSmokeSource the fire source will automatically scale the volumetric heat release with the actual
fire source volume to ensure the total heat release rate is matched. E.g. if one wants to change the
volumetric smoke production rate of the example fire “Fire1” to 1[C]∕s, one does the following
fire.setVolumetricSmokeSource(1.0);
Please note: When using the fire source, the concentration will always be interpreted as a
volumetric quantity, i.e. [C] = ..∕m3.
Chapter 10 Parametric Analyzer
The Parametric Analyzer is an application integrated in TransAT, developed with the purpose of
performing parametric study based on existing TransAT project. Fig. 10.1 shows how the application
looks like. It consists of 4 pages:
The idea behind the application is to define all the parametric variables of interest, regardless of if they
belong to the same case or different ones, and, afterwards, reorganize them according to your own
purpose. The role of the application is to assemble the folders corresponding to the different
cases of the template project and run them. It is up to the user to run the simulations.
Before performing the parametric study is advisable to check if the template project properly
works.
Figure 10.1: Parametric Analyzer Interface. Four main tab page are present.
10.1 Files
The Files page deals with the management of necessary data files and names:
transatMB folder path, retrieved by clicking on Get TransatMB Path.
TransAT template project path, namely the path of the folder containing all the necessary
files(stt, inp), obtained by clicking on Get TransAT Project Path.
Name of the parametric study, entered in the corresponding line edit.
10.2 Parametric Variables
In the Parametric Variables page the user can choose the parametric variables of interest among
Inputs, Boundary Conditions, Grid Properties, Advanced Initial Conditions and UserDefined Functions
Figure 10.2: Parametric Variables Page
10.2.1 Selection of Input, Boundary Conditions and Grid Properties
The choice of a variable belonging to the branches Inputs, Boundary Conditions and GridProperties occurs in the same way. By clicking on Get Input Variables (respectively Get BC Variables
and Get Mesh Variables) a tree structure appears and the user can select one variable, Fig. 10.3).
Figure 10.3: Selection of parametric variables belonging to the branches Inputs, BoundaryConditions and Grid Properties
10.2.2 Selection of Advanced initial Conditions and User Defined Functions variables
Clicking on Get Initial Condition File (respectively Get User Defined Function File) the corresponding
C++ file is displayed and the user can choose the parametric variable highlighting it with the mouse (it
is preferable to highlight some additional information in addition to the parametric variable, as showed
in Fig. 10.4).
Figure 10.4: Selection of parametric variables belonging to the branches Advanced InitialConditions and User Defined Function
10.2.3 Add Parametric Variable
After choosing the parametric variable, it is possible to assign values to the parametric variable. This
can be achieved in two ways:
Automatic Input Creation: the values of the parametric variable are automatically assigned
once the minimum, maximum and number of samples are defined. They are equidistantly
spaced between the minimum and maximum.
Manual Input Creation: the values of the parametric variable can be manually assigned
clicking on Add New Value and entering them.
The new parametric variable can be added clicking on Add New Parametric Variable .
Figure 10.5: Assign the values to the parametric variable: automatic and manual option
10.2.4 Graphical Representation
The structure of the parametric study and the total number of cases that will be obtained can be
visualize through a diagram block structure, Fig. 10.6).
Figure 10.6: Graphical representation of the parametric study
Fig. 10.6 shows a parametric study with 2 parametric variables
ygravity
inflowtemeprature
and consisting of 4 different cases:
ygravity = -9.81 and inflowtemeprature = 300K.
ygravity = -9.81 and inflowtemeprature = 420K.
ygravity = 0 and inflowtemeprature = 300K.
ygravity = 0 and inflowtemeprature = 420K.
10.3 Execute
Figure 10.7: Execute Tab Page
10.3.1 Rearrange parametric variables
In the Execute page of the Parametric Analyzer the variables defined in the Parametric Variable
page can be properly rearranged through the buttons Delete, Swap and Merge.
Delete: select one or more parametric variables and delete them.
Merge: select two or more variables characterized by the same number of sample and merge
them, namely the selected variables will change together in the same case.
Swap: select two variables and exchange their position.
Figure 10.8: Schematic parametric study representation before the merging of the variables
inflowtemperature and inflow_velocity_u
Figure 10.9: Schematic parametric study representation after the merging of the variables
inflowtemperature and inflow_velocity_u
The variables structure displayed in the Execute page is a simplified version of the diagram block
structure.
10.3.2 Assemble folders
The folders for the parametric study are assembled clicking on Assemble Folder, according to the
structure depicted in the diagram block. In general, if the text browser displays as final message
Parametric study setup is ready! and Successfully moved filesthe folder assembling is successful. For
example given the diagram block in Fig. 10.10
Figure 10.10: Graphical representation of the parametric study after the merging of the variables
inflowtemperature and inflow_velocity_u
from the assembling we obtain 2 folders named inflowtemperature__inflow_velocity_u__ygravity_-9.8
and inflowtemperature__inflow_velocity_u__ygravity_0. The first corresponds to a value of the variable
ygravity equal to -9.8 and the second to 0. Each on them contains two more folders: Case0pc and
Case1pc, corresponding to 2 sub-cases:
inflowtemperature = 300K and inflow_velocity_u = 0.15.
inflowtemperature = 420K and inflow_velocity_u = 0.3.
Please note: The variables inflowtemperature and inflow_velocity_u vary within the same case, as
result of their merging with button Merge.
10.3.3 Run the simulations
Once the folders for the parametric study are assembled, it is possible to compile and run the
cases with the buttons Prepare Simulation FIles and Compile and Run. The former manages
the preparation of the simulation files and the compilation of UDF and advanced initial
conditions, if present. The latter, instead, manages the run of the cases. Two option are
available:
Locale: the simulations are run on the local desktop with the specified number of processors
(per case);
Remote: a zip folder containing all the folders cases is assembled in order to run the
parametric study on Linux based remote server. Three scripts are prepared in order to
facilitate the management of the parametric study on the server: parametric.sh (by clicking
Prepare Simulation FIles and Compile) necessary to compile UDF and advanced initial
conditions (if present), submit.run and submit.ini (by clicking Run) to submit the jobs to
run the program and the advanced initial conditions (if present) with the specified number
of processors (per case). Please note: The zip folder is created after clicking Run Please note: The above mentioned scripts are designed for SGE system. For different
system, keywords can be accordingly changed in the scripts. Please note: The transatMB path required in the Files page refers to the one on the
remote server. A message is shown to remind the user of this once Run is clicked. Moreover,
when Remote is selected, the user is asked to insert the python executable path on the
remote server.
10.4 Data Analysis
Figure 10.11: Data Analytics Tab Page
The Data Analysis manages the plotting of results of parametric study. Clicking on Open, the user
is allowed to select one or multiple files, candidates for the plotting and comparison. The actual plot
requires the loading of the data through the button Load. To this end the user is asked to enter the
number of inputs and outputs variable according to the structure of the files (it is advisable to use
properly designed User Defined Function to define the optimal format of the file). Two plot options are
available:
1D Plot.
2D Plot.
Any ouput variable can be plotted as function of any input variable. If more than 2 input variables are
present, the user is asked to insert the value of the input variable not indicated as plotting
variables.
Fill the registration form as shown in Figrue 11.3
Enter an institution (school or work) email address, then click Submit. After being reviewed, an
email will be sent within one business day with credentials to log into the Customer Portal.
After logging in, TransAT<version> can be downloaded from the TransAT Downloads
tab
Please note: if you did not receive an email with Customer Portal credentials, make sure that it has not
been filtered out to your Spam folder
11.2 Customer Portal
Support for TransAT is provided through the Customer Portal.
To submit a support case in the Customer Portal
Go to the Customer Portal by clicking Login at the top of the TransAT webpage or by
directly using this link.
Sign in to the Customer Portal with the credentials to download TransAT<version> that
were sent to you after activation of your account. In case you do not remember your
password, fill in the forgot password form to get your password sent back to you.
Please note: if you did not receive your credentials, make sure that the Customer Portal
emails have not been filtered out to your Spam folder
Figure 11.2: Customer Portal login page
Click Create a case to create a new support case
Figure 11.3: Registration form
Fill in the form then click Save to submit the case
Upon submission, your case will be attended to as soon as possible.
Once a satisfactory solution has been found, the case can be closed in the Customer Portal by clicking
Close this case in the case properties window.
This error typically appears because the AMG solver is not able to handle properly separated flow
regions. Separated flow regions appear if a solid completely separates regions of the grid as shown in
Fig. 11.4.
Figure 11.4: Grid regions separated by solid
It is important to note if BMR is used, separate regions might appear even due to the grid only.
Fig. 11.5 shows the oilspill tutorial. In this tutorial there are two grid levels. The second level
(fine grid) has two separate regions and therefore the default AMG solver might complain.
Figure 11.5: Separate regions in fine BMR level
Solution
TransAT offers other solvers which can handle separated flow regions. See subsection 4.4.2 for all
solver options. The default solver ”GMRES” for example will also handle separate flow
regions.
Apte, S. V., Mahesh, K., Moin, P. & Oefelein, J. C. 2003 Large-eddy simulation of
swirling particle-laden flows in a coaxial-jet combustor. Int. J. Multiphase Flow 29, 1311–1331.
Hysing, S. 2006 A new implicit surface tension implementation for interfacial flows.
International Journal for Numerical Methods in Fluids 51 (6), 659–672.
Johnson, P. C. & Jackson, R. 1987 Frictional-collisional constitutive relations for granular
materials, with application to plane shearing. J. Fluid Mech. 176, 64–93.
Launder, B. & Spalding, D. 1974 The numerical computation of turbulent flows. Comput.Meths. Appl. Mech. Eng. 3, 269–289.
Sarfraz, M. 2003 A rational cubic spline for the visualization of monotonic data: an alternate
approach. Computer & Graphics 27, 107–121.
Snider, D. M. 2001 An incompressible three-dimensional multiphase particle-in-cell model
for dense particle flows. Journal of Computational Physics 170, 523–549.
Sundaram, S. & Collins, L. R. 1999 A numerical study of the modulation of isotropic
turbulence by suspended particles. J. Fluid Mech. 379, 105–143.
Chapter 12 Engineering Guidelines
Some problems in TransAT require some experience to set up properly. The goal of these Guidelines is to
present some of these problems and give some useful tips based on the TransAT developing team
experience.
12.1 Moving Objects
TransAT now offers the possibility to add Rigid Body Motion into CFD simulations. This possibility is
coupled with the Immersed Surface Technique (IST), which makes RBM possible and fast, but
also goes with some specifics that need to be considered when setting up a simulation with
moving parts. Some of these specifics are listed here in order to prevent some classic set-up
errors.
12.1.1 Main Idea
In the IST, solid objects loaded into TransAT are represented using a step function, which is 1 in the
fluid cells, 0 in the solid cells. This field is accessible in TransAT’s Paraview output under the
name Hfluid. At the beginning of each time-step,the current position of the solid object
within the computational mesh is read, and the step function is computed prior to any fluid
calculation.
One of the requirements of the IST is that the mesh resolution must be good enough to always have
at least 3 cells around a fluid/solid interface. For fixed objects this requirement is easy to implement, as
the TransAT User Interface allows visualizing the mesh and the solid object together during the mesh
definition step.
For moving objects, this requirement must still be filled, and at all times during the
object motion. While defining the mesh, one must think about eventual problems which
may occur once the moving part exits the mesh, or reaches a region where the grid size is
larger.
12.1.2 Tips
Some tips can be listed as ”good practice” to work with TransAT’s IST in general and even more so
when working with moving objects.
Don’t make the domain boundaries coincide exactly with solid parts boundaries: it is better,
from case to case, to extand the solid objects far outside the domain, or reciprocally.
Avoid thin parts (such as blades, thin walls ...) as they will drastically increase mesh
refinement requirements, especially for moving objects. Remember that a solid object must
be thicker than 3 grid cells throughout its trajectory in the grid.
When thin parts are needed, it is often useful to thicken them before importing them into
TransAT, especially when it doesn’t have a huge impact of the simulated process.
When using an object as the fluid domain using the Set CAD as Solid functionnality, the
mesh requirements remain the same.
12.2 Hydraulics
Here are some guidelines summarizing the TransAT workflow to be followed for a study on a hydraulic
system, here in the example of an ozonation channel. Other examples carried were flow rate repartition,
velocity profile after a turn, ...
12.2.1 Main Idea
The goal is to give information about some interesting quantities for structure design, where a flow is
taking place. Most of the times people want to access something in particular such as flow through time,
velocity profiles, pressure drops, dead zones... These problems can be 2D, 3D, single phase, free-surface,
multiphase... An important thing is to first decide how much can the approach be simplified to save
computation time. Based on what people want to see, and on the problem itself, most of the time
free-surface effects can be neglected... the goal is to stay, as much as possible, close to steady single
phase simulations. Here some specifics about what has been done to access the residence time in an
ozonation channel.
Figure 12.1: Flow through a ozone reactor tank
12.2.2 Practical Steps
The first step is a discussion with the client to see what they want and understand how much we can
simplify. They dont always know much about CFD and fluid dynamics, but they know their processes
really well and this is helpful. For instance, here they could confirm that 2D was enough and that free
surface could be ignored. Thank to that the flow can be simulated single phase steady state, which is a
huge time gain.
Domain, Grid and Boundary Conditions
Geometry created in Inventor based on drawings
Baffles, walls, made bigger to reduce stress on embedded object mesh
Thinking of including inflow and outflows BEFORE generating the geometry makes life
easier later
Physical Models
Steady, single phase, so only careful definition of BCs is required.
Once the steady state flow is obtained, different information can be accessed by introducing a
certain quantity of fluid particles at the inlet and observing them flow through the
domain
Same density as fluid
Langevin force very important
MAXIT = 0
1-way coupling
No additional particles introduced at inflow
Post-processing
By monitoring the position of the particles, dead zones and accumulation zones are identified
By monitoring the number of particles present in the domain the cumulative density function
and so on can be computed, giving access to quantities such as flow through time, (when
90% of particles have left for inst.) or give indications about the dispersion (spreading of
the CDF)
Figure 12.2: Cumulative residence time density function
12.3 Hydraulic Jump
Here some tips are given to study hydraulic energy dissipation systems in general, with the example of a
hydraulic jump.
12.3.1 Main Idea
The goal of a dissipation energy study is to assess the amount of energy which can be dissipated for
given flow conditions and a given geometry. Depending on the situation some analytical solution or
correlation might be available to validate the simulation results. The energy in a hydraulic system is
often analyzed as the hydraulic head which is monitored along the streamlines and has the
unit of a distance ([m]). Before starting anything the definition of the head must be well
understood.
In this document we take the example of a hydraulic jump at the exit of a channel. A hydraulic
jump is an energy dissipation configuration where the fluid slows down, and the cross section expands.
The head at a given section is the integral of z + 2g over the cross section. A hydraulic jump is
possible when the incoming flow is super-critical, meaning the Froude number Fr is greater than 1 and
correlations give the amplitude of the jump and the head loss as a function of the Froude number before
the jump:
(12.1)
(12.2)
Figure 12.3: Hydraulic energy dissipation
12.3.2 Practical Steps
As an example, a 2D problem with a simple geometry is described here:
Figure 12.4: Hydraulic jump setup
The problem is described by the incoming Froude and Reynolds numbers (Fr1 and Re1). After
arbitrarily fixing quantities such as the channel height and the density, the other variables are adjusted
to fit the desired problem.
Domain, grid and Boundary Conditions
Height should be high enough so that the jump is always contained in the domain (2Y2 is
reasonable, less should not be used).
should be long enough so that the vertical profiles do not change anymore after the jump
(15Y2 after the channel outlet is reasonable).
Channel length should be long enough so that the flow is developed before reaching the free
surface region (look at entry length correlations with Reynolds number).
Mesh refinement should be done at the wall of the channel, at the entry of the free surface
region and between the initial and expected liquid levels.
Inflow: the inflow profile depends on the conditions but in general a turbulent profile is
assumed. Enough entry length should be given so that the flow is developed when it reaches
the free surface region.
Wall BC at the bottom.
Pressure BC at the top (constant 0 pressure).
The outflow BC is the most complex one, as the velocity outflow does not ensure mass
conservation. Using analytical correlations, one can assume the expected liquid level at the
outflow (after the jump) and use a pressure outflow corresponding to this liquid level.
Physical Models
The problem is a multiphase flow and the ASM model with gravity drift can be used.
Turbulence is required (k - ϵ).
Even if the objective is to obtain a steady state, an unsteady simulation is more stable.
Postprocessing
TransAT offers the possibility to use section outputs where different variables such as flow rate of each
phase, kinetic energy and more can be monitored.
12.4 Flocculation
In this chapter we provide some hints to study a complex water treatment plant, which includes several
separate difficulties like the hydraulics or the chemical reactions forming part of the purification process,
modelled here using interphasic mass transfer between mixed phases in the ASM (Algebraic Slip Model)
model. here the example of phosphorus removal using activated carbon powder (PAC) particles is
modelled.
12.4.1 Main Idea
Initially some chemicals are mixed with the waste-water and the homogenized mixture is poured into a
retention pool with slow mixing where chemical and physical reactions take place. The pollutants
precipitate as solid particles, which in time become bigger and bigger by accumulating other pollutants:
this process is called flocculation. These particles are heavier than water and will settle down, the goal
of the slow mixing is to prevent this and drive the flocs until the outlet of the pool where they will be
filtered.
12.4.2 Modelling Principle
It is impossible for a CFD code to have all the existing models for waste water treatment available, so
modeling choices must be made for the physico-chemical reactions taking place. It is important to have
a clear understanding of the problem to be able to simplify it to a reasonable number of key elements
and reactions (the detailed process for flocculation involves tens of species and reactions, this is too
much for CFD).
Once the process is simplified it will be converted into a mass transfer multiphase problem in order
to use TransAT ASM capabilities. The different species, in this case:
air
water
dissolved phosphates (pollutants)
dissolved iron
precipitated iron
small flocs
big flocs
All the species should be thought of as independent phases with their own properties such as density,
viscosity and their own source and sink terms. The phasic properties will help to regulate how
the phases move relative to each other by means of the ASM (air will be lighter than the
other phases and will go up, dissolved phases will have the same density than water and
so will follow it exactly, while precipitated species and flocs will be heavier and will tend
to fall). The physico-chemical reactions will be modeled with inter-phasic mass transfer,
defined by means of TransAT s UDFs (User-Defined Functions). The reaction rates must be
converted to volume fraction source terms using the relation between volume fraction and molar
concentration (one must first know what units, orders of reactions etc... are used to describe the
processes).
There are two methods to simulate mixing in TransAT that one can choose from.
Introducing a detailed geometry with a specified motion using the moving object feature.
This requires a proper resolution around the object and might not be adapted for large
scale problems due to computational cost
Embedded fan/jet technique. A geometrical shape is defined in which the velocity is
imposed, modelling the effect of an agitator, fan, jet...
12.4.3 Practical Steps
This sort of problems is rather complex and should be done steps-by-steps in order to minimize the
chances of undetected errors. Typically, these intermediate cases should be done.
Real geometry single phase problem - test the geometry and the basic BCs and mesh setup
Real geometry free surface problem - if air is relevant because of possible waves, changes of
the liquid level... a simulation to observe just that should be done
Same thing, add mixing if relevant (check that mixing is giving the expected behavior) -
eventually a scalar tracker can be set to observe the passive propagation of species (set a
concentration of 1 at the inlet and let it evolve)
Simple geometry (closed 2D box) with all species and reactions knowing the initial
conditions and reaction rates, one should know which species will form and which species
will disappear, and at what rate
Figure 12.5: Species quantities evolution
Domain, Grid and Boundary Conditions
The geometry should be defined as a closed .stl object and meshed with sufficient resolution so that
solid and liquid layers always have at least 3 cells inside. BCs (especially inflow/outflow) should be
defined carefully as an ill-suited choice of BCs is a current source of error, this choice should be
carefully detailed and specified as explained above:
Volume fraction and velocity for each phase
Backflow phases
Outlet pressures
Physical Models
Chemical reactions through UDFs and inter-phasic source terms
Mixing through embedded objects or moving objects
Phase separation through ASM and a well-chosen set of properties for each phase, the
density values typically should be estimated beforehand to have the expected settling
velocities
Turbulence model (k - ϵ) if needed
Run Time
Figure 12.6: Flocs repartition in water treatment plant
12.5 Sludge Clarifier - Controlling Separation
Here are some learnings summarized for the study of a water treatment plant where sludge is removed
from clear water using stratification.
12.5.1 Main Idea
A sludge clarifier is a large-scale device (typically 20-30 m radius) where a sludge/water mixture is
introduced and let there to settle. Under a mixture of gravity and flow forcing (pumping) the sludge is
removed at the bottom of the clarifier while the clean-water, hopefully sludge-free up to a certain
tolerance, is extracted at the top to be sent to secondary clarifiers.
12.5.2 Modelling Principles
This problem is a sedimentation problem which can be tackled using the Algebraic Slip
Model (ASM). The inflow consists of a water-sludge mixture, with the ratio depending on
environmental variables such as the amount of rain. The main modeling difficulty is that
several studies have shown that the settling velocity of the sludge is a complex function of the
sludge concentration (following a curve such as presented by Takacs et al. (1991)) and is as
such not covered by the standard ASM. It is however possible to use TransATs UDFs to
impose the correct settling velocity as a function of the concentration with a user-defined drag
model.
Figure 12.7: Separation rate is a function of concentration
12.5.3 Practical Steps
This paragraph summarizes some useful tips to set up a water clarifier problem.
Domain, Grid and Boundary Conditions
The geometry should be defined as a closed .stl object and meshed with sufficient resolution so that the
smaller details are captured and all structures are meshed with 3 cells minimum. Typically, the clarifiers
have a axisymmetric geometry so the axisymmetric model of TransAT can be used. The axis of
revolution has to be the X-axis.
The following boundaries need to be set up:
Inflow with a water/sludge mixture
A clear water outflow at the top, which may have air as a backflow based on modeling
choices. This outflow can be defined as a pressure outflow with the gravitational head
imposed.
A sludge outflow at the bottom, often defined as a pump (for example imposing 60% of the
inflow flow rate)
Physical Models
TransAT ASM (sludge, water and possibly air are independent phases)
If a complex model for settling velocity is wanted, a User-Defined drag model using th
available templates should be used
If a complex rheology is wanted, UDFs for the suspension viscosity should be used as well
As TransAT uses volume faction and practical problems use mass concentration, one should
take the time to work out the conversion between both.
Run Time
These problems are large scale and would typically require long simulation time
Slowly increasing the modeling complexity and closely monitoring the simulations saves time
beginitemize
Simple inflow/outflow problem (no gravity...)
Multiphase problem without slip
...
Depending on the operating conditions the solution may or may not reach a steady state. It is
important to know when to stop
Monitoring the sludge concentration along various line outputs in the domain is a good tool for
monitoring
Figure 12.8: Flow through a sludge separator
12.6 Natural Hazards - debris fall and avalanches
Here is a set of guidelines summarizing the TransAT workflow to be followed for the study of natural
hazards like debris flows or avalanches.
12.6.1 Main Idea
The goal is to model avalanchesi, rock falls, debris flows or landslides and access the relevant quantities
for this sort of problems such as spreading, runout length, thickness, energy balance.
12.6.2 Modelling Principles
Usually these problems can be approached using the ASM model of TransAT, while once available the
VOF model might also be a good candidate. A study like this should usually consist of two steps: The
materials involved are considered as a single phase following a non-Newtonian rheology such as the
Bingham or Herschell-Blkley models. The parameters of this rheology are usually unknown, as the real
material composition (debris, rocks, snow...) is very variable from one case to the other. The first
part of a study like this one is to find a benchmark test case in the literature to simulate
and obtain parameters for the rheology. Then, the real case can be simulated. It can be
challenging to obtain good-quality geometrical models for problems involving real natural
environment such as mountain faces. These topographic data can be accessed on various
websites and some of them allow to export this data in a .stl format (usually for 3D printing
applications).
Figure 12.9: Simulation of a landslide using TransAT
12.6.3 Practical Steps and Tips
This paragraph summarizes some useful tips to set up a natural hazard problem.
Domain, Grid and Boundary Conditions
The geometry should be defined as a closed .stl object and meshed with sufficient resolution so that the
smaller details are captured and all structures are meshed with 3 cells minimum.
Mesh refinement must be based on several considerations such has the global size of the
domain and the details of the flow modeled (typically the thickness of the avalanche,
landslide...)
With good initialization, all BCs can be made as pressure outflows with air as the backflow
material
Physical Models
The multiphase ASM model can be used for multiple phases, if only two phases are included
the VOF is also an option to limit numerical diffusion
If the material rheology is too complex, then it can be modelled as several layers of different
materials (phases) with different rheologies. For instance, a base layer with a very high yield
which wont ever move and a top layer with a low yield which is likely to flow under gravity.
Initial Conditions
Initial conditions are important here as they define the initial topology, or the position and
quantity of the flowing phases (snow, debris...) before they start moving. They are expected
to have a great impact on the runout, energy and spreading of the flow. To set a certain
thickness over a geometry the solid level-set function (lsembed) can be used to define initial
positions.
12.7 Process Engineering - Chemistry
Here some hintsare provided for the study of the acidification reaction in a Tall Oil reactor vessel, but
these tips can easily be translated to other process and hydraulics probems.
12.7.1 Main Idea
The reaction vessel consists of a large vessel with several inflows, several outflows and sometimes a
rotating part used to steer the mixture (agitator). Different reacting species are introduced through the
inflows, they will react, form new species and separate in the vessel, and finally exit at the outflows,
based on their relative densities, ...
12.7.2 Modelling Principles
Simple reactions in homogeneous phases can be modelled using the Species & Reactions functionality
of TransAT. However, this model will fail at modelling the separation between the reactants/products of
the reactions, meaning that each component taking part to the reaction should be modelled as a phase
in a N-phase mixture approach, using the Algebraic Slip Model to capture the phase separation
(the pairwise miscibility of all phases must be entered in TransAT). The reactions must be
defined through User Defined Functions (UDFs) with interphasic mass transfer source terms.
Examples of such source terms can be found in the TransAT UDFs templates. In the example
of the acidification reaction, the reaction and the different phases (components) involved
are:
(12.3)
Assuming a reaction rate, the interphasic source terms can be set to model the reaction.
12.7.3 Practical Steps
This sort of problems is rather complex and should be done steps-by-steps in order to minimize the
chances of undetected errors. Typically, these intermediate cases should be done.
Domain, Grid and Boundary Conditions
Real geometry no moving part - single phase problem - test the geometry and the basic
BCs and mesh setup: the simplified inflow/outflow problem must work before anything else
is envisaged, and the flow patterns should be matching expectations. The choice of the
inflow/outflows boundary conditions definition (pump, regular inflow, pressure outflow...)
must be investigated here
Simple geometry (2D square box) separation problem: the ASM lays on the idea that the
speed at which two phases separate is controlled by a parameter which is the dispersedphase bubble size. When this parameter is increased, the separation rate of two phases
is increased. Based on the expectations (which phase will be dispersed phase, in which
continuous phase) the parameter should be tuned to have the correct separation velocity.
Simple geometry reaction setup: testing the reaction source terms without complex flow
patterns is a good idea to spot errors
Real geometry - no moving part problem
Real geometry - moving part problem (if relevant): only add the moving parts once there
is confidence in the rest of the modelling
Domain, Grid and Boundary Conditions
The geometry should be defined as a closed .stl object and meshed with sufficient resolution so that
solid and liquid layers always have at least 3 cells inside. BCs (especially inflow/outflow) should be
defined carefully as an ill-suited choice of BCs is a current source of error, this choice should be detailed
with the following quantities:
Volume fraction and velocity for each phase
Backflow phases
Outlet pressures
Physical Models
Chemical reactions through UDFs and inter-phasic source terms
Mixing through moving objects feature
Phase separation through ASM and a well-chosen set of properties for each phase
Turbulence model (k - ϵ) if needed
Run Time
These problems are typically large scale and take a long time to run
Setup errors can be limited by increasing the complexity step by step
Constant monitoring allows to react faster
Figure 12.10: Tall Oil plant reactor vessel
12.8 Process Engineering - Separation
A Tall Oil reaction vessel is again studied, with a focus on the separation of the produced species (Tall
Oil, Lignin and Spent Acid), meaning that the reaction part is omitted here.
12.8.1 Main Idea
The part modelled here is downstream of the place where the reaction happens, so that we consider the
reaction finished and the final species (Spent acid, Lignin, Tall Oil) already formed and mixed. The goal
is to model the separation to see where each species is going.
12.8.2 Modelling Principle
Several options exist to model this based on how much time is available. Using the ASM is the obvious
choice (and the most accurate) since it can follow each phase independently. The risk is that it will be
very slow for 3D unsteady case.
In that case one approximation is to use particles tracking, one-way coupling frozen flow, on the
back of a steady state, single phase simulation. It is an approximation in the sense that the effect of the
lighter phases separation is decorrelated from a main flow pattern. On the other hand, this method is
very fast, and 1 to 2 days are enough to perform a separation study. In both cases, the
separation rate is critical and must be calibrated (a simple separation experiment can be
enough).
12.8.3 Practical Steps
This sort of problems is rather complex and should be done steps-by-steps in order to minimize the
chances of undetected errors. Typically, these intermediate cases should be done.
All points listed here can also be done on a mockup axisymmetric setup first in order to
save time and get a reasonnably representative setup
Real geometry no moving part - single phase problem - test the geometry and the basic
BCs and mesh setup: the simplified inflow/outflow problem must work before anything else
is envisaged, and the flow patterns should be matching expectations. The choice of the
inflow/outflows boundary conditions definition (pump, regular inflow, pressure outflow...)
must be investigated here
Calibration of the separation rates, ideally using some experimental data like a
sedimentation experiment
Homogeneous model: even without separation, adding several phases can modify the
behavior from the single-phase case by introducing regions with a mixture which will
have different density. Understanding what is going on before adding separation is key to
understand the real physical behavior
Introduce separation with ASM, Particles
Domain, Grid and Boundary Conditions
The geometry should be defined as a closed .stl object and meshed with sufficient resolution so that
solid and liquid layers always have at least 3 cells inside. BCs (especially inflow/outflow) should be
defined carefully as an ill-suited choice of BCs is a current source of error, this choice should be
carefully detailed using the quantities below.
Chemical reactions through UDFs and inter-phasic source terms
Mixing through moving objects feature
Phase separation through ASM and a well-chosen set of properties for each phase
Turbulence model (k - ϵ) if needed
Run Time tips
These problems are typically large scale and take a long time to run
Constant monitoring allows to react faster
Monitoring the flow rates of each species at each in/outlet and their overall quantity to
check that the results make sense is a must-do for multiphase problems such as this one.
Figure 12.11: Separation of Lignin in a Tall Oil reactor vessel
12.9 Thermal Packaging
In this chapter, the long-term evolution of temperature in a passive container is studied, and some ideas
on how to model such a problem are provided.
12.9.1 Main Idea
The goal of such a problem is to study how a system responds to a thermal load against time. The
example developed here is that of a container used to transport sensible products (such as medicines) by
plane and ensure that certain temperature constraints are respected during the shipment. The container
is made of a load, corresponding to the center compartment where material is stored and
where constraints have to be respected, of a structural material (isolating the load from the
outside) and of pockets inside the load initially filled with ice in order to prevent excessive
heating.
The challenge is to reduce the computational cost due to the long time span of the simulations
(several days, while thermal convection starting in the fluid zones can be very fast).
12.9.2 Practical Steps
Figure 12.12: Thermal packaging setup
The geometry must account for all the parts of the container. If pockets of ice are introduced, then
the corresponding holes in the container structure must be created and based on the modelling choice,
solid parts corresponding to the ice pockets must be created.
If one chooses to model the ice pockets as fluids with a phase change model, then some multiphase
model must be chosen, as typically the load inside the container is filled with air. A lighter option is to
model those pockets as solids with an adaptive heat capacity model to account for the phase change (Cp
becomes a custom function of temperature). Using solid is faster as no momentum equation is solved
there, only the temperature equation when the heat transfer model for the solid is set as
conjugate.
The other important modelling choice concerns the boundary conditions on the side of the container.
Accurate modelling would require simulating the surrounding air in order to have the thermal
convection considered, however this would make the simulation time increase significantly. One can set
instead the domain to correspond with the container and choose between time-dependent temperature
or heat flux at the walls.
Figure 12.13: Temperature evolution in the thermal load
12.9.3 Tips
To perform these simulations in an efficient way, the user can benefit from the expert’s experience,
which is formulated in terms of tips:
Diffusion criterion for time steps can be increased so that CFL is the restricting criterion
Mesh size should be thought carefully to resolve all features, pockets, but not be too fine
in fluid zones where large CFL numbers will be observed, so that it does not slow down the
calculation too much
Thermal boundary condition (heat flux or temperature) must be chosen based on the
available data for the problem
Variable Cp is implemented using the Heat Capacity from file option, and calibration
should be done to ensure that the behavior is close to the expectations (look for Stefan
problem simulations in literature for more on that topic)
Use advanced initial conditions to set the temperature in the different zones (ice pocket,
load, container structure)
12.10 Turbulence Study
A turbulence study oftan aims at producing some statistical profiles, including a mesh-dependency
analysis, and in practice some useful tips are helpful to execute these studies in an efficient
way.
12.10.1 Main Idea
The goal of a LES study is to generate a synthetic flow field in the form of x-y profiles of velocity,
kinetic energy, temperature in a pipe or channel under specific flow conditions. The very nature of these
profiles is statistical, meaning that they are obtained by performing a time- (and often space-) averaging
of the instantaneous quantities (instant velocities, instant temperatures...). To perform these averages,
the flow must have reached a pseudo-static state (also called ergodic state) where the statistical
quantities do not vary anymore.
Mesh convergence is important in this sort of problems as it allows to generate turbulent flows on
coarse meshes (hence saving computational time) and then restart on successive refined grids to
enhance the solution accuracy. Ideally once the mesh is fine enough no further refinement is
refined. It is important to note that turbulence can decay if the mesh and scheme are not
adequate.
12.10.2 Practical Steps
Problem Setup
PIC
A turbulence problem is defined using non-dimensional numbers, based on the parameters of
interest, e.g.: bulk or shear Reynolds number, Prandtl number, Based on known material properties,
problem geometry and non-dimensional numbers of the problem, the list of key figures include
(sometimes it is required to arbitrary fix some of the values):
Turbulent wall quantities such as the friction velocity utau which will be needed to determine
all dimensions in wall unit
For thermal problems the friction temperature Ttau must also be calculated (used for
calculation of non-dimensional profiles)
For thermal problems, the size of the mesh must be carefully determined by considering
both the momentum and temperature boundary layers (ratio between two quantities is Pr,
if Pr > 1 the thermal boundary layer is smaller as the momentum boundary layer).
Turbulence Generation On Coarse Meshes
Turbulence is more easily created on smaller meshes, as calculations are faster, numerical diffusion is
less important and it is easier to highlight setup mistakes.
Figure 12.14: Mesh refinement
mesh Refinement
Restarting the simulation from a coarse mesh on a finer mesh is made possible by TransAT
non-matching restart option. Before changing to the next mesh, it must first be made sure that
the flow rate has equilibrated on the previous one. That is, for a given imposed pressure
gradient, the bulk velocity (or macroscopic flow rate) will slightly vary from one mesh to
another (due to resolution of the wall stresses) and this bulk velocity must have reached a
stable value before starting the next finer-mesh simulation. The same occurs for flows with
imposed flow rate and where the pressure gradient adjusts to flow conditions. Other quantities
such as volume-integrated kinetic energy can be monitored to control the ergodicity of the
flow.
Mesh needs to be refined so that several cells are present in the boundary layers for flow problems,
this corresponds to the region of y+< 10, with first cell around y+ = 1. For each mesh, based on the
value of the wall-neighboring cell y+, the wall-functions or no-slip approach should be chosen.
Time-averaging should typically start once the flow has reached ergodic conditions and last long enough
taveraging+10000 is generally sufficient.
Figure 12.15: Averaged and instantaneous velocity
Tips
To perform these simulations in an efficient way, the user can benefit from the expert’s experience,
which is formulated in terms of tips:
CFL must remain < 0.5 for good accuracy
Central difference scheme for spatial derivatives is more accurate (here CFL< 0.2 - 0.3)
Flow forcing method: imposed pressure gradient or imposed velocity should be chosen based on
the problem definition.
If the flow is defined with a constant flow rate or a bulk Reynolds number, then the
mean velocity forcing is the best approach
If the flow is defined in terms of the pressure gradient or the shear Reynolds number,
then the mean pressure gradient forcing approach is the right one
For thermal problems, the wall boundary condition (heat flux or fixed temperature) must be
chosen based on the available data for the problem
As periodic conditions are typically used, it might be needed to impose a null energy balance on
the average domain, otherwise the fluid will be constantly heated by the wall. This can be done
using TransAT UDF source terms.
No choice of material properties, grid parameters, must be random everything has to be
justified.
12.11 Restarting Procedures
This chapter details a quick procedure to restart a simulation on a cluster, without using the GUI as it
is not always available on a cluster. The last restart file that has been created during the previous run is
called: casename.runb
Make a copy of this file using following command:
cp casename.runb casename.rstb
TransAT will automatically identify this file as the restart data to be used.
Then the user must specify that the simulation will be the restart of an old simulation. This can be
done manually by editing the file: transat_mb.inp.
Open this file with a text editor and search for the following lines.
restart_method = "norestart"
and change it to:
restart_method = "restart"
Save and close.
To perform a restart from a different mesh, which is typically useful when grid refinement studies are
performed, the restart file from the old mesh casename.runb a well as the old mesh file casename.grda
must also be specified in the input file transat_mb.inp. The simplest way is to copy them in the current
working folder, in a subfolder called, say, non_matching_restart_files/.
The modification in the input file must now look like:
Submit your job again, check that the restart is effective. The time step or iteration numbering
should start from the value at which the restart file was written.
12.12 Level-set - microfluidics
Here are some hints on how to simulate a low Capillary number flow using an interface tracking method
(ITM), e.g. level Set approach. We refer to the example of the flow of a supercritical CO2 bubble
through a convergent-divergent pore.
12.12.1 Main Idea
Low Ca flows are challenging because of the flow is mainly driven by wetting effects controlled by
surface tension. Second, in this class of flows, parasitic currents appear around the front because of the
imbalance between pressure gradient and surface tension in the momentum equation. These tend to
dominate the rest of the flow, making accurate solution difficult.
12.12.2 Practical Steps
Figure 12.16: Flow of a supercritical CO2 bubble through a pore
The following items must be carefully checked:
Level set scheme must be Quick, others probably wont work
Other quantities schemes: default - HLPA
Inflow from IC to determine the inflow profile
Understanding the time step limitations. Ideally the time step will be controlled by a CFL
criterion. If diffusion is not important the diffusion criterion can be made very large to
prevent small time steps. Fixed time steps can also be used; however, this should be done
carefully, constantly checking simulation results to detect eventual problems
Mass loss is the principal risk following the information in mass_conserve.dat is critical. If
mass loss is important then time-step reduction and mesh refinement are the only options
These problems can be micro scale problem, which proved to be an issue for the GTS
library in TransAT. To be properly loaded, geometries must be specified in a bigger scale
(ex m instead of mm). Then one must think in terms of the non-dimensional problem and
adapt required quantities (speed, fluid properties) to fall back on the original problem;
non-dimensional numbers must be the same.
12.12.3 Tips and Hints
To perform these simulations in an efficient way, the user can benefit from the expert’s experience,
which is formulated in terms of tips:
Always check results and mass conservation errors to spot problems
Fixed time steps can help to control the simulation speed and prevent very low time steps.
The chosen value must be well-understood
Very small time-steps can be initially chosen to properly initialize the flow, before restarting
with larger time steps progressively. Increasing the time step must be done carefully, without
abrupt jumps (not exceeding one or half a decade) making sure that the mass conservation
error prior to increasing it is under control.
When the time step is increased (be it manually or using the adaptice time-stepping
controls), the mass conservation error should increase but remain stable. If this is not the
case, it may mean that the time step increase is too large or happening too early.
2nd order time scheme is available for level-set and should be considered
12.13 Viscoelasticity
Viscoelastic problems are a challenging class of CFD poblems with very few guidelines on how to
properly define and tackle them. This chapter aims at giving some useful tips in that regard, without
tackling the problem of choosing a viscoelastic model among the many available (PTT, Giezekus,
Oldroyd-B.).
12.13.1 Main Idea
The difficulty of simulating viscoelastic flows can come from several factors. One is a very
well-known difficulty with the traditional methods called the high Weissenberg number problem,
which can in theory be circumvented by the Log of Conformation Tensor (LCT) method
(implemented in TransAT) which is itself very challenging and complex. Another difficulty is
the number of equations to be solved which is very large, especially for 3D or multimode
problems.
12.13.2 Practical Steps
Problem Setup
A viscoelastic flow is set up roughly the same as any other flow (free surface with Level-set method or
single phase), where the rheology is specified as viscoelastic, which then requires several inputs such
as the VE model, some material properties, and some equations parameters for the stress
equations.
The VE stresses are generated as viscous stresses by shear, but then have a more complex
behavior because of the elastic mechanisms which are making them time-dependent as well as
shear-dependent.
Important Things to Look for and Troubleshooting
Calculating the flow Weissenberg (or Deborah) number gives information about how difficult a flow can
be to simulate.
It is simple in theory, but many things can go wrong in practice, and looking at the stresses/LCT
tensors in Paraview is probably the best way to access information about what is going wrong, and
where. In many cases, onvergence problems will happen in regions where some mesh transition can be
observed. The remedy to that it to keep the mesh as homogeneous as possible thoughout the domain.
For multiphase problems, when the viscoelastic properties of the two phases are very different (or when
a phase is not viscoelastic) the transition of the viscoelastic properties such as λ and μp at the interface
can cause problems. Making the interface wider (smoother) is a way to try and circumvent this
issue.
Tips
These elements can help with convergence:
LCT method
PTT model: increase the value of ϵ
Interface width for free surface flows can be increased to 2 or 3
Play with the values of λ to reduce the effective Weissenberg number and see if this helps.
Then this number can be increased step-by-step to better understand the complexity.
High viscosities can also be problematic, it was understood that for viscoelastic flows, viscous
heating is an important phenomenon which can strongly affect the values of polymeric
viscosities. An Arrhenius temperature dependence of these viscosities is implemented.