SVG-Viewer needed.

SVG-Viewer needed.

SVG-Viewer needed.

Overview

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.

Tutorial Manual


Contents

1 Starting with TransAT
 1.1 Turbulent Channel Flow
  1.1.1 Prerequisites
  1.1.2 Problem Description
  1.1.3 Problem Setup
  1.1.4 Launching TransATUI
  1.1.5 Opening TransAT window
  1.1.6 Mesh & BCs Tab
  1.1.7 Input Tab
  1.1.8 Execute Tab
   1.1.8.1 Starting the simulation
  1.1.9 Viewing Results in Paraview
   1.1.9.1 Plotting Velocity Vectors
  1.1.10 Results
 1.2 Flow over a Backward Facing Step
  1.2.1 Prerequisites
  1.2.2 Introduction
  1.2.3 Launch TransATUI
  1.2.4 Opening TransAT window
  1.2.5 Mesh & BCs Tab
  1.2.6 Input Tab
  1.2.7 Execute Tab
   1.2.7.1 Starting the simulation
  1.2.8 Visualization of the results
  1.2.9 Results
 1.3 Flow over a Cylinder (Re=20)
  1.3.1 Prerequisites
  1.3.2 Introduction
  1.3.3 Launch TransATUI
  1.3.4 Opening TransAT window
  1.3.5 Geo Tab
  1.3.6 Mesh & BCs Tab
  1.3.7 Input Tab
  1.3.8 Execute Tab
   1.3.8.1 Starting the simulation
  1.3.9 Visualisation of the results
  1.3.10 Results
2 Incompressible Single Phase Flows
 2.1 Block Mesh Refinement: Flow over Cylinder (Re=150)
  2.1.1 Prerequisites
  2.1.2 Introduction
  2.1.3 Creating a template project
   2.1.3.1 Launch TransATUI
  2.1.4 Opening TransAT window
  2.1.5 Geo Tab
   2.1.5.1 Mesh & BCs Tab
   2.1.5.2 Input Tab
   2.1.5.3 Saving the project
  2.1.6 Cylinder flow using a body fitted grid
   2.1.6.1 Creating the project
   2.1.6.2 Mesh & BCs Tab
   2.1.6.3 Execute Tab
   2.1.6.4 Visualisation of the results
  2.1.7 Cylinder flow using a Block Mesh Refinement (BMR) grid with Immersed Surface Technique (IST)
   2.1.7.1 Creating TransAT project
   2.1.7.2 Mesh & BCs Tab
   2.1.7.3 Execute Tab
   2.1.7.4 Starting the simulation
   2.1.7.5 Visualisation of the results
  2.1.8 Results
 2.2 Flow over Buildings
  2.2.1 Prerequisites
  2.2.2 Problem
  2.2.3 Launching TransATUI
  2.2.4 Opening TransAT window
   2.2.4.1 Geo Tab
   2.2.4.2 Mesh & BCs Tab
   2.2.4.3 Input Tab
   2.2.4.4 Execute
   2.2.4.5 Running TransAT
  2.2.5 Visualisation of the results
 2.3 Flow in an obstructed pipe
  2.3.1 Prerequisites
  2.3.2 Problem Description
  2.3.3 Problem Setup
  2.3.4 Launch TransATUI
  2.3.5 Opening TransAT window
  2.3.6 Geo Tab
  2.3.7 Mesh & BCs Tab
  2.3.8 Input Tab
  2.3.9 Execute Tab
   2.3.9.1 Starting the simulation
  2.3.10 Viewing Results in Paraview
  2.3.11 Results
3 Heat Transfer
 3.1 Forced Convection in a Channel with Heated Walls
  3.1.1 Prerequisites
  3.1.2 Introduction
  3.1.3 Launching TransATUI
  3.1.4 Opening TransAT window
  3.1.5 Mesh & BCs Tab
  3.1.6 Input Tab
  3.1.7 Execute Tab
   3.1.7.1 Starting the Simulation
  3.1.8 Visualization of the results
 3.2 Natural Convection in a Closed Cavity
  3.2.1 Prerequisites
  3.2.2 Introduction
  3.2.3 Launch TransATUI
  3.2.4 Opening TransAT window
  3.2.5 Mesh & BCs Tab
  3.2.6 Input Tab
  3.2.7 Execute Tab
   3.2.7.1 Starting the simulation
  3.2.8 Visualization of the results
 3.3 Turbulent Heat Flux Modelling
  3.3.1 Prerequisites
  3.3.2 Introduction
  3.3.3 Launch TransATUI
  3.3.4 Opening TransAT window
  3.3.5 Mesh & BCs Tab
  3.3.6 Input Tab
  3.3.7 Execute Tab
  3.3.8 Visualization of the results
4 Multiphase Flows
 4.1 Dam Break
  4.1.1 Prerequisites
  4.1.2 Launching TransATUI
  4.1.3 Opening TransAT window
  4.1.4 Mesh & BCs Tab
   4.1.4.1 Domain & Grid tab
   4.1.4.2 Blocks
   4.1.4.3 BCs Tab
  4.1.5 Input Tab
   4.1.5.1 Physical Models Tab
   4.1.5.2 Phase Properties Tab
   4.1.5.3 Simulation Type and Control Parameters
   4.1.5.4 Equations
   4.1.5.5 Initial Conditions
   4.1.5.6 Output Management Tab
  4.1.6 Execute Tab
   4.1.6.1 Running TransAT
  4.1.7 Visualisation of the results
   4.1.7.1 Result files
   4.1.7.2 Viewing Results in Paraview
 4.2 Sloshing
  4.2.1 Prerequisites
  4.2.2 Launching TransATUI
  4.2.3 Opening TransAT window
  4.2.4 Mesh & BCs Tab
   4.2.4.1 Domain & Grid
   4.2.4.2 Blocks
   4.2.4.3 BCs Tab
  4.2.5 Input Tab
   4.2.5.1 Physical Models Tab
   4.2.5.2 Phase Properties Tab
   4.2.5.3 Simulation Parameters Tab
   4.2.5.4 Equations Section
   4.2.5.5 Initial Conditions
   4.2.5.6 Output Management Tab
  4.2.6 Execute Tab
   4.2.6.1 Running TransAT
  4.2.7 Visualisation of the results
   4.2.7.1 Result files
   4.2.7.2 Viewing Results in Paraview
 4.3 Bubbles Merging
  4.3.1 Prerequisites
  4.3.2 Introduction
  4.3.3 Launching TransATUI
  4.3.4 Opening TransAT window
  4.3.5 Mesh & BCs Tab
  4.3.6 Input Tab
  4.3.7 Execute Tab
  4.3.8 Visualisation of the results
  4.3.9 Results
 4.4 Film Boiling
  4.4.1 Prerequisites
  4.4.2 Introduction
  4.4.3 Launching TransATUI
  4.4.4 Opening TransAT window
  4.4.5 Mesh & BCs Tab
  4.4.6 Input Tab
  4.4.7 Execute Tab
  4.4.8 Visualisation of the results
  4.4.9 Results
 4.5 Spillway
  4.5.1 Prerequisites
  4.5.2 Run time
  4.5.3 Introduction
  4.5.4 Launching TransATUI
  4.5.5 Opening TransAT window
  4.5.6 Geo
  4.5.7 Mesh & BCs Tab
  4.5.8 Input Tab
  4.5.9 Execute Tab
  4.5.10 Visualization of the results
  4.5.11 Results
5 Particle Tracking
 5.1 Particles in Crossflow
  5.1.1 Prerequisites
  5.1.2 Launch TransATUI
  5.1.3 Opening TransAT window
  5.1.4 Mesh & BCs Tab
  5.1.5 Input Tab
  5.1.6 Execute Tab
   5.1.6.1 Starting the simulation
  5.1.7 Results
 5.2 Particle Separator
  5.2.1 Prerequisites
  5.2.2 Introduction
  5.2.3 Launching TransATUI
  5.2.4 Opening TransAT window
  5.2.5 Geo Tab
  5.2.6 Mesh & BCs Tab
  5.2.7 Input Tab
  5.2.8 Execute Tab
  5.2.9 Visualization of the results
 5.3 Transport of particles in a pipe
  5.3.1 Prerequisites
  5.3.2 Problem Description
  5.3.3 Problem Setup
  5.3.4 Launching TransATUI
  5.3.5 Opening TransAT window
  5.3.6 Geo Tab
  5.3.7 Mesh & BCs Tab
  5.3.8 Input Tab
  5.3.9 Execute Tab
   5.3.9.1 Starting the simulation
  5.3.10 Viewing Results in Paraview
  5.3.11 Results
