0% found this document useful (0 votes)
11 views17 pages

Tut Expansion Fan

The document outlines the setup and execution of a simulation for high-speed compressible flow past an expansion corner at a Mach number of 2.5, using a steady compressible solver based on the Euler equations. It provides detailed instructions on running the case, selecting thermophysical properties, defining boundary conditions, and configuring discretization schemes and linear solvers. The goal is to compare numerical solutions with analytical results and explore different setups for learning purposes.

Uploaded by

BEHNAM FALLAH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views17 pages

Tut Expansion Fan

The document outlines the setup and execution of a simulation for high-speed compressible flow past an expansion corner at a Mach number of 2.5, using a steady compressible solver based on the Euler equations. It provides detailed instructions on running the case, selecting thermophysical properties, defining boundary conditions, and configuring discretization schemes and linear solvers. The goal is to compare numerical solutions with analytical results and explore different setups for learning purposes.

Uploaded by

BEHNAM FALLAH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

High speed compressible flow – Expansion fan

Expansion corner – Expansion fan

Physical and numerical side of the problem:


• In this case, we simulate a flow past by an expansion corner.
• The expansion corner is inclined 15 degrees below the horizontal line and the inlet Mach
number is equal to 2.5.
• We are going to use a steady compressible solver with zero viscosity.
• Therefore, the governing equations of the problem are the compressible Euler equations.
• This problem has an analytical solution and plenty of validation data.
High speed compressible flow – Expansion fan

• Let us run this case. Go to the directory:

$PTOFC/expansion_fan

• $PTOFC is pointing to the directory where you extracted the training material.
• In the case directory, you will find the README.FIRST file. In this file, you will find the general instructions of
how to run the case. In this file, you might also find some additional comments.
• You will also find a few additional files (or scripts) with the extension .sh, namely, run_all.sh,
run_mesh.sh, run_sampling.sh, run_solver.sh, and so on. These files can be used to run the case
automatically by typing in the terminal, for example, sh run_solver.
• We highly recommend you to open the README.FIRST file and type the commands in the terminal, in this
way, you will get used with the command line interface and OpenFOAM® commands.
• If you are already comfortable with OpenFOAM®, use the automatic scripts to run the cases.
High speed compressible flow – Expansion fan
What are we going to do?

• We will use this case to learn how to setup supersonic flow cases.
• We will compare the numerical solution with the analytical solution.
• We will run the case with a robust numerics, but you are invited to try different setups
and compare the different outcomes.
• To find the numerical solution we will use the solver rhoSimpleFoam with zero
viscosity (Euler equations).
• rhoSimpleFoam is a steady solver for turbulent flow of compressible fluids.
• After finding the numerical solution we will do some sampling.
• Then we will do some plotting (using gnuplot or Python) and scientific visualization.
High speed compressible flow – Expansion fan
Running the case
• Let us first convert the mesh from Fluent format.
• In the terminal window type:

1. $> foamCleanTutorials
2. $> rm -rf 0 > /dev/null 2>&1
3. $> fluentMeshToFoam -2D 1 ./mesh/ascii.cas
4. $> checkMesh

• If you want to generate the mesh using blockMesh, in the directory system you will
the dictionary blockMeshDict, which has been already parametrized.
• In this case we are using a medium mesh and the wedge angle is 15 degrees.
• If you want to try different meshes or wedge angles, feel free to modify the dictionary
blockMeshDict.
High speed compressible flow – Expansion fan

Selecting thermophysical properties


• The thermophysical properties are set in the dictionary
1 thermoType thermophysicalProperties.
2 {
3 type hePsiThermo; • This dictionary file is located in the directory constant.
4 mixture pureMixture;
5 transport const; • In the sub-dictionary thermoType (lines 1-10), we define
6 thermo hConst;
7 equationOfState perfectGas;
the thermophysical models. Many of these options are
8 specie specie; hardwired with the solver used.
9 energy sensibleEnthalpy;
10 } • The transport keyword (line 5) concerns evaluating
11 dynamic viscosity. In this case the viscosity is constant.
12 mixture
13 { • The thermodynamic models (thermo keyword) are
14 specie concerned with evaluating the specific heat Cp (line 6). In
15 {
16 nMoles 1;
this case Cp is constant.
17 molWeight 28.9;
18 }
• The equationOfState keyword (line 7) concerns to the
19 thermodynamics equation of state of the working fluid. In this case, we are
20 { using the ideal gas equation model.
21 Cp 1005;
22 Hf 0;
23 }
24 transport
25 {
26 mu 0.0;
27 Pr 0.713;
28 }
29 }
High speed compressible flow – Expansion fan

