Caelus Documentation

Version

9.04

Date

Aug 29, 2020

Caelus is a software library suitable for numerical simulations of problems in Continuum Mechanics (CM), with many applications in Computational Fluid Dynamics (CFD) for a wide range of scientific and engineering applications across commercial and academic environments. Caelus was forked from OpenFOAM®, version 2.1.1 released by OpenFOAM® Foundation which is mainly a collection of libraries written in C++. Caelus is developed and maintained by Applied CCM Pty Ltd.

Being a derivative of OpenFOAM®, it is released under the GPL. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See the GNU General Public License for more details.

This documentation is split into three parts: a tutorial, a theory and a validation manual. New users should start with the tutorial manual that provides examples of usage.

Tutorial Manual

Tutorials: Introduction

Caelus is a software library suitable for numerical simulations of problems in Continuum Mechanics (CM), with many applications in Computational Fluid Dynamics (CFD) for a wide range of scientific and engineering applications across commercial and academic environments. Caelus is forked from OpenFOAM, version 2.1.1 released by OpenFOAM Foundation which is mainly a collection of libraries written in C++. Caelus is developed and maintained by Applied CCM Pty Ltd.

Welcome to Caelus tutorials page. Here, various capabilities of Caelus are presented through a range of tutorials. These closely follow the case studies performed for the purpose of code validation in a view that users can repeat those numerical experiments successfully while understanding the procedures involved. Each tutorial contains information about the problem description, case set-up, solver settings and post-processing details. It is suggested that user follow these steps methodically.

Note: In order to use Linux based commands on Windows, as given in the tutorial guide, it is suggest that the user install Caelus with the packaged installer. This guide assumes the user has also installed the Caelus Python Library (CPL).

Tutorials: Incompressible Laminar Flow

Laminar Flat Plate

In this tutorial, simulation of laminar incompressible flow over a two-dimensional sharp leading-edge flat plate using Caelus 9.04 is introduced here. First, pre-requisites to begin a Caelus simulation is discussed followed by various dictionary entries defining fluid properties, boundary conditions, solver setting, etc that are needed. Finally, the presence of laminar boundary layer is visualised using velocity contours. Here, the basic procedures of running Caelus is shown in sufficient detail such that the user feels comfortable with the usage.

Objectives

With the completion of this tutorial, the user will be familiar with setting up Caelus simulation for steady, laminar, incompressible flow over flat-plates in two-dimensions and subsequently post-processing the results. Following are some of the steps carried out in this tutorial

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Visualisation of the laminar boundary layer

Pre-requisites

It is assumed that the user is familiar with the Linux command line environment using a terminal or Caelus-console (for Windows OS) and that Caelus is installed correctly with appropriate environment variables set. The grid used here is generated using Pointwise and the user is free to use their choice of grid generation tool having exporting capabilities to the Caelus grid format.

Background

The flow over a flat-plate presents an ideal case where initial steps of a Caelus simulation can be introduced to the user in easy steps. Here, laminar, incompressible flow over a sharp-leading edge plate is solved in a time-accurate approach. This results in the formation of laminar boundary layer which is then compared with the famous Blasius [6] analytical solution in the form of a non-dimensional shear stress distribution (skin-friction coefficient). For more details, the user is suggested to refer the validation of flat-plate in section Flat plate validation.

The length of the flat-plate considered here is \(L = 0.3048~m\) with a Reynolds number based on the total length of \(Re = 200,000\). A schematic of the geometry is shown in Figure 1, wherein \(U\) is the flow velocity in \(x\) direction. An inflow temperature of \(T = 300~K\) can assumed for the fluid air which corresponds to a kinematic viscosity (\(\nu\)) of \(\nu = 1.5896306 \times 10^{-5}~m^2/s\). Using the values of \(Re\), \(L\) and \(\nu\), we can evaluate the freestream velocity to \(U = 10.4306~m/s\).

_images/fp-schematic-tutorials.svg

Schematic of the flat-plate flow

In the following table, details of the freestream conditions are provided.

Freestream conditions

Fluid

\(L~(m)\)

\(Re\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~(K)\)

\(\nu~(m^2/s)\)

Air

0.3048

200,000

69.436113

Gauge (0)

300

\(1.58963\times10^{-5}\)

Grid Generation

As noted earlier, Pointwise has been used here to generate a hexahedral grid. Specific details pertaining to its usage are not discussed here, rather a more generic discussion is given about the computational domain and boundary conditions. This would facilitate the user to obtain a Caelus compatible grid using their choice of grid generating tool.

The computational domain is a rectangular block encompassing the flat-plate. The below (Figure 2) shows the details of the boundaries that will be used in two-dimensions (\(x-y\) plane). First, the flat-plate, which is our region of interest (highlighted in blue) is extended between \(0\leq x \leq 0.3048~m\). Because of viscous nature of the flow, the velocity at the wall is zero which can be represented through a no-slip boundary (\(u, v, w = 0\)). Upstream of the leading edge, a slip boundary will be used to simulate a freestream flow approaching the flat-plate. However, downstream of the plate, it would be ideal to further extend up to three plate lengths (highlighted in green) with no-slip wall. This would then ensure that the boundary layer in the vicinity of the trailing edge is not influenced by outlet boundary. Since the flow is incompressible (subsonic), the disturbance caused by the pressure can propagate both upstream as well as downstream. Therefore, the placement of the inlet and outlet boundaries are to be chosen to have minimal or no effect on the solution. The inlet boundary as shown will be placed at start of the slip-wall at \(x = -0.06~m\) and the outlet at the exit plane of the no-slip wall (green region) at \(x = 1.2192~m\). Both inlet and outlet boundary are between \(0\leq y \leq 0.15~m\). A slip-wall condition is used for the entire top boundary.

_images/fp-domain-tutorials.svg

Flat-plate computational domain

The 2D structured grid is shown in Figure 3. Since Caelus is a 3D solver, it necessitates the grid to be in 3D. Therefore, the 3D grid should be obtained through extruding the 2D gird in the \(z\) direction by a minimum of one-cell thick. The final 3D grid should be then exported to Caelus format (polyMesh). The two \(x-y\) planes obtained as a result of grid extrusion need boundary conditions to be specified. As the flow over a flat-plate is generally 2D, we do not need to solve the flow in the third dimension. This can easily be achieved in Caelus by specifying empty boundary condition for each of those two planes.

Note

A velocity value of \(w=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(z\) direction.

_images/fp-grid-tutorials.png

Flat-plate computational grid

The flat-plate has a total of 400 cells over the region of interest between \(0 \leq x \leq 0.3048~m\) and 286 cells in the no-slip wall that extends for an additional 3 plate lengths (green region in the above figure). In the wall normal direction, 298 cells are used and sufficient refinement close to the wall was made to ensure that accurate boundary layer is captured.

Problem definition

Several important instructions would be shown here to set-up the flat-plate problem along with the detail of configuration files used. A full working case can be found in:

/tutorials/incompressible/simpleSolver/laminar/ACCM_flatPlate2D

However,the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

In order to set-up the problem, three main sub-directories containing all the relevant information are used. Caelus requires time, constant and system sub-directories. Since we begin the simulation at time \(t = 0~s\), the time sub-directory should be just 0.

The 0 sub-directory is where additional two files, p and U for pressure (\(p\)) and velocity (\(U\)) respectively are kept. The contents of these two files sets the dimensions, initialisation and boundary conditions to the problem, which also form three principle entries required.

It should be noted that Caelus is case sensitive and therefore the user should set-up the directories (if applicable), files and the contents identical to what is mentioned here.

Boundary Conditions and Solver Attributes

Boundary Conditions

First let us look at setting up the boundary conditions. Referring back to Figure 2, following are the boundary conditions that need to be specified:

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 10.4306~m/s\) in \(x\) direction

    • Pressure: Zero gradient

  • Slip wall
    • Velocity: slip

    • Pressure: slip

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 10.4306~m/s\) in \(x\) direction

    • Pressure: Zero Gauge pressure

Now let us look at the contents and significance of each file in these sub-directories beginning with the pressure (\(p\)) file.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      	[0 2 -2 0 0 0 0];

internalField   	uniform 0;

boundaryField
{
    downstream
    {
        type            zeroGradient;
    }
    inflow
    {
        type            zeroGradient;
    }
    outflow
    {
        type            fixedValue;
        value           uniform 0;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top
    {
        type            slip;
    }
    upstream
    {
        type            slip;
    }
    wall
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //

The above file begins with a dictionary named FoamFile which contains standard set of keywords for version, format, location, class and object names. The following are the principle entries required for this case.

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

Similarly, the file U, shown below sets the boundary conditions for velocity.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      	[0 1 -1 0 0 0 0];

internalField   	uniform (10.4306 0 0);

boundaryField
{
    downstream
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    inflow
    {
        type            fixedValue;
        value           uniform (10.4306 0 0);
    }
    outflow
    {
        type            zeroGradient;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top
    {
        type            slip;
    }
    upstream
    {
        type            slip;
    }
    wall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
}


// ************************************************************************* //

The principle entries for velocity field are self explanatory and the dimension are typical for velocity with units \(m/s\) ([0 1 -1 0 0 0 0]). Since we initialise the flow with a uniform freestream velocity, we set the internalField to uniform (10.43064759 0 0) representing three components of velocity. In a similar manner, inflow, wall and downstream boundary patches have three velocity components.

At this stage it is important to ensure that the boundary conditions (inflow, outflow, top, etc) specified in the above files should be the grid boundary patches (surfaces) generated by the grid generation tool and their names are identical. Further, the two boundaries in \(x-y\) plane obtained due to grid extrusion have been named as symm-left and symm-right with specifying empty boundary conditions forcing Caelus to assume the flow to be in two-dimensions. This completes the setting up of boundary conditions.

Grid file and Physical Properties

The flat-plate grid files that is generated in the Caelus format resides in the constant/polyMesh sub-directory. It contains information relating to the points, faces, cells, neighbours and owners of the mesh.

In addition, the physical properties are specified in various different files present in the directory constant. In the transportProperties file, transport model and kinematic viscosity are specified. The contents of this file are as follows

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 1.5896306e-5;

As the flow is Newtonian, the transportModel is specified with Newtonian keyword and the value of kinematic viscosity (nu) is given which has the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The next file is the turbulenceProperties file, where the type of simulation is specified.

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{

	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				laminar;

Since the flow here is laminar, the simulationType would be laminar. Similarly, in the RASProperties file, RASModel is set to laminar as shown below.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				RASProperties;
}

//--------------------------------------------------------------------------------

RASModel				laminar;


turbulence				off;

printCoeffs				on;

Controls and Solver Attributes

The files required to control the simulation and specifying the type of discretization method along with the linear solver settings are present in the system directory.

The controlDict file is shown below:

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				controlDict;
}

//-------------------------------------------------------------------------------

application				simpleSolver;

startFrom				startTime;

startTime				0;

stopAt					endTime;

endTime					2000;

deltaT					1;

writeControl				runTime;

writeInterval				500;

purgeWrite				0;

writeFormat				ascii;

writePrecision				6;

writeCompression 			uncompressed;

timeFormat				general;

timePrecision				6;

runTimeModifiable			true;

Here, the application simpleSolver refers to the SIMPLE solver that will be used. We also begin the simulation at \(t = 0~s\), which logically explains the need for 0 directory where the data files are read at the beginning of the run. Therefore, we need to set the keyword startFrom to startTime, where startTime would be 0. Since simpleSolver is a steady-state solver, the keyword endTime corresponds to the total number of iterations.The interval at which output files are written is controlled by writeControl and writeInterval keywords.

The discretization schemes and parameters are specified through the fvSchemes file, shown below

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//------------------------------------------------------------------------------

ddtSchemes
{
	default				steadyState;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwind	grad(U);
	div((nuEff*dev(T(grad(U)))))	Gauss 	linear;
}

laplacianSchemes
{
	default					none;
	laplacian(nu,U)			Gauss	linear	corrected;
	laplacian(nuEff,U)		Gauss	linear	corrected;
	laplacian(p)			Gauss	linear	corrected;
	laplacian(rAUf,p)		Gauss 	linear	corrected;
	laplacian((1|A(U)),p) 		Gauss 	linear 	corrected;
}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}



Here, the discretization schemes for finite volume discretization of time-derivative, gradient, divergence and Laplacian terms are specified.

The linear solver controls and tolerances are set in fvSolution as given below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
        version                         2.0;
        format                          ascii;
        class                           dictionary;
        location                        "system";
        object                          fvSolution;
}

//------------------------------------------------------------------------------

solvers
{
        p
        {
            solver          PCG;
            preconditioner
            {
                	preconditioner  		GAMG;
                	smoother        		SSGS;
	                cacheAgglomeration 		true;
        	        nCellsInCoarsestLevel 		10;
                	agglomerator    		algebraicPair;
                	mergeLevels     		1;
            }
            tolerance       1e-08;
            relTol          0.01;
            maxIter         500;
        }
        U
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-7;
                relTol                  0.1;
        }

}

SIMPLE
{
        nNonOrthogonalCorrectors        0;
        pRefCell                        0;
        pRefValue                       0;
        consistent  true;
}

// relexation factors

relaxationFactors
{
        p                               1.0;
        U                               0.7;
}

Different linear solvers are used here to solve pressure and velocity. The GAMG preconditioner is applied to improve convergence of the p solver. Also, by setting the keyword consistent to true, SIMPLEC solver is used and therefore a relaxation factor of 1.0 is applied for p.

The set-up of the directory structure along with the relevant files are completed. Let us verify again by typing the following command (on Linux and Caelus-console prompt) and the directory tree should be identical to the one shown below

tree
.
├── 0
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

Before execution of the solver, renumbering of the grid or mesh needs to be performed as well as checking the quality of the grid. Renumbering the grid-cell list is vital to reduce the matrix bandwidth while the quality check gives us the mesh statistics. Renumbering and mesh quality can be determined by executing the following from the top directory

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

It is suggested for the user to take note of the bandwidth before and after the mesh renumbering. When the checkMesh is performed, the following information is given as an output

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Checking geometry...
    Overall domain bounding box (-0.06 0 0.03) (1.2192 0.15 0.055)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (5.80542e-19 1.1194e-17 1.1403e-14) OK.
    Max cell openness = 2.2093e-16 OK.
    Max aspect ratio = 55.555 OK.
    Minimum face area = 1e-08. Maximum face area = 0.000138887.  Face area magnitudes OK.
    Min volume = 2.5e-10. Max volume = 2.50831e-07.  Total volume = 0.004797.  Cell volumes OK.
    Mesh non-orthogonality Max: 0 average: 0
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 3.85044e-13 average: 9.40402e-15 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End

The mesh non-orthogonality as reported above is 0 and therefore no non-orthogonal corrections are needed in this case. In the case of mesh non-orthogonality being high, certain number of corrections are to be accounted for which can be set in the fvSolution file with the keyword nNonOrthogonalCorrectors. The next step is to execute the solver and monitoring the progress of the solution. The solver is always executed from the top directory which is ACCM_flatPlate2D in our case as below

caelus run -l my-flat-plate.log -- simpleSolver

Now the simulation begins and the output of the solution process is written to the log file, my-flat-plate.log. In another the terminal window the solver process a ca nbe watched through plotting of the residuals

caelus logs -w my-flat-plate.log

Now the convergence of pressure can be seen with respect to number of iterations along with other convergence properties.

_images/fp-lam-convergence-tutorials.png

Convergence of pressure with respect to number of iterations.

Results

A brief qualitative data of the simulated flat-plate results are given here. Since the aim here is to obtained the steady solution, the results therefore represent the final steady state condition. In Figure 5, the contours of velocity magnitude are shown which highlights the development of the boundary layer. Since the Reynolds number of the flow is high, thickness of the boundary layer is quite thin in comparison to the length of the plate.

_images/fp-velocity-tutorials.png

Contour of velocity magnitude over the flat-plate

Tee Junction

This tutorial introduces the steady, laminar flow through a two-dimensional \(90^\circ\) tee-junction. Here, we will be using Caelus 9.04 and some of the basic requirements to begin a Caelus simulation will be shown. These include, specifying input data defining boundary conditions, fluid properties and discretization/solver settings. At the end, visualisation is carried out to look at the pressure and velocity contours within the tee-junction. The details in running a Caelus simulation for the tee-junction will be shown in sufficient detail so that the user is able to repeat the numerical experiment.

Objectives

Through the completion of this tutorial, the user will be able to set-up the Caelus simulation for laminar, incompressible flow through a two-dimensional junction and subsequently estimate the flow-split. Following are the steps that will be carried out in this tutorial

  • Background
    • A brief description about the problem

    • Geometry and flow conditions

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Visualising the flow inside the tee-junction

Pre-requisites

It is assumed that the user is familiar with the Linux command line environment using a terminal or Caelus-console (for Windows OS) and that Caelus is installed correctly with appropriate environment variables set. The grid used here is generated using Pointwise and the user is free to use their choice of grid generation tool having exporting capabilities to the Caelus grid format.

Background

The flow in a tee-junction presents with a simple introduction in carrying out separated flow simulation in Caelus. Because of the presence of a side branch, the flow separates forming a recirculating region. This in turn affects the mass flow through main and side branches altering the flow splits. For more details, the user can refer to the validation example show in Tee Junction.

A schematic of the tee-junction geometry is shown in Figure 6. Here, \(L = 3.0~m\) and \(W = 1.0~m\) with a Reynolds number of \(Re_w = 300\) based on the side branch width. The velocity (\(V\)) is assumed to be \(1~m/s\) in the \(y\) direction for simplicity. With these flow parameters, the kinematic viscosity can be evaluated to \(\nu = 0.00333~m^2/s\).

_images/tj-schematic-tutorials.svg

Tee-junction geometry

In the table, the flow parameters are provided.

Flow conditions

\(Re\)

\(V~(m/s)\)

\(p~(m^2/s^2)\)

\(\nu~(m^2/s)\)

300

1.0

0 Gauge

0.00333

Grid Generation

A hexahedral grid is generated for the tee-junction grid using Pointwise. Specific grid generation details are not discussed here, however information regarding the computational domain and boundary conditions are provided. With this, the user will be able to generate an equivalent grid using their choice of tool.

The computational domain should follow the tee-junction geometry and the details are shown in Figure 7. Due to viscous nature of the flow, the velocity at the walls is zero, which should be represented through a no-slip boundary condition (\(u, v, w = 0\)) highlighted in blue. A fully developed laminar flow with a parabolic velocity profile will also be applied as a profile boundary at the inlet. This would ensure that the velocity is fully developed before it approaches the side branch, otherwise requiring to have sufficient length in main branch for the flow to develop. As shown in the geometry, the domain will have two outlets, one at the end of the main channel and the other at the end of side branch. Also of further importance is that the exit pressures at the two outlets are set equal.

_images/tj-domain-tutorials.svg

Tee junction Computational Domain

The 2D structured grid is shown in Figure 8 for a \(x-y\) plane. Caelus is a 3D solver and hence requires a 3D grid although the flow here is assumed to be two-dimensional. The 3D grid was obtained by extruding the 2D grid in the third (\(z\) - direction) dimension by one-cell thick. The two \(x-y\) planes obtained as a result of mesh extrusion needs boundary conditions to be specified. As the flow is assumed to be 2D, we do not need to solve the flow in \(z\) direction and this was achieved by specifying empty boundary condition for each of those two planes.

Note

