Implementation and run-time mesh refinement for the k SST DES - - PowerPoint PPT Presentation

implementation and run time mesh refinement for the k sst
SMART_READER_LITE
LIVE PREVIEW

Implementation and run-time mesh refinement for the k SST DES - - PowerPoint PPT Presentation

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Implementation and run-time mesh refinement for the k SST DES turbulence model when applied to airfoils Daniel Lindblad 2013-12-10,11 Daniel Lindblad k SST


slide-1
SLIDE 1

Theory OpenFOAM implementation Airfoil simulation with mesh refinement

Implementation and run-time mesh refinement for the k − ω SST DES turbulence model when applied to airfoils

Daniel Lindblad 2013-12-10,11

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 1 / 23

slide-2
SLIDE 2

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Turbulence model

The k − ω SST DES turbulence model

Governing transport equations ∂k ∂t + ∂(¯ uik) ∂xi = ˜ Pk + ∂ ∂xi

  • ν + νt

σk ∂k ∂xi

  • − β∗kωFDES

∂ω ∂t + ∂(¯ uiω) ∂xi = Pω + ∂ ∂xi

  • ν + νt

σω ∂ω ∂xi

  • − βω2

+2(1 − F1)σω2 1 ω ∂k ∂xi ∂ω ∂xi ω = ε β∗k

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 2 / 23

slide-3
SLIDE 3

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Turbulence model

The k − ω SST DES turbulence model

Turbulent viscosity, used in Boussinesq assumption νt = a1k max(a1ω, SF2) −v′

iv′ j

= 2νt¯ sij − 2 3δijk S =

sij¯ sij ¯ sij = 1 2 ∂¯ ui ∂xj + ∂¯ uj ∂xi

  • Daniel Lindblad

k − ω SST DES with mesh refinement 2013-12-10,11 3 / 23

slide-4
SLIDE 4

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Turbulence model

The k − ω SST DES turbulence model

The DES (Detached Eddy Simulation) and DDES (Delayed Detached Eddy Simulation) terms FDES = max

  • Lt

CDES∆, 1

  • FDDES

= max

  • Lt

CDES∆(1 − FS), 1

  • Lt

= √ k β∗ω DDES = Boundary later protection through the blending function FS = F1, F2.

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 4 / 23

slide-5
SLIDE 5

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Mesh refinement

Idea behind run time mesh refinement

Unresolved turbulence + Finer mesh = Resolution of turbulence through DES features Mesh should be fine in turbulent regions and coarse in other regions Question: When is the mesh fine enough?

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 5 / 23

slide-6
SLIDE 6

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Mesh refinement

Idea behind run time mesh refinement

Unresolved turbulence + Finer mesh = Resolution of turbulence through DES features Mesh should be fine in turbulent regions and coarse in other regions Question: When is the mesh fine enough? Answer: The FDES FDDES terms are larger than 1 Only known after simulation has been performed

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 5 / 23

slide-7
SLIDE 7

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Mesh refinement

Controlling mesh refinement

OpenFOAM refines the mesh based on a governing field Use a part of the FDES or FDDES term LDES = √ k CDESβ∗ω∆ LDDES = √ k CDESβ∗ω∆(1 − FS) Refine the mesh if this field lies in a specific region.

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 6 / 23

slide-8
SLIDE 8

Theory OpenFOAM implementation Airfoil simulation with mesh refinement k − ω SST DES for Refinement

Overview, Implementation procedure

Modification of the LES-class turbulence model k − ω SST SAS (Scale Adaptive Simulation) Remove the SAS features and add the DES features Go through implementation to make sure the terms that are kept are correctly implemented Add separate computation of the LDES or LDDES field to govern mesh refinement.

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 7 / 23

slide-9
SLIDE 9

Theory OpenFOAM implementation Airfoil simulation with mesh refinement k − ω SST DES for Refinement

Copying and compiling the new turbulence model

We will not have a look at the implementation of the new turbulence model, called kOmegaSSTDESRefine. Start by copying and compiling the turbulence model. Copy the supplied turbulence model into the user directory, go to the place where the downloaded files are situated cp -r --parents src/turbulenceModels/incompressible/\ LES/kOmegaSSTDESRefine/ $WM_PROJECT_USER_DIR/ cd $WM_PROJECT_USER_DIR/src/turbulenceModels/\ incompressible/LES/ If you have not got a Make/ directory, create one mkdir Make cd Make

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 8 / 23

slide-10
SLIDE 10

Theory OpenFOAM implementation Airfoil simulation with mesh refinement k − ω SST DES for Refinement

Copying and compiling the new turbulence model

Add two new files, called files and options, if you don’t already have them. gedit files gedit options In the file files, add the following kOmegaSSTDESRefine/kOmegaSSTDESRefine.C LIB = $(FOAM_USER_LIBBIN)/libmyIncompressibleLESModels

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 9 / 23

slide-11
SLIDE 11

Theory OpenFOAM implementation Airfoil simulation with mesh refinement k − ω SST DES for Refinement

Copying and compiling the new turbulence model

