The TransAT Tutorial Manual is a self-sufficient document that provides step-by-step instructions
on how to setup, execute and visualize results for a fluid flow simulation using TransAT.
The examples included with the TransAT distribution can be found in the Contents. The tutorials
are chosen in a manner that they illustrate not only the range of functionalities in TransAT, but also the
breadth of its applications.
Single-phase flow with heat transfer through a channel is studied. The walls of the channel are kept at a
constant temperature of 320 K. Air flows in through an inlet at a velocity of 3 m∕s and an
initial temperature of 300 K. The aim is to get a steady-state solution of the temperature
profile in the channel. Since the flow is in the turbulent regime, k-ϵ turbulence model is
used.
1.1.3 Problem Setup
The problem is setup in 2D.
Domain: 1m × 10cm resolved by a mesh of 40 × 20 × 1 cells.
Left: inflow: velocity 3.0m∕s, constant velocity inflow, temperature Tin = 300K.
Right: outflow (velocity extrapolation)
Y faces: no–slip walls, temperature Tw = 320K.
Z faces: symmetry boundaries.
Fluid: Air
Reynolds number = 24000
1.1.4 Launching TransATUI
To launch TransATUI, open a terminal then execute the following command
>transatui.py&
1.1.5 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say channel_turbulent, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as channel_turbulent then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
Geo is a module that can be used to create simple geometries for TransAT. The grid properties are
defined in Mesh & BCs tab whilst the physical and numerical parameters of the simulation are defined
in the Input tab. When the simulation is ready, the simulation will be started from the Execute
tab.
Some general operations such as saving and loading projects or exiting TransAT can be done by clicking
Files then selecting the corresponding option.
1.1.6 Mesh & BCs Tab
The computational domain is defined and the mesh is created in the Mesh & BCs tab.
Select the Mesh & BCs tab at the top of TransATUI if that is not already the case.
Domain & Grid Tab In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab
In the Domain section, set the following values for the domain boundaries:
Note that Nx, Ny, Nz are the number of corner points in the x, y and z directions. The actual number
of cells in each direction is the number of corner points in the corresponding direction minus
one.
Also note that TransAT is a three-dimensional solver. As a result, at least 1 cell (i.e. 2 nodes)
is required in the third dimension, even for two-dimensional or axisymmetrical problems.
Blocks The domain must now be decomposed into several blocks so that the simulation can run on several
processors. Indeed, each block is allocated to one processor (but a processor can handle several
blocks).
Select Blocks to define the multi-block option.
Click to cut the domain into several computational blocks.
Choose 2 for X direction then click
The domain is automatically cut into blocks of equivalent sizes.
BCs Tab The BCs tab allows the user to assign boundary conditions for each of the surfaces present in the
domain. A list of the surfaces present in the domain can be seen by selecting All surfaces in the
drop-down menu.
The appropriate setup for this simulation requires 4 boundary conditions in total.
Select the BCs tab
One of each type of boundary condition are already available at the start.
This tutorial will edit from the Inflow, Outflow, and Wall BCs available.
Now conditions for each of the boundaries should be set.
For each boundary condition, press to open the parameters window, set the parameters
listed below then click .
In the Models and Properties section activate Turbulence Modelling and set the model RANS
(drop-down list). Keep Turbulent Heat Flux Modelling activated with the default choice and
settings
Activate Reference Properties and click to the right.
Set the following parameters in the reference properties window then click to save the settings
ReferenceVelocity:3.0 ReferenceLength:0.1
Figure 1.2: Physical models
Phase Properties Tab To set the fluid properties,
Click Phase Properties on the left-hand side of the TransATUI
Select Phase 1 in the phase tree
To use the pre-set properties of air, select Air in the Material Library drop-down list
Simulation Parameters Tab This tab is used to define the numerical properties of the simulation.
Simulation Type and Control Parameters The simulation will be run till the flow reaches steady state.
Click Simulation Parameters on the left-hand side of the TransATUI
Use the following parameters to run a steady simulation solved with an implicit method.
SimulationType:Steady NumberofIterations:500
Equations In this section the convergence threshold is defined as well as the convection scheme and the solvers
used by TransAT. These parameters can be set for each equation individually.
In the equation tree, click All Quantities
Modify the Convergence Tolerance field besides the equation tree as follows
Convergence Tolerance: 1.0e-5
Figure 1.3: Simulation parameters
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 1
Proceed as above to set the initial state of the remaining quantities as follows
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
1.1.8.1 Starting the simulation
Click to start the simulation
1.1.9 Viewing Results in Paraview
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
click File - > Open.
Navigate to the RESULT folder and choose xy-channel_turbulent...vtm.
Click Apply.
Choose variable T from the drop-down list. (See Figure 1.4).
Make visible the father object (xy-channel_turbulent.0000*) by clicking on the ”eye”.
Play the animation by hitting the Play button.
Figure 1.4: Variable Selection Drop-Down Box and the Play button
1.1.9.1 Plotting Velocity Vectors
To create velocity vectors in Paraview, an object is needed to calculate the 2D velocity vector, and a
plotting device to display the vector. To this end, the Calculator and the 2D Glyph tools are
used.
In the same Paraview window, create a Calculator object by clicking in the toolbar.
Alternatively, select Filters - > Common - > Calculator in the menu bar to create a
Calculator
In the Object Inspector window for the Calculator, enter Velocity as the Result Array
Name.
In the box below, enter U * iHat + V * jHat. See Figure 1.5.
Click .
Make sure that the Calculator is made
invisible and the father object (xy-channel_turbulent.0000*) is made visible by clicking on
the respective icons.)
Highlight the Calculator in the Pipeline Browser by clicking it once and then choose the
Glyph object by clicking in the toolbar (alternatively, select Filters - > Common
- > Glyph in the menu bar). Click .
Figure 1.5: Calculator Object in Paraview
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
1.1.10 Results
Figure 1.6 shows the temperature contours of the converged solution
Figure 1.6: Temperature contours: channel flow
1.2 Flow over a Backward Facing Step
1.2.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
1.2.2 Introduction
Single-phase flow over a backward facing step is simulated. The formation of the vortices when flowing
over an obstacle is of particular interest. The flow conditions are chosen so that the flow is laminar. The
problem is three-dimensional to capture the vortices. The following tutorial also shows how to
decompose a computational domain and modify the blocks in TransAT. The setup of the case is as
follows:
Domain: 50mm × 10mm × 10mm resolved by a mesh of 100 × 50 × 10 cells.
The step is defined at 0 ≥ x ≥ 10mm and 0 ≥ y ≥ 5mm.
X Min: inflow, velocity 0.1m∕s, constant velocity inflow.
X Max: pressure outflow
Y Min, Y Max and obstacle faces: no–slip walls.
Z Min and Z Max: symmetry boundaries.
Fluid: air
Inflow Reynolds number = 40
1.2.3 Launch TransATUI
Execute the following command to launch TransATUI
>transatui.py
1.2.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say backwardstep, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as backwardstep then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
Geo is a module that can be used to create simple geometries for TransAT. The grid properties are
defined in Mesh & BCs tab whilst the physical and numerical parameters of the simulation are defined
in the Input tab. When the simulation is ready, the simulation will be started from the Execute
tab.
Some general operations such as saving and loading projects or exiting TransAT can be done by clicking
Files then selecting the corresponding option.
1.2.5 Mesh & BCs Tab
The domain is defined and the mesh is created in the Mesh & BCs tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid Tab In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab
In the Domain section, set the following values for the domain boundaries.
Note that Nx, Ny, Nz are the number of corner points in the x, y and z directions. The actual number of
cells in each direction is the number of corner points in the corresponding direction minus
one.
Blocks
Click the Blocks tab.
To create a step, the domain has to be split into 4 blocks which can be adjusted to a required
dimension.
First, click
Enter the following number of blocks in each direction in the corresponding fields
Xdirection:2 Ydirection:2 Zdirection:1
Click to apply the block decomposition and close the block decomposition settings
window
A block can be selected with the Select Block field by choosing the appropriate block number.
Select Block 1 then click
After the deletion operation, the numbering of the blocks will be automatically re-adjusted.
Now the dimensions of the three remaining blocks will be modified in the x-direction. To do
so
Select a block by clicking up or down triangle next to the Select Block field
Click
Fill in the fields X min and X max so that they match the following parameters for each block
then click .
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, an inflow is at X min, an outflow at X max, walls are at Y min and Y max, and symmetry
boundary conditions at Z min and Z max. Follow the step-by-step a instructions given below to create
an inflow boundary condition and to define its properties.
From the Inflow BC, rename Inflow to inflow1
Click
Fill in the inflow properties:
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Constant
Inflow Velocity components: u: 0.1 v: 0.0 w: 0.0
Click to save the settings and close the window
Proceed similarly as above to create the following boundary conditions.
Select boundary XMin in the drop-down list at the top of the BCs tab
Highlight XMIN 0 in the surface tree by a simple click
Check inflow1 in the list of boundary conditions
Click
After completion of the assignment, the XMin 0 surface will be highlighted in both the the surface tree and
the graphical viewer with the corresponding color in the boundary condition table (see the column to
the right of the Type column).
Proceed similarly as above to assign the remaining surfaces to their respective boundary
conditions.
In this example, the value of the Relaxation Factor has been increased compared to the default
value of 0.6 in order to increase the speed of convergence of the simulation.
Note that increasing the Relaxation Factor is not a foolproof method to accelerate the convergence of
a simulation. Indeed, a simulation may become unstable with high values of the Relaxation Factor. In
such a simulation, it might be required to decrease the Relaxation Factor to stabilise
it.
Equations In this section the convergence threshold is defined, as well as the convection scheme and other
parameters of the solvers used by TransAT.
Select All Quantities in the equation tree and set the value of the Convergence Tolerance field
as follows
ConvergenceTolerance:1.0e-6
∙ Select Pressure in the equation tree and set the solver parameters and Convergence Tolerance
as follows
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.1
Proceed as above to set the initial state of the remaining quantities as follows
This tab is where the simulation is started and controlled.
1.2.7.1 Starting the simulation
Running TransAT The number of processors on which the simulation will run can be modified by changing the field
Number of Processors.
Click to start the simulation
1.2.8 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose backwardstep...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Create a Slice object by clicking in the toolbar (alternatively select Filters - >
Common - > Slice in the menu bar) to see variables in a plane. Click on Z Normal and
Center on Bounds to see the flow in the middle of the channel. Click .
Choose variable U from the drop-down list. (See Figure 6.5).
Clicking on the rainbow button on the left shows the Legend. Clicking on the double-arrow
button on its right re-scales the color range to the data range.
To visualise the converged results, go to the last frame by hitting in the toolbar.
Figure 1.7: Variable Selection Drop-Down Box and the Play button
Plotting Velocity Vectors To create velocity vectors in ParaView, an object is needed to calculate the 2D velocity and a
plotting device to display the vector. To this end, the Calculator and the Glyph tools are
used.
Make sure the Slice filter is selected.
Create a Calculator object by clicking in the menu bar (alternatively, you can select
Filters - > Common - > Calculator)
In the Object Inspector window for the Calculator, enter Velocity as the Result Array
Name.
In the box below, enter U * iHat + V * jHat. See Figure 1.8.
Click .
Make sure that the Calculator is made invisible and the father object is made visible by
clicking on the respective icon.
In the Pipeline Browser, highlight the Calculator by clicking it once and then click in
the menu bar (alternatively, you can select Filters - > Common - > Glyph). Click .
Figure 1.8: Calculator Object in ParaView
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
A single-phase flow over a cylinder is simulated here where the Reynolds number is Re = 20. The flow
can be simulated using a steady simulation. This tutorial is beneficial to understand the basics of
multiblock meshes
Dimensions of the domain are 30m × 30m resolved by a mesh of 72 × 72 × 1 cells.
The cylinder with a radius of 0.5m is located in the middle of the domain.
The fluid over the cylinder is air.
1.3.3 Launch TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
1.3.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say cylinder, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as cylinder then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
Geo is a module that can be used to create simple geometries for TransAT. The grid properties are
defined in Mesh & BCs tab whilst the physical and numerical parameters of the simulation are defined
in the Input tab. When the simulation is ready, the simulation will be started from the Execute
tab.
Some general operations such as saving and loading projects or exiting TransAT can be done by clicking
Files then selecting the corresponding option.
1.3.5 Geo Tab
A cylinder is needed for the simulation. To create a cylinder
Click Geo at the top of the TransATUI.
Click Create Shape tab within the left panel
In the object selection drop-down list next to the button , choose cylinder.
Note that Nx, Ny, Nz are the number of corner points in the x, y and z directions. The actual number of
cells in each direction is the number of corner points in the corresponding direction minus
one.
Blocks The domain must now be decomposed into several blocks, so that the simulation can run in parallel
(i.e. on several processors). Indeed, each block is allocated to one processor (but a processor can handle
several blocks).
Select Blocks to define the multiblock option.
Click to split the domain into several computational blocks.
Set the number of blocks for both the X direction and Y direction to 2 then click
The domain is automatically split into blocks of equivalent sizes
BCs Tab The boundary conditions will now be set. An inflow will be defined at the X min boundary, and an
outflow at the X max boundary. Other boundaries will be defined as symmetry conditions.
Ensure the Inflow BC is available, and make sure its type is Inflow. Click to define its
parameters. In the Basic tab, define the following properties:
Confirm that the Outflow BC has a type of Outflow. Click . Define the outflow model as
follows:
Outflow type: pressure
Outflow Data Source: From Boundary Conditions
Outflow pressure: 0
Click to save the changes and close the window.
Select X Min in the drop-down list and select the Xmin0 surface in the surface list
below.
Check the Inflow boundary condition in the list of boundary conditions by clicking the light grey
square at the corresponding line. Then, click to apply the boundary condition to the Xmin0
surface.
Select X Max in the drop-down list and select the Xmax0 surface in the surface list.
Check the Outflow boundary condition in the list of boundary conditions then click to apply
the boundary condition to the Xmax0 surface.
Select All Surfaces in the drop-down list and tick the Symmetry boundary condition in the list of
boundary conditions.
To assign all the remaining surfaces at once, press on Ctrl while selecting the surfaces that have
not been assigned to a boundary condition in the surface list (they appear in white in the list of
boundaries).
Click to apply the boundary condition to these surfaces.
Figure 1.10: Boundary conditions
1.3.7 Input Tab
To set up the simulation parameters,
Click Input at the top of the TransATUI.
The different tabs to define the parameters of the simulation can now be selected.
Physical Models
Click Physical models on the left-hand side to define the equations to be solved for and
the models to be used in the simulation.
Phase Properties The Phase Properties tab is used to define the phases of the flow. Since the Multiphase Flow
Method is turned off, only the fluid properties of Phase 1 need be defined. A custom phase can defined
by directly entering the values for its properties.
Click Phase Properties on the left-hand side of the TransATUI
Select Phase 1 in the phase tree and enter the following values of the physical properties
Phase1 Density:1.0 Viscosity:0.0001(constant)
Figure 1.12: Phase properties
Simulation Parameters This tab is used to define the numerical properties of the simulation.
Click Simulation Parameters on the left-hand side of the TransATUI
Simulation Type and Control Parameters
Set the following parameters to solve for a steady flow.
A low relaxation factor gives a more stable simulation, while the simulation converges faster with a high
value.
Equations In the Equations section the convergence threshold is defined as well as the convection scheme and
the solvers used by TransAT for each equation.
Select All Quantities in the equation tree and set the value of the Convergence Tolerance as
follows
ConvergenceTolerance:1.0e-6
There is no need to have a strict threshold for pressure because it must comply with the overall
criterion to finish the simulation.
Figure 1.13: Simulation parameters
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.002
Proceed as above to set the initial state of the remaining quantities as follows
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
1.3.8.1 Starting the simulation
Running TransAT
Start the simulation by clicking
1.3.9 Visualisation of the results
The results of the simulation can be seen with the help of the open-source visualisation tool, ParaView.
Launch ParaView as follows from the project folder using the terminal
>paraview&
Click on File - > Open.
Navigate to your project folder.
Navigate to the “RESULT” folder and choose the files xy-<projectname>...vtm for 2D
visualization in the x-y plane.
Click OK.
Choose the variable you want to visualize (e.g. P) from the drop-down list. (See Figure
6.5).
To visualize fluid-solid interface when using IST technique, click in the toolbar
(alternatively select Filters - > Common - > Contour in the menu bar). Use Contour by:EmbI and enter Isosurface: 0 to see your solid objects. Click .
With the Contour highlighted, choose Solid Color from the drop-down box.
Make the father object visible (xy-<projectname>.0000*) by clicking on the icon to
its left.
To visualise the converged results, go to the last frame by hitting in the toolbar.
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.
1.3.10 Results
Figure 1.14: Cylinder Flow: Streamlines
Chapter 2 Incompressible Single Phase Flows
2.1 Block Mesh Refinement: Flow over Cylinder (Re=150)
2.1.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
2.1.2 Introduction
In this section a single-phase flow over a cylinder will be simulated. The flow around the object is
studied and the time signal of the velocity at a monitoring point is the output. The Reynolds number is Re = 150. Different grids are compared, using Block Mesh Refinement (BMR).
This tutorial is beneficial in understanding the possibilities of BMR.
2.1.3 Creating a template project
A first project will be created, where everything but grid properties will be defined. In this way, several
grid configurations can be used, using BMR or simple refinement.
2.1.3.1 Launch TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
2.1.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say cylinder_bmr, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as cylinder_bmr then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
2.1.5 Geo Tab
A cylinder is needed for the simulation. To create a cylinder
Click Geo at the top of the TransATUI.
Click Create Shape tab within the left panel
In the object selection drop-down list next to the button , choose cylinder.
The grid is not defined for now, as several grids will be tested further down in this tutorial.
BCs Tab The boundary conditions must now be set for this case. An inflow will be defined on the X
min boundary, and a outflow on the X max. Other boundaries will be defined as symmetry
conditions.
Select the BCs tab
Ensure that the Inflow BC has a type of Inflow.
Click and set the following parameters in the window that popped up:
Click and set the following parameters in the window that popped up:
Outflow type: Pressure
Outflow Data Source: From Boundary Conditions
Outflow Pressure: 0
Click
The boundary conditions must now be assigned to the corresponding boundary surfaces. An inflow will be
defined at the X min boundary, and an outflow will be defined at the X max. The remaining boundaries
will be defined as symmetry conditions.
To proceed with the assignment of boundary conditions to surfaces,
Select X Min in the drop-down list and select the surface Xmin0 in the surface list below.
Select the Inflow boundary condition by ticking the light grey square next to it in the list
of boundary conditions.
Click to apply the boundary condition to the Xmin0 surface.
Select X Max in the drop-down list and select the surface Xmax0 in the surface list.
Select Outflow boundary condition by ticking the light grey square next to it in the list of
boundary conditions.
Click to apply the boundary condition to the Xmax0 surface.
Select All Surfaces in the Boundary drop-down list and select the symmetry boundary
condition in the list of boundary conditions.
To assign all the remaining surfaces at once, press the Ctrl key while selecting the surfaces
that have not been assigned to a boundary condition in the surface list (they appear in
black in the list).
Click to apply the boundary condition to the selected surfaces.
Figure 2.1: Boundary conditions
2.1.5.2 Input Tab
Click Input at the top of the TransATUI to set up the simulation parameters
Physical Models
Select the Physical models tab
Select the following equations in the Basic Equations section
A lower relaxation factor means a more stable simulation, a higher value means a faster
convergence.
For Time Stepping select Adaptive then click
Set the following parameters in the Adaptive Time-Stepping window then click to save the
settings and close the window
CFLLimitsMin:0.5Max:1.0 DiffusionMin:1.0Max:2.0
Equations In this section the convergence threshold is defined, as well as the convection scheme and the solvers
to be used by TransAT.
Select All Quantities in the equation tree and set the value of Convergence Tolerance as follows:
ConvergenceTolerance:1.0e-3
Select Other Variables in the equation tree and set the value of BMR Iterations as follows:
BMRIterations:5
Select Pressure in the equation tree and set the value of BMR Iterations as follows:
BMRIterations:15
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.015
Proceed as above to set the initial state of the remaining quantities as follows
The template for the simulations is now ready. To save it
Click Files then select Save
2.1.6 Cylinder flow using a body fitted grid
2.1.6.1 Creating the project
Please note: It is important to save different projects in different folders, because results
will always be stored in a sub-folder called RESULT. The template will be used for several
grids.
Click Files then select Open Project. Alternatively, press Ctrl+o.
Select cylinder_template.stt.
The Execute tab is automatically opened.
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
Set a name for the new directory, say multiblock.
Set a name to the project (cylinder_mb for instance) then click .
2.1.6.2 Mesh & BCs Tab
Domain & Grid
Click Mesh & BCs at the top of TransATUI, then select Domain & Grid.
Set the general properties of the mesh (the number of cells in each direction domain and the
refinement zones of the main grid) as follows
Note that Nx is the number of corner points meaning that the actual number of cells is Nx -1.
Blocks The domain must now be decomposed into several blocks, so that the simulation can run in parallel
(i.e. on several processors). Indeed, each block is allocated to one processor (but a processor can handle
several blocks).
Select the Blocks tab
Click
Enter the number of blocks in the different directions as follows then click
Xdirection:2 Ydirection:2
The domain is automatically split into blocks of equivalent sizes.
To display the mesh information, click in the bottom right corner of the user interface
The total number of cells in the domain given in the mesh information panel is around 3300.
BCs Tab The boundary settings applied in the template are not affected by modifying the grid.
2.1.6.3 Execute Tab
Click Execute at the top of the TransATUI.
This tab is where the simulation is started and controlled.
Running TransAT
Start the simulation by clicking
2.1.6.4 Visualisation of the results
The results of the simulation can be seen with the help of the open-source visualisation tool, ParaView.
Launch ParaView as follows from the project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Navigate to the RESULT folder and choose the files xy-<projectname>...vtm for 2D
visualization in the x-y plane.
Click .
Choose the variable you want to visualize (e.g. P) from the drop-down list. (See Figure
6.5).
To visualize fluid-solid interface when using IST technique, click in the toolbar
(alternatively, select Filters - > Common - > Contour in the menu bar). Use Contour by:EmbI and enter Isosurface: 0 to see your solid objects. Click .
Make the father object visible (xy-<projectname>.0000*) by clicking the icon to its
left.
Play the animation by hitting the in the toolbar.
To get more information about visualitsation of TransAT results with ParaView, please refer to the TransATParaview Tutorial .
2.1.7 Cylinder flow using a Block Mesh Refinement (BMR) grid with Immersed Surface Technique
(IST)
2.1.7.1 Creating TransAT project
Please note: It is important to save different projects in different folders because results
will always be stored in a subfolder called RESULT. The template will be used for several
grids.
Go to the template folder and launch TransATUI
>transatui.py&
Click then select cylinder_template.stt in the file browser that popped up
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
In the window that popped up, enter a project folder name, say bmr, then click
Click to close the browser
Set Project Name to a more explicit name such as cylinder_bmr then click
2.1.7.2 Mesh & BCs Tab
Domain & Grid
Select Mesh & BCs, then Domain & Grid to define the general properties of the mesh: the
number of cells in each direction domain and the refinement zones of the main grid.
Note that Nx, Ny, Nz are the number of corner points in the x, y and z directions. The actual number of
cells in each direction is the number of corner points in the corresponding direction minus
one.
Also note that we will create a BMR grid: the Grid Properties tab only defines the properties of the
coarsest mesh.
Blocks The Blocks tab will be used to create the block mesh refinement (BMR) and decompose
the domain into several blocks, so that the simulation can run in parallel (i.e. on several
processors). Indeed, each block is allocated to one processor (but a processor can handle several
blocks).
With BMR, blocks with finer meshes are created to get a better resolution around areas of
interest.
Click Blocks
To create a block with a finer mesh around the object
Click
Enter the following values in the Add Son Block window then click
XMin:3.0 XMax:10.0 YMin:4.5 YMax:7.5
Now blocks will be split so as to be able to use several processors.
Select Block 1 by changing the field Select block to 1
Click then enter the number of blocks in each direction as the following:
Xdirection:2 Ydirection:1
Click
The coarse mesh is automatically split into two blocks of equivalent sizes.
Now change the field Select block to 3 (the finer meshes always have the largest indices)
Click then enter the number of blocks in each direction as the following:
Xdirection:2 Ydirection:1
Click
The fine mesh is automatically split into two blocks of equivalent sizes.
To display the mesh information, click in the bottom right corner of the user interface
The total number of cells in the domain given in the mesh information panel is around 2100, which is one
third less than the body fitted grid for a comparable mesh quality.
BCs Tab The boundary settings applied in the template are not affected by modifying the grid.
2.1.7.3 Execute Tab
This tab is where the simulation is started and controlled.
Click Execute at the top of TransATUI.
2.1.7.4 Starting the simulation
Run TransAT
Click to start the simulation
2.1.7.5 Visualisation of the results
The results of the simulation can be seen with the help of the open-source visualisation tool, ParaView.
Launch ParaView as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Navigate to the RESULT folder and choose the files xy-<projectname>...vtm for 2D
visualization in the x-y plane.
Click .
Choose the variable you want to visualize (e.g. P) from the drop-down list. (See Figure
6.5).
To visualize the fluid-solid interface when using the IST technique, click in the toolbar
(alternatively, select Filters - > Common - > Contour in the menu bar). Use Contour by:EmbI and enter Isosurface: 0 to see your solid objects. Click .
Make the father object visible (xy-<projectname>.0000*) by clicking the icon at its
left.
Play the animation by hitting the in the toolbar.
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.
2.1.8 Results
Figure 2.3: Multiblock and BMR Cylinder Flow (Re=150): Pressure field and Velocity vectors
2.2 Flow over Buildings
2.2.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
2.2.2 Problem
Turbulent flow over several buildings is simulated.
The following tutorial utilises the Immersed Surface Technology (IST) capability of TransAT, by
which solid objects can be incorporated into the fluid flows. The CAD file of the buildings must be
imported into the TransATUI, and finally meshed appropriately, before the solution can be
executed. This tutorial is beneficial to learn how to use the multiblock and IST capacities of TransAT.
2.2.3 Launching TransATUI
Launch TransATUI by executing the following command
>transatui.py&
2.2.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say flow_over_buildings, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as buildings then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
2.2.4.1 Geo Tab
In this tab, the necessary objects are added to the mesh.
Click Geo at the top of the TransATUI.
Objects Load the geometry file already prepared and located in the TransAT Object Database.
Select the Database tab.
Expand the Wind-Engineering folder
Select Three_buildings.gts
then click to load the file to the mesh
In the Choose Units window that popped up, select m in the drop-down box
Activate the check-box Resize Mesh around Geometry to resize the domain
Click to create the Buildings and send them to the mesh
The Buildings need to be positioned at suitable coordinates.
Switch to the Objects tab
Select the Three_buildings object that appeared in the list of objects. Make sure the buildings
are coloured in orange in the Graphical window
Under the Object Motion, find Object Transformation
Change to Position and click the .
Set the following parameters:
XPosition:6[m] YPosition:-24[m] ZPosition:18[m]
Click . This will slightly move the Buildings
2.2.4.2 Mesh & BCs Tab
In the Mesh & BCs tab, the domain along with the mesh are defined.
Select Mesh & BCs at the top of the TransATUI window
Domain & Grid
Select the Domain & Grid tab
Set the following values for the domain boundaries in the Domain section
Set the following parameters to define the general properties of the mesh: the number of cells in
each direction domain and the refinement zones of the main grid
Make sure that Blocks Refinement is selected to give a finer grid around blocks
Figure 2.4: Domain with the buildings
Blocks
Select the Blocks tab to define the block distribution of the case.
The domain must now be decomposed into several blocks, so that the simulation can run in parallel (i.e. on
several processors). Indeed, each block is allocated to one processor (but a processor can handle
several blocks). Firstly we will add a son block in order to get more refined grid around the
buildings.
Click Blocks
To create a block with a finer mesh around the object
Click
Enter the following values in the Add Son Block window then click
Now blocks will be split so as to be able to use several processors.
Select son block by changing the field Select block to 2
Click then enter the number of blocks in each direction as the following:
Xdirection:1 Ydirection:2 Zdirection:1
Click
BCs Tab The boundary conditions must now be set for this case. An inflow will be defined on the X min
boundary, and a outflow on the X max. The bottom surface will be defined as a wall. Other boundaries
will be defined as symmetry conditions.
Select the BCs tab
Make sure the Inflow BC is available and that its type is Inflow.
Click to define its parameters.
In the Basic panel, set the values of the following parameters:
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Turbulent
Inflow Velocity components: u: 1.0 v: 0.0 w: 0.0
In the Turbulence (RANS) panel, set the values of the following parameters then click
:
Turbulence intensity: 0.1
Mu_t / Mu: 100
Click to save the settings and close the window.
Now the Outflow BC will be edited
Click for the Outflow BC and set the following parameters, then click
Outflow type: Pressure
Outflow Data Source: From Boundary Conditions
Outflow Pressure: 0
Click
The Wall boundary condition will use the default settings
The boundary conditions will now be assigned to the boundaries:
Select All Surfaces in the drop-down list.
Highlight XMIN 0 in the list of boundaries and check Inflow by clicking the light grey square
at the corresponding line in the list of boundary conditions. Click to apply the boundary
condition to the XMIN 0 surface.
Select XMAX 0 in the list of boundaries. Check Outflow in the list boundary conditions.
Click on to apply the boundary condition to the XMAX 0 surface.
Select ZMIN 0 in the list of boundaries. Check Wall in the list of boundary conditions. Click
on to apply the boundary condition to the ZMIN 0 surface.
The symmetry boundary condition will now be assigned to all the remaining boundaries.
Select Symmetry in the list of boundary conditions. Select all the surfaces in the surface tree
which have not been assigned to a boundary condition: they appear with a standard font.
Press the Ctrl key while selecting surfaces to select several surfaces at once. Click to
apply the symmetry boundary condition to these surfaces.
Figure 2.5: Boundary conditions
2.2.4.3 Input Tab
To select the models and set up the simulation parameters
Click Input at the top of the TransATUI.
Physical Models
Select the Physical models tab
Select the following equations in the Basic Equations section
Set the following parameters in the Adaptive Time-Stepping window then click to save the
settings and close the window
CFLLimitsMin:0.5Max:1.0 DiffusionMin:1.0Max:2.0
Equations In the Equations section, the convergence threshold is defined, as well as the convection scheme and
other parameters of the solvers used by TransAT.
Select Pressure in the Equation tree
Set the Convergence Tolerance value to the following
ConvergenceTolerance:1.0e-3
Choose the following solver
Solver:GMRES Preconditioner:AMG
Set the BMR Iterations and the Relative Solver Tolerance values to the following
BMRIterations:10 RelativeSolverTolerance:0.1
Select Other Variables in the Equation tree
Set the Convergence Tolerance value to the following
ConvergenceTolerance:1.0e-2
Set the BMR Iterations and the Relative Solver Tolerance values to the following
BMRIterations:10 RelativeSolverTolerance:0.01
Figure 2.7: Simulation Parameters
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 1
Proceed as above to set the initial state of the remaining quantities as follows
In the Post-Processing section, activate Non-Dimensional Numbers if that is not already the
case (it is activated if its check-box is orange).
2.2.4.4 Execute
Click Execute at the top of TransATUI.
This tab is where the simulation is started and controlled.
Set Number of Processors to 3.
2.2.4.5 Running TransAT
Start the simulation by clicking
2.2.5 Visualisation of the results
Launch Paraview as follows from your project folder using the Terminal
>paraview&
Click on File - > Open.
Navigate to the RESULT folder and choose buildings...vtm.
Click .
Click on to go to the last result file.
Create a Contour object by clicking in the toolbar (alternatively, select Filters - >Alphabetical - > Contour in the menu bar).
With the Contour highlighted, click on the Properties tab on the Object Inspector.
In the drop-down box next to Contour By, choose variable EmbI (EmbI is the Embedded
Interface function).
Set value of the contour to be 0.
Click .
To create velocity vectors or streamlines in ParaView, an object is needed to compute the three-dimensional
velocity field along with a plotting device to display the vector. To this end, the Calculator and the
Stream Tracer tools are used.
Select the results file by clicking it in the Pipeline Browser.
Create a Calculator object by clicking in the toolbar (alternatively, select Filters - >
Common - > Calculator in the menu bar)
In the Object Inspector window for the Calculator, enter Velocity as the
ResultArrayName.
In the box below, enter U * iHat + V * jHat + W * kHat.
Click .
Highlight the Calculator by clicking on it once and then choose the Stream Tracer object
by clicking in the toolbar (alternatively, select Filters - > Common - > Stream Tracer
in the menu bar). Click .
Figure 2.8: Selected streamlines over the buildings
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
2.3 Flow in an obstructed pipe
2.3.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
2.3.2 Problem Description
In this tutorial, the Immersed Surface Technology (IST) and Block Mesh Refinement (BMR) feature of
TransAT are coupled to simulate a single-phase flow through a pipe in 3D. A disk is fixed at the center
of the pipe at 0.2 meters downstream the inlet. Water flows in through an inlet at a velocity of 0.005
m∕s with a laminar profile. The aim is to get a unsteady solution of the velocity profile in the
pipe.
2.3.3 Problem Setup
Domain: 0.762m × 0.22m × 0.22m resolved by a mesh of 30 × 25 × 25 cells.
Disk dimensions: 3inch diameter, set in the center of the pipe
Ratio = 5
2.3.4 Launch TransATUI
To launch TransATUI, open a terminal then execute the following command
>transatui.py&
2.3.5 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say obstructed_pipe_flow, then click to create the
folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as obstructed_pipe_flow then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
Geo is a module that can be used to create simple geometries for TransAT. The grid properties are
defined in Mesh & BCs tab whilst the physical and numerical parameters of the simulation are defined
in the Input tab. When the simulation is ready, the simulation will be started from the Execute
tab.
Some general operations such as saving and loading projects or exiting TransAT can be done by clicking
Files then selecting the corresponding option.
2.3.6 Geo Tab
A pipe geometry and a disk (cylinder) are needed for the simulation.
Click Geo at the top of the TransATUI.
Click Create Shape tab within the left panel
In the shape selection drop-down list next to the button, choose Pipe.
In the text field below the drop-down list, set the name of the object to be created as Pipe
Note that Nx, Ny, Nz are the number of corner points in the x, y and z directions. The actual number
of cells in each direction is the number of corner points in the corresponding direction minus
one.
Blocks The Blocks tab will be used to create the block mesh refinement (BMR) and decompose
the domain into several blocks, so that the simulation can run in parallel (i.e. on several
processors). Indeed, each block is allocated to one processor (but a processor can handle several
blocks).
With BMR, blocks with finer meshes are created to get a better resolution around areas
of interest. In this case, refinement are defined in the vicinity of the internal disk of the
pipe.
Select Blocks to define the multi-block option.
Click to cut the domain into several computational blocks.
Choose 2 for X direction then click
The domain is automatically cut into blocks of equivalent sizes.
To create a block with a finer mesh around the object
Click
Enter the following values in the Add Son Block window then click
BCs Tab The BCs tab allows the user to assign boundary conditions for each of the surfaces present in the
domain. A list of the surfaces present in the domain can be seen by selecting All surfaces in the
drop-down menu. The appropriate setup for this simulation requires 2 boundary conditions in
total.
Select the BCs tab
One of each type of boundary condition are already available at the start.
This tutorial will edit from the Inflow and Outflow BCs available.
Now conditions for each of the boundaries should be set.
For each boundary condition, press to open the parameters window, set the parameters listed
below then click .
To assign the Inflow boundary condition to the XMIN 0 surface
Click the face XMIN 0 in the surface tree
Select the Inflow boundary condition by ticking the light grey square to the left in the
appropriate line of the boundary conditions table
Press . The XMIN 0 face will now be highlighted in both the surface list and the graphical
viewer.
Proceed similarly using the data in the following table to assign the other boundary
conditions to their respective faces.
BoundaryXMIN0:Inflow BoundaryXMAX0:Outflow
Symmetry conditions are applied on the remaining boundary surfaces. Since undefined boundaries are set to
symmetry by default in TransAT, no extra operation is required to define the remaining boundary
conditions. The final setup should be similar to Figure 2.9
Figure 2.9: Boundaries Final Setup
Click Files then select Save to save the settings. Alternatively, you can press Ctrl+s to save
the settings.
2.3.8 Input Tab
To set up the simulation parameters
Select Input at the top of TransATUI
Physical Models Tab In this tab, the models that will be used during the simulation will be defined.
Select the following equations in the Basic Equations section
Activate Reference Properties and click to the right.
Set the following parameters in the reference properties window then click to save the settings
ReferenceVelocity:0.005 ReferenceLength:0.1524
Figure 2.10: Physical models
Phase Properties Tab To set the fluid properties,
Click Phase Properties on the left-hand side of the TransATUI
Select Phase 1 in the phase tree
To use the pre-set properties of water, select Water Liquid in the Material Library
drop-down list
Simulation Parameters Tab This tab is used to define the numerical properties of the simulation.
Simulation Type and Control Parameters The simulation will be run unsteady because of the vortex shedding downstream the
disk.
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for the unsteady flow.
Equations In this section the convergence threshold is defined as well as the convection scheme and the solvers
used by TransAT. These parameters can be set for each equation individually. Set the following
parameters.
In the equation tree, click All Quantities
Set the Convergence Tolerance as follows
ConvergenceTolerance:1.0e-2
Click Momentum in the equation tree
Modify the following properties
BMRIterations:10 RelativeSolverTolerance:0.01
In the equation tree, click Pressure
Modify the BMR Iterations and the Relative Solver Tolerance fields besides the equation
tree as follows
BMRIterations:20 RelativeSolverTolerance:0.1
Figure 2.11: Simulation parameters
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.005
Proceed as above to set the initial state of the remaining quantities as follows
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
2.3.9.1 Starting the simulation
Change the Number of Processors to 3.
Click to start the simulation
2.3.10 Viewing Results in Paraview
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose obstructed_pipe_flow...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Create a Slice object by clicking in the toolbar (alternatively select Filters - >
Common - > Slice in the menu bar) to see variables in a plane. Click on Z Normal and
Center on Bounds to see the flow in the middle of the channel. Click .
Plotting Velocity Vectors To create velocity vectors in ParaView, an object is needed to calculate the 2D velocity and a
plotting device to display the vector. To this end, the Calculator and the Glyph tools are
used.
Make sure the Slice filter is selected.
Create a Calculator object by clicking in the menu bar (alternatively, you can select
Filters - > Common - > Calculator)
In the Object Inspector window for the Calculator, enter Velocity as the Result Array
Name.
In the box below, enter U * iHat + V * jHat. See Figure 2.12.
Click .
Choose variable Velocity from the drop-down list to color the slice with the velocity
magnitude.
Make sure that the Slice is made invisible and the calculator is made visible by clicking
on the respective icon.
In the Pipeline Browser, highlight the Calculator by clicking it once and then click
in the menu bar (alternatively, you can select Filters - > Common - > Glyph).
Choose variable GlyphVector from the drop-down list to color the vectors with the velocity
magnitude.
Figure 2.12: Calculator Object in ParaView
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
2.3.11 Results
Figure 2.13 shows the temperature contours of the solution
Figure 2.13: Velocity profile in the pipe
Chapter 3 Heat Transfer
3.1 Forced Convection in a Channel with Heated Walls
3.1.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
3.1.2 Introduction
This TransAT tutorial provides a simple demonstration of the heat transfer that occurs when a fluid
flows inside a channel which walls are heated.
3.1.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
3.1.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say forcedconvection, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as forcedconvection then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
3.1.5 Mesh & BCs Tab
The domain is defined and the mesh is created using this tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab in the sub-window on the left
In the Domain section, set the domain boundaries as follows
To get higher resolutions in regions such as boundary layers, refinements zones can be created using the
Customized Refinement feature of TransAT. In this case, the grid is refined in the vicinity of the top and
bottom walls as follows:
Check Customized Refinement in the Refinement Type section
Select Y-axis then click to create a new refinement zone at the bottom of the channel.
Enter the following parameters in the corresponding fields then click
Type:Range P1(Y):0.0 P2(Y):0.0005
Select Y-axis and click to set up refinements at the top of the channel.
Type:Range P1(Y):0.01 P2(Y):0.0095
Blocks In TransAT, the user has the possibility to split the domain into several blocks so that the simulation
can run on several processors. Indeed, each block is allocated to one processor (but a processor can
handle several blocks). This can be done in the Blocks tab, however for this case, the domain can be
left as is.
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, an inflow is located at X min, an outflow at X max, walls at Y min and at Y max, and
symmetry boundary conditions at Z min and Z max. Below is a set of step-by-step instructions to create
an inflow boundary condition and define its properties.
From the Inflow BC available, click to set the properties of the boundary condition
Fill in the inflow properties - Tab: Basic
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Constant
Inflow Velocity components: u: 0.5 v: 0.0 w: 0.0
Inflow Static Temperature: 300.0
Click to save the settings and close the window.
The inflow boundary condition has now been created.
Proceed similarly as above to edit the BCs to the following properties
Activate Reference Properties and click to the right.
Set the following parameters in the reference properties window then click to save the settings
ReferenceVelocity:0.5 ReferenceLength:0.01
Note that the reference properties are only for computing the non-dimensional numbers and does not affect
the simulations. Phase Properties The Phase Properties tab is where the phases of the flow are defined.
Click Phase Properties on the left-hand side of the TransATUI
Select Air in the Material Library drop-down list.
Phase1 Fluid:Air
Simulation Parameters The numerical parameters of the simulation are set in the simulation parameters tab.
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for a steady flow with an implicit method.
SimulationType:Steady NumberofIterations:2000
Equations Section In this tab the convergence threshold is defined, as well as the convection scheme and
other parameters of the solvers used by TransAT. Modify the convergence thresholds as
follows:
In the Equation tree highlight All Quantities and make sure that Normalised Residue is checked.
The check box should be colored in orange
set the Convergence Tolerance value as follows
ConvergenceTolerance:1.0e-6
∙ Select Pressure in the Equation tree
∙ Change the solver parameters to the following
Solver:GMRES Preconditioner:AMG
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except temperature.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0
Proceed as above to set the initial state of the remaining quantities as follows
V-Velocity Method:Constant Value:0 Temperature Method:Constant Value:300 Pressure Method:Constant Value:0
Output Management The simulation’s outputs are defined in the Output Management tab. In this example, only the
visualization output will be set.
Select the Output Management tab on the left-hand side
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
This tab is where the simulation is started and controlled.
3.1.7.1 Starting the Simulation
Running TransAT
Click to start the simulation
3.1.8 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-forcedconvection...vtm. Click OK.
Click in the Properties Panel, on the bottom left.
Choose variable T from the drop-down list. (See Figure 6.5). This shows the temperature
distribution along the domain.
Clicking the rainbow button on the left-hand side shows the Legend. Clicking the
double-arrow button on its right rescales the color range to the data range.
See Figure 3.2 for the steady state result of the temperature profile.
To visualise the converged results, go to the last frame by hitting the in the toolbar.
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.
Figure 3.1: Variable Selection Drop-Down Box and the Play button
Figure 3.2: Temperature Profile of the forced convection problem at steady state
3.2 Natural Convection in a Closed Cavity
3.2.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
3.2.2 Introduction
This TransAT tutorial provides a simple demonstration of the heat transfer that occurs when a fluid
flows inside a closed cavity which walls are heated. The setup is taken from simulations by Theodoridis
& Rasoul (2010)
3.2.3 Launch TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
3.2.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say naturalconvection, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as naturalconvection then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
3.2.5 Mesh & BCs Tab
The domain is defined and the mesh is created in the Mesh & BCs tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab located in the sub-window on the left-hand side.
In the Domain section, set the domain boundaries as follows
In this case, the mesh is regular: ratios between cells is set to 1.
Blocks In TransAT, the user has the possibility to split the domain into several blocks so that the simulation
can be run on several processors. Indeed, each block is allocated to one processor (but a processor can
handle several blocks). The splitting of the domain can be done in the Blocks tab, however for this
case, the domain can be left as is.
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, a heated wall is at X min, a cold wall at X max, walls with zero heat flux at Y min and Y
max and symmetry boundary conditions at Z min and Z max. Below step-by-step instructions are given
to create the hot wall boundary condition and define its properties.
Rename the Wall BC to hotwall
Ensure the type is set as Wall in the drop-down list of the Type column
Click to set the properties of the boundary condition
Fill in the wall properties - Tab: Basic
Temperature / Heat Flux Choice: Temperature
Temperature / Heat Flux Value: 315.0
Click to save the settings and close the window
Click to create a second Wall BC and rename it to coldwall
Ensure the type is set as Wall and then click to set the properties
Set the following parameters in the Gravity window them click to save the settings
x:0.0 y:-9.81 z:0.0
Activate Reference Properties and click to the right.
Set the following parameters in the reference properties window then click to save the settings
ReferenceVelocity:0.1 ReferenceLength:0.01
Note that the reference properties are only for computing the non-dimensional numbers and does not affect
the simulations.
Figure 3.4: Physical models
Phase Properties The Phase Properties tab is used to define the phases of the flow. Phase properties can
be imported from the material library or defined by directly modifying the corresponding
fields.
Click Phase Properties on the left-hand side of the TransATUI
Select Air in the Material Library drop-down list.
Phase1 Fluid:air
Simulation Parameters This tab is used to define the numerical properties of the simulation.
Simulation Type and Control Parameters
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for a steady flow with an implicit method.
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the
relevant quantities will be set to 0 except velocity components in the x- and y- directions and
temperature.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 1e-5
Proceed as above to set the initial state of the remaining quantities as follows
V-Velocity Method:Constant Value:1e-5 Temperature Method:Constant Value:300 Pressure Method:Constant Value:0
Output Management In this tab the parameters of the simulation outputs are set. For this example, only the visualization
output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
3.2.7.1 Starting the simulation
Running TransAT The number of processors on which the simulation will be run can be changed by modifying the
value of the field Number of Processors.
Click to start the simulation
3.2.8 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from your project folder using the XTerminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-naturalconvection...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Choose variable T from the drop-down list. (See Figure 6.5). This shows the temperature
distribution along the domain.
Clicking the rainbow button on the left shows the Legend. Clicking the double-arrow button
on its right rescales the color range to the data range.
See Figure 3.7 for the steady state result of the temperature profile.
To visualise the converged results, go to the last frame by hitting in the toolbar.
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.
Figure 3.6: Variable Selection Drop-Down Box and the Play button
Figure 3.7: Temperature Profile of the natural convection problem at steady state
3.3 Turbulent Heat Flux Modelling
3.3.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
3.3.2 Introduction
In this TransAT tutorial the turbulent heat flux (THF) model is employed to model the heat transfer in
a heated pipe by explicitely solving for the turbulent heat fluxes. The setup for this test case is related
to the experimental data of Steiner (1971) for Re = 5000.
3.3.3 Launch TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
3.3.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say turbulent_heat_flux, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as turbulent_heat_flux then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
3.3.5 Mesh & BCs Tab
The domain is defined and the mesh is created using this tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab in the panel on the left-hand side
In the Domain section, set the domain boundaries as follows
Blocks The grid will now be decomposed into 4 blocks, so that the simulation can be run on up to 4
processors.
Select Blocks to define the multi-block options
Click to cut the domain into several computational blocks
Set the number of blocks in the X direction to 4. Leave the number of the blocks in the
Y direction to 1
Click
The domain is automatically cut into 4 blocks of equivalent number of cells.
Figure 3.9: Block decomposition
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, an inflow is located at the X min surface, an outflow at the X max surface, a wall at the Y
max surface and symmetry boundary conditions at Y min, Z min and Z max surfaces. The wall in Y
max will be cut into two adiabetic sections at the entry and exit of the pipe and a heated section at the
center using Sub-BCs. Below is a set of step-by-step instructions to create an inflow boundary condition
and define its properties.
Beginning with the Inflow BC, click to set the properties of the boundary condition
Fill in the inflow properties - Tab: Basic
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Turbulent
Inflow Velocity components: u: 1 v: 0.0 w: 0.0
Inflow Static Temperature: 300.0
Fill in the inflow properties - Tab: Turbulence (RANS)
Turbulent Intensity: 0.1
Turbulent Viscosity Ratio: 60
Temperature Variance Intensity: 0.001
Thermal Timescale Ratio: 0.5
Turbulent Heat Fluxe (X-, Y-, Z-directions): 1e-6
Click to save the settings and close the window.
The inflow boundary condition has now been created.
Proceed similarly as above to set the remaining boundary conditions with the following
properties, you will need to create a new wall BC, using the Add new boundarycondition button.
Equations Section In this tab the convergence threshold is defined, as well as the convection scheme and
other parameters of the solvers used by TransAT. Modify the convergence thresholds as
follows:
In the Equation tree highlight All Quantities and make sure that Normalised Residue is
checked. The check box should be colored in orange
Set the Convergence Tolerance value as follows
ConvergenceTolerance:1.0e-6
Initial Conditions In this tab simple initial conditions can be set. In this case, the velocity components and the
temperature are initialised to the same values as the ones prescribed at the inflow over the whole
domain. Pressure is initialised to 0 Pa over the domain.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 1
Proceed as above to set the initial state of the remaining quantities as follows
This tab is where the simulation is started and controlled. The simulation will now be saved and the
necessary files (grid file, boundary conditions file, etc.) to run the simulation generated.
Click Files in the top left corner then select Save to save your settings.
Click Files then select Prepare Simulation Files to generate the necessary files to run a
simulation.
Running TransAT
Click to start the simulation.
3.3.8 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-turbulent_heat_flux...vtm. Click OK.
Click in the Properties Panel, on the bottom left.
Choose variable T in the variable drop-down list. The temperature distribution along the
domain should be shown.
Clicking the rainbow button on the left-hand side shows the legend. Clicking the
double-arrow button on its right rescales the color range to the data range.
See Figure 3.12 for the steady state temperature profile contour.
To visualise the converged results, go to the last frame by hitting the in the toolbar.
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.
Figure 3.12: Temperature contour once steady state is reached
Chapter 4 Multiphase Flows
4.1 Dam Break
In this tutorial, the use of custom initial conditions and two–phase flow simulations are
introduced. This is a step by step guide on how to simulate the flow of water after a dam
breaks.
4.1.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
4.1.2 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
At the top of the TransATUI window, the tabs Geo, Mesh & BCs, Input or Execute are the different
modules to set up and run a case.
4.1.3 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say dam_break, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as dam_break then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
4.1.4 Mesh & BCs Tab
In the Mesh & BCs tab, the domain along with the mesh are defined.
If that is not already the case, select Mesh & BCs at the top of the TransATUI window
4.1.4.1 Domain & Grid tab
Select the Domain & Grid tab
In the Domain section, set the following values for the boundaries (see Figure 4.1)
The number of cells in the domain and the refinement zones is also defined the Domain & Grid tab.
In this case, a uniform mesh will be created for the simulation.
Change the values of the properties of the grid in the different directions so that they correspond
to the following values (see Figure 4.1)
The domain must now be decomposed into several blocks, so that the simulation can run in parallel (i.e.
on several processors). Indeed, each block is allocated to one processor (but a processor can handle
several blocks).
Select the Blocks tab
Click
Enter the number of blocks in the different directions as follows then click
Xdirection:2 Ydirection:2
The domain is automatically split into blocks of equivalent sizes.
4.1.4.3 BCs Tab
The boundary conditions are defined in the BCs tab. In this case a wall and a symmetry boundary
condition will be used.
By clicking next to each defined boundary condition, it is possible to modify different
parameters at the walls such as the temperature or the heat flux. In this case, no modifications are
required in the basic tab since we only solve for the flow. However, some changes may be needed in the
interface tracking tab. The model used for this simulation does not use a film at the interface between
the wall and the fluids. In TransAT such a model can be achieved by setting a negative value to the film
thickness.
Next to the Wall BC, click
Make sure that, in the interface tracking tab, the value of the film thickness is negative.
Click .
The next step is to assign each surface to the corresponding boundary condition.
First, select All surfaces in the drop-down list to show all available boundary surfaces.
Next, select the Xmin0 surface by simply clicking it in the surface
Check the light grey square at the line corresponding to the Wall boundary condition.
To complete the assignment of the surface to the adequate boundary condition click .
Proceed similarly to assign the other surfaces to their respective boundary conditions as described
below
After the assignment of all the boundary conditions, the window should be similar to Figure 4.2.
Figure 4.2: Boundaries tab
4.1.5 Input Tab
The simulation parameters can be set up by clicking the Input tab at the top of the TransATUI. The
parameters of the simulation can then be defined by selecting and completing the different
tabs.
Click Input at the top of the TransATUI
4.1.5.1 Physical Models Tab
In the Basic Equations section of the Physical Models tab, check the following equations that
are to be solved for during the simulation (see Figure 4.3)
Select All Quantities in the equation tree and set the value of Convergence Tolerance as follows:
ConvergenceTolerance:1.0e-3
Select Level-set in the equation tree and choose the following solver parameters
Convectionscheme:QUICK
4.1.5.5 Initial Conditions
In TransAT, the user has the possibility to create custom initial conditions. For two–phase flow
simulations especially, the initial gas–liquid interface topology has to be specified by the user. In this
case, this is achieved in TransAT using an XML file initialconditions.xml.
For this specific case, the only variables that are being initialized are simply the ones that are
solved for, i.e. velocity, pressure, and the Level-Set function which defines the topology of the gas–liquid
interface.
At the initial time step, pressure and velocity are set to 0 throughout the domain.
As for the two phases, they are initially confined in two distinct areas. The liquid is confined in a
rectangular area and the gas occupies the rest of the domain. The interface between the two
fluids is defined by the Level-Set function which is positive for one fluid and negative for the
other. To create the initial interface, a rectangular shape is defined in the Levet-set node of
initialconditions.xml.
To be able to use custom initial conditions in this case, the file initialconditions.xml has to be
placed in the project folder. For this case, a ready-made initial conditions file available in the TransAT
Tutorials folder will be used to initialise variables over the domain. More information can be found on
the generation of custom initial conditions in the Custom Initial Conditions chapter of the TransAT UserManual .
Click Files in the top left corner then select Save to save the settings of the simulation
Execute the following command to copy the initial conditions file to your project directory.
Please note: : do not make a copy/paste from this document to the terminal, since characters from pdf
files will not be understood. Directly type the command into the terminal instead.
The simulation must now be re-loaded to take into account the initial conditions settings set in
initialconditions.xml.
Click Files in the top left corner then select Open Project
Select the project file of the simulation e.g. dam_break.stt.
4.1.5.6 Output Management Tab
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
This tab is where the simulation is started and controlled.
4.1.6.1 Running TransAT
Click to start the simulation
4.1.7 Visualisation of the results
4.1.7.1 Result files
TransAT creates a folder RESULT to save the results of the simulation:
xy-dam_break.0000000.vtk: Paraview file with initial conditions
xy-dam_break.0001000.vtk: Paraview file after 1000 time steps
transat_mb.inp: a copy of transat_mb.inp with all available parameters used for the
simulation
ND_numbers: non-dimensional numbers of the simulation
dam_break.log: log-file of the simulation
mass_conserve.dat: mass of gas and liquid at all time steps
max_residuals.dat: maximum residual at all time steps
avg_residuals.dat: averaged residual at all time steps
4.1.7.2 Viewing Results in Paraview
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
Paraview. To plot the data:
Launch Paraview as follows from your project folder using a terminal
>paraview&
Click File - > Open.
Navigate to the RESULT folder which is in the Project folder and choose xy-dam_break...vtm.
Click .
Create a Contour object by clicking in the toolbar (alternatively, select Filters - >
Alphabetical - > Contour in the menu bar).
Choose variable PHI (PHI is the Level-Set function).
Set value of the contour to be 0.
Click .
Make visible the father object (xy-dam_break.0000*) by clicking the icon.
Choose the“DEN” variable from the drop-down list.
Play the animation by clicking the in the toolbar.
In Figure 4.5 and Figure 4.6 the initial and the final states of the two–phase systems are plotted.
The contour object which is the white line on Figure 4.5 and Figure 4.6 represents the liquid-gas
interface.
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.
Figure 4.5: Density contour plot at the initial time step
Figure 4.6: Density contour plot after 0.6 s
4.2 Sloshing
In this tutorial, the use of custom initial conditions and two–phase flow simulations are continued. This
is a step by step guide on how to simulate sloshing of water inside a domain.
4.2.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
4.2.2 Launching TransATUI
Execute the following command from a terminal to launch TransATUI
>transatui.py&
4.2.3 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say sloshing, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as sloshing then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
4.2.4 Mesh & BCs Tab
In the Mesh & BCs tab, the domain along with the mesh are defined.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
4.2.4.1 Domain & Grid
In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab
Set the domain boundaries with the following values by filling in the corresponding fields with the
values given below (see Figure 4.7)
The number of cells in the domain and the refinement zones are defined in Grid Properties tab.
For this case, a uniform mesh will be create (i.e. cell ratios equal to 1)
Change the values of the grid parameters in the different directions so that they correspond to the
following values (see Figure 4.7)
The domain must now be decomposed into several blocks, so that the simulation can run in parallel (i.e.
on several processors). Indeed, each block is allocated to one processor (but a processor can handle
several blocks).
Select the Blocks tab
Click
Enter the number of blocks in the different directions as follows then click
Xdirection:2 Ydirection:2
The domain is automatically split into blocks of equivalent sizes.
4.2.4.3 BCs Tab
The boundary conditions are defined in the BCs tab. In this case a wall and a symmetry boundary
condition will be used.
To set up the boundary conditions,
Select the BCs tab
One of each type of boundary condition are already available at the start.
This tutorial will edit from the Wall and Symmetry BCs available.
By clicking next to each defined boundary condition, it is possible to modify different
parameters at the walls such as the temperature or the heat flux. In this case, no modifications are
required in the basic tab since we only solve for the flow. However, some changes may be needed in the
interface tracking tab. The model used for this simulation does not use a film at the interface between
the wall and the fluids. In TransAT such a model can be achieved by setting a negative value to the film
thickness.
Ensure the Wall BC is available and set to a type of Wall
Click next to the type of the Wall boundary condition then click the Interface Trackingtab.
Make sure that, in the interface tracking tab, the value of the film thickness is negative.
The next step is to associate each boundary surface with its corresponding boundary
condition.
For that, click the drop-down list above the surfaces tree and select .
Next, select the Xmin 0 surface in the surface tree by simply clicking it and check the Wall
in the list of boundary conditions.
To complete the assignment of the surface to the adequate boundary condition click .
Proceed similarly to assign the remaining boundary surfaces to their coresponding boundary
conditions as described below
The window should look similar to Figure 4.8 after the assignment of all the boundary conditions.
Figure 4.8: Boundaries tab
4.2.5 Input Tab
The simulation parameters can be set up by clicking the Input at the top of the TransATUI. The
parameters of the simulation can then be defined by selecting and completing the fields of the different
tabs.
Click Input at the top of the TransATUI
4.2.5.1 Physical Models Tab
In the Basic Equations section of the Physical Models tab, check the following equations that
are to be solved for during the simulation (see Figure 4.9)
Select Level-set in the equation tree then set the following
ConvectionScheme:QUICK
4.2.5.5 Initial Conditions
In TransAT, the user has the possibility to create custom initial conditions. For two–phase flow
simulations especially, the initial gas–liquid interface topology has to be specified by the user. This is
achieved in TransAT using an XML file initialconditions.xml.
For this specific case, the only variables that are being initialized are simply the ones that we are
solving for, i.e. velocity and pressure, and the Level-Set function which defines the topology of the
gas–liquid interface.
For this case, the aim as far as initial conditions are concerned, is to define where in the domain,
each phase should be. To gain the best perspective on the sloshing effect, the simulation starts simply
with phase 2 (water) in the lower half of the domain and phase 1 (air) in the upper half. The
initiated Vibrating Body Force will then cause the entire body of both fluids to vibrate with
a frequency of 0.4 Hz and a change in velocity of both fluids should be witnessed almost
immediately.
To be able to use custom initial conditions in this case, the file initialconditions.xml has to be
placed in the project folder. For this case, a ready-made initial conditions file available in the TransAT
Tutorials folder will be used to initialise variables over the domain. More information can be found on
the generation of custom initial conditions in the Custom Initial Conditions chapter of the TransAT UserManual .
Click Files in the top left corner then select Save to save the settings of the simulation
Copy the initial conditions file to the project folder with the following command.
Please note: : do not make a copy/paste from this document to the terminal, characters from pdf files
will not be understood. Directly type the command into the terminal instead.
The simulation must now be re-loaded to take into account the initial conditions settings set in
initialconditions.xml.
Click Files in the top left corner then select Open Project
Select the project file of the simulation e.g. sloshing.stt.
4.2.5.6 Output Management Tab
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
This tab is where the simulation is started and controlled.
4.2.6.1 Running TransAT
Click to start the simulation
4.2.7 Visualisation of the results
4.2.7.1 Result files
TransAT creates a folder RESULT to save the results of the simulation:
xy-sloshing.0000000.vtm: Paraview file with initial conditions
xy-sloshing.0001000.vtm: Paraview file after 1000 time steps
transat_mb.inp: a copy of transat_mb.inp with all available parameters used for the
simulation
ND_numbers: non-dimensional numbers of the simulation
sloshing.log: log-file of the simulation
mass_conserve.dat: mass of gas and liquid at all time steps
max_residuals.dat: maximum residual at all time steps
avg_residuals.dat: averaged residual at all time steps
4.2.7.2 Viewing Results in Paraview
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
Paraview. To plot the data:
Launch Paraview as follows from your project folder using a terminal
>paraview&
Click File - > Open.
Navigate to the RESULT folder which is in the Project folder and choose xy-sloshing...vtm.
Click .
Create a Contour object by clicking in the toolbar (alternatively, select Filters - >
Alphabetical - > Contour in the menu bar).
Choose variable PHI (PHI is the Level-Set function).
Set value of the contour to be 0.
Click .
Make visible the father object (xy-sloshing.0000*) by clicking the icon.
Choose the“DEN” variable from the drop-down list.
Play the animation by clicking the in the toolbar.
In Figure 4.11 and Figure 4.12 the initial and the final states of the two–phase systems are plotted.
The contour object which is the white line on Figure 4.11 and Figure 4.12 represents the liquid-gas
interface. To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
Figure 4.11: Density contour plot at the initial time step
Figure 4.12: Density contour plot after 2.5 s
4.3 Bubbles Merging
4.3.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
4.3.2 Introduction
This is a step by step guide on how to simulate the merging of two bubbles in three-dimensions. This
tutorial will show the user how to define a multiphase problem using Level-Set method and how to
define initial conditions in TransAT.
To launch the TransATUI user interface, TransATUI,
Execute the following command from a terminal
>transatui.py&
4.3.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say bubblemerge, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as bubblemerge then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
4.3.5 Mesh & BCs Tab
In the Mesh & BCs tab, the domain along with the mesh are defined.
If that is not already the case, select Mesh & BCs at the top of the TransATUI window
Domain & Grid
Select the Domain & Grid tab
In the Domain section, set the following domain boundaries
Blocks The domain must now be decomposed into several blocks so that the simulation can be run on
several processors. A processor can handle several block but each block is to be allocated to one
processor.
To decompose the domain into several blocks,
Select Blocks to define the multiblock option.
Click to cut your domain in several computational blocks.
Choose 3 for Y direction then click .
The domain will automatically be cut into blocks of equivalent sizes.
BCs Tab The boundary conditions must now be set for this case. Here a simple wall boundary condition will
be defined for all boundaries.
Select the BCs tab.
First, select All surfaces in the drop-down list to show all available boundary surfaces.
Ensure the Wall BC is available and has a type of Wall
The wall BC can remain with default properties and does not need to be edited
Check the wall boundary condition by clicking the small light grey square at the
corresponding line in the boundary conditions table
Select all six surfaces by dragging the mouse in the surafce tree then click to associate
the wall boundary condition to all the surfaces.
The mesh is now ready.
To save the settings,
Click Files in the top left corner then select Save.
4.3.6 Input Tab
Click the Input tab at the top of the TransATUI.
In this tab the simulation parameters are set up. It gives access to the different sub-tabs where the
parameters of the simulation are defined. For this tutorial, the parameters will be set such that a
two-phase flow can be simulated with the Level-Set interface-tracking method.
Physical Models
Select the Physical models tab
Define the equations to be solved and set the models to be used in the simulation as the following
Set the following parameters in the Gravity window them click to save the settings
x:0.0, y:-2.5 z:0.0 ENABLEHydrostatic
In the Multiphase section activate Interface Tracking and set the model (drop-down list) to
Level-Set
Click , set the value of Surface Tension as follows then click
SurfaceTension:0.002
The values for surface tension and gravity in this example were arbitrarily chosen for the sake of
computational time.
Phase Properties In the Phase Properties tab, the properties of different phases of the flow are defined. In this case,
the first phase is air whilst the second one is water.
To assign the corresponding fluid properties to the different phases
First, click Phase Properties on the left-hand side of the TransATUI
To define the first phase, under Phase 1 choose Air in the Material Library drop-down
list.
Proceed similarly to set the fluid of Phase 2 as Water Liquid
Simulation Parameters In the Simulation Parameters tab, the numerical parameters of the simulation are defined, such
as the type of simulation to be run and the way of computing the time steps.
Click Simulation Parameters on the left-hand side
Set the following parameters to solve for an unsteady flow with an implicit method.
Equations The user can define the convergence threshold, the solvers and the numerical schemes to be used for
each equation using the Equations tab.
Select Pressure in the Equation tree
To the right of the Equation tree, set the value of Convergence Tolerance field as follows
ConvergenceTolerance:Pressure:1.0e-2
∙ Set the parameters of the Pressure equation solver as the following
Solver:GMRES Preconditioner:AMG
Select Other Variables in the Equation tree
To the right of the Equation tree, set the value of Convergence Tolerance field as follows
ConvergenceTolerance:1.0e-3
Select Momentum in the Equation tree
To the right of the Equation tree, select HLPA in Convection Scheme drop-down list
ConvectionScheme:HLPA
Select Level-Set in the Equation tree
To the right of the Equation tree, select Quick in Convection Scheme drop-down list
ConvectionScheme:Quick
Initial Conditions For two–phase flow simulations, the initial gas–liquid interface topology has to be specified by the
user. Two bubbles with radius of 1mm are initially located at center coordinates, c1 = (2.25,1.5,2.0)mm
and c2 = (1.75,3.8,2.0)mm. The initial conditions can be set in TransAT through the use of the initialconditions.xml XML
file.
To be able to use custom initial conditions in this case, the file initialconditions.xml has to be
placed in the project folder. For this case, a ready-made initial conditions file available in the TransAT
Tutorials folder will be used to initialise variables over the domain. More information can be found on
the generation of custom initial conditions in the Custom Initial Conditions chapter of the TransAT UserManual .
Click Files in the top left corner then select Save to save the settings of the simulation
Copy the initial conditions file initialconditions.xml from the Tutorials/bubblemerge folder in
TransAT installation folder to the project folder by executing the following commands in
the terminal.
Please note: : do not make a copy/paste from this document to the terminal, since characters from pdf
files will not be understood. Directly type the command into the terminal instead.
The simulation must now be re-loaded to take into account the initial conditions settings set in
initialconditions.xml.
Click Files in the top left corner then select Open Project
Select the project file of the simulation e.g. bubblemerge.stt.
Output Management The Output Management Tab is used to define the output of the simulation, in particular the
format of the visualization files, the variables to be output, as well as the frequency at which the output
files will be produced.
Click Ouptut Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
The Execute tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI.
Running TransAT The Number of Processors to be used can be chosen in the corresponding field. In this case for 3
blocks, 3 processors is an appropriate value to use for the number of processors.
Click start the simulation.
4.3.8 Visualisation of the results
Viewing Results in Paraview The results of the simulation can be seen with the help of the open-source visualisation tool,
ParaView.
Launch Paraview as follows from your project folder using a terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>...vtm for 3D visualization.
Click .
To visualize gas-liquid interface, click in the toolbar (alternatively select Filters - >Common - > Contour).
Use Contour by: PHI (PHI is the Level-Set distance) function) and enter Isosurface: 0
to see the bubbles. Click .
Play the animation by hitting in the toolbar.
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.
4.3.9 Results
Figure 4.14: Bubble merge problem: bubble surface
4.4 Film Boiling
4.4.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
4.4.2 Introduction
In this tutorial film boiling of a liquid is modeled. A vapor layer spreads over the lower wall, which is
kept at a constant superheated temperature. The liquid is kept at the saturation temperature. The heat
transfer from the wall causes phase change from the liquid to vapor. The vapor film grows in size and
due to the subsequent hydrodynamics, a plume begins to form. As heat is being transfered, the
plume grows then detaches from the film. This test case is similar to the setup from Gibou
et al. (2007).
Note that for this problem, properties of the phases have been arbitrarily determined, in order to reduce
the computational time while still capturing the correct physical behaviors.
The problem setup is given as follows:
Domain: 79mm × 79mm resolved by a mesh 72 × 72 × 1. The top is an outflow whereas the
bottom is a wall with a defined temperature.
In the initial conditions, the heated surface of 5K is covered by a thin layer of vapor that
separates the fluid with a temperature of 0K above the saturation temperature and a latent
heat of 10,000J∕kg from the wall completely. A Rayleigh instability of the liquid–vapor
interface is triggered by gravity
4.4.3 Launching TransATUI
The TransATUI (TransAT User Interface) is a versatile and complete platform where the meshing,
problem setup and execution of a given simulation can be carried out.
Execute the following command to launch TransATUI
>transatui.py
4.4.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say filmboiling, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as filmboiling then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
4.4.5 Mesh & BCs Tab
The domain is defined and the mesh is created in the Mesh & BCs.
Select the Mesh & BCs tab at the top of TransATUI if that is not already the case
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Click Domain & Grid
In the Domain section, set the following values for the domain boundaries
Also note that although the problem setup is two-dimensional, 1 cell (i.e. 2 corner points) is required in the
third dimension since TransAT is a three-dimensional solver. This very same rule must also be applied
for the setup of axisymmetric problems.
Figure 4.15: Domain & Grid tab
Blocks To allow parallel computation, the domain must be split into several blocks.
Click and enter number of blocks as the following then click to perform the block
decomposition and close the window
Xdirection:2 Ydirection:2
The block decomposition should be similar as Figure 4.16.
Figure 4.16: Block Decomposition
BCs Tab The surfaces of each or all boundaries can be displayed by selecting the corresponding
boundary in the drop-down list at the top of the BCs tab. One boundary condition of each
type is available to be edited and used from the start. Additional BCs can be created by
clicking on . The button assigns a selected boundary condition to a highlighted
surface. Creating Boundary Conditions: In this case, a heated wall is at Y Min and an outflow at Y max. Other boundary conditions are
symmetry boundary conditions. Below, step-by-step instructions are given to create the wall boundary
condition and to define its properties. Note that in this tutorial temperature and pressure must be understood as relative properties, with the
saturation temperature being set as 0K and the outflow pressure as 0Pa.
Rename the Wall BC to Wall1
Click to set the properties of the boundary condition
Fill in the fields with the following parameters:
Temperature / Heat flux choice: Temperature.
Temperature value: 5 K
Click to save the settings and close the window
Proceed similarly as above to set properties for the outflow BC
Select Y Min in the drop-down list at the top of the BCs tab
Highlight YMin 0 in the surface tree by clicking it
Check Wall1 in the list of boundary conditions at the bottom of the page
Click
Once the the assignment is done, the surface Y min 0 will be highlighted in the graphical window on the
right.
Proceed similarly to assign the remaining surfaces to their respective boundary conditions. The
assignments of the remaining boundary conditions can be found below.
In this tab the numerical parameters of the simulation are defined, such as the type of simulation to be run,
the methods for computing the time step and solving the equations.
Simulation Type and Control Parameters
Set the following parameters to solve for an unsteady flow with an implicit method.
Initial Conditions In the Initial Conditions tab, the initial conditions for the simulation are set. In this tutorial
advanced initial conditions are used.
For two–phase flow simulations, the initial gas–liquid interface topology has to specified by the user.
This is achieved in TransAT by using the initialconditions.cxx C++ file. More information can be
found on the generation of custom initial conditions in the Custom Initial Conditions chapter of the
TransAT User Manual.
Copy the initialconditions.cxx file to the current working directory to be able to initialise
the two–phase flow conditions with the following command
Please note: : Do not copy/paste from this document to the terminal, as the characters from .pdf
files may not be understood by the terminal. Instead, directly type the command in the terminal.
Select Advanced Initial Conditions
Several new icons are displayed. opens a text editor where the the initial conditions file can be edited.
However, there is no change to be made in this case.
Click to compile the initial conditions. This step is optional and only checks that
the initialcondition.cxx file is written properly and can be compiled. The flow field will be
initialised later in the Execute window.
Output Management In the Output Management tab, the parameters of the outputs for the simulation are set. In this
tutorial, only the visualization output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
Navigate to the RESULT folder and choose xy-filmboiling_ls...vtm.
Click .
Create a Contour object by clicking in the toolbar ( alternatively select Filters - >
Alphabetical - > Contour in the menu bar).
Choose variable PHI (PHI is the Level-Set function).
Set value of the contour to be 0.
Click .
Make the father object visible (xy-filmboiling_ls.0000*) by clicking the icon.
Choose the ”DEN” variable from the drop-down list.
Play the animation by clicking in the toolbar.
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.
Figure 4.21: Paraview: Select Density as the Variable and the PLAY button
4.4.9 Results
Results for initial bubble detachment are shown in Figure 4.22 and Figure 4.23. As the simulation
continues, more bubbles can be observed.
Figure 4.22: Interface (white line) and velocity vectors before initial bubble detachment, colored
by Temperature.
Figure 4.23: Interface (white line) and velocity vectors of fully detached bubble, colored by
Temperature.
4.5 Spillway
4.5.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
4.5.2 Run time
Approximately 20 minutes using 4 core processor when run in parallel.
4.5.3 Introduction
In this tutorial, a pipe spillway is simulated. Algebraic Slip Model is selected for modelling interphase
physics. It is assumed there is a slip between two phases (water and air here) resulting in two different
phase velocities. The goal of the simulation is to investigate in water discharge rate over the
spillway.
4.5.4 Launching TransATUI
Execute the following command to launch TransATUI
>transatui.py&
4.5.5 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say spillway, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as spillway then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
4.5.6 Geo
In this tab simple geometries can be created and imported to the mesh. Additionally, geometries created
externally by other software can be imported in STL format. In this tutorial the geometry has been
created externally therefore it has to be loaded into the mesh.
Click Geo at the top of the TransATUI.
Objects Load the geometry file already prepared and located in the TransAT Object Database.
Select the Database tab.
Expand the Hydraulics folder
Select Spillway_4.gts
then click to load the file to the mesh
In the Choose Units window that popped up, select mm in the drop-down box
Activate the check-box Resize Mesh around Geometry to resize the domain
Click to create the Spillway and send it to the mesh
The Spillway needs to be positioned at suitable coordinates.
Switch to the Objects tab
Select the Spillway_4 object that appeared in the list of objects. Make sure the Spillway is
coloured in orange in the Graphical window
Under the Object Motion, find Object Transformation
Refinements will be performed in the zones of interest in the Customized refinement. Here a very coarse
mesh is used, and without refining it we would end up with only 3 cells in the pipe in X direction. By
slightly refining the mesh at the flow entrance section and where the solid geometry is changing we can
improve the results of the simulation. Open Customized refinement and create new X-axis as a range
type starting at X=0.2 and ending at X=15m.
Figure 4.25: Grid
Blocks If you want to run the simulation on more than 1 processor then you can split the domain. E.g. in
order to use 4 processors the domain can be split in X and Y directions. In order to set it up click on
icon and set number of new blocks as 2 for X and Y direction. This will create a domain split into 4
blocks. Now the simulation can run on up to 4 processors since every processor can handle one or several
blocks.
BCs Tab
Select the BCs tab
Creating Boundary Conditions: In this test case, a wall is at YMIN and ZMIN, pressure outflows at YMAX, XMIN and XMAX.
Symmetry boundary condition is applied at ZMAX. Note an inlet boundary condition for water will be
modelled here via pressure outflow boundary condition by employing backflow property. We can define
water phase for the backflow, so whenever the flow is reversed, water will enter the domain. This is a
kind of trick here, since we do not know what would be the velocity at the inlet boundary condition and
by using backflow condition this problem is resolved automatically. However by imposing a backflow we
are not able to control water level, so it is presumed the water level is not affected far away from the
spillway.
Rename the Outflow BC to inflowWater
Click to set the boundary condition properties
Fill in the outflow properties:
In the Basic tab
Outflow Type: Pressure
OutflowData Source: From Initial Conditions
In Backflow properties tab:
Backflow turbulent intensity: 0.1
Backflow eddy viscosity ratio: 100.0
Backflow volume fraction of phase 2: 1.0 (water only)
Click
A second outflow is required. Click to create this.
Rename the created BC to inflowAir and change the type to Outflow in the drop-down.
Select All surfaces in the drop-down list at the top of the BCs tab
With a simple click, highlight XMIN 0 in the surface tree.
Click to create a subBC. The button is visible next to the other buttons once XMIN 0
is selected.
Set the value of Ymin and Ymax as follows: Ymin = 0.75 and Ymax = 3.26
Click
Assigning Boundary Conditions:
Select All surfaces in the drop-down list at the top of the BCs tab
Highlight XMIN 0 in the surface tree. Choose lower SubBC previously created (for Ymin =
0.75 and Ymax = 3.26).
Tick inflowWater in the list of boundary conditions by clicking the light grey square at the
corresponding line of the boundary conditions table
Click
XMAX 0, YMAX 0 in the surface tree takes the colour associated with the inflowAir boundary condition
(see boundary conditions table) after being assigned. Choose also XMIN 0 upper SubBC and set it to
inflowAir.
Proceed similarly as above to assign the remaining surfaces to their corresponding boundary
conditions given below.
In the Models and Properties section activate Turbulence Modelling and set the model V-LES
(drop-down list). In the V-LES set V-LES filter width to 0.01 m.
Activate Gravity and click to the right.
Set the following parameters in the Gravity window them click to save the settings
x:0.0 y:-9.81 z:0.0 CHECKHydrostatic
In the Multiphase section activate Phase Average and set the model (drop-down list) to
Algebraic Slip Model
Phase Properties In the Phase Properties tab, the physical properties of the different phases are defined.
To define the first phase, under Phase 1 choose Air in the Material Library drop-down
list.
Proceed similarly to set the fluid of Phase 2 as Water Liquid
Phases Interactions In the Phases Interactions tab, the interphase slip models will be defined between the phases. The
first table shown, miscibility, cannot be changed from the default values. Phases of different states will
be immiscible with each other. The drag models will be defined:
Click
Select Drag Model in the Interphase Slip Relations drop-down choice.
Select Tomiyama contaminated for air bubbles dispersed in water (first row, second column).
Select Clift for water drops dispersed in air (second row, first column).
No relations for lift or wall lubrication will be set, however, surface tension needs to be set for the
tomiyama model.
Select Surface Tension in the Interphase Slip Relations drop-down choice.
Set 0.072 as a value for the surface tension.
Figure 4.27: Drag Model Table
Simulation Parameters In the Simulation Parameters tab, the numerical parameters of the simulation are set (schemes,
relaxation, time-stepping,...).
Simulation Type and Control Parameters
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for an unsteady flow
Initial conditions It is necessary to initialise the simulation, in order to give the initial location of the different phases.
In this example water is located at the entrance part of the domain between the inlet and pipe spillway.
In the Initial Conditions tab, the initial conditions for the simulation are set. In this tutorial
advanced initial conditions are used.
Figure 4.29: Spillway: Initial Conditions
The initial velocity can be defined in a C++ file initialconditions.cxx. A template of an initial
condition file can be found in the reference folder (spillway in Tutorials folder).
Copy the initial conditions file to the project folder by executing the following command
Please note: : do not copy/paste the above line in the terminal as PDF-format characters will
not be understood by the terminal. Instead, type the command directly into the terminal.
Select Advanced Initial Conditions
Click to compile the initial conditions. This step is optional and only checks that
the initialcondition.cxx file is written properly and can be compiled. The flow field will be
initialised later in the Execute window.
Output Management In the Output Management tab, the parameters of the outputs of the simulation are set. In this
example, only the visualization output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
Click to initialise the flow field from the initialconditions.cxx file.
Click to start the simulation.
4.5.10 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from the project folder using the terminal
>paraview&
Click on File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>...vtm for 3D visualization.
Click on .
To visualize only the fluid domain, Select Filters - > Common - > Clip. Use: Clip Type: Scalar Scalars: EmbI Value: 0 Check Inside Out. Click OK Then use Clip Type: Scalar Scalars: PhaseAlpha2 Value: 0.05
This shows the volume fraction distribution of water (larger than 5%) in the simulated
domain.
Play the animation by hitting in the toolbar.
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.
4.5.11 Results
Figure 4.30: Spillway: Water phase coloured by velocity magnitude (the domain is mirrored here
with respect to the symmetry boundary condition at Z=2.335)
Chapter 5 Particle Tracking
5.1 Particles in Crossflow
The goal of this tutorial is to introduce the Lagrangian particle tracking feature of TransAT.
In this tutorial a flow in a channel with a cross-stream flowing downstream of the primary inlet is
simulated. In both inlets particles of 3 different diameters are injected in the flow. The temperature
equation is solved for both the fluid and the particles. Two-way momentum and temperature coupling
between the fluid and the particles is accounted for.
The domain is a two-dimensional channel with length of 10cm and height of 1cm. The dimension in the
z direction does not matter as long as the number of grid points along that direction is 2. The flow is
modelled with a uniform 41 × 10 grid.
5.1.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
5.1.2 Launch TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
5.1.3 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say crossflow, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as crossflow then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
If that is not already the case, select Mesh & BCs at the top of the TransATUI window
5.1.4 Mesh & BCs Tab
Domain & Grid Tab In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab
In the Domain section, set the following values for the boundaries
The ratios between cells has been set to 1 so as to obtain a uniform grid. Blocks The domain must now be decomposed into several blocks so that the simulation can run on several
processors. Indeed, each block is allocated to one processor (but a processor can handle several blocks).
Select Blocks to define the multi-block options.
Click to cut the domain into several computational blocks.
Set X direction input to 3 then click .
The domain is automatically cut into blocks of equivalent sizes.
BCs Tab To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top
of the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating and assigning Boundary Conditions: To create the inflow at the boundary on the left-hand side of the domain ( i.e. X min) follow the
instructions given below:
One of each type of boundary condition are already available at the start. This tutorial will
use each type of available BCs.
Click of the Inflow BC. Set the properties of the boundary condition
Select Xmin 0 in the boundary tree with a simple click
Check the light grey square next to Inflow in the list of boundary conditions
Click
The boundary on the left end of the domain is now associated to the Inflow boundary condition and should
be coloured in the corresponding color in the graphical window.
Proceed similarly as above to add and define the properties of the following boundary conditions:
Please note: : the wall boundary condition is only defined once but assigned to two surfaces.
Figure 5.1: Inflow properties
Defining a sub-boundary condition (SubBC)
Select Ymin in the drop-down list at the top of the BCs tab and highlight YMIN0 in the
surface tree
Click to create a subBC. The button is visible next to the other buttons once Ymin 0
is selected.
There are two horizontal and two vertical scroll bars in the Sub BC window. Move the
horizontal scroll bars to define a 0.01 m long sub BC around the middle of the Y-min
boundary in the X-direction ( i.e. X min =0.045 to X max =0.055m).
Click
Set the newly created boundary YMIN 0 1 to be an inflow. To do so
Click
Rename newbc0 to Inflow_part
Select Inflow in the drop-down list of the Type column
Click
Fill in the inflow properties:
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Constant
Inflow Velocity Components: u: 0.0 v: 0.87 w: 0.0
In the Lagrangian Particle Tracking tab: Particle Volume Fraction: 2.0e-3 Particle Temperature: 400.0
Click to save the settings and close the window
Assign the Inflow_part boundary condition to the YMIN0 1 surface
The mesh is now ready.
Click Files then select Save to save the settings
Figure 5.2: Boundary conditions
5.1.5 Input Tab
To set up the simulation parameters
Click Input at the top of the TransATUI
Physical Models Tab
Select the Physical models tab to define the equations to be solved and the models to be
used in the simulation.
Select the following equations in the Basic Equations section
Phase Properties Tab In the tab Phase Properties, the physical properties of the phases of the flow are defined. Since
the Multiphase Flow Method is turned off, only Phase 1’s fluid properties should be available in
the phase tree.
In the phase tree, click Phase 1 and fill in the corresponding fields with the following values
Simulation Parameters Tab In this tab the numerical parameters of the simulation are defined, such as the type of simulation to
be run, the methods for computing the time step and solving the equations.
Click Simulation Parameters on the left-hand side
Simulation Type and Control Parameters
Set up the simulation type and control parameters as the following
Set the following parameters to solve for an unsteady flow with an implicit method.
Equations The user can define the convergence threshold and the numerical schemes to be used for each
equation in the Equations section.
Click All Quantities in the equation tree and set the value of the Convergence Tolerance
field as the following
ConvergenceTolerance:1.0e-3
Figure 5.5: Simulation parameters
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except temperature.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0
Proceed as above to set the initial state of the remaining quantities as follows
V-Velocity Method:Constant Value:0 Temperature Method:Constant Value:300 Pressure Method:Constant Value:0
Output Management Tab The Output Management tab is used to define the output of the simulation, in particular the
format of the visualization files, the variables to be output, as well as the frequency of generation of the
output.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
In the Post-Processing section, activate Non-Dimensional Numbers if that is not already the
case (it is activated if its check-box is orange).
5.1.6 Execute Tab
Click Execute at the top of the TransATUI
This tab is where the simulation is started and controlled.
5.1.6.1 Starting the simulation
Running TransAT The number of processor in which the simulation is to be run can be changed by modifying the value
of the field Number of Processors. In this case, 1 processor is enough.
Start the simulation by clicking
5.1.7 Results
Particles are released at T = 400K and they exchange both momentum and heat with the fluid. The
fluid gets warmer and the particles are cooled.
The results of the simulation can be seen with the help of the open-source visualisation tool,
ParaView.
Launch Paraview as follows from your project folder using a terminal
>paraview&
Click on File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>…vtm for 3D visualization.
Click .
To visualize the temperature profile of the fluid:
Select (alternatively, select Filters - > Common - > Slice in the menu bar). Select ZNormal and unselect Show Plane. Click Apply.
To visualize temperature select T in the Coloring section from the left most drop-down list.
Play the animation by hitting in the toolbar.
To visualize the particles colored with their temperatures:
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>_part…vtm for 3D visualization of
particles
Select in the toolbar (alternatively, select Filters - > Common - > Glyph in the menu
bar).
Set Scalars to T and set Scale Mode as scalar
Set Glyph Type to Sphere and change Center Radius to 0.01
Click
Play the animation by hitting in the toolbar.
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.
(a)Fluidtemperature
(b)Particletemperature
Figure 5.6: Two-way coupled gas-particle flow
5.2 Particle Separator
5.2.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
5.2.2 Introduction
In this tutorial, the Immersed Surface Technology (IST) of TransAT is coupled with its Lagrangian
Particle Tracking (LPT) capabilities. The simulation as described in this section can also be augmented
by turning ON the turbulence modelling feature and run with the Very Large Eddy Simulation (VLES)
model.
The problem simulated is that of a hydro-cyclone with a mixture of water and particles entering through
a tangential inlet. The particles which are denser than water will leave through the bottom outlet and
water will exit through the upper outlet. Particle paths are simulated using the Lagrangian particle
tracking method, whereas the fluid flow is simulated using an Eulerian representation. The interaction
between the phases is modelled by transforming the force acting on the particles onto an
Eulerian field that interacts with the flow. The case is such that particles are volumetrically
dilute, however, the momentum interaction between the particles and the fluid is taken into
account.
5.2.3 Launching TransATUI
Execute the following commands to launch TransATUI.
>transatui.py&
5.2.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say particle_separator, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as particle_separator then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
5.2.5 Geo Tab
In this tab, the necessary objects are added to the mesh.
Click Geo at the top of the TransATUI.
Objects Load the geometry file already prepared and located in the TransAT Object Database.
Select the Database tab.
Expand the Processes folder
Select Cyclone_separator.gts
then click to load the file to the mesh
In the Choose Units window, select User defined for the unit and set the value at 10.
Activate the check-box Resize Mesh around Geometry to resize the domain
Click to create the separator and send it to the mesh
In this case the fluid region is enclosed in the geometry that was just loaded. Bearing in mind that in
TransAT, loaded objects are considered as solids by default, the fluid and solid domain need to be
inverted. To do so,
Un-check Set CAD as Solid below Object Properties
5.2.6 Mesh & BCs Tab
The domain is defined and the mesh is created in the Mesh & BCs tab.
Click Mesh & BCs at the top of the TransATUI
Domain & Grid
Click Domain & Grid on the left-hand side of the TransATUI
Click Blocks on the left-hand side of the TransATUI
Click in the bottom right corner of the TransATUI to display the mesh information
The information panel shows that the single block contains roughly ≈ 200,000 cells. The mesh will be
adapted to roughly fit the geometry by creating blocks and adjusting their size to fit to the geometry
with the shrinking options in TransAT.
Click , then enter the number of blocks in the different directions as follows.
40 blocks have been created and some of them have been resized to fit the geometry (there are now roughly
132,000 cells distributed in 40 blocks). See Figure 5.7.
The size of the blocks is parameterised with the Shrink Factor. A Shrink Factor of 0.5 will fit
the mesh to the geometry and make sure that the fluid-solid interface is surrounded by
at least 3 cells each side of the interface. This ensures that the fluid-solid interface is well
resolved.
Figure 5.7: Grid after splitting and shrinking the blocks
BCs Tab
Click BCs on the left-hand side of the TransATUI.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, we have an inflow at Zmax and pressure outflows at Ymin and Ymax. All other
boundaries need not be specified - they will be considered as symmetry boundaries by the solver.
Firstly, the boundary conditions will be created and defined, then assigned to specific grid
planes.
From the Inflow available, click
Fill in the inflow properties:
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: constant
Inflow Velocity components: u: 0.0 v: 0.0 w: -5.0
Click Lagrangian Particle Tracking on the left-hand side of the window then modify
the following the parameters: Particle volume fraction: 1.0e-4 Particle velocity: u: 0.0 v: 0.0 w: -5.0
Click
Now the outflow boundary conditions will be adjusted.
Rename the Outflow BC to outflowbottom
Click to set the boundary condition properties
Fill in the outflow properties as follows:
Outflow Type: Pressure
Outflow Data Source: From Boundary Conditions
Outflow Pressure: 200 [Pa]
Click
An additional outflow will be created.
Click
Rename newbc0 to outflowtop
Select Outflow in the drop-down box of the Type column
Click
Fill in the outflow properties:
Outflow Type: Pressure
Outflow Data Source: From Boundary Conditions
Outflow Pressure: 0 [Pa]
Click
Assigning Boundary Conditions:
Select Z Max in the drop-down list.
Highlight ZMAX 0 in the surface tree by simply clicking it.
Check the inflow boundary condition (click on the light grey square at the corresponding
line) in the list of boundary conditions at the bottom of the window
Click
ZMAX 0 in the surface tree takes the color of the boundary condition after being assigned.
Select Y Min in the drop-down list.
Highlight YMIN 0 in the surface tree.
Check outflowbottom in the list of boundary conditions.
Click
YMIN 0 in the surface tree takes the color of the boundary condition after being assigned.
Select Y Max in the drop-down list at the top of the BCs tab.
Highlight YMAX 0 in the surface tree.
Check outflowtop in the list of boundary conditions.
Click
YMAX 0 in the surface tree takes the color of the boundary condition after being assigned.
The mesh is now ready.
Click Files then select Save to save the settings
Figure 5.8: Boundary conditions
5.2.7 Input Tab
To set up the simulation parameters
Click Input at the top of the TransATUI.
Physical Models In this tab, the models that will be used during the simulation will be defined.
Select the Physical models tab to define the equations to be solved and the models to be
used in the simulation.
Select the following equations in the Basic Equations section
Simulation Parameters In the Simulation Parameters tab the numerical parameters of the simulation are defined, such as
the type of simulation to be run, the methods for computing the time step and solving the
equations.
Simulation Type and Control Parameters
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for an unsteady flow
Set the following parameters in the Adaptive Time-Stepping window then click to save the
settings and close the window
CFLMin:0.6Max:1.2 DiffusionMin:0.6Max:1.2
Equations In the Equations section the convergence threshold is defined, as well as the convection scheme and
the solvers used by TransAT.
Select All Quantities in the equation tree. All the equations should be highlighted
Modify the parameters besides the equation tree as the following
ConvergenceTolerance:1e-2
∙ Select Pressure in the equation tree and set the following:
Solver:GMRES Preconditioner:AMG
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click All Qunatities in the quantity tree
Set Method to Constant and Value to 0
Output Management In the Output Management tab, the parameters of the outputs of the simulation are set. In this
example, only the visualization output is defined.
Click Ouptut Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
Click Execute at the top of the TransATUI to run the simulation.
Running TransAT
Set the Number of Processors to 3 (for a standard quad-core machine) then click the
icon below the text field to run the solver.
5.2.9 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>...vtm for 3D flow visualization.
Click Apply.
Go to the RESULT folder and choose <projectname>_part...vtm for 3D particle visualization.
Create a Glyph on the particle data and choose Glyph type as Sphere. Use the scalar (particle
diameters) to size the Glyph.
To visualize solid-fluid interface, select <projectname>...vtm in the Pipeline Browser then
select in the toolbar (alternatively, select Filters - > Common - > Contour in the
menu bar).
Use Contour by: EmbI (EmbI is the distance to the fluid-solid interface) and enter
Isosurface: 0
Play the animation by hitting the in the toolbar.
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.
Figure 5.12: U-velocity contour, streamlines and particles after 2000 time steps
5.3 Transport of particles in a pipe
5.3.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
5.3.2 Problem Description
In this tutorial a single-phase flow transporting particles through a pipe is modelled in 3D using
TransAT’s Immersed Surface Technology (IST) for object representation. Water and particles flow in
through an inlet at a velocity of 0.005 m∕s with a laminar profile. The aim is to get the velocity profile
and the distribution of particles in the pipe over time.
5.3.3 Problem Setup
Domain: 1.524m × 0.22m × 0.22m resolved by a mesh of 50 × 25 × 25 cells.
Inflow: velocity 0.005m∕s, laminar velocity inflow with particles.
Outflow: fixed pressure
Fluid: Water
Reynolds number = 778
Pipe diameter = 6inch (15.24cm)
Ratio = 10
5.3.4 Launching TransATUI
To launch TransATUI, open a terminal then execute the following command
>transatui.py&
5.3.5 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say particles_pipe_flow, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as particles_pipe_flow then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
Geo is a module that can be used to create simple geometries for TransAT. The grid properties are
defined in Mesh & BCs tab whilst the physical and numerical parameters of the simulation are defined
in the Input tab. When the simulation is ready, the simulation will be started from the Execute
tab.
Some general operations such as saving and loading projects or exiting TransAT can be done by clicking
Files then selecting the corresponding option.
5.3.6 Geo Tab
A cylinder geometry is needed for the simulation.
Click Geo at the top of the TransATUI.
Click Create Shape tab within the left panel
In the shape selection drop-down list next to the button, choose Cylinder.
In the text field below the drop-down list, set the name of the object to be created as
Cylinder
Check Resize Mesh around Geometry, to adjust the domain around the cylinder
Click to create the Cylinder and send it to the mesh
Objects Tab In this case the fluid region is enclosed in the geometry that was just loaded. Bearing in mind that in
TransAT, loaded objects are considered as solids by default, the fluid and solid domain need to be
inverted. To do so,
Click the Objects tab.
Select the Cylinder object that appeared in the list of objects. Make sure the Cylinder is
coloured in orange in the Graphical window
Under the Object Properties, find Set CAD as Solid
Un-check Set CAD as Solid to define the Cylinder as the flow domain
5.3.7 Mesh & BCs Tab
The computational domain is defined and the mesh is created in the Mesh & BCs tab.
Select the Mesh & BCs tab at the top of TransATUI if that is not already the case.
Domain & Grid Tab In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab
In the Domain section, set the following values for the domain boundaries:
Please note: The domain size has been chosen in order to make sure that the fluid-solid interface is
surrounded by at least 3 cells each side of the interface. This ensures that the fluid-solid interface
is well resolved.
Set the following parameters to define the cell density and aspect ratios in the domain
Note that Nx, Ny, Nz are the number of corner points in the x, y and z directions. The actual number
of cells in each direction is the number of corner points in the corresponding direction minus
one.
Also note that TransAT is a three-dimensional solver. As a result, at least 1 cell (i.e. 2 nodes)
is required in the third dimension, even for two-dimensional or axisymmetrical problems.
Blocks The domain must now be decomposed into several blocks so that the simulation can run on several
processors. Indeed, each block is allocated to one processor (but a processor can handle several
blocks).
Select Blocks to define the multi-block option.
Click to cut the domain into several computational blocks.
Choose 3 for X direction then click
The domain is automatically cut into blocks of equivalent sizes.
BCs Tab The BCs tab allows the user to assign boundary conditions for each of the surfaces present in the
domain. A list of the surfaces present in the domain can be seen by selecting All surfaces in the
drop-down menu. The appropriate setup for this simulation requires 2 boundary conditions in
total.
Select the BCs tab
One of each type of boundary condition are already available at the start.
This tutorial will edit from the Inflow and Outflow and BCs available.
Now conditions for each of the boundaries should be set.
For each boundary condition, press to open the parameters window, set the parameters listed
below then click .
To assign the Inflow boundary condition to the XMIN 0 surface
Click the face XMIN 0 in the surface tree
Select the Inflow boundary condition by ticking the light grey square to the left in the
appropriate line of the boundary conditions table
Press . The XMIN 0 face will now be highlighted in both the surface list and the graphical
viewer.
Proceed similarly using the data in the following table to assign the other boundary
conditions to their respective faces.
BoundaryXMIN0:Inflow BoundaryXMAX0:Outflow
Symmetry conditions are applied on the remaining boundary surfaces. Since boundary conditions are set as
symmetries by default in TransAT, no extra operation is required to define the remaining boundary
conditions. The final setup should be similar to Figure 5.13
Figure 5.13: Boundaries Final Setup
Click Files then select Save to save the settings. Alternatively, you can press Ctrl+s to save
the settings.
5.3.8 Input Tab
To set up the simulation parameters
Select Input at the top of TransATUI
Physical Models Tab In this tab, the models that will be used during the simulation will be defined.
Select the following equations in the Basic Equations section
Activate Reference Properties and click to the right.
Set the following parameters in the reference properties window then click to save the settings
ReferenceVelocity:0.005 ReferenceLength:0.1524
In the Multiphase section, activate Lagrangian Particle Tracking, then click to select the
advanced parameters for the Lagrangian Particle Tracking Tab.
Set the following parameters in the different tabs of the Lagrangian Particle Tracking window then
click to save the settings
Click Phase Properties on the left-hand side of the TransATUI
Select Phase 1 in the phase tree
To use the pre-set properties of water, select Water Liquid in the Material Library
drop-down list
Simulation Parameters Tab This tab is used to define the numerical properties of the simulation.
Simulation Type and Control Parameters The simulation will be run unsteady because of the motion of the particles.
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for the unsteady flow.
For Time Stepping select Adaptive and leave the default settings.
Equations In this section the convergence threshold is defined as well as the convection scheme and the solvers
used by TransAT. These parameters can be set for each equation individually.
In the equation tree, click All Quantities
Modify the Convergence Tolerance field besides the equation tree as follows
ConvergenceTolerance:1.0e-2
Figure 5.15: Simulation parameters
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.005
Proceed as above to set the initial state of the remaining quantities as follows
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
5.3.9.1 Starting the simulation
Change the Number of Processors to 3.
Click to start the simulation
5.3.10 Viewing Results in Paraview
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose particles_pipe_flow...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Create a Slice object by clicking in the toolbar (alternatively select Filters - >
Common - > Slice in the menu bar) to see variables in a plane. Click on Z Normal and
Center on Bounds to see the flow in the middle of the channel. Click .
Choose variable U from the drop-down list.
Clicking on the rainbow button on the left shows the Legend. Clicking on the double-arrow
button on its right re-scales the color range to the data range.
To visualise the converged results, go to the last frame by hitting in the toolbar.
To visualize the particles:
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose particles_pipe_flow_part ... vtm for 3D visualization of
particles
Select in the toolbar (alternatively, select Filters - > Common - > Glyph in the menu
bar).
Plotting Velocity Vectors To create velocity vectors in ParaView, an object is needed to calculate the 2D velocity and a
plotting device to display the vector. To this end, the Calculator and the Glyph tools are
used.
Make sure the Slice filter is selected.
Create a Calculator object by clicking in the menu bar (alternatively, you can select
Filters - > Common - > Calculator)
In the Object Inspector window for the Calculator, enter Velocity as the Result Array
Name.
In the box below, enter U * iHat + V * jHat. See Figure 5.16.
Click .
Make sure that the Calculator is made invisible and the father object is made visible by
clicking on the respective icon.
In the Pipeline Browser, highlight the Calculator by clicking it once and then click
in the menu bar (alternatively, you can select Filters - > Common - > Glyph).
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
5.3.11 Results
Figure 5.17 shows the temperature contours of the converged solution
Figure 5.17: Velocity profile and particle distribution in the pipe
Chapter 6 Thermal-Hydraulics Applications
6.1 Wall Boiling
6.1.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
6.1.2 Introduction
The following section gives a step-by-step guide to simulate the phenomenon of subcooled boiling in an
upward flowing pipe. This tutorial will show the user how to define the multiphase problem within
the Phase Average Model and how to define initial conditions in TransAT. Note that this
type of modeling is presently valid for the Phase Average Model only and not for Level-Set
model.
6.1.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
6.1.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say wallboiling, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as wallboiling then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
6.1.5 Mesh & BCs Tab
In the Mesh & BCs tab, the domain along with the mesh are defined.
If that is not already the case, select Mesh & BCs at the top of the TransATUI window
Domain & Grid
Select the Domain & Grid tab
Set the following values for the boundaries in the fields of the Domain section
Blocks In TransAT, the domain can be decomposed into several blocks so that the simulation can run on
several processors. Indeed, each block is allocated to one processor (but a processor can
handle several blocks). This case does not require such action and will be left as a single
block.
BCs Tab
Select the BCs tab
Creating Boundary Conditions: In this case, an inflow is at X min, an outflow at X max, axis of symmetry at Y min, wall at Y max, and
symmetry boundary conditions at Z min and Z max. Follow the step-by-step instructions below to
create the inflow boundary condition and define its properties.
From the Inflow BC available, click to set the boundary condition properties
Fill in the inflow properties - Tab: Basic
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Turbulent
Inflow Static Temperature: 345.8 K
Inflow Velocity components: u: 1.0 v: 0.0 w: 0.0
Fill in the inflow properties - Tab: Turbulence (RANS)
Turbulent Intensity: 0.1
Mu_t/Mu: 100
Fill in the inflow properties - Tab: N-Phases Algebraic Slip Model
Inflow Volume Fraction of Phase 1: 0.003
Inflow Volume Fraction of Phase 2: 0.997
Click to save the settings and close the window
Proceed similarly as above to edit the remaining boundary conditions with the following
properties.
In the Models and Properties section activate Turbulence Modelling and set the model RANS
(drop-down list)
Activate Gravity and click to the right.
Set the following parameters in the Gravity window them click to save the settings
x=-9.81 y=0.0 z=0.0 ENABLEHydrostatic
In the Multiphase section activate Phase Average and set the model (drop-down list) to
Homogeneous
Click , set the parameters given below then click
Numberofphases:2
Activate Phase Change then click
Set the model inputs in the Phase Change Properties Window as described in Figure 6.1 and then
click
Figure 6.1: Phase change model
Click
Activate Axisymmetry
Figure 6.2: Physical models
Phase Properties The Phase Properties tab is used to define the phases of the flow. It is possible to directly use
properties that are available in the material list. If the phase to be simulated is not in the proposed
material list, its properties can be directly entered in the corresponding fields. Here, “custom”
properties for the two fluids will be used. The fluid properties are based on Refrigerant
R-12.
Click Phase Properties on the left-hand side of the TransATUI
Select Phase 1 in the phase tree
Fill in the different fields with the following properties
This tab is where the simulation is started and controlled.
6.1.7.1 Starting the simulation
Running TransAT
Click to start the simulation
6.1.8 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the Terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-wallboiling...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Choose variable PhaseAlpha1 from the drop-down list. (See Figure 6.5). This shows the
void fraction distribution along the domain. The vapor generated at the wall and then
dispersed along the flow and towards the center of the pipe.
Clicking the rainbow button on the left shows the Legend. Clicking the double-arrow button
on its right rescales the color range to the data range.
As the length of the domain in X-direction is quite large compared to the Y-direction,
we can scale down the view in the X-direction. Click the Advanced Toggle Properties
button under the Properties panel. See Figure 6.6
Scroll down to Transforming and then enter 0.05 in the first box next to Scale.
To visualise the converged results, display the last frame of the results by hitting in
the toolbar.
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.
Figure 6.5: Variable Selection Drop-Down Box and the Play button
Figure 6.6: Advanced Toggle Properties Button
6.1.9 Results
Figure 6.7: Wallboiling: Phase 1 void fraction along an upward flowing pipe flow with subcooled
boiling
6.2 Counter current flow in a pipe
6.2.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
6.2.2 Introduction
In this test case, a stratified air-water countercurrent flow will be simulated. Air flows at
a temperature of 298.15K and water flows in the opposite direction at a temperature of
295.15K.
An image of the domain is given in Fig 6.8. In the top half of the pipe, air flows from right to left with
an inflow velocity of 4 m/s, while water flows from left to right with a velocity of 0.1 m/s in the bottom
half.
Figure 6.8: Counter-current flow: Mesh of the setup
This tutorial is beneficial in understanding the creation of a two-phase problem and the definition of
a domain with complex inflows and outflows.
6.2.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
6.2.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say countercurrent_flow, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as countercurrent_flow then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
Geo is a module that can be used to create simple geometries for TransAT. The grid properties are
defined in Mesh & BCs tab whilst the physical and numerical parameters of the simulation are defined
in the Input tab. When the simulation is ready, the simulation will be started from the tab
Execute.
Some general operations such as saving and loading projects or exiting TransAT can be done by clicking
Files then selecting the corresponding option.
6.2.5 Geo Tab
A pipe is needed for the simulation. It will be created using the Geo tab.
Click Geo at the top of the TransATUI
In the drop-down list next to the icon, select Pipe.
Blocks To differentiate inflows and outflows, the mesh will be split and inflow/outflow blocks will be
disconnected. The gap between blocks will play the role of a separator plate, to avoid the influence of
boundary conditions on each other.
Select the Blocks tab to set the multi-block options.
Click to split the domain into several computational blocks.
Choose 4 for X direction then click .
The domain is automatically cut into blocks of equivalent sizes. The blocks on the left and right
ends of the domain will now be split in 2 to define the inflows and outflows at these two
ends.
Select the block on the left-hand side by setting Select Block to 1 then click .
Choose 2 for the Y direction input then click .
The operation will be repeated for the block on the right-hand side of the domain.
Set Select Block to 3 then click .
Choose 2 for the Y direction input then click .
Blocks will now be redimensioned, so that the length of the contact zone between air and water is 2
m, and that inflows and outflows are separated by plates.
Redimensioning of the left end of the domain
To select the bottom-left block, set Select Block to 3.
Click , and enter Xmax: -1.0. Click .
Select the top-left block (Block 4).
Click , and enter Xmax: -1.0 and Ymin: 0.0065. Click .
Make sure that the two left blocks are disconnected. To do so, click at the bottom right
corner of the graphical view to display the Mesh Info panel with the relevant information.
Select the center-left block (Block 1), click , and enter Xmin: -1.0. Click .
Make sure that block 1 is now connected to blocks 2, 3 and 4 in the Mesh Info panel.
Redimensioning of the right end of the domain
Select the bottom-right block (Block 5). Click , and enter Xmin: 1.0. Click .
Select the top-right block (Block 6). Click , and enter Xmin: 1.0 and Ymin: 0.0065. Click
. Make sure the two right blocks are disconnected in the Mesh Info panel.
Select the center-right block (Block 2), click , and enter Xmax: 1.0. Click .
Make sure that block 2 is now connected to blocks 1, 5 and 6 in the Mesh Info panel.
To see boundaries, it may be useful to hide the pipe geometry. To do this
Click in the top left corner of the graphical view window
Uncheck Show objects
Creating Boundary Conditions: In this case, air enters from the top right, while subcooled liquid water enters from the bottom left. Top
left and bottom right boundaries are considered as outflows. Separator plate are considered as
adiabatic walls, like the pipe. Symmetries will be defined in Z-direction, not solved in this
problem.
Rename the Inflow BC to airinflow
Click to set the properties of the boundary condition
Set the following parameters in the Adaptive Time-Stepping window then click to save the
settings and close the window
CFLLimitsMin:0.5Max:1.0
Please note: The Level-Set model can only be used with unsteady simulations.
Equations In the Equation section of the window, the convergence threshold, as well as the convection scheme
and other parameters of the solvers used by TransAT are defined. These parameters can be modified for
each equation individually.
In the equation tree, click All Quantities. The parameters of all the highlighted equations
will be modified.
Modify the parameters besides the equation tree as follows
ConvergenceTolerance:1e-2
∙ In the equation tree, click Pressure. Set as follows
Solver:AMGR-cycle,adaptive
In the equation tree, click Level-set. Set as follows
Convectionscheme:Quick
The AMG (Algebraic Multigrid) preconditioner increases the speed of convergence, but may be unstable
in some cases.
Initial conditions It is necessary to initialise the simulation, in order to give the initial location of the different phases.
In the Initial Conditions tab, the initial conditions for the simulation are set. In this tutorial
advanced initial conditions are used.
The initial velocity can be defined in a C++ file initialconditions.cxx. A template of an initial
condition file can be found in the reference folder (Tutorials/countercurrent_flow in TransAT
folder).
Copy the initial conditions file to your project folder by executing the following command
in a terminal
Please note: : do not copy/paste the above line to the terminal, as PDF-format characters are not
understood by the terminal. Type the command directly in the terminal instead.
Select Advanced Initial Conditions
Click to compile the initial conditions. This step is optional and only checks that
the initialcondition.cxx file is written properly and can be compiled. The flow field will be
initialised later in the Execute window.
Output Management The parameters of the outputs of the simulation are set in the Output Management tab. In this
example, only the visualization output will be defined.
Click Output Management on the left-hand side of the TransATUI
Activate the following variables in the Output Variables window then click to save the
settings and close the window
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
Running TransAT The Number of processors to be used can be chosen by modifying the corresponding
field.
Click to initialise the flow field from the initialconditions.cxx file.
Click to start the simulation
6.2.9 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
Click on File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>...vtm for 3D visualization.
Click .
To visualize solid-fluid interface, select <projectname>...vtm in the tree. Click in the
toolbar (alternatively, select Filters - > Common - > Contour in the menu bar).
Use Contour by: EmbI (EmbI is the distance to the fluid-solid interface) and enter
Isosurface: 0
To visualize gas-liquid interface, select <projectname>...vtm in the tree. Click in the
toolbar (alternatively, select Filters - > Common - > Contour in the menu bar).
Use Contour by: PHI (Phi is the distance to the gas-liquid interface) and enter
Isosurface: 0
Choose variable T from the drop-down list, to show temperature. Make sure that the scale
is such that you can see variations.
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.
6.2.10 Results
Figure 6.12: Counter-current flow: Results
Chapter 7 Oil and Gas Applications
7.1 Separation of oil, gas and water
7.1.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
7.1.2 Introduction
This tutorial explains how to simulate an oil and gas separator. A mixture of oil, gas and water enters
on one side, and on the other side two pumps collect separated oil and water, with the gas leaving
through the top of the separator.
7.1.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
7.1.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say oilseparation, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as oilseparation then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute buttons at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
7.1.5 Geo Tab
In this tab, the necessary objects are added to the mesh.
Click Geo at the top of the TransATUI.
Objects Load the geometry file already prepared and located in the TransAT Object Database.
Select the Database tab.
Expand the Oil-Gas folder
Select reservoir.gts
then click to load the file to the mesh
In the Choose Units window that popped up, select m in the drop-down box
Activate the check-box Resize Mesh around Geometry to resize the domain
Click to create the reservoir and send it to the mesh
In this case the fluid region is enclosed in the geometry that was just loaded. Bearing in mind that in
TransAT, loaded objects are considered as solids by default, the fluid and solid domain need to be
inverted. To do so,
Un-check Set CAD as Solid below Object Properties
7.1.6 Mesh & BCs Tab
In the Mesh & BCs tab, the domain along with the mesh are defined.
If that is not already the case, select Mesh & BCs tab at the top of the TransATUI window
Domain & Grid
Click the Domain & Grid tab and set the following values for the domain boundaries in the
Domain section.
Grid refinements need be created to make sure that there are enough cells in the diameter of the
outflows.
Check Customized Refinement in the Refinement Type section
Select X-axis then click to create a new refinement zone
Enter the following parameters in the corresponding fields then click
Type:Point P1(X):1.55
Select Y-axis and click to set up refinements at the bottom pipe.
Enter the following parameters in the corresponding fields then click
Type:Point P1(Y):4.05
Figure 7.1: Customized refinement parameters
Blocks The domain must now be decomposed into several blocks, so that the simulation can run on several
processors. Indeed, each block is allocated to one processor (but a processor can handle several
blocks).
Select Blocks to define the multiblock option.
Click to cut the domain into several computational blocks.
Set the number of blocks for both X direction and Y direction to 2
Click
The domain will be automatically cut into blocks of equivalent sizes.
BCs Tab To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the
top of the BCs tab. One boundary condition of each type is available to be edited and used from the
start. Additional BCs can be created by clicking on . is used to assign a selected BC to a
highlighted surface.
Creating Boundary Conditions: In this test case, pumps extract water at the bottom of the domain and oil on the right-hand side of the
domain. These two fluid exits will be defined as Inflows. The inflow velocities will be defined such that
the fluids exit the domain.
Other than the inflows, symmetry boundary conditions will be defined for the Z min and Z max
surfaces. The remaining boundaries which comprises the fluid solid interface will automatically be
considered as walls. To create the Inflow boundary condition, follow the instructions given below
Select the BCs tab
Beginning from the Inflow BC available, click to set the properties of the boundary
condition
Fill in the inflow properties as follows:
In the Basic tab
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Constant
Inflow Velocity Components: u: 0.0 v: 0.0 w: 0.0
Note that we do not need to set mixture velocity since for N-phase ASM we set phase
velocities.
In Turbulence (RANS)
Turbulent intensity: 0.1
Mu_t/mu: 100.0
In N-phase algebraic slip model
Inflow volume fraction of phase 1: 0.44
Inflow volume fraction of phase 2: 0.39
Inflow volume fraction of phase 3: 0.17
Phase velocities: u=0.25 v= 0.0 w=0.0 for phases 1 to 3.
Click to save the settings and close the window
Change the name of the Outflow to Gasexit. Then edit the properties.
Additional Inflows are required, which can be created by clicking and changing
the type to Inflow in the drop-down. The name and other properties can be edited as
follows:
For the third phase, the default properties of water will be used.
To define the third phase, under Phase 3 choose Water Liquid in the Material Library
drop-down list.
Define the name as Water
Leave State of Phase as liquid
Figure 7.5: Phase Properties
Phases Interactions In the Phases Interactions tab, the interphase slip models will be defined between the
phases. Click on . The clift drag model will be used for all relations, without lift or wall
lubrication.
Select Miscibility in the Interphase Slip Relations drop-down choice.
Ensure water and oil are immiscible
Select Drag Model in the Interphase Slip Relations drop-down choice.
Select Clift for all relations in the drag table
Select Lift Model in the Interphase Slip Relations drop-down choice.
Select None for all relations in the lift table
Select Wall Lubrication Model in the Interphase Slip Relations drop-down choice.
Select None for all relations in the wall lubrication table
Figure 7.6: Lift Model Table
Simulation Parameters This tab is used to define the numerical parameters of the simulation.
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for an unsteady flow with an implicit method.
Set the following parameters in the Adaptive Time-Stepping window then click to save the
settings and close the window
CFLLimitsMin:0.5Max:1.0 DiffusionMin:1.0Max:2.0
Equations In this section the convergence threshold is defined, as well as the convection scheme and the solvers
used by TransAT.
Select All Quantities in the equation tree and set the convergence tolerance as follows
ConvergenceTolerance:1e-2
Figure 7.7: Simulation parameters
Initial conditions It is necessary to initialise the simulation, in order to give the initial location of the different phases.
In the Initial Conditions tab, the initial conditions for the simulation are set. In this tutorial
advanced initial conditions are used.
The initial velocity can be defined in a C++ file initialconditions.cxx. A template of an initial
condition file can be found in the reference folder (oil_separation in Tutorials).
Copy the initial conditions file to the project folder with the following command
Please note: : do not copy/paste the above line in the terminal, because PDF-format characters
will not be understood. Type the command directly in the terminal.
Select Advanced Initial Conditions
Click to compile the initial conditions. This step is optional and only checks that
the initialcondition.cxx file is written properly and can be compiled. The flow field will be
initialised later in the Execute window.
Output Management In this tab the parameters of the outputs of the simulation will be set. In this example, only the
visualization output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
This tab is where the simulation is started and controlled.
Running TransAT The number of processors with which the simulation will be run can be set by modifying Numberof Processors.
Click to initialise the flow field from the initialconditions.cxx file.
Click to start the simulation
7.1.9 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from the project folder using a terminal
>paraview&
Click File - > Open.
Navigate to the project folder.
Go to the RESULT folder and choose <projectname>...vtm for 3D visualization.
Click .
To only visualize the solid domain, select in the toolbar (alternatively, select Filters- > Common - > Clip in the toolbar).
Set the following parameters: Clip Type: Scalar Scalars: EmbI Value: 0 Check Inside Out. Click
Choose variable Density from the drop-down list.
Play the animation by hitting in the toolbar.
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.1.10 Results
Figure 7.8: Oil separation
7.2 Two-phase slug flow in TransAT–OLGA coupled simulation
7.2.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
OLGA (supported version is 7.2)
7.2.2 Introduction
Gas–liquid flow appears in various industrial processes, particularly in the petroleum industry, where
mixtures of gas with associated liquids (light and heavy components of oil, solid particles, hydrates,
condensate and/or water) are produced and transported together. Slug flow is a commonly observed
pattern in horizontal and upslope gas liquid flows. The regime is associated with large coherent
disturbances, owing to an intermittent appearance of aerated liquid masses that fill the pipe
cross-section and travel downstream.
In this tutorial, a stratified flow in a pipe is studied. Air and water fills the domain and the transition
from stratified to slug flow regime associated with the sudden growth of interfacial waves owing to the
Kelvin–Helmholtz instability has been studied. In (Lakehal et al., 2012) we have studied this problem
using a 2D simulation of a 8m long horizontal pipe. It has been shown that a slug frequency position
occurs approximately 5m downstream.
In this tutorial we will test the capability of the TransAT–OLGA coupling model. 2m of the upstream
pipe is simulated with a 2D TransAT domain connected to an OLGA domain simulating 100m pipe
downstream.
The problem setup is given as follows:
The 2D domain is 2.214m × 0.12m in the x - z plane, resolved with a mesh 124 × 22 ×
1. Inside the domain, an horizontal pipe is simulated, whose diameter is 8cm. Two inflows
are defined close to the upstream part of the pipe: air is flowing inside the domain from the
top, and water from the bottom of the pipe. A plate is placed in the middle of the pipe, as
shown in Fig.7.9.
In the initial conditions, the bottom half of the volume of the pipe is filled with water, and
the top half with air.
Figure 7.9: Sketch of the TransAT domain geometry.
7.2.3 Creating a Project Folder
Create a project folder (e.g. coupling_slugs) by executing the following in command in the
terminal
>mkdircoupling_slugs >cdcoupling_slugs
Then, since it is a TransAT–OLGA coupled simulation, a folder is needed where data can be
exchanged between the two simulators at the coupling boundary interface. Since you run TransAT on
Linux and OLGA necessarily on Windows, you have to create a shared memory folder such
that it is accessible from both the machines through the local network, i.e. create a samba
share on the Linux machine and map the shared location as network drive on the Windows
machine.
Please note: Ask your network administrator if you need help for this task.
Once this folder is created, create a subfolder (e.g. communication) in it.
>mkdircommunication
7.2.4 Launching TransATUI
Make sure that you are in the project folder (i.e. coupling_slugs) then execute the following
command to launch TransATUI.
>transatui.py&
7.2.5 Opening TransAT window
The first step in creating a new TransAT project is naming said project.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say coupling_slugs, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as coupling_slugs then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute buttons at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
7.2.6 Geo
In this tab, the necessary objects are added to the mesh.
Click Geo at the top of the TransATUI.
Objects Load the geometry file already prepared and located in the TransAT Object Database.
Select the Database tab.
Expand the Oil-Gas folder
Select olga_pipe.gts
then click to load the file to the mesh
In the Choose Units window that popped up, select m in the drop-down box
Activate the check-box Resize Mesh around Geometry to resize the domain
Click to create the pipe and send it to the mesh
The properites of the Immersed Surfaces will be adjusted, to do so
Click of Immersed Surfaces
Set the following parameters in the Immersed Surfaces window then click to save the settings
ThickenFactor:0 HembedSupport:1e-3
Note that Hembed Support limits the region where fluid variables are computed. In this case, it has been
reduced because the mesh is too coarse with respect to the solid objects when using the default
values.
In TransAT, loaded objects represent solids by default. In this project, the loaded object actually
represents an enclosed fluid domain. As a result, the Fluid-Solid domain needs to be inverted. To do
so,
Un-check Set CAD as Solid below Object Properties
Now the object properties must be defined.
Highlight geometry.gts with a simple click in the list of objects (dark grey area) then enter the
following properties
Proceed as in the last three steps to create two extra refinement zones. One for which
P1(X) is set to -0.01m and the other for which P1(X) is set to 0.0m
Blocks To allow parallel computation, the domain must be split into several blocks.
Click
Enter number of blocks in each direction as the following then click
Xdirection:4 Ydirection:1 Zdirection:1
BCs Tab
Select BCs tab.
Creating Boundary Conditions: In this case, an inflow should be assigned at Z min, another inflow at Z max, an OlgaCoupling at X
max, and Symmetry boundary conditions for other boundaries. Below is a step-by-step instruction, how
to create all the boundary conditions and to define their properties, starting with the water inflow
boundary condition.
Rename the Inflow to water_inflow
Click to set the properties of the boundary condition
Fill in the inflow properties as follows:
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow Profile: Laminar
Inflow Velocity Components: u: 0.0 v: 0.0 w: 0.0
Inflow Temperature: 300
Select the N-Phases Algebraic Slip Model tab on the left-hand side of the inflow properties
window, then set:
Inflow Volume Fraction of phase 3: 1.0
Phase 1 Velocity [m∕s]: u: 0.0, v: 0.0, w: 1.22
Phase 2 Velocity [m∕s]: u: 0.0, v: 0.0, w: 1.22
Phase 3 Velocity [m∕s]: u: 0.0, v: 0.0, w: 1.22
Click to save the settings and close the window
An additional air inflow boundary condition to be assigned to the Z max surface will be created:
Click
Rename newbc0 to air_inflow
Select Inflow in the drop-down box of the Type column
Click
Fill in the inflow properties as follows:
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow Profile: Laminar
Inflow Temperature: 300
Inflow Velocity components: u: 0.0 v: 0.0 w: 0.0
Select the N-Phases Algebraic Slip Model tab on the left-hand side of the inflow properties
window, then set:
Inflow Volume Fraction of phase 2: 1.0
Phase 1 Velocity [m∕s]: u: 0.0, v: 0.0, w: -9.28
Phase 2 Velocity [m∕s]: u: 0.0, v: 0.0, w: -9.28
Phase 3 Velocity [m∕s]: u: 0.0, v: 0.0, w: -9.28
Click to save the settings and close the window
Lastly, create the Coupling boundary condition:
Click
Rename newbc0 to coupling
Select Type OlgaCoupling in the dropdown box
Click
Fill in the inflow properties as follows:
1D-code filename: O2T.txt
TransAT filename: T2O.txt
1D-code Boundary tag: P-tag
1D-code Oil Source tag: O-tag
1D-code Gas Source tag: G-tag
1D-code Water Source tag: W-tag
Select Geometry on the left-hand side of the coupling configuration window.
Set the pipe diameter to 0.08m.
Select Coupling Scheme on the left-hand side of the coupling configuration window.
Set the coupling boundary control parameters as follows:
Pressure equation tolerance: 0.01
Outflow velocity tolerance: 0.01
Mass flux tolerance: 0.01
Assigning Boundary Conditions: To assign the water_inflow boundary condition the Z min surface
Select Z Min from the drop-down list at the top of the BCs tab
Highlight ZMin0 in the surface tree
Check the light grey square at the line corresponding to the water_inflow boundary condition
Click
ZMin 0 in the surface tree is colored with the color associated to the water_inflow boundary condition after
being assigned.
Proceed as above to assign the corresponding boundary conditions to the remaining surfaces using
the information given below
Note that three phases are defined because of the coupling with OLGA. Indeed, OLGA usually simulates
three-phase simulations with oil, gas and water. Since only air and water are present in the system, an
additional dummy phase (phase 1) was created.
Phases Interactions In the Phases Interactions tab, the interphase slip models will be defined between the
phases. Click on . The clift drag model will be used for all relations, without lift or wall
lubrication.
Select Drag Model in the Interphase Slip Relations drop-down choice.
Select Clift for all relations in the drag table
Select Lift Model in the Interphase Slip Relations drop-down choice.
Select None for all relations in the lift table
Select Wall Lubrication Model in the Interphase Slip Relations drop-down choice.
Select None for all relations in the wall lubrication table
Simulation Parameters The Simulation Parameters tab is used to define the numerical parameters of the
simulation.
Set the following parameters to solve for an unsteady flow
Equations Section In the Equations section, the convergence threshold is defined, as well as the convection scheme and
other parameters of the solvers used to run the simulation with TransAT.
Select Pressure in the Equations tree
Set the solver parameters given below to the following values
Set the Convergence Tolerance to the following value
ConvergenceTolerance:1e-2
Initial conditions In the Initial Conditions tab, the initial conditions for the simulation are set. In this tutorial
advanced initial conditions are used.
The initial velocity can be defined in a C++ file initialconditions.cxx. A template of an
initial condition file can be found in in the reference folder (Tutorials/coupling_slugs in
TransAT installation folder). For the simulation, a ready-made initial conditions file will be
used.
Copy the ready-made initial conditions file from the reference folder to the project folder
by executing the following command
Please note: : do not copy/paste the above line to the terminal, since PDF-format
are not understood by the terminal. Instead, type the command directly in the terminal.
To initialise the variables in the domain,
Select Advanced Initial Conditions
Click to compile the initial conditions. This step is optional and only checks that
the initialcondition.cxx file is written properly and can be compiled. The flow field will be
initialised later in the Execute window.
Output Management The Output Management tab is used to define the output of the simulation, in particular the
format of the visualization files, the variables to be output, as well as the frequency of generation of the
output.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
In the Post-Processing section, activate Non-Dimensional Numbers and Maximum Valuesof Variables if that is not already the case (the check-boxes appear in orange when
activated).
Click Files in the top left corner of the TransATUI, then select Prepare Simulation Files.
7.2.9 OLGA model setup
To set up the OLGA model
Click Start on the Windows machine where OLGA is run.
Right-click the OLGA 7.2 icon and select Run As Administrator
Note that administrator privileges are required to run OLGA in server mode, i.e. such that it can
communicate data at run-time.
In the OLGA window, select New, and Basic case in the Templates window.
Change the name of the case into ”slug.opi”, and set its path to the project folder, e.g. C:\
Users\ username\ Documents
Click Create
A basic case of OLGA is created.
Click the plus just besides the name slug, in the model view on the left-hand side of the
window
Right-click Case Definition then select Add serveroptions.
Open Case Definition and set the following parameters:
Right-click FLOWPATH: PIPELINE and select “Add >> Positions >> Position”
An instance Positions >> POSITION: POS-1 is created in the Model View tab.
On the Properties Menu of POSITION: POS-1 just opened on the right, select:
PIPE:PIPE-1 SECTION:1
Add another position, called POS-2, with the following setting:
PIPE:PIPE-1 SECTION:2
Lastly, add a third position with the following setting:
LABEL:P-tag PIPE:PIPE-1 SECTION:4
Do not forget to set the label to P-tag, as defined in the Coupling Boundary condition
tab.
Now, the inlet sources at the entrance of the OLGA pipe, which will receive inflow conditions from
TransAT simulation, will be defined.
Select Flow Component >> FLOWPATH: PIPELINE >> Boundary and Initial Conditions
>> SOURCE: SOURCE-1 in the Model View tab
Then, set the following properties:
GENERAL LABEL:G-tag TIME:0s TEMPERATURE:300K MASSFLOW:0.028kg/s SERVER EXPOSE:MASSFLOW,TEMPERATURE POSITION PIPE:- SECTION:-#REMOVEIFTHEREISANY,OTHERWISE YOUCANNOTSETTHENEXTVALUE POSITION:POS-2 PHASEDISTRIBUTION GASFRACTION:1 WATERFRACTION:- TOTALWATERFRACTION:0
Right-click “Boundary and Initial Conditions on the Model View tab”, then select ”Add
>> Massflow source”
Set the following properties for the Oil source (even though it will not be used for this test
case)
GENERAL LABEL:O-tag TIME:0s TEMPERATURE:300K MASSFLOW:0.0kg/s SERVER EXPOSE:MASSFLOW,TEMPERATURE POSITION SECTION:-#REMOVEIFTHEREISANY,OTHERWISEYOU CANNOTSETTHENEXTVALUE PIPE:- POSITION:POS-2 PHASEDISTRIBUTION GASFRACTION:0 WATERFRACTION:- TOTALWATERFRACTION:0
In the same way, add the third source, i.e. the Water source:
GENERAL LABEL:W-tag TIME:0s TEMPERATURE:300K MASSFLOW:3.07kg/s SERVER EXPOSE:MASSFLOW,TEMPERATURE POSITION PIPE:- SECTION:-#REMOVEIFTHEREISANY,OTHERWISE YOUCANNOTSETTHENEXTVALUE POSITION:POS-1 PHASEDISTRIBUTION GASFRACTION:0 WATERFRACTION:- TOTALWATERFRACTION:1
The Server Output Variables, i.e. the ones that will be communicated to TransAT, now need to be
added.
Right-click on Flow Component >> FLOWPATH: PIPELINE >> OUTPUT
Select “Add >> ServerData” and set the following properties on the tab on the right
GENERAL VARIABLE:GASMFR,OILMFR,WATMFR,PT,TM[K]#MAKESUREYOU SELECTKAS TEMPERATUREUNIT POSITION POSITION:POS-1,P-tag
Add another Serverdata, and set:
GENERAL VARIABLE:DPDGGS,DPDGLTHLS,DPDGLTWTS EQUIPMENT SOURCE:G-tag
The last setting is used for communicating the sensitivity of the pressure with respect to the mass
flux exchanged at the coupling interface. The purpose of this input is to avoid instabilities of the
coupling scheme.
Select “Add >> ProfileData” and set the following properties:
VARIABLE:GASMFR,OILMFR,TWATMFR,PT,TM
The Properties of the two nodes now need to be set.
Click ”Flow Component >> FLOWPATH: PIPELINE >> NODE: INLET”, and make sure
the node is of TYPE: CLOSED. It looks black with a white cross in the sketch.
Click on ”NODE: OUTLET” and set:
GENERAL TYPE:PRESSURE PRESSURECONDITIONS: TOTALWATERFRACTION:1 GASFRACTION:0.5 TEMPERATURE:300K PRESSURE:1bar FLUID:1
In the last section of the Model View tab, i.e. “Output”
Right-click it and select “Add >> Serverdata”.
Then, in the Properties of the serverdata created, set:
GENERAL: VARIABLE:HT,NINTGR,TIME DTPLOT:0s
Select “Output >> Profile”, and set:
DTPLOT:0.01s DTTIME:0s
Set the same for ”Output >> Trend”:
DTPLOT:0.01s TIME:0s
Now that the OLGA problem has been set up,
Press the F7 key (or click the green button at the top of the OLGA window) to verify the
setup
Then press the F4 button, or click the play button as shown in Fig. 7.2.9 to RUN BATCH.
Doing this, the simulation has not been started yet, but the OLGA server is now listening to possible
clients that will connect to it.
7.2.10 Run OLGA simulation
The TransAT–OLGA coupling communication is managed by a Python script called OLGA_client.py,
which must be executed on the machine where OLGA is run. This file is located in the TransAT
installation directory inside the folder transatMB/OLGA_CLIENT.
Thus, in order to be able to start the OLGA simulation a Python installation is required on the
Windows machine that runs OLGA (version 2.7.3, 32 bit compilation has been tested) together with
an additional package, which is called OpenOPC. This package can be downloaded from:
“http://sourceforge.net/projects/openopc/files/openopc/1.2.0/”.
To install OpenOPC,
Double-click “OpenOPC-1.2.0.win32-py2.7.exe”, and use the default installation settings.
Now, you should be able to connect the OLGA client to the OLGA server.
Copy all the files located inside the TransAT installation directory transatMB/OLGA_CLIENT
folder to the shared folder directory, so the Windows machine that runs OLGA can execute
them there.
On the machine where OLGA is run, click Start, and look for “cmd”.
Right-click the Command Prompt and select Run as Administrator otherwise the client will
not be able to connect to the OLGA server
Now, navigate into your shared folder directory (in the example given it has been called
“communication”). Make sure you have the following files in this directory: OLGA_client.py,
CouplingManager.py, CouplingBoundary.py, CouplingParams.py and OLGA_help_functions.py.
Execute the following command to start the OLGA simulation
pythonOLGA_client.py
Please note: Command line options for additional output are available in OLGA_client.py. The
possible options can be listed by adding “--help” after the script name with a blank space “ ” in
between.
7.2.11 Execute Tab
Now the TransAT simulation can be started.
Go back to the TransATUI window where the TransAT setup was defined
Click Execute at the top of the window
The Number of processors sets the number of processors on which the simulation will be
run.
Running TransAT
Click to initialise the flow field from the initialconditions.cxx file.
Click to start the simulation
7.2.12 Visualization of the results
The results of the TransAT simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from your project folder using a terminal
>paraview&
Click on File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>...vtm for 2D visualization.
Click .
Click +Y, for an horizontal visualization.
To visualize solid-fluid interface, select <projectname>...vtm in the tree. Click in the
toolbar (alternatively, select Filters - > Common - > Contour in the menu bar).
Use Contour by: EmbI (EmbI is the distance to the fluid-solid interface) and enter
Isosurface: 0.99e-3
Choose variable PhaseAlpha3 from the drop-down list, to visualize the Water mass
fraction.
Play the animation by hitting in the toolbar.
You can also have a look at the results of the OLGA simulation. Particularly, you can select the
“Profile Plot” on the main OLGA window, and then choose to plot GASMFR and TWATMFR, to look
at the profile distribution of the air and water mass fractions. Then, you can open a second profile
plot, selecting the pressure PT, and a third one, selecting the mass fluxes QG and QLTW.
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.
Finally, you can plot the trend of the variables at the coupling interface. In order to do this, you
must have gnuplot installed on the machine where you run TransAT or on the one where you run OLGA.
Then, navigate into your shared location folder, and copy there the folder “PLOT” from the reference
folder (coupling_slugs in Tutorials).
It will create several output “*.eps” files, showing the trend of the coupling variables at the interface.
7.2.13 Results
Figure 7.10: Slug of water crossing the coupling interface.
7.3 Oil spill
7.3.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
7.3.2 Introduction
In this tutorial, an oil spill in the deep sea is simulated, with the installation of a dome to try to contain
it. When hydrocarbons enter in contact with sea water, hydrates will form if the temperature is low
enough. Hydrates cause a very large increase of viscosity, which may cause a plug in the container, thus
creating leaks.
We consider that the spill consists in heavy oil and gas. Only gas will be able to form hydrates.
7.3.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
7.3.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say oilspill, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as oilspill then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
7.3.5 Geo
In this tab, the necessary objects are added to the mesh.
Click Geo at the top of the TransATUI.
Objects Load the geometry file already prepared and located in the TransAT Object Database.
Select the Database tab.
Expand the Oil-Gas folder
Select oil_spill.gts
then click to load the file to the mesh
In the Choose Units window that popped up, select m in the drop-down box
Activate the check-box Resize Mesh around Geometry to resize the domain
Click to create the object and send it to the mesh
The object properties and boundary conditions must now be defined.
In the object tree (dark grey area), select oil_spill.gts.
Enter the following values to set the properties of the objects.
Change the input of the Select Block field to 1 to select Block 1
Click
Enter the following parameters to subdivide Block 1 into several blocks then click
Xdirection:2 Ydirection:2 Zdirection:1
Figure 7.12: Block decomposition of the domain
BCs Tab
Select the BCs tab
Creating Boundary Conditions: In this test case, a wall is at Ymin, pressure outflows at Ymax, Xmin and Xmax. Symmetry boundary
conditions are applied at Zmin and Zmax (flow is not solved in z-direction). On top of this, we will add
an inflow boundary conditions between the two spill walls. The outflows at the top and on the
side are differentiated, because a pressure gradient is initialised on the sides but not at the
top.
From the Inflow BC, click to set the boundary condition properties
Fill in the inflow properties:
In the Basic tab
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: constant
Inflow Velocity components: u: 0.0 v: 6.0 w: 0.0
Inflow Static Temperature: 323K
In Turbulence (RANS) tab:
Turbulent intensity: 0.1
Mu_t/mu: 100.0
In N-phase algebraic slip model tab:
Inflow volume fraction of phase 1 (hydrates) : 0.0
Inflow volume fraction of phase 2 (water) : 0.0
Inflow volume fraction of phase 3 (heavy oil): 0.7
Inflow volume fraction of phase 4 (gas) : 0.3
Note that the velocities per phase are actually not used since ASM (Algebraic Slip
Model) is not used for this testcase. Only the inflow volume fractions have to be
defined, all phases have the same velocity which corresponds to the one given in
the “Basic” tab of the inflow.
Click
Proceed similarly as above to have the following boundary conditions available for use.
Please note: Make sure not to forget to specify the reference pressure and the hydrates model.
Reference pressure is added to the flow pressure, to calculate the hydrate dissociation temperature. A
reference pressure of 107Pa is akin to having the domain at around 1 km below sea level
Phase Properties In the Phase Properties tab, the physical properties of the different phases are defined.
Click to add a hydrocarbon then select Phase 4 in the hydrocarbon column
Click to save the settings and close the Hydrate Reaction Creator window
Figure 7.18: Phase interaction model
Figure 7.19: Reaction parameters
Simulation Parameters In the Simulation Parameters tab, the numerical parameters of the simulation are set (schemes,
relaxation, time-stepping,...).
Simulation Type and Control Parameters
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for an unsteady flow
Initial conditions It is necessary to initialise the simulation, in order to give the initial location of the different phases.
In the Initial Conditions tab, the initial conditions for the simulation are set. In this tutorial
advanced initial conditions are used.
The initial velocity can be defined in a C++ file initialconditions.cxx. A template of an initial
condition file can be found in the reference folder (oil_spill in Tutorials folder).
Copy the initial conditions file to the project folder by executing the following command
Please note: : do not copy/paste the above line in the terminal as PDF-format characters will
not be understood by the terminal. Instead, type the command directly into the terminal.
Select Advanced Initial Conditions
Click to compile the initial conditions. This step is optional and only checks that
the initialcondition.cxx file is written properly and can be compiled. The flow field will be
initialised later in the Execute window.
Output Management In the Output Management tab, the parameters of the outputs of the simulation are set. In this
example, only the visualization output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
Click to initialise the flow field from the initialconditions.cxx file.
Click to start the simulation.
7.3.9 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from the project folder using the terminal
>paraview&
Click on File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose <projectname>...vtm for 3D visualization.
Click on .
To visualize only the fluid domain, Select Filters - > Common - > Clip. Use: Clip Type: Scalar Scalars: EmbI Value: 0 Check Inside Out. Click OK
Choose variable PhaseAlpha1 (Hydrates) from the drop-down list. This shows the void
fraction distribution of hydrates in the simulated domain. Since hydrates are formed from
the gas that is spilled with the heavy oil, the hydrates region roughly coincides with the
regions of spilled oil and gas.
Play the animation by hitting in the toolbar.
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.10 Results
Figure 7.21: Oil spill: Distribution of hydrates void fraction after 5000 time steps
Figure 7.22: Oil spill: Distribution of hydrates void fraction after 10000 time steps
Chapter 8 Rigid Body Motion
8.1 Flow around a train entering a tunnel
8.1.1 Prerequisites
TransAT
TransATUI
Paraview (or Tecplot)
8.1.2 Introduction
A single-phase flow around a moving train is simulated here where the train is modelled by a
reduced-scale model and using TransAT Rigid Body Motion (RBM) capability. This tutorial is
beneficial in understanding the RBM functionalities provided with TransAT.
8.1.3 Launch TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
8.1.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say moving_train, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as moving_train then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
Geo is a module that can be used to create simple geometries for TransAT. The grid properties are
defined in Mesh & BCs tab whilst the physical and numerical parameters of the simulation are defined
in the Input tab. When the simulation is ready, the simulation will be started from the Execute
tab.
Some general operations such as saving and loading projects or exiting TransAT can be done by clicking
Files then selecting the corresponding option.
8.1.5 Geo Tab
The train will be modelled by a simle rectangular geometry for the simulation. To create this
object:
Click Geo at the top of the TransATUI.
Click Create Shape tab within the left panel
In the object selection drop-down list next to the button , choose Cube.
Note that Nx, Ny, Nz are the number of corner points in the x, y and z directions. The actual number of
cells in each direction is the number of corner points in the corresponding direction minus
one.
Blocks The domain must now be decomposed into several blocks, so that the simulation can run in parallel
(i.e. on several processors). Indeed, each block is allocated to one processor (but a processor can handle
several blocks).
Select Blocks to define the multiblock option.
Click to split the domain into several computational blocks.
Set the number of blocks for the X direction to 2 then click
A block modification will be used to create the tunnel section on the right side of the
domain:
Using the Select Blocks select block 2 and then click the button.
Enter 0.02m in the Y max field
Click
BCs Tab The boundary conditions will now be set. Pressure outflows will be used where an open surface is to
be considered, and Wall will be used to model the tunnel walls. Other surfaces will be set as Symmetry
boundaries.
Ensure the Outlow BC is available, and make sure its type is Outlow. Click to define its
parameters. In the General tab, define the following properties:
Outflow Type: Pressure
Outflow Data Source: From Boundary Conditions
Outflow Pressure: 0
Pressure Loss Coefficient: 0
In the backflow properties tab define the following properties:
Backflow turbulence intensity: 0.1
Backflow eddy viscosity ratio: 10
Click to save the settings and close the window.
Confirm that the Wall BC has a type of Wall.
Select the XMIN 0 surface in the surface list.
Check the Outflow boundary condition in the list of boundary conditions by clicking the light grey
square at the corresponding line. Then, click to apply the boundary condition to the XMIN 0
surface.
repeat the operation to assign the following boundary conditions as suggested below:
Assign XMAX 0 to Outflow
Assign XMAX 1 to Wall
Assign YMIN 0 to Symmetry
Assign YMAX 0 to Outflow
Assign YMAX 1 to Wall
Assign ZMIN 0 to Symmetry
Assign ZMAX 0 to Symmetry
Figure 8.1: Boundary conditions
The domain and boundary conditions are now set, save your project by clicking Files in the top left
corner and then clicking Save.
8.1.7 Input Tab
To set up the simulation parameters,
Click Input at the top of the TransATUI.
The different tabs to define the parameters of the simulation can now be selected.
Physical Models
Click Physical models on the left-hand side to define the equations to be solved for and
the models to be used in the simulation.
Phase Properties The Phase Properties tab is used to define the phases of the flow. Since the Multiphase Flow
Method is turned off, only the fluid properties of Phase 1 need to be defined. Here air properties can be
used:
Click Phase Properties on the left-hand side of the TransATUI
Select Phase 1 in the phase tree and select Air in the Material Library
Simulation Parameters This tab is used to define the numerical properties of the simulation.
Click Simulation Parameters on the left-hand side of the TransATUI
Simulation Type and Control Parameters
Set the following parameters to solve for an unsteady flow.
A low relaxation factor gives a more stable simulation, while the simulation converges faster with a high
value.
Equations In the Equations section the convergence threshold is defined as well as the convection scheme and
the solvers used by TransAT for each equation.
Select All Quantities in the equation tree and set the value of the Convergence Tolerance as
follows
ConvergenceTolerance:1.0e-2
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values for all the relevant
quantities will be set to 0 except the velocity component in the x-direction.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.001
Proceed as above to set the initial state of the remaining quantities as follows
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
8.1.8.1 Starting the simulation
Running TransAT As 2 blocks have been defined during the grid generation, up to 2 processors can be used to run the
simulation.
Set Number of Processors to 2
Start the simulation by clicking
8.1.9 Visualisation of the results
The results of the simulation can be seen with the help of the open-source visualisation tool, ParaView.
Launch ParaView as follows from the project folder using the terminal
>paraview&
Click on File - > Open.
Navigate to your project folder.
Navigate to the “RESULT” folder and choose the files xy-<projectname>.pvd for 2D
visualization in the x-y plane.
Click OK.
Choose the variable you want to visualize (e.g. P) from the drop-down list. (See Figure
6.5).
To visualize fluid-solid interface when using IST technique, click in the toolbar
(alternatively select Filters - > Common - > Contour in the menu bar). Use Contour by:EmbI and enter Isosurface: 0 to see your solid objects. Click .
With the Contour highlighted, choose Solid Color from the drop-down box.
Make the father object visible (xy-<projectname>.0000*) by clicking on the icon to
its left.
To visualise the results against time, go to the last frame by hitting the Play in the toolbar.
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
8.1.10 Results
Figure 8.3: Moving Train
Chapter 9 Advanced Post-processing
9.1 Water suction
9.1.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
9.1.2 Introduction
In this TransAT tutorial suction of water from a reservoir is simulated. The setup is shown in Figure 9.1
where water at the bottom of the reservoir is sucked out by two pumps.
Figure 9.1: Setup
This tutorial introduces two TransAT features:
Pump boundary condition
User-defined functions
Pump boundary conditions are used to suck out water and a user-defined function is used to compute the
mass of water in the domain over time.
9.1.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
9.1.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say watersuction, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as watersuction then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
9.1.5 Mesh & BCs Tab
The domain is defined and the mesh is created in the Mesh & BCs tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab located in the sub-window on the left-hand side.
In the Domain section, set the domain boundaries as follows
In this case the mesh is uniform: ratios between cells are set to 1.
Blocks The grid will now be split into 4 blocks so the simulation can run on up to 4 processors.
Please note: one processor can handle one or several blocks. Also note that an optimal load balance
has 1 block per processor with blocks of equal edge length (in terms of cells). For the current 2D setup,
this means splitting the domain in x- and y-direction.
Select Blocks to define the multi-block options
Click to cut the domain into several computational blocks
Set the number of blocks in both the X direction and the Y direction to 2.
Click
The domain is automatically cut into 4 blocks of equivalent number of cells.
Figure 9.2: Block decomposition
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case wall boundary conditions are applied at the X min, X max and Y min surfaces. A pressure
outflow is prescribed at the Y max surface and symmetry conditions are applied on the Z min and Z
max surfaces. Below, step-by-step instructions are given.
From the Outflow BC available, click to set the properties of the boundary condition
Set the following properties in the different tabs of the outflow properties window
Two sub-boundary conditions operating as pumps will now be created on the Y min and X max
surfaces. Pump boundary conditions may be defined by setting Inflow boundary conditions with a
velocity vector pointing outward. Please refer to the Inflow Boundary section in the TransAT UserManual for more information.
The pump boundary condition on the Y min surface will first be created.
Select Ymin in the drop-down list and highlight YMIN0 in the surface tree
Click to create a subBC. The button is visible next to the other buttons once YMIN 0
is selected.
Set X min to 0.2 and to X max to 0.3.
Click
Set the newly created boundary YMIN 0 1 to be an inflow. To do so
Click
Rename newbc0 to pump_ymin
Fill in the inflow properties - Tab: Basic
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Constant
Inflow Velocity components: u: 0.0 v: -0.1 w: 0.0
Tab: Turbulence (RANS)
Turbulent Intensity: 0.1
Mu_t/Mu: 100
Click to save the settings and close the window.
Assign the pump_ymin boundary condition to the YMIN 0 1 surface
Now the boundary condition on the X max surface will be created
Select Xmax in the drop-down list and highlight XMAX 0 in the surface tree
Click to create a subBC
Set Y min to 0.01 and to Y max to 0.11.
Click
Set the newly created boundary XMAX 0 1 to be an inflow. To do so
Click
Rename newbc0 to pump_xmax
Fill in the inflow properties - Tab: Basic
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Constant
Inflow Velocity components: u: 0.1 v: 0.0 w: 0.0
Tab: Turbulence (RANS)
Turbulent Intensity: 0.1
Mu_t/Mu: 100
Click to save the settings and close the window.
Assign the pump_xmax boundary condition to the XMAX 0 1 surface
The mesh is now ready.
Click Files then select Save to save the settings. Alternatively, press Ctrl+s.
Figure 9.3: Boundary conditions
9.1.6 Input Tab
To set up the simulation parameters, click Input at the top of the TransATUI.
The different tabs to define the parameters of the simulation can then be selected.
Physical Models
Select the Physical models tab
Select the following equations in the Basic Equations section
Activate Turbulence Modelling and set the model (drop-down list) to RANS
Activate Gravity and click to the right.
Set the following parameters in the Gravity window them click to save the settings
x:0.0 y:-9.81 z:0.0 EnableHydrostatic
Activate Phase Average and set the model (drop-down list) to Homogeneous
Figure 9.4: Physical models
Phase Properties The Phase Properties tab is used to define the phases of the flow. Phase properties can
be imported from the material library or defined by directly modifying the corresponding
fields.
Click Phase Properties on the left-hand side of TransATUI
To define the first phase, under Phase 1 choose Water Liquid in the Material Library
drop-down list.
Proceed similarly to set the fluid of Phase 2 as Air
Simulation Parameters This tab is used to define the numerical properties of the simulation.
Simulation Type and Control Parameters
Click Simulation Parameters on the left-hand side of the TransATUI
Set the following parameters to solve for an unsteady flow with an implicit method.
Equations In this section, the convergence threshold is defined, as well as the convection scheme and other
parameters of the solvers used by TransAT.
Select All Quantities in the equation tree
Set Convergence Tolerance to 1e-3
Figure 9.5: Simulation parameters
Initial Conditions In this tab initial conditions can be set. In this case, initial values of the velocity components will all
be set to 0m.s-1. The remainig quantities, namely pressure and phase volume fractions will be set up
using advanced initial conditions.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity and V-velocity in the quantity tree
Set Method to Constant and Value to 0.0
Advanced Initial Conditions It is necessary to initialise the simulation, in order to give the initial location of the different
phases and set the initial pressure distribution. In this simulation, the region defined by
y < yc is initially filled with water while the region defined by y ≥ yc is filled with air with
yc = 0.25m.
Pressure is initialised over the domain with the following equation to get a reference pressure 0 at the
interface between the two phases:
(9.1)
with ρ the density of the mixture (ρ = ρwater if y < yc and ρ = ρair if y ≥ yc) and g the component of
the gravity vector in the y-direction.
A ready-made initial condition file, initialconditions.cxx, can be found in the reference folder (9.1 -water_suction in the Tutorials folder).
Copy the initial conditions file to the project folder by executing the following command
Please note: : do not copy/paste the above line in the terminal as PDF-format characters will
not be understood by the terminal. Instead, type the command directly into the terminal.
Select Advanced Initial Conditions
Click to compile the initial conditions. This step is optional and only checks that
the initialcondition.cxx file is written properly and can be compiled. The flow field will be
initialised later in the Execute window.
User-defined function User-defined functions will be called to compute the bulk temperature along
with the Nusselt number and to generate output files with profiles of different variables. In this tutorial
ready-made user-defined function will be used to compute and output the physical quantities of
interest.
User-defined functions should be defined in the User Defined Functions window. In this tutorial the
ready-made user-defined function is available as a template. It can be opened by the following
steps:
Click to create a new UDF
Define a valid name in the first entry
Select
the template called mass_output, which is located under Entry_Point \ Every_Time_Step
type of template
Click to create the UDF
Click to view or edit the UDF
Finally, confirm that the UDF can be compiled by clicking . The output of compilation will be
shown in the text box in the bottom half of the window.
Once the simulation finishes running, the test_output.dat data file containing different profiles will be
generated.
The data from the data files can be loaded and plotted using softwares such as spreadsheet editor,
gnuplot or Python for instance or simply opened with a text editor. In Figure 9.16 the mass of
water in the domain is plotted over time. On that plot, one can see that the mass of water
decreases linearly over time due to the suction by the pumps. The results obtained with
TransAT match the expected analytical solution of mass over time (green line in Figure 9.6).
Figure 9.6: Mass of water in domain over time
Comments on the output generation
In this example, the MPI_Allreduce method was used to get the total mass of water in the domain.
Taking the usercompile folder located in <TransAT_Installation_folder>/transatMB as a basis, the
required modifications to get the mass over time are described below.
For the generation of this output, UDF files mass_output.h and mass_output.cxx files are required.
The MPI Allreduce method is used to sum the total mass of water in the domain over all
processors.
Overview of mass_output UDF The time and the mass of water in the domain at the different
time steps have been stored as vector attributes. For this purpose, the following lines were added in the
private attribute section of the mass_output class declaration:
Two functions are declared in the public section of the mass_output class declaration
update_time_mass: appends time and mass to Time and Mass vectors when called
write_time_mass: writes Time and Mass vectors to a file
Description of mass_output.cxx The two functions mentioned above are defined in
mass_output.cxx.
update_time_mass function The update_time_mass function can be split into 3 distinct
parts
Part 1: variable declarations
Part 2: access and processing of TransAT data
Part 3: data communication
Part 1 is the preamble where all the variables used in the function are declared. In Part 2, the TransAT data
required to get the time and compute the mass of water is accessed and processed. In Part 3, the data is
processed locally on each processor.
For update_time_mass to be functional, the inclusion of headers allowing access to parallel computing
function (mpi.h header file) and to the TransAT data (cppinterface.h header file) must be included in
mass_output.cxx
#include "cppinterface.h"
#include "mpi.h"
To compute the total mass of water in the domain, the mass of water in all the cells (product of volume
fraction of water, density and cell volume) are added up. A loop over the whole set of cells is used to do
so:
// Loop over blocks
for (int nb=0; nb < nblocks; nb++){
// Total number of cells in block
nijk = get_integer(nb,"nijk");
// Access to TransAT data arrays
set_pointer(nb, &kblk, "kblk" );
set_pointer(nb, &vol, "cellvolume" );
set_pointer(nb, &Hembed, "hembed" );
// Loop over cells
for (int ii=0; ii < nijk; ii++) {
properties_initialize(nb, ii);
// Get water density
rho_water = properties_get("density",0);
// Get water volume fraction
alpha_water = properties_get("alpha",0);
// Increment local mass
local_water_mass += rho_water*alpha_water*kblk[ii]*Hembed[ii]*vol[ii];
}
}
On each processor, the mass of water from the set of blocks assinged to it is stored in the
local_water_mass variable. local_water_mass is computed by adding the mass of water from each
cell.
For the compuation of local_water_mass, the multiplication by the internal cells marker, kblk, and the
fluid-solid marker, Hembed, is done to strictly restrict the sum to the set of internal fluid
cells.
The MPI_Allreduce method is called to get the total mass of water (stored in global_water_mass) by
summing the partial masses computed by each processor and using the MPI_SUM combination
operator
// Sum partial masses from all processors
MPI_Allreduce(&local_water_mass, &global_water_mass, 1, MPI_DOUBLE,
MPI_SUM, MPI_COMM_WORLD);
Further information regarding the MPI_Allreduce method can be found in the Parallel post-processing
section in the TransAT User Manual .
The time and the computed mass are then append to the Time and Mass vectors using the push_back
command
// Append data to vectors storing time and water mass
Time.push_back(t);
Mass.push_back(global_water_mass);
write_time_mass function The write_time_mass function makes use of the function
from the TransAT parallel toolbox. The mpi.h and toolbox.h must be included to make it
work.
It writes the data contained in the Time and Mass vectors alongside a header with the
column/variable mapping to a file, test_output.dat
// Set variable names for header
varnames.push_back("Time s");
varnames.push_back("Mass kg");
// Group data
std::vector<std::vector<double> > variables;
variables.push_back(Time);
variables.push_back(Mass);
// Write data to file
tmb::toolbox::writeDataVectorsToFile(std::string("test_output.dat"), varnames, variables);
Note that the above code excerpt is only executed on the root processor to avoid writing test_output.dat
multiple times.
operator()() function The Time and Mass vectors are updated at every time step by calling
update_time_mass in operator()(). The write_time_mass is also called in operator()() so that the file
storing mass over time is refreshed at every time step
void mass_output::operator()(){
// Update the Time and Mass vectors
update_time_mass();
// Write the mass of water over time to a file
write_time_mass();
}
Output Management In this tab the parameters of the simulation outputs are set. For this example, only the visualization
output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
This tab is where the simulation is started and controlled.
Click Execute at the top of the TransATUI
Running TransAT
Click to initialise the flow field from the initialconditions.cxx file.
Click to start the simulation.
9.1.8 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from your project folder using a terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-watersuction...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Choose variable PhaseAlpha1 from the drop-down list. See Figure 9.7 and Figure 9.8
which show the initial and final distributions of water volume fraction over the domain.
Clicking the rainbow button on the left shows the Legend. Clicking the double-arrow button
on its right rescales the color range to the data range.
To visualise the results at the end of the simulation, go to the last frame by hitting in
the toolbar.
To get a rough idea about visualisation of TransAT results with ParaView, please refer to the
TransAT Paraview Tutorial .
More detailed information can also be found in the Paraview Tutorial on the ParaView website.
Figure 9.7: Water volume fraction distribution at t = 0.0s
Figure 9.8: Water volume fraction distribution at t = 2.0s
9.2 Forced Convection in an Isothermal Pipe
9.2.1 Prerequisites
TransAT
TransATUI
Advanced Initial Conditions
Paraview (or Tecplot)
9.2.2 Introduction
In this TransAT tutorial heat transfer owing to forced convection in an isothermal pipe is
simulated. User-defined functions are used to compute and output the following quantities to
files:
Bulk temperature and Nusselt number along the streamwise direction
Velocity and temperature profile at the exit of the pipe along the crossflow direction
9.2.3 Launch TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
9.2.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say pipe, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as pipe then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
9.2.5 Mesh & BCs Tab
The domain is defined and the mesh is created using this tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab in the panel on the left-hand side
In the Domain section, set the domain boundaries as follows
To get higher resolutions in regions such as boundary layers, refinements zones can be created using the
Customized Refinement feature of TransAT. In this case, the grid is refined in the vicinity of the top wall
as follows:
Check Customized Refinement in the Refinement Type section
Select Y-axis then click to create a new refinement zone at the bottom of the channel.
Enter the following parameters in the corresponding fields then click
Type:Range P1(Y):0.05 P2(Y):0.1
Figure 9.9: Customized Refinement parameters
Blocks The grid will now be decomposed into 3 blocks, so that the simulation can be run on up to 3
processors.
Select Blocks to define the multi-block options
Click to cut the domain into several computational blocks
Set the number of blocks in the X direction to 3. Leave the number of the blocks in the
Y direction to 1
Click
The domain is automatically cut into 3 blocks of equivalent number of cells.
Figure 9.10: Block decomposition
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, an inflow is located at the X min surface, an outflow at the X max surface, a wall at the Y
max surface and symmetry boundary conditions at Y min, Z min and Z max surfaces. Below
is a set of step-by-step instructions to create an inflow boundary condition and define its
properties.
Beginning with the Inflow BC, click to set the properties of the boundary condition
Fill in the inflow properties - Tab: Basic
Inflow Data Source: From BC
Inflow Type: Velocity based
Inflow profile: Laminar
Inflow Velocity components: u: 0.01 v: 0.0 w: 0.0
Inflow Static Temperature: 300.0
Click to save the settings and close the window.
The inflow boundary condition has now been created.
Proceed similarly as above to set the remaining boundary conditions with the following properties
Equations Section In this tab the convergence threshold is defined, as well as the convection scheme and
other parameters of the solvers used by TransAT. Modify the convergence thresholds as
follows:
In the Equation tree highlight All Quantities and make sure that Normalised is checked. The check
box should be colored in orange
Set the Convergence Tolerance value as follows
ConvergenceTolerance:1.0e-5
∙ Select Temperature in the Equation tree
∙ Change the solver parameters to the following
Initial Conditions In this tab simple initial conditions can be set. In this case, the velocity components and the
temperature are initialised to the same values as the ones prescribed at the inflow over the whole
domain. Pressure is initialised to 0 Pa over the domain.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.01
Proceed as above to set the initial state of the remaining quantities as follows
V-Velocity Method:Constant Value:0 Temperature Method:Constant Value:300 Pressure Method:Constant Value:0
Figure 9.15: Initial Conditions tab
User-defined function User-defined functions will be called to compute the bulk temperature along
with the Nusselt number and to generate output files with profiles of different variables. In this tutorial
ready-made user-defined function will be used to compute and output the physical quantities of
interest.
User-defined functions should be defined in the User Defined Functions window. In this tutorial two
UDFs are created from templates. They can be opened by the following steps:
Click to create a new UDF
Define a valid name in the first entry
Select the template called streamwise_output, which is located under Entry_Point
\ Simulation_End type of template
Click to create the UDF
Click to view or edit the UDF
Repeat the above steps for the second UDF, called crossflow_output, which is located under
Entry_Point \ Simulation_End type of template
Finally, confirm that both of the UDFs can be compiled by clicking . The output of compilation
will be shown in the text box in the bottom half of the window.
Once the simulation finishes running, the crossflow_output.dat and streamwise_output.dat data files
containing different profiles will be generated.
The data from the data files can be loaded and plotted using softwares such as spreadsheet editor,
gnuplot or Python for instance or simply opened with a text editor. In Figure 9.16 the
Nusselt number is plotted along the streamwise direction in blue. One can see that the Nusselt
number becomes constant near the exit of the pipe. The value is consistent with the expected
analytical value of the Nusselt number which is equal to 3.66 (green line in Figure 9.16).
Figure 9.16: Nusselt number along streamswise direction
Comments on output generation in the crossflow direction
In this example, the line_output feature was used to get profiles in the crossflow direction near the exit
of the pipe. The crossflow_output UDF is described below.
Description of crossflow_output.h To use the line_output feature the required header is
imported in crossflow_output.h with the following line
#include "line_output.h"
The line_output class is documented in the Data output along a straight line section in the TransAT UserManual . For each line over which data is to be generated, a line_output object must be created. In this
case, the pointer to the line_output object is stored as an attribute of the crossflow_output object. To do
so, the following line was added in the private attribute section of the crossflow_output class
declaration:
line_output *output
Description of crossflow_output.cxx The properties of the line_output object are defined in
the crossflow_output constructor located in the crossflow_output.cxx file. The properties of the
line_output object consist of:
line direction
reference point
interpolation method
variables
In this case, the line is drawn along the y-direction going through x = 1.99m and z = 0.0005m.
The variables stored in the line_output object are the u-velocity component, the v-velocity
component and temperature. The definition of the line_output object properties is done in
the following code excerpt setting up the line_output in the constructor of the UserGlobal
class:
crossflow_output::crossflow_output(){
output = new line_output(LO_YDIR,1.99,0.0005,LO_BILINEAR);
output->add_variable("uvelocity");
output->add_variable("vvelocity");
output->add_variable("temperature");
}
The list of keywords to access variables is available in the List of accessible variables section in the
TransAT User Manual .
The data stored in the line_output object is written to a file - crossflow_output.dat - at the end
of the simulation by calling the write_file method in the User_processing_end function as
follows:
// Function executed at end of simulation
void crossflow_output::operator ()(){
// Write profiles in crossflow direction in crossflow_output.dat
output->write_file("crossflow_output.dat");
...
}
Comments on output generation in the streamwise direction
In this case, the output in the streamwise direction consist of the bulk temperature and Nussselt
number distribution. The line_output feature cannot be used as both the bulk temperature and
the Nusselt number must be computed. To do so, the streamwise_output function has been
created.
Theoretical basis of the streamwise_output function The streamwise_output function
proceeds to compute the bulk temperature and the Nusselt number then writes them to a
file.
The bulk temperature is obtained by computing the following integral in the cross-sections along the
pipe:
(9.2)
with Σ the cross-section and the Nusselt number definition reads:
(9.3)
with q′′ the heat flux through the pipe, R = 0.1m the radius of the pipe, λ the conductivity of air and
Tw the pipe temperature.
Given that the domain is axisymmetric and that air is modelled as an incompressible fluid, Eq. 9.2
simplifies as follows
(9.4)
with R = 0.1m the radius of the pipe.
streamwise_output.cxx function structure The streamwise_output function can be split
into 3 distinct parts
Part 1: header inclusions and variable declarations
Part 2: computation
Part 3: data gathering and writing
Part 1 is the preamble where all the classes and variables used in the function are imported and declared. In
Part 2, the bulk temperature and the Nusselt number are computed on each block on each processor. In
Part 3, the data from each processor is grouped and sorted on one processor then written to a
file.
Part 1: header inclusions and variable declarations The inclusion of headers allowing
access to parallel computing function (mpi.h header file), TransAT data (cppinterface.h header file) and
to the TransAT toolbox for parallel post-processing (toolbox.h header file) in the streamwise_output
function is necessary in this case
The parallel toolbox contains functions that allow gathering and sorting the data from all the processors
and writing it to a file. It takes pointers to vectors as arguments. Hence, the bulk temperature and the
Nusselt number are stored using the following pointers:
// Pointers to vectors storing data on each processor
std::vector <double>* x_local = new std::vector <double> ();
std::vector <double>* Nu_local = new std::vector <double> ();
std::vector <double>* Tbulk_local = new std::vector <double> ();
// Pointers to vectors storing gathered data
std::vector <double>* x_global;
std::vector <double>* Nu_global;
std::vector <double>* Tbulk_global;
More information can be found on the TransAT parallel toolbox in the Parallel Post-processing section of
the TransAT User Manual .
Part 2: computation The actual computation of the bulk temperature and the Nusselt
number is done in this part. For that, a loop over the wall cells and cross-sections of each block is used
as follows:
direction_top is set to ”ymax” the keyword of the getWallBoundaryNFaces function to get the number of
wall cells at the top boundary of the domain.
In the wall cells loop, the getWallBoundaryValue function is used to get the x-coordinate of the wall
cell/cross-section, the wall temperature and the heat flux through the pipe:
ncellsblock = getWallBoundaryNFaces(iblock, direction_top);
for (int icell = 0; icell < ncellsblock; icell++){
// Get x-coordinate
x = getWallBoundaryValue(iblock, icell, "x", direction_top);
...
// Get wall temperature
Twall = getWallBoundaryValue(iblock, icell, "temperature", direction_top);
...
// Get heat flux
heatflux = getWallBoundaryValue(iblock, icell, "q", direction_top);
}
while the conductivity is accessed through the properties module
// Get conductivity using TransAT’s properties module
properties_initialize(iblock,ii);
lambda = properties_get("lambda");
The following discretised form of Eq. 9.4 is used to get the bulk temperature:
(9.5)
with Ωi the set of cells in the ith cross-section and ii the corresponding cell index.
Given that all cells have the same dimension in the x- and z- directions, Eq. 9.5 is equivalent to the
following equation
(9.6)
with vol_ii the cell-volume. To integrate over the cross-section corresponding to a specific wall cell, the
getWallBoundaryCellIndex and the convert1DindexTo3D are used to get the indices of cells in the
cross-section.
First, the 1D-index of the wall cell in the block is accessed through the getWallBoundaryCellIndex then
it is converted into a 3D-index to get the indices of the cells in the cross-section
// Get wall cell 1D-index in block
iiWallCell = getWallBoundaryCellIndex(nb, icell, "direction_top");
// Get 3D-indexing of wall cell
convert1DindexTo3D(nb,iiWallCell,iBoundaryCell,jBoundaryCell,kBoundaryCell);
The cells belonging to the cross-section in block iblock have fixed coordinates in the first and third
directions. Their indices in the first and third directions are respectively equal to iBoundaryCell and
kBoundaryCell and their index in the second direction varies between 2 and nj - 4 which corresponds
the set of internal cells as shown in Figure 9.17. For more details, see the Cell-data access and filtering
section in the TransAT User Manual . Eq. 9.5 is then transcribed as follows in the streamwise_output function:
// Compute bulk temperature
// Initialise numerator and denominator for bulk temperature computation
Tnum = 0;
Tden = 0;
// Integrate along the crossflow direction over the internal cells to get
// the bulk temperature
for (int j = 2; j < nj-3; j++){
ii = iBoundaryCell + j*ni + kBoundaryCell*nij;
Tnum += kblk[ii]*T[ii]*u[ii]*cellvolume[ii];
Tden += kblk[ii]*u[ii]*cellvolume[ii];
}
Tb = Tnum/Tden;
The multiplication by internal cells marker kblk is used to strictly restrict the integrals to the set of
internal cells.
Part 3: data gathering and writing The data gathering and writing is done with the
TransAT parallel toolbox for which more detailed information can be found in the Parallel
Post-processing section of the TransAT User Manual . The data from each processor is first gathered using the following set of calls:
// Gather data from all processors on the root processor
x_global = tmb::toolbox::parallel_collectVector(x_local);
Nu_global = tmb::toolbox::parallel_collectVector(Nu_local);
Tbulk_global = tmb::toolbox::parallel_collectVector(Tbulk_local);
Next, the sorted accordingly to the x-coordinate on the root processor with the following
lines
if(glob_rank==0){
// Sort data by x-coordinate
std::vector<size_t> * indexSorted;
indexSorted = tmb::toolbox::indexMapFromSort (x_global);
std::vector<double>* x_globalSorted;
std::vector<double>* Nu_globalSorted;
std::vector<double>* Tbulk_globalSorted;
then the sorted data is grouped and is written alongside a header with the column/variable mapping to
a file, streamwise_output.dat
// Group data
std::vector<std::vector<double> > variables;
variables.push_back(*x_globalSorted);
variables.push_back(*Tbulk_globalSorted);
variables.push_back(*Nu_globalSorted);
// Set column names
std::vector<std::string> varnames;
varnames.push_back("x-coordinate");
varnames.push_back("bulk_temperature");
varnames.push_back("Nu");
// Write data to file
tmb::toolbox::writeDataVectorsToFile(std::string("streamwise_output.dat"),
varnames,variables);
Finally the pointers can be deleted once the data has been written to a file
This tab is where the simulation is started and controlled. The simulation will now be saved and the
necessary files (grid file, boundary conditions file, etc.) to run the simulation generated.
Click Files in the top left corner then select Save to save your settings.
Click Files then select Prepare Simulation Files to generate the necessary files to run a
simulation.
Running TransAT
Click to start the simulation.
9.2.8 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView.
Launch Paraview as follows from your project folder using the terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-pipe...vtm. Click OK.
Click in the Properties Panel, on the bottom left.
Choose variable T in the variable drop-down list. The temperature distribution along the
domain should be shown.
Clicking the rainbow button on the left-hand side shows the legend. Clicking the
double-arrow button on its right rescales the color range to the data range.
See Figure 9.18 for the steady state temperature profile contour.
To visualise the converged results, go to the last frame by hitting the in the toolbar.
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.
Figure 9.18: Temperature contour once steady state is reached
Chapter 10 TransAT Convergence Control module: SarP
10.1 Flow past a backward facing step
10.1.1 Prerequisites
TransAT
TransATUI
TransAT Python Environment
Paraview (or Tecplot)
10.1.2 Introduction
In this tutorial, a laminar flow past a backward facing step is studied. The step is modelled by means of
the Immersed Surface Technique (IST). This test case is a demonstration of the TransAT Smart
Adaptive Run Parametrisation (SarP) module. Solver and control parameters can be controlled and
automatically tuned, as demonstrated by Ghorbel et al. (2019). In this tutorial the simulation will be
run in both normal mode, i.e. without the activation of the SarP module, and SarP stability mode. For
this purpose two simulation setups will be created from a template TransAT project and
run.
10.1.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
10.1.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say backwardstep, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as backwardstep then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
10.1.5 Geo Tab
The next task consists in creating the geometry of the step. The geometry can be imported or directly
created using the utilities in Geo.
To create the geometry and load it into the domain
Click Geo at the top of the TransATUI.
Click Create Shape tab within the left panel
In the object selection drop-down list next to the button , choose Cube
Select Edges Refinement in the Refinement Type section
In this case, the cell ratios are set to 1.10 to have a refinements in the vicinity of the step.
Blocks The domain will now be decomposed into several blocks, so that the simulation can run in parallel
(i.e. on several processors). Indeed, each block is allocated to one processor (but a processor can handle
several blocks).
Select the Blocks tab
Click
Enter the number of blocks in the different directions as follows then click
Xdirection:2 Ydirection:2
The domain is automatically split into blocks of equivalent sizes.
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, an inflow is located on X min surface, an outflow on the X max surface, walls on the Y min
and Y max surfaces. Symmetry conditions are applied on the Z min and Z max surfaces. Below
step-by-step instructions are given to define the BCs.
Ensure the Inflow BC is set in the drop-down as type Inflow
Phase Properties The Phase Properties tab is used to define the phases of the flow. Phase properties can
be imported from the material library or defined by directly modifying the corresponding
fields.
Click Phase Properties on the left-hand side of the TransATUI
Select Air in the Material Library drop-down list to set the fluid as air
Phase1 Air
Figure 10.4: Phase properties
Simulation Parameters This tab is used to define the numerical properties of the simulation.
Simulation Type and Control Parameters
Click Simulation Parameters on the left-hand side of the TransATUI
Select Steady in the drop-down list of the Simulation Type section
Set the Number of Iterations field to 2000
Set the Autorelaxation field to 0.9
Select All Quantities in the equation tree located in the Equations section
Set Convergence Tolerance to 1e-06
Initial Conditions In this tab simple initial conditions are set. In this case the default initialisation method –
i.e. Automatic – which set pressure accordingly to the source terms and make the initial
velocity field divergence-free will be used. Therefore no settings should be changed in this
tab.
Output Management In this tab the parameters of the simulation outputs are set. For this example, only the visualization
output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
The template for the simulations is now ready. To save it
Click Files then select Save
10.1.8 Simulation in normal mode
10.1.8.1 Creating the project
Please note: It is important to save different projects in different folders, because results
will always be stored in a sub-folder called RESULT. The template will be used for several
grids.
Click Files then select Open Project. Alternatively, press Ctrl+o.
Select backwardstep.stt.
The Execute tab is automatically opened.
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
Set a name for the new directory, say nosarp.
Set a name to the project (backwardstep_nosarp.stt for instance) then click .
This setup deactivates the correction feature, causing SarP to run in pure monitoring mode. The
detected iterations or time steps with convergence issues are listed in the SarP tab of the
simulation information panel of the Execute tab. To deactivate the correction feature of
SarP:
Select Input at the top of the TransATUI then select Simulation Parameters on the
left-hand side of the TransATUI
Check SarP then set the mode to Stability (drop-down list)
Click to open the Advanced Parameters window of the SarP module
Uncheck Genetic Algorithm Correction/Optimisation, then click
10.1.8.2 Running the simulation
The simulation will now be run.
Click Execute at the top of the TransATUI
The number of processors on which the simulation will be run can be changed by modifying the value of the
Number of Processors field. Set it accordingly to your workstation specification. Note that it cannot
be greater than the number of blocks which is equal to 4 in this case.
Click to start the simulation
With these settings, the simulation should not converge within the specified number of iterations. The
simulation should stop after 2000 iterations.
To make non-converged simulations converge or make simulations converge faster, the numerical
parameters of the solvers in Simulation Parameters can be tuned. The setting of the numerical
parameters can be automatically done at runtime with the SarP module by means of an optimising
iterative process. The SarP module can detect the non-convergence of a simulation and modify the
numerical parameters of the simulation to make it converge.
A second simulation setup using the SarP module will now be created from the TransAT template
project that was created earlier.
10.1.9 Simulation in SarP stability mode
10.1.9.1 Creating the project
Please note: It is important to save different projects in different folders, because results
will always be stored in a sub-folder called RESULT. The template will be used for several
grids.
Click Files then select Open Project. Alternatively, press Ctrl+o.
Select backwardstep.stt.
The Execute tab is automatically opened.
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
Set a name for the new directory, say sarp.
Set a name to the project (backwardstep_sarp.stt for instance) then click .
The SarP module must now be activated.
Select Input at the top of the TransATUI then select Simulation Parameters on the
left-hand side of the TransATUI
Check SarP then set the mode to Stability (drop-down list)
Click
Set Configuration to Normal then click to close the Advanced Parameters window
and save the settings
To get more details on the SArP module’s options and settings, refer to the SArP Guide in the TransATUser Manual.
Figure 10.5: Simulation Parameters
10.1.9.2 Running the simulation
The simulation will now be run.
Click Execute at the top of the TransATUI
The number of processors on which the simulation will be run can be changed by modifying the value of the
Number of Processors field. Set it accordingly to your workstation specification. Note that it cannot
be greater than the number of blocks which is equal to 4 in this case.
Click to start the simulation
With these settings, an iterative process will be launched from the start of the simulation to optimise the
solver parameters.
Contrary to the original simulation, this simulation should end and reach the target residuals in less
than 2000 iterations due to the parameter correction operated by the SArP module.
Please note: clicking stops the optimisation process and restarts the simulation with the best
solution found by the process at that time i.e. the valid solution with the highest score. This can help in
reducing the duration of the optimisation process. Other methods that can reduce the computation time
of the SArP module are described in the Speeding up SArP section of the TransAT UserManual.
10.1.10 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from the project folder using a terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-backwardstep...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Select U in the variable the drop-down list to show the distribution of the streamwise
velocity component in the domain.
Clicking the rainbow button on the left shows the Legend. Clicking the double-arrow button
on its right rescales the color range to the data range.
See Figure 10.6 for the steady state result of the streamwise velocity component.
To visualise the converged results, go to the last frame by hitting in the toolbar.
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.
Figure 10.6: Streamwise velocity component contour along the step
10.2 Natural Convection in a Square Cavity at Ra = 106
10.2.1 Prerequisites
TransAT
TransATUI
TransAT Python Environment
Paraview (or Tecplot)
10.2.2 Introduction
In this tutorial, natural convection in a square cavity is studied at a Rayleigh number Ra = 106. This
test case is a demonstration of the TransAT Smart Adaptive Run Parametrisation (SarP) module. Solver
and control parameters can be controlled and automatically tuned, as demonstrated by Ghorbel
et al. (2019). In this tutorial the simulation will be run in both normal mode, i.e. without the activation
of the SarP module, and SarP optimisation mode. For this purpose two simulation setups will be
created from a template TransAT project and run.
10.2.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
10.2.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say naturalconvection, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as naturalconvection then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
10.2.5 Mesh & BCs Tab
The domain is defined and the mesh is created in the Mesh & BCs tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab located in the sub-window on the left-hand side.
In the Domain section, set the domain boundaries as follows
In this case, the mesh is uniform: ratios between cells are set to 1.
Blocks The domain will now be decomposed into several blocks, so that the simulation can run in parallel
with a maximum number of processors equal to the number of blocks.
Select the Blocks tab
Click
Enter the number of blocks in the different directions as follows then click
Xdirection:2 Ydirection:2
The domain is automatically split into blocks of equivalent sizes.
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional BCs can be created by clicking on . is used to assign a selected BC to a highlighted
surface.
Creating Boundary Conditions: In this case, a hot wall is located on X min surface, a cold wall on the X max surface and insulated walls
on the Y min and Y max surfaces. Symmetry conditions are applied on the Z min and Z max surfaces.
Below step-by-step instructions are given to create the hot wall boundary condition and define its
properties.
Rename the Wall BC to hot_wall
Click to set the properties of the boundary condition
Fill in the wall properties - Tab: Basic
Temperature / Heat Flux Choice: Temperature
Temperature / Heat Flux Value: 310.0
Click to save the settings and close the window
A second wall BC will be created by clicking , and naming it to cold_wall
Click to set the properties of the cold wall
This and the other BCs should have the following settings:
Set the following parameters in the Gravity window them click to save the settings
x:0.0 y:-8.707 z:0.0
Activate Reference Properties and click to the right.
Set the following parameters in the reference properties window then click to save the settings
ReferenceTemperature:300.0 ReferenceLength:0.1
Note that the reference properties are only for computing the non-dimensional numbers and does not affect
the simulations.
Figure 10.8: Physical models
Phase Properties The Phase Properties tab is used to define the phases of the flow. Phase properties can
be imported from the material library or defined by directly modifying the corresponding
fields.
Click Phase Properties on the left-hand side of the TransATUI
Set the following physical properties for Phase 1 as in Figure 10.9.
The template for the simulations is now ready. To save it
Click Files then select Save
10.2.7 Simulation in normal mode
10.2.7.1 Creating the project
Please note: It is important to save different projects in different folders, because results
will always be stored in a sub-folder called RESULT. The template will be used for several
grids.
Click Files then select Open Project. Alternatively, press Ctrl+o.
Select naturalconvection.stt.
The Execute tab is automatically opened.
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
Set a name for the new directory, say nosarp.
Set a name to the project (naturalconvection_nosarp.stt for instance) then click .
This setup is an exact copy the template project. No modification to the setup is required, the simulation
will be run as is.
10.2.7.2 Running the simulation
The simulation will now be run.
Click Execute at the top of the TransATUI
The number of processors on which the simulation will be run can be changed by modifying the value of the
Number of Processors field. Set it accordingly to your workstation specification. Note that it cannot
be greater than the number of blocks which is equal to 4 in this case.
Click to start the simulation
With these settings, the simulation should not converge within the specified number of iterations. The
simulation should stop after 2000 iterations.
To make non-converged simulations converge or make simulations converge faster, the numerical
parameters of the solvers in Simulation Parameters can be tuned. The setting of the numerical
parameters can be automatically done with the SarP module by means of an optimising iterative
process.
A second simulation setup using the SarP module will now be created from the TransAT template
project that was created earlier.
10.2.8 Simulation in SarP optimisation mode
10.2.8.1 Creating the project
Please note: It is important to save different projects in different folders, because results
will always be stored in a sub-folder called RESULT. The template will be used for several
grids.
Click Files then select Open Project. Alternatively, press Ctrl+o.
Select naturalconvection.stt.
The Execute tab is automatically opened.
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
Set a name for the new directory, say sarp.
Set a name to the project (naturalconvection_sarp.stt for instance) then click .
The SarP module must now be activated.
Select Input at the top of the TransATUI then select Simulation Parameters on the
left-hand side of the TransATUI
Check SarP then set the mode to Optimisation (drop-down list)
Click
Set Configuration to Normal then click to close the Advanced Parameters window
and save the settings
To get more details on the SArP module’s options and settings, refer to the SArP Guide in the TransATUser Manual.
Figure 10.10: Simulation Parameters
10.2.8.2 Running the simulation
The simulation will now be run.
Click Execute at the top of the TransATUI
The number of processors on which the simulation will be run can be changed by modifying the value of the
Number of Processors field. Set it accordingly to your workstation specification. Note that it cannot
be greater than the number of blocks which is equal to 4 in this case.
Click to start the simulation
With these settings, an iterative process will be launched from the start of the simulation to optimise the
solver parameters.
Contrary to the original simulation, this simulation should end and reach the target residuals in less
than 2000 iterations due to the parameter optimisation operated by the SArP module.
Please note: clicking stops the optimisation process and restarts the simulation with the best
solution found by the process at that time i.e. the valid solution with the highest score. This can help in
reducing the duration of the optimisation process. Other methods that can reduce the computation time
of the SArP module are described in the Speeding up SArP section of the TransAT UserManual.
10.2.9 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from the project folder using a terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-naturalconvection...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Select variable T from the variables drop-down list to show the temperature distribution in
the domain.
Clicking the rainbow button on the left shows the Legend. Clicking the double-arrow button
on its right rescales the color range to the data range.
See Figure 10.11 for the steady state result of the temperature profile.
To visualise the converged results, go to the last frame by hitting in the toolbar.
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.
Figure 10.11: Temperature distribution in the cavity
10.3 Droplet Impact on a Flat Plate
10.3.1 Prerequisites
TransAT
TransATUI
TransAT Python Environment
Paraview (or Tecplot)
10.3.2 Introduction
In this tutorial, the impact of a droplet on a flat plate is studied. This test case is a demonstration of
the TransAT Smart Adaptive Run Parametrisation (SarP) module. Solver and control parameters can be
controlled and automatically tuned, as demonstrated by Ghorbel et al. (2019). In this tutorial the
simulation will be run in both normal mode, i.e. without the activation of the SarP module, and SarP
optimisation mode. For this purpose two simulation setups will be created from a template TransAT
project and run.
10.3.3 Launching TransATUI
Execute the following commands to launch TransATUI
>transatui.py&
10.3.4 Opening TransAT window
The first step in creating a new TransAT project is naming said project and giving it a location.
Click to create a new project
In the next window, navigate to the folder where the project will be saved
To create a new project folder, click in the top right corner of the window
Enter a project folder name, say droplet_impact, then click to create the folder
Click to select the folder and close the browser
Set Project Name to a more explicit name such as droplet_impact then click
After clicking , the Mesh & BCs tab will be opened.
The Geo, Mesh & BCs, Input and Execute tabs at the top of the TransATUI window can now be
selected to open the modules to set up a simulation with TransAT.
10.3.5 Mesh & BCs Tab
The domain is defined and the mesh is created in the Mesh & BCs tab.
If that is not already the case, select the Mesh & BCs tab at the top of the TransATUI
window
Domain & Grid In this section the domain and the computational grid for the simulation will be defined.
Select the Domain & Grid tab located in the sub-window on the left-hand side.
In the Domain section, set the domain boundaries as follows
In this case, the mesh is uniform: ratios between cells are set to 1.
BCs Tab The boundary conditions must now be set for this case.
Select BCs tab.
To see the surfaces of all or each of the boundaries, choose a boundary in the drop-down list at the top of
the BCs tab. One boundary condition of each type is available to be edited and used from the start.
Additional boundary conditions can be created by clicking on . is used to assign a selected BC
to a highlighted surface.
Creating Boundary Conditions: In this case, a wall is located on X max surface and symmetry conditions are applied on the remaining
surfaces. Below step-by-step instructions are given to create the wall boundary condition and define its
properties.
From the Wall BC available, click to set the properties of the boundary condition
Select the Interface Tracking tab
Set Contact Angle to 118∘
Click to save the settings and close the window
Assigning Boundary Conditions:
Select boundary X Min from the drop-down list at the top of the BCs tab
By a simple click, highlight XMIN 0 in the surface tree
Tick (light grey square) symmetry in the boundary conditions table
Click
XMin 0 in the surface tree takes the color of the boundary condition after being assigned.
Follow the steps above to assign the remaining surfaces to their corresponding boundary
conditions.
Set the following parameters in the Gravity window them click to save the settings
x:9.81 y:0.0 z:0.0 EnableHydrostatic
In the Multiphase section activate Interface Tracking and set the model (drop-down list) to
Level-Set
Click
Uncheck Implicit Treatment of Surface Tension
Set Surface Tension to 0.728N/m then click to close the window
Activate Axisymmetry in the Additional Features section
Figure 10.13: Physical models
Phase Properties The Phase Properties tab is used to define the phases of the flow. Phase properties can
be imported from the material library or defined by directly modifying the corresponding
fields.
Click Phase Properties on the left-hand side of the TransATUI
Set the following physical properties for Phase 1 and Phase 2 as in Figure 10.14.
In the Equations section, select All Quantities in the equation tree
Set Convergence Tolerance to 1e-2
Initial Conditions In this tab simple initial conditions can be set. In this case, initial values of the velocity components
will be set along the pressure. The distance function of the Level-Set method will be set up later on in
the tutorial using user-defined initial conditions.
Select the Initial Conditions tab on the left-hand side of the TransAT user interface
Click U-Velocity in the quantity tree
Set Method to Constant and Value to 0.4
Proceed as above to set the initial state of the remaining quantities as follows
User-defined Initial Conditions In TransAT, the user has the possibility to create custom initial conditions. For two–phase flow
simulations especially, the initial gas–liquid interface topology has to be specified by the user. In this
case, this is achieved in TransAT using an XML file initialconditions.xml.
For this specific case, the only variables that are being initialized are simply the ones that are
solved for, i.e. velocity, pressure, and the Level-Set function which defines the topology of the gas–liquid
interface.
At the initial time step, pressure and velocity are set to constant values over the whole domain as
done in the Initial Conditions tab.
As for the two phases, they are initially confined in two distinct areas. The liquid is confined in a
circular area and that represents the droplet and the gas occupies the rest of the domain. The interface
between the two fluids is defined by the Level-Set function which is positive for one fluid and negative
for the other. To create the initial interface, a circular shape is defined in the Level-set node of
initialconditions.xml.
To be able to use custom initial conditions in this case, the file initialconditions.xml has to be placed
in the project folder. For this case, a ready-made initial conditions file available in the TransAT Tutorials
folder will be used to initialise variables over the domain. More information can be found on the
generation of custom initial conditions in the Custom Initial Conditions chapter of the TransAT UserManual .
Click Files in the top left corner then select Save to save the settings of the simulation
Execute the following command to copy the initial conditions file to your project directory.
Please note: : do not make a copy/paste from this document to the terminal, since characters from pdf
files will not be understood. Directly type the command into the terminal instead.
The simulation must now be re-loaded to take into account the initial conditions settings set in
initialconditions.xml.
Click Files in the top left corner then select Open Project
Select the project file of the simulation e.g. droplet_impact.stt.
The template for the simulations is now ready.
Output Management In this tab the parameters of the simulation outputs are set. For this example, only the visualization
output will be defined.
Click Output Management on the left-hand side of the TransATUI
Set the Output File Format and Frequency of output files from Iteration / timestepnumber as follows
Please note: It is important to save different projects in different folders, because results
will always be stored in a sub-folder called RESULT. The template will be used for several
grids.
Click Files then select Open Project. Alternatively, press Ctrl+o.
Select droplet_impact.stt.
The Execute tab is automatically opened.
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
Set a name for the new directory, say nosarp.
Set a name to the project (droplet_impact_nosarp.stt for instance) then click .
This setup is an exact copy the template project. No modification to the setup is required, the simulation
will be run as is.
10.3.7.2 Running the simulation
The simulation will now be run.
Click Execute at the top of the TransATUI
Click to start the simulation
With these settings, the simulation should take 3000 time-steps or more to reach the specified end time of
the simulation which has been set to 0.02s.
To make non-converged simulations converge or make simulations converge faster, the numerical
parameters of the solvers in Simulation Parameters can be tuned. The setting of the numerical
parameters can be automatically done with the SarP module by means of an optimising iterative
process.
A second simulation setup using the SarP module will now be created from the TransAT template
project that was created earlier.
10.3.8 Simulation in SarP optimisation mode
10.3.8.1 Creating the project
Please note: It is important to save different projects in different folders, to avoid overwriting results
since results are always stored in the RESULT sub-folder.
Click Files then select Open Project. Alternatively, press Ctrl+o.
Select droplet_impact.stt.
The Execute tab is automatically opened.
Click Files then select Save As. Alternatively, press Ctrl+Shift+s.
Click to select the folder where the project will be saved
Create a new directory by clicking the icon
Set a name for the new directory, say sarp.
Set a name to the project (droplet_impact_sarp.stt for instance) then click .
The SarP module must now be activated.
Select Input at the top of the TransATUI then select Simulation Parameters on the
left-hand side of the TransATUI
Check SarP then set the mode to Optimisation (drop-down list)
Click to open the Advanced Parameters window of the SarP module
Set the SarP parameters in the list below as follows:
To get more details on the SArP module’s options and settings, refer to the SArP Guide in the TransATUser Manual.
Please note: when running unsteady simulation with SArP, set Analysis Window Size to values as
low as 5 to accelerate the optimisation process.
Figure 10.15: Simulation Parameters
10.3.8.2 Running the simulation
The simulation will now be run.
Click Execute at the top of the TransATUI
Click to start the simulation
With these settings, an iterative process will be launched from the start of the simulation to optimise the
solver parameters.
Contrary to the original simulation, this simulation should end and reach the target physical
time in less than 3000 time steps due to the parameter optimisation operated by the SArP
module.
Please note: clicking stops the optimisation process and restarts the simulation with the best
solution found by the process at that time i.e. the valid solution with the highest score. This can help in
reducing the duration of the optimisation process. Other methods that can reduce the computation time
of the SArP module are described in the Speeding up SArP section of the TransAT UserManual.
10.3.9 Visualization of the results
The results of the simulation can be seen with the help of the Open-Source Visualisation Tool,
ParaView. Launch Paraview as follows from the project folder using a terminal
>paraview&
Click File - > Open.
Navigate to your project folder.
Go to the RESULT folder and choose xy-droplet_impact...vtm. Click OK
Click in the Properties Panel, on the bottom left.
Select variable DEN from the variables drop-down list to show the density distribution in
the domain.
Clicking the rainbow button on the left shows the Legend. Clicking the double-arrow button
on its right rescales the color range to the data range.
Play the animation by clicking the in the toolbar.
To visualise the results at the end of the simulation, go to the last frame by hitting in
the toolbar. The expected final density distribution is displayed in Figure 10.16.
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.
Figure 10.16: Density distribution at the end of the simulation (t = 0.02s)
Ghorbel, H., Zannini, N., Cherif, S., Sauser, F., Grunenwald, D., Droz, W.,Baradji, M. & Lakehal, D. 2019 Smart adaptive run parameterization (sarp): enhancement
of user manual selection of running parameters in fluid dynamic simulations using bio-inspired
and machine-learning techniques. Soft Computing .
Gibou, F., Chen, L., Nguyen, D. & Banerjee, S. 2007 A level set based sharp interface
method for the multiphase incompressible navier–stokes equations with phase change. Journalof Computational Physics 222 (2), 536–555.
Lakehal, D., Labois, M. & Narayanan, C. 2012 Advances in the large-eddy and interface
simulation (leis) of interfacial multiphase flows in pipes. Progress in Computational FluidDynamics 12, 153–163.
Steiner, A. 1971 On the reverse transition of a turbulent flow under the action of buoyancy
forces. Journal of Fluid Mechanics 47 (3), 503–512.
Theodoridis, G. S. & Rasoul, J. 2010 Three-dimensional numerical simulation of the
natural convection in an open tilted cubic cavity. In I. Conf. Applied Mechanics, Materials andManufacturing ICAMMM. Sultan Qaboos University, Oman.