Selecting thermophysical properties


• The form of the energy equation to be used is specified
1 thermoType in line 9 (energy).
2 {
3 type hePsiThermo; • In this case we are using enthalpy formulation
4 mixture pureMixture;
5 transport const;
(sensibleEnthalpy). In this formulation, the following
6 thermo hConst; equation is solved,
7 equationOfState perfectGas;
8 specie specie;
9 energy sensibleEnthalpy;
10 }
11
12 mixture • In the sub-dictionary mixture (lines 12-29), we define the
13 { thermophysical properties of the working fluid (air in this
14 specie
15 {
case).
16 nMoles 1; • In line 17, we define the molecular weight.
17 molWeight 28.9;
18 } • In line 21, we define the specific heat Cp. The heat of
19 thermodynamics
20 { formation Hf is defined in line 22 (not used in this case).
21 Cp 1005;
22 Hf 0;
• As we are using the transport model const (line 5), we
23 } need to define the dynamic viscosity mu and Prandtl
24 transport number Pr (lines 26 and 27).
25 {
26 mu 0.0; • As we want to solve the Euler equations, we set the
27 Pr 0.713;
viscosity to zero (line 26). We also define the Prandtl
28 }
29 } number in line 27 but is not used in this case as we are
solving the Euler equations.
High speed compressible flow – Expansion fan

Selecting thermophysical properties


• When solving the enthalpy formulation of the energy equation,

the pressure work term can be excluded from the solution.


• This has a stabilizing effect on the solution, specially if you are using steady solvers.
• To turn off the pressure work term , set the option dpdt to no in the
thermophysicalProperties dictionary.



dpdt no;
High speed compressible flow – Expansion fan

Selecting turbulence model


• As we are solving the Euler equations (no viscosity), there is no turbulence involved.
• Nevertheless, we need to set the turbulence model to laminar in the dictionary
turbulenceProperties.
• This dictionary is located in the directory constant.

simulationType laminar;

• At this point we are done with the physical properties.


• Let us define the boundary conditions.
High speed compressible flow – Expansion fan

Boundary and initial conditions


• The boundary and initial conditions are defined as follows.
Boundary conditions
Initial conditions:
U → (867.7192 0 0)
p → 303961 INLET:

fixedValue
T → 300 U → (867.7192 0 0)
p → 303961
T → 300

OUTLET-FARFIELD:
U → inletOutlet
p → zeroGradient
T → inletOutlet

SLIP WALLS:
U, p, T → slip

Note: the inlet velocity is equivalent to a


Mach number of 2.5. The speed of
sound used was for air at 303961 Pa
and 300 Kelvin.
High speed compressible flow – Expansion fan

Selecting the discretization schemes


1 ddtSchemes
• The discretization schemes are set in the dictionary
2 { fvSchemes located in the directory system.
3 default steadyState;
4 }
5 • When dealing with compressible flows and strong
6 gradSchemes discontinuities (such as shock waves), it is of paramount
7 {
8 default cellLimited Gauss linear 1; importance to set a robust and accurate numerics, as the
9 grad(p) cellLimited Gauss linear 0.333;
10 grad(h) cellLimited Gauss linear 0.333; one used in this case.
11 }
12 • In this case, we use a steady solver(line 3).
13 divSchemes
14
15
{
default none;
• In lines 6-11 we define the gradient discretization. When
16 div(phi,U) bounded Gauss vanLeerV; dealing with shock waves, it is recommended to use an
17 div(phi,K) bounded Gauss limitedLinear 1;
18 div(phi,h) bounded Gauss limitedLinear 1; aggressive limiter for grad(U) (line 8).
19 div(phid,p) Gauss limitedLinear 1;
20 div((nuEff*dev2(T(grad(U))))) Gauss linear; • Be careful not to add very aggressive limiters to grad(p)
21 }
22 and grad(h) (line 8), as they may add a lot of numerical
23 laplacianSchemes
24 {
diffusion.
25 default Gauss linear limited 1;
26 } • In this case, we are using a stable and accurate limiter
27
28 interpolationSchemes
for grad(p) and grad(h) (lines 9 and 10).
29 {
30 default linear;
31 }
32
33 snGradSchemes
34 {
35 default limited 1;
36 }
High speed compressible flow – Expansion fan