A velocity value of \(w=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(z\) direction.

_images/tj-grid-tutorials.png

Tee junction Structured Grid

A coarse grid with a total of 2025 cells is made for the tee-junction of which, 90 cells are distributed along the height of the main channel, and 45 along the length of the side branch. The distribution is such that a dimensional length, \(L = 1~m\) has a total of 45 cells and this gives a distribution of \((2/3)45 = 30\) cells for the \((2/3) L\) segment of the main channel. The width \(W\) consists of 15 cells.

Problem definition

We begin with instructions to set-up the tee-junction problem and subsequently configuring the required input files. A full working case can be found in the following location

/tutorials/incompressible/simpleSolver/laminar/ACCM_teeJunction

However,the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

For setting up the problem the following directories are needed:time, constant and system, where relevant files are placed. In this case, the time directory would be named 0 as we begin the simulation at time \(t = 0~s\).

In the 0 sub-directory, two additional files p and U for pressure (\(p\)) and velocity (\(U\)) are present. The input contents of these two files set the dimensions, initial and boundary conditions to the problem. These three forms the principle entries required.

It should be noted that Caelus is case sensitive and therefore the user should set-up the directories (if applicable), files and the contents identical to what is mentioned here.

Boundary Conditions and Solver Attributes

Boundary Conditions

Referring to Figure 7, the following boundary conditions will be applied:

  • Inlet
    • Velocity: Parabolic velocity profile; average velocity of \(v = 1.0~m/s\) in \(y\) direction

    • Pressure: Zero gradient

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Outlet-1
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Outlet-2
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Initialisation
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero Gauge pressure

The first quantity to define would be the pressure (\(p\)) and this is done by in file p, which can be opened using a text editor.

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*-----------------------------------------------------------------------------*/
FoamFile
{
	version				2.0;
	format				ascii;
	class				volScalarField;
	location			"0";
	object				p;
}

//-------------------------------------------------------------------------------

dimensions				[0 2 -2 0 0 0 0];

internalField				uniform 0;

boundaryField
{
	wall
	{
		type			zeroGradient;
	}
	inlet
	{
		type			zeroGradient;
	}
	outlet-1
	{
		type			fixedValue;
		value			uniform	0;
	}
	outlet-2
	{
		type			fixedValue;
		value			uniform 0;
	}
	symm-left-right
	{
		type			empty;
	}
}

As we can see, the above file begins with a dictionary named FoamFile which contains standard set of keywords such as version, format, location, class and object names. This is followed by the principle elements

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0;

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

In a similar manner, the input data for the velocity file is shown below

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*-----------------------------------------------------------------------------*/
FoamFile
{
	version				2.0;
	format				ascii;
	class				volVectorField;
	object				U;
}

//-------------------------------------------------------------------------------

dimensions				[0 1 -1 0 0 0 0];

internalField				uniform (0 0 0);

boundaryField
{
	wall
	{
		type			fixedValue;
		value			uniform (0 0 0);
	}
	inlet           
   	{
		type			groovyBC;
		variables		"Vmax=1.0;xp=pts().x;minX=min(xp);maxX=max(xp);para=-(maxX-pos().x)*(pos().x-minX)/(0.25*pow(maxX-minX,2))*normal();";
		valueExpression		"Vmax*para";
		value			uniform (0 1 0);
   	}	
	outlet-1
	{
		type			zeroGradient;
	}
	outlet-2
	{
		type			zeroGradient;
	}
	symm-left-right
	{
		type			empty;
	}
}

As noted above, the principle entries for the velocity filed are self explanatory with the typical dimensional units of \(m/s\) ([0 1 -1 0 0 0 0]). The initialisation of the flow is done at \(0~m/s\) which is set using internalField to uniform (0 0 0); which represents three components of velocity.

As discussed previously, a parabolic velocity profile is set for the inlet. This is done through an external library to Caelus called as groovyBC which allows to specify boundary conditions in terms of an expression. In this case an expression for a parabolic velocity profile in the \(y\) direction is obtained by setting the following expression

"Vmax=1.0;xp=pts().x;minX=min(xp);maxX=max(xp);para=-(maxX-pos().x)*(pos().x-minX)/(0.25*pow(maxX-minX,2))*normal();"

and the velocity at the centerline is uniform at \(1~m/s\) represented through uniform (0 1 0);

The boundary conditions (inlet, outlet, wall, etc) specified above should be the grid boundary patches (surfaces) generated by the grid-generation tool. It should be ensured by the user that their names are identically matched. In addition, the two boundaries in \(x-y\) plane obtained due to grid extrusion are named as symm-left-right with applying empty boundary conditions enforcing the flow to be in two-dimensions. It should however be noted that the two planes are grouped together and the empty patch is applied. This is a capability of Caelus, where similar boundaries can be grouped together and is also used for the wall boundary, where multiple walls are present in tee-junction.

Grid file and Physical Properties

The grid that has been generated for Caelus format is placed in the polyMesh sub-directory of constant. Additionally, the physical properties are specified in three different files, placed in the constant sub-directory. The first file transportProperties, contains the detail about the transport model for the viscosity and kinematic viscosity. The contents are as follows

/*-----------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*-----------------------------------------------------------------------------*/
FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 0.003333;

We use Newtonian; keyword as the flow is solved under Newtonian assumption, and a kinematic viscosity (\(nu\)) with the units \(m^2/s\) ([0 2 -1 0 0 0 0]) is specified.

The next file in the constant sub-directory is the turbulenceProperties. Here, the type of simulation through the keyword simulationType is set to be laminar; as shown below

/*-----------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*-----------------------------------------------------------------------------*/
FoamFile
{

	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//-----------------------------------------------------------------------------

simulationType			laminar;

Similarly, in the RASProperties file, RASModel is set to laminar.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				RASProperties;
}

//--------------------------------------------------------------------------------

RASModel				laminar;


turbulence				off;

printCoeffs				on;

Controls and Solver Attributes

The necessary files to control the simulation and specify solver attributes such as discretization method, linear solver settings can be found in the system directory. The controlDict file contains information regarding the simulation as shown below

/*-----------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*-----------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				controlDict;
}

		
//-------------------------------------------------------------------------------

application				simpleSolver;

startFrom				startTime;

startTime				0;

stopAt					endTime;

endTime					3000;

deltaT					1;

writeControl				runTime;

writeInterval				1000;

purgeWrite				0;

writeFormat				ascii;

writePrecision				6;

writeCompression 			uncompressed;

timeFormat				general;

timePrecision				6;

runTimeModifiable			true;


libs (
      "libsimpleSwakFunctionObjects.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
     );

Since groovyBC is used, few relevant libraries are imported by calling the following soon at the end of the file.

libs
(
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
);

Next, the application simpleSolver; referring to the SIMPLE solver is used in this simulation. As we begin the simulation at \(t = 0~s\), we need the boundary condition files to be present in the 0 directory, which has been formerly done. The keywords, startTime to startTime is used, where startTime is set to a value 0. Since simpleSolver is a steady-state solver, the keyword endTime corresponds to the total number of iterations.The interval at which output files are written is controlled by writeControl and writeInterval keywords.

The schemes for finite volume discretization are specified through fvSchemes file with the contents as follows

/*-----------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*-----------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//------------------------------------------------------------------------------

ddtSchemes
{
	default				steadyState;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwindBJ	grad(U);
	div((nuEff*dev(T(grad(U)))))	Gauss 	linear;
}

laplacianSchemes
{
	default				none;
	laplacian(nu,U)			Gauss 	linear 	corrected;
	laplacian(nuEff,U)		Gauss 	linear 	corrected;
	laplacian(p)			Gauss 	linear 	corrected;
	laplacian(rAUf,p)		Gauss 	linear	corrected;
	laplacian((1|A(U)),p)		Gauss 	linear 	corrected;
}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}


As apparent from the above file, discretization schemes are set for time-derivative, gradient, divergence and Laplacian terms.

In the final file, fvSolution, linear solver settings are made as given below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
        version                         2.0;
        format                          ascii;
        class                           dictionary;
        location                        "system";
        object                          fvSolution;
}

//------------------------------------------------------------------------------

solvers
{
        p
        {
                solver                  PCG;
                preconditioner          SSGS;
                tolerance               1e-8;
                relTol                  0.01;
        }
        U
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-7;
                relTol                  0.01;
        }

}

SIMPLE
{
        nNonOrthogonalCorrectors        0;
        pRefCell                        0;
        pRefValue                       0;
        consistent  true;
}

// relexation factors

relaxationFactors
{
        p                               1.0;
        U                               0.7;
}

In the above file, different linear solvers can be seen to be used to solve pressure and velocity fields. By setting the keyword consistent to true, SIMPLEC solver is used and therefore a relaxation factor of 1.0 is applied for p. Further, the grid used here is perfectly orthogonal and therefore the orthogonal correction specified via nNonOrthogonalCorrectors is set to 0.

With these, the set-up of the relevant directories and files are completed. Let us view the directory structure to ensure all are present. The tree should be identical to the one shown below

tree
.
├── 0
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

The execution of the solver involves few different steps. The first of which is to renumber the grid or mesh followed by checking the mesh quality. Renumbering reduces the matrix bandwidth while quality check shows the mesh statistics. These can be performed as follows

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

During the process of renumbering, grid-cell bandwidth information before and after renumberMesh is shown and the user can take a note of this. The mesh statistics are as shown below after invoking checkMesh

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (0 0 -0.072111) (4 6 0.072111)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (1.07982e-18 -2.28423e-18 1.37054e-18) OK.
    Max cell openness = 1.98307e-16 OK.
    Max aspect ratio = 2.65996 OK.
    Minimum face area = 0.00127855. Maximum face area = 0.0131236.  Face area magnitudes OK.
    Min volume = 0.000184395. Max volume = 0.00119416.  Total volume = 1.298.  Cell volumes OK.
    Mesh non-orthogonality Max: 0.00224404 average: 0.000335877
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 2.64853e-05 average: 1.09754e-06 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End

From the above information, the mesh non-orthogonality is very small and therefore no non-orthogonal corrections are required for the solver to be carried out and we set nNonOrthogonalCorrectors to 0 in the fvSolution file. In the next step, we will execute the solver and monitor the progress of the simulation. The solver should be executed from the top level directory

caelus run -l my-tee-junction.log -- simpleSolver

The progress of the simulation is written to the log file my-tee-junction.log, which can further be processed to get the convergence history. In a separate terminal window use

caelus logs -w my-tee-junction.log

The plot indicates the convergence history for pressure and other variables with respect to number of iterations. The same for pressure is shown in Figure 9.

_images/tj-convergence-tutorials.png

Convergence of pressure with respect to number of iterations.

Results

The solution obtained for the tee-junction at steady state is shown here using qualitative contour plots. In Figure 10, velocity magnitude and pressure contour plots are shown. In addition, streamlines superimposed on the velocity magnitude is given. The change in the flow pattern due to the presence of side branch is quite evident from the velocity magnitude contour. The streamlines particularly facilitate to visualise the flow separation phenomenon which is occurring in this case, just before the flow entering the side branch. Also to note is the velocity profile at the inlet, which is fully developed as expected.

_images/tj-velocitypressure-tutorials.png

Velocity magnitude and pressure contour plots within the tee-junction

Circular Cylinder

The simulation of laminar, incompressible flow over a two-dimensional circular cylinder is shown in this tutorial. Caelus 9.04 will be used and the details of setting up directory structure, fluid properties, boundary conditions, etc will be shown. This tutorial introduces to the user in carrying out a time-dependent simulation of a externally separated flow. Further to this, the flow around the cylinder would be visualised using velocity and pressure contours.

Objectives

Through this tutorial, the user would be familiar in setting up a time-dependent Caelus simulation for laminar, incompressible flow in two-dimensions for external separated flows. Following will be some of the steps that will be performed.

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Showing the flow structure in near and far wake

Pre-requisites

It is assumed that the user is familiar with the Linux command line environment using a terminal or Caelus-console (for Windows OS) and that Caelus is installed correctly with appropriate environment variables set. The grid used here is generated using Pointwise and the user is free to use their choice of grid generation tool having exporting capabilities to the Caelus grid format.

Background

The flow over a circular cylinder is a classical configuration to study separation and its related phenomena. This provides an ideal case for the user to use Caelus for flow over bluff bodies that represents externally separated flow. It has been shown that for low Reynolds number flows (\(40 \leq Re \leq 150\)), period vortex shedding occurs in the wake. This phenomena of vortex shedding behind bluff bodies is referred as the Karman Vortex Street [2]. The frequency associated with the oscillations of vortex streets can be expressed via Strouhal number (\(St\)) which is non-dimensional relating to the frequency of oscillations (\(f\)) of vortex shedding, cylinder diameter (\(D\)) and the flow velocity (\(U\)) as

\[St = \frac{fD}{U}\]

For a Reynolds number based on the cylinder diameter of \(Re_D = 100\), the Strouhal number is about \(St\approx 0.16-0.17\) as determined through experiments and is nearly independent of the diameter of the cylinder. More details are discussed in section Circular Cylinder

The diameter chosen for the cylinder here is \(D = 2~m\) and is the characteristic length for the Reynolds number, which is (\(Re_D = 100\)). The velocity is assumed to be \(U = 1~m/s\) in the \(x\) direction. Based on these, the kinematic velocity can be estimated as \(\nu = 0.02~m^2/s\). The below Figure 11 shows the schematic of the cylinder in the \(x-y\) plane.

_images/cc-schematic-tutorials.svg

Schematic of the circular cylinder in two-dimensions

In the below table a summary of the freestream conditions are given

Freestream conditions

\(Re_D\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(\nu~(m^2/s)\)

100

1.0

\((0)\) Gauge

\(0.02\)

Grid Generation

A hexahedral grid around the circular cylinder was development with a O-grid topology using Pointwise. Specific grid generation details are omitted while proving sufficient details regarding computational domain and boundary conditions. With these details the user should be able to recreate the required grid for the two-dimensional cylinder

A rectangular computational domain in the \(x-y\) plane has been constructed surrounding the circular cylinder as shown in Figure 12. A full cylinder was considered as the vortices developed behind the cylinder are of the periodic nature. Upstream of the cylinder, the domain is extended by 5 cylindrical diameters, whereas, downstream it was extended up to 20. Since the flow here is viscous dominated, sufficient downstream length is required to capture the initial vortex separation from the surface of the cylinder and the subsequent shedding process. In the \(y\) direction, the domain is extended up to 5 cylindrical diameters on either side. From the figure, multiple inlet boundaries to this domain can be seen, one at the far end of the upstream and the other two for the top and bottom boundaries. This type of configuration is particularly needed to appropriately model the inflow, very similar to an undisturbed flow in an experimental set-up. It should be noted here that for top and bottom boundaries, the flow is in the \(x\) direction. Outlet boundary to the domain is placed at the downstream end which is at 20 cylindrical diameters. Since the fluid behaviour is viscous, the velocity at the wall is zero (\(u, v, w = 0~m/s\)) represented here through a no-slip boundary condition as highlighted in blue.

_images/cc-domain-tutorials.svg

Circular cylinder computational domain

The hexahedral grid around the cylinder is shown in Figure 13 for a \(x-y\) plane. Caelus is a 3D solver and requires the grid to be in 3D. This was obtained by extruding the grid in the \(x-y\) plane by one cell thick and subsequently specifying empty boundary conditions to the extruded planes. This enforces that Caelus to solve the flow in two dimensions assuming symmetry in the \(z\) direction as is required in this case due to the two-dimensionality of the flow.

Note

A velocity value of \(w=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(z\) direction.

_images/cc-grid-tutorials.png

O-grid around the cylinder and structured gird representation

The 2D domain consisted of 9260 cells in total. An O-grid topology is constructed around the cylinder and extended to a maximum of 1 cylindrical diameter in the radial direction with a distribution of 10 cells. Around the cylinder, 84 cells are used giving 21 cells per each O-grid block. Upstream of the O-grid in the \(x\) direction, 31 cells were used and 100 in the downstream. The region of interest is about 10 diameters downstream, where the grids are refined. In the \(y\) direction, both positive and negative axes, 21 cells are used beyond the O-grid region.

Problem definition

We first begin with instructions to set-up the circular cylinder case in addition to the configuration files that are needed. A full working case can be found in the following directory:

/tutorials/incompressible/pimpleSolver/laminar/ACCM_circularCylinder/

However, the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

For setting up this problem, Caelus requires time, constant and system sub-directories within the main working directory. Since we start the simulation at time, t = 0 s, a time sub-directory named 0 is required.

The 0 sub-directory contains files, p and U, which describe the dimensions, initialisation and boundary conditions of pressure (\(p\)) and velocity (\(U\)) respectively.

It is to be noted that Caelus is case sensitive and therefore the user should set-up the directories (if applicable), files and the contents identical to what is mentioned here.

Boundary Conditions

We now begin with setting up the boundary conditions. Referring back to Figure 12, the following are the boundary conditions that need to be specified:

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 1.0~m/s\) in \(x\) direction

    • Pressure: Zero gradient

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 1.0~m/s\) in \(x\) direction

    • Pressure: Zero Gauge pressure

Beginning with the pressure (\(p\)), the dictionary begins with FoamFile containing standard set of keywords for version, format, location, class and object names as shown below.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				volScalarField;
	object				p;
}

//--------------------------------------------------------------------------------

dimensions				[0 2 -2 0 0 0 0];

internalField				uniform 0;

boundaryField
{
	inlet-1
	{
		type			zeroGradient;
	}
	inlet-2
	{
		type			zeroGradient;
	}
	outlet
	{
		type			fixedValue;
		value			uniform 0;
	}
	symmetry
	{
		type			empty;
	}
	wall
	{
		type			zeroGradient;
	}
}

The following provides the explanation to the principle entries

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

In a similar manner, the file U contains the following entries

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*-------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				volVectorField;
	object				U;
}

//--------------------------------------------------------------------------------

dimensions				[0 1 -1 0 0 0 0];

internalField				uniform (1.0 0 0);

boundaryField
{
	inlet-1
	{
		type			fixedValue;
		value			uniform (1.0 0 0);
	}
	inlet-2
	{
		type			fixedValue;
		value			uniform (1.0 0 0);
	}
	outlet
	{
		type			zeroGradient;
	}
	symmetry
	{
		type			empty;
	}
	wall
	{
		type			fixedValue;
		value			uniform (0 0 0);
	}
}

The principle entries for velocity field are self explanatory and the dimension are typical for velocity with the units \(m/s\) ([0 1 -1 0 0 0 0]). Since we initialise the flow with a uniform freestream velocity, we set the internalField to uniform (1.0 0 0) representing three components of velocity. Similarly, inlets and wall boundary patches have three velocity components.

Before proceeding further, it is important to ensure that the boundary conditions (inlet, outlet, wall, etc) specified in the above files should be the grid boundary patches (surfaces) generated by the grid generation tool and their names are identical. Further, the two boundaries in \(x-y\) plane obtained due to grid extrusion have been named as symm-left and symm-right with specifying empty boundary conditions forcing Caelus to assume the flow to be in two-dimensions. This completes the setting up of boundary conditions.

Grid file and Physical Properties

The circular cylinder grid file is placed in the constant/polyMesh sub-directory. Additionally, the physical properties are specified in different files present in the constant directory.

The first file is transportProperties, where the transport model and the kinematic viscosity are specified. The contents of this file are as follows

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 0.02;

Since the flow is Newtonian, the transportModel is specified with Newtonian keyword and the value of kinematic viscosity (nu) is given which has the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The final in this sun-directory is the turbulenceProperties file, where the type of simulation is specified as

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{

	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				laminar;

As the flow here is laminar, the simulationType would be laminar.

Controls and Solver Attributes

This section details the files required to control the simulation, specifying the type of discretization method and linear solver settings. These files can be found in the system directory.

The first file, controlDict is shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				controlDict;
}

//--------------------------------------------------------------------------------

application				pimpleSolver;

startFrom				startTime;

startTime				0;

stopAt					endTime;

endTime					360;

deltaT					0.01;

writeControl			runTime;

writeInterval			1;

purgeWrite				0;

writeFormat				ascii;

writePrecision			6;

writeCompression		uncompressed;

timeFormat				general;

timePrecision			6;

runTimeModifiable		true;

//-------------------------------------------------------------------------------

// Function Objects to obtain mean values

functions
{
	forces
	{
        type                forces;
        functionObjectLibs	("libforces.so");
        patches             ( wall );
        CofR                (0 0 0);
        rhoName             rhoInf;
        rhoInf              1;
        writeControl        timeStep;
        writeInterval       50;
     }
}
//------------------------------------------------------------------------------


In this file, the application pimpleSolver refers to the PIMPLE solver that is used in this tutorial. We also begin the simulation at t = 0 s, which logically explains the need for 0 directory where the data files are read at the beginning of the run. Therefore, we need to set the keyword startFrom to startTime, where startTime would be 0. The simulation is run for 360 seconds specifying through the keywords stopAt and endTime. Since PIMPLE solver is time-accurate, we also need to set the time-step via deltaT. The results are written at every 0.01 seconds via writeControl and writeInterval keywords.

The discretization schemes and its parameters are specified in the fvSchemes file which is shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//--------------------------------------------------------------------------------

ddtSchemes
{
	default				Euler;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwindBJ grad(U);
	div((nuEff*dev(T(grad(U)))))	Gauss   linear;
}

laplacianSchemes
{
	default				none;
	laplacian(nu,U)			Gauss 	linear 	corrected;
	laplacian(nuEff,U)		Gauss 	linear 	corrected;
	laplacian(p)			Gauss	linear 	corrected;
	laplacian((1|A(U)),p)           Gauss   linear  corrected;
	laplacian(rAUf,p)               Gauss   linear  corrected;

}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}


In the fvSolution file, linear solver controls and tolerances are set as shown in the below file

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				fvSolution;
}

//--------------------------------------------------------------------------------

solvers
{
	p
	{
		solver			PCG;
		preconditioner		SSGS;
		tolerance		1e-6;
		relTol			0.05;
	}
	pFinal
	{
		solver			PCG;
		preconditioner		SSGS;
		tolerance		1e-7;
		relTol			0;
	}
	UFinal
	{
		solver			PBiCGStab;
		preconditioner		USGS;
		tolerance		1e-6;
		relTol			0;
	}
	U
	{
		solver			PBiCGStab;
		preconditioner		USGS;
		tolerance		1e-6;
		relTol			0;
	}
}

PIMPLE
{
	nCorrectors                     2;
	nNonOrthogonalCorrectors	1;
	pRefCell			0;
	pRefValue			0;
}

Note that different linear solvers are used here to solve for pressure and velocity. Also, nNonOrthogonalCorrectors is set to 1, since there is some degree of non-orthogonality in the grid.

At this stage, the directory structure should be identical to the one shown below. This can be done by using the tree command on Linux OS.

tree
.
├── 0
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   ├── points
│   │   └── sets
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

Prior to solver execution, renumbering of the grid or mesh needs to be performed as well as checking the quality of the grid. Renumbering the grid-cell list is vital to reduce the matrix bandwidth while the quality check gives us the mesh statistics. Renumbering and mesh quality can be determined by executing the following from the top directory

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

The user should take note of the bandwidth before and after the mesh renumbering. When the checkMesh is performed, the mesh statistics are shown as below

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (-10 -10 0) (40 10 0.537713)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (-2.57817e-19 1.67414e-19 -4.29222e-16) OK.
    Max cell openness = 2.19645e-16 OK.
    Max aspect ratio = 3.66844 OK.
    Minimum face area = 0.00895343. Maximum face area = 0.586971.  Face area magnitudes OK.
    Min volume = 0.00481437. Max volume = 0.315622.  Total volume = 536.025.  Cell volumes OK.
    Mesh non-orthogonality Max: 14.6136 average: 1.75565
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 0.206341 average: 0.00112274 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

In the next step, execution of the solver can be performed while monitoring the progress of the solution. The solver is always executed from the top directory which is ACCM_circularCylinder in this case.

caelus run -l my-circular-cylinder.log -- pimpleSolver

The output of the solution process is saved in the log file, my-circular-cylinder.log. In a separate terminal window the convergence history can be monitored using

caelus logs -w my-circular-cylinder.log

With the above, the convergence of pressure along with other variables can be seen with respect to time. The same is shown in the Figure 14 and due to the periodic nature of vortex shedding, oscillatory convergence of pressure is seen.

_images/cc-convergence-tutorials.png

Convergence of pressure with respect to time

Results

In this section, some qualitative results obtained as a result of steady vortex shedding in the wake of the cylinder is shown. Figure 15 shows the velocity magnitude and pressure contour for the flow over the cylinder. The formation of vortex shedding is clearly visible from the velocity contour and the pressure variation due to oscillating vortex in the wake. The vortex break-up that occurs in the near wake of the cylinder, travels several diameters downstream eventually diffusing into the flow.

_images/cc-velocitypressure-tutorials.png

Velocity magnitude and pressure contour plots for the flow over the 2D cylinder

Triangular Cavity

In this tutorial, we carry out laminar, incompressible flow inside a triangular cavity in two-dimensions using Caelus 9.04. Details regarding setting up of the directories, fluid properties, boundary conditions, etc will be discussed. Subsequent to this, post-processing the velocity distribution along the center-line will be shown.

Objectives

With the completion of this tutorial, the user would be familiar with setting up a steady-state Caelus simulation for laminar, incompressible flow over lip-driven cavity. Following are the steps that would be performed

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Showing the flow structure inside the cavity

Pre-requisites

It is assumed that the user is familiar with the Linux command line environment using a terminal or Caelus-console (for Windows OS) and that Caelus is installed correctly with appropriate environment variables set. The grid used here is generated using Pointwise and the user is free to use their choice of grid generation tool having exporting capabilities to the Caelus grid format.

Background

Flow inside lid-driven cavities is a classical case to study cases with flow recirculation. In the present case, the top wall of the cavity moves at constant velocity initiating a recirculation motion with the cavity and as a consequence, a boundary layer develops in the direction of the moving lid. The feature that is of interest is the velocity distribution along the center-line of cavity. Details regarding the validation of this case is given in Triangular Cavity.

The triangular cavity schematic is shown in Figure 16. Here D represents the cavity depth which is 4 m and the top width, W = 2 m. For this configuration, the Reynolds number based on the cavity depth is 800 and the wall velocity is assumed and set to 2 m/s. This give us with a kinematic viscosity of 0.01. Note that the two-dimensional plane considered here is in \(x-z\).

_images/tc-schematic-tutorials.png

Schematic of a triangular cavity

The below table gives the summary of the freestream conditions used here

Freestream conditions

\(Re_D\)

\(U~(m/s)\)

\(p~(Pa)\)

\(\nu~(m^2/s)\)

800

2.0

\((0)\) Gauge

\(0.01\)

Grid Generation

A hybrid-grid consisting of quadrilateral and triangular cells has been generated for this cavity geometry using Pointwise. Details regarding the generation of grid is not covered in this tutorial, however details regarding computational domain and boundary conditions are provided.

The computational domain for the triangular cavity follows the cavity geometry due to internal flow configuration. This is in contrast to other flow configurations here where the flow was over the region of interest. A schematic of the domain is shown in Figure 17. The velocity at the cavity walls (high lighted in blue) is zero, represented through a no-slip boundary, wherein \(u, v, w = 0\). Whereas the top wall has a uniform velocity in the x-direction.

_images/tc-domain-tutorials.svg

Computational domain for a triangular cavity

The hybrid grid is shown in Figure 18. As can be seen, up to a depth of D = 1.35 m, structured grids are used and after which it is filled with triangular unstructured elements. In the structured domain, 40 X 40 cells are used respectively. In the 2D domain, a total of 5538 cells are present, however the polyMesh format of Caelus should be in 3D. This was achieved by extruding the grid in the \(x-y\) plane by one cell thick and subsequently specifying empty boundary conditions to the extruded planes. This should force Caelus to solve the flow the flow in 2D in the extruded direction, which is \(z\).

Note

A velocity value of \(w=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(z\) direction.

_images/tc-grid-tutorials.png

Hybrid grid representation for a triangular cavity

Problem definition

This section provides the case set-up procedures along with the configuration files that are needed. A full working case of this problem is given in the following location:

/tutorials/incompressible/pimpleSolver/laminar/ACCM_triangularCavity/

However,the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

Caelus requires time, constant and system sub-directories within the main my-triangular-cavity working directory. Since we start the simulation at time, t = 0 s, a time sub-directory named 0 is required.

The 0 sub-directory contains the pressure, p and velocity U files. The contents of these files set the dimensions, initialisation and boundary conditions to the case, which form the three principle entries required.

If applicable, the user should take precautions in setting the directories and files as Caelus is case sensitive. These have to be identical to the names mentioned here.

Boundary Conditions

Next we start with setting-up of the boundary conditions. Referring back to Figure 17, the following are the boundary conditions that need to be specified:

  • Moving wall
    • Velocity: Fixed uniform velocity \(u = 2.0~m/s\) in \(x\) direction

    • Pressure: Zero gradient

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 0~m/s\) in \(x, y, z\) directions

    • Pressure: Zero Gauge pressure

The file p for pressure contains the following information

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				volScalarField;
	object				p;
}

//--------------------------------------------------------------------------------

dimensions				[0 2 -2 0 0 0 0];

internalField				uniform 0;

boundaryField
{
	fixed-walls
	{
		type			zeroGradient;
	}
	moving-wall
	{
		type			zeroGradient;
	}
    symm
	{
		type			empty;
	}
}

As noted from the above file, the dictionary begins with FoamFile containing standard set of keywords for version, format, location, class and object names. The following provides the explanation to the principle entries

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

Similarly, the contents for the file U is as shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
	version				2.0;
	format				ascii;
	class				volVectorField;
	location			"0";
	object				U;
}

//--------------------------------------------------------------------------------

dimensions				[0 1 -1 0 0 0 0];

internalField				uniform (0 0 0);

boundaryField
{
	fixed-walls
	{
		type            	fixedValue;
        value				uniform (0 0 0);
	}
	moving-wall
	{
		type            	fixedValue;
        value				uniform (2 0 0);
	}
    symm
	{
		type			empty;
	}
}

The principle entries for velocity field are self explanatory and the dimension are typical for velocity with the units \(m/s\) ([0 1 -1 0 0 0 0]). Here, since the top wall moves with a velocity, we set a uniform (2.0 0 0) for moving-wall boundary patch. Similarly, the cavity walls (fixed-walls) have uniform (1.0 0 0).

At this stage, the user should ensure that the boundary conditions (fixed-walls, moving-wall and symm) specified in the above files should be the grid boundary patches (surfaces) generated by the grid generation tool and their names are identical. Further, the two boundaries in \(x-y\) plane obtained due to grid extrusion have been combined and named as symm with specifying empty boundary conditions forcing Caelus to assume the flow to be in two-dimensions. With this, the setting up of boundary conditions are completed.

Grid file and Physical Properties

The triangular cavity grid is placed in constant/polyMesh sub-directory. In addition, the physical properties are specified in different files, all present in the constant directory.

The transport model and the kinematic viscosity are specified in the file transportProperties. The contents of this file are as follows

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 0.01;

Since the viscous behaviour is modelled as Newtonian, the transportModel is specified with the keyword Newtonian and the value of kinematic viscosity is set with has the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The final file in this class is the turbulenceProperties file, in which the type of simulation is specified as

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{

	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				laminar;

The flow being laminar, the simulationType is set to laminar.

Controls and Solver Attributes

In this section, the files required to control the simulation, setting the discretization parameters and linear solver settings are discussed can be found in the system directory.

The controlDict file is shown below.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				controlDict;
}

//-------------------------------------------------------------------------------

application				pimpleSolver;

startFrom				startTime;

startTime				0;

stopAt					endTime;

endTime					60;

deltaT					0.01;

writeControl				runTime;

writeInterval				1;

purgeWrite				0;

writeFormat				ascii;

writePrecision				6;

writeCompression			uncompressed;

timeFormat				general;

timePrecision				6;

runTimeModifiable			true;


In the controlDict file, pimpleSolver refers to the application, PIMPLE solver that is used here. The simulation is also started at t = 0 s and this logically explains the need for 0 directory where the data files are read at the beginning of the run. Therefore, the keyword startFrom to startTime, where startTime would be 0 is needed. The simulation is run for 200 seconds specifying through the keywords stopAt and endTime. Since PIMPLE solver is time-accurate, we also need to set the time-step via deltaT. The results are written at every 0.01 seconds via writeControl and writeInterval keywords.

The discretization schemes and its parameters are specified in the fvSchemes file which is shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//--------------------------------------------------------------------------------

ddtSchemes
{
	default				Euler;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwindBJ grad(U);
	div((nuEff*dev(T(grad(U)))))	Gauss   linear;
}

laplacianSchemes
{
	default				none;
	laplacian(nu,U)			Gauss 	linear 	corrected;
	laplacian(nuEff,U)		Gauss 	linear 	corrected;
	laplacian(p)			Gauss 	linear 	corrected;
	laplacian((1|A(U)),p)           Gauss   linear  corrected;
	laplacian(rAUf,p)		Gauss 	linear 	corrected;

}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}


In the following file, which is the fvSolution the linear solver controls and tolerances are set as shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				fvSolution;
}

//------------------------------------------------------------------------------

solvers
{
	p
	{
		solver			PCG;
		preconditioner		SSGS;
		tolerance		1e-10;
		relTol			0;
	}
	pFinal
	{
		solver			PCG;
		preconditioner		SSGS;
		tolerance		1e-10;
		relTol			0;
	}
	UFinal
	{
		solver			PBiCGStab;
		preconditioner		USGS;
		tolerance		1e-15;
		relTol			0;
	}
	U
	{
		solver			PBiCGStab;
		preconditioner		USGS;
		tolerance		1e-15;
		relTol			0;
	}
}

PIMPLE
{
	nCorrectors                     2;
	nNonOrthogonalCorrectors	1;
	pRefCell			0;
	pRefValue			0;
}

It should be noted that different linear solvers are used to solve for pressure a velocity. Since we have used hybrid grids, nNonOrthogonalCorrectors is set to 1 as there would be some degree of non-orthogonality present due to triangular nature of the geometry.

This completes the set-up of directory structure along with all the necessary files. This can be verified by using the following commands and the directory tree should be identical to the one shown below

tree
.
├── 0
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── fvSchemes
    ├── fvSolution
Execution of the solver

Renumbering and checking the mesh quality is needed before the solver is executed. Renumbering the grid-cell list is vital to reduce the matrix bandwidth while the quality check gives us the mesh statistics. Renumbering and mesh quality can be determined by executing the following from the top directory

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

The user should take note of the bandwidth before and after the mesh renumbering. When the checkMesh is performed, the mesh statistics are shown as below

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (-1 -4 0) (1 0 0.0447214)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (-6.25534e-18 -5.30678e-18 -6.4712e-16) OK.
    Max cell openness = 2.16191e-16 OK.
    Max aspect ratio = 2.97779 OK.
    Minimum face area = 8.00174e-05. Maximum face area = 0.00322809.  Face area magnitudes OK.
    Min volume = 3.57849e-06. Max volume = 0.000109372.  Total volume = 0.178886.  Cell volumes OK.
    Mesh non-orthogonality Max: 41.8682 average: 9.34065
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 0.621726 average: 0.0313562 OK.
    Coupled point location match (average 0) OK.

Mesh OK.


End

Solver can now be executed and the progress of the solution can be monitored. The solver is always executed from the top directory which is my-triangular-cavity in this case.

caelus run -l my-triangular-cavity.log pimpleSolver

The output of the solver progress is saved in the log file, my-triangular-cavity.log. The log file (my-triangular-cavity.log) can be monitored to look at the convergence history. In a separate terminal window use

caelus logs -w my-triangular-cavity.log

The convergence of the pressure can now be seen with respect to time.

_images/tc-convergence-tutorials.png

Convergence of pressure with respect to time

Results

The flow within the cavity is shown here at steady state condition. Figure 20 presents the velocity and pressure contour plots. In addition, the streamlines indicate the multiple vortices formed within the cavity.

_images/tc-velocitypressure-tutorials.png

Velocity magnitude and pressure contour plots within the triangular cavity

Spherical Cavity

In this tutorial, we look at simulating buoyant flow inside a spherically heated cavity using Caelus 9.04 which will be a three-dimension case. Because of the natural convection process, the fluid initiates a motion due to buoyancy effects. This results in steady isotherms which is of interest in this tutorial and will be compared with the analytical data.

Objectives

With this tutorial, the user would be familiar in setting up a steady-state Caelus simulation for laminar, buoyant flow within a spherically heated cavity. The steps that would be performed in this tutorial are as follows

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Showing the flow structure inside the cavity

Pre-requisites

It is assumed that the user is familiar with the Linux command line environment using a terminal or Caelus-console (for Windows OS) and that Caelus is installed correctly with appropriate environment variables set. The grid used here is generated using Pointwise and the user is free to use their choice of grid generation tool having exporting capabilities to the Caelus grid format.

Background

The flow inside a spherically heated cavity is an interesting case of buoyant flow simulation. Here, the flow is enclosed in a spherical cavity and the wall is heated with a specified temperature gradient. Due to the natural convection process, the fluid initiates a motion as a result of buoyancy effects. The characteristic feature that is of interest is the steady isotherms. Details regarding the validation of this case is given in Spherical Cavity.

The schematic representation of the sphere is shown in Figure 21 and only half of the sphere is considered here having the plane of symmetry in #:math:x-y plane at \(z=0\). The radius of the sphere is chosen to be \(r=0.5~m\), such that \(x=0\) at \(r=0\) and \(x=0.5\) at \(r=0.5\).

_images/sphere-schematic-tutorials.png

Schematic of a sphere

The thermal boundary condition to the spherical wall was generated by specifying temperature (\(T\)) as a function of distance (\(x\)), which are as follows:

\[T = x\]

with this,

\[T = -0.5~K \quad \text{at} \quad x = -0.5~m\]
\[T = 0.5~K \quad \text{at} \quad x = 0.5~m\]

To obtain a smooth distribution of temperature, sufficient cells in the radial direction is required. For buoyancy driven flows, the non-dimensional number, Rayleigh number (\(Ra\)) is often used which relates buoyancy and viscous effects of the flow. In this case, we will be simulating with a (\(Ra\)) number of 2000 and a Prandtl number of 0.7.

The below table summarises the flow conditions that will be used

Freestream conditions

\(Ra\)

\(Pr\)

\(T~(K)\)

\(p~(m^2/s^2)\)

\(\nu~(m^2/s)\)

\(\beta~(1/K)\)

\(2000\)

\(0.7\)

\(T = x\)

\((0)\) Gauge

\(3.4 \times 10^{-4}\)

\(3.567\times10^{-5}\)

Grid Generation

A hexahedral grid within the sphere was developed via the O-grid topology using Pointwise. Grid generation details are not discussed here, however details regarding the computational domain and boundary conditions are provided.

As noted earlier, the computational domain considered is a half sphere with the plane of symmetry in the \(x-y\) axes at \(z=0~m\). The temperature will be set as given in the above equations and also the initialisation follows the surface temperature (\(T=x\)). In Figure 22 the computational domain, in particular the applied temperature boundary condition when applied is shown.

_images/sphere-domain-tutorials.png

Computational domain and temperature boundary condition for a spherical cavity

The structured O-grid over the spherical wall and on the plane of symmetry is shown in Figure 23. A total of 18564 cells are present within the domain. Over the plane of symmetry, 32 cells are distributed and, over the spherical surface 35 cells are distributed in the radial direction.

_images/sphere-grid-tutorials.png

O-grid representation distribution on the wall and on the plane of symmetry

Problem definition

We begin with instructions to set-up the spherical cavity case and the required configuration files that are needed. A full working case is found in the following directory:

/tutorials/heatTransfer/buoyantBoussinesqSimpleSolver/laminar/ACCM_sphericalCavity/

However,the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

In order to set-up the problem, Caelus requires a time, constant and system sub-directories. Since we will be starting the simulation at time \(t = 0~s\), the time directory would be just 0.

In the 0 sub-directory, few additional files p, p_rgh, alphat, T, and U for pressure, buoyant pressure, turbulent thermal conductivity, temperature and velocity are set respectively. Note that even for a laminar simulation, alphat is required, although a value of 0 would be used. The contents of these files set the dimensions, initialisation and boundary conditions to the case.

The user should be aware that Caelus is case sensitive and therefore the setting up of the directories, files and contents (when applicable) should be identical.

Boundary Conditions and Solver Attributes

Boundary Conditions

The boundary conditions would be set as follows

  • Wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Uniform zero Buoyant Pressure

    • Temperature: Temperature as a function of \(x\) (\(T = x\))

    • Turbulent thermal conductivity: Fixed uniform value of 0

  • Symmetry Plane
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Temperature: Symmetry

    • Turbulent thermal conductivity: Symmetry

  • Initialisation
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Uniform zero Buoyant Pressure

    • Temperature: Temperature as a function of \(x\) (\(T = x\))

    • Turbulent thermal conductivity: A value of 0

Note that to specify a temperature as a function of \(x\), swak4Foam library was used and funkySetFields utility was employed. The usage of this would be shown later.

The first quantity to define would be the pressure (\(p\)) and this is done in the file p, which has the following contents.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    symm
    {
        type            symmetryPlane;
    }
    wall-1
    {
        type            zeroGradient;
    }
    wall-2
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //

The above file begins with a dictionary named FoamFile containing standard set of keywords such as version, format, location, class and object names. The principle elements follows next

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0;

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

Similarly, the input data for the buoyant pressure is shown below

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    symm
    {
        type            symmetryPlane;
    }
    wall-1
    {
        type            fixedFluxPressure;
        gradient        uniform 0;
        rho             rhok;
        value           uniform 0;
    }
    wall-2
    {
        type            fixedFluxPressure;
        gradient        uniform 0;
        rho             rhok;
        value           uniform 0;
    }
}


// ************************************************************************* //

In the next file, alphat is defined as follows.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    symm
    {
        type            symmetryPlane;
    }
    wall-1
    {
        type            fixedValue;
        value           uniform 0;
    }
    wall-2
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

For the temperature, before the funkySetFields expression is used, we need to have the T file with the generic boundary conditions. This is because when funkySetFields is applied, the T file would be overwritten with the profile values.

The final file in this directory is the velocity and the contents are as follows.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    symm
    {
        type            symmetryPlane;
    }
    wall-1
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    wall-2
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
}


// ************************************************************************* //

As noted above, the principle entries for the velocity filed are self explanatory with the typical dimensional units of \(m/s\) ([0 1 -1 0 0 0 0]). The initialisation of the flow is done at \(0~m/s\) which is set using internalField to uniform (0 0 0); which represents three components of velocity.

The boundary conditions (symm, wall-1, wall-2, etc) specified in the above files should be the grid boundary patches (surfaces) that are generated by the grid-generation tool. The user should ensure that their names are identically matched.

Grid file and Physical Properties

The spherical cavity grid is placed in constant/polyMesh sub-directory. Additionally, physical properties are specified in separate files, placed in the constant sub-directory.

The first file is g,wherein the value of acceleration due to gravity is specified. Since we are simulating a buoyancy driven flow, gravity effects should be considered. The contents of g are as follows

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version     			2.0;
	format      			ascii;
	class      			uniformDimensionedVectorField;
	location    			"constant";
	object      			g;
}
// -------------------------------------------------------------------------------

dimensions      			[0 1 -2 0 0 0 0];

value           			( 0 -9.81 0 );

In the next file transportProperties, details about the transport model for viscosity, Prandtl number, coefficient of thermal expansion are specified. The contents are as follows

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

// Laminar viscosity
nu					nu [0 2 -1 0 0 0 0] 3.4e-4;

// Thermal expansion coefficient
beta					beta [0 0 0 -1 0 0 0] 3.5677e-5;

// Reference temperature
TRef         				TRef [0 0 0 1 0 0 0] 0;

// Laminar Prandtl number
Pr          				Pr [0 0 0 0 0 0 0] 0.7;

// Turbulent Prandtl number
Prt           				Prt [0 0 0 0 0 0 0] 0.7;

Here, Newtonian; keyword is used since the flow is under Newtonian assumption and a kinematic viscosity (\(nu\)) with the units \(m^2/s\) ([0 2 -1 0 0 0 0]) is specified. Similarly, the value of beta, TRef, Pr and Prt are specified. Note that a value of 0.7 is used for laminar Prandtl number.

The type of simulation is specified in turbulenceProperties to laminar using the keyword simulationType as shown below

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{

	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				laminar;


In addition to this, RASProperties file is required since we specify turbulent thermal conductivity property.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				RASProperties;
}

//--------------------------------------------------------------------------------

RASModel				laminar;


turbulence				off;

printCoeffs				on;

Controls and Solver Attributes

Here we set-up the necessary files to control the simulation and specifying the solver attributes such as discretization method, linear solver setting, etc and these reside in the system directory.

First, there is the controlDict file with the following information

/*------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
    version         2.0;
    format          ascii;
    class           dictionary;
    location        "system";
    object          controlDict;
}
//-------------------------------------------------------------------------------

application         buoyantBoussinesqSimpleSolver;

startFrom           startTime;

startTime           0;

stopAt              endTime;

endTime             2000;

deltaT              1.0;

writeControl        runTime;

writeInterval       10;

purgeWrite          5;

writeFormat         ascii;

writePrecision      12;

writeCompression    uncompressed;

timeFormat          general;

timePrecision       6;

runTimeModifiable   true;


libs (
      "libsimpleSwakFunctionObjects.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
     );

As we will be using funkySetFields, few relevant libraries are needed and they are imported by using the following lines in the controlDict.

libs
(
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
);

The next is the application, buoyantBoussinesqSimpleSolver which is the buoyancy version of the SIMPLE solver that will be used in this simulation. As we begin the simulation at \(t = 0~s\), we need the boundary condition files to be present in the 0 directory, which has been formerly done. The keywords, startTime to startTime is used, where startTime is set to a value 0. The flow is simulated for a total of 2000 iterations and is specified through stopAt and endTime. This is followed by setting the time interval of 10 iterations to save the results via writeControl and writeInterval keywords.

The schemes for finite volume discretization are specified through fvSchemes file with the contents as follows

/*---------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*---------------------------------------------------------------------------*/
FoamFile
{
    version         2.0;
    format          ascii;
    class           dictionary;
    location        "system";
    object          fvSchemes;
}
//------------------------------------------------------------------------------

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
    grad(p)         Gauss linear;
    grad(U)         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      Gauss linearUpwindBJ grad(U);
    div(phi,T)      Gauss linearUpwindBJ grad(T);
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         none;
    laplacian(rAUf,p_rgh) Gauss linear corrected;
    laplacian(nu,U) Gauss linear corrected;
    laplacian(nuEff,U) Gauss linear corrected;
    laplacian(alphaEff,T) Gauss linear corrected;
    laplacian(p_rgh) Gauss linear corrected;
    laplacian(kappaEff,T) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
    laplacian((1|A(U)),p_rgh) Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
    interpolate(HbyA) linear;
}

snGradschemes
{
    default         corrected;
}

In the above file, the discretization schemes are set for time-derivative, gradient, divergence and Laplacian terms.

The final file is the fvSolution, where linear solver settings are provided and is as given below