6 Thermal-Hydraulics Applications
 6.1 Wall Boiling
  6.1.1 Prerequisites
  6.1.2 Introduction
  6.1.3 Launching TransATUI
  6.1.4 Opening TransAT window
  6.1.5 Mesh & BCs Tab
  6.1.6 Input Tab
  6.1.7 Execute Tab
   6.1.7.1 Starting the simulation
  6.1.8 Visualization of the results
  6.1.9 Results
 6.2 Counter current flow in a pipe
  6.2.1 Prerequisites
  6.2.2 Introduction
  6.2.3 Launching TransATUI
  6.2.4 Opening TransAT window
  6.2.5 Geo Tab
  6.2.6 Mesh & BCs Tab
  6.2.7 Input Tab
  6.2.8 Execute Tab
  6.2.9 Visualization of the results
  6.2.10 Results
7 Oil and Gas Applications
 7.1 Separation of oil, gas and water
  7.1.1 Prerequisites
  7.1.2 Introduction
  7.1.3 Launching TransATUI
  7.1.4 Opening TransAT window
  7.1.5 Geo Tab
  7.1.6 Mesh & BCs Tab
  7.1.7 Input Tab
  7.1.8 Execute Tab
  7.1.9 Visualization of the results
  7.1.10 Results
 7.2 Two-phase slug flow in TransAT–OLGA coupled simulation
  7.2.1 Prerequisites
  7.2.2 Introduction
  7.2.3 Creating a Project Folder
  7.2.4 Launching TransATUI
  7.2.5 Opening TransAT window
  7.2.6 Geo
  7.2.7 Mesh & BCs Tab
  7.2.8 Input Tab
  7.2.9 OLGA model setup
  7.2.10 Run OLGA simulation
  7.2.11 Execute Tab
  7.2.12 Visualization of the results
  7.2.13 Results
 7.3 Oil spill
  7.3.1 Prerequisites
  7.3.2 Introduction
  7.3.3 Launching TransATUI
  7.3.4 Opening TransAT window
  7.3.5 Geo
  7.3.6 Mesh & BCs Tab
  7.3.7 Input Tab
  7.3.8 Execute Tab
  7.3.9 Visualization of the results
  7.3.10 Results
8 Rigid Body Motion
 8.1 Flow around a train entering a tunnel
  8.1.1 Prerequisites
  8.1.2 Introduction
  8.1.3 Launch TransATUI
  8.1.4 Opening TransAT window
  8.1.5 Geo Tab
  8.1.6 Mesh & BCs Tab
  8.1.7 Input Tab
  8.1.8 Execute Tab
   8.1.8.1 Starting the simulation
  8.1.9 Visualisation of the results
  8.1.10 Results
9 Advanced Post-processing
 9.1 Water suction
  9.1.1 Prerequisites
  9.1.2 Introduction
  9.1.3 Launching TransATUI
  9.1.4 Opening TransAT window
  9.1.5 Mesh & BCs Tab
  9.1.6 Input Tab
  9.1.7 Execute Tab
  9.1.8 Visualization of the results
 9.2 Forced Convection in an Isothermal Pipe
  9.2.1 Prerequisites
  9.2.2 Introduction
  9.2.3 Launch TransATUI
  9.2.4 Opening TransAT window
  9.2.5 Mesh & BCs Tab
  9.2.6 Input Tab
  9.2.7 Execute Tab
  9.2.8 Visualization of the results
10 TransAT Convergence Control module: SarP
 10.1 Flow past a backward facing step
  10.1.1 Prerequisites
  10.1.2 Introduction
  10.1.3 Launching TransATUI
  10.1.4 Opening TransAT window
  10.1.5 Geo Tab
  10.1.6 Mesh & BCs Tab
  10.1.7 Input Tab
   10.1.7.1 Saving the project
  10.1.8 Simulation in normal mode
   10.1.8.1 Creating the project
   10.1.8.2 Running the simulation
  10.1.9 Simulation in SarP stability mode
   10.1.9.1 Creating the project
   10.1.9.2 Running the simulation
  10.1.10 Visualization of the results
 10.2 Natural Convection in a Square Cavity at Ra = 106
  10.2.1 Prerequisites
  10.2.2 Introduction
  10.2.3 Launching TransATUI
  10.2.4 Opening TransAT window
  10.2.5 Mesh & BCs Tab
  10.2.6 Input Tab
   10.2.6.1 Saving the project
  10.2.7 Simulation in normal mode
   10.2.7.1 Creating the project
   10.2.7.2 Running the simulation
  10.2.8 Simulation in SarP optimisation mode
   10.2.8.1 Creating the project
   10.2.8.2 Running the simulation
  10.2.9 Visualization of the results
 10.3 Droplet Impact on a Flat Plate
  10.3.1 Prerequisites
  10.3.2 Introduction
  10.3.3 Launching TransATUI
  10.3.4 Opening TransAT window
  10.3.5 Mesh & BCs Tab
  10.3.6 Input Tab
  10.3.7 Simulation in normal mode
   10.3.7.1 Creating the project
   10.3.7.2 Running the simulation
  10.3.8 Simulation in SarP optimisation mode
   10.3.8.1 Creating the project
   10.3.8.2 Running the simulation
  10.3.9 Visualization of the results
List of Figures
References

Chapter 1
Starting with TransAT

1.1 Turbulent Channel Flow

1.1.1 Prerequisites

1.1.2 Problem Description

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.

1.1.4 Launching TransATUI

> 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.

After clicking PIC, 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.

Domain & Grid Tab
  In this section the domain and the computational grid for the simulation will be defined.

Ratios are set to 1.0 to create a uniform mesh.

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).

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.

Now conditions for each of the boundaries should be set.

To assign the Inflow boundary condition to the XMIN 0 surface

The final setup should be similar to Figure 1.1


PIC

Figure 1.1: Boundaries Final Setup


1.1.7 Input Tab

To set up the simulation parameters

Physical Models Tab
  In this tab, the models that will be used during the simulation will be defined.


PIC

Figure 1.2: Physical models


Phase Properties Tab
  To set the fluid properties, 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.   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.


PIC

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. Output Management Tab
  In this tab the parameters of the outputs of the simulation are defined.

1.1.8 Execute Tab

This tab is where the simulation is started and controlled.

1.1.8.1 Starting 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.

> paraview &


PIC

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.


PIC

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


PIC

Figure 1.6: Temperature contours: channel flow


1.2 Flow over a Backward Facing Step

1.2.1 Prerequisites

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:

1.2.3 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.

After clicking PIC, 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.

Domain & Grid Tab
  In this section the domain and the computational grid for the simulation will be defined.

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 

To create a step, the domain has to be split into 4 blocks which can be adjusted to a required dimension.

A block can be selected with the Select Block field by choosing the appropriate block number.

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

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 PIC. PIC 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.

Assigning Boundary Conditions:

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).

Since undefined boundaries are by default set to symmetry, boundary conditions for the ZMin and ZMax boundaries do not have to be defined.

The mesh is now ready.

1.2.6 Input Tab

To set up the simulation parameters,

Physical Models
  In this tab, the equations that will be solved for during the simulation are chosen. Phase Properties 

Since the Multiphase Flow Modelling is turned off, only the Phase 1 fluid properties need to be set up.

Simulation Parameters
  This tab is used to define the numerical properties of the simulation.
Simulation Type: Steady 
Number of Iterations: 800 
 
ENABLE Autorelaxation 
           Relaxation Factor: 0.90

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.

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. Output Management
  The parameters of the simulation outputs are defined in the Output Management tab.

1.2.7 Execute Tab

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.

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.

> paraview &


PIC

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.


PIC

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.

1.2.9 Results


PIC

Figure 1.9: Velocity vectors: backward facing step flow


1.3 Flow over a Cylinder (Re=20)

1.3.1 Prerequisites

1.3.2 Introduction

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

1.3.3 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.

After clicking PIC, 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

The cylinder needs to be rotated and translated.

You will need to update the mesh, as the cylinder will have moved out of its bounds. To do so