Selecting the discretization schemes


1 ddtSchemes • In lines 13-21 we define the discretization of the
2 { convective terms.
3 default steadyState;
4 }
5 • Notice that for velocity (line 16) we are using a TVD
6 gradSchemes scheme.
7 {
8 default cellLimited Gauss linear 1;
9 grad(p) cellLimited Gauss linear 0.333; • TVD schemes are highly recommended when you are
10 grad(h) cellLimited Gauss linear 0.333;
11 }
dealing with strong discontinuities (such as shock
12 waves).
13 divSchemes
14
15
{
default none;
• In lines 17-20 we define the discretization schemes for
16 div(phi,U) bounded Gauss vanLeerV; the variables related to the energy equation. In general,
17 div(phi,K) bounded Gauss limitedLinear 1;
18 div(phi,h) bounded Gauss limitedLinear 1; the setup used is accurate and stable.
19 div(phid,p) Gauss limitedLinear 1;
20 div((nuEff*dev2(T(grad(U))))) Gauss linear;
21 }
22
23 laplacianSchemes
24 {
25 default Gauss linear limited 1;
26 }
27 div(phi,h) div(phi,K)
28 interpolationSchemes
29 {
30 default linear;
31 }
32
33 snGradSchemes • Line 19 is related to the transonic correction used. this
34
35
{
default limited 1;
correction is set in the dictionary fvSolution.
36 }
High speed compressible flow – Expansion fan

Selecting the discretization schemes


1 ddtSchemes • For steady state cases, the bounded form can be applied
2 { to the divSchemes.
3 default steadyState;
4 }
5 • In this case, div(phi,U) is defined as bounded Gauss
6 gradSchemes vanLeerV.
7 {
8 default cellLimited Gauss linear 1;
9 grad(p) cellLimited Gauss linear 0.333; • The terms div(phi,K) and div(phi,h) are defined as
10 grad(h) cellLimited Gauss linear 0.333;
11 }
bounded Gauss limitedLinear 1.
12
13 divSchemes • This adds a linearized, implicit source contribution to the
14 {
15 default none;
transport equation of the form,
16 div(phi,U) bounded Gauss vanLeerV;
17 div(phi,K) bounded Gauss limitedLinear 1;
18 div(phi,h) bounded Gauss limitedLinear 1;
19 div(phid,p) Gauss limitedLinear 1;
20 div((nuEff*dev2(T(grad(U))))) Gauss linear;
21 }
22
23 laplacianSchemes
24 {
25 default Gauss linear limited 1;
26 }
27
28 interpolationSchemes • This term removes a component proportional to the
29 {
30 default linear;
continuity error. This acts as a convergence aid to tend
31 } towards a bounded solution as the calculation proceeds.
32
33
34
snGradSchemes
{
• At convergence, this term becomes zero and does not
35 default limited 1; contribute to the final solution.
36 }
High speed compressible flow – Expansion fan

Selecting the solution method and linear solvers


1 solver • The solution method, corrections and linear solvers are
2 { set in the dictionary fvSolution located in the
3 p
4 { directory system.
5 solver PBiCGStab;
6
7
preconditioner
tolerance
DILU;
1e-06;
• In this case, we are using the linear solver PBiCGStab
8 relTol 0.001; for all variables except rho.
9 minIter 2;
10
11
}
• In compressible solvers, rho is computed from the
12 U thermodynamical variables, therefore, we use a diagonal
13 {
14 solver PBiCGStab; solver (back substitution).
15 preconditioner DILU;
16 tolerance 1e-08; • It is recommended to set the minimum number of
17 relTol 0.001;
18 minIter 2; iterations to 2 or 3, this increases the stability and helps
19 } at linearizing the linear system.
20
21 h
22 { • The minimum number of iterations is set by using the
23 solver PBiCGStab;
24 preconditioner DILU;
keyword minIter.
25 tolerance 1e-08;
26 relTol 0.001;
27 minIter 2;
28 }
29
30 rho
31 {
32 solver diagonal;
33 }
34
35 }
36
High speed compressible flow – Expansion fan