/*---------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
//------------------------------------------------------------------------------

solvers
{
    p_rgh
    {
        solver           GAMG;
        tolerance        1e-8;
        relTol           0.01;
        smoother         SSGS;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator     algebraicPair;
        mergeLevels      1;
    }

    "(U|T)"
    {
        solver          PBiCGStab;
        preconditioner  USGS;
        tolerance       1e-8;
        relTol          0.01;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       0;

    residualControl
    {
        p_rgh           1e-4;
        T               1e-4;

        // possibly check turbulence fields
    }
}

relaxationFactors
{
    fields
    {
        p_rgh           0.3;
    }
    equations
    {
        U               0.7;
        T               0.7;
    }
}


// ************************************************************************* //

The above file details the different linear solvers that are used to solve for buoyant pressure and velocity fields. Further, nNonOrthogonalCorrectors is set to 2; since there is some degree of non-orthogonality present in the grid.

With these, the set-up of the relevant directories and files are completed. Let us view the directory structure to ensure all are present. The tree should be identical to the one shown below

tree
.
├── 0
│   ├── alphat
│   ├── p
│   ├── p_rgh
│   ├── T
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

Before the solver can be executed, we have to apply the temperature profile as noted earlier. This step can be performed as follows

funkySetFields -field T -expression "pos().x" -time 0 -keepPatches -valuePatches "wall-1 wall-2"

The above expression re-writes the T file with the appropriate values of temperature as a function of distance \(x\). Following this, the solver can be executed and it involves few different steps. The first of which is to renumber the grid or mesh followed by checking the mesh quality. Renumbering reduces the matrix bandwidth while quality check shows the mesh statistics. These can be performed as follows

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

During the process of renumbering, grid-cell bandwidth information before and after renumberMesh is shown and the user can take a note of this. The mesh statistics are as shown below after invoking checkMesh

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (-0.5 -0.5 0) (0.5 0.5 0.5)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (2.69541574409e-17 -1.48776322194e-17 -2.09950188835e-16) OK.
    Max cell openness = 2.71077471766e-16 OK.
    Max aspect ratio = 5.13298999541 OK.
    Minimum face area = 7.26421673269e-05. Maximum face area = 0.0145134277912.  Face area magnitudes OK.
    Min volume = 8.32359098625e-07. Max volume = 0.000256180182954.  Total volume = 0.259143943239.  Cell volumes OK.
    Mesh non-orthogonality Max: 64.2010673845 average: 15.1363376112
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 0.60153646289 average: 0.0467687348165 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End

The above information gives a maximum mesh non-orthogonality angle of 64.2 and therefore non-orthogonal corrections are needed for the solver. In the next step, we will execute the solver and monitor the progress of the simulation. The solver should be executed from the top level directory using,

caelus run -l my-spherical-cavity.log buoyantBoussinesqSimpleSolver

The progress of the simulation is written to the log file my-spherical-cavity.log, which can be monitored to view the convergence history. In a separate terminal window use

caelus logs -w my-spherical-cavity.log

The plot indicates the convergence history for pressure with respect to time and a similar plot is shown in Figure 24. The convergence of other properties can also be found by using the above command.

_images/sphere-convergence-tutorials.png

Convergence of pressure with respect to time

Results

Here, the solution obtained at steady state is shown and is compared with the analytical solution. In Figure 25, the comparison of temperature isotherms is presented. The analytical solution is a first order approximation. A close agreement between the two can be observed.

_images/sphere-isotherms-tutorials.png

Comparison of temperature isotherms between computational and analytical solutions.

Totorials: Incompressible Turbulent Flow

Turbulent Flat Plate

This tutorial considers the simulation of turbulent incompressible flow over a two-dimensional sharp leading-edge flat plate using Caelus 9.04. Some basic steps to start a Caelus simulation for a turbulent flow environment will be shown such as specifying input data to define the boundary conditions, fluid properties, turbulence parameters and discretization/solver settings. Subsequently, the velocity contour over the plate will be visualised to identify the developed boundary layer. It will be further shown in sufficient detail to carry out Caelus simulation so that the user is able to reproduce accurately.

Objectives

Through this tutorials the user will be familiarised with setting up the Caelus simulation for steady, turbulent, incompressible flow over a sharp leading-edge flat-plate in two-dimensions. Further, the user will also be able to visualise the boundary layer. The following steps are carried out in this tutorial

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Visualisation of turbulent boundary layer

Pre-requisites

It is assumed that the user is familiar with the Linux command line environment using a terminal or Caelus-console (for Windows OS) and Caelus is installed correctly with appropriate environment variables set. The grid used here is obtained from Turbulence Modeling Resource in a Plot3D format and is exported to Caelus format using Pointwise. However, the user is free to use their choice of grid generation tool to covert the Plot3D file to Caelus format.

Background

Turbulent flow over a flat-plate configuration presents an ideal case to introduce the user with the turbulent simulation using Caelus. Here, the steady-state solution to the incompressible flow over the plate will be obtained, which results in a turbulent boundary layer. The shear stress distribution along the length of the wall and the velocity profile across the wall would be used to infer the development of the turbulent boundary layer. The user can look at the validation section for more details at Zero Pressure Gradient Flat Plate.

The flat-plate length considered for this tutorial is L = 2.0 m and with a unit Reynolds number of \(5 \times 10^6\). Air is used as a fluid and a temperature of T = 300 K is assumed. Based on the Reynolds number and temperature, kinematic viscosity evaluates to \(\nu = 1.38872\times10^{-5}~(m^2/s)\). A freestream velocity of \(U = 69.436113~m/s\) is used. In Figure 26, a schematic of the flat-plate is shown. Note that the 2D plane of interest is in \(x-z\) directions.

_images/t-fp-schematic-tutorials.png

Schematic of the flat-plate flow

The freestream conditions that would be used is given in the below table

Freestream conditions

Fluid

\(L~(m)\)

\(Re/L~(1/m)\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~(K)\)

\(\nu~(m^2/s)\)

Air

0.3048

\(5 \times 10^6\)

69.436113

Gauge (0)

300

\(1.38872\times10^{-5}\)

Grid Generation

The hexahedral grid used in this tutorial is obtained from Turbulence Modeling Resource that has 137 X 97 cells in \(x-z\) directions respectively. The original 3D grid is in Plot3D and is then converted to Caelus compatible polyMesh format.

The computational domain is a rectangular block that encompasses the flat-plate. In Figure 27 below, the details of the boundaries in 2D (\(x-z\) plane) that will be used is shown. The region of interest, which is highlighted in blue extends between \(0 \leq x \leq 2.0~m\), where the leading-edge is at \(x=0\). Due to the viscous nature of the flow, the velocity at the wall is zero which is represented through a no-slip boundary wherein \(u,v,w = 0\). Upstream of the leading edge, a symmetry boundary at the wall will be used. The inlet boundary is placed at the start of the symmetry boundary and the outlet is placed at the exit of the flat-plate the no-slip wall. The entire top boundary will be again modelled as a symmetry plane.

_images/t-fp-domain-tutorials.svg

Flat-plate computational domain

The polyMesh grid as noted earlier is in 3D. However, since the flow over a flat-plate is two-dimensional, the 2D plane that is considered here is in \(x-z\) directions. It would therefore be ideal to have one-cell thick in the direction (\(y\)), normal to the 2D plane of interest, where the flow is considered symmetry. The two \(x-z\) planes obtained as a result of having 3D grid need boundary conditions to be specified. Since the flow is 2D, we do not need to solve for flow in 3D. This can easily be achieved in Caelus by specifying empty boundary condition for each of the two planes. As a consequence, the flow in \(y\) direction would be symmetry.

Note

A velocity value of \(v=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(y\) direction.

_images/t-fp-grid-tutorials.png

Flat-plate computational grid in \(x-z\) plane

In Figure 28, the 2D grid is shown which has 137 X 97 cells in \(x-z\) directions respectively. To capture the turbulent boundary layer accurately, the grids are refined close to the wall and \(y^+\) is estimated to be less than 1. Due to this, no wall-functions would be used to estimate the velocity gradients near the wall and integration is carried up to the wall.

Problem definition

In this section, several key instructions would be provided to set-up the turbulent flat-plate problem along with details of file configuration. A full working case can be found in:

/tutorials/incompressible/simpleSolver/ras/ACCM_flatPlate2D

However,the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

For setting up the problem, we need to further have few more sub-directories where relevant files can be created. Caelus requires time, constant and system sub-directories. Since we will begin the simulation at time \(t = 0~s\), the time sub-directory should be just 0.

In the 0 sub-directory, additional files are required for specifying the boundary properties. The following table lists the necessary files required based on the turbulence model chosen.

Parameter

File name

Pressure (\(p\))

p

Velocity (\(U\))

U

Turbulent viscosity (\(\nu\))

nut

Turbulence field variable (\(\tilde{\nu}\))

nuTilda (Only for SA model)

Turbulent kinetic energy (\(k\))

k (Only for \(k-\omega~\rm{SST}\) model)

Turbulent dissipation rate (\(\omega\))

omega (Only for \(k-\omega~\rm{SST}\) model)

As can be noted from the above table, we will be considering two turbulence models namely, Spalart-Allmaras (SA) and \(k-\omega\) - Shear Stress Transport (\(\rm{SST}\)) in the current exercise. These files set the dimensions, initialisation and boundary conditions to the problem, which also forms the three principle entries required.

The user should take into account that Caelus is case sensitive and therefore where applicable, the directory set-up should be identical to what is shown here.

Boundary Conditions and Solver Attributes

Boundary Conditions

Initially, let us set-up the boundary conditions. Referring back to Fig. %s:num:t-fp-domain-tutorials, the following are the boundary conditions that will be specified:

  • Inlet
  • Symmetry
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Turbulence: Symmetry

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu}=0\))

      • \(k-\omega~\textrm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart–Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\textrm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation

Starting with the pressure, let us open p using a text editor, which has the following contents.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            zeroGradient;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            fixedValue;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //

As can be seen, the above file begins with a dictionary named FoamFile which contains the standard set of keywords for version, format, location, class and object names.

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0;

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

In a similar approach, let us open the file U.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (69.4361 0 0);

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform (69.4361 0 0);
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            noSlipWall;
    }
}


// ************************************************************************* //

As detailed above, the principle entries for velocity field are self explanatory and the dimensions are typically for that of velocity with the units \(m/s\) ([0 1 -1 0 0 0 0]). Since we initialise the flow with a uniform freestream velocity, we set the internalField to uniform (69.4361 0 0) which represents three components of velocity. Similarly, inflow boundary patch has three velocity components.

Similarly, the turbulent properties needed at the boundaries can be set. We begin with opening the file nut, which is the turbulent kinematic viscosity and is shown below.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 2.9224e-06;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 2.9224023e-06;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            calculated;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

Here, the turbulent viscosity is specified as kinematic and therefore the units are \(m^2/s\) ([0 2 -1 0 0 0 0] ). The value of turbulence viscosity at freestream, specified at inflow patch is calculated as detailed in Turbulence freestream conditions for SA model and Turbulence freestream conditions for k-\omega~\rm{SST} model for SST models respectively and is specified accordingly. The same value also goes for internalField. Note that a fixedValue of 0 is used for the wall which suggests that on the wall, it is only the molecular (laminar) viscosity that prevails.

We shall now look at nuTilda which is a turbulence field variable, specific to the SA model and has same units ([0 2 -1 0 0 0 0]) as kinematic turbulent viscosity. The details of which are given in Turbulence freestream conditions for SA model. In the file nuTilda, the entries specified for the boundaryField are identical to that of turbulent kinematic viscosity explained above.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 4.166166e-05;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 4.166166e-05;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

We now proceed to files k and omega, specific to only \(k-\omega~\rm{SST}\) model. As we know, \(k-\omega~\rm{SST}\) is a turbulence model which solves for the turbulent kinetic energy and the specific rate of dissipation using two partial differential equations. Caelus therefore requires information about these to be specified when this model is used. Firstly, the file k with the following contents is needed.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.0010848;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 0.0010848;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            fixedValue;
        value           uniform 1e-10;
    }
}


// ************************************************************************* //

The unit of kinetic energy is \(m^2/s^2\) and this is set in dimensions as [0 2 -2 0 0 0 0]. As with other turbulent quantities discussed above, the value of \(k\) (refer Turbulence freestream conditions for k-\omega~\rm{SST} model needs to be specified for internalField, inflow and wall. Please note that for wall boundaryField with no wall-function, a small, non-zero fixedValue is required.

Next, the value for \(\omega\) is evaluated in omega file as shown below and as detailed in Turbulence freestream conditions for k-\omega~\rm{SST} model.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 8679.5135;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 8679.5135;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            omegaWallFunction;
        value           uniform 1;
    }
}


// ************************************************************************* //

The unit of specific rate of dissipation for \(\omega\) is \(1/s\) which is set in dimensions as [0 0 -1 0 0 0 0]. The internalField and inflow gets a fixedValue. Note that for wall boundaryField, we specify omegaWallFunction and this is a model requirement and sets omega to the correct value near wall based on the \(y^+\). In conjunction, the value that goes with omegaWallFunction can be anything and for simplicity its set to 1.

Before setting up other parameters, it is important to ensure that the boundary conditions (inflow, outflow, top, etc) specified in the above files should be the grid boundary patches (surfaces) generated by the grid generation tools and their names are identical. Further, the two boundaries in \(x-z\) plane named here as left and right have empty boundary conditions which forces Caelus to assume the flow to be in 2D. With this, the setting up of boundary conditions are completed.

Grid file and Physical Properties

The turbulent flat-plate grid files is placed in the constant/polyMesh sub-directory. Additionally, the physical properties are specified in various different files present in the directory constant.

As you can see in the constant directory, three files are listed in addition to the polyMesh sub-directory. In the first file, RASProperties, the Reynolds-Average-Stress (RAS) model is specified as below. Note that depending on the turbulence model you wish to run with, the line that corresponds to that specific model should be enabled

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				RASProperties;
}

//--------------------------------------------------------------------------------

// For Spalarat-Alamaras Model, enable the below line
RASModel				SpalartAllmaras;

// For k-omega SST Model, enable the below line
// RASModel				kOmegaSST;

turbulence				on;

printCoeffs				on;

Next, we look at the transportProperties file, where transport model and kinematic viscosity is specified.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 1.388722E-5;

As the viscous behaviour is Newtonian, the transportModel is given using the keyword Newtonian and the value of molecular (laminar) kinematic viscosity (nu) is given having the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The final file in this class is the turbulenceProperties file, which sets the simulationType to RASModel. Both SA and \(k-\omega~\rm{SST}\) are classified as Reynolds Average Stress (RAS) models.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				RASModel;

Controls and Solver Attributes

In this section, the files required to control the simulation and specifying the type of discretization method along with the linear solver settings are provided. These are placed in the system directory.

First, we begin with the controlDict file as below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				controlDict;
}
			
//-------------------------------------------------------------------------------

application				simpleSolver;

startFrom				startTime;

startTime				0;

stopAt					endTime;

endTime					20000;

deltaT					1;

writeControl				runTime;

writeInterval				1000;

purgeWrite				0;

writeFormat				ascii;

writePrecision				12;

writeCompression			true;

timeFormat				general;

timePrecision				6;

runTimeModifiable			true;

//-------------------------------------------------------------------------------

// Function Objects to obtain forces

functions
{
	forces
	{
		type			forces;

        functionObjectLibs	("libforces.so");
        patches     		( wall );
        CofR      			(0 0 0);
        rhoName         	rhoInf;
        rhoInf          	1.347049;
        writeControl   	    timeStep;
        writeInterval  	    50;
     }
}

As can be noted in the above file, simpleSolver solver is used and the simulation begins at t = 0 s. This logically explains the need for 0 directory where the data files are read at the beginning of the run. Therefore, the keyword startFrom is set to startTime, where startTime would be 0. Since the simulation is steady-state we specify the total number of iterations as a keyword for endTime. Via the writeControl and writeInternal keywords, the interval at which the solutions are saved can be specified. Also included is the function object to obtain the force over the wall every 50 iterations. Note that for obtaining the force, the freestream density (rhoInf) is required and is specified with the value.

The discretization schemes for the finite volume discretization that will be used is set through the fvSchemes file shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//------------------------------------------------------------------------------

ddtSchemes
{
	default				steadyState;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwind	grad(U);
	div(phi,nuTilda)		Gauss	upwind;	// Will be used for S-A model only
	div(phi,k)			Gauss 	upwind; // will be used for k-epsilon & k-omega only
	div(phi,omega)			Gauss 	upwind;	// Will be used for k-omega model only
	div((nuEff*dev(T(grad(U)))))	Gauss   linear;
	div(phi,symm(grad(U))) 		Gauss 	linear;
	
}

laplacianSchemes
{
	default				none;
	laplacian(nu,U)			Gauss 	linear 	corrected;
	laplacian(nuEff,U)		Gauss 	linear 	corrected;
	laplacian(DnuTildaEff,nuTilda) 	Gauss 	linear 	corrected; // Will be used for S-A model only
	laplacian(DkEff,k)		Gauss 	linear 	corrected; // Will be used for k-omega & k-omega only
	laplacian(DomegaEff,omega)	Gauss 	linear 	corrected; // Will be used for k-omega model only
	laplacian(rAUf,p)		Gauss 	linear	corrected;
	laplacian(1,p)			Gauss 	linear 	corrected;
}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}


The linear solver controls and tolerances are set in fvSolution as given below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
        version                         2.0;
        format                          ascii;
        class                           dictionary;
        location                        "system";
        object                          fvSolution;
}

//------------------------------------------------------------------------------

solvers
{
        p
        {
                solver                  PCG;
                preconditioner          SSGS;
                tolerance               1e-8;
                relTol                  0.01;
        }
        U
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-7;
                relTol                  0.01;
        }

        "(k|omega|nuTilda)"
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-08;
                relTol                  0;
        }
}

SIMPLE
{
        nNonOrthogonalCorrectors        1;
        pRefCell                        0;
        pRefValue                       0;
}

// relexation factors

relaxationFactors
{
        p                               0.3;
        U                               0.5;
        nuTilda                         0.5;
        k                               0.5;    
        omega                           0.5;
}

Here, different linear solvers are used to solve velocity, pressure and turbulence quantities. We also set the nNonOrthogonalCorrectors to 1 in this case. Further, relaxation is set on the primary and turbulent variables so that the solution is more stable. Furthermore, the relTol is not set to 0 unlike a time-accurate set-up. This is because we are solving for a steady-state solution and a very low (\(\approx 0\)) tolerance at every iteration is not required as the entire system of equations converges to the global tolerance set as the simulation progresses to steady state.

Now the set-up of the directory structure with all the relevant files the directory tree should appear identical to the one shown below

.
├── 0
│   ├── epsilon
│   ├── k
│   ├── nut
│   ├── nuTilda
│   ├── omega
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

Prior to execution of solver, renumbering of the grid/mesh needs to be performed in addition to checking the quality of the grid/mesh. Renumbering the grid-cell list is vital to reduce the matrix bandwidth while quality check gives us the mesh statistics. Renumbering and mesh quality can be determined by executing the following from the top directory.

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

At this stage, it is suggested that the user should take note of the matrix bandwidth before and after the mesh renumbering. When the checkMesh is performed, the mesh statistics are shown as below

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Checking geometry...
    Overall domain bounding box (-0.06 0 0.03) (1.2192 0.15 0.055)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (5.80542e-19 1.1194e-17 1.1403e-14) OK.
    Max cell openness = 2.2093e-16 OK.
    Max aspect ratio = 55.555 OK.
    Minimum face area = 1e-08. Maximum face area = 0.000138887.  Face area magnitudes OK.
    Min volume = 2.5e-10. Max volume = 2.50831e-07.  Total volume = 0.004797.  Cell volumes OK.
    Mesh non-orthogonality Max: 0 average: 0
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 3.85044e-13 average: 9.40402e-15 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End

In the above terminal output, we get Failed 1 mesh checks. and this is because of the high aspect ratio meshes present immediate to the wall due to very low (\(<< 1~y^+\)). However, Caelus can solve on this mesh. The next step is to execute the solver and monitoring the progress of the solution. The solver is always executed from the top directory.

caelus run -l my-turbulent-flat-plate.log -- simpleSolver

With the execution of the above command, the simulation begins and the progress of the solution is written to the specified log file (my-turbulent-flat-plate.log). The log file can be further processed to look at the convergence history and this can be done as follows

caelus logs -w my-turbulent-flat-plate.log

This allows you to look at the convergence of different variables with respect to the number of iterations carried out. In Fig. %s:num:tfpconvergencetutorials pressure convergence is shown.

_images/t-fp-convergence-tutorials.png

Convergence of pressure with respect to iterations

Results

The turbulent flow over the flat plate is shown here through velocity magnitude contours for SA model. In Fig. %s:num:tfpvelocitytutorials the boundary layer over the entire flat-plate and in the region up to \(x=0.10~m\) is emphasised. The growth of the boundary layer can be seen very clearly. Since the Reynolds number of the flow is reasonably high, the turbulent boundary layer seems thin in comparison to the length of the plate.

_images/t-fp-velocity-tutorials.png

Contour of velocity magnitude over the flat-plate

Bump in a Channel

The simulation of turbulent flow over a two-dimensional bump in a channel is considered in this tutorial and will be performed using Caelus 9.04. As with the other tutorials, setting up the directory structure, fluid properties, boundary conditions, turbulence properties etc will be shown. Further to this, visualisation of the solution will be shown to look at the velocity and pressure contours over the bump surface. These steps would be shown in sufficient details so that the user is able to reproduce the tutorial accurately.

Objectives

Some of the main objectives of this tutorial would be for the user to get familiarise with setting up the Caelus simulation for steady, turbulent, incompressible flow over a two-dimensional bump in a channel and be able to post-process the desired solution. Following would be some of the steps that would be covered.

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Visualisation of flow near the bump

Pre-requisites

The user should be familiar with a Linux command line environment via a terminalor caelus-console (For Windows OS). It is also assumed that Caelus is installed correctly with appropriate environment variables set. The grid used here is obtained from Turbulence Modeling Resource in a Plot3D format and is exported to Caelus format using Pointwise. However, the user is free to use their choice of grid generation tool to covert the Plot3D file to Caelus format.

Background

Turbulent flow over a bump in a channel is quite similar to a flat-plate flow, except that due to the curvature effect, a pressure gradient is developed. The flow would be assumed to be steady-state and incompressible. To demonstrate the effect of curvature, the skin friction distribution along the bump will be plotted. For further information on this case, the user can refer to Two-dimensional Bump in a Channel.

The bump, as shown in the schematic below in Figure 31 has a upstream and a downstream flat-plate region that begins at x = 0 m and x = 1.5 m respectively, which gives a total length of L = 1.5 m. The flow has a unit Reynolds number of \(3 \times 10^6\) and Air is used as a fluid with a temperature of 300 K. Based on these values, kinematic viscosity can be evaluated to \(\nu = 2.314537 \times 10^{-5} m^2/s\). To match the required Reynolds number, a freestream velocity of U = 69.436 m/s would be used. Note that the two-dimensional plane considered here is in \(x-z\) directions.

_images/t-bump-schematic-tutorials.png

Schematic of the 2D bump

The freestream conditions that will be used is given in the below table (Freestream conditions)

Freestream conditions

Fluid

\(L~(m)\)

\(Re/L~(1/m)\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~(K)\)

\(\nu~(m^2/s)\)

Air

1.5

\(3 \times 10^6\)

69.436113

Gauge (0)

300

\(2.314537\times10^{-5}\)

Grid Generation

The hexahedral grid used in this tutorial is obtained from Turbulence Modeling Resource that contains 704 X 320 cells in \(x-z\) directions respectively. The grid originally is in Plot3D format and is converted to Caelus compatible polyMesh format.

The computational domain is a rectangular channel encompassing the bump. Figure 32 shown below identifies the boundary conditions in a two-dimensional plane (\(x-z\)). The bump region, highlighted in blue extends between \(0 \leq x \leq 1.5~m\), where the velocity at the wall is zero, wherein \(u,v,w=0\) represented through a no-slip boundary. Upstream and downstream of the bump, a symmetry boundary at the wall is used. The inlet and outlet are placed at the end of the symmetry as depicted in the figure and the top boundary has a symmetry condition.

_images/t-bump-domain-tutorials.png

Computational domain of a 2D bump

The polyMesh grid obtained from the conversion of Plot3D is in 3D. However, the flow over a bump is two-dimensional and is solved in a 2D plane with \(x-z\) directions. Therefore, ideally we can have cells with one-cell thick in the direction (\(y\)), normal to the 2D plane, where the flow can be assumed to be symmetry. The two \(x-z\) planes obtained as a result of having a 3D grid require boundary conditions to be specified. As the flow is assumed to be 2D, we do not need to solve the flow in 3D and this can easily be achieved in Caelus by specifying empty boundary condition for each of the two planes. This consequently allows for the flow in \(y\) direction to be symmetry.

Note

A velocity value of \(v=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(y\) direction.

_images/t-bump-grid-tutorials.png

Computational grid of a two-dimensional bump in \(x-z\) plane

In Figure 33 above, the 2D grid is shown with a distribution of 704 X 320 in \(x-z\) directions respectively. The inset focuses the distribution in the region between \(0 \leq x \leq 1.5~m\). As can be seen, the distribution of the grids in the flow normal direction is finer near the wall to capture the turbulent boundary layer more accurately and it is estimated that \(y^+\) is less than 1 for the chosen grid and therefore, no wall-function has been used and the integration is carried out up to the wall.

Problem definition

This section deals with several key instructions need to set-up the turbulent flow over a bump. A full working case of this can be found in:

/tutorials/incompressible/simpleSolver/ras/ACCM_bump2D/

The user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

In order to set-up the problem Caelus requires time, constant and system sub-directories within the main working directory. Typically, the simulations are started at time \(t = 0~s\), which requires a time sub-directory to be 0.

Within the 0 sub-directory, additional files specifying the boundary properties are present. The below table lists the necessary files required based on the turbulence model chosen

Parameter

File name

Pressure (\(p\))

p

Velocity (\(U\))

U

Turbulent viscosity (\(\nu\))

nut

Turbulence field variable (\(\tilde{\nu}\))

nuTilda (Only for SA model)

Turbulent kinetic energy (\(k\))

k (Only for \(k-\omega~\rm{SST}\) model)

Turbulent dissipation rate (\(\omega\))

omega (Only for \(k-\omega~\rm{SST}\) model)

In this tutorial, we will be considering two turbulence models namely, Spalart-Allmaras (SA) and \(k-\omega\) - Shear Stress Transport (\(\rm{SST}\)). The contents of the files listed above sets the dimensions, initialisation and boundary conditions to the defining problem, which also forms three principle entries required. Firstly, we begin with looking at these files in the 0 sub-directory

The user should take into account that Caelus is case sensitive and therefore the directory set-up should be identical to what is shown here.

Boundary Conditions and Solver Attributes

Boundary Conditions

Referring back to Figure 32, the following are the boundary conditions that will be specified:

  • Inlet
  • Symmetry
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Turbulence: Symmetry

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu}=0\))

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k =<<0\) and \(\nu_t=0\); \(\omega\) = omegaWallFunction)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart–Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation

We begin with p, the pressure file using a text editor with the following content

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            zeroGradient;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            fixedValue;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //

From the above information, it can be seen that the file begins with a dictionary named FoamFile which contains the standard set of keywords for version, format, location, class and object names. The explanation of the principle entries are as follows

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0;

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

Similarly, we have the file U with the following information

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (69.4361 0 0);

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform (69.4361 0 0);
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            noSlipWall;
    }
}


// ************************************************************************* //

As with the pressure, the principle entries for velocity field are self-explanatory and the dimensions are typically for that of velocity with the units \(m/s\) ([0 1 -1 0 0 0 0]). Since the initialisation of the flow is with a uniform freestream velocity, we should set the internalField to uniform (69.4361 0 0) representing three components of velocity. In a similar manner, inflow boundary patch has three velocity components.

In addition to p and U, the turbulent properties are also needed at the boundary patches and these can be set in a similar process. We begin with the file nut, which corresponds to turbulent kinematic viscosity as shown below.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 4.87067e-06;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 4.87067e-06;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            calculated;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

Here, the turbulent viscosity is specified as kinematic and therefore the units are \(m^2/s\) ([0 2 -1 0 0 0 0]). The value of turbulence viscosity at freestream, specified at inflow patch is calculated as detailed in Turbulence freestream conditions for SA model and Turbulence freestream conditions for k-\omega~\rm{SST} model for SST models respectively and is specified accordingly. The same value also goes for internalField. Note that a fixedValue of 0 is used for the wall which suggests that on the wall, it is only the molecular (laminar) viscosity that prevails.

The next variable is the nuTilda which is a turbulence field variable, specific to only SA model and has the same units ([0 2 -1 0 0 0 0]) as kinematic turbulent viscosity. The details of which are given in Turbulence freestream conditions for SA model. The following contents given in the file nuTilda and the entries specified for the boundaryField are identical to that of turbulent kinematic viscosity explained above.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 6.943611e-05;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 6.943611e-05;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

We now proceed to files k and omega, specific to only \(k-\omega~\rm{SST}\) model. As we know, \(k-\omega~\rm{SST}\) is a turbulence model which solves for the turbulent kinetic energy and the specific rate of dissipation using two partial differential equations. Caelus therefore requires information about these to be specified at the boundary patches when this model is chosen as shown below.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.0010848;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 0.0010848;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            fixedValue;
        value           uniform 1e-10;
    }
}


// ************************************************************************* //

The unit of kinetic energy is \(m^2/s^2\) and this is set in dimensions as [0 2 -2 0 0 0 0]. As with other turbulent quantities discussed above, the value of \(k\) (refer Turbulence freestream conditions for k-\omega~\rm{SST} model) needs to be specified for internalField, inflow and wall. Please note that for wall boundaryField with no wall-function, a small, non-zero fixedValue is required.

We now evaluate the value for \(\omega\) in the omega file as shown below and as detailed in Turbulence freestream conditions for k-\omega~\rm{SST} model.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 5207.65;

boundaryField
{
    bottom
    {
        type            symmetryPlane;
    }
    inflow
    {
        type            fixedValue;
        value           uniform 5207.65;
    }
    left
    {
        type            empty;
    }
    outflow
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            symmetryPlane;
    }
    wall
    {
        type            omegaWallFunction;
        value           uniform 1;
    }
}


// ************************************************************************* //

The unit of specific rate of dissipation for \(\omega\) is \(1/s\) which is set in dimensions as [0 0 -1 0 0 0 0]. The internalField and inflow gets a fixedValue. Note that for wall boundaryField, we specify omegaWallFunction and this is a model requirement and sets omega to the correct value near wall based on the \(y^+\). In conjunction, the value that goes with omegaWallFunction can be anything and for simplicity its set to 1.

Before proceeding further, it is important to ensure that the boundary conditions (inflow, outflow, top, etc) added in the above files should be the grid boundary patches (surfaces) generated by the grid generation tool and their names are identical. Additionally, the two boundaries \(x-z\) plane named here as left and right have empty boundary conditions which forces Caelus to assume the flow to be in two-dimensions. With this, the setting up of the boundary conditions are complete.

Grid file and Physical Properties

The grid file for the turbulent-bump need to be placed in constant/polyMesh sub-directory. In addition to this, the physical properties are specified in various different files present in the constant directory. The three files that are listed in addition to the polyMesh sub-directory set the physical properties. The first one, RASProperties in which the Reynolds-Average-Stress (RAS) is specified, is shown below. Please note that depending on the turbulence model you wish to run with, the line that corresponds to that specific model should be enabled.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				RASProperties;
}

//--------------------------------------------------------------------------------

// For Spalarat-Alamaras Model, enable the below line
RASModel				SpalartAllmaras;

// For k-omega SST Model, enable the below line
// RASModel				kOmegaSST;

turbulence				on;

printCoeffs				on;

Next, kinematic viscosity is specified in the transportProperties file, as shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 2.314537E-5;

As the viscous behaviour is Newtonian, the transportModel is given using the keyword Newtonian and the value of molecular (laminar) kinematic viscosity (nu) is given having the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The final file in this class is the turbulenceProperties file, which sets the simulationType to RASModel. Both SA and \(k-\omega~\rm{SST}\) are classified as Reynolds Average Stress (RAS) models.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				RASModel;

Controls and Solver Attributes

This section details the files require to control the simulation and the specifying discretization methods in addition to the linear solver settings. These files are placed in the system directory.

The controlDict file contains the following details

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				controlDict;
}

//-------------------------------------------------------------------------------

application				simpleSolver;

startFrom				startTime;

startTime				0;

stopAt					endTime;

endTime					20000;

deltaT					1;

writeControl				runTime;

writeInterval				1000;

purgeWrite				0;

writeFormat				ascii;

writePrecision				12;

writeCompression			true;

timeFormat				general;

timePrecision				6;

runTimeModifiable			true;

//-------------------------------------------------------------------------------

// Function Objects to obtain forces

functions
{
	forces
	{
		type			forces;

        functionObjectLibs	("libforces.so");
        patches     		( wall );
        CofR      			(0 0 0);
        rhoName         	rhoInf;
        rhoInf          	0.80822;
        writeControl   	 	timeStep;
        writeInterval   	50;
     }
}

Referring to the above information, some explanation is needed. Here, simpleSolver is used and the simulation begins at t = 0 s. This now explains the logical need for having a 0 directory where the data files are read at the beginning of the run, which is t = 0 s in this case. Therefore, the keyword startFrom is set to startTime, where startTime would be 0. The simulation would be carried out as steady-state and therefore we require to specify the total number of iterations as a keyword for endTime. Through the writeControl and writeInterval keywords, the solution intervals at which they are saved can be specified. Also note that a function object to obtain the force over the wall for every 50 iterations is included. In order to obtain this, a freestream density (rhoInf) need to be specified.

The discretization schemes for the finite volume discretization that will be used should be set through the fvSchemes file show below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//------------------------------------------------------------------------------

ddtSchemes
{
	default				steadyState;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwind	grad(U);
	div(phi,nuTilda)		Gauss	upwind;	// Will be used for S-A model only
	div(phi,k)			Gauss 	upwind; // will be used for k-epsilon & k-omega only
	div(phi,omega)			Gauss 	upwind;	// Will be used for k-omega model only
	div((nuEff*dev(T(grad(U)))))	Gauss   linear;
	div(phi,symm(grad(U))) 		Gauss 	linear;
	
}

laplacianSchemes
{
	default				none;
	laplacian(nu,U)			Gauss 	linear 	corrected;
	laplacian(nuEff,U)		Gauss 	linear 	corrected;
	laplacian(DnuTildaEff,nuTilda) 	Gauss 	linear 	corrected; // Will be used for S-A model only
	laplacian(DkEff,k)		Gauss 	linear 	corrected; // Will be used for k-omega & k-omega only
	laplacian(DomegaEff,omega)	Gauss 	linear 	corrected; // Will be used for k-omega model only
	laplacian(rAUf,p)		Gauss 	linear	corrected;
	laplacian(1,p)			Gauss 	linear 	corrected;
}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}


The linear solver controls and tolerances are set in fvSolution as given below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
        version                         2.0;
        format                          ascii;
        class                           dictionary;
        location                        "system";
        object                          fvSolution;
}

//------------------------------------------------------------------------------

solvers
{
        p
        {
                solver                  PCG;
                preconditioner          SSGS;
                tolerance               1e-8;
                relTol                  0.01;
        }
        U
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-7;
                relTol                  0.01;
        }

        "(k|omega|nuTilda)"
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-08;
                relTol                  0;
        }
}

SIMPLE
{
        nNonOrthogonalCorrectors        1;
        pRefCell                        0;
        pRefValue                       0;
}

// relexation factors

relaxationFactors
{
        p                               0.3;
        U                               0.5;
        nuTilda                         0.5;
        k                               0.5;    
        omega                           0.5;
}

The user should note that in the fvSolution file, different linear solvers are used to solve for velocity, pressure and turbulence quantities. We also set the nNonOrthogonalCorrectors to 1 for this case. To ensure the stability of the solution, the relaxation is set to primary and turbulent variables. The relTol is set to 0 unlike a time-accurate set-up as we are solving for a steady-state solution and a very low (\(\approx 0\)) tolerance at every iteration is unnecessary. Since the entire system of equations converge to a global set tolerance the convergence would occur as the solution progresses to a steady state.

With this, the set-up of the directory structure with all the relevant files are complete and the directory tree should appear identical to the one shown below

.
├── 0
│   ├── epsilon
│   ├── k
│   ├── nut
│   ├── nuTilda
│   ├── omega
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── DecomposeParDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

It is always important to renumber and to do a quality check on the grid/mesh before executing the solver. Renumbering reduces the matrix bandwidth whereas the quality check shows the mesh statistics. These two can be performed by executing the following commands from the top working directory

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

At this stage, it is suggested that the user should take note of the bandwidth before and after the mesh renumbering. When the checkMesh is performed, the mesh statistics are shown as below

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (-10 -10 0) (40 10 0.537713)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (-2.57817e-19 1.67414e-19 -4.29222e-16) OK.
    Max cell openness = 2.19645e-16 OK.
    Max aspect ratio = 3.66844 OK.
    Minimum face area = 0.00895343. Maximum face area = 0.586971.  Face area magnitudes OK.
    Min volume = 0.00481437. Max volume = 0.315622.  Total volume = 536.025.  Cell volumes OK.
    Mesh non-orthogonality Max: 14.6136 average: 1.75565
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 0.206341 average: 0.00112274 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

The output of the checkMesh indicates that the mesh check has failed through the final message``Failed 1 mesh checks.`` and this is because of the high aspect ratio meshes present immediate to the wall due to very low (\(<< 1~y^+\)). However, Caelus will solve on this mesh.

In this tutorial, it will be shown further to utilise the multi-core capability of CPUs thus performing a parallel computation for large grids, such as the one considered here. At first the grid has to be decomposed into smaller pieces that can be solved by each single CPU core. The number of decomposition should be equal to the number of CPU core available for parallel computing. The decomposition should be carried out through a file decomposeParDict present in the system sub-directory with the following content,

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
    version     		2.0;
    format      		ascii;
    class       		dictionary;
    object      		decomposeParDict;
}
//--------------------------------------------------------------------------------

numberOfSubdomains 		4; // It is suggested that the numberOfSubdomains be increased based on available resources for validation cases and to reduce the computation time.


method          		simple;

simpleCoeffs
{
	n			(4 1 1);
	delta 			0.001;
}

In the above file, the keyword numberOfSubdomains defines the number of decomposed sub-domains. In this case, the grid is partitioned into 4 sub-domains. We use simple as the method of decomposition and n is used to specify the number of decomposition that should be carried out in x, y and z directions respectively. In this case (4 1 1) performs 4 decompositions in x direction and 1 in both y and z directions. The execution to decompose the grid is carried out again from the top directory as follows

caelus run -- decomposePar

Now the decomposition should begin and the details of which are displayed in the terminal window. Subsequently, 4 processor directories will be generated as shown below

0  constant  processor0  processor1  processor2  processor3  system

The solver can now be executed for parallel computation in the host machine from the top directory using the following command

caelus run -p -l my-turbulent-bump.log -- simpleSolver

Note that here it is assumed that the parallel computing is available in the host machine. With the execution of the above commands, the simulation begins and the progress is written to the specified log file (my-turbulent-bump.log).

The log file can be further processed to look at the convergence history and this can be done as follows

caelus logs -w my-turbulent-bump.log

This allows you to look at the convergence of the variables with respect to the number of iterations carried out and the Figure 34 indicates the same for pressure.

_images/t-bump-convergence-tutorials.png

Convergence of pressure with respect to iterations

Results

The flow visualisation over the bump is shown here through the contours of velocity and pressure for SA model. In Figure 35 the variation of velocity and pressure can be seen as the bump is approached. As expected due to the curvature, flow accelerates while pressure reduces over the bump.

_images/t-bump-velocitypressure-tutorials.png

Contours of velocity and pressure over the bump surface

NACA Airfoil

In this tutorial, the turbulent flow over a two-dimensional NACA 0012 airfoil at two angles of attack, namely \(0^\circ\) and \(10^\circ\) will be considered. Caelus 9.04 will be used and the basic steps to set-up the directory structure, fluid properties, boundary conditions, turbulence properties etc will be shown. Visualisation of pressure and velocity over the airfoil are also shown. With these, the user should be able to reproduce the tutorial accurately.

Objectives

The user will get familiar in setting up Caelus simulation for steady, turbulent, incompressible flow over a two-dimensional airfoils at different angles of attack. Alongside, the user will be able to decompose the mesh on several CPUs performing a parallel simulation. Some of the steps that would be detailed are as follows

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Visualisation of flow over the airfoil

Pre-requisites

It is understood that the user will be familiar with the Linux command line environment via a terminal or Caelus-console (For Windows OS) and Caelus is installed corrected with appropriate environment variables set. The grid for this case is obtained from Turbulence Modeling Resource as a Plot3D format and is converted to Caelus using Pointwise. The user is however free to use their choice of grid generation tool to convert the original Plot3D grid to Caelus readable format.

Background

Turbulent flow over airfoils is an interesting example to highlight some of the capabilities of Caelus. Here, the flow undergoes rapid expansion due to strong surface curvatures thereby inducing pressure and velocity gradients along the surface. Depending on shape of the curvature, adverse or favourable pressure gradients can exist on either side. These can be examined through surface quantities like pressure and skin-friction distributions. The user can refer to the verification and validation of this case at Two-dimensional NACA 0012 Airfoil.

The schematic of NACA 0012 airfoil at two angles of attack are shown in Figure 36 for a two-dimensional profile. A chord length (C) of 1.0 m is considered for both and has a Reynolds number of \(6 \times 10^6\). The flow is assumed to be Air with a freestream temperature of 300 K. Considering these values, the freestream velocity can be evaluated to U = 52.077 m/s. Note that the geometric plane considered for two-dimensionality is in \(x-z\) directions.

_images/t-airfoil-schematic-tutorials.png

Schematic representation of the airfoil

The freestream conditions are given in the below table

Freestream conditions

Fluid

\(C~(m)\)

\(Re/L~(1/m)\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~(K)\)

\(\nu~(m^2/s)\)

Air

1.0

\(6 \times 10^6\)

52.0770

Gauge (0)

300

\(8.6795\times10^{-6}\)

As noted earlier, flow at two angles of attack (\(\alpha\)) will be considered in this tutorial. In order to obtain a free-stream velocity of 52.0770 m/s at \(\alpha = 0^\circ\) and \(10^\circ\), the velocity components in \(x\) and \(z\) have to be resolved. The following table provides these values

Velocity components in x and z directions

\(\alpha~\rm{Degrees}\)

\(u~(m/s)\)

\(w~(m/s)\)

\(0^\circ\)

52.0770

0.0

\(10^\circ\)

51.2858

9.04307

Grid Generation

The structured grid used for this tutorial can cells obtained from Turbulence Modeling Resource in Plot3D format that contains 512 around the airfoil and 256 cells in the flow normal direction. This should be then converted to polyMesh format.

The computational domain for the NACA 0012 airfoil is shown in Figure 37 along with the boundary conditions. A large domain exists around the airfoil (highlighted in blue) extending 500 chord lengths in the radial direction and the inlet condition is given for the entire boundary highlighted in green, whereas the outlet is placed at the exit plane which is about \(x \approx 500~m\). The velocity on the airfoil surface is zero, wherein \(u, v, w = 0\) represented through a no-slip boundary.

_images/t-airfoil-domain-tutorials.png

Computational domain of a 2D airfoil

The polyMesh grid is in three-dimensions, however the flow over airfoils can be assumed to be 2D at low angles of attack and is solved here in \(x-z\) directions. Therefore, a one-cell thick grid normal to the 2D flow plane is sufficient, where the flow can be assumed to be symmetry. The two \(x-z\) planes that are prevalent require boundary conditions to be specified. Since the flow is assumed to be 2D, we do not need to solve the flow in the third-dimension and this can be easily achieved in Caelus by specifying empty boundary conditions for each of the two planes. Consequently, the flow will be treated as symmetry in \(y\) direction.

Note

A velocity value of \(v=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(y\) direction.

_images/t-airfoil-grid-tutorials.png

Computational grid of a 2D airfoil in \(x-z\) plane

The 2D airfoil grid in \(x-z\) plane is shown in Figure 38 which has a distribution of 512 X 256 cells. The grid in the vicinity of airfoil is shown as an inset and a very fine distribution can be noted very close to the wall. It was estimated that \(y^+\) is less than 1 to capture the turbulent boundary layer accurately and no wall-function is used.

Problem definition

In this section, various steps needed to set-up the turbulent flow over an airfoil will be shown. A full working case of this can be found in:

/tutorials/incompressible/simpleSolver/ras/ACCM_airFoil2D

However,the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

The problem requires time, constant and system sub-directories within the main working directory. Here, the simulation will be started at time t = 0 s, which requires a time sub-directory named 0.

The 0 sub-directory has files in which boundary properties are specified. In the below table, the list of necessary files are provided based on the turbulence model chosen

Parameter

File name

Pressure (\(p\))

p

Velocity (\(U\))

U

Turbulent viscosity (\(\nu\))

nut

Turbulence field variable (\(\tilde{\nu}\))

nuTilda (Only for SA model)

Turbulent kinetic energy (\(k\))

k (Only for \(k-\omega~\rm{SST}\) model)

Turbulent dissipation rate (\(\omega\))

omega (Only for \(k-\omega~\rm{SST}\) model)

We will consider two turbulence models in this tutorial, namely Spalart-Allmaras (SA) and \(k-\omega\) - Shear Stress Transport (\(\rm{SST}\)). The contents of the files listed above sets the dimensions, initialisation and boundary conditions to the defining problem, which also forms three principle entries required.

The user should note that Caelus is case sensitive and therefore the directory and file set-up should be identical to what is shown here.

Boundary Conditions and Solver Attributes

Boundary Conditions

Referring back to Figure 37, the following are the boundary conditions that will be specified:

  • Inlet
    • Velocity:

      • \(\alpha=0^\circ\): Fixed uniform velocity \(u = 52.0770~m/s\); \(v = w = 0.0~m/s\) in \(x, y\) and \(z\) directions respectively

      • \(\alpha=10^\circ\): Fixed uniform velocity \(u = 51.2858~m/s\); \(v = 0.0~m/s\) and \(w = 9.04307~m/s\) in \(x, y\) and \(z\) directions respectively

    • Pressure: Zero gradient

    • Turbulence:

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras (Fixed unifSpalart–Allmaras (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu}=0\))

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k = <<0\) and \(\nu_t=0\); \(\omega\) = omegaWallFunction)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart–Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation
    • Velocity:

      • \(\alpha=0^\circ\): Fixed uniform velocity \(u = 52.0770~m/s\); \(v = w = 0.0~m/s\) in \(x, y\) and \(z\) directions respectively

      • \(\alpha=10^\circ\): Fixed uniform velocity \(u = 51.2858~m/s\); \(v = 0.0~m/s\) and \(w = 9.04307~m/s\) in \(x, y\) and \(z\) directions

    • Pressure: Zero Gauge pressure

    • Turbulence:

First, the pressure file named p has the following contents

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    wall
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //

In the information shown above, it can be seen that the file begins with a dictionary named FoamFile which contains the standard set of keywords for version, format, location, class and object names. The explanation of the principle entries are as follows

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0;

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

Similarly, the file U is defined as follows,

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (52.077 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (52.077 0 0);
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    wall
    {
        type            noSlipWall;
    }
}


// ************************************************************************* //

The principle entries for velocity field are self-explanatory and the dimensions are typically for that of velocity with the units \(m/s\) ([0 1 -1 0 0 0 0]). The user should note that appropriate entry has to be enabled for both internalField and inlet boundaryField depending on which angle of attack (AOA/\(\alpha\)) is being simulated. Here, both initialisation and inlet have a uniform flow velocity specified with three velocity components. For example at \(\alpha = 10^\circ\), we specify (51.2858 0 9.04307) for \(u, v, w\) components respectively. Similarly, the wall boundary patch have three velocity components.

The turbulent properties are also required to be specified at the boundary patches and these can be done similar to p and U. The file nut, defines turbulent kinematic viscosity and its boundary conditions as follows.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 1.8265e-06;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 1.8265e-06;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

As noted above, the turbulent viscosity is specified as kinematic and therefore the units are in \(m^2/s\) ([0 2 -1 0 0 0 0]). The turbulent viscosity value at freestream, specified at inlet patch is calculated as detailed in Turbulent freestream conditions for SA Model and Turbulent freestream conditions for SST Model for SA and SST models respectively and is specified accordingly. The same value also goes for internalField. Note that a fixedValue of 0 is used for the wall which suggests that on the wall, it is only the molecular (laminar) viscosity that prevails.

The next turbulent property to set is the nuTilda which is a turbulent field variable, specified to only SA model and has the same units ([0 2 -1 0 0 0 0]) as kinematic turbulent viscosity. Details pertaining to this are given in Turbulent freestream conditions for SA Model. The following are the contents of the file nuTilda and the entries specified for the boundaryField are identical to that of turbulent kinematic viscosity explained above.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 2.60385e-05;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 2.60385e-05;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

We can now proceed to the files k and omega, specific to only \(k-\omega~\rm{SST}\) model. \(k-\omega~\rm{SST}\) is a turbulence model which solves for turbulent kinetic energy and the specific rate of dissipation using two partial differential equations. Caelus therefore requires information about these to be specified at the boundary patches when this model is chosen. Starting with the file k,

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.0010999;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 0.0010999;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    wall
    {
        type            fixedValue;
        value           uniform 1e-10;
    }
}


// ************************************************************************* //

The unit of kinetic energy is \(m^2/s^2\) and this is set in dimensions as [0 2 -2 0 0 0 0]. As with other turbulent quantities discussed above, the value of \(k\) (refer Turbulent freestream conditions for SST Model) needs to be specified for internalField, inlet and wall. Please note that for wall boundaryField with no wall-function, a small, non-zero fixedValue is required.

We now proceed to the file omega and the value for this is evaluated as detailed in Turbulent freestream conditions for SST Model

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 13887.21912;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 13887.21912;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    wall
    {
        type            omegaWallFunction;
        value           uniform 1;
    }
}


// ************************************************************************* //

The unit of specific rate of dissipation for \(\omega\) is \(1/s\) which is set in dimensions as [0 0 -1 0 0 0 0]. The internalField and inlet gets a fixedValue. Note that for wall boundaryField, we specify omegaWallFunction and this is a model requirement and sets omega to the correct value near wall based on the \(y^+\). In conjunction, the value that goes with omegaWallFunction can be anything and for simplicity its set to 1.

Before proceeding to the next step, it is vital to ensure that the boundary conditions (inlet, outlet, wall, etc) added in the above files should be the grid boundary patches (surfaces) generated by grid generation tool and their names are identical. Additionally, the two boundaries \(x-z\) plane named here as left and right have empty boundary conditions which forces Caelus to assume the flow to be in two-dimensions. With this, the setting up of the boundary conditions are complete.

Grid file and Physical Properties

The grid files associated with the NACA airfoil need to be placed in polyMesh sub-directory, which resides in the constant directory. Note that for both angles of attack, the identical grid is used. This is because the flow incidence angle is relative to the fixed airfoil and the equivalent velocity components can be easily specified thus simulating the airfoil at the required angle of attack. In addition, the physical properties are specified in various different files present in the constant directory.

polyMesh  RASProperties  transportProperties  turbulenceProperties

As seen above, the three files are listed in addition to the polyMesh sub-directory. The first one, RASProperties in which the Reynolds-Average-Stress (RAS) model is specified, which is shown below. Please note that depending on the turbulence model you wish to run with, the line that corresponds to that specific model should be enabled.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				RASProperties;
}

//--------------------------------------------------------------------------------

// For Spalarat-Alamaras Model, enable the below line
RASModel				SpalartAllmaras;

// For k-omega SST Model, enable the below line
// RASModel				kOmegaSST;

turbulence				on;

printCoeffs				on;

SpalartAllmarasCoeffs
{
    curvatureCorrection off;
}

kOmegaSSTCoeffs
{
    curvatureCorrection off;
    Cscale          1;
    frMax           1.25;    
}

Second from the list is the transportProperties file, where kinematic viscosity is specified as shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 8.679514E-6;

The viscous behaviour is modelled as Newtonian and hence the keyword Newtonian is used for the transportModel and the molecular (laminar) kinematic viscosity (\(nu\)) is given having the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The final file in this class is the turbulenceProperties file, which sets the simulationType to RASModel. Both SA and \(k-\omega~\rm{SST}\) are classified as Reynolds Average Stress (RAS) models.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				RASModel;

Controls and Solver Attributes

In this section, the files required to control the simulation, specifying discretisation methods and linear solver settings are given. These files are to be placed in the system directory. First, navigate to the system directory. The controlDict file contains the following details

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
   version          2.0;
   format           ascii;
   class            dictionary;
   location         "system";
   object           controlDict;
}
//-------------------------------------------------------------------------------

application         simpleSolver;

startFrom           startTime;

startTime           0;

stopAt              endTime;

endTime             10000; // increase endTime to atleast 50000 for validation cases

deltaT              1;

writeControl        runTime;

writeInterval       1000;

purgeWrite          2;

writeFormat         ascii;

writePrecision      12;

writeCompression    true;

timeFormat          general;

timePrecision       6;

runTimeModifiable   true;

//-------------------------------------------------------------------------------

// Function Objects to obtain forces

functions
{
    forces
    {
        type            forces;

        functionObjectLibs ("libforces.so");
        patches         ( wall );
        CofR            (0 0 0);
        rhoName         rhoInf;
        rhoInf          2.15527;
        writeControl    timeStep;
        writeInterval   50;
    }
}

Referring to the above file, some explanation is required. Here, simpleSolver is used and the simulation begins at t = 0 s. This now explains the logical need for having a 0 directory where the data files are read at the beginning of the run, which is t = 0 s in this case. Therefore, the keyword startFrom is set to startTime, where startTime is set to 0. The simulation would be carried out as steady-state and therefore we require to specify the total number of iterations as a keyword for endTime. Via the writeControl and writeInterval keywords, the solution intervals at which they are saved can be specified. Also note that a function object to obtain the force over the wall (airfoil surface) for every 50 iterations is included. In order to obtain this, a freestream density (rhoInf) need to be specified.

The discretization schemes for the finite volume discretization that will be used should be set through the fvSchemes file shown below.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
    version         2.0;
    format          ascii;
    class           dictionary;
    object          fvSchemes;
}
//------------------------------------------------------------------------------

ddtSchemes
{
   default              steadyState;
}

gradSchemes
{
   default              Gauss linear;
}

divSchemes
{
   default              none;
   div(phi,U)           Gauss linearUpwindBJ grad(U);
   div(phi,nuTilda)     Gauss upwind;
   div(phi,k)           Gauss upwind;
   div(phi,omega)       Gauss upwind;
   div((nuEff*dev(T(grad(U))))) Gauss linear;
   div(phi,symm(grad(U))) Gauss linear;
}

laplacianSchemes
{
   default              none;
   laplacian(nu,U)      Gauss linear corrected;
   laplacian(nuEff,U)   Gauss linear corrected;
   laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
   laplacian(DkEff,k) Gauss linear corrected;
   laplacian(DomegaEff,omega) Gauss linear corrected;
   laplacian(rAUf,p)    Gauss linear corrected;
   laplacian(1,p)       Gauss linear corrected;
}

interpolationSchemes
{
   default              linear;
   interpolate(HbyA)    linear;
}

snGradschemes
{
   default              corrected;
}


The linear solver controls and tolerances are set in fvSolution as given below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
        version                         2.0;
        format                          ascii;
        class                           dictionary;
        location                        "system";
        object                          fvSolution;
}
//------------------------------------------------------------------------------

solvers
{
    p
    {
        solver                  PCG;
        preconditioner
        {
            preconditioner          GAMG;
            smoother                SSGS;
            cacheAgglomeration      true;
            nCellsInCoarsestLevel   10;
            agglomerator            algebraicPair;
            mergeLevels             1;
        }

        tolerance               1e-16;
        relTol                  0.01;
    }

    U
    {
        solver                  PBiCGStab;
        preconditioner          USGS;
        tolerance               1e-16;
        relTol                  0.1;
    }

    "(k|omega|nuTilda)"
    {
        solver                  PBiCGStab;
        preconditioner          USGS;
        tolerance               1e-16;
        relTol                  0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors    1;
    pRefCell                    0;
    pRefValue                   0;
    consistent                  yes;
    correctionFoam              yes;
}

// relexation factors

relaxationFactors
{
    p                           0.3;
    U                           0.7;
    nuTilda                     0.7;
    k                           0.7;
    omega                       0.7;
}

The user should now take a note that in the fvSolution file, different linear solvers are used to solve for velocity, pressure and turbulence quantities We also set the nNonOrthogonalCorrectors to 1 for this case. To ensure the stability of the solution, the relaxation is set to primary and turbulent variables. The relTol is not set to 0 unlike a time-accurate set-up as we are solving for a steady-state solution and a very low (\(\approx 0\)) tolerance at every iteration is unnecessary. Since the entire system of equations converge to a global set tolerance the convergence would occur as the solution progresses to a steady state.

With this, the set-up of the directory structure with all the relevant files are complete. This can be verified again by issuing the following command and the directory tree should appear identical to the one shown below

cd my-turbulent-airfoil/
tree
.
├── 0
│   ├── epsilon
│   ├── k
│   ├── nut
│   ├── nuTilda
│   ├── omega
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── decomposePar
    ├── fvSchemes
    └── fvSolution
Execution of the solver

Before executing the solver, it is important to renumber and to carry out a quality check on the grid/mesh. Renumbering reduces the bandwidth whereas the quality check shows the mesh statistics. These two can be performed by executing the following commands from the top working directory

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

When the renumberMesh is performed, the user should take note of the bandwidth before and after the mesh renumbering. In a similar manner, when the checkMesh is performed, the mesh statistics are shown as below

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (-484.456616748 0 -507.806809185) (501.000007802 10 507.806808887)
    Mesh (non-empty, non-wedge) directions (1 0 1)
    Mesh (non-empty) directions (1 0 1)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (8.28364670182e-18 1.55457412622e-15 -1.3301799376e-17) OK.
 ***High aspect ratio cells found, Max aspect ratio: 31784747.6728, number of cells 29164
  <<Writing 29164 cells with high aspect ratio to set highAspectRatioCells
    Minimum face area = 9.57960157047e-11. Maximum face area = 843.777295738.  Face area magnitudes OK.
    Min volume = 9.57960157047e-10. Max volume = 8437.77295738.  Total volume = 8755584.35466.  Cell volumes OK.
    Mesh non-orthogonality Max: 57.3127287926 average: 1.73980453241
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 0.201755632336 average: 0.00254964789178 OK.
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

As can be noted above, the output of the checkMesh indicates that the mesh check has failed reporting in the final message as Failed 1 mesh checks. This is because of the high aspect ratio meshes present immediate to the wall with very low (\(<< y^+\)) values. Nevertheless, this is just a warning and Caelus will solve on this mesh.

As with the previous tutorial, it will be shown here to utilise the multi-core capability of CPUs for performing a parallel computation using MPI technique for large grids, such as the one considered here. Before this can be done, the grid has to be decomposed into smaller domains that can be solved by each single CPU core. The number of decomposition should be equal to the number of CPU core available for parallel computing. The decomposition is carried out through a file decomposeParDict present in the system sub-directory as shown below.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
    version     		2.0;
    format      		ascii;
    class       		dictionary;
    object      		decomposeParDict;
}
//--------------------------------------------------------------------------------

numberOfSubdomains 		4; // It is suggested that the numberOfSubdomains be increased based on available resources for validation cases and to reduce the computation time.

method          		scotch;

distributed     		no;

roots
(
);

In the above file, the the keyword numberOfSubdomains defines the number of decomposed sub-domains needed and 4 is used which partitions the grid into 4 sub-domains. We use scotch as the method of decomposition which automatically divides the gird. The execution to decompose the grid is carried out again from the top directory as follows

caelus run -- decomposePar

Now the decomposition should begin and the details of which are displayed in the terminal window. Subsequently, 4 processor directories will be generated as we have requested for 4 divisions of grid as shown below

0  constant  processor0  processor1  processor2  processor3  system

The solver can now be executed for parallel computation in the host machine from the top directory using the following command

caelus run -p -l my-turbulent-airfoil.log -- simpleSolver

Note that here it is assumed that the parallel computing is available in the host machine. With the execution of the above commands, the simulation begins and the progress of the solution is written to the specified log file (my-turbulent-airfoil.log).

The log file can be further processed to look at the convergence history and this can be done as follows

caelus logs -w my-turbulent-airfoil.log

The above command allows you to look at the convergence of different variables with respect to the number of iterations carried out. The convergence of pressure is shown in Figure 39.

_images/t-airfoil-convergence-tutorials.png

Convergence of pressure with respect to iterations

Results

The flow over the airfoil at both \(0^\circ\) and \(10^\circ\) degree angle of attack are presented here. In Figure 40, velocity magnitude and pressure contours can be seen for \(\alpha = 0^\circ\) angle of attack. These result are for the SA model. The suction and the pressure surfaces essentially produce the same flow due to \(0^\circ\) angle of incidence and thus contributes to zero lift. In contrast, at \(0^\circ\) angle of incidence in Figure 41, a low pressure region exists on the upper surface and consequently the velocity increases thus generating some lift.

_images/t-airfoil-velocitypressure-tutorials-0.png

Velocity magnitude and pressure contours for \(\alpha = 0^\circ\) angle of attack

_images/t-airfoil-velocitypressure-tutorials-10.png

Velocity magnitude and pressure contours for \(\alpha = 10^\circ\) angle of attack

Convex Curvature

Turbulent flow in a constant-area duct having a convex curvature is considered in this tutorial. Caelus 9.04 will be used and the process of setting-up of directory structure, fluid properties, boundary conditions, turbulent properties, etc will be explained here. In addition to this, the flow within the duct will be visualised. The steps would be sufficient for the user to reproduce the tutorial accurately.

Objectives

Through this tutorial, the user will get familiarise with setting up the Caelus simulation for steady, turbulent, incompressible flow in a two-dimensional duct having a convex curvature and subsequently post-process the results. The steps that would be followed in this tutorial is outlined below

  • Background
    • A brief description about the problem

    • Geometry and inflow details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Visualising the flow within the convex duct

Pre-requisites

It will be assumed that the user is comfortable and familiar with the Linux command line environment using a terminal or Caelus-console (on Windows OS). The user should also make sure that Caelus is installed correctly with appropriate environment variables set. The grid used here is obtained from Turbulence Modeling Resource in Plot 3D format and is exported to Caelus using Pointwise. The user can use their choice of grid generation tool to convert Plot3D file to Caelus format.

Background

Turbulent flow in a constant-area duct with a curvature is an interesting case. Here as a result of a curvature, pressure gradients occur in the vicinity of the curvature having localised effect. The flow will be assumed as steady-state and incompressible. Non-dimensional shear-stress (skin-friction coefficient) will be used to show the influence of curvature on the flow. Validation and verification of this exercise is detailed in section Two-dimensional Convex Curvature and the user is suggested to refer for more information.

The inlet of the duct as can be seen from the schematic below in Figure 42 has an inclination of \(\alpha = 30^\circ\). This is followed by a rapid bend at the same angle, \(\alpha\) after a distance of about 1.4 m. The downstream extends to 1.6 meters. The inflow has a Reynolds number of \(2.1 \times 10^6\), with Air as the fluid. The temperature of the inflow is at 293 K and U is the inlet velocity. Based on the Reynolds number, temperature and velocity, the kinematic viscosity is evaluated to \(\nu = 1.519470 \times 10^{-5}~m^2/s\). The geometric-plane for this case in 2-D is \(x-z\) plane.

_images/t-curvature-schematic-tutorials.png

Schematic representation of the 2D curvature geometry

The inflow conditions for this case is given in the below table (Freestream conditions)

Freestream conditions

Fluid

\(Re/L~(1/m)\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~(K)\)

\(\nu~(m^2/s)\)

Air

\(2.1 \times 10^6\)

31.9088

Gauge (0)

293

\(1.5194\times10^{-6}\)

To achieve a inlet velocity of U = 31.9088 m/s at \(\alpha = 30^\circ\), the velocity components in \(x\) and \(z\) are resolved. These are given in the below table

Velocity components in x and z directions

\(\alpha\)

\(u~(m/s)\)

\(w~(m/s)\)

\(30^\circ\)

27.63313

15.95443

Grid Generation

The structured grid for this case has been obtained from from Turbulence Modeling Resource in a Plot3 format which contains 512 cells in streamwise direction and 192 in the flow normal direction. The Plot3D file has to be converted to polyMesh format.

In Figure 43, the computational domain can be seen which as expected follows the geometry. The velocity at the internal walls (highlighted in blue) are zero, wherein \(u, v, w =0\) representing a no-slip boundary. The inlet and the outlet are applied to the start and end of the domain respectively.

_images/t-curvature-domain-tutorials.png

Computational domain of the convex curvature

The grid that is used, polyMesh format is in three-dimensions. However it is assumed that the flow through the duct can be modelled as 2D and is the 2D plane considered for this case is \(x-z\) directions. As with all the previous cases, one-cell thick normal to the 2D plane is sufficient, assuming the flow to be symmetry. The two \(x-z\) planes that are present in the grid require boundary conditions to be specified. An empty boundary condition can be used in Caelus for the two planes that forces the solver not to solve in the third-dimension, essentially treating the flow as symmetry in \(y\) direction.

Note

A velocity value of \(v=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(y\) direction.

_images/t-curvature-grid-tutorials.png

Convex curvature grid in two-dimensions in \(x-z\) plane

The 2D grid in \(x-z\) plane is shown in Figure 44 having a distribution of 512 X 192 cells. The inset in the figure highlights the region vicinity of the curvature and very fine distribution of cells can be seen close to the wall. It is estimated that \(y^+\) is less than 1 in order to capture turbulent boundary layer accurately and thus no wall-function is used.

Problem definition

This section details the various steps required to set-up the turbulent flow inside a convex duct. A full working case of this can be found in:

/tutorials/incompressible/simpleSolver/ras/ACCM_convexCurvature2D

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

A few more sub-directories are needed in the top-level directory to set-up the case. Caelus requires time, constant and system sub-directories within the main my-turbulent-curvature working directory. Since we start the simulation at time, t =0 s, a time sub-directory named 0 is required. A

The 0 sub-directory cotains the files in which boundary properties are specified. In the below table, the list of necessary files are provided based on the turbulence model chosen

Parameter

File name

Pressure (\(p\))

p

Velocity (\(U\))

U

Turbulent viscosity (\(\nu\))

nut

Turbulence field variable (\(\tilde{\nu}\))

nuTilda (Only for SA & SA-CC model)

Turbulent kinetic energy (\(k\))

k (Only for \(k-\omega~\rm{SST}\) model)

Turbulent dissipation rate (\(\omega\))

omega (Only for \(k-\omega~\rm{SST}\) model)

We consider simulating this case with three turbulence models, namely Spalart-Allmaras (SA), Spalart–Allmaras Rotational/Curvature (SA-RC) and \(k-\omega\) - Shear Stress Transport (\(\rm{SST}\)). The contents that are entered in these files set the dimensions, initialisation and boundary conditions to the defining problem, which also form three principle entries required.

Caelus is case sensitive and therefore the user should carefully set-up the case as shown here if applicable.

Boundary Conditions and Solver Attributes

Boundary Conditions

Referring back to figure Computational domain of the convex curvature, following are the boundary conditions that will be specified:

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 27.63313~m/s\); \(v = 0.0~m/s\) and \(w = 15.95443~m/s\) in \(x, y\) and \(z\) directions respectively

    • Pressure: Zero gradient

    • Turbulence:

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • SA & SA-RC (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu} =0\))

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k = <<0\) and \(\nu_t=0\); \(\omega\) = omegaWallFunction)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • SA & SA-RC (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 27.63389~m/s\); \(v = 0.0~m/s\) and \(w = 15.95443~m/s\) in \(x, y\) and \(z\) directions respectively

    • Pressure: Zero Gauge pressure

    • Turbulence:

First, we begin with the pressure file, p and using a text editor with the following content.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            zeroGradient;
    }
    wall
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //

As noted above, the file begins with a dictionary named FoamFile containing the essential set of keywords for version, format, location, class and object names. The explanation of the principle entries are as follows

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0;

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

Similarly, the contents for the file U is as follows

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (27.63313 0 15.954);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (27.63313 0 15.954);
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    wall
    {
        type            noSlipWall;
    }
}


// ************************************************************************* //

The principle entries for velocity field are self-explanatory and the dimensions are typically for that of velocity with the units \(m/s\) ([0 1 -1 0 0 0 0]). Here, both initialisation and inlet have a uniform flow velocity specified with three velocity components. For example at \(\alpha = 30^\circ\), we specify (27.63313 0 15.954) for \(u, v, w\) components respectively. Similarly, the top and wall boundary patch have three velocity components.

The turbulent properties are also required to be specified at the boundary patches and these can be done similar to p and U. First, we start with opening the file nut, which is turbulent kinematic viscosity having the following details

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 1.36756e-07;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 1.36756e-07;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            fixedValue;
        value           uniform 0;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

In the above file, the turbulent viscosity is specified as kinematic and therefore the units are in \(m^2/s\) ([0 2 -1 0 0 0 0]). The turbulent viscosity value at inlet, specified at inlet patch is calculated as detailed in Turbulent freestream conditions for SA Model and Turbulent freestream conditions for SST Model for SST models respectively and is specified accordingly. The same value also goes for internalField. Note that a fixedValue of 0 is used for the wall which suggests that on the wall, it is only the molecular (laminar) viscosity that prevails.

The next property to set is the nuTilda, which is the turbulent field variable, specified to only SA and SA-RC models and has the same units ([0 2 -1 0 0 0 0]) as kinematic turbulent viscosity. For more information about these, the user can look at Turbulent freestream conditions for SA Model. Following are the contents of the file nuTilda and the entries specified for the boundaryField are identical to that of turbulent kinematic viscosity explained above.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 4.55841e-05;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 4.55841e-05;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            fixedValue;
        value           uniform 0;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

We can now set the properties of k and omega, specific to only \(k-\omega~\rm{SST}\) model. \(k-\omega~\rm{SST}\) is a turbulence model which solves for turbulent kinetic energy and the specific rate of dissipation using two partial differential equations. Caelus therefore requires information about these to be specified at the boundary patches when this model is chosen. Starting with the file k,

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.001052132;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 0.001052132;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            fixedValue;
        value           uniform 1e-10;
    }
    wall
    {
        type            fixedValue;
        value           uniform 1e-10;
    }
}


// ************************************************************************* //

The unit of kinetic energy is \(m^2/s^2\) and this is set in dimensions as [0 2 -2 0 0 0 0]. As with other turbulent quantities discussed above, the value of \(k\) (refer Turbulent freestream conditions for SST Model) needs to be specified for internalField, inlet and wall. Please note that for wall boundaryField with no wall-function, a small, non-zero fixedValue is required.

Similarly in the file omega, the value is evaluated as detailed in Turbulent freestream conditions for SST Model

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 7747.333;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 7747.333;
    }
    left
    {
        type            empty;
    }
    outlet
    {
        type            zeroGradient;
    }
    right
    {
        type            empty;
    }
    top
    {
        type            omegaWallFunction;
        value           uniform 1;
    }
    wall
    {
        type            omegaWallFunction;
        value           uniform 1;
    }
}


// ************************************************************************* //

The unit of specific rate of dissipation for \(\omega\) is \(1/s\) which is set in dimensions as [0 0 -1 0 0 0 0]. The internalField and inlet gets a fixedValue. Note that for wall boundaryField, we specify omegaWallFunction and this is a model requirement and sets omega to the correct value near wall based on the \(y^+\). In conjunction, the value that goes with omegaWallFunction can be anything and for simplicity its set to 1.

At this stage it is important to ensure that the boundary conditions (inlet, outlet, wall, etc) added in the above files should be the grid boundary patches (surfaces) generated by grid generation tool and their names are identical. In addition, the two boundaries \(x-z\) plane named here as left and right have empty boundary conditions which forces Caelus to assume the flow to be in two-dimensions. With this, the setting up of the boundary conditions are complete.

Grid file and Physical Properties

The grid file for the convex curvature has to be placed in polyMesh sub-directory, which is in the constant directory. Further to is, the physical properties should be specified in various different files present in the constant directory.

polyMesh  RASProperties  transportProperties  turbulenceProperties

As noted above, the three files are listed in the constant sub-directory. The first one is the RASProperties where, Reynolds-Average-Stress (RAS) model is specified as shown below. Please note that depending on the turbulence model you wish to run with, the line that corresponds to that specific model should be enabled.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				RASProperties;
}

//--------------------------------------------------------------------------------

// For Spalarat-Alamaras Model, enable the below line
//RASModel				SpalartAllmaras;

// For k-omega SST Model, enable the below line
RASModel				kOmegaSST;

turbulence				on;

printCoeffs				on;

SpalartAllmarasCoeffs
{
    curvatureCorrection on;
}

kOmegaSSTCoeffs
{
    curvatureCorrection off;
    Cscale          1;
    frMax           1.25;    
}

Second from the list is the transportProperties file, where kinematic viscosity is specified as shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				transportProperties;
}

//--------------------------------------------------------------------------------

transportModel				Newtonian;

nu					nu [0 2 -1 0 0 0 0] 1.519470E-5;

The viscous behaviour is modelled as Newtonian and hence the keyword Newtonian is used for the transportModel and the molecular (laminar) kinematic viscosity (\(nu\)) is given having the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The final file in this class is the turbulenceProperties file, which sets the simulationType to RASModel. Both SA and \(k-\omega~\rm{SST}\) are classified as Reynolds Average Stress (RAS) models.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"constant";
	object				turbulenceProperties;
}

//--------------------------------------------------------------------------------

simulationType				RASModel;

Controls and Solver Attributes

This section will provide details and settings required to control the simulation, specifying discretisation methods and linear solver settings. These files should be saved in the system directory.

The controlDict file contains the following details

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	location			"system";
	object				controlDict;
}

//-------------------------------------------------------------------------------

application				simpleSolver;

startFrom				startTime;

startTime				0;

stopAt					endTime;

endTime					3000;

deltaT					1;

writeControl				runTime;

writeInterval				1000;

purgeWrite				0;

writeFormat				ascii;

writePrecision				12;

writeCompression			true;

timeFormat				general;

timePrecision				6;

runTimeModifiable			true;

//-------------------------------------------------------------------------------

// Function Objects to obtain forces

functions
{
	forces
	{
		type			forces;

        functionObjectLibs	("libforces.so");
        patches     		( wall );
        CofR      			(0 0 0);
        rhoName         	rhoInf;
        rhoInf          	1.2084;
        writeControl   		timeStep;
        writeInterval  		50;
     }
}

With reference to the above files, some explanation is required. In this case, simpleSolver solver is used and the simulation begins at t = 0 s. This now explains the logical need for having a 0 directory where the data files are read at the beginning of the run, which is t = 0 s for this simulation. Therefore, the keyword startFrom is set to startTime, where startTime is set to 0. The simulation would be carried out as steady-state and therefore we require to specify the total number of iterations as a keyword for endTime. Via the writeControl and writeInterval keywords, the solution intervals at which they are saved can be specified. Also note that a function object to obtain the force over the wall for every 50 iterations is included. In order to obtain this, a inlet/inflow density (rhoInf) need to be specified.

The discretization schemes for the finite volume discretization that will be used should be set through the fvSchemes file show below and the contents should be copied

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//------------------------------------------------------------------------------

ddtSchemes
{
	default				steadyState;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwind	grad(U);
	div(phi,nuTilda)		Gauss	upwind;	// Will be used for SA & SA-RC model only
	div(phi,k)			Gauss 	upwind; // will be used for k-epsilon & k-omega only
	div(phi,omega)			Gauss 	upwind;	// Will be used for k-omega model only
	div((nuEff*dev(T(grad(U)))))	Gauss   linear;
	div(phi,symm(grad(U))) 		Gauss 	linear;
}

laplacianSchemes
{
	default				none;
	laplacian(nu,U)			Gauss 	linear 	corrected;
	laplacian(nuEff,U)		Gauss 	linear 	corrected;
	laplacian(DnuTildaEff,nuTilda) 	Gauss 	linear 	corrected; // Will be used for SA & SA-RC model only
	laplacian(DkEff,k)		Gauss 	linear 	corrected; // Will be used for k-omega & k-omega only
	laplacian(DomegaEff,omega)	Gauss 	linear 	corrected; // Will be used for k-omega model only
	laplacian(rAUf,p)		Gauss 	linear	corrected;
	laplacian(1,p)			Gauss 	linear 	corrected;
}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}


The linear solver controls and tolerances are set in fvSolution as given below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
        version                         2.0;
        format                          ascii;
        class                           dictionary;
        location                        "system";
        object                          fvSolution;
}

//------------------------------------------------------------------------------

solvers
{
        p
        {
                solver                  PCG;
                preconditioner          SSGS;
                tolerance               1e-8;
                relTol                  0.01;
        }
        U
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-7;
                relTol                  0.01;
        }

        "(k|omega|nuTilda)"
        {
                solver                  PBiCGStab;
                preconditioner          USGS;
                tolerance               1e-08;
                relTol                  0;
        }
}

SIMPLE
{
        nNonOrthogonalCorrectors        1;
        pRefCell                        0;
        pRefValue                       0;
}

// relexation factors

relaxationFactors
{
        p                               0.3;
        U                               0.5;
        nuTilda                         0.5;
        k                               0.5;    
        omega                           0.5;
}

In the fvSolution file, different linear solvers are used to solve for velocity, pressure and turbulence quantities and this has to be noted by the user. We also set the nNonOrthogonalCorrectors to 1 for this case. To ensure the stability of the solution, the relaxation is set to primary and turbulent variables. The relTol is not set to 0 unlike a time-accurate set-up as we are solving for a steady-state solution and a very low (\(\approx 0\)) tolerance at every iteration is unnecessary. Since the entire system of equations converge to a global set tolerance the convergence would occur as the solution progresses to a steady state.

The set-up of the directory structure with all the relevant files are now complete. This can be verified again as follows and the directory tree should appear identical to the one shown below

cd my-turbulent-curvature/
tree
.
├── 0
│   ├── k
│   ├── nut
│   ├── nuTilda
│   ├── omega
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── decomposeParDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

Renumbering and checking the grid/mesh quality is important before the solver is executed. Renumbering reduces the matrix bandwidth whereas the quality check shows the mesh statistics. These two can be performed by executing the following commands from the top working directory

cd my-turbulent-curvature/

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

With the execution of renumberMesh -overwrite, the user should note the reduction in bandwidth after renumbering occurs. Similarly, when the checkMesh is performed, the mesh statistics are shown as below

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (-1.5 -1 -0.8097167) (1.6 0 0.127)
    Mesh (non-empty, non-wedge) directions (1 0 1)
    Mesh (non-empty) directions (1 0 1)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (2.89884272002e-17 2.78435627054e-16 2.89924087017e-17) OK.
 ***High aspect ratio cells found, Max aspect ratio: 6762.08993149, number of cells 1283
  <<Writing 1283 cells with high aspect ratio to set highAspectRatioCells
    Minimum face area = 1.52715761849e-08. Maximum face area = 0.0318702444976.  Face area magnitudes OK.
    Min volume = 1.52715761849e-08. Max volume = 0.000180011068556.  Total volume = 0.417212754326.  Cell volumes OK.
    Mesh non-orthogonality Max: 27.7205032543 average: 17.6783210246
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 0.0357278029285 average: 0.000574009677514 OK.
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

Apparent from the above output, the checkMesh indicates that the mesh check has failed reporting in the final message as Failed 1 mesh checks. This is because of the high aspect ratio meshes present immediate to the wall with very low (\(<< y^+\)) values. Nevertheless, this is just a warning and Caelus will solve on this mesh.

We can utilise the multi-core capability of CPUs for performing a parallel computation for large grids, such as the one considered for this tutorial. Before this can be done, the grid has to be decomposed into smaller domains that can be solved by each single CPU core. The number of decomposition should be equal to the number of CPU core available for parallel computing. The decomposition should be carried out through a file decomposeParDict present in the system sub-directory which is shown below.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
    version     		2.0;
    format      		ascii;
    class       		dictionary;
    object      		decomposeParDict;
}
//--------------------------------------------------------------------------------

numberOfSubdomains 		4;// It is suggested that the numberOfSubdomains be increased based on available resources for validation cases and to reduce the computation time.


method          		scotch;

distributed     		no;

roots
(
);

In the above file, the the keyword numberOfSubdomains defines the number of decomposed sub-domains needed and 4 is used which partitions the grid into 4 sub-domains. We use scotch as the method of decomposition which automatically divides the grid. The execution to decompose the grid is carried out again from the top directory as follows

caelus run -- decomposePar

Now the decomposition should start and the details of which are displayed in the terminal window. Subsequently, 4 processor directories will be generated as we have requested for 4 divisions of grid as shown below

0  constant  processor0  processor1  processor2  processor3  system

The solver can now be executed for parallel computation from the top directory using the following command

caelus run -p -l my-turbulent-curvature.log -- simpleSolver

Note that here it is assumed that the parallel computing is available in the host machine. With the execution of the above commands, the simulation begins and the progress of the solution is written to the specified log file (my-turbulent-curvature.log).

The log file can be further processed to look at the convergence history and this can be done as follows

caelus logs -w my-turbulent-curvature.log

The above statement allows you to look at the convergence of variables with respect to the number of iterations carried out as shown in Figure 45 for pressure.

_images/t-curvature-convergence-tutorials.png

Convergence of pressure with respect to iterations

Results

The flow visualisation of velocity and pressure within the convex duct is presented here. In Figure 46 velocity magnitude and pressure are shown for SA model. Due to the convex bend, the thinning of the turbulent boundary layer occurs on the lower surface and the pressure decreases. Whereas the trends are opposite on the upper surface.

_images/t-curvature-velocitypressure-tutorials.png

Velocity magnitude and pressure contours within the convex duct

Backward Facing Step

This tutorial focuses on the turbulent flow over a two-dimensional backward facing step using Caelus 9.04. In particular this tutorial emphasises the use of wall functions for a high \(y^+\) grid. The basic steps to set-up the directory structure, fluid properties, boundary conditions, turbulence properties etc will be discussed. Flow visualisation such as pressure and velocity contours within the separated region will be shown. With these steps in place, the user should be able to reproduce the tutorial accurately.

Objectives

Through this tutorial, the user will get familiar in setting up Caelus simulation for steady, turbulent, incompressible flow over a two-dimensional backward facing step with wall functions. Further, the velocity and pressure contours within the separated region will be highlighted. Following would be the steps that would be carried out.

  • Background
    • A brief description about the problem

    • Geometry and freestream details

  • Grid generation
    • Computational domain and boundary details

    • Computational grid generation

    • Exporting grid to Caelus

  • Problem definition
    • Directory structure

    • Setting up boundary conditions, physical properties and control/solver attributes

  • Execution of the solver
    • Monitoring the convergence

    • Writing the log files

  • Results
    • Visualisation of flow over within the separated region

Pre-requisites

By now the user should be familiar with the Linux command line environment via a terminalor caelus-consolu (for Windows OS). The grid for this case can be obtained from the full working case directory shown below and was generated using Pointwise and appropriately converting it to Caelus format.

Background

Turbulent flow over a backward facing step is a classical configuration to examine steady separated flows. Here due to the presence of the step, the flow undergoes separation and the subsequent shear layer reattaches downstream forming a recirculation region. The thickness of the boundary layer at the lip of the step and the flow Reynolds number are important parameters that determines the length of separated region. A decrease in pressure or favourable pressure gradient in the immediate vicinity of the step is a classical behaviour that contributes to the increase in drag. The user is suggested to refer to the verification and validation of this case at Two-dimensional Backward Facing Step for more detailed analysis.

The schematic of the backward facing step is shown in Figure 47 in two-dimensions. A step height (H) of 1.0 m is used with a flow Reynolds number of 36000, which is based on the step height. Air is considered as a fluid with a freestream temperature of 298 K and the freestream velocity corresponds to U = 44.315 m/s. The user should note that the two-dimensional geometric plane considered is in \(x-z\) directions.

_images/t-step-schematic-tutorials.png

Schematic representation of the backward facing step

Freestream conditions are detailed in the below table

Freestream conditions

Fluid

\(Re_H\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~(K)\)

\(\nu_\infty~(m^2/s)\)

Air

\(36000\)

44.31525

\((0)\) Gauge

298.330

\(1.230979\times10^{-3}\)

Grid Generation

A fully structured gird is developed for this geometry and is converted to polyMesh format. The grid in polyMesh format can be found in the full working directory of this case at

/tutorials/incompressible/simpleSolver/ras/ACCM_backwardFacingStep2D/constant/polyMesh

The computational domain for the step is shown in Figure 48 which also highlights the boundary conditions used. The upstream flat plate extends for up to 110 step heights so that a fully turbulent boundary layer is ensured prior to the step at which the flow separates. Downstream of the step, the plate extends to 50 step heights giving sufficient length for the flow to reattach. The inlet and the outlet is placed as indicated in the Figure 48 and closely flows the experimental set-up. The velocity on the step surfaces is zero, wherein \(u,v,w = 0\) represented through a no-slip boundary.

_images/t-step-domain-tutorials.png

Computational domain of a 2D backward facing step

The grid in polyMesh is in three-dimensions, although the flow over the step is two-dimensional in nature. A one-cell thick grid normal to the flow plane (\(x-z\)) is therefore sufficient for Caelus to consider symmetry flow in the \(y\) direction. The two resulting planes that are in (\(x-z\)) direction need boundary conditions to be specified. Since the flow is assumed to be 2D, we do not need to solve the flow in the third-dimension and this can be easily achieved in Caelus by specifying empty boundary conditions for each of the two planes. This consequently treats the flow in :math`y` direction as symmetry.

Note

A velocity value of \(v=0\) needs to be specified at appropriate boundaries although no flow is solved in the \(y\) direction.

_images/t-step-grid-tutorials.png

Computational grid of a 2D backward facing step in \(x-z\) plane

The 2D step grid in \(x-z\) plane is shown in figure %s:numref:t-step-grid-tutorials which has a total of 189 cells in the streamwise direction and 64 cells in the normal direction, with 20 cells representing the step height. As noted earlier, the grid is developed to use with wall functions and hence the \(y^+ \approx 30\) in this case.

Problem definition

This section details various steps needed to set-up the turbulent flow over a step. A full working case of this can be found in:

/tutorials/incompressible/simpleSolver/ras/ACCM_backwardFacingStep2D

However,the user is free to start the case setup from scratch consistent with the directory stucture discussed below.

Directory Structure

Note

All commands shown here are entered in a terminal window, unless otherwise mentioned

In order to set-up the problem Caelus requires time, constant and system sub-directories within the main working directory. Here, the simulation will be started at time t = 0 s, which requires a time sub-directory named 0.

The 0 sub-directory contains few additional files in which boundary conditions are specified. In the below table, the list of necessary files are provided based on the turbulence model chosen.

Parameter

File name

Pressure (\(p\))

p

Velocity (\(U\))

U

Turbulent viscosity (\(\nu\))

nut

Turbulence field variable (\(\tilde{\nu}\))

nuTilda (Only for SA model)

Turbulent kinetic energy (\(k\))

k (Only for \(k-\omega~\rm{SST}\) model)

Turbulent dissipation rate (\(\omega\))

omega (Only for \(k-\omega~\rm{SST}\) model)

Turbulent dissipation (\(\epsilon\))

epsilon (Only for R \(k-\epsilon\) model)

In this tutorial we consider three turbulence models. They are Spalart-Allmaras (SA), \(k-\omega\) - Shear Stress Transport (\(\rm{SST}\)) and Realizable \(k-epsilon\) models. The content of the files listed above sets the dimensions, initialisation and boundary conditions to the defining problem, which also forms three principle entries required.

The user should note that Caelus is case sensitive and therefore the directory and file set-up should be identical to what is shown here.

Boundary Conditions and Solver Attributes

Boundary Conditions

Referring back to Figure 48, the following are the boundary conditions that will be specified:

  • Inlet
  • Symmetry
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Turbulence: Symmetry

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras:

        • \(\nu_t\): type nutUWallFunction with a uniform value of \(\nu_t=0\)

        • \(\tilde{\nu}\): type fixedValue with a value of \(\tilde{\nu}=0\)

      • \(k-\omega~\rm{SST}\):

        • \(k\): type kqRWallFunction with a uniform value of \(k_{\infty}\)

        • \(\omega\): type omegaWallFunction with a uniform value of \(\omega_{\infty}\)

        • \(\nu_t\): type nutUWallFunction with a uniform value of \(\nu_t=0\)

      • Realizable \(k-\epsilon\):

        • \(k\): type kqRWallFunction with a uniform value of \(k_{\infty}\)

        • \(\epsilon\): type epsilonWallFunction with a uniform value of \(\epsilon=0\)

        • \(\nu_t\): type nutUWallFunction with a uniform value of \(\nu_t=0\)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart–Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

      • Realizable \(k-\epsilon\) (Zero gradient \(k\) and \(\epsilon\); Calculated \(\nu_t=0\); )

  • Initialisation

First, the file p, shown below, contains initial and boundary conditions for pressure.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top-wall
    {
        type            zeroGradient;
    }
    upstream
    {
        type            symmetryPlane;
    }
    wall
    {
        type            zeroGradient;
    }
}


// ************************************************************************* //

As can be noted from the above file, it begins with a dictionary named FoamFile which contains the standard set of keywords for version, format, location, class and object names. The explanation of the principle entries are as follows

  • dimension
    • is used to specify the physical dimensions of the pressure field. Here, pressure is defined in terms of kinematic pressure with the units (\(m^2/s^2\)) written as [0 2 -2 0 0 0 0]

  • internalField
    • is used to specify the initial conditions. It can be either uniform or non-uniform. Since we have a 0 initial uniform gauge pressure, the entry is uniform 0;

  • boundaryField
    • is used to specify the boundary conditions. In this case its the boundary conditions for pressure at all the boundary patches.

In the similar way, the file U is defined for velocity

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (44.31525 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (44.31525 0 0);
    }
    outlet
    {
        type            zeroGradient;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top-wall
    {
        type            noSlipWall;
    }
    upstream
    {
        type            symmetryPlane;
    }
    wall
    {
        type            noSlipWall;
    }
}


// ************************************************************************* //

The principle entries for velocity field are self-explanatory and the dimensions are typically for that of velocity with the units \(m/s\) ([0 1 -1 0 0 0 0]). Here, both initialisation and inlet have a uniform flow velocity specified with three velocity components. Therefore these should be set to uniform (44.31525 0 0); while the wall is given a no-slip condition.

The turbulent properties are also required to be specified at the boundary patches and these can be done similar to p and U. We have the file nut, which defines turbulent kinematic viscosity in the domain as follows

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 0.09811;

boundaryField
{
    inlet
    {
        type            calculated;
        value           uniform 0.09811;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top-wall
    {
        type            nutUWallFunction;
        Cmu             0.09;
        kappa           0.41;
        E               9.8;
        value           uniform 0;
    }
    upstream
    {
        type            symmetryPlane;
    }
    wall
    {
        type            nutUWallFunction;
        Cmu             0.09;
        kappa           0.41;
        E               9.8;
        value           uniform 0;
    }
}


// ************************************************************************* //

As noted above, the turbulent viscosity is specified as kinematic and therefore the units are in \(m^2/s\) ([0 2 -1 0 0 0 0]). The turbulent viscosity value at freestream, specified at inlet patch is calculated as detailed in Turbulence freestream conditions for SA model, Turbulent freestream conditions for k-\omega~\rm{SST} Model and Turbulent freestream conditions for Realizable k-\epsilon Model for SA, SST and RKE models respectively and is specified accordingly. The same value also goes for internalField.

The next turbulent property set is the nuTilda which is a turbulent field variable, specified to only SA model and has the same units ([0 2 -1 0 0 0 0]) as kinematic turbulent viscosity. Details pertaining to this are given in Turbulence freestream conditions for SA model. The following is the file nuTilda with the entries specified for the boundaryField are identical to that of turbulent kinematic viscosity explained above.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 0.003692937;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 0.003692937;
    }
    outlet
    {
        type            zeroGradient;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top-wall
    {
        type            fixedValue;
        value           uniform 0;
    }
    upstream
    {
        type            symmetryPlane;
    }
    wall
    {
        type            fixedValue;
        value           uniform 0;
    }
}


// ************************************************************************* //

We can now proceed to the file k which is specific to both \(k-omega~\rm{SST}\) and Realizable \(k-epsilon\) models and represents turbulent kinetic energy.

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.2945755;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 0.2945755;
    }
    outlet
    {
        type            zeroGradient;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top-wall
    {
        type            kqRWallFunction;
        value           uniform 0.2945755;
    }
    upstream
    {
        type            symmetryPlane;
    }
    wall
    {
        type            kqRWallFunction;
        value           uniform 0.2945755;
    }
}


// ************************************************************************* //

The unit of kinetic energy is \(m^2/s^2\) and this is set in dimensions as [0 2 -2 0 0 0 0]. The value of \(k\) (refer Turbulent freestream conditions for k-\omega~\rm{SST} Model and Turbulent freestream conditions for Realizable k-\epsilon Model) needs to be specified for internalField, inlet and wall. Please note that for wall kqRWallFunction with values of freestream are required.

We now proceed to the file omega, specific to only \(k-\omega~\rm{SST}\) model and the value for this is evaluated as detailed in Turbulent freestream conditions for k-\omega~\rm{SST} Model

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 97.37245;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 97.37245;
    }
    outlet
    {
        type            zeroGradient;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top-wall
    {
        type            omegaWallFunction;
        Cmu             0.09;
        kappa           0.41;
        E               9.8;
        beta1           0.075;
        value           uniform 97.37245;
    }
    upstream
    {
        type            symmetryPlane;
    }
    wall
    {
        type            omegaWallFunction;
        Cmu             0.09;
        kappa           0.41;
        E               9.8;
        beta1           0.075;
        value           uniform 97.37245;
    }
}


// ************************************************************************* //

The unit of specific rate of dissipation for \(\omega\) is \(1/s\) which is set in dimensions as [0 0 -1 0 0 0 0]. The internalField and inlet gets a fixedValue. Note that for wall boundaryField, we specify omegaWallFunction required for high \(y^+\).

The final file in this class is the epsilon, specific to only Realizable \(k-\epsilon\) model and the value for this is evaluated as detailed in Turbulent freestream conditions for Realizable k-\epsilon Model

/*---------------------------------------------------------------------------*\
Caelus 9.04
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -3 0 0 0 0];

internalField   uniform 0.079598;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 0.079598;
    }
    outlet
    {
        type            zeroGradient;
    }
    symm-left
    {
        type            empty;
    }
    symm-right
    {
        type            empty;
    }
    top-wall
    {
        type            epsilonWallFunction;
        value           uniform 0;
    }
    upstream
    {
        type            symmetryPlane;
    }
    wall
    {
        type            epsilonWallFunction;
        value           uniform 0;
    }
}


// ************************************************************************* //

The unit of turbulent dissipation for \(\epsilon\) is \(m^2/s^3\) which is set in dimensions as [0 2 -3 0 0 0 0]. The internalField and inlet gets a fixedValue similar to \(\omega\). Note that for wall boundaryField, we specify epsilonWallFunction required for high \(y^+\).

Before proceeding to the next step, it is vital to ensure that the boundary conditions (inlet, outlet, wall, etc) added in the above files should be the grid boundary patches (surfaces) generated by grid generation tool and their names are identical. Additionally, the two boundaries \(x-z\) plane named here as symm-left and symm-right have empty boundary conditions which forces Caelus to assume the flow to be in two-dimensions. With this, the setting up of the boundary conditions are complete.

Grid file and Physical Properties

The files associated with the grid need to be placed in polyMesh sub-directory, which resides in the constant directory. We use identical grid for all the three turbulence simulation. In addition, the physical properties are specified in various different files present in the constant directory.

There are three files listed in addition to the polyMesh sub-directory. The first one, RASProperties in which the Reynolds-Average-Stress (RAS) model is specified, which is shown below. Please note that depending on the turbulence model you wish to run with, the line that corresponds to that specific model should be enabled.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version			2.0;
	format			ascii;
	class			dictionary;
	location		"constant";
	object			RASProperties;
}

//--------------------------------------------------------------------------------

// For Spalarat-Alamaras Model, enable the below line
//RASModel				SpalartAllmaras;

// For k-omega SST Model, enable the below line
//RASModel				kOmegaSST;


// For Realizable k-epsilon Model, enable the below line
RASModel			realizableKE;

turbulence			on;

printCoeffs			on;

Second from the list is the transportProperties file, where laminar kinematic viscosity is specified as shown below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
	version			2.0;
	format			ascii;
	class			dictionary;
	location		"constant";
	object			transportProperties;
}

//--------------------------------------------------------------------------------

transportModel			Newtonian;

nu				nu [0 2 -1 0 0 0 0] 1.230979E-3;

//Cross Power law and Bird-Carreau non-linear viscosity models
// ----------------------------------------------------------------------------
CrossPowerLawCoeffs
{
	nu0             	nu0 [0 2 -1 0 0 0 0] 1e-06;
	nuInf           	nuInf [0 2 -1 0 0 0 0] 1e-06;
	m               	m [0 0 1 0 0 0 0] 1;
	n               	n [0 0 0 0 0 0 0] 1;
}

BirdCarreauCoeffs
{
	nu0             	nu0 [0 2 -1 0 0 0 0] 1e-06;
	nuInf           	nuInf [0 2 -1 0 0 0 0] 1e-06;
	k               	k [0 0 1 0 0 0 0] 0;
	n               	n [0 0 0 0 0 0 0] 1;
}

//------------------------------------------------------------------------------

The viscous behaviour is modelled as Newtonian and hence the keyword Newtonian is used for the transportModel and the molecular (laminar) kinematic viscosity (\(nu\)) is given having the units \(m^2/s\) ([0 2 -1 0 0 0 0]).

The final file in this class is the turbulenceProperties file, which sets the simulationType to RASModel. Here, SA, \(k-\omega~\rm{SST}\) and Realizable \(k-\epsilon\) are classified as Reynolds Average Stress (RAS) models.

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{

	version			2.0;
	format			ascii;
	class			dictionary;
	location		"constant";
	object			turbulenceProperties;
}

//-----------------------------------------------------------------------------

simulationType			RASModel;

//-----------------------------------------------------------------------------

Controls and Solver Attributes

This section details the files required to control the simulation, discretization methods and linear solvers. These files are to be placed in the system directory. First, navigate to the system directory The following is the controlDict file,

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version			2.0;
	format			ascii;
	class			dictionary;
	location		"system";
	object			controlDict;
}
			
//--------------------------------------------------------------------------------

application			simpleSolver;

startFrom			startTime;

startTime			0;

stopAt				endTime;

endTime				10000;

deltaT				1.0;

writeControl			runTime;

writeInterval			500;

purgeWrite			0;

writeFormat			ascii;

writePrecision			12;

writeCompression 		true;

timeFormat			general;

timePrecision			12;

runTimeModifiable		true;

//-------------------------------------------------------------------------------

// Function Objects to obtain forces

/*functions
{
	forces
	{
		type		forces;

        functionObjectLibs 	("libforces.so");
        patches     		( wall );
        CofR      		(0 0 0);
        rhoName         	rhoInf;
        rhoInf          	15.13009E-3;
        outputControl   	timeStep;
        outputInterval  	100;
     }
}

Here, simpleSolver is used and the simulation begins at t = 0 s. This now explains the logical need for having a 0 directory where the data files are read at the beginning of the run, which is t = 0 s in this case. Therefore, the keyword startFrom is set to startTime, where startTime is set to 0. The simulation would be carried out as steady-state and therefore we require to specify the total number of iterations as a keyword for endTime. Via the writeControl and writeInterval keywords, the solution intervals at which they are saved can be specified. Also note that a function object to obtain the force over the wall (step surface) for every 100 iterations is included. In order to obtain this, a freestream density (rhoInf) need to be specified.

The discretization schemes for the finite volume discretization that will be used should be set through the fvSchemes file show below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/

FoamFile
{
	version				2.0;
	format				ascii;
	class				dictionary;
	object				fvSchemes;
}

//------------------------------------------------------------------------------

ddtSchemes
{
	default				steadyState;
}

gradSchemes
{
	default				Gauss	linear;
	grad(p)				Gauss	linear;
	grad(U)				Gauss	linear;
}

divSchemes
{
	default				none;
	div(phi,U)			Gauss	linearUpwind 	grad(U);
	div(phi,nuTilda)		Gauss	upwind;		                    // Will be used for S-A model only
	div(phi,k)      		Gauss	upwind; 	                    // will be used for k-epsilon & k-omega only
	div(phi,omega)  		Gauss 	upwind;				// Will be used for k-omega model only
	div(phi,epsilon)	  	Gauss 	upwind;	
	div((nuEff*dev(T(grad(U)))))	Gauss   linear;
	div(phi,symm(grad(U)))		Gauss	linear;				// Will be used for S-A-Curvature-corr only
}

laplacianSchemes
{
	default				none;
	laplacian(nu,U)			Gauss 	linear	corrected;
	laplacian(nuEff,U)		Gauss 	linear	corrected;
	laplacian(DnuTildaEff,nuTilda)  Gauss 	linear 	corrected; // Will be used for S-A model only
	laplacian(DkEff,k) 		Gauss 	linear 	corrected; // Will be used for k-omega & k-omega only
	laplacian(DomegaEff,omega) 	Gauss 	linear 	corrected; // Will be used for k-omega model only
	laplacian(DepsilonEff,epsilon)	Gauss 	linear 	corrected;
	laplacian(rAUf,p)		Gauss 	linear 	corrected;
	laplacian(1,p)  		Gauss 	linear 	corrected;
}

interpolationSchemes
{
	default				linear;
	interpolate(HbyA)		linear;
}

snGradschemes
{
	default				corrected;
}


//--------------------------------------------------------------------------------

The linear solver controls and tolerances are set in fvSolution as given below

/*-------------------------------------------------------------------------------*
Caelus 9.04
Web:   www.caelus-cml.com
\*------------------------------------------------------------------------------*/
FoamFile
{
        version                         2.0;
        format                          ascii;
        class                           dictionary;
        location                        "system";
        object                          fvSolution;
}