1.3.6 Mesh & BCs Tab

In the Mesh & BCs tab, the domain along with the mesh are defined.

Domain & Grid Tab
  In this section the domain and the computational grid for the simulation will be defined.

You can click PIC at the bottom of the graphical window to display the domain in the XY plane.

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).

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.


PIC

Figure 1.10: Boundary conditions


1.3.7 Input Tab

To set up the simulation parameters,

The different tabs to define the parameters of the simulation can now be selected. Physical Models
 


PIC

Figure 1.11: Physical models


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.


PIC

Figure 1.12: Phase properties


Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
 

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.

There is no need to have a strict threshold for pressure because it must comply with the overall criterion to finish the simulation.


PIC

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.

Output Management
  The parameters for the outputs of the simulation are defined in the Output Management tab.

1.3.8 Execute Tab

This tab is where the simulation is started and controlled.

1.3.8.1 Starting the simulation
Running TransAT
 

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 &

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.3.10 Results


PIC

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

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
> 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.

After clicking PIC, 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

The cylinder needs to be rotated and translated.

You will need to update the mesh, as the cylinder will have moved out of its bounds. To do so

2.1.5.1 Mesh & BCs Tab

In the Mesh & BCs tab, the domain along with the mesh are defined.

Domain & Grid 

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.

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,


PIC

Figure 2.1: Boundary conditions


2.1.5.2 Input Tab
Physical Models
  Phase Properties
  In the Phase Properties tab the phases of the flow are defined.


PIC

Figure 2.2: Phase Properties


Simulation Parameters
  The Simulation Parameters tab is used to define the numerical parameters of the simulation.

Equations
  In this section the convergence threshold is defined, as well as the convection scheme and the solvers to be used by TransAT. 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. Output Management
  The parameters of the outputs of the simulation are defined in the Output Management tab.
2.1.5.3 Saving the project

The template for the simulations is now ready. To save it

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.

The Execute tab is automatically opened.

2.1.6.2 Mesh & BCs Tab
Domain & Grid
 

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).

The domain is automatically split into blocks of equivalent sizes.

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

This tab is where the simulation is started and controlled. Running TransAT 

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.

> paraview &

To get more information about visualitsation of TransAT results with ParaView, please refer to the TransAT Paraview 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.

> transatui.py &
2.1.7.2 Mesh & BCs Tab
Domain & 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.

To create a block with a finer mesh around the object

Now blocks will be split so as to be able to use several processors.

The coarse mesh is automatically split into two blocks of equivalent sizes.

The fine mesh is automatically split into two blocks of equivalent sizes.

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.

2.1.7.4 Starting the simulation
Run TransAT
 
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.

> 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.1.8 Results


PIC

Figure 2.3: Multiblock and BMR Cylinder Flow (Re=150): Pressure field and Velocity vectors


2.2 Flow over Buildings

2.2.1 Prerequisites

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

> 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.

After clicking PIC, 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.

Objects
  Load the geometry file already prepared and located in the TransAT Object Database.

The Buildings need to be positioned at suitable coordinates.

2.2.4.2 Mesh & BCs Tab

In the Mesh & BCs tab, the domain along with the mesh are defined.

Domain & Grid 


PIC

Figure 2.4: Domain with the buildings


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). Firstly we will add a son block in order to get more refined grid around the buildings.

To create a block with a finer mesh around the object

Now blocks will be split so as to be able to use several processors.

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.

The boundary conditions will now be assigned to the boundaries:

The symmetry boundary condition will now be assigned to all the remaining boundaries.


PIC

Figure 2.5: Boundary conditions


2.2.4.3 Input Tab

To select the models and set up the simulation parameters

Physical Models 


PIC

Figure 2.6: Physical models


Phase Properties
  Since the Multiphase Flow Method is turned off, only the fluid properties of Phase 1 need be defined. Simulation Parameters
  This tab is used to define the numerical parameters of the simulation. 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.


PIC

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. Output Management
  In the Output Management tab the parameters of the outputs of the simulation are defined.
2.2.4.4 Execute

This tab is where the simulation is started and controlled.

Set Number of Processors to 3.

2.2.4.5 Running TransAT

2.2.5 Visualisation of the results

> paraview &

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.


PIC
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

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

2.3.4 Launch TransATUI

> 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.

After clicking PIC, 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.

To create the cylinder geometry:

2.3.7 Mesh & BCs Tab

The computational domain is defined and the mesh is created in the Mesh & BCs tab.

Domain & Grid Tab
  In this section the domain and the computational grid for the simulation will be defined.

Ratios are set to 1.0 to create a uniform mesh.

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.

The domain is automatically cut into blocks of equivalent sizes.

To create a block with a finer mesh around the object

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.

Now conditions for each of the boundaries should be set.

To assign the Inflow boundary condition to the XMIN 0 surface

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


PIC

Figure 2.9: Boundaries Final Setup


2.3.8 Input Tab

To set up the simulation parameters

Physical Models Tab
  In this tab, the models that will be used during the simulation will be defined.


PIC

Figure 2.10: Physical models


Phase Properties Tab
  To set the fluid properties, 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.   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.


PIC

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. Output Management Tab
  In this tab the parameters of the outputs of the simulation are defined.

2.3.9 Execute Tab

This tab is where the simulation is started and controlled.

2.3.9.1 Starting 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.

> paraview &
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.


PIC

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


PIC

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

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

> 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

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:

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.

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 PIC. PIC 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.

The inflow boundary condition has now been created.

Assigning Boundary Conditions:

XMIN 0 in the surface tree takes the color of the boundary condition after being assigned.


The mesh is now ready.

3.1.6 Input Tab

To set up the simulation parameters,

Physical Models
 

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.

Simulation Parameters
  The numerical parameters of the simulation are set in the simulation parameters tab. 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: 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. Output Management
  The simulation’s outputs are defined in the Output Management tab. In this example, only the visualization output will be set.

3.1.7 Execute Tab

This tab is where the simulation is started and controlled.

3.1.7.1 Starting the Simulation

Running TransAT
 

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.

> 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.


PIC

Figure 3.1: Variable Selection Drop-Down Box and the Play button



PIC

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

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

> 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

The number of cells in the domain and the refinement zones are defined in the Domain & Grid tab

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.

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 PIC. PIC 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.

Assigning Boundary Conditions:

XMIN 0 in the surface tree takes the color of the boundary condition after being assigned.


The mesh is now ready.


PIC

Figure 3.3: Boundary conditions


3.2.6 Input Tab

The different tabs to define the parameters of the simulation can then be selected. Physical Models
 

Note that the reference properties are only for computing the non-dimensional numbers and does not affect the simulations.


PIC

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. Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
    Equations
  In this section, the convergence threshold is defined, as well as the convection scheme and other parameters of the solvers used by TransAT.


PIC

Figure 3.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 velocity components in the x- and y- directions and temperature. Output Management
  In this tab the parameters of the simulation outputs are set. For this example, only the visualization output will be defined.

3.2.7 Execute Tab

This tab is where the simulation is started and controlled.

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.

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 &

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.


PIC

Figure 3.6: Variable Selection Drop-Down Box and the Play button



PIC

Figure 3.7: Temperature Profile of the natural convection problem at steady state


3.3 Turbulent Heat Flux Modelling

3.3.1 Prerequisites

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

> 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.


PIC

Figure 3.8: Domain and Grid settings


Blocks
  The grid will now be decomposed into 4 blocks, so that the simulation can be run on up to 4 processors.

The domain is automatically cut into 4 blocks of equivalent number of cells.


PIC

Figure 3.9: Block decomposition


BCs Tab
  The boundary conditions must now be set for this case.

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 PIC. PIC 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.

The inflow boundary condition has now been created.

The YMAX boundary will be split using the SubBC functionnality. Follow the instructions below to split the wall between heated and adiabatic sections.

Assigning Boundary Conditions:

XMIN 0 in the surface tree takes the color of the boundary condition after being assigned.


PIC

Figure 3.10: BCs window


The mesh is now ready.

3.3.6 Input Tab

To set up the simulation parameters,

Physical Models
 

Note that the reference properties only matter for the computation of non-dimensional numbers and do not affect the simulations.


PIC

Figure 3.11: Physical Models window