Selecting the solution method and linear solvers


• In this case we are using the SIMPLE pressure-velocity coupling
1 SIMPLE (line 1).
2 {
3 transonic yes;
4 consistent yes;
• In line 3, we enable the transonic correction.
5
6 residualControl • This option is recommended when the critical Mach number is
7 { exceeded (usually for Mach number values above 0.5).
8 P 1e-4;
9 U 1e-4; • In line 4 we are enabling the SIMPLEC pressure-velocity coupling
10 h 1e-4;
11 } formulation.
12
13 nNonOrthogonalCorrectors 2; • This formulation is more stable and faster than the SIMPLE
14 formulation.
15 pMin 10000;
16 pMax 1000000; • In lines 6-11 we are defining the residuals control for the field
17 }
18 variables. If the solver reach this tolerance it will automatically
19 relaxationFactors stop.
20 {
21 fields • In line 13 we define the non-orthogonal corrections (these
22 {
23 p 0.7; corrections are related to the mesh quality).
24 rho 0.7;
25 } • In lines 15-16 we define the minimum and maximum values of
26 equations pressure. This is not compulsory, but it is recommended to follow
27 {
28 p 0.7; this practice to avoid reaching unrealistic values (and of course the
29 U 0.7; values used should be realistic).
30 h 0.7;
31 } • In lines 19-32 we define the under-relaxation factors (URF).
32 }
33
• Remember, URF values are they are problem dependent.
• An optimum choice of under-relaxation factors is one that is small
enough to ensure stable computation but large enough to move
the iterative process forward quickly.
High speed compressible flow – Expansion fan

fvOptions – Limiting temperature min/max values


• As for the minimum and maximum values of pressure in the dictionary fvSolution (pMin and pMax), it is
also possible to add a limit to the minimum and maximum values of the temperature field.
• This can be done by adding a limit in the form of a source term in the fvOptions dictionary (located in the
directory system).
• This limiting of the minimum and maximum values is not compulsory. However, it is recommended to follow
this practice to avoid reaching unrealistic values and eventually divergence.
• No need to mention that the limits defined should be realistic.
• Also, it is recommended to use this form of limiter during the initial iterations and until the solution has
stabilized.
• In the lines below, a limiter for the temperature is shown (there is a similar version for the velocity field).

limitT User given name of the limiting source term


{
type limitTemperature; Source term to limit temperature

active yes; Turn on/off limit

min 100;
Allowed minimum and maximum values
max 1000;

selectionMode all; Selection mode, in this case we are applying


} the limit to the whole domain. It can also be
applied to a region or cellSet.
High speed compressible flow – Expansion fan
Running the case
• You will find this tutorial in the directory $PTOFC/supersonic_wegde
• In the terminal window type:

1. $> cp -r 0_empty 0
2. $> renumberMesh -overwrite
3. $> rhoSimpleFoam | tee log.solver
4. $> rhoSimpleFoam -postProcess -func MachNo
5. $> paraFoam

• In line 4 we compute the Mach number.


• You cannot use the pseudo-transient formulation with steady solvers
(rhoSimpleFoam in this case).
High speed compressible flow – Expansion fan
Visualizing the solution in Paraview
• At this point, you can visualize the solution using Paraview and compare the output with the analytical solution.

Analytical solution [1, 2]

Mach number

Mach number after expansion fan/corner 3 .2370

• [1] Modern compressible flow: with historical perspective. Third edition. McGraw-Hill.
• [2] Compressible aerodynamics calculator. http://www.dept.aoe.vt.edu/~devenpor/aoe3114/calc.html

You might also like