//------------------------------------------------------------------------------

solvers
{
        p
        {
            solver                      PCG;
            preconditioner              SSGS;
            tolerance                   1e-8;
            relTol                      0.01;
        }
        U
        {
            solver                      PBiCGStab;
            preconditioner              USGS;
            tolerance                   1e-7;
            relTol                      0.01;
        }

        "(k|omega|nuTilda|epsilon)"
        {
            solver                      PBiCGStab;
            preconditioner              USGS;
            tolerance                   1e-08;
            relTol                      0;
        }
}

SIMPLE
{
        nNonOrthogonalCorrectors        1;
        pRefCell                        0;
        pRefValue                       0;
}

relaxationFactors
{
    	p                               0.3;
    	U                               0.3;
        nuTilda                         0.5;
        k                               0.5;
        omega                           0.5;
        epsilon                         0.5;
}

The user should now take a note that in the fvSolution file, different linear solvers are used to solve for velocity, pressure and turbulence quantities. We also set the nNonOrthogonalCorrectors to 1 for this case. To ensure the stability of the solution, the relaxation is set to primary and turbulent variables. The relTol is not set to 0 unlike a time-accurate set-up as we are solving for a steady-state solution and a very low (\(\approx 0\)) tolerance at every iteration is unnecessary. Since the entire system of equations converge to a global set tolerance the convergence would occur as the solution progresses to a steady state.

