Presentation slides for the course CFD with OpenSource Software...

28
Introduction: hpdc basics Generating the mesh Case setup Running the case Results Presentation slides for the course CFD with OpenSource Software 2015 Sebastian Kohlst¨ adt Applied Mechanics/Fluid Dynamics, Chalmers University of Technology, Gothenburg, Sweden 2015-12-08 Sebastian Kohlst¨ adt Modeling hpdc 2015-12-08 1 / 28

Transcript of Presentation slides for the course CFD with OpenSource Software...

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Presentation slidesfor the course

CFD with OpenSource Software 2015

Sebastian Kohlstadt

Applied Mechanics/Fluid Dynamics,Chalmers University of Technology,

Gothenburg, Sweden

2015-12-08

Sebastian Kohlstadt Modeling hpdc 2015-12-08 1 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Principal setup of a high-pressure die caster

What is high-pressure die casting?

clampingunit ejector unit tie bar

plunger

hydraulicaggregatefixed

plate

movingplate

casting unitlocking unit

Figure : The layout and components of a high-pressure die casting machineaccording to DIN 24480.Sebastian Kohlstadt Modeling hpdc 2015-12-08 2 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Three process phases of high-pressure die casting

The three phases in high-pressure die casting (1)

Figure : Phase one: pre-filling.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 3 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Three process phases of high-pressure die casting

The three phases in high-pressure die casting (2)

Figure : Phase two: die-filling.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 4 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Three process phases of high-pressure die casting

The three phases in high-pressure die casting (3)

Figure : Phase three: after-pressure.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 5 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Focus of tutorial: CFD in shot sleeve

The fluid mechanics processes in the shot sleeve

Figure : Impact of increasing plunger propagation. The velocity increases fromthe left to the right picture.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 6 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Overview

Ways to create mesh with open source software

blockMesh: included in openFOAM R©. Usable for very simple geometries.Somewhat spread in academia. Of limited usability forindustrial cases.

Salome: Salome comes along with meshing tools. They are quiteintuitively usable, however can not entirely compete withcommercial alternatives.

snappyHexMesh: included in openFOAM R©. Requires however some workwith the .stl file – mostly in additional pre-processingsoftware – in order to be appropriately usable.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 7 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Overview

Ways to create mesh with open source software – author’srecommendation

The author of this tutorial found out that for industrial applications withcomplex shapes the combination of pre-processing the (stl-) geometry inSalome and then applying snappyHexMesh is for the majority of cases thebest option. Unless the user has access to proprietary software such asANSA.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 8 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Salome tutorial

A brief tutorial in Salome

Open Salome, please!We will now create a geometry together!

Sebastian Kohlstadt Modeling hpdc 2015-12-08 9 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Generating the mesh for the tutorial

Envisioned geometry/mesh for the tutorial

The aim is to create a mesh like the one shown underneath for thetutorial. How would you proceed?

Sebastian Kohlstadt Modeling hpdc 2015-12-08 10 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Generating the mesh for the tutorial

Envisioned geometry/mesh for the tutorial

The author did it by using his self-developed template of theblockMeshDict for boxes. Some excerpts of it will be shown in thefollowing slides and beneath the text.

minXCor -30;

minYCor -30;

minZCor -300; //This is the first paragraph my

maxXCor 30; //blockMeshDict starts with

maxYCor 30; // I do convert the values to meters by 1e-3

maxZCor -20;

Sebastian Kohlstadt Modeling hpdc 2015-12-08 11 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Generating the mesh for the tutorial

How to create the geometry/mesh for the tutorial (1)

The vertices only use the priorly defined coordinates.

vertices

(

($minXCor $minYCor $minZCor)

($maxXCor $minYCor $minZCor)

($maxXCor $maxYCor $minZCor)

($minXCor $maxYCor $minZCor)

($minXCor $minYCor $maxZCor)

($maxXCor $minYCor $maxZCor)

($maxXCor $maxYCor $maxZCor)

($minXCor $maxYCor $maxZCor)

);

Sebastian Kohlstadt Modeling hpdc 2015-12-08 12 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Generating the mesh for the tutorial

How to create the geometry/mesh for the tutorial

The faces of the so created blocks can be easily assigned to the patchesbecause they were previously assigned to XY, XZ, YZ planes.

boundary