Phase Properties
  The Phase Properties tab is where the phases of the flow are defined. Simulation Parameters
  The numerical parameters of the simulation are set in the simulation parameters tab. 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:

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.

Output Management
  The simulation’s outputs are defined in the Output Management tab. In this example, only the visualization output will be set.

3.3.7 Execute Tab

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.

Running TransAT
 

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.

> 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.


PIC

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

4.1.2 Launching 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.

After clicking PIC, 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.

4.1.4.1 Domain & Grid tab

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.


PIC

Figure 4.1: Domain & Grid tab


4.1.4.2 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).

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 PIC 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.

  The next step is to assign each surface to the corresponding boundary condition.

After the assignment of all the boundary conditions, the window should be similar to Figure 4.2.


PIC

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.

4.1.5.1 Physical Models Tab


PIC

Figure 4.3: Physical models


4.1.5.2 Phase Properties Tab

The flow is constituted of two phases for which physical properties have to be defined.

Properties for the different phases:

Phase 1 
   Density   : 1.0 
   Viscosity : 1.70e-05   (constant) 
 
Phase 2 
   Density   : 1000.0 
   Viscosity : 0.0017    (constant)


PIC

Figure 4.4: Phase properties


4.1.5.3 Simulation Type and Control Parameters
4.1.5.4 Equations

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 User Manual .
cp <TransAT Installation directory>/Tutorials/4.1\ -\ dam_break/initialconditions.xml .

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.

4.1.5.6 Output Management Tab

4.1.6 Execute Tab

This tab is where the simulation is started and controlled.

4.1.6.1 Running TransAT

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:

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:

> paraview &

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 TransAT Paraview Tutorial .

More detailed information can also be found in the Paraview Tutorial on the ParaView website.


PIC

Figure 4.5: Density contour plot at the initial time step



PIC

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

4.2.2 Launching 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.

After clicking PIC, 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.

4.2.4.1 Domain & Grid

In this section the domain and the computational grid for the simulation will be defined.

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)


PIC

Figure 4.7: Domain & Grid tab


4.2.4.2 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).

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,

  By clicking PIC 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.   The next step is to associate each boundary surface with its corresponding boundary condition.

The window should look similar to Figure 4.8 after the assignment of all the boundary conditions.


PIC

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.

4.2.5.1 Physical Models Tab


PIC

Figure 4.9: Physical models


4.2.5.2 Phase Properties Tab

The flow is constituted of two phases which physical properties have to be defined.

The properties of the fluid can be manually defined, however they can remain default for this simulation.


PIC

Figure 4.10: Phase Properties


4.2.5.3 Simulation Parameters Tab
4.2.5.4 Equations Section
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 User Manual .
cp <TransAT Installation directory>/Tutorials/4.2\ -\ sloshing/initialconditions.xml .

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.

4.2.5.6 Output Management Tab

4.2.6 Execute Tab

This tab is where the simulation is started and controlled.

4.2.6.1 Running TransAT

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:

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:

> paraview &

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.  


 

PIC

Figure 4.11: Density contour plot at the initial time step
 


PIC

Figure 4.12: Density contour plot after 2.5 s

4.3 Bubbles Merging

4.3.1 Prerequisites

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.

The initial setup can be seen in Figure 4.13.


PIC

Figure 4.13: Bubble merge problem: initial conditions


4.3.3 Launching TransATUI

To launch the TransATUI user interface, TransATUI,

> 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.

After clicking PIC, 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.

Domain & Grid 

To define the number of cells in the domain and the refinement zones,

The chosen mesh in this case is regular so the ratios between cells will be set to 1.

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,

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.

The mesh is now ready.

To save the settings,

4.3.6 Input Tab

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 

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

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. Equations
  The user can define the convergence threshold, the solvers and the numerical schemes to be used for each equation using the Equations tab. 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 User Manual .
> cp <TransAT_Tutorial_Folder>/4.3\ -\ bubblemerge/initialconditions.xml .

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.

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.

4.3.7 Execute Tab

The Execute tab is where the simulation is started and controlled.

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.

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.
> 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.

4.3.9 Results


PIC PIC PIC

Figure 4.14: Bubble merge problem: bubble surface


4.4 Film Boiling

4.4.1 Prerequisites

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:

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.

> 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

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.


PIC

Figure 4.15: Domain & Grid tab


Blocks
  To allow parallel computation, the domain must be split into several blocks.

The block decomposition should be similar as Figure 4.16.


PIC

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 PIC. The PIC 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.

Assigning Boundary Conditions:

Once the the assignment is done, the surface Y min 0 will be highlighted in the graphical window on the right.


After assigning all the surfaces to their boundary conditions, the BCs tab should be similar to Figure 4.17.


PIC

Figure 4.17: Boundary tab after assignment of surfaces to boundary conditions


The mesh is now ready.

4.4.6 Input Tab

To set up the simulation parameters

Physical Models
  In this tab, the models that will be used during the simulation are defined.

The Physical Models and the Phase Change Properties windows are shown in Figure 4.18 and Figure 4.19.


PIC

Figure 4.18: Physical models



PIC

Figure 4.19: Phase Change Properties


Phase Properties 

Since the Level-Set method is used, the number of phases is set to 2. The properties to be set for both phases are given below.


PIC

Figure 4.20: Phase properties


Simulation Parameters 

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 

  Equations
  In the Equation section, the convergence threshold is defined, as well as the convection scheme and the solvers used by TransAT. 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.
cp <TransAT Installation directory>/Tutorials/4.4\ -\ filmboiling/initialconditions.cxx .

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.

Several new icons are displayed. PIC opens a text editor where the the initial conditions file can be edited. However, there is no change to be made in this case.

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.

4.4.7 Execute Tab

Running TransAT
 

4.4.8 Visualisation of the results

The results of the simulation can be seen with the help of the open-source visualisation tool, ParaView.

> paraview &

See Figure 4.21.

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.


PIC

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.


PIC

Figure 4.22: Interface (white line) and velocity vectors before initial bubble detachment, colored by Temperature.



PIC

Figure 4.23: Interface (white line) and velocity vectors of fully detached bubble, colored by Temperature.


4.5 Spillway

4.5.1 Prerequisites

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

> 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.

After clicking PIC, 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.

Objects
  Load the geometry file already prepared and located in the TransAT Object Database.

The Spillway needs to be positioned at suitable coordinates.


PIC

Figure 4.24: Spillway geometry


4.5.7 Mesh & BCs Tab

In the Mesh & BCs tab, the domain is defined, the mesh created and the boundary conditions set.

Domain  Grid
  A uniform mesh will be used as a basis.

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.


PIC

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 PIC 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 

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.

Now a SubBC will be created for water inflow:

Assigning Boundary Conditions:

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.

The mesh is now ready.


PIC

Figure 4.26: Boundary conditions


4.5.8 Input Tab

To set up the simulation parameters

Physical Models
  In the Physical Models tab, the models that will be used during the simulation are chosen. Phase Properties
  In the Phase Properties tab, the physical properties of the different phases are defined. 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:

No relations for lift or wall lubrication will be set, however, surface tension needs to be set for the tomiyama model.


PIC

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 


PIC

Figure 4.28: Simulation Parameters


  Equations
  In this tab the convergence threshold is defined, as well as the convection scheme and the solvers used by TransAT.

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.


PIC

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).
cp <TransAT_Tutorial_folder>/4.5\ -\ spillway/initialconditions.cxx .

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.

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.

4.5.9 Execute Tab

Running TransAT
 

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 &

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.

4.5.11 Results


PIC

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

5.1.2 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.

After clicking PIC, 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.1.4 Mesh & BCs Tab

Domain & Grid Tab
  In this section the domain and the computational grid for the simulation will be defined.

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).

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 PIC. PIC 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:

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.

Please note: : the wall boundary condition is only defined once but assigned to two surfaces.


PIC

Figure 5.1: Inflow properties


Defining a sub-boundary condition (SubBC)

The mesh is now ready.


PIC

Figure 5.2: Boundary conditions


5.1.5 Input Tab

To set up the simulation parameters

Physical Models Tab 


PIC

Figure 5.3: Physical models


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.


PIC

Figure 5.4: Phase properties


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.

  Simulation Type and Control Parameters    Equations
  The user can define the convergence threshold and the numerical schemes to be used for each equation in the Equations section.


PIC

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. 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.

5.1.6 Execute Tab

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.

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.