With this, the set-up of the directory structure with all the relevant files are complete. This can be verified again by issuing the following command and the directory tree should appear identical to the one shown below

cd my-turbulent-step/
tree
.
├── 0
│   ├── epsilon
│   ├── k
│   ├── nut
│   ├── nuTilda
│   ├── omega
│   ├── p
│   └── U
├── constant
│   ├── polyMesh
│   │   ├── boundary
│   │   ├── faces
│   │   ├── neighbour
│   │   ├── owner
│   │   └── points
│   ├── RASProperties
│   ├── transportProperties
│   └── turbulenceProperties
└── system
    ├── controlDict
    ├── fvSchemes
    └── fvSolution
Execution of the solver

Prior to the execution of the solver, it is important to renumber and to carry out a quality check on the grid/mesh. Renumbering reduces the bandwidth whereas the quality check shows the mesh statistics. These two can be performed by executing the following commands from the top working directory

caelus run -- renumberMesh -overwrite
caelus run -- checkMesh

When the renumberMesh is performed, the user should take note of the bandwidth before and after the mesh renumbering. In a similar manner, when the checkMesh is performed, the mesh statistics are shown as below

/*---------------------------------------------------------------------------*\
 Caelus 8.04                                   
 Web:      www.caelus-cml.com 
\*---------------------------------------------------------------------------*/

Checking geometry...
    Overall domain bounding box (-130 0 0) (50 1 9)
    Mesh (non-empty, non-wedge) directions (1 0 1)
    Mesh (non-empty) directions (1 0 1)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (7.60426729195e-19 -3.46752522136e-15 6.3479100872e-18) OK.
    Max cell openness = 2.1851506874e-16 OK.
    Max aspect ratio = 205.17630165 OK.
    Minimum face area = 0.00417125. Maximum face area = 10.4153124857.  Face area magnitudes OK.
    Min volume = 0.00417125. Max volume = 1.987102972.  Total volume = 1490.  Cell volumes OK.
    Mesh non-orthogonality Max: 12.1317921302 average: 0.100202600449
    Non-orthogonality check OK.
    Face pyramids OK.
    Mesh skewness Max: 0.00821683161155 average: 8.01613031841e-06 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End

At this stage, the solver can be executed from the top directory using the following command

caelus run -l my-turbulent-step.log -- simpleSolver

The log file can be further processed to look at the convergence history and this can be done as follows

caelus logs -w my-turbulent-step.log

The caelus-plotResiduals -l allows you to look at the convergence of various variables with respect to the number of iterations carried out and is shown in Figure 50.

_images/t-step-convergence-tutorials.png

Convergence of pressure with respect to iterations

Results

The flow within the separated region is visualised here through the velocity and pressure contours. In Figure 51 velocity magnitude and pressure contours are shown for SA model. Immediate downstream of the step a decrease in pressure is seen followed by an increases as the shear layer reattaches to the step. This is consistent with the formation of a low velocity recirculating region behind the step.

_images/t-step-velocitypressure-tutorials.png

Velocity magnitude and pressure contours over the backward facing step

Validation Manual

Validation: Introduction

This part contains details of validation case for Caelus.

Validation: Incompressible Laminar Flows

This section details the validation work carried out in Caelus 9.04 for several conditions ranging from attached to separated flows. Both transient and steady state conditions have been considered under laminar and turbulent flows for relevant cases.

Flat-plate

Laminar, incompressible flow over a two-dimensional Sharp-Leading Edge flat-plate

Nomenclature

Symbol

Definition

Units (SI)

\(c_f\)

Skin friction coefficient

Non-dimensional

\(e\) (subscript)

Boundary layer edge conditions

\(L\)

Length of the plate

\(m\)

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re\)

Reynolds number

Non-dimensional

\(T\)

Temperature

\(K\)

\(u\)

Local velocity in x-direction

\(m/s\)

\(U\)

Freestream velocity in x-direction

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(y\)

Distance in y-direction

\(m\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

\(\eta\)

Blasius parameter

Non-dimensional

Introduction

In this validation case, steady, incompressible, laminar flow over a two-dimensional sharp-leading edge flat-plate at zero angle of incidence is investigated. The flow generates a laminar boundary layer and the computational results are compared with the Blasius solution for the incompressible flow. Validation of the flow over a flat-plate forms the basis of these validation efforts as it is perhaps the most well understood configuration for CFD code-validation.

Blasius, in his work [6] obtained the solution to the Boundary Layer Equations using a transformation technique. Here, equations of continuity and momentum in two-dimensional form are converted into a single ordinary differential equation (ODE). The solution to this ODE can be numerically obtained and is regarded as the exact solution to the boundary layer equations. It is only valid for steady, incompressible, laminar flow over a flat-plate. One of the highlights of Blasius solution is the analytical expression for the skin friction coefficient (\(c_f\)) distribution along the flat-plate given by

\[c_f \approx \frac{0.644}{\sqrt{Re_{x}}}\]

where \(Re_{x}\) is the local Reynolds number defined as

\[Re_x = \frac{Ux}{\nu}\rm{,}\]

\(U\) is the freestream velocity, \(x\) is the distance starting from the leading edge and \(\nu\) is the kinematic viscosity.

Problem definition

This exercise is based on the validation work carried out by the NASA NPARC alliance for a flow over a flat-plate using the same conditions in the incompressible limit. A schematic of the geometric configuration is shown in Figure 52.

_images/flat-plate-schematic.svg

Schematic representation of the flat plate

The length of the plate is L = 0.3048 m wherein, x = 0 is the leading edge, the Reynolds number of the flow based on the length of the plate is 200,000 and U is the velocity in the x-direction. Assuming the inlet flow is at a temperature of 300 K, the kinematic viscosity can be determined from dynamic viscosity and density of the fluid. The value is given in the table below. The value of dynamic viscosity is obtained from the Sutherland viscosity formulation. Using the Reynolds number, plate length and kinematic viscosity, the freestream velocity evaluates to U = 10.4306 m/s. The following table summarises the freestream conditions used:

Fluid

\(Re\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~(K)\)

\(\nu~(m^2/s)\)

Air

200,000

10.43064

\((0)\) Gauge

300

\(1.58963\times10^{-5}\)

As we have assumed the flow incompressible, the density (\(\rho\)) remains constant. In addition, since the fluid temperature is not considered, the viscosity remains constant. For incompressible flows, the kinematic forms of pressure and viscosity are always used in Caelus.

Computational Domain and Boundary Conditions

The computational domain is a rectangular block encompassing the flat-plate. Figure 53 shows the details of the boundaries used in two-dimensions (\(x-y\) plane). As indicated in blue, the region of interest extends between \(0\leq x \leq 0.3048~m\) and has a no-slip boundary condition. Upstream of the leading edge, a slip boundary is used to simulate freestream uniform flow approaching the flat-plate. However, downstream of the plate, there is additional no-slip wall a further three plate lengths (highlighted in green). This ensures that the boundary layer in the vicinity of the trailing edge is not influenced by the outlet boundary. Since the flow is subsonic, disturbances cause the pressure to propagate both upstream and downstream. Therefore, placement of the inlet and outlet boundaries were chosen to have minimal effect on the solution. The inlet boundary as shown in the figure below is placed at start of the slip-wall (\(x = -0.06~m\)) and the outlet at the end of the second no-slip wall (\(x = 1.2192~m\)). Both inlet and outlet boundaries are between \(0\leq y \leq 0.15~m\). A slip-wall condition is used for the entire top boundary.

_images/flat-plate-domain.svg

Flat plate computational domain

Boundary Conditions and Initialisation

The following are the boundary condition details used for the computational domain:

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 10.4306~m/s\) in \(x\) direction

    • Pressure: Zero gradient

  • Slip wall
    • Velocity: Slip

    • Pressure: Slip

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 10.4306~m/s\) in \(x\) direction

    • Pressure: Zero Gauge pressure

Computational Grid

A 2D structured grid was generated using Pointwise in the \(x-y\) plane. Since Caelus is a 3D computational framework, it necessitates the grid to also be 3D. Therefore, a 3D grid was obtained using Pointwise by extruding the 2D grid in the positive \(z\) direction by one cell. The final 3D grid was then exported to the Caelus format (polyMesh). The two \(x-y\) planes obtained as a result of grid extrusion need boundary conditions to be specified. As the flow over a flat-plate is generally 2D, we do not need to solve the flow in the third dimension. This is achieved in Caelus by specifying empty boundary condition for each plane. Although, no flow is computed in the \(z\) direction, a velocity of \(w = 0\) has to be specified for the velocity boundary condition as indicated above.

_images/flat-plate-grid.png

Structured grid for a flat plate domain

Figure 54 shows the 2D grid in the \(x-y\) plane. As can be seen, the grid is refined perpendicular to the wall in order to capture resolve the viscous effects. To ensure that the gradients in boundary layer are well resolved, about 50 grid nodes are placed between the wall and the boundary layer edge. Grid refinement is also added at the leading edge so that the growth of the boundary layer is also well resolved. In this particular case, 400 cells were used in the stream-wise (\(x\)) direction (\(x \leq 0 \leq 0.3048~m\)) and 600 in the wall normal (\(y\)) direction. For no-slip wall beyond \(x > 0.3048\), a similar distribution is used.

