Skip to content

Tutorials

Jiří Fürst edited this page Mar 4, 2023 · 13 revisions

The section gives brief description of tutorials from the tutorials directory. Tutorials are sorted into sub-directories according to solvers.

Warning: the tutorials are not updated regularly and therefore it may happen that some setup will be out-of date. Next, the repository uses several branches, so the case can be relevant to different branch.

Tutorials for myLusgsFoam

transonicChannel

This tutorial shows the setup for 2D inviscid transonic flows through a channel with a circular arc bump at the lower wall.

Geometry & mesh

The length of the channel is L = 3m and the height is H = 1m. There is a 1m long circular arc bump at the lower wall located 1m from the channel inlet. The height of the bump is h = 0.1m.

image

The case uses structured mesh with 150x50 quadrilateral cells created with blockMesh (see system/blockMeshDict).

Boundary conditions

The flow is considered as inviscid with the equation of state for perfect gas. The boundary conditions are:

  • inlet: given total pressure p0 = 100 kPa, total temperature T0 = 288.15, and flow direction $dir$ = (1, 0).
  • outlet: given static pressure p2 = 73.7 kPa
  • walls: non-permeable slip condition

The computation setup in openFOAM is therefore:

  • p: totalPressure at the inlet, fixedValue at the outlet, zeroGradient at walls
  • T: totalTemperature at the inlet, zeroGradient at the outlet and walls
  • U: subsonicInletTotal at the inlet, zeroGradient at the outlet, slip at walls

Notes:

  1. the pressureInletVelocity and its variants are not compatible with myLusgsFoam solver! Therefore the subsonicInletTotal should be used for velocity. It calculates the inlet velocity magnitude using Riemann invariants. The condition is compatible only with perfect gas EOS!
  2. the realGas branch of repository contains specific set of inlet/outlet boundary conditions.

Results

The following image shows the distribution of Mach number in the channel. One can see a shock wave at the bump (at x approx. 1.7). The thick line is the sonic line (i.e. Ma = 1).

image

The distribution of Mach number along the lower wall is extracted using standard postprocessing tools. It can be found in postProcessing/surfaces/20000/Ma_lowerWall.raw. Plot column 4 (Mach number) versus column 1 (x coordinate)

image

The convergence history can be extracted from the log file using foamLog log.myLusgsFoam. image

lowMachChannel

This tutorial shows the setup for 2D inviscid low Mach number flows through a channel with a circular arc bump at the lower wall. The case uses the same geometry, mesh, and boundary condition setup as the transonicChannel case. The differences are in the value of outlet pressure and in the numerical flux.

axiBump

This is the axisymmetric transonic bump case from the NASA validation page. The description of the case can be found here. The setup more less corresponds to transonicChannel. The difference is that a no-slip boundary condition is assumed at the lower wall. Moreover, the flow is viscous and the turbulence is modeled with a two-equation k-omega SST turbulence model.

To run the tutorial, one has to run getMesh.sh at first. It downloads the mesh from NASA site and then it converts the mesh to OpenFOAM format. Then the calculation can be performed with Allrun script.

image

hypersonicCylinder

2D inviscid hypersonic flow through over a cylinder - ...

ercoftacCentrifugalPump_MRF

2D flow through ERCOFTAC pump, MRF approach - ...

ercoftacCentrifugalPump_DyM

2D flow through ERCOFTAC pump, dynamic mesh approach - ...