> paraview &

To visualize the temperature profile of the fluid:

To visualize the particles colored with their temperatures:

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.


PIC
(a) Fluid temperature
PIC
(b) Particle temperature

Figure 5.6: Two-way coupled gas-particle flow


5.2 Particle Separator

5.2.1 Prerequisites

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

> 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.

After clicking PIC, 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.

Objects
  Load the geometry file already prepared and located in the TransAT Object Database.

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,

5.2.6 Mesh & BCs Tab

The domain is defined and the mesh is created in the Mesh & BCs tab.

Domain & Grid 

Note that the geometry encloses the fluid (CFD) domain. That is why the chosen domain encompasses the geometry.

The mesh will now be defined.

Blocks 

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.

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.


PIC

Figure 5.7: Grid after splitting and shrinking the blocks


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 PIC. PIC 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.

Now the outflow boundary conditions will be adjusted.

An additional outflow will be created.

Assigning Boundary Conditions:

ZMAX 0 in the surface tree takes the color of the boundary condition after being assigned.

YMIN 0 in the surface tree takes the color of the boundary condition after being assigned.

YMAX 0 in the surface tree takes the color of the boundary condition after being assigned.

The mesh is now ready.


PIC

Figure 5.8: Boundary conditions


5.2.7 Input Tab

To set up the simulation parameters

Physical Models
  In this tab, the models that will be used during the simulation will be defined.


PIC

Figure 5.9: Lagrangian particle-tracking parameters



PIC

Figure 5.10: Physical models


Phase Properties 


PIC

Figure 5.11: Phase properties


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    Equations
  In the Equations section the convergence threshold is defined, as well as the convection scheme and the solvers used by TransAT. 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. 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.

5.2.8 Execute Tab

Running TransAT
 

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 &

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.


PIC

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

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

5.3.4 Launching TransATUI

> 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.

After clicking PIC, 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.

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,

5.3.7 Mesh & BCs Tab

The computational domain is defined and the mesh is created in the Mesh & BCs tab.

Domain & Grid Tab
  In this section the domain and the computational grid for the simulation will be defined.

Ratios are set to 1.0 to create a uniform mesh.

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).

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.

Now conditions for each of the boundaries should be set.

To assign the Inflow boundary condition to the XMIN 0 surface

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


PIC

Figure 5.13: Boundaries Final Setup


5.3.8 Input Tab

To set up the simulation parameters

Physical Models Tab
  In this tab, the models that will be used during the simulation will be defined.


PIC

Figure 5.14: Physical models


Phase Properties Tab
  To set the fluid properties, 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.   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.


PIC

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. Output Management Tab
  In this tab the parameters of the outputs of the simulation are defined.

5.3.9 Execute Tab

This tab is where the simulation is started and controlled.

5.3.9.1 Starting 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.

> paraview &

To visualize the particles:

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.


PIC

Figure 5.16: 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.

5.3.11 Results

Figure 5.17 shows the temperature contours of the converged solution


PIC

Figure 5.17: Velocity profile and particle distribution in the pipe


Chapter 6
Thermal-Hydraulics Applications

6.1 Wall Boiling

6.1.1 Prerequisites

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

> 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.

After clicking PIC, 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.

Domain & Grid  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 

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.

Assigning Boundary Conditions:

XMin 0 in the surface tree takes the color of the boundary condition after being assigned.


The mesh is now ready.

6.1.6 Input Tab

To set up the simulation parameters

The different sub-tabs can now be selected to define the parameters of the simulation. Physical Models
 


PIC

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.

Note that the Heat Capacity value is high to aid in quick computations.


PIC

Figure 6.3: Phase properties


Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
 

  Equations
  Set the solver parameters as follows:


PIC

Figure 6.4: Simulation parameters


Initial Conditions
  In this tab simple initial conditions can be set. Output Management
  The parameters of the simulation outputs are set in this tab. For this example, only the visualization output will be set.

6.1.7 Execute Tab

This tab is where the simulation is started and controlled.

6.1.7.1 Starting the simulation

Running TransAT
 

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.

> 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.


PIC

Figure 6.5: Variable Selection Drop-Down Box and the Play button



PIC

Figure 6.6: Advanced Toggle Properties Button


6.1.9 Results


PIC

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

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.


PIC

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

> 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.

After clicking PIC, 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.

Objects
  The pipe geometry has already been loaded into the mesh. Now the properties and boundary conditions of the solid walls must be set.

With these properties, the walls are modelled as adiabatic. The settings of the object are automatically saved.


PIC

Figure 6.9: Object properties and BCs


6.2.6 Mesh & BCs Tab

In the Mesh & BCs tab, the domain along with the mesh and the boundary conditions are defined.

Domain & Grid 

The grid is now inside the Geometry.

Now the cell density of the grid will be defined.

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.

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.

The operation will be repeated for the block on the right-hand side of the domain.

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 

  Redimensioning of the right end of the domain 

The mesh should look as in Fig 6.8 BCs Tab 

To see boundaries, it may be useful to hide the pipe geometry. To do this

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.

Assigning Boundary Conditions:

XMin 0 in the surface tree takes the color of the boundary condition after being assigned.


PIC

Figure 6.10: Boundary conditions


The mesh is now ready.

6.2.7 Input Tab

To set up the simulation parameters

Physical Models
  In this tab, the models that will be used during the simulation will be defined.

The physical models tab is shown on Fig. 6.11.


PIC

Figure 6.11: Physical models


Phase Properties
  To set the properties of the phases

Simulation Parameters
  This tab is used to define the numerical parameters of the simulation.   Simulation Type and Control Parameters 

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.

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).

cp <TransAT Installation directory>/Tutorials/7.2\ -\ countercurrent_flow/ 
initialconditions.cxx .

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.

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.

6.2.8 Execute Tab

This tab is where the simulation is started and controlled.

Running TransAT
  The Number of processors to be used can be chosen by modifying the corresponding field.

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.

> paraview &

A snapshot of results is shown in Fig. 6.12.

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.

6.2.10 Results


PIC

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

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

> 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.

After clicking PIC, 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.

Objects
  Load the geometry file already prepared and located in the TransAT Object Database.

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,

7.1.6 Mesh & BCs Tab

In the Mesh & BCs tab, the domain along with the mesh are defined.

Domain & Grid 

Grid refinements need be created to make sure that there are enough cells in the diameter of the outflows.


PIC

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).

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 PIC. PIC 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


PIC

Figure 7.2: Inflow parameters


Assigning Boundary Conditions:

After the assignment is completed, in the surface tree, XMIN 0 will be colored with the color associated to Inflow in the list of boundary conditions.

The mesh is now ready.


PIC

Figure 7.3: Boundary conditions


7.1.7 Input Tab

To set up the simulation parameters

Physical Models
  In this tab, the models that will be used during the simulation will be defined.


PIC

Figure 7.4: Phase average parameters


Phase Properties
  The properties of the different phases of the Gas-oil-water flow will be set in this section.

For the third phase, the default properties of water will be used.


PIC

Figure 7.5: Phase Properties


Phases Interactions
  In the Phases Interactions tab, the interphase slip models will be defined between the phases. Click on PIC. The clift drag model will be used for all relations, without lift or wall lubrication.


PIC

Figure 7.6: Lift Model Table


Simulation Parameters
  This tab is used to define the numerical parameters of the simulation.

Equations
  In this section the convergence threshold is defined, as well as the convection scheme and the solvers used by TransAT.


PIC

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).
cp <TransAT Installation directory>/Tutorials/8.1\ -\ oil_separation/initialconditions.cxx .

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.

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.

7.1.8 Execute Tab

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 Number of Processors.

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.

> 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.

7.1.10 Results


PIC

Figure 7.8: Oil separation


7.2 Two-phase slug flow in TransAT–OLGA coupled simulation

7.2.1 Prerequisites

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 TransATOLGA 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:


PIC

Figure 7.9: Sketch of the TransAT domain geometry.


7.2.3 Creating a Project Folder

> mkdir coupling_slugs 
> cd coupling_slugs

Then, since it is a TransATOLGA 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.

> mkdir communication

7.2.4 Launching TransATUI

> transatui.py &

7.2.5 Opening TransAT window

The first step in creating a new TransAT project is naming said project.

After clicking PIC, 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.

Objects
  Load the geometry file already prepared and located in the TransAT Object Database.