Results and Discussion

A time-dependent solution to the two-dimensional flat-plate was obtained using Caelus 9.04. The SLIM transient solver was used here and the flow was simulated sufficiently long (several plate length flow times) such that steady flow was established. For the discretization of time-dependent terms, the first-order Euler scheme was used. A Gauss linear discretization was used for the pressure and velocity gradients. A linear upwind discretization was for the divergence of velocity and mass flux. A linear corrected scheme was used for Laplacian discretization while cell-to-face centre interpolation used linear interpolation.

In Figure 55, the skin-friction distribution along the flat-plate obtained from the CFD simulation is compared with that of the Blasius analytical solution. Here, the distance \(x\) is normalised with the length of the plate (\(L\)). Excellent agreement is observed along the entire length of the flat-plate.

_images/cf-flat-plate-laminar.png

Skin-friction comparison between SLIM and Blasius solutions

At the exit plane of the flat-plate at \(x = 0.3048~m\), velocity data was extracted across the boundary layer and compared with the Blasius analytical solution. This is shown in Figure 56 where the velocity profile is plotted using similarity variables from the Blasius solution. Here, \(\eta\) is the non-dimensional distance from the wall to the boundary layer edge and \(U_e\) is the velocity at the boundary layer edge. Similar to skin-friction, the velocity profile also exhibits excellent agreement with the Blasius solution.

_images/velocity-profile-laminar.png

Non-dimensional velocity profile comparison between SLIM and Blasius solutions

Conclusions

The steady, incompressible, laminar flow over a two-dimensional flat-plate was simulated using Caelus 9.04 utilising the SLIM solver. The results were validated against the Blasius analytical solutions resulting in excellent agreement.

Tee Junction

Laminar, incompressible flow in a 90 degree tee junction

Nomenclature

Symbol

Definition

Units (SI)

\(L\)

Length of the branch

\(m\)

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_w\)

Reynolds number based on width

Non-dimensional

\(V\)

Freestream velocity in y-direction

\(m/s\)

\(W\)

Width of the branch

\(m\)

\(x\)

Distance in x-direction

\(m\)

\(y\)

Distance in y-direction

\(m\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

Introduction

In this validation case, laminar, incompressible flow through a two-dimensional \(90^\circ\) tee junction was investigated. Due to the presence of the side branch, the flow separates and forms a recirculating region. The recirculating regions influences the mass flow through the main and side branches. The numerically computed mass-flow ratio was calculated and compared with experiment.

A comprehensive study of flow through planar branches has been carried out by Hayes et al. [12] due to its prevelance in the bio-mechanical industry. Of which, the \(90^\circ\) right-angled tee junction is considered here for the purpose of validation.

Problem definition

The following figure shows the schematic of the tee-junction. Here, L = 3.0 m, W = 1.0 m respectively, the Reynolds number based on the width is 300, and V is the velocity in the y-direction. For simplicity, we have assumed the velocity, V = 1 m/s. Using these values the resulting kinematic viscosity was 0.00333 \(m^2/s\).

_images/tee-junction-schematic.png

Tee-junction Schematic

The summary of the flow properties and geometric details are given in the following table.

\(Re_w\)

\(L\)

\(W\)

\(V~(m/s)\)

\(p~(m^2/s^2)\)

\(\nu~(m^2/s)\)

300

3.0

1.0

1.0

\((0)\) Gauge

0.00333

As we have assumed the flow incompressible, the density (\(\rho\)) remains constant. In addition, since the fluid temperature is not considered, the viscosity remains constant. For incompressible flows, the kinematic forms of pressure and viscosity are always used in Caelus.

Computational Domain and Boundary Conditions

Since this is an internal flow problem, the computational domain is contained within tee-junction geometry. The details are shown in Figure 58. As indicated, all tee-junction walls have a no-slip boundary condition which has been highlighted in blue. At the inlet, a fully developed laminar flow parabolic profile is applied, otherwise a much longer main branch would be required for the flow to develop. The domain has two outlets, one at the end of the main channel and the other at the end of side branch. Note the exit pressures at the two outlets are equal.

_images/tee-junction-domain.svg

Computational domain representing tee-junction

Boundary Conditions and Initialisation

The following are the boundary condition details used for the computational domain:

  • Inlet
    • Velocity: Parabolic velocity profile; centerline velocity of \(v = 1.0~m/s\) in \(y\) direction

    • Pressure: Zero gradient

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Outlet-1
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Outlet-2
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Initialisation
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero Gauge pressure

Computational Grid

The 2D structured grid is shown in Figure 59. Since Caelus is a 3D computational framework, it necessitates the grid to also be 3D. Therefore, a 3D grid was obtained by extruding the 2D grid in the positive \(z\) direction by one cell. The final 3D grid was then exported to the Caelus format (polyMesh). The two \(x-y\) planes obtained as a result of grid extrusion need boundary conditions to be specified. As the flow over a flat-plate is generally 2D, we do not need to solve the flow in the third dimension. This is achieved in Caelus by specifying empty boundary condition for each plane. Although, no flow is computed in the \(z\) direction, a velocity of \(w = 0\) has to be specified for the velocity boundary condition as indicated above.

_images/tee-junction-grid.png

Structured grid for tee-junction domain

A total of 2025 cells comprise the tee-junction of which, 90 cells are distributed along the height of the main channel, and 45 along the length of the side branch. The distribution is such that a dimensional length of \(L = 1~m\) has a total of 45 cells, giving a distribution of \((2/3)*45 = 30\) cells for the \((2/3) L\) segment of the main channel. The width, \(W\), consists of 15 cells.

Results and Discussion

A time-dependent solution to the two-dimensional flat-plate was obtained using Caelus 9.04. The SLIM transient solver was used here and the flow was simulated sufficiently long such that steady separated flow was established. To ensure this, shear-stress distribution was monitored on the lower wall of the side branch. The simulation was stopped once the separation and reattachment locations no longer varied with time.

Mass flow was calculated at the inlet and at the main outlet (outlet-1) and the mass-flow ratio was subsequently calculated. The below table compares the SLIM result with the experimental value. As can be noted, the agreement between the two is excellent.

Experimental

SLIM

Percentage Difference

Flow Split

\(0.887\)

\(0.886\)

\(0.112~\%\)

Conclusions

The steady, incompressible, two-dimensional laminar flow in a right-angled \(90^\circ\) tee-junction was simulated using Caelus 9.04 with the SLIM solver and validated against experimental data resulting in excellent agreement.

Circular Cylinder

Laminar, incompressible flow over a circular cylinder

Nomenclature

Symbol

Definition

Units (SI)

\(D\)

Diameter of the cylinder

\(m\)

\(f\)

Frequency

\(hz\)

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_D\)

Reynolds number based on diameter

Non-dimensional

\(St\)

Strouhal number

Non-dimensional

\(U\)

Freestream velocity in x-direction

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(y\)

Distance in y-direction

\(m\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

In this validation study, laminar incompressible flow over a 2D circular cylinder is investigated at a Reynolds number of 100. This classical configuration represents flow over a bluff body dominated by a wake region. For flows having a low Reynolds number (\(40 \leq Re_D \leq 150\)), periodic vortex shedding occurs in the wake. The phenomenon of vortex shedding behind bluff bodies is referred to as the Karman Vortex Street [2] and provides an transient case for CFD code validation.

In his work, Roshko [2] experimentally studied wake development behind two-dimensional circular cylinders from Reynolds number ranging from 40 to 10000. For Reynolds numbers of 40 to 150, the so called the stable range [Roshko1954], regular vortex streets are formed with no evidence of turbulence motion in the wake. Therefore, at a Reynolds number of 100, the vortex shedding exhibits smooth, coherent structures making it ideally suited for validating laminar CFD calculations. The frequency associated with the oscillations of the vortex streets can be characterized by the Strouhal Number (\(St\)). The Strouhal Number is a non-dimensional number defined as

\[St = \frac{fD}{U}\]

where, \(f\) is the frequency of oscillations of vortex shedding, \(D\) is the diameter of the cylinder and \(U\) is the freestream velocity of the flow. Experimentally [Roshko1954], it has been determined that for a Reynolds number based on the diameter of the cylinder of 100, the Strouhal number \(St \approx 0.16 - 0.17\). One of the main objectives in this study was to compare the \(St\) for the CFD calculation to the experimental data of Roshko [Roshko1954]. Provided the cylinder has a sufficient span length, the flow characteristics can be assumed to be two-dimensional as the experiments suggest.

Problem Definition

Figure 60 shows the schematic of the two-dimensional circular cylinder. Here, the diameter D = 2 m and is the characteristic length for the Reynolds number, which is 100. For simplicity, the freestream velocity was taken to be U = 1 m/s in the x direction. Using these values the kinematic viscosity was calculated to be 0.02 \(m^2/s\).

_images/cylinder-schematic.svg

Schematic representation of a circular cylinder

In the table below, a summary of the freestream conditions are provided

\(Re_D\)

\(D\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(\nu~(m^2/s)\)

100

2.0

1.0

\((0)\) Gauge

0.02

Here, the flow is assumed to be incompressible and therefore the density is constant. Further, no temperature is evaluated in this calculation and hence the viscosity also remains constant. For incompressible flows, the kinematic forms of pressure and viscosity are always used in Caelus.

Computational Domain and Boundary Conditions

A rectangular computational domain in the \(x-y\) plane was constructed surrounding the circular cylinder as shown in Figure 61. A full cylinder must be used due to the oscillatory nature of the shed vortices. Rhe domain extends by 5 diameters of cylinder and 20 diameters downstream. Since the flow here is viscous dominated, sufficient downstream length is required to capture the vortex separation from the surface of the cylinder and the subsequently shedding in the wake. In the \(y\) direction, the domain extends 5 diameters on either side. From the figure, multiple inlet boundaries to this domain can be seen, one at the upstream boundary and the other two for the top and bottom boundaries. This type of configuration is needed to appropriately model the inflow, similar to an undisturbed flow in an experimental set-up. It is noted that for top and bottom boundaries, the flow is in the \(x\) direction. The outlet is located at the downstream boundary. The cylindrical wall is a no-slip boundary condition.

_images/cylinder-domain.svg

Computational domain of a circular cylinder

Boundary Conditions and Initialisation

Following are the details of the boundary conditions used:

  • Inlet-1
    • Velocity: Fixed uniform velocity \(u = 1.0~m/s\) in \(x\) direction

    • Pressure: Zero gradient

  • Inlet-2
    • Velocity: Fixed uniform velocity \(u = 1.0~m/s\) in \(x\) direction

    • Pressure; Zero gradient

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 1.0~m/s\) in \(x\) direction

    • Pressure: Zero Gauge pressure

Computational Grid

The computational grid in 2D was generated using Pointwise in the \(x-y\) plane. Since Caelus is a 3D computational framework, it necessitates the grid to also be 3D. Therefore, a 3D grid was obtained using Pointwise by extruding the 2D grid in the positive \(z\) direction by one cell. The final 3D grid was then exported to the Caelus format (polyMesh). The two \(x-y\) planes obtained as a result of grid extrusion need boundary conditions to be specified. As the flow over a flat-plate is generally 2D, we do not need to solve the flow in the third dimension. This is achieved in Caelus by specifying empty boundary condition for each plane. Although, no flow is computed in the \(z\) direction, a velocity of \(w = 0\) has to be specified for the velocity boundary condition as indicated above.

_images/cylinder-grid.png

O-grid around the cylinder and structured gird representation

The 2D domain consisted of 9260 cells. An O-grid topology was constructed around the cylinder (see the right figure) with 10 cells in the radial direction and 84 cells in the circumferential direction. 31 cells were used upstream of the O-grid, in the \(x\) direction while 100 cells were used downstream. The region of interest is about 10 diameters downstream, where the grids are refined. In the \(y\) direction, 21 cells were used above and below the O-grid region.

Results and Discussion

A time-dependent simulation was carried out using the Caelus 9.04 with the SLIM solver. To capture the transient start-up process, the calculation was started from time t = 0 s and was simulated up to t = 360 s, while lift and drag forces over the cylindrical surface were monitored at a frequency of 2 Hz. It was found that the on-set of vortex shedding occurred after about t = 90 s which was then followed by a steady shedding process. A Fast Fourier transformation (FFT) was carried out on the lift force data and the peak frequency of vortex shedding occurred at \(f = 0.0888\) Hz. Based on this value, it takes about 7.8 cycles for the shedding to start.

Using the peak frequency value of \(f = 0.0888\) Hz, \(St\) was evaluated. The table below compares the computed value from SLIM with that of the experiment. The agreement is good given that experimental uncertainty can be relatively high at low Reynolds numbers.

Frequency (Hz)

Strouhal Number

Experimental

0.0835

\(0.167\)

SLIM

0.0888

\(0.177\)

Conclusions

The transiet, incompressible, two-dimensional flow over a circular cylinder was simulated using Caelus 9.04 to estimate the peak frequency of vortex shedding. The value was compared to well known experimental data resulting in good agreement.

Triangular Cavity

Laminar, incompressible flow inside a lid driven Triangular Cavity

Nomenclature

Symbol

Definition

Units (SI)

\(D\)

Depth of the cavity

\(m\)

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_D\)

Reynolds number based on depth

Non-dimensional

\(U\)

Freestream velocity in x-direction

\(m/s\)

\(W\)

Width

\(m\)

\(x\)

Distance in x-direction

\(m\)

\(y\)

Distance in y-direction

\(m\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

This validation study concerns the laminar, incompressible flow inside a lid driven triangular cavity. Here, the top wall of the cavity moves at a constant velocity initiating a recirculating motion within the cavity. Due to the viscous nature of the flow, a boundary layer develops in the direction of the moving lid, while flow reversal occurs due to the recirculating flow. The flow feature of interest is the velocity distribution along the centre-line of the cavity.

Benchmark experiments on this configuration has been reported in Jyotsna and Venka [11] for a Reynolds number of 800. The main objective of this validation case was to compare the \(x\) velocity distribution against experimental data.

Problem Definition

A schematic of the triangular cavity is presented in Figure 63 where depth of the cavity D = 4 m and the width W = 2 m. The Reynolds number based on the cavity depth is 800 and the wall velocity is U = 2 m/s. Using the Reynolds number, U, and D, kinematic viscosity was calculated to be 0.01 \(m^2/s\).

_images/t-cavity-schematic.svg

Schematic showing the Triangular Cavity

The table below summaries the flow properties

\(Re_D\)

\(D~(m)\)

\(W~(m)\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(\nu~(m^2/s)\)

800

4.0

2.0

2.0

\((0)\) Gauge

\(0.01\)

The flow in this case is assumed to be incompressible and hence the density remained constant throughout. Further, the temperature field is not accounted into the calculation, and therefore the viscosity of the flow can also remain constant. Since viscosity is constant, it becomes more convenient to specify it as kinematic viscosity. It should be noted that in Caelus for incompressible flows, both pressure and viscosity are always specified as kinematic.

Computational Domain and Boundary Conditions

The computational domain is the triangular cavity shown in Figure 64. Highlighted in blue, the side walls of the cavity have a no-slip boundary condition while the top wall, highlighted in green, has a uniform velocity in the \(x\) direction.

_images/t-cavity-domain.svg

Computational domain of a Triangular Cavity

Boundary Conditions and Initialisation

  • Moving wall
    • Velocity: Fixed uniform velocity \(u = 2.0~m/s\) in \(x\) direction

    • Pressure: Zero gradient

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

  • Initialisation
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero Gauge pressure

Computational Grid

The 2D grid in \(x-y\) plane is shown in Figure 65. A hybrid grid is employed for this case with a total of 5538 cells. Up to a depth of D = 1.35 m a structured grid is used while below that value an unstructured triangular grid is used. An unstructured grid is used in the bottom portion because it resulted in lower skewness in this vicinity. For the structured region, 40 cells are distributed across the width of the cavity and 40 along the depth. The cavity walls in the unstructured region have 100 cells along each. The interface of the two regions is node matched and has 40 cells across the width. The grid close to the cavity lid was refined to better capture the shear layer.

_images/t-cavity-grid.png

Hybrid grid for a Triangular Cavity

The flow characteristics in the cavity can be assumed to be two dimensional and here it has been solved with the same assumption. Since Caelus is a 3D computational framework, it necessitates the grid to also be 3D. Therefore, a 3D grid was obtained using Pointwise by extruding the 2D grid in the positive \(z\) direction by one cell. The final 3D grid was then exported to the Caelus format (polyMesh). The two \(x-y\) planes obtained as a result of grid extrusion need boundary conditions to be specified. As the flow over a flat-plate is generally 2D, we do not need to solve the flow in the third dimension. This is achieved in Caelus by specifying empty boundary condition for each plane. Although, no flow is computed in the \(z\) direction, a velocity of \(w = 0\) has to be specified for the velocity boundary condition as indicated above.

Results and Discussion

A steady solution to the cavity was obtained using Caelus 9.04 with the SLIM solver. While a time-dependent approach was used, the solution was simulated sufficiently long so that steady flow was achieved. To determine when this occured the velocity distribution along the cavity centre-line was monitored with respect to time. The simulations was stopped when no appreciable changes were observed.

In Figure 66, the \(x\) velocity distribution along the cavity centre-line is compared with that of the benchmark experimental data. The \(y\) distance is normalised with the cavity depth (\(D\)) which gives \(y/d = 0\) at the cavity lid and \(y/d = -1\) at the bottom vertex. Similarly, the \(u\) velocity is normalised with the velocity of the cavity lid (\(u_L\)).

_images/t-cavity-velocity.png

Comparison of experimental and computational \(x\) velocity distribution along the cavity’s centre-line

As seen in Figure 66 above, the comparison the experiment is excellent.

Conclusions

A steady, incompressible flow past a two-dimensional triangular cavity was simulated using Caelus 9.04 on a hybrid grid. The velocity distribution along the centre-line of the cavity was compared with the benchmark experimental data, it was found that the SLIM results compared very favorably.

Spherical Cavity

Natural Convection in a Spherical Cavity

Nomenclature

Symbol

Definition

Units (SI)

\(C_p\)

Specific heat at constant pressure

\(J/kg \cdot K\)

\(D\)

Diameter of the sphere

\(m\)

\(g\)

Gravitational constant

\(9.80~m/s^2\)

\(k\)

Thermal conductivity

\(W/m \cdot K\)

\(Nu\)

Nusselt number

Non-dimensional

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Pr\)

Prandtl number

Non-dimensional

\(r\)

Radius of the sphere

\(m\)

\(Ra\)

Rayleigh number

Non-dimensional

\(T\)

Temperature

\(K\)

\(u\)

velocity in x-direction

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(y\)

Distance in y-direction

\(m\)

\(z\)

Distance in z-direction

\(m\)

\(\beta\)

Coefficient of thermal expansion

\(1/K\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

\(\rho\)

Density

\(kg/m^3\)

In this study, laminar flow inside a heated spherical cavity is investigated. A temperature gradient was applied to the surface of the cavity inducing fluid motion due to buoyancy effects. Here, a Rayleigh number (\(Ra\)) of 2000 and a Prandtl number (\(Pr\)) of 0.7 is used to set appropriate thermal conditions to the problem.

Analytical solutions to the heated spherical cavity were investigated by McBain and Stephens [4] at various Rayleigh numbers up to \(Ra = 10000\). However, it was noted that asymptotic heat transfer rate predictions as a function of Nusselt number (\(Nu\)) deviated largely with increase in Rayleigh number. Therefore a value of \(Ra = 2000\) was chosen to avoid these deviations. At this value, the analytical heat transfer rate compares very well with the asymptotic solution. Isotherms from the analytical solution were used for comparision with numerical results.

Problem Definition

The schematic of the spherical cavity is depicted Figure 67 and as can be seen, only half of the sphere is considered here with an \(x-y\) symmetry plane. The sphere is located at \(x = 0, y = 0, z = 0\) with a radius \(r = 0.5~m\).

_images/sphere-schematic.png

Schematic representation of the sliced sphere

As indicated, a non-uniform temperature profile was used as a thermal boundary condition on the spherical wall. The temperature (\(T\)) was specified as a function of \(x\):

\[T = x\]

with,

\[T = -0.5~K \quad \text{at} \quad x = -0.5~m\]
\[T = 0.5~K \quad \text{at} \quad x = 0.5~m\]

The energy equation in a non-dimensional form [4] for a steady state can be expressed as:

\[Gr~Pr~u \cdot T = \nabla^2 T\]

where, \(Gr\) is the Grashof number. Since, \(Ra = Gr~Pr\) the above equation can be rewritten along with expanding the Laplacian term (\(\nabla^2\)) as

\[ \begin{align}\begin{aligned}Ra~u \cdot T = \nabla~[\alpha \nabla T]\\\text{or}\\u \cdot T = \frac{1}{Ra}~\alpha~\nabla~[ \nabla T]\end{aligned}\end{align} \]

where \(\alpha\) is the thermometric conductivity. It is reasonable to assume that (\(1/Ra\)) is approximately equal to the thermometric conductivity (\(\alpha\)), which is given as

\[\alpha = \frac{k}{\rho C_p} = \frac{\nu}{Pr}\]

where, \(k\), \(\rho\), \(C_p\) and \(\nu\) are the thermal conductivity, density, specific heat capacity and kinematic viscosity of the fluid respectively. Using the above relation with a value of \(Ra = 2000\) and \(Pr = 0.7\), the kinematic viscosity was calculated to be \(\nu = 3.4 \times 10^{-4}~m^2/s\). The coefficient of thermal expansion (\(\beta\)) needed to model the Boussinesq buoyancy term was evaluated from the following relation

\[Gr = \frac{g~\beta~\Delta T~D^3}{\nu^2}\]

where, \(g\) is the acceleration due to gravity and \(D\) is the diameter of the sphere. \(\beta\) was calculated to \(3.567\times10^{-5}~1/K\). In the following table, a summary of the properties are given. Note that gravity acts in \(-y\) direction.

\(Ra\)

\(Pr\)

\(T~(K)\)

\(p~(m^2/s^2)\)

\(\nu~(m^2/s)\)

\(\beta~(1/K)\)

\(2000\)

\(0.7\)

\(T = x\)

\((0)\) Gauge

\(3.4 \times 10^{-4}\)

\(3.567\times10^{-5}\)

Although the temperature is calculated in this simulation, a constant viscosity is used. Since the temperature gradient is very small (\(\mathcal{O}(1)\)), effect of temperature on the viscosity would be insignificant. The kinematic definition of pressure is used here.

Computational Domain and Boundary Conditions

The computational domain was a half sphere with an \(x-y\) plane of symmetry at \(z = 0~m\). The surface temperature was prescribed as discussed above. The initialisation of the fluid temperature within the sphere follows that of the surface temperature (\(T = x\)) and is depicted in Figure 68 at the symmetry plane. Note that this figure also aids in providing a clarity of understanding for the temperature variation over the spherical surface.

_images/sphere-domain.png

Computational domain and temperature boundary condition

Boundary Conditions and Initialisation

  • Wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Uniform zero Buoyant Pressure

    • Temperature: Linear unction of \(x\) (\(T = x\))

  • Symmetry Plane
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Temperature: Symmetry

  • Initialisation
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Uniform zero Buoyant Pressure

    • Temperature: Linear function of \(x\) (\(T = x\))

Computational Grid

The computational grid for the half sphere was generated using Pointwise. A fully structured grid was constructured with a total of 18564 cells. As seen in Figure 69, an O-H topology used where an H-block is centred within 5 O-blocks.

_images/sphere-grid.png

O-grid distribution on the wall and plane of symmetry

Results and Discussion

The steady solution to the natural convection in a buoyant sphere was obtained using Caelus 9.04 with the SLIM solver that includes the a buoyancy source term based on the Boussinesq assumption. Since SLIM is inherently time-accurate, the simulation was run sufficiently long such that a steady state was achieved. In Figure 70, compares the isotherms obtained with SLIM and the analytical isotherms obtained with a first order approximation. Close agreement was observed.

_images/sphere-isotherms.png

Comparison of temperature isotherms between computational and analytical data

Conclusions

A validation study of a buoyant flow inside a spherically heated cavity was conducted using Caelus 9.04. The isotherms obtained from the CFD results were compared with the first order analytical solution and excellent agreement was observed.

Validation: Incompressible Turbulent Flows

This section discusses the turbulence model verification and validation conducted for Caelus 9.04. The implemented Spalart–Allmaras, Spalart–Allmaras Curvature Correction, \(k-\omega~\rm{SST}\) turbulence models are verified with NASA’s CFL3D results. To validate these models, the Caelus results are compared with available experimental data. The cases considered for this exercise are obtained from the Turbulence Modeling Resource database.

Zero Pressure Gradient Flat Plate

Turbulent, incompressible flow over a two-dimensional Sharp-Leading Edge flat-plate

Nomenclature

Symbol

Definition

Units (SI)

\(a\)

Speed of sound

\(m/s\)

\(c_f\)

Skin friction coefficient

Non-dimensional

\(k\)

Turbulent kinetic energy

\(m^2/s^2\)

\(L\)

Length of the plate

\(m\)

\(M_\infty\)

Freestream Mach number

Non-dimensional

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_L\)

Reynolds number

\(1/m\)

\(T\)

Temperature

\(K\)

\(u\)

Local velocity in x-direction

\(m/s\)

\(U\)

Freestream velocity in x-direction

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(y\)

Distance in y-direction

\(m\)

\(y^+\)

Wall distance

Non-dimensional

\(\mu\)

Dynamic viscosity

\(kg/m~s\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

\(\tilde{\nu}\)

Turbulence field variable

\(m^2/s\)

\(\rho\)

Density

\(kg/m^3\)

\(\omega\)

Specific dissipation rate

\(1/s\)

\(\infty\)

Freestream conditions

\(t\) (subscript)

Turbulent property

Introduction

In this case, steady turbulent incompressible flow over a two-dimensional sharp-leading edge flat-plate is considered at zero angle of incidence, which generates a turbulent boundary layer with zero-pressure gradient over the flat plate. The simulations are carried over a series of four successively refined grids and the solutions are compared with the CFL3D data. This therefore serves as both grid independence study and verification of the turbulence models. The distribution of skin-friction coefficient (\(c_f\)) along the plate is used to verify the accuracy of the models.

Problem definition

This exercise is based on the Turbulence Modeling Resource case for a flat-plate and follows the same conditions used in the incompressible limit. However, note that CFL3D uses a freestream Mach number (\(M_\infty\)) of 0.2 as it is a compressible solver. The schematic of the geometric configuration is shown in Figure 71.

_images/turbulent-flat-plate-schematic.svg

Schematic representation of the flat plate

The length of the plate is L = 2.0 m, wherein, x = 0 is at the leading edge and the Reynolds number is \(5 \times 10^6\) and \(U_\infty\) is the freestream velocity in the x -direction. The inflow temperature in this case is assumed to be 300 K and for Air as a perfect gas, the speed of sound (\(a\)) can be evaluated to 347.180 m/s. Based on the freestream Mach number and speed of sound, velocity can be calculated, which is \(U_\infty\) = 69.436 m/s. Using velocity and Reynolds number, the kinematic viscosity can be evaluated. The following table summarises the freestream conditions used:

Freestream conditions

Fluid

\(Re_L~(1/m)\)

\(U_\infty~(m/s)\)

\(p_\infty~(m^2/s^2)\)

\(T_\infty~(K)\)

\(\nu_\infty~(m^2/s)\)

Air

\(5 \times 10^6\)

69.436113

\((0)\) Gauge

300

\(1.38872\times10^{-5}\)

Note that in an incompressible flow the density (\(\rho\)) does not change and is reasonable to assume a constant density throughout the calculation. In addition, temperature is not considered and therefore the viscosity can also be held constant. In Caelus, for incompressible flows, pressure and viscosity are always specified as kinematic.

Turbulent Properties for Spalart–Allmaras model

The turbulent inflow boundary conditions used for the Spalart–Allmaras model were calculated as \(\tilde{\nu}_{\infty} = 3 \cdot \nu_\infty\) and subsequently turbulent eddy viscosity was evaluated. The following table provides the values of these used in the current simulations:

Turbulence freestream conditions for SA model

\(\tilde{\nu}_\infty~(m^2/s)\)

\(\nu_{t~\infty}~(m^2/s)\)

\(4.166166 \times 10^{-5}\)

\(2.9224023 \times 10^{-6}\)

Turbulent Properties for k-omega SST model

The turbulent inflow boundary conditions used for \(k-\omega~\rm{SST}\) were calculated as follows and is as given in Turbulence Modeling Resource

\[k_{\infty} = 9 \times 10^{-9} \cdot a^2_\infty = \frac{1.125 U_\infty^2}{Re_L}\]
\[\omega_{\infty} = 1 \times 10^{-6} \cdot \frac{\rho_\infty a^2_\infty}{\mu_\infty} = \frac{125 U_\infty}{L}\]
\[\nu_{t~\infty} = 0.009 \times \nu_\infty\]

Note that the dynamic viscosity for the above equation is obtained from Sutherland formulation and density is calculated as \(\rho = \mu / \nu\). The below table provides the turbulent properties used in the current simulations

Turbulence freestream conditions for \(k-\omega~\rm{SST}\) model

\(k_{\infty}~(m^2/s^2)\)

\(\omega_{\infty}~(1/s)\)

\(\nu_{t~\infty}~(m^2/s)\)

\(1.0848 \times 10^{-3}\)

\(8679.5135\)

\(1.24985 \times 10^{-7}\)

Computational Domain and Boundary Conditions

The computational domain is a rectangular block encompassing the flat-plate. Figure 72 below shows the details of the boundaries used in two-dimensions (\(x-y\) plane). As can be seen, the region of interest (highlighted in blue) extends between \(0\leq x \leq 2.0~m\) and has a no-slip boundary condition. Upstream of the leading edge, a symmetry boundary is used to simulate a freestream flow approaching the flat-plate. The inlet boundary as shown in Figure 72 is placed at start of the symmetry at \(x = -0.3333~m\) and the outlet at the exit plane of the no-slip wall (blue region) at \(x = 2.0~m\). A symmetry plane condition is used for the entire top boundary.

_images/turbulent-flat-plate-domain.svg

Flat-plate computational domain

Boundary Conditions and Initialisation

Following are the boundary condition details used for the computational domain:

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 69.436113~m/s\) in \(x\) direction

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart-Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

      • \(k-\omega~\textrm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

  • Symmetry
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Turbulence: Symmetry

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart-Allmaras (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu}=0\))

      • \(k-\omega~\textrm{SST}\) (Fixed uniform values of \(k = 0\) and \(\nu_t=0\); \(\omega\) = omegaWallFunction)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart-Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\textrm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 69.436113~m/s\) in \(x\) direction

    • Pressure: Zero Gauge pressure

    • Turbulence:

      • Spalart-Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

      • \(k-\omega~\textrm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

Computational Grid

The 3D structured grid was obtained from Turbulence Modeling Resource as a Plot3D and was converted to Caelus format using Pointwise. It should be noted that the flow normal direction in the Plot3D grids is \(z\) and the two-dimensional plane of interest is in \(x-z\) directions. Since the flow-field of interest is two-dimensional, and simpleSolver being a 3D solver, the two \(x-z\) planes are specified with empty boundary conditions. As mentioned earlier, a series of four grids were considered from the original set of five, excluding the coarsest. Details of the different grids used are given below.

Grid

Cells in \(x\)-direction

Cells in \(z\)-direction

Total

\(y^+\)

Grid-2

68

48

3264

0.405

Grid-3

136

96

13,056

0.203

Grid-4

272

192

52,224

0.101

Grid-5

544

384

208,896

0.05

In Figure 73, the 2D grid in the \(x-z\) plane is shown for Grid-4. As can be seen, the grid is refined close to the wall in order to capture the turbulent boundary layer accurately. All grids have \(y^+ < 1\) and no wall function is used for the wall boundary in the current verification cases.

_images/turbulent-flat-plate-grid.png

Flat-plate grid (Grid-4) in 2D

Results and Discussion

The steady-state solution of the turbulent flow over a flat plate was obtained using Caelus 9.04. The simpleSolver was used here and the solution was simulated for a sufficient length until the residuals for pressure, velocity and turbulent quantities were less than \(1 \times 10^{-6}\). The finite volume discretization of the gradient of pressure and velocity was carried out using the linear approach. Where as the divergence of velocity and mass flux was carried out through the linear upwind method. However, for the divergence of the turbulent quantities, upwind approach was utilised and linear approach for the divergence of the Reynolds stress terms. For the discretization of the Laplacian terms, again linear corrected method was used. For some grids having greater than 50 degree non-orthogonal angle, linear limited with a value of 0.5 was used for the Laplacian of the turbulent stress terms.

Spalart–Allmaras

In Figure 74, the skin-friction distribution along the flat-plate obtained from Caelus for different grids is shown. As can be seen, all grids produce the same skin-friction values suggesting a grid-independent solution is achieved.

_images/cf-turbulent-flat-plate-Caelus-SACC.png

Skin-friction distribution for various grids obtained from Caelus simulation using Spalart–Allmaras turbulence model

In Figure 75, the skin-friction distribution obtained from Caelus on Grid-5 is compared with CFL3D of the same grid. An excellent agreement is obtained all along the plate.

_images/cf-turbulent-flat-plate-Caelus-CFL3D-SACC.png

Skin-friction comparison between Caelus and CFL3D using Spalart–Allmaras turbulence model

k-Omega SST

The skin-friction distribution for various grids obtained from \(k-\omega~\rm{SST}\) model is shown in Figure 76.

_images/cf-turbulent-flat-plate-Caelus-SST.png

Skin-friction distribution for various grids obtained from Caelus simulation using \(k-\omega~\rm{SST}\) turbulence model

The skin-friction comparison between Caelus and CFL3D for Grid-5 is shown in Figure 77.

_images/cf-turbulent-flat-plate-Caelus-CFL3D-SST.png

Skin-friction comparison between Caelus and CFL3D using \(k-\omega~\rm{SST}\) turbulence model

Conclusions

The steady turbulent flow over a two-dimensional flat-plate was simulated using Caelus 9.04 utilising the simpleSolver. The simulations were carried out with two turbulence models and the obtained solutions were verified against CFL3D data. The results were found to be in good agreement with CFL3D and suggesting the turbulence implementation in Caelus is accurate.

Two-dimensional Bump in a Channel

Turbulent, incompressible flow over a two-dimensional bump in a channel

Symbol

Definition

Units (SI)

\(a\)

Speed of sound

\(m/s\)

\(c_f\)

Skin friction coefficient

Non-dimensional

\(k\)

Turbulent kinetic energy

\(m^2/s^2\)

\(L\)

Length of the bump

\(m\)

\(M_\infty\)

Freestream Mach number

Non-dimensional

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_L\)

Reynolds number

\(1/m\)

\(T\)

Temperature

\(K\)

\(u\)

Local velocity in x-direction

\(m/s\)

\(U\)

Freestream velocity in x-direction

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(z\)

Distance in z-direction

\(m\)

\(y^+\)

Wall distance

Non-dimensional

\(\mu\)

Dynamic viscosity