In the file options, add the following EXE_INC = \

  • I$(LIB_SRC)/turbulenceModels \
  • I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
  • I$(LIB_SRC)/turbulenceModels/LES/LESfilters/lnInclude \
  • I$(LIB_SRC)/transportModels \
  • I$(LIB_SRC)/finiteVolume/lnInclude \
  • I$(LIB_SRC)/meshTools/lnInclude \
  • I$(LIB_SRC)/turbulenceModels/incompressible/LES/lnInclude

LIB_LIBS = Compile the dynamic library for the turbulence model cd .. wmake libso

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 10 / 23

slide-12
SLIDE 12

Theory OpenFOAM implementation Airfoil simulation with mesh refinement k − ω SST DES for Refinement

Looking inside the new turbulence model

Now we will look inside the new turbulence model Look inside the file kOmegaSSTDESRefine.H gedit kOmegaSSTDESRefine/kOmegaSSTDESRefine.H Look inside the file kOmegaSSTDESRefine.C gedit kOmegaSSTDESRefine/kOmegaSSTDESRefine.C

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 11 / 23

slide-13
SLIDE 13

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Mesh refinement in OpenFOAM

Overview, Mesh refinement

Mesh needs to be a subclass to the class dynamicFvMesh In cases of mesh refinement, the sub class is called dynamicRefineFvMesh Dynamic meshes are handled by solvers named ...DyMFoam instead

  • f ...Foam

...DyMFoam-solvers does not automatically support all types of subclasses to dynamicFvMesh For incompressible, transient flow, the solver is called pimpleDyMFoam To specify the sub class that should be used, and how it should be used, a special dictionary called dynamicMeshDict is needed in the case directory

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 12 / 23

slide-14
SLIDE 14

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Mesh refinement in OpenFOAM

The pimpleDyMFoam solver

We will have a brief look at the pimpleDyMFoam solver to see how it handles dynamic meshes. It is located at $FOAM_APP/solvers/incompressible/pimpleFoam/pimpleDyMFoam/ The following important differences for mesh refinement exist between pimpleFoam.C and pimpleDyMFoam.C The inclusion of dynamicFvMesh.H Change from including createMesh.H to createDynamicFvMesh.H Change from including readTimeControls.H to readControls.H The operation mesh.update() is performed The inclusion of correctPhi.H under some circumstances

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 13 / 23

slide-15
SLIDE 15

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Mesh refinement in OpenFOAM

The refinement in mesh.update()

The function update() is defined differently depending on which type of dynamicFvMesh that is

  • used. For refinement it is defined

in $FOAM_SRC/dynamicFvMesh/\ dynamicRefineFvMesh/\ dynamicRefineFvMesh.C

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 14 / 23

slide-16
SLIDE 16

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Setting up and running the case

Overview, Airfoil simulation with refinement

We will only do the final part of applying mesh refinement to the simulation after the flow has developed The case is 2D to save time The airfoil is a NACA 4412 that is 1m long The fluid is air hitting the airfoil at 1m/s The mesh is far from perfect, which affect the result

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 15 / 23

slide-17
SLIDE 17

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Setting up and running the case

Copying the case files

Copy the case Airfoil4412 2D into the run directory, go to the place where the downloaded files are situated cp -r --parents Airfoil4412_2D/ $FOAM_RUN/ cd $FOAM_RUN/Airfoil4412_2D/ Create the mesh blockMesh

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 16 / 23

slide-18
SLIDE 18

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Setting up and running the case

Setting up the case to run with refinement

Enable mesh refinement by changing a parameter in constant/dynamicMeshDict "refineInterval 0" to "refineInterval 10" To avoid having to wait too long, change the write interval in system/controlDict "writeInterval 0.2" to "writeInterval 0.05" Also change the start time and end time in system/controlDict "startFrom startTime" to "startFrom latestTime" "endTime 3" to "endTime 3.05" Start simulation pimpleDyMFoam > logRefine &

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 17 / 23

slide-19
SLIDE 19

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Setting up and running the case

The case files

We will have a short look into some of the files necessary to run this case The dynamicMeshDict dictionary gedit constant/dynamicMeshDict The LESProperties dictionary gedit constant/LESProperties The fvSolution dictionary gedit system/fvSolution

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 18 / 23

slide-20
SLIDE 20

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Post processing

Results

Look at the results in paraFoam Note how the mesh refinement has been done Have a look at the field LDDES

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 19 / 23

slide-21
SLIDE 21

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Post processing

Results

Magnitude of velocity Pressure

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 20 / 23

slide-22
SLIDE 22

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Post processing

Results

Turbulent kinetic energy LDDES field

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 21 / 23

slide-23
SLIDE 23

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Post processing

Results

Mesh before refinement, t = 3 s Mesh after refinement, t = 3.05 s

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 22 / 23

slide-24
SLIDE 24

Theory OpenFOAM implementation Airfoil simulation with mesh refinement Post processing

The end

Any questions or thought are welcome Thank you all for you attention and participation

Daniel Lindblad k − ω SST DES with mesh refinement 2013-12-10,11 23 / 23