The properites of the Immersed Surfaces will be adjusted, to do so

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,

Now the object properties must be defined.

The settings will be saved automatically.

7.2.7 Mesh & BCs Tab

In the Mesh & BCs tab, the domain along with the mesh are defined.

Domain & Grid 

To refine the mesh do the following:

Blocks
  To allow parallel computation, the domain must be split into several blocks.

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.

An additional air inflow boundary condition to be assigned to the Z max surface will be created:

Lastly, create the Coupling boundary condition:

Assigning Boundary Conditions:
To assign the water_inflow boundary condition the Z min surface

ZMin 0 in the surface tree is colored with the color associated to the water_inflow boundary condition after being assigned.

The mesh is now ready.

7.2.8 Input Tab

Physical Models
  In the Physical Models, the models that will be used to run the simulation are defined.

Phase Properties 

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 PIC. The clift drag model will be used for all relations, without lift or wall lubrication.

Simulation Parameters
  The Simulation Parameters tab is used to define the numerical parameters of the simulation. 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.

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.

cp <TransAT Installation directory>/Tutorials/8.2\ -\ coupling_slugs/initialconditions.cxx .

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,

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.

7.2.9 OLGA model setup

To set up the OLGA model

Note that administrator privileges are required to run OLGA in server mode, i.e. such that it can communicate data at run-time.

A basic case of OLGA is created.


PIC


 
FILES: 
   PVTFILE: Set to Water-gas.tab file 
            (Check OLGA manual for location of .tab files). 
 
INTEGRATION: 
   ENDTIME          : 2s 
   MAXDT            : 0.01s 
   MAXTIME          : 0s 
   MINDT            : 1.0E-5s 
   MINTIME          : 0s 
   RUNTIMESTEPAGAIN : TRUE 
   NSIMINFO         : -1 
   STARTTIME        : 0s 
   DTSTART          : 1.0E-3s 
   EXPOSE           : ALL 
 
OPTIONS: 
   STEADYSTATE      : OFF 
 
SERVEROPTIONS: 
   SIMULATORMODE    : EXTERNAL 
   MODULENAME       : sim                   #MAKE SURE IT IS THE SAME AS DEFINED 
                                            IN OLGA COUPLING PARAMETERS IN TRANSAT 
   MODELNAME        : coupling_slugs        #MAKE SURE IT IS THE SAME AS DEFINED 
                                            IN OLGA COUPLING PARAMETERS IN TRANSAT 
    default values for the other parameters
Interpolation 
   INTERPOLATION     : LENGTH 
   INTEMPERATURE     : 300K 
   OUTTEMPEARTURE    : 300K 
   INPRESSURE        : 1bar 
   OUTPRESSURE       : 1bar 
   INVOIDFRACTION    : 0.5 
   OUTVOIDFRACTTION  : 0.5 
   INWATERCUT        : 1.0 
   OUTWATERCUT       : 1.0 
Section wise: 
   MASSFLOW          : 3.07kg/s
BRANCH: 
   INIFLOWDIR : POSITIVE 
   FLUID      : 1 
PIPE-1: 
   NSEGMENT   : 100 
   DIAMETER   : 0.08m 
   POSITION: 
      LENGTH      : 100m 
      ELEVATION   : 0m

An instance Positions >> POSITION: POS-1 is created in the Model View tab.

PIPE    : PIPE-1 
SECTION : 1
PIPE    : PIPE-1 
SECTION : 2
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.

GENERAL 
   LABEL             : G-tag 
   TIME              : 0s 
   TEMPERATURE       : 300K 
   MASSFLOW          : 0.028kg/s 
SERVER 
   EXPOSE            : MASSFLOW, TEMPERATURE 
POSITION 
   PIPE              : - 
   SECTION           : -        #REMOVE IF THERE IS ANY, OTHERWISE 
                                 YOU CANNOT SET THE NEXT VALUE 
   POSITION          : POS-2 
PHASE DISTRIBUTION 
   GAS FRACTION        : 1 
   WATER FRACTION      : - 
   TOTALWATERFRACTION  : 0
GENERAL 
   LABEL             : O-tag 
   TIME              : 0s 
   TEMPERATURE       : 300K 
   MASSFLOW          : 0.0kg/s 
SERVER 
   EXPOSE            : MASSFLOW, TEMPERATURE 
POSITION 
   SECTION           : -        #REMOVE IF THERE IS ANY, OTHERWISE YOU 
                                 CANNOT SET THE NEXT VALUE 
   PIPE              : - 
   POSITION          : POS-2 
PHASE DISTRIBUTION 
   GAS FRACTION        : 0 
   WATER FRACTION      : - 
   TOTALWATERFRACTION  : 0
GENERAL 
   LABEL             : W-tag 
   TIME              : 0s 
   TEMPERATURE       : 300K 
   MASSFLOW          : 3.07kg/s 
SERVER 
   EXPOSE            : MASSFLOW, TEMPERATURE 
POSITION 
   PIPE              : - 
   SECTION           : -        #REMOVE IF THERE IS ANY, OTHERWISE 
                                 YOU CANNOT SET THE NEXT VALUE 
   POSITION          : POS-1 
PHASE DISTRIBUTION 
   GAS FRACTION        : 0 
   WATER FRACTION      : - 
   TOTALWATERFRACTION  : 1

The Server Output Variables, i.e. the ones that will be communicated to TransAT, now need to be added.

GENERAL 
   VARIABLE          : GASMFR, OILMFR, WATMFR, PT, TM[K]    # MAKE SURE YOU 
                                                              SELECT K AS 
                                                              TEMPERATURE UNIT 
POSITION 
   POSITION          : POS-1, P-tag
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.

Now, some Profile outputs can be defined.

VARIABLE          : GASMFR, OILMFR, TWATMFR, PT, TM

The Properties of the two nodes now need to be set.

GENERAL 
   TYPE        : PRESSURE 
PRESSURE CONDITIONS: 
   TOTALWATERFRACTION : 1 
   GASFRACTION        : 0.5 
   TEMPERATURE        : 300K 
   PRESSURE           : 1bar 
   FLUID              : 1

In the last section of the Model View tab, i.e. “Output”

GENERAL: 
   VARIABLE    : HT, NINTGR, TIME 
   DTPLOT      : 0s
DTPLOT   : 0.01s 
DTTIME   : 0s
DTPLOT   : 0.01s 
TIME     : 0s

Now that the OLGA problem has been set up,


PIC

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 TransATOLGA 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,

Now, you should be able to connect the OLGA client to the OLGA server.

      python OLGA_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.

The Number of processors sets the number of processors on which the simulation will be run.

Running TransAT
 

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 &

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 TransAT Paraview 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).

cp <TransAT Installation folder>/Tutorials/coupling_slugs/PLOT -r .

Then, simply run:

gnuplot plot.plt

It will create several output “*.eps” files, showing the trend of the coupling variables at the interface.

7.2.13 Results


PIC

Figure 7.10: Slug of water crossing the coupling interface.


7.3 Oil spill

7.3.1 Prerequisites

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

> 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.

After clicking PIC, 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.

Objects
  Load the geometry file already prepared and located in the TransAT Object Database.

The object properties and boundary conditions must now be defined.

The settings will automatically be saved.


PIC

Figure 7.11: Object properties and boundary conditions


7.3.6 Mesh & BCs Tab

In the Mesh & BCs tab, the domain is defined, the mesh created and the boundary conditions set.

Domain  Grid
  A uniform mesh will be used as a basis.

Blocks
  Refinements will be performed in the zones of interest in the Blocks


PIC

Figure 7.12: Block decomposition of the domain


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.


PIC

Figure 7.13: Inflow parameters


Now a SubBC will be created for the spill inflow:

Assigning Boundary Conditions:

XMAX 0 in the surface tree takes the colour associated with the outflow boundary condition (see boundary conditions table) after being assigned.

The mesh is now ready.


PIC

Figure 7.14: Boundary conditions


7.3.7 Input Tab

To set up the simulation parameters

Physical Models
  In the Physical Models tab, the models that will be used during the simulation are chosen.


PIC

Figure 7.15: Phase average parameters



PIC

Figure 7.16: Physical models


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.


PIC

Figure 7.17: Phase properties


Phases Interactions
  To define the hydrates reactions between the phases,


PIC