\(kg/m~s\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

\(\tilde{\nu}\)

Turbulence field variable

\(m^2/s\)

\(\rho\)

Density

\(kg/m^3\)

\(\omega\)

Specific dissipation rate

\(1/s\)

\(\infty\)

Freestream conditions

\(t\) (subscript)

Turbulent property

Introduction

This case covers the verification of turbulent incompressible flow over a two-dimensional bump in a channel. The bump acts as a perturbation causing local changes to the velocity and pressure over the bump surface. Since the perturbation is quite small, the flow remains attached to the bump surface. The simulations are carried out over a series of four grids which are successively refined and are studied over two turbulence models, serving as a grid independence study. The distribution of skin-friction (\(c_f\)) is then compared with that of the CFL3D data.

Problem definition

This verification exercise is based on the Turbulence Modeling Resource case for a 2D bump in a channel and follows the same conditions used in the limit of incompressibility. In this case, CFL3D uses a freestream Mach number (\(M_\infty\)) of 0.2. The schematic of the geometric configuration is shown in Figure 78.

_images/turbulent-bump-schematic.svg

Schematic representation of the close-up of the bump (Not to scale)

The location of the plate upstream of the bump begins at x=0 m and ends at x = 1.5 m, giving a total plate length of L = 1.5 m. The flow has a Reynolds number of \(3 \times 10^6\) with a freestream velocity \(U_\infty\) in the x-direction. The temperature of the inflow is assumed to be 300 K and for Air as a perfect gas, the speed of sound (\(a\)) can be evaluated to 347.180 m/s. With the freestream Mach number and speed of sound, the freestream velocity was calculated to \(U_\infty\) = 69.436 m/s. Kinematic viscosity was then obtained from velocity and Reynolds number. The following table summarises the freestream conditions used for this case.

Fluid

\(Re_L~(1/m)\)

\(U_\infty~(m/s)\)

\(p_\infty~(m^2/s^2)\)

\(T_\infty~(K)\)

\(\nu_\infty~(m^2/s)\)

Air

\(3 \times 10^6\)

69.436113

\((0)\) Gauge

300

\(2.314537\times10^{-5}\)

Since the flow is incompressible, the density (\(\rho\)) does not change and therefore, a constant density is assumed throughout the calculation. Further, the temperature is not considered and hence it does not have any influence on viscosity, which is therefore kept constant. Note that in Caelus, pressure and viscosity are always specified as kinematic for a incompressible flow simulation.

Turbulent Properties for Spalart–Allmaras model

The turbulent inflow boundary conditions used for the Spalart–Allmaras model were calculated as \(\tilde{\nu}_{\infty} = 3 \cdot \nu_\infty\) and subsequently turbulent eddy viscosity was evaluated. The following table provides the values of these used in the current simulations:

Turbulence freestream conditions for SA model

\(\tilde{\nu}_\infty~(m^2/s)\)

\(\nu_{t~\infty}~(m^2/s)\)

\(6.943611 \times 10^{-5}\)

\(4.8706713 \times 10^{-6}\)

Turbulent Properties for k-omega SST model

The turbulent inflow boundary conditions used for \(k-\omega~\rm{SST}\) were calculated as follows and is as given in Turbulence Modeling Resource

\[k_{\infty} = 9 \times 10^{-9} \cdot a^2_\infty = \frac{0.675 U_\infty}{Re_L}\]
\[\omega_{\infty} = 1 \times 10^{-6} \cdot \frac{\rho_\infty a^2_\infty}{\mu_\infty} = \frac{50 U_\infty}{L}\]
\[\nu_{t~\infty} = 0.009 \times \nu_\infty\]

Note that the dynamic viscosity for the above equation is obtained from Sutherland formulation and density is calculated as \(\rho = \mu / \nu\). The below table provides the turbulent properties used in the current simulations:

Turbulence freestream conditions for \(k-\omega~\rm{SST}\) model

\(k_{\infty}~(m^2/s^2)\)

\(\omega_{\infty}~(1/s)\)

\(\nu_{t~\infty}~(m^2/s)\)

\(1.0848 \times 10^{-3}\)

\(5207.6475\)

\(2.08310 \times 10^{-7}\)

Computational Domain and Boundary Conditions

The computational domain consists of a rectangular channel encompassing the bump. In Figure 79 , the details of the boundaries used in two-dimensions (\(x-y\) plane) are shown. The region of interest, which is the bump extends between \(0\leq x \leq 1.5~m\) and has a no-slip boundary condition. Upstream and downstream of the bump, the symmetry boundary extends about 17 bump lengths. The inlet boundary is placed at the start of the symmetry at \(x = -25.0~m\) and the outlet is placed at \(x = 26.5~m\). For the entire top boundary, symmetry plane condition is used.

_images/turbulent-bump-domain.svg

Computational domain for a 2D bump (Not to scale)

Boundary Conditions and Initialisation

Following are the boundary condition details used for the computational domain:

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 69.436113~m/s\) in \(x\) direction

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

  • Symmetry
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Turbulence: Symmetry

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu}=0\))

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k = 0\) and \(\nu_t=0\); \(\omega\) = omegaWallFunction)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart–Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 69.436113~m/s\) in \(x\) direction

    • Pressure: Zero Gauge pressure

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

Computational Grid

The 3D computational grid was obtained from Turbulence Modeling Resource as a Plot3D and was converted to Caelus format using Pointwise. In the Plot3D computational grid, the flow normal direction is \(z\) and thus the two-dimensional plane of interest is in \(x-z\) directions. Further, since the flow-field is of two-dimensional, and the simpleSolver being a 3D solver, the two \(x-z\) planes are specified with empty boundary conditions. A series of four grids were considered from the original set of five, excluding the coarsest grid and the following table give its details.

Grid

Cells in \(x\)-direction

Cells in \(z\)-direction

Total

\(y^+\)

Grid-2

176

80

14,080

0.236

Grid-3

352

160

56,320

0.118

Grid-4

704

320

225,280

0.059

Grid-5

1408

640

901,120

0.03

The 2D grid in \(x-z\) plane is shown in Figure 80 for Grid-3. As can be noted, the grid is sufficiently refined close to the wall in the normal direction. In addition, the grids are refined in the vicinity of the bump, including both upstream and downstream which can be seen in the inset. All grids have a \(y^+ < 1\) and no wall function is used for the wall boundary in the current verification cases.

_images/turbulent-bump-grid.png

Bump grid (Grid-3) in 2D

Results and Discussion

The steady-state solution of the turbulent flow over a two-dimensional bump was obtained using Caelus 9.04. The simpleSolver was used for the calculations and was run for a sufficient length until the residuals for pressure, velocity and turbulent quantities were less than \(1 \times 10^{-6}\). The finite volume discretization of the gradient of pressure and velocity was carried out using the linear approach. Where as the divergence of velocity and mass flux was carried out through the linear upwind method. However, for the divergence of the turbulent quantities, upwind approach was utilised and linear approach for the divergence of the Reynolds stress terms. For the discretization of the Laplacian terms, again linear corrected method was used. For some grids having greater than 50 degree non-orthogonal angle, linear limited with a value of 0.5 was used for the Laplacian of the turbulent stress terms.

Spalart–Allmaras

The skin-friction distributions over the 2D bump obtained from Caelus for different grids are shown in Figure 81. There is very little difference in the skin-friction beyond Grid-2 suggesting that a grid-independence solution is achieved.

_images/cf-turbulent-bump-Caelus-SACC.png

Skin-friction distribution for various grids obtained from Caelus simulation using Spalart–Allmaras turbulence model

In Figure 82 , the comparison between Caelus and CFL3D is made for Grid-5 and as can be seen, a very good agreement is obtained over the entire region of the bump.

_images/cf-turbulent-bump-Caelus-CFL3D-SACC.png

Skin-friction comparison between Caelus and CFL3D using Spalart–Allmaras turbulence model

k-Omega SST

The skin-friction distribution variation for different grids obtained from \(k-\omega~\rm{SST}\) model is shown in Figure 83.

_images/cf-turbulent-bump-Caelus-SST.png

Skin-friction distribution for various grids obtained from Caelus simulation using \(k-\omega~\rm{SST}\) turbulence model

In Figure 84 , the skin-friction comparison between Caelus and CFL3D is made for Grid-5 and is shown.

_images/cf-turbulent-bump-Caelus-CFL3D-SST.png

Skin-friction comparison between Caelus and CFL3D using \(k-\omega~\rm{SST}\) turbulence model

Conclusions

The steady turbulent flow simulation over a two-dimensional bump was carried out using Caelus 9.04 employing simpleSolver. The solutions were obtained with two turbulence models, implemented in-house and the results were verified against CFL3D data. The comparison was found to be in good agreement with CFL3D suggesting that the turbulence model implementation is accurate in Caelus.

Two-dimensional NACA 0012 Airfoil

Nomenclature

Turbulent, incompressible flow over a two-dimensional NACA airfoil

Symbol

Definition

Units (SI)

\(a\)

Speed of sound

\(m/s\)

\(c_f\)

Skin friction coefficient

Non-dimensional

\(c_p\)

Pressure coefficient

Non-dimensional

\(C\)

Chord length

\(m\)

\(I\)

Turbulent intensity

Percentage

\(k\)

Turbulent kinetic energy

\(m^2/s^2\)

\(M_\infty\)

Freestream Mach number

Non-dimensional

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_L\)

Reynolds number

\(1/m\)

\(T\)

Temperature

\(K\)

\(u\)

Local velocity in x-direction

\(m/s\)

\(w\)

Local velocity in z-direction

\(m/s\)

\(U\)

Freestream velocity

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(z\)

Distance in y-direction

\(m\)

\(y^+\)

Wall distance

Non-dimensional

\(\alpha\)

Angle of attack

Degrees

\(\mu\)

Dynamic viscosity

\(kg/m~s\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

\(\tilde{\nu}\)

Turbulence field variable

\(m^2/s\)

\(\rho\)

Density

\(kg/m^3\)

\(\omega\)

Specific dissipation rate

\(1/s\)

\(\infty\)

Freestream conditions

\(t\) (subscript)

Turbulent property

Introduction

This case deals with the steady turbulent incompressible flow over a two-dimensional NACA 0012 airfoil. The study is conducted at two angles of attack, \(\alpha = 0^\circ\) and \(\alpha = 10^\circ\) respectively. The simulations are carried out over a series of four grids and compared with CFL3D data and the results are also compared with the experimental data. This exercise therefore verifies and validates the turbulence models used through the distribution of skin-friction coefficient (\(c_f\)) and pressure coefficient (\(c_p\)) over the airfoil surface.

Problem definition

This verification and validation exercise is based on the Turbulence Modeling Resource case for a NACA 0012 airfoil and follows the same flow conditions used in the incompressible limit. However, the numerical code CFL3D uses a freestream Mach number (\(M_\infty\)) of 0.15. In Figure 85 the schematic of the airfoil is shown. Note that the 2D plane in Figure 85 is depicted in \(x-z\) directions as the computational grid also follows the same 2D plane.

_images/turbulent-airfoil-schematic.svg

Schematic representation of the 2D airfoil (Not to scale)

The length of the airfoil chord is C = 1.0 m, wherein, x = 0 is at the leading edge and the Reynolds number is \(6 \times 10^6\) and \(U_\infty\) is the freestream velocity. For \(\alpha = 10^\circ\), the velocity components are evaluated in order to have a same resultant freestream velocity. The freestream flow temperature in this case is assumed to be 300 K and for Air as a perfect gas, the speed of sound (\(a\)) can be evaluated to 347.180 m/s. Based on the freestream Mach number and speed of sound, freestream velocity can be evaluated to \(U_\infty\) = 52.077 m/s. Using the value of velocity and Reynolds number, kinematic viscosity can be calculated. The following table summarises the freestream conditions used:

Fluid

\(Re_L~(1/m)\)

\(U_\infty~(m/s)\)

\(p_\infty~(m^2/s^2)\)

\(T_\infty~(K)\)

\(\nu_\infty~(m^2/s)\)

Air

\(6 \times 10^6\)

52.0770

\((0)\) Gauge

300

\(8.679514\times10^{-6}\)

To get a freestream velocity of \(U_\infty\) = 52.077 m/s at \(\alpha = 10^\circ\), the velocity components in \(x\) and \(z\) are resolved. These are provided in the table below

\(\alpha~\rm{(Degrees)}\)

\(u~(m/s)\)

\(w~(m/s)\)

\(0^\circ\)

52.0770

0.0

\(10^\circ\)

51.2858

9.04307

Note that in an incompressible flow, the density (\(\rho\)) does not vary and a constant density can be assumed throughout the calculation. Further, since temperature is not considered here, the viscosity is also held constant. In Caelus for incompressible flow simulations, pressure and viscosity are always specified as kinematic.

Turbulent Properties for Spalart–Allmaras model

The turbulent inflow boundary conditions used for the Spalart–Allmaras model were calculated as \(\tilde{\nu}_{\infty} = 3 \cdot \nu_\infty\) and subsequently turbulent eddy viscosity was evaluated. The following table provides the values of these used in the current simulations:

Turbulent freestream conditions for SA Model

\(\tilde{\nu}_\infty~(m^2/s)\)

\(\nu_{t~\infty}~(m^2/s)\)

\(2.603854 \times 10^{-5}\)

\(1.8265016 \times 10^{-6}\)

Turbulent Properties for k-omega SST model

The turbulent inflow boundary conditions used for \(k-\omega~\rm{SST}\) were calculated as follows and is as given in Turbulence Modeling Resource

\[k_{\infty} = \frac{3}{2} (U_\infty I)^2\]
\[\omega_{\infty} = 1 \times 10^{-6} \cdot \frac{\rho_\infty a^2_\infty}{\mu_\infty} = \frac{266.7 U_\infty}{L}\]
\[\nu_{t~\infty} = 0.009 \times \nu_\infty\]

Note that the dynamic viscosity in the above equation is obtained from Sutherland formulation and density is evaluated as \(\rho = \mu / \nu\). In the below table, the turbulent properties used in the current simulations are provided.

Turbulent freestream conditions for SST Model

\(I\)

\(k_{\infty}~(m^2/s^2)\)

\(\omega_{\infty}~(1/s)\)

\(\nu_{t~\infty}~(m^2/s)\)

\(0.052\%\)

\(1.0999 \times 10^{-3}\)

\(13887.219\)

\(7.811564 \times 10^{-8}\)

Computational Domain and Boundary Conditions

The computational domain used for the airfoil simulations and the details of the boundaries are shown in Figure 86 for a \(x-z\) plane. The leading edge and the trailing edge extends between \(0 \leq x \leq 1.0~m\) and the entire airfoil has a no-slip boundary condition. The far-field domain extends by about 500 chord lengths in the radial direction and the inlet is placed for the entire boundary highlighted in green. The outlet boundary is placed at the exit plane, which is at \(x \approx 500~m\).

_images/turbulent-airfoil-domain.svg

Computational domain for a 2D airfoil (Not to scale)

Boundary Conditions and Initialisation

  • Inlet
    • Velocity:

      • \(\alpha=0^\circ\): Fixed uniform velocity \(u = 52.0770~m/s\); \(v = w = 0.0~m/s\) in \(x, y\) and \(z\) directions respectively

      • \(\alpha=10^\circ\): Fixed uniform velocity \(u = 51.2858~m/s\); \(v = 0.0~m/s\) and \(w = 9.04307~m/s\) in \(x, y\) and \(z\) directions respectively

      • Pressure: Zero gradient

      • Turbulence:

        • Spalart–Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

        • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu}=0\))

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k = <<0\) and \(\nu_t=0\); \(\omega\) = omegaWallFunction)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart–Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation
    • Velocity:

      • \(\alpha=0^\circ\): Fixed uniform velocity \(u = 52.0770~m/s\); \(v = w = 0.0~m/s\) in \(x, y\) and \(z\) directions respectively

      • \(\alpha=10^\circ\): Fixed uniform velocity \(u = 51.2858~m/s\); \(v = 0.0~m/s\) and \(w = 9.04307~m/s\) in \(x, y\) and \(z\) directions respectively

      • Pressure: Zero Gauge pressure

      • Turbulence:

        • Spalart–Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

        • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

Computational Grid

The 3D computational grid for the NACA 0012 airfoil was obtained from Turbulence Modeling Resource as a Plot3D format. Using Pointwise it was then converted to Caelus format. As indicated earlier, the two-dimensional plane of interest in the Plot3D grid is in \(x-z\) directions. As the flow is considered here to be two-dimensional, and simpleSolver being a 3D solver, the two \(x-z\) planes are specified with empty boundary conditions consequently treating as symmetry flow in \(y\) direction. To study the sensitivity of the grid, four grids were considered from the original set of five, in which the coarsest grid was excluded from this study. Details of the different grids used are given in the below table. Not that for both angles of attack, same grid is used.

Grid

Cells over airfoil

Cells in normal direction

Total

\(y^+\)

Grid-2

128

64

14,336

0.465

Grid-3

256

128

57,344

0.209

Grid-4

512

256

229,376

0.098

Grid-5

1024

512

917,504

0.047

The below Figure 87 shows the 2D grid in \(x-z\) plane for Grid-3 and the refinement around the airfoil is shown in the inset. Sufficient refinement can be seen in the wall normal direction and all the grid have a \(y^+ < 1\) and no wall function is used for the airfoil surface throughout the current verification and validation cases.

_images/turbulent-airfoil-grid.png

Airfoil grid (Grid-3) shown in 2D

Results and Discussion

The solution to the turbulent flow over the NACA 0012 airfoil was obtained using Caelus 9.04. SimpleSolver was used and the solutions were run sufficiently long until the residuals for pressure, velocity and turbulence quantities were less than \(1 \times 10^{-6}\). The finite volume discretization of the gradient of pressure and velocity was carried out using the linear approach. Where as the divergence of velocity and mass flux was carried out through the linear upwind method. However, for the divergence of the turbulent quantities, upwind approach was utilised and linear approach for the divergence of the Reynolds stress terms. For the discretization of the Laplacian terms, again linear corrected method was used. For some grids having greater than 50 degree non-orthogonal angle, linear limited with a value of 0.5 was used for the Laplacian of the turbulent stress terms.

The verification results are shown firstly for both angles of attack and is followed by the experimental validation data.

Verification results: Spalart–Allmaras

The following Figure 88 and Figure 89 shows the skin-friction distribution over the upper surface for \(\alpha=0^\circ\) and \(\alpha=10^\circ\) from Caelus for different grids. In both cases, Grid-4 and Grid-5 essentially produces the same solution suggesting a grid-independence solution is obtained.

_images/cf-turbulent-airfoil-Caelus-SACC-0.png

Skin-friction distribution obtained from Caelus simulations using SA turbulence model for \(\alpha=0^\circ\)

_images/cf-turbulent-airfoil-Caelus-SACC-10.png

Skin-friction distribution obtained from Caelus simulations using SA turbulence model for \(\alpha=10^\circ\)

In Figure 90 and Fig. #turbulent-airfoil-caelus-cfl3d-sacc-10 , the skin-friction is compared with CFL3D on Grid-4. As can be seen, a very good agreement between the two codes can be seen.

_images/cf-turbulent-airfoil-Caelus-CFL3D-SACC-0.png

Skin-friction comparison between Caelus and CFL3D using SA turbulence model for \(\alpha=0^\circ\)

_images/cf-turbulent-airfoil-Caelus-CFL3D-SACC-10.png

Skin-friction comparison between Caelus and CFL3D using SA turbulence model for \(\alpha=10^\circ\)

Verification results: k-omega SST

The skin-friction distribution obtained from using \(k-\omega~\rm{SST}\) turbulence model for \(\alpha=0^\circ\) and \(\alpha=10^\circ\) is shown below for different grids. The grid-sensitivity behaviour is very similar to the Spalart–Allmaras turbulence case and no change is seen between Grid-4 and Grid-5.

_images/cf-turbulent-airfoil-Caelus-SST-0.png

Skin-friction distribution obtained from Caelus simulations using \(k-\omega~\rm{SST}\) turbulence model for \(\alpha=0^\circ\)

_images/cf-turbulent-airfoil-Caelus-SST-10.png

Skin-friction distribution obtained from Caelus simulations using \(k-\omega~\rm{SST}\) turbulence model for \(\alpha=10^\circ\)

The comparison of the skin-friction with CFL3D using \(k-\omega~\rm{SST}\) is shown in Figure 94 and Figure 95 for both angle of attacks and similar to the previous case, a very good agreement between the two can be seen.

_images/cf-turbulent-airfoil-Caelus-CFL3D-SST-0.png

Skin-friction comparison between Caelus and CFL3D using \(k-\omega~\rm{SST}\) turbulence model for \(\alpha=0^\circ\)

_images/cf-turbulent-airfoil-Caelus-CFL3D-SST-10.png

Skin-friction comparison between Caelus and CFL3D using \(k-\omega~\rm{SST}\) turbulence model for \(\alpha=10^\circ\)

Experimental validation

Here, the Caelus data is compared with the pressure-coefficient (\(c_p\)) obtained experimentally by Gregory, N. and O’Reilly, C. L [5] for both angles of attack over the upper surface. In addition, the data obtained from CFL3D is also included for verification. There is a very good agreement with the current Caelus and experiments which indicates that the correct turbulence equations are being solved in both Spalart–Allmaras and \(k-\omega~\rm{SST}\) models.

_images/p-turbulent-airfoil-Caelus-CFL3D-SA-SST-0.png

Pressure comparison between Caelus, experiments and CFL3D for \(\alpha=0^\circ\)

_images/p-turbulent-airfoil-Caelus-CFL3D-SA-SST-10.png

Pressure comparison between Caelus, experiments and CFL3D for \(\alpha=10^\circ\)

Conclusions

Verification and validation over a two-dimensional NACA 0012 airfoil for turbulent inflow conditions were carried out using Caelus 9.04 employing simpleSolver. Two turbulence models that are implemented in-house were used and the solutions were verified with CFL3D data and subsequently validated with the experimental pressure coefficient values. The results were found to be in very good agreement suggesting that the turbulence modelling implementation is appropriate and solves accurately.

Two-dimensional Convex Curvature

Turbulent, incompressible flow in a two-dimensional convex curvature channel

Nomenclature

Symbol

Definition

Units (SI)

\(a\)

Speed of sound

\(m/s\)

\(c_f\)

Skin friction coefficient

Non-dimensional

\(c_p\)

Pressure coefficient

Non-dimensional

\(I\)

Turbulent intensity

Percentage

\(k\)

Turbulent kinetic energy

\(m^2/s^2\)

\(M_i\)

Inlet Mach number

Non-dimensional

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_L\)

Reynolds number

\(1/m\)

\(T\)

Temperature

\(K\)

\(u\)

Local velocity in x-direction

\(m/s\)

\(w\)

Local velocity in z-direction

\(m/s\)

\(U\)

Inlet velocity

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(y\)

Distance in y-direction

\(m\)

\(y^+\)

Wall distance

Non-dimensional

\(\alpha\)

Angle of attack

Degrees

\(\mu\)

Dynamic viscosity

\(kg/m~s\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

\(\tilde{\nu}\)

Turbulence field variable

\(m^2/s\)

\(\rho\)

Density

\(kg/m^3\)

\(\omega\)

Specific dissipation rate

\(1/s\)

\(i\)

Inlet conditions

\(t\) (subscript)

Turbulent property

\(ref\)

Reference pressure

\(Pa\)

Introduction

In this case, the turbulent incompressible flow in a constant-area duct having a convex curvature is investigated as a part of verification and validation. The effect of curvature on the capability of turbulence model to predict the boundary layer accurately is of primary concern in this study. Similar to previous cases, the simulations are carried out over a series of four grids that tests the sensitivity of solution as the grid is refined. As with the earlier cases, Spalart-Allmaras (SA) and \(k-\omega~\rm{SST}\) turbulence models are tested. However due to the presence of strong curvature, a variant of Spalart–Allmaras turbulence model which accounts for rotational and curvature effects is additionally considered. This model is referred to as “Spalart–Allmaras Rotational/Curvature” (SA-RC) [9] . The results are then verified against CFL3D data and validated with experimental pressure distributions.

Problem definition

This verification and validation exercise is based on the Turbulence Modeling Resource case and follows the same conditions used in the incompressible limit. As CFL3D is a compressible CFD code, the original simulation used a inlet Mach number (\(M_i\)) of 0.093. A schematic of the geometric configuration is shown below and is depicted in \(x-z\) plane as the computational grid also follows the same 2D plane of flow.

_images/turbulent-curvature-schematic.svg

Schematic representation of the 2D curvature geometry (Not to scale)

As can be seen above, the 2D duct has a rapid bend of \(\alpha = 30^\circ\) after about a distance of 1.4 m and the downstream extends up to 1.6 m in length. The cross-section of the duct is 0.127 m and the inner radius and outer radius of curvature are 0.127 m and 0.254 m respectively. The flow has a Reynolds number of \(2.1 \times 10^6\) and U is the inlet velocity. To achieve a desired inlet velocity at an angle of 30 degrees, the velocity components are evaluated. The inlet temperature for this case is T = 293 K and for Air as a perfect gas, the speed of sound (\(a\)) can be evaluated to 343.106 m/s. Based on the inlet Mach number and speed of sound, the inlet velocity can be calculated to U = 31.908 m/s. Using velocity and Reynolds number kinematic viscosity can be calculated. The table below summarises the inlet conditions used:

Fluid

\(Re_L~(1/m)\)

\(U~(m/s)\)

\(p~(m^2/s^2)\)

\(T~~(K)\)

\(\nu_i~(m^2/s)\)

Air

\(2.1 \times 10^6\)

31.9088

\((0)\) Gauge

293

\(1.519470\times10^{-5}\)

In order to achieve a inlet velocity of U = 31.9088 m/s at \(\alpha=30^\circ\), the velocity components in \(x\) and \(z\) are resolved. These are given below

\(\alpha~\rm{(Degrees)}\)

\(u~(m/s)\)

\(w~(m/s)\)

\(30^\circ\)

27.63389

15.95443

It should be noted that in an incompressible flow, the density (\(\rho\)) does not vary and a constant density assumption is valid throughout the calculation. Further, the temperature field is not solved and therefore its influence on viscosity can be neglected and a constant viscosity can be used. In Caelus for incompressible flow simulations, pressure and viscosity are always specified as kinematic.

Turbulent Properties for Spalart–Allmaras and Spalart–Allmaras Curvature Correction model

The inflow conditions used for turbulent properties in Spalart-Allamaras model was calculated as \(\tilde{\nu}_{i} = 3 \cdot \nu_i\) and subsequently turbulent eddy viscosity was evaluated. The following table provides the values of these used in the current simulations:

Turbulent freestream conditions for SA Model

\(\tilde{\nu}_i~(m^2/s)\)

\(\nu_{t~i}~(m^2/s)\)

\(4.558411 \times 10^{-5}\)

\(3.197543 \times 10^{-6}\)

Turbulent Properties for k-omega SST model

The turbulent inflow boundary conditions used for \(k-\omega~\rm{SST}\) were calculated as follows and is as given in Turbulence Modeling Resource

\[k_{i} = \frac{3}{2} (U_i I)^2\]
\[\omega_{i} = 1 \times 10^{-6} \cdot \frac{\rho_i a^2_i}{\mu_i}\]
\[\nu_{t~i} = 0.009 \times \nu_i\]

Note that the dynamic viscosity in the above equation is obtained from Sutherland formulation and density is evaluated as \(\rho = \mu / \nu\). In the below table, the turbulent properties used in the current simulations are provided

Turbulent freestream conditions for SST Model

\(I\)

\(k_{i}~(m^2/s^2)\)

\(\omega_{i}~(1/s)\)

\(\nu_{t~i}~(m^2/s)\)

\(0.083\%\)

\(1.0521 \times 10^{-3}\)

\(7747.333\)

\(1.36756 \times 10^{-7}\)

Computational Domain and Boundary Conditions

The computational domain for the duct is quite simple and follows the geometry as is shown in Figure 99. The walls are modelled as no-slip boundary and is highlighted in blue and the outlet is placed at the end of the duct.

_images/turbulent-curvature-domain.svg

Computational domain for a 2D convex curvature (Not to scale)

Boundary Conditions and Initialisation

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 27.63389~m/s\); \(v = 0.0~m/s\) and \(w = 15.95443~m/s\) in \(x, y\) and \(z\) directions respectively

    • Pressure: Zero gradient

    • Turbulence:

      • SA & SA-RC (Fixed uniform values of \(\nu_{t~i}\) and \(\tilde{\nu}_{i}\) as given in the above table)

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{i}\), \(\omega_{i}\) and \(\nu_{t~i}\) as given in the above table)

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • SA & SA-RC (Fixed uniform values of \(\nu_{t}=0\) and \(\tilde{\nu} =0\))

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k = 0\) and \(\nu_t=0\); \(\omega\) = omegaWallFunction)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • SA & SA-RC (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 27.63389~m/s\); \(v = 0.0~m/s\) and \(w = 15.95443~m/s\) in \(x, y\) and \(z\) directions respectively

    • Pressure: Zero Gauge pressure

    • Turbulence:

      • SA & SA-RC (Fixed uniform values of \(\nu_{t~i}\) and \(\tilde{\nu}_{i}\) as given in the above table)

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{i}\), \(\omega_{i}\) and \(\nu_{t~i}\) as given in the above table)

Computational Grid

The computational grid in 3D for the convex curvature duct was obtained from Turbulence Modeling Resource as a Plot3D format. The same was used in Caelus by converting it in the required format with the use of Pointwise. Since the flow field is assumed to the two-dimensional, the 2D computational plane of interest is in \(x-z\) directions. SimpleSolver is a 3D solver, therefore the two additional \(x-z\) planes are specified with empty boundary conditions. To look at the effect of grid sensitivity, four grids were considered from the original set of five, while the coarsest grid was not included in this study. The table below gives the details of different grids used.

Grid

Cells in streamwise direction

Cells in normal direction

Total

Grid-2

128

48

6144

Grid-3

256

96

98304

Grid-4

512

192

98,304

Grid-5

1024

384

393,216

The 2D convex curvature grid is shown in Figure 100 below, for Grid-3 in \(x-z\) plane and the inset shows the grids in the vicinity of the strong curvature. Grids are refined close to the wall in order to capture the turbulent boundary layer and all grids have a \(y^+ < 1\) and no wall function is used through the validation and verification of this configuration.

_images/turbulent-curvature-grid.png

Convex curvature grid (Grid-3) shown in 2D (Inset shows the close-up of the curvature region)

Results and Discussion

The turbulent flow inside the convex curvature duct was simulated using Caelus 9.04 through the use of simpleSolver. The solutions were run until the residuals for pressure, velocity and turbulent quantities were less than \(1 \times 10^{-6}\). The finite volume discretization of the gradient of pressure and velocity was carried out using the linear approach. Where as the divergence of velocity and mass flux was carried out through the linear upwind method. However, for the divergence of the turbulent quantities, upwind approach was utilised and linear approach for the divergence of the Reynolds stress terms. For the discretization of the Laplacian terms, again linear corrected method was used. For some grids having greater than 50 degree non-orthogonal angle, linear limited with a value of 0.5 was used for the Laplacian of the turbulent stress terms.

The verification results of the turbulence model are discussed first, which is then followed by the experimental validation.

Verification results Spalart–Allmaras (SA)

In Figure 101, the skin-friction distribution obtained over the lower wall of the duct is shown from Caelus for different grids. As can be seen, there is very little difference in skin-friction variation among the different grids. The oscillatory behaviour noted at Grid-5 very close to the corner is also apparent in CFL3D data as will be see in Figure 101.

_images/cf-turbulent-curvature-Caelus-SA.png

Skin-friction distribution obtained from Caelus simulations using SA turbulence model on the lower surface of the duct

The skin-friction coefficient comparison with CFL3D is shown in Figure 102. It should be noted that the available solution from CFL3D was for Grid-4 and hence to be consistent, Grid-4 solution from Caelus is used for comparison. In the vicinity of strong curvature region, Caelus compares very well with CFL3D, however both upstream and downstream, there seems to be some difference in the solution.

_images/cf-turbulent-curvature-Caelus-CFL3D-SA.png

Skin-friction comparison between Caelus and CFL3D using SA turbulence model on the lower surface of the duct

Verification results Spalart–Allmaras Rotational/Curvature (SA-RC)

The following Figure 103 shows the grid sensitivity and verification with CFL3D data respectively. The solution that have been used for verification is obtained from Grid-4 and the trends are similar to what is noted for the SA model.

_images/cf-turbulent-curvature-Caelus-SARC.png

Skin-friction distribution obtained from Caelus simulations using SA-RC turbulence model on the lower surface of the duct

_images/cf-turbulent-curvature-Caelus-CFL3D-SARC.png

Skin-friction comparison between Caelus and CFL3D using SA-RC turbulence model on the lower surface of the duct

Verification results k-Omega SST

In Figure 105, the skin-friction sensitivity is shown over the lower wall obtained using Caelus with the \(k-\omega~\rm{SST}\) model. After Grid-3, not much difference in values can be noted. With Grid-5, however some oscillations can be see upstream and in the vicinity of the curvature.

_images/cf-turbulent-curvature-Caelus-SST.png

Skin-friction distribution obtained from Caelus simulations using \(k-\omega~\rm{SST}\) turbulence model on the lower surface of the duct

The skin-friction comparison between Caelus and CFL3D is shown in Figure 106. A very good agreement between the two is obtained.

_images/cf-turbulent-curvature-Caelus-CFL3D-SST.png

Skin-friction comparison between Caelus and CFL3D using \(k-\omega~\rm{SST}\) turbulence model on the lower surface of the duct

Experimental validation

This section details the experimental validation carried out for Caelus and both skin-friction and pressure coefficients obtained experimentally by Smits, A. J et al. [8] are compared. Further, CFL3D is also included. In Figure 107, skin-friction distribution obtained from Caelus using different turbulence models is compared with the experiments. Both SA-RC and \(k-\omega~\rm{SST}\) has a fair agreement with experiments down stream of the curvature, more so with the SA-RC model. However upstream they all seem to predict nearly the same values.

_images/cf-turbulent-curvature-Caelus-CFL3D-Expt.png

Skin-friction comparison between Caelus, experiments and CFL3D on the lower surface of the duct.

Figure 108 shows the comparison of pressure-coefficient (\(c_p\)) distribution with experiments and CFL3D data on the lower surface. Firstly, the solutions obtained from Caelus with the three turbulence models essentially produces the same values and matches exactly with the CFL3D data. In comparison with experiments, the agreement is very good in the upstream, vicinity of the curvature and downstream and, identical to CFL3D’s behaviour. Note that for obtaining the pressure-coefficient (\(c_p\)) values, a reference pressure (\(p_{ref}\)) is needed. However, this is not specified in Turbulence Modeling Resource for this case and hence a value of 145 Pa has been used.

_images/p-turbulent-curvature-Caelus-CFL3D-Expt.png

Pressure coefficient comparison between Caelus, experiments and CFL3D on the lower surface of the duct.

Experimental skin-friction data [8] is also available over the upper surface of the duct and is used to compare the Caelus results. Figure 109 shows the comparison. Similar to the behaviour noted for the lower surface, the SA-RC model tends to be closer to the experimental data. In general, all the three turbulence model have similar trends and agrees very closely with the CFL3D data.

_images/cf-turbulent-curvature-Caelus-CFL3D-Expt-upper.png

Skin-friction coefficient comparison between Caelus, experiments and CFL3D on the upper surface of the duct.

Conclusions

A detailed verification and validation of a turbulent flow in a convex curvature duct were carried out using Caelus 9.04 and simpleSolver. Here, three turbulence models used and the solutions were verified against CFL3D data. As a part of validation, Caelus results were compared with the experimental data obtained on both lower and upper surfaces. The comparison was good with both CFL3D as well as with experiments. This suggests that the implementation of the turbulence models is correct and is being solved accurately.

Two-dimensional Backward Facing Step

Turbulent, incompressible flow over a two-dimensional backward facing step

Nomenclature

Symbol

Definition

Units (SI)

\(a\)

Speed of sound

\(m/s\)

\(c_f\)

Skin friction coefficient

Non-dimensional

\(c_p\)

Pressure coefficient

Non-dimensional

\(H\)

Step height

\(m\)

\(I\)

Turbulent intensity

Percentage

\(k\)

Turbulent kinetic energy

\(m^2/s^2\)

\(M_\infty\)

Freestream Mach number

Non-dimensional

\(p\)

Kinematic pressure

\(Pa/\rho~(m^2/s^2)\)

\(Re_H\)

Reynolds number based on step height

Non-dimensional

\(T\)

Temperature

\(K\)

\(u\)

Local velocity in x-direction

\(m/s\)