(

slipWalls

{

type wall;

faces

(

(3 7 6 2) //maxXZBlock0

(1 5 4 0) //minXZBlock0

);

}

Sebastian Kohlstadt Modeling hpdc 2015-12-08 13 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Generating the mesh for the tutorial

Envisioned geometry/mesh for the tutorial

The faces of the so created blocks can be easily assigned to the patchesbecause they were previously assigned to XY, XZ, YZ planes.

fixedWalls

{

type wall;

faces

(

(9 13 12 8) //minXZBlock1

(12 13 14 15) //maxXYBlock1

(16 19 18 17) //minXYBlock2

(20 21 22 23) //maxXYBlock2

);

The same is done for movingWalls, outlet and frontAndBack (emptypatches in 2D case).Sebastian Kohlstadt Modeling hpdc 2015-12-08 14 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Generating the mesh for the tutorial

Envisioned geometry/mesh for the tutorial

In the end the patches that form internal borders are stitched together.This is necessary because of point doubling.

mergePatchPairs

// Remember: This only works if in both cases the master box

// (the box to which the master patch belongs) stays the same.

(

(internalBorderBlock10 internalBorderBlock01)

(internalBorderBlock12 internalBorderBlock21)

);

Sebastian Kohlstadt Modeling hpdc 2015-12-08 15 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

How to make the mesh moving

Which solvers handle moving meshes?

Moving meshes in openFOAM R©

Solvers handling moving meshes are distinguished from solvers thatdo not by the expression DyM in their name, i.e.compressibleInterDyMFoamthey additionally require the dictionary dynamicMeshDict

this dictionary is located in$CASE_DIR/constant/dynamicMeshDict

the specialty of this DyM-solver family is that they inside call anothersolver that solves for mesh motionan additional library has to be included in dynamicMeshDict

the mesh solution can be looked at independently from the flowsolution by simply typing moveDynamicMesh into a terminal in thecase folderan example of the dynamicMesh I used will be given on the followingpages

Sebastian Kohlstadt Modeling hpdc 2015-12-08 16 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

How to make the mesh moving

The layout of the dynamicMeshDict

The example of the dynamicMeshDict I used. Particularly difficult tofigure out was the line that includes the motionSolverLibs asopenFOAM R©does not tell you it needs it and which options are available.

/*openFOAM header */

...

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ( "libfvMotionSolvers.so" );

solver velocityComponentLaplacian z;

velocityComponentLaplacianCoeffs

{

component z;

diffusivity directional ( 0 200 1 );

}

Sebastian Kohlstadt Modeling hpdc 2015-12-08 17 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

How to make the mesh moving

Available dynamicFvMesh types

Available dynamicMesh types in openFOAM R©You can see them byapplying the banana trick.

6

(

dynamicInkJetFvMesh

dynamicMotionSolverFvMesh

dynamicRefineFvMesh

multiSolidBodyMotionFvMesh

solidBodyMotionFvMesh

staticFvMesh

)

Sebastian Kohlstadt Modeling hpdc 2015-12-08 18 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

How to make the mesh moving

Selection the motion solver

What to do if the motion solver table is missing?

--> FOAM FATAL ERROR:

solver table is empty

From function motionSolver::New(const polyMesh& mesh)

in file motionSolver/motionSolver/motionSolver.C at line 116.

FOAM exiting

You are probably missing the line

motionSolverLibs ( "libfvMotionSolvers.so" );

inside your dynamicMeshDict.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 19 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

How to make the mesh moving

Available solvers from the libfvMotionSolvers.so library

Which solvers can you select?

Valid solver types are:

7

(

displacementComponentLaplacian

displacementInterpolation

displacementLaplacian

displacementLayeredMotion

displacementSBRStress

velocityComponentLaplacian

velocityLaplacian

)

Sebastian Kohlstadt Modeling hpdc 2015-12-08 20 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Mesh motion

Running the mesh motion

For only calculating the mesh motion one has to type

blockMesh > log.blockMesh

moveDynamicMesh > log.moveDynamicMesh &

paraFoam

to a terminal window in which the case directory is selected.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 21 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

CFD solution

Computing the flow

The commands for running the case are fairly similar to all otheropenFOAM R©cases. One opens a terminal sources the bashrc andnavigates to the case directory. Typing

blockMesh > log.blockMesh

cp 0/alpha.melt.org 0/alpha.melt

setFields > log.setFields

compressibleInterDyMFoam > log.compressibleInterDyMFoam &

paraFoam

will run the case. The results can then be viewed paraFoam.

Sebastian Kohlstadt Modeling hpdc 2015-12-08 22 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Mesh motion

Results from moveDynamicMesh (1)

Something like this should appear in ParaView after you executed thecommand moveDynamicMesh in the tutorial’s case folder.

At t = 0

Sebastian Kohlstadt Modeling hpdc 2015-12-08 23 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Mesh motion

Results from moveDynamicMesh (2)

Something like this should appear in ParaView after you executed thecommand moveDynamicMesh in the tutorial’s case folder.

At t = 0.125

Sebastian Kohlstadt Modeling hpdc 2015-12-08 24 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

Mesh motion

Results from moveDynamicMesh (3)

Something like this should appear in ParaView after you executed thecommand moveDynamicMesh in the tutorial’s case folder.

At t = 0.25

Sebastian Kohlstadt Modeling hpdc 2015-12-08 25 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

CFD solution

Results from compressibleInterDyMFoam (1)

Something like this should appear in ParaView after you executed thecommands as stated above in the tutorial’s case folder.

At t = 0

Sebastian Kohlstadt Modeling hpdc 2015-12-08 26 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

CFD solution

Results from compressibleInterDyMFoam (2)

Something like this should appear in ParaView after you executed thecommands as stated above in the tutorial’s case folder.

At t = 0.125

Sebastian Kohlstadt Modeling hpdc 2015-12-08 27 / 28

Introduction: hpdc basics Generating the mesh Case setup Running the case Results

CFD solution

Results from compressibleInterDyMFoam (3)

Something like this should appear in ParaView after you executed thecommands as stated above in the tutorial’s case folder.

At t = 0.25Sebastian Kohlstadt Modeling hpdc 2015-12-08 28 / 28