Figure 7.18: Phase interaction model



PIC

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    Equations
  In this tab the convergence threshold is defined, as well as the convection scheme and the solvers used by TransAT.


PIC

Figure 7.20: 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_spill in Tutorials folder).
cp <TransAT_Tutorial_folder>/8.3\ -\ oil_spill/initialconditions.cxx .

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.

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.

7.3.8 Execute Tab

Running TransAT
 

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 &

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.

7.3.10 Results


PIC

Figure 7.21: Oil spill: Distribution of hydrates void fraction after 5000 time steps



PIC

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

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

> 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.

After clicking PIC, 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:

The train motion now needs to be specified:

8.1.6 Mesh & BCs Tab

In the Mesh & BCs tab, the domain along with the mesh are defined.

Domain & Grid Tab
  In this section the domain and the computational grid for the simulation will be defined.

You can click PIC at the bottom of the graphical window to display the domain in the XY plane.

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).

A block modification will be used to create the tunnel section on the right side of the domain:

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.


PIC

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,

The different tabs to define the parameters of the simulation can now be selected. Physical Models
 


PIC

Figure 8.2: Physical models


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: Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
 

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.

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. Output Management
  The parameters for the outputs of the simulation are defined in the Output Management tab.

8.1.8 Execute Tab

This tab is where the simulation is started and controlled.

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.

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 &

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


PIC

Figure 8.3: Moving Train


Chapter 9
Advanced Post-processing

9.1 Water suction

9.1.1 Prerequisites

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.


PIC

Figure 9.1: Setup


This tutorial introduces two TransAT features:

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

> 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

The grid properties will now be set

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.

The domain is automatically cut into 4 blocks of equivalent number of cells.


PIC

Figure 9.2: Block decomposition


BCs Tab
  The boundary conditions must now be set for this case.

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 PIC. PIC 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.

Assigning Boundary Conditions:

XMin 0 in the surface tree takes the color of the boundary condition after being assigned.

Defining sub-boundary conditions (SubBC)

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 User Manual for more information.

The pump boundary condition on the Y min surface will first be created.

Now the boundary condition on the X max surface will be created


The mesh is now ready.


PIC

Figure 9.3: Boundary conditions


9.1.6 Input Tab

The different tabs to define the parameters of the simulation can then be selected. Physical Models
 


PIC

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. Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
    Equations
  In this section, the convergence threshold is defined, as well as the convection scheme and other parameters of the solvers used by TransAT.


PIC

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.

  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:

p(x,y) = ρg (yc - y)
(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).
cp <TransAT_Tutorial_folder>/9.1\ -\ water_suction/initialconditions.cxx .

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.

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:

Finally, confirm that the UDF can be compiled by clicking PIC. 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).


PIC

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:
std::vector<double> Time;  
std::vector<double> Mass;

Two functions are declared in the public section of the mass_output class declaration

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 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.

9.1.7 Execute Tab

This tab is where the simulation is started and controlled.

Running TransAT
 

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 &

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.


PIC
Figure 9.7: Water volume fraction distribution at t = 0.0s



PIC

Figure 9.8: Water volume fraction distribution at t = 2.0s


9.2 Forced Convection in an Isothermal Pipe

9.2.1 Prerequisites

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:

9.2.3 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

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:

Blocks
  The grid will now be decomposed into 3 blocks, so that the simulation can be run on up to 3 processors.

The domain is automatically cut into 3 blocks of equivalent number of cells.


PIC

Figure 9.10: Block decomposition


BCs Tab
  The boundary conditions must now be set for this case.

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 PIC. PIC 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.

The inflow boundary condition has now been created.

Assigning Boundary Conditions:

XMin 0 in the surface tree takes the color of the boundary condition after being assigned.


PIC

Figure 9.11: Boundaries tab



The mesh is now ready.

9.2.6 Input Tab

To set up the simulation parameters,

Physical Models
 

Note that the reference properties only matter for the computation of non-dimensional numbers and do not affect the simulations.


PIC

Figure 9.12: Physical models


Phase Properties
  The Phase Properties tab is where the phases of the flow are defined.


PIC

Figure 9.13: Phase Properties tab


Simulation Parameters
  The numerical parameters of the simulation are set in the simulation parameters tab. 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:


PIC

Figure 9.14: Simulation Parameters tab


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.


PIC

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:

Finally, confirm that both of the UDFs can be compiled by clicking PIC. 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).


PIC

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 User Manual . 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:

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:

       ∫
         ρuT dΣ
Tbulk = Σ∫-------
          ρudΣ
        Σ
(9.2)
with Σ the cross-section and the Nusselt number definition reads:
N u = ----2Rq-′′----
      λ (Tw - Tbulk)
(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
       y=∫R
           uTdy
Tbulk = y=0------
        y=∫R
        y=0 udy
(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 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

#include "mpi.h"  
#include"cppinterface.h"  
#include <toolbox.h>

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:

ncellsblock = getWallBoundaryNFaces(iblock, direction_top);  
for (int icell = 0; icell < ncellsblock; icell++){  
...  
}

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");


PIC

Figure 9.17: Computational grid (k = kBoundaryCell layer)


The following discretised form of Eq. 9.4 is used to get the bulk temperature:

        ∑
          uiiTiiΔyii
Tbulk = Ωi∑----------
           uiiΔyii
         Ωi
(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

        ∑ uiiTiivolii
        Ωi----------
Tbulk =  ∑ uiivolii
         Ωi
(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;  
 
   x_globalSorted      = tmb::toolbox::getVectorSortedByIndexMap(indexSorted,  
                                                                 x_global);  
   Nu_globalSorted     = tmb::toolbox::getVectorSortedByIndexMap(indexSorted,  
                                                                 Nu_global);  
   Tbulk_globalSorted  = tmb::toolbox::getVectorSortedByIndexMap(indexSorted,  
                                                                 Tbulk_global);  
   ...  
}

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

      // Delete data-sorting pointers  
      delete indexSorted, x_globalSorted, Nu_globalSorted, Tbulk_globalSorted;  
      }  
   // Delete data-storing pointers  
   delete x_local, Nu_local, Tbulk_local, x_global, Nu_global, Tbulk_global;  
   }

Output Management
  The simulation’s outputs are defined in the Output Management tab. In this example, only the visualization output will be set.

9.2.7 Execute Tab

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.

Running TransAT
 

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.

> 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.


PIC

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

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

> 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.

After clicking PIC, 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


PIC

Figure 10.1: Settings for the generation of the step


10.1.6 Mesh & BCs Tab

The domain is defined and the mesh is created in the Mesh & BCs tab.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

The number of cells in the domain and the refinement zones are defined in the Domain & Grid tab

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).

The domain is automatically split into blocks of equivalent sizes. BCs Tab
  The boundary conditions must now be set for this case.

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 PIC. PIC 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.

Assigning Boundary Conditions:

XMin 0 in the surface tree takes the color of the boundary condition after being assigned.


The mesh is now ready.


PIC

Figure 10.2: Boundary conditions


10.1.7 Input Tab

The different tabs to define the parameters of the simulation can then be selected. Physical Models
 


PIC

Figure 10.3: 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.


PIC

Figure 10.4: Phase properties


Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
  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.
10.1.7.1 Saving the project

The template for the simulations is now ready. To save it

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.

The Execute tab is automatically opened.

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:

10.1.8.2 Running the simulation

The simulation will now be run.

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.

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.

The Execute tab is automatically opened.

The SarP module must now be activated.

To get more details on the SArP module’s options and settings, refer to the SArP Guide in the TransAT User Manual.


PIC

Figure 10.5: Simulation Parameters


10.1.9.2 Running the simulation

The simulation will now be run.

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.

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 PIC 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 User Manual.

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 &

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.


PIC

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

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

> 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

The number of cells in the domain and the refinement zones are defined in the Domain & Grid tab

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.

The domain is automatically split into blocks of equivalent sizes. BCs Tab
  The boundary conditions must now be set for this case.

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 PIC. PIC 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.

Assigning Boundary Conditions:

XMin 0 in the surface tree takes the color of the boundary condition after being assigned.


The mesh is now ready.


PIC

Figure 10.7: Boundary conditions


10.2.6 Input Tab

The different tabs to define the parameters of the simulation can then be selected. Physical Models
 

Note that the reference properties are only for computing the non-dimensional numbers and does not affect the simulations.