\(u_*\)

Frictional velocity

\(m^2/s\)

\(U\)

Freestream velocity in x-direction

\(m/s\)

\(U_{ref}\)

Reference velocity

\(m/s\)

\(x\)

Distance in x-direction

\(m\)

\(z\)

Distance in z-direction

\(m\)

\(y^+\)

Wall distance

Non-dimensional

\(\epsilon\)

Turbulent dissipation

\(m^2/s^3\)

\(\mu\)

Dynamic viscosity

\(kg/m~s\)

\(\nu\)

Kinematic viscosity

\(m^2/s\)

\(\tilde{\nu}\)

Turbulence field variable

\(m^2/s\)

\(\rho\)

Density

\(kg/m^3\)

\(\tau_w\)

Wall shear stress

\(kg/m~s^2\)

\(\omega\)

Specific dissipation rate

\(1/s\)

\(\infty\)

Freestream conditions

\(t\) (subscript)

Turbulent property

Introduction

This study investigates steady turbulent, incompressible flow over a two-dimensional backward facing step at zero angle of incidence. Unlike the previous cases, the efficacy of wall functions in separated flow is evaluated for different turbulent models. The validation of these wall functions are carried out through the comparison of skin-friction coefficient (\(c_f\)) and pressure coefficient (\(c_p\)) downstream of the step with those of the experimental data. In addition to Spalart–Allmaras and \(k - \omega~\rm{SST}\), Realizable \(k-\epsilon\) turbulence model was also considered in this exercise.

Problem definition

The backward facing step configuration is obtained from the Turbulence Modeling Resource and is a widely considered case for the purpose of verification and validation. This particular study is based on the experiments carried out by Driver and Seegmiller [15]. The schematic of the step configuration in Figure 110 below as considered in the Turbulence Modeling Resource.

_images/turbulent-step-schematic.svg

Schematic representation of the backward facing step in 2D

The height of the step (H) is chosen to be 1.0 m and is located at x = 0 m. Upstream of the step, the plate extends to 110 step heights such that a fully developed turbulent boundary layer with proper thickness exists at separation (x = 0 m). This is followed by a downstream plate which extends up to 50 step heights. The flow has a Reynolds number of 36000 based on the step height with a freestream velocity (\(U_\infty\)) in the x-direction. The inflow is assumed to be Air as a perfect gas with a temperature of 298 K, giving the value of speed of sound (\(a\)) at 346.212 m/s. A reference Mach number (\(M_\infty\)) of 0.128 is used to obtain the freestream velocity, which was \(U_\infty\) = 44.315 m/s. The kinematic viscosity was then evaluated based on the velocity and the Reynolds number. The following table summarises the freestream conditions used for the backward facing step.

Freestream conditions

Fluid

\(Re_H\)

\(U_\infty~(m/s)\)

\(p_\infty~(m^2/s^2)\)

\(T_\infty~(K)\)

\(\nu_\infty~(m^2/s)\)

Air

\(36000\)

44.31525

\((0)\) Gauge

298.330

\(1.230979\times10^{-3}\)

As with all the previous cases, the flow is incompressible and therefore the density (\(\rho\)) does not change throughout the simulation. Further, the temperature is not accounted and has no influence on viscosity and is also held constant. However note that in Caelus, pressure and viscosity for incompressible flow are always specified as kinematic.

Turbulent Properties for Spalart–Allmaras model

The turbulent boundary conditions at the freestream used for Spalart-Allmaras model were calculated according to \(\tilde{\nu}_{\infty} = 3 \cdot \nu_\infty\) and turbulent eddy viscosity was subsequently evaluated. In the following table, the values used in the current simulation are provided:

Turbulence freestream conditions for SA model

\(\tilde{\nu}_\infty~(m^2/s)\)

\(\nu_{t~\infty}~(m^2/s)\)

\(3.692937 \times 10^{-3}\)

\(2.590450 \times 10^{-4}\)

Turbulent Properties for k-omega SST model

The turbulent inflow boundary conditions used for \(k-\omega~\rm{SST}\) were calculated as follows and is as given in Turbulence Modeling Resource

\[k_{\infty} = \frac{3}{2} (U_\infty I)^2\]
\[\omega_{\infty} = 1 \times 10^{-6} \cdot \frac{\rho_\infty a^2_\infty}{\mu_\infty}\]
\[\nu_{t~\infty} = 0.009 \times \nu_\infty\]

The dynamic viscosity in the above equation is obtained from Sutherland formulation and the density is calculated through \(\mu/\nu\). In the table below, the turbulent properties used for the current \(k-\omega~\rm{SST}\) simulation are provided

Turbulent freestream conditions for \(k-\omega~\rm{SST}\) Model

\(I\)

\(k_{\infty}~(m^2/s^2)\)

\(\omega_{\infty}~(1/s)\)

\(\nu_{t~~\infty}~(m^2/s)\)

\(0.061\%\)

\(1.0961 \times 10^{-3}\)

\(97.37245\)

\(1.10787 \times 10^{-5}\)

Turbulent Properties for Realizable k-epsilon model

The turbulent inflow properties used for Realizable \(k-\epsilon\) model were evaluated as follows

\[k_{\infty} = \frac{3}{2} (U_\infty I)^2\]
\[\epsilon_{\infty} = \frac{0.1643~k_{\infty}^{3/2}}{\lambda}\]
\[\nu_{t\infty} = \frac{C_\mu~k^2}{\epsilon_{\infty}}\]

where, \(\lambda\) is the turbulent length scale and is evaluated at 0.22 of the boundary layer thickness at separation (1.5H) and \(C_\mu\) is a model constant with a value 0.09. The following table provides the evaluated turbulent properties. Note that the turbulent intensity was assumed to be 1 % for this particular model.

Turbulent freestream conditions for Realizable \(k-\epsilon\) Model

\(I\)

\(k_{\infty}~(m^2/s^2)\)

\(\epsilon_{\infty}~(m^2/s^3)\)

\(\nu_{t\infty}~(m^2/s)\)

\(1\%\)

\(294.57 \times 10^{-3}\)

\(0.079598\)

\(98.11 \times 10^{-3}\)

Computational Domain and Boundary Conditions

The computational domain simply follows the step geometry for the entire bottom region. In Figure 111 below, the boundary details in two-dimensions (\(x-z\) plane) are shown. The walls of the upstream plate, step and the downstream plate that extend between \(-110 \leq x \leq 50~m\) are modelled as no-slip wall boundary condition. Similarly, the top plate is also modelled as a no-slip wall. Upstream of the leading edge, that is, \(x \leq 110\) symmetry boundary extends for a length of 20 step heights and the inlet boundary is placed at the start of the symmetry. The outlet is placed at the end of the downstream plate, which is at \(x = 50~m\).

_images/turbulent-step-domain.svg

Computational domain for a 2D step (Not to scale)

Boundary Conditions and Initialisation

  • Inlet
    • Velocity: Fixed uniform velocity \(u = 44.31525~m/s\) in \(x\) direction

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

      • Realizable \(k-\epsilon\) (Fixed uniform value of \(k_{\infty}\), \(\epsilon_{\infty}\) and \(\nu_{t_\infty}\) as given in the above table)

  • Symmetry
    • Velocity: Symmetry

    • Pressure: Symmetry

    • Turbulence: Symmetry

  • No-slip wall
    • Velocity: Fixed uniform velocity \(u, v, w = 0\)

    • Pressure: Zero gradient

    • Turbulence:

      • Spalart–Allmaras:

        • \(\nu_t\): type nutUWallFunction with an initial value of \(\nu_t=0\)

        • \(\tilde{\nu}\): type fixedValue with a value of \(\tilde{\nu}=0\)

      • \(k-\omega~\rm{SST}\):

        • \(k\): type kqRWallFunction with an initial value of \(k_{\infty}\)

        • \(\omega\): type omegaWallFunction with an initial value of \(\omega_{\infty}\)

        • \(\nu_t\): type nutUWallFunction with an initial value of \(\nu_t=0\)

      • Realizable \(k-\epsilon\):

        • \(k\): type kqRWallFunction with an initial value of \(k_{\infty}\)

        • \(\epsilon\): type epsilonWallFunction with an initial value of \(\epsilon=0\)

        • \(\nu_t\): type nutUWallFunction with an initial value of \(\nu_t=0\)

  • Outlet
    • Velocity: Zero gradient velocity

    • Pressure: Fixed uniform gauge pressure \(p = 0\)

    • Turbulence:

      • Spalart–Allmaras (Calculated \(\nu_{t}=0\) and Zero gradient \(\tilde{\nu}\))

      • \(k-\omega~\rm{SST}\) (Zero gradient \(k\) and \(\omega\); Calculated \(\nu_t=0\); )

      • Realizable \(k-\epsilon\) (Zero gradient \(k\) and \(\epsilon\); Calculated \(\nu_t=0\); )

  • Initialisation
    • Velocity: Fixed uniform velocity \(u = 44.31525~m/s\) in \(x\) direction

    • Pressure: Zero Gauge pressure

    • Turbulence:

      • Spalart–Allmaras (Fixed uniform values of \(\nu_{t~\infty}\) and \(\tilde{\nu}_{\infty}\) as given in the above table)

      • \(k-\omega~\rm{SST}\) (Fixed uniform values of \(k_{\infty}\), \(\omega_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

      • Realizable \(k-\epsilon\) (Fixed uniform values of \(k_{\infty}\), \(\epsilon_{\infty}\) and \(\nu_{t~\infty}\) as given in the above table)

Computational Grid

The 3D computational grid was generated using Pointwise. and was converted to Caelus format. Note that the plane of interest is in \(x-z\) directions. Further, since the flow field is assumed to be two-dimensional, the two \(x-z\) obtained as a result of a 3D grid are specified with empty boundary condition. This forces the 3D solver, simpleSolver to treat the flow in \(y\) direction as symmetry. The following figure shows the 2D grid. As noted earlier, the purpose of this exercise is to validate the wall functions and hence the grid is designed for a \(y^+ = 30\). In order to design such a gird, the first cell height (\(\Delta z\)) from wall in the wall normal (\(z\)) direction was obtained from the following set of equations

\[\Delta z = \frac{y^+~\nu}{u_*}\]

where, \(u_*\) is the frictional velocity given by

\[u_* = \sqrt{\frac{\tau_w}{\rho}}\]

In the above equation, \(\tau_w\) is the shear-stress at the wall and was be estimated using the skin-friction (\(c_f\)) relation, given as

\[\tau_w = c_f\frac{1}{2} \rho u_\infty^2\]

where, \(c_f\) was obtained for the flat-plate as given in Schlichting [7] and is shown below

\[c_f = [2~\textrm{log}(Re_x) - 0.65]^{-2.3}\]

where, \(Re_x\) is the Reynolds number based on the length of the boundary layer. In this case, it is the length developed over the upstream plate.

The 2D grid of a backward facing step in \(x-z\) is shown in Figure 112 for a \(y^+ \approx 30\). In the upstream region of the step, there are 60 cells in the streamwise and 64 in the wall normal directions respectively. Downstream of the step, there are 129 cells in the streamwise and a total of 84 cells in the normal direction. Out of 84 cells, 20 cells represent the height of the step.

_images/turbulent-step-grid.png

Backward facing step grid shown in 2D for \(y^+ \approx 30\) (Inset shows the vicinity of the step region)

Results and Discussion

The steady-state solution of turbulent flow over a two-dimensional backward facing step was obtained using Caelus 9.04. The simpleSolver was used and the simulation was run sufficiently long until the residuals for pressure, velocity and turbulent quantities were less than \(1 \times 10^{-6}\). The finite volume discretization of the gradient of pressure and velocity was carried out using linear approach. Where as the divergence of velocity and mass flux was carried out through the linear upwind method. However, for the divergence of the turbulent quantities, upwind approach was utilised. For the discretization of the Laplacian terms, again linear method was used.

Experimental validation of skin-friction coefficient

In this section, the validation carried out for Caelus based on skin-friction and pressure obtained experimentally by Driver and Seegmiller [15] is presented. The results obtained from CFL3D [1] are additionally shown and should be considered only as a reference and not as a benchmark for verification. This is because all the CFL3D results have been obtained without the use of wall functions and on a grid having \(y^+ \approx 1\). In Figure 113, skin-friction distribution obtained from Caelus using SA turbulence model is compared with the experiments. Upstream of the step, the agreement is good, however, downstream post-reattachment the skin-friction under predicts the experimental data. In both these regions of the flow, Caelus results are nearly identical to that of CFL3D suggesting that the wall-function is capturing the flow characteristics accurately. Within the separated region, there is a large discrepancy and this is due to the inherent low \(y^+\) mesh in that region, where typically a wall function becomes invalid.

_images/cf-turbulent-step-Caelus-SA.png

Skin-friction distribution obtained from Caelus simulation using SA turbulence model

Figure Figure 114 gives the comparison of skin-friction obtained from \(k-\omega~\rm{SST}\) turbulence model. The result is very similar to the one obtained from SA model. In this case, the skin-friction upstream of the step is slightly under predicted, whereas, post reattachment, it seems to be closer to experiments. In contrast with the SA result, the skin-friction is now closer to the experimental data within the separated region, particularly in the region closer to the reattachment location.

_images/cf-turbulent-step-Caelus-SST.png

Skin-friction distribution obtained from Caelus simulation using \(k-\omega~\rm{SST}\) turbulence model

In Figure 115, the comparison is shown for Realizable \(k-\epsilon\) turbulence model. Note that CFL3D data was not available for this turbulence model to use as a reference. Again, similar skin-friction behaviour can be noted both upstream and downstream of the step with reasonable agreement with the experimental data. Within the separated region, there is a large difference and this could be due to the presence of low \(y^+\) mesh as discussed earlier.

_images/cf-turbulent-step-Caelus-RKE.png

Skin-friction distribution obtained from Caelus simulation using Realizable \(k-\epsilon\) turbulence model

One of the key feature of modelling the backward facing step is the accurate prediction of reattachment location downstream of the step. This was determined through the location at which the reversal of skin-friction occurs over the downstream surface for each of the turbulence model considered here. In the below table, the normalised reattachment distances obtained from Caelus simulation are compared with the experimental data. Out of the three models considered here, Realizable \(k-\epsilon\) prediction is in very good agreement with the experimentally obtained value.

Comparison of reattachment distance with the experiment data

Type

Reattachment location (\(x/H\))

Experimental

\(6.26 \pm 0.10\)

SA

\(5.55\)

\(k-\omega~\rm{SST}\)

\(6.08\)

Realizable \(k-\epsilon\)

\(6.27\)

Experimental validation of pressure coefficient

Figure 116 gives the pressure-coefficient (\(c_p\)) comparison among three Caelus simulations and the experimental data. The inclusion of CFL3D data is again only for reference and not as a benchmark comparison. All the simulations essentially produce the same trend and is consistent with the skin-friction coefficient distribution. The pressure prediction in both \(k-\omega~\rm{SST}\) and Realizable \(k-\epsilon\) are very close to each other over the entire region shown in the figure and is also in fair agreement with the experimental data. However, SA seems to show some significant deviation particularly in the region of pressure minima.

_images/p-turbulent-step-Caelus-CFL3D-Expt.png

Pressure-coefficient comparison between Caelus and experiments over the backward facing step

Conclusions

A detailed validation of the turbulent flow over a backward facing step was carried out using Caelus 9.04 for a simpleSolver. In particular the focus was to validate wall functions for grids having \(y^+ \approx 30\). The solutions from three turbulence models were compared with both skin-friction and pressure coefficients obtained experimentally over the surface of the model. Overall, a good agreement was noted. With respect to the reattachment location, the simulated result with Realizable \(k-\epsilon\) turbulence model agreed very close to the experimental data. Considering both the skin-friction and pressure data, the implementation of the turbulence model is correct with providing accurate solutions.

Theory Manual

Theory: Introduction

This part contains details of the unerlying theory for the methods which are contained in Caelus.

Theory: Turbulence Models

This section details the turbulence models implemented in Caelus 9.04. Caelus 9.04 supports both steady-state and transient turbulence models. From an averaging point of view, Caelus 9.04 supports Reynolds averaged (RANS) and large eddy simulations (LES). The current focus of turbulence modelling in Caelus 9.04 is on incompressible flows. Future versions of Caelus will support compressible flows and appropriate compressible turbulence models.

Reynolds Averaged Navier-Stokes Equations

The general form of the incompressible Navier-Stokes equations in absence of body forces is given by the following expression:

\[\partial_t u_i + \partial_j(u_i u_j) = -\frac{1}{\rho} \partial_i p + \partial_j \nu \partial_j u_i.\]

The momentum equation is complemented by continuity equation, which for incompressible flow is the divergence free condition for velocity:

\[\partial_i u_i = 0\]

The Reynolds averaging procedure decomposes instantaneous variables into time averaged and fluctuating components according the expression

\[u_i(x_i,t) = \overline{u}_i(x_i) + u_i'(x_i,t).\]

Instantaneous quantities are averaged over a sufficiently long time such that the time scale of the fluctuating part of the field is much smaller than the averaging interval \(T\)

\[\overline{u}_i = \frac{1}{T} \int u_i(x_i,t) dt.\]

This definition allows for time variability in the averaged momentum and continuity equations although the structures that have characteristic time scales comparable to or larger than the filter width \(T\) could be resolved.

An important property of the fluctuating portion of the flow fields in Reynolds averaged simulations is that they have zero mean value by the definition:

\[\frac{1}{T} \int u_i'(x_i,t) dt = 0.\]

Keeping in mind this property, the Reynolds averaging procedure is applied to the Navier-Stokes equations to obtain Reynolds Averaged Navier-Stokes (RANS) equations:

\[\partial_i \overline{u}_i = 0\]
\[\partial_t \overline{u}_i + \partial_j (\overline{u}_i \overline{u}_j) = \frac{1}{\rho} \partial_i \overline{p} + \partial_j(\nu \partial_j \overline{u}_i ) - \partial_j \overline{u_i' u_j'}\]

The new term in momentum equations, \(-\partial_j\overline{u_i' u_j'}\), appears due to the non-linear nature of the momentum equation. This term is called the Reynolds stress tensor and it represents the influence of turbulence on the mean flow. The Reynolds stress tensor contains 6 unique, unknown components. The unknowns must be modelled and are determined by relating them to time averaged quantities. The most common approach used to close the Reynolds stresses is the Boussinesq hypothesis:

\[-\overline{u_i' u_j'} = 2 \nu_{t} \left( \overline{S}_{ij} - \frac{2}{3} k \delta_{ij}\right),\]

where the term \(\overline{S}_{ij}\) is the symmetric part of the time averaged stress tensor

\[\overline{S}_{ij} = \frac{1}{2}(\partial_j \overline{u}_i + \partial_i \overline{u}_j),\]

and \(k\) is turbulent kinetic energy

\[k = \frac{1}{2} \sum_i \overline{(u_i')^2}.\]

The Boussinesq hypothesis is also called eddy viscosity approximation and most RANS turbulence models use it in this linear form. The main difference between various turbulence models employing the Boussinesq hypothesis is how the turbulent viscosity \(\nu_t\) is determined.

The following sections describes the transport equations of the RANS turbulence models included in Caelus 9.04. Note, the over-bar used to denote time averaged quantities, will be omitted for the clarity throughout this section.

Spalart-Allmaras Turbulence Model

Model Description

The Spalart-Allmaras model uses one equation to compute the turbulent viscosity. The Spalart-Allmaras model used in Caelus 9.04 corresponds to the version of Shur et al. [9] with curvature correction. The transport equation in this version is the same as the original Spalart-Allmaras model [10] but with rotation and curvature effects accounted for. This modification is accomplished by introducing the \(f_{r1}\) function into the transport equation for the viscosity-like variable

\[\partial_t \tilde{\nu} + u_j \partial_j \tilde{\nu} = c_{b1}f_{r1}\tilde{S}\tilde{\nu} - c_{w1}f_{w1}\left(\frac{\tilde{\nu}}{d}\right)^2 + \frac{1}{\sigma}\left[\partial_j(\nu+\tilde{\nu})\partial_j \tilde{\nu} + c_{b2}\partial_i \tilde{\nu} \partial_i \tilde{\nu} \right]\]

Terms appearing in the Spalart-Allmaras turbulence model have the following definitions:

Model definitions

Symbol

Definition

Formula

\(\tilde{\nu}\)

Viscosity-like variable

\(\nu_t\)

Turbulent eddy viscosity

\(\tilde{\nu} f_{v1}\)

\(f_{v1}\)

Viscous Damping Function

\(\frac{\chi^3}{\chi^3 + c_{v1}}\)

\(\chi\)

Viscosity ratio

\(\frac{\tilde{\nu}}{\nu}\)

\(\nu\)

Kinematic Viscosity

\(\tilde{S}\)

Modified vorticity

\(\Omega + \frac{\tilde{\nu}}{\kappa^2 d^2}f_{v2}\)

\(\Omega\)

Vorticity magnitude

\(\Omega = \sqrt{2W_{ij}W_{ij}}\)

\(W_{ij}\)

Vorticity

\(\frac{1}{2}(\partial_j u_i - \partial_i u_j)\)

\(d\)

Wall distance

\(f_{v2}\)

Function

\(1-\frac{\chi}{1+\chi f_{v1}}\)

\(f_{w}\)

Function

\(g\left[\frac{1+c_{w3}^6}{g^5+c_{w3}^6}\right]^{1/6}\)

\(g\)

Function

\(r+c_{w2}(r^6-r)\)

\(r\)

Variable

\(r=min\left[\frac{\tilde{\nu}}{\tilde{S} \kappa^2 d^2},10\right]\)

It should be noted that the Caelus 9.04 implementation of the Spalart-Allmaras turbulence model omits the rotational and turbulence tripping terms as the flow is assumed fully turbulent.

Model constants

\(c_{b1} = 0.1355\)

\(\sigma = \frac{2}{3}\)

\(c_{b2} = 0.622\)

\(c_{w2} = 0.3\)

\(c_{w3} = 2.0\)

\(c_{v1} = 7.1\)

\(c_{w1} = \frac{c_{b1}}{\kappa^2} + \frac{1+c_{b2}}{\sigma}\)

\(\kappa = 0.41\)

The Spalart-Allmaras model neglects the contribution of the turbulent kinetic energy to the eddy viscosity. This is deemed acceptable for many incompressible and low Mach number compressible flows.

Boundary conditions

The Spalart-Allmaras turbulence model was originally developed for external aerodynamics of streamlined bodies. Typically, mesh resolutions used for external aerodynamics have \(y^+\) values close to 1. Therefore, the Spalart-Allmaras model is often referred to as a low Reynolds number model when it comes to near wall treatment. In the case of meshes resolved near the wall, i.e. \(y^+ \sim 1\), the following set of boundary conditions are recommended:

\(\tilde{\nu}|_{wall} = 0\)

\(\nu_t|_{wall} = 0\)

However, in Caelus 9.04 it is possible to use the Spalart-Allmaras on meshes that are not wall-resolved, i.e., meshes that have the first cell height next to the wall \(y^+ \gg 1\). In such cases, a wall function for \(\nu_t\) based on the velocity is recommended.

\(\nu_t|_{wall} =\) nutUWallFunction (\(y^+ > 30\))

Inlet values of \(\tilde{\nu}\) at the far field boundary for external flows is suggested as follows:

\(\tilde{\nu}|_{inlet} = 3 \nu\) to \(5 \nu\).

\(\nu_t\) should be set to “calculated”.

It is also possible to specify \(\tilde{\nu}\) from the turbulence intensity and length scale as follows:

\(\tilde{\nu}|_{inlet} = \sqrt{\frac{3}{2}} |u_i| I l\)

where \(I = \frac{|u_i'|}{|u_i|}\) is turbulence intensity and

\(l\) is a turbulence length scale (measure of largest eddies in the flow field).

In the case of internal flows, depending on the level of turbulence intensity, \(\tilde{\nu}\) can be determined from the turbulence viscosity ratio

\(\tilde{\nu} = 10\nu\) or higher and

\(\nu_t\) should be set to “calculated”.

At the outlet, zero gradient an acceptable choice.

Realizable \(k\)\(\varepsilon\) Turbulence Model

Model description

The realizable \(k\)\(\varepsilon\) turbulence model is an improvement on the standard \(k\)\(\varepsilon\) model as it is modified to guarantee realizability of normal Reynolds stresses [13]. In the standard \(k\)\(\varepsilon\) turbulence model it is possible, under certain conditions, to have negative normal Reynolds stresses, i.e. non-realizable. The realizable \(k\)\(\varepsilon\) turbulence model resolves this problem by introducing a non-constant definition of \(C_{\mu}\) and by modifying the \(\varepsilon\) equation. The transport equations for the realizable \(k\)\(\varepsilon\) turbulence model are as follows:

\[\partial_t k + \partial_j (u_j k) = \partial_j\left[\mu + \frac{\mu_t}{\sigma_k}\partial_j k\right] + G_k -\varepsilon\]
\[\partial_t \varepsilon + \partial_j (u_j \varepsilon) = \partial_j\left[\mu + \frac{\mu_t}{\sigma_{\varepsilon}}\partial_j \varepsilon \right] + C_1 S \varepsilon - C_2 \frac{\varepsilon^2}{k+ \sqrt{\nu\varepsilon}}\]

The terms appearing in the realizable \(k\)\(\varepsilon\) turbulence model have the following definitions:

Model definitions

Symbol

Definition

Formula

\(\nu_t\)

Turbulent viscosity

\(C_{\mu}\frac{k^2}{\varepsilon}\)

\(C_1\)

Model parameter

\(max \left(0.43,\frac{\eta}{\eta+5}\right)\)

\(\eta\)

Strain magnitude over time scale

\(S\frac{k}{\varepsilon}\)

\(S\)

Strain magnitude

\(S = \sqrt{2S_{ij}S_{ij}}\)

\(S_{ij}\)

Strain tensor

\(\frac{1}{2}(\partial_j u_i + \partial_i u_j)\)

\(C_{\mu}\)

Model parameter

\(\frac{1}{A_0 + A_S \frac{k U^*}{\varepsilon}}\)

\(U^*\)

Velocity

\(\sqrt{S_{ij}S_{ij}+\tilde{\Omega_{ij}}\tilde{\Omega_{ij}}}\)

\(\overline{\Omega}_{ij}\)

Rate of rotation tensor

\(\frac{1}{2}(\partial_j u_i - \partial_i u_j)\)

\(\omega_k\)

Angular velocity

\(\Omega_{ij}\)

Rotation tensor

\(\overline{\Omega}_{ij} - \varepsilon_{ijk} \omega_k\)

\(\tilde{\Omega}_{ij}\)

Modified rotation tensor

\(\Omega_{ij} - 2 \varepsilon_{ijk} \omega_k\)

\(A_0\)

Model constant

\(4.04\)

\(A_S\)

Function

\(\sqrt{6} cos(\phi)\)

\(\phi\)

Function

\(\frac{1}{3} cos^{-1} (\sqrt{6} W)\)

\(W\)

Variable

\(\frac{S_ijS_{jk}S{ki}}{S^3}\)

Model constants

\(C_{1\varepsilon} = 1.44\)

\(C_2 = 1.9\)

\(\sigma_k = 1.0\)

\(\sigma_{\varepsilon} = 1.2\)

Boundary conditions

The realizable \(k\)\(\varepsilon\) was developed as a high-Reynolds number model. In other words, the wall treatment is such that wall functions for \(\nu_t\), \(k\), and \(\varepsilon\) fields must be always used. It is recommended that velocity based wall functions for the \(\nu_t\) field is used. On the inlet, the following relations can be used to determine the values of \(k\) and \(\varepsilon\) fields:

\(k|_{inlet} = \frac{3}{2} (U_{inlet} I)^2\),

\(\varepsilon = C_{\mu}^{3/4} \frac{k^{3/2}}{l}\),

\(\nu_t\) should be set to “calculated” or computed from the viscosity ratio.

\(I = \frac{|u_i'|}{|u_i|}\) is the turbulence intensity

and \(l\) is a turbulence length scale.

On outlets, zero gradient is an acceptable choice.

\(k\)\(\omega\) SST Model

Model description

The \(k\)\(\omega\) shear stress transport (SST) turbulence model was introduce by Menter [16] as an improvement on the original two equation \(k\)\(\omega\) model of Wilcox [14]. The SST formulation uses the \(k\)\(\omega\) formulation in the inner parts of the boundary layer and it switches to a \(k\)\(\varepsilon\) behaviour in the free-stream portions of the flow domain. Thus, the \(k\)\(\omega\) SST turbulence model does not require a damping function close to the wall enabling its use with near-wall resolved meshes without modification. At the same time, the \(k\)\(\omega\) SST models reverts to a \(k\)\(\varepsilon\) model behaviour away from the walls thus removing the sensitivity of the original \(k\)\(\omega\) model to the \(\omega\) free-stream boundary value.

The implementation of the \(k\)\(\omega\) SST model in Caelus 9.04 is that of Kuntz et al [3]. The transport equations for turbulence kinetic energy and specific dissipation are:

\[\partial_t k + \partial_j (u_j k) = \frac{P}{\rho} - \beta^* \omega k + \partial_j[(\nu + \sigma_k \nu_t) \partial_j k]\]
\[\partial_t \omega + \partial_j(u_j \omega) = \frac{\gamma P}{\rho \nu_t} - \beta \omega^2 + \partial_j[(\nu + \nu_t) \partial_j \omega] + 2(1-F_1) \frac{\sigma_{\omega2}}{\omega} \partial_j k \partial_j \omega\]

It should be noted that this set of transport equations only applicable for incompressible flows as density was assumed constant. Terms appearing in the \(k\)\(\omega\) SST model have the following definitions:

Model definitions

Symbol

Definition

Formula

\(\nu_t\)

Turbulent viscosity

\(\frac{a_1 k}{max (a_1 \omega, S F_2)}\)

\(S_{ij}\)

Symmetric part of stress tensor

\(\frac{1}{2}(\partial_j u_i + \partial_i u_j)\)

\(S\)

Strain invariant

\(S=\sqrt{S_{ij}S_{ij}}\)

\(F_1\)

Blending function

\(tanh(arg_1^4)\)

\(arg_1\)

Argument for \(F_1\) function

\(min\left[max \left(\frac{\sqrt{k}}{\beta^* \omega d},\frac{500 \nu}{d^2 \omega}\right), \frac{4 \sigma_{\omega 2} k}{CD_{k \omega} d^2}\right]\)

\(CD_{k \omega}\)

Function

\(max\left(2 \sigma_{\omega 2}\frac{1}{\omega} \frac{\partial k}{\partial x_j} \frac{\partial \omega}{\partial x_j}, 10^{-10}\right)\)

\(F_2\)

Blending function

\(tanh(arg_2^2)\)

\(arg_2\)

Argument for \(F_2\) function

\(max \left(2 \frac{\sqrt{k}}{\beta^* \omega d},\frac{500 \nu}{d^2 \omega}\right)\)

This variant of the \(k\)\(\omega\) SST turbulence model uses a production limiter in both \(k\) and \(\omega\) equations,

\[P = min(P, 10 \beta^* \omega k).\]

Model constants

\(\gamma_1 = \frac{5}{9}\)

\(\gamma2 = 0.44\)

\(\sigma_{k 1} = 0.85\)

\(\sigma_{\omega 1} = 0.5\)

\(\beta_1 = 0.075\)

\(\sigma_{k 2} = 1.0\)

\(\sigma_{\omega 2} = 0.856\)

\(\beta_2 = 0.0828\)

\(\beta^* = 0.09\)

\(\kappa = 0.41\)

\(a_1 = 0.31\)

Boundary conditions

As described above, the \(k\)\(\omega\) SST turbulence model does not require damping functions near the wall. Thus it can be used for both resolved and unresolved near-wall meshes. In the case of meshes resolved near the wall, i.e. \(y^+ \sim 1\), the following set of boundary conditions are recommended:

\(k_{wall} = 0\)

\(\omega_{wall} =\) omegaWallFunction

\(\nu_t|_{wall} = 0\)

For meshes that are not wall-resolved, i.e., meshes that have the first cell height next to the wall \(y^+ \gg 1\), wall functions will be needed. In such cases, a wall function for \(\nu_t\) based on the velocity is recommended.

\(k_{wall} =\) kqRWallFunction

\(\omega_{wall} =\) omegaWallFunction

\(\nu_t|_{wall} =\) nutUSpaldingWallFunction or alternatively nutUWallFunction if \(y^+ \gt 30\)

Inlet values of can be determined as follows:

\(k_{inlet} = \frac{3}{2} (U_{inlet} I)^2\),

\(\omega = C_{\mu}^{-1/4} \frac{\sqrt{k}}{l}\),

\(\nu_t\) should be set to “calculated” or computed from the turbulent viscosity relation.

\(I = \frac{|u_i'|}{|u_i|}\) is the turbulence intensity

and \(l\) is a turbulence length scale.

On outlets, zero gradient is an acceptable choice.

References

References

1

Turbulence Modeling Resource. Langley Research Center, NASA, http://turbmodels.larc.nasa.gov/index.html.

2

Roshko A. On the Development of Turbulent Wakes from Vortex Streets. Technical Report TR-1191, National Advisory Committee for Aeronautics, 1954.

3

F.R., Menter, M. Kuntz, and Langtry R. Ten Years of Industrial Experience with the SST Turbulence Model. In K., Hanjalić, Y. Nagano, and Tummers M., editors, Turbulence, Heat and Mass Transfer 4, 625–632. 2003.

4

McBain G.D. and Stephens D.W. Low Grashof Number Convective Heat Transfer across a Spherical Cavity. In G. B. Brassington & J. C. Patterson, editor, Heat and Mass Transfer Australasia, 231–237. 2000.

5

N Gregory. and C. L O’Reilly. Low-Speed Aerodynamic Characteristics of NACA 0012 Aerofoil Sections, including the Effects of Upper-Surface Roughness Simulation Hoar Frost. Technical Report 3726, National Physical Laboratory, 1970.

6

Blasius H. Grenzschichten in Flüssigkeiten mit kleiner Reibung. Z. Math. Phys, 56:1–37, 1908.

7

Schlichting H. Boundary Layer Theory. McGraw-Hill Science, 7 edition, 1979.

8

Smits A. J., Young S. T. B., and Bradshaw P. The Effect of Short Regions of High Surface Curvature on Turbulent Boundary Layers. J. Fluid Mech., 94(2):209–242, 1979.

9

Shur M. L., Strelets M. K., Travin A. K., and Spalart P. R. Turbulence Modeling in Rotating and Curved Channels: Assessing the Spalart-Shur Correction. AIAA Journal, 38(5):784–792, 2000.

10

P.R., Spalart and Allmaras S.R. A One-Equation Turbulence Model for Aerodynamic Flows. Recherche Aerospatiale, (1):5–21, 1994.

11

Jyotsna R. and Vanka S. P. Multigrid Calculation of Steady, Viscous Flow in a Triangular Cavity. Journal of Computational Physics, 122:107–117, 1995.

12

Hayes R.E., Nandkumar K., and Nasr-El-Din H. Steady Laminar Flow in a 90 Degree Planar Branch. Computers and Fluids, 17(4):537–553, 1989.

13

T.-H., Shih, Liou W.W., Shabbir A., Yang Z., and Zhu. J. A New :math:`k-\epsilon ` Eddy-Viscosity Model for High Reynolds Number Turbulent Flows - Model Development and Validation. Computers Fluids, 24(3)(5):227–238, 1995.

14

Wilcox D. C. Reassessment of the Scale-Determining Equation for Advanced Turbulence Models”. AIAA Journal, 26:1299–1310, 1988.

15

Driver D. M. and Seegmiller H. L. Features of Reattaching Turbulent Shear Layer in Divergent Channel Flow. AIAA Journal, 23(2):163–171, Feb 1985.

16

Menter F. R. Two-Equation Eddy-Viscosity Models for Engineering Applications. AIAA Journal, 32:1598–1605, 1994.

Indices and tables