PIC

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.


PIC

Figure 10.9: Phase properties


Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
 

Initial Conditions
  In this tab simple initial conditions are set. Output Management
  In this tab the parameters of the simulation outputs are set. For this example, only the visualization output will be defined.
10.2.6.1 Saving the project

The template for the simulations is now ready. To save it

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.

The Execute tab is automatically opened.

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.

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.

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.

The Execute tab is automatically opened.

The SarP module must now be activated.

To get more details on the SArP module’s options and settings, refer to the SArP Guide in the TransAT User Manual.


PIC

Figure 10.10: Simulation Parameters


10.2.8.2 Running the simulation

The simulation will now be run.

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.

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 PIC 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 User Manual.

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 &

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.


PIC

Figure 10.11: Temperature distribution in the cavity


10.3 Droplet Impact on a Flat Plate

10.3.1 Prerequisites

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

> 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.

After clicking PIC, 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.

Domain & Grid
  In this section the domain and the computational grid for the simulation will be defined.

The number of cells in the domain and the refinement zones are defined in the Domain & Grid tab

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.

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 PIC. PIC 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.

Assigning Boundary Conditions:

XMin 0 in the surface tree takes the color of the boundary condition after being assigned.


The mesh is now ready.


PIC

Figure 10.12: Boundary conditions


10.3.6 Input Tab

The different tabs to define the parameters of the simulation can then be selected. Physical Models
 


PIC

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.


PIC

Figure 10.14: Phase properties


Simulation Parameters
  This tab is used to define the numerical properties of the simulation.   Simulation Type and Control Parameters
 

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. 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 User Manual .
cp <TransAT Installation directory>/Tutorials/10.3\ -\ droplet_impact/initialconditions.xml .

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.

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.

10.3.7 Simulation in normal mode

10.3.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.

The Execute tab is automatically opened.

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.

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.

The Execute tab is automatically opened.

The SarP module must now be activated.

To get more details on the SArP module’s options and settings, refer to the SArP Guide in the TransAT User Manual.

Please note: when running unsteady simulation with SArP, set Analysis Window Size to values as low as 5 to accelerate the optimisation process.


PIC

Figure 10.15: Simulation Parameters


10.3.8.2 Running the simulation

The simulation will now be run.

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 PIC 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 User Manual.

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 &

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.


PIC

Figure 10.16: Density distribution at the end of the simulation (t = 0.02s)


List of Figures

1.1 Boundaries Final Setup
1.2 Physical models
1.3 Simulation parameters
1.4 Variable Selection Drop-Down Box and the Play button
1.5 Calculator Object in Paraview
1.6 Temperature contours: channel flow
1.7 Variable Selection Drop-Down Box and the Play button
1.8 Calculator Object in ParaView
1.9 Velocity vectors: backward facing step flow
1.10 Boundary conditions
1.11 Physical models
1.12 Phase properties
1.13 Simulation parameters
1.14 Cylinder Flow: Streamlines
2.1 Boundary conditions
2.2 Phase Properties
2.3 Multiblock and BMR Cylinder Flow (Re=150): Pressure field and Velocity vectors
2.4 Domain with the buildings
2.5 Boundary conditions
2.6 Physical models
2.7 Simulation Parameters
2.8 Selected streamlines over the buildings
2.9 Boundaries Final Setup
2.10 Physical models
2.11 Simulation parameters
2.12 Calculator Object in ParaView
2.13 Velocity profile in the pipe
3.1 Variable Selection Drop-Down Box and the Play button
3.2 Temperature Profile of the forced convection problem at steady state
3.3 Boundary conditions
3.4 Physical models
3.5 Simulation parameters
3.6 Variable Selection Drop-Down Box and the Play button
3.7 Temperature Profile of the natural convection problem at steady state
3.8 Domain and Grid settings
3.9 Block decomposition
3.10 BCs window
3.11 Physical Models window
3.12 Temperature contour once steady state is reached
4.1 Domain & Grid tab
4.2 Boundaries tab
4.3 Physical models
4.4 Phase properties
4.5 Density contour plot at the initial time step
4.6 Density contour plot after 0.6 s
4.7 Domain & Grid tab
4.8 Boundaries tab
4.9 Physical models
4.10 Phase Properties
4.11 Density contour plot at the initial time step
4.12 Density contour plot after 2.5 s
4.13 Bubble merge problem: initial conditions
4.14 Bubble merge problem: bubble surface
4.15 Domain & Grid tab
4.16 Block Decomposition
4.17 Boundary tab after assignment of surfaces to boundary conditions
4.18 Physical models
4.19 Phase Change Properties
4.20 Phase properties
4.21 Paraview: Select Density as the Variable and the PLAY button
4.22 Interface (white line) and velocity vectors before initial bubble detachment, colored by Temperature.
4.23 Interface (white line) and velocity vectors of fully detached bubble, colored by Temperature.
4.24 Spillway geometry
4.25 Grid
4.26 Boundary conditions
4.27 Drag Model Table
4.28 Simulation Parameters
4.29 Spillway: Initial Conditions
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)
5.1 Inflow properties
5.2 Boundary conditions
5.3 Physical models
5.4 Phase properties
5.5 Simulation parameters
5.6 Two-way coupled gas-particle flow
5.7 Grid after splitting and shrinking the blocks
5.8 Boundary conditions
5.9 Lagrangian particle-tracking parameters
5.10 Physical models
5.11 Phase properties
5.12 U-velocity contour, streamlines and particles after 2000 time steps
5.13 Boundaries Final Setup
5.14 Physical models
5.15 Simulation parameters
5.16 Calculator Object in ParaView
5.17 Velocity profile and particle distribution in the pipe
6.1 Phase change model
6.2 Physical models
6.3 Phase properties
6.4 Simulation parameters
6.5 Variable Selection Drop-Down Box and the Play button
6.6 Advanced Toggle Properties Button
6.7 Wallboiling: Phase 1 void fraction along an upward flowing pipe flow with subcooled boiling
6.8 Counter-current flow: Mesh of the setup
6.9 Object properties and BCs
6.10 Boundary conditions
6.11 Physical models
6.12 Counter-current flow: Results
7.1 Customized refinement parameters
7.2 Inflow parameters
7.3 Boundary conditions
7.4 Phase average parameters
7.5 Phase Properties
7.6 Lift Model Table
7.7 Simulation parameters
7.8 Oil separation
7.9 Sketch of the TransAT domain geometry.
7.10 Slug of water crossing the coupling interface.
7.11 Object properties and boundary conditions
7.12 Block decomposition of the domain
7.13 Inflow parameters
7.14 Boundary conditions
7.15 Phase average parameters
7.16 Physical models
7.17 Phase properties
7.18 Phase interaction model
7.19 Reaction parameters
7.20 Simulation parameters
7.21 Oil spill: Distribution of hydrates void fraction after 5000 time steps
7.22 Oil spill: Distribution of hydrates void fraction after 10000 time steps
8.1 Boundary conditions
8.2 Physical models
8.3 Moving Train
9.1 Setup
9.2 Block decomposition
9.3 Boundary conditions
9.4 Physical models
9.5 Simulation parameters
9.6 Mass of water in domain over time
9.7 Water volume fraction distribution at t = 0.0s
9.8 Water volume fraction distribution at t = 2.0s
9.9 Customized Refinement parameters
9.10 Block decomposition
9.11 Boundaries tab
9.12 Physical models
9.13 Phase Properties tab
9.14 Simulation Parameters tab
9.15 Initial Conditions tab
9.16 Nusselt number along streamswise direction
9.17 Computational grid (k = kBoundaryCell layer)
9.18 Temperature contour once steady state is reached
10.1 Settings for the generation of the step
10.2 Boundary conditions
10.3 Physical models
10.4 Phase properties
10.5 Simulation Parameters
10.6 Streamwise velocity component contour along the step
10.7 Boundary conditions
10.8 Physical models
10.9 Phase properties
10.10 Simulation Parameters
10.11 Temperature distribution in the cavity
10.12 Boundary conditions
10.13 Physical models
10.14 Phase properties
10.15 Simulation Parameters
10.16 Density distribution at the end of the simulation (t = 0.02s)

Bibliography

   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. Journal of 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 Fluid Dynamics 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 and Manufacturing ICAMMM. Sultan Qaboos University, Oman.