Upload
vuminh
View
275
Download
2
Embed Size (px)
Citation preview
8/20/2012
1
PATC FEM – GMSH-GUI-VTU example
Cooling of steel block by periodic
pipes
A walk-through demonstration
8/20/2012
2
Work Flow
GMSH
VTU
Work Flow
Pre-processing Create a bottom-up geometry in GMSH
Meshing in GMSH
Use ElmerGrid to create Elmer mesh
Set-up Importing mesh into ElmerGUI
Defining the case/project
Run
Post-processing Using ElmerPost
Adding Result Output Solver to export VTU for ParaView
8/20/2012
3
Pre-Processing: GMSH
Create a new sub-directory: mkdir name
Change into this directory: cd name
Launch GMSH: gmsh periodic.geo Elementary entities
Add
New
Point
Pre-Processing: GMSH
8/20/2012
4
Pre-Processing: GMSH
Start with point (0,0,0)
Prescribed mesh element
size at point: 0.1 (see
previous slide)
Add points:
(0,1,0), (1,1,0) and (1,0,0)
Straight Line
– Klick on two adjacent points
– 4 times to create a closed
square
Add further two Points:
(0.5,0.5,0) and (0.5,0.7,0)
Pre-Processing: GMSH
Circle Arc
Select the upper middle
point as start point
Select the middle point as
centre point
Select again the upper
middle point as end point
If you get a red warning in
the communication window:
ignore it
8/20/2012
5
Pre-Processing: GMSH
Plane surface
Select all 4 straight lines by
clicking on them
Select circle as the hole
boundary
Finally, press e
Pre-Processing: GMSH
Plane surface
Select circle
Finally, press e
8/20/2012
6
Pre-Processing: GMSH
Geometry (click into
blue array)
Elementary entities
Extrude
Surface
Set 1 for Z
component
Click on both
surfaces (cross lines
should turn red)
Finally, press e
// the square
Point(1) = {0, 0, 0, 0.1};
Point(2) = {0, 1, 0, 0.1};
Point(3) = {1, 1, 0, 0.1};
Point(4) = {1, 0, 0, 0.1};
Line(1) = {1, 4};
Line(2) = {4, 3};
Line(3) = {3, 2};
Line(4) = {2, 1};
// the circle in the centre
Point(5) = {0.5, 0.5, 0, 0.1};
Point(6) = {0.5, 0.7, 0, 0.1};
Circle(5) = {6, 5, 6};
// creating the surfaces
Line Loop(6) = {2, 3, 4, 1};
Line Loop(7) = {5};
Plane Surface(8) = {6, 7};
Plane Surface(9) = {7};
//extruding them
Extrude {0, 0, 1} {
Surface{9, 8}; Layers{10};
}
Pre-Processing: GMSH
Before continuing, open the
file periodic.geo using a
text editor (emacs)
Add Layers{10}; to the
extrusion command line
Save and close
Re-open in GMSH by
clicking on
Geometry
Reload NB: the comment lines in the example right won’t
show in your case
8/20/2012
7
Pre-Processing: GMSH
Mesh
3D
The mesh should
appear after a
while
A summary of the
meshing procedure
is reported in the
text window
Pre-Processing: GMSH
Geometry
Physical Groups
Add
Volumes
Click on the part in the middle
(pipe; should turn red)
Press e
Click on the outer part (block;
should turn red)
Press e
Now, do yourself a favor and
reload the case once again
(to get rid of the mesh)
8/20/2012
8
Pre-Processing: GMSH
Geometry
Physical Groups
Add
Surface
Click in the
annotated order on
the boundaries
(always one at a
time) and press e 1. Inflow
2. Outflow
3. Block at inflow
4. Block at outflow
5. Pipe wall
6. - 9. Block sides
2
1
4
5
3
6
7
9
8
Pre-Processing: GMSH
Sorry, but once
again now:
Mesh
3D
The mesh should
appear after a
while
A summary of the
meshing procedure
is reported in the
text window
Save the mesh
In your terminal:
ElmerGrid 14 2 periodic.msh -autoclean
8/20/2012
9
Pre-Processing: GMSH ElmerGrid 14 3 periodic.msh –autoclean
ElmerPost :File →Open periodic.ep
Edit →Grouping
Pre-Processing: Simulation set-up
Body 1 (pipe): oil
Body 2 (block): steel
BC’s: 1 Inflow: pext = -0.1
2 Outflow
3+4 adiabatic
5 pipe wall (no slip)
6 →7 periodic
8 fixed temperature T = 30 C
9 fixed heat flux q=200 W/m2
104.49
8/20/2012
10
Pre-Processing: ElmerGUI
Launch
ElmerGUI in terminal:
ElmerGUI
File
Load mesh
periodic
Pre-Processing: ElmerGUI
Model
Setup…
Just press
Apply
8/20/2012
11
Pre-Processing: ElmerGUI
To identify the
body number:
– View
– Numbering
– Body Index
To hide of
certain surface:
– Double click on
surface
– Surface turns
red
– Press Ctrl + H
Pre-Processing: ElmerGUI
Model
Equation
Go to tab Heat Equation
– Toggle Active
– Priority:1
– Toggle Body 1
Edit Solver Setting
– General: Toggle Stabilize
– Nonlinear System: Max.
iterations 1
– Apply
8/20/2012
12
Pre-Processing: ElmerGUI
Go to tab Navier Stokes
– Toggle Active
– Priority:2
Edit Solver Setting
– General: Toggle Stabilize
– Apply
To open a new equation:
– Add
– New (new window for
Equation 2 opens)
– OK (in the previous window
to close it)
Pre-Processing: ElmerGUI
All setting for Solvers
remain, but we have to
take off the Navier Stokes
solver
Go to tab Navier Stokes
– Toggle off Active
8/20/2012
13
Pre-Processing: ElmerGUI
Model
Material
– Toggle Body 1
Material Library
– Choose Oil, olive
– Apply (library window
closes)
– Add
– New (new window opens)
– OK (close old window)
Similar for second:
– Toggle Body 2
– Material library: Steel
– Apply
– OK (close old window)
Pre-Processing: ElmerGUI
To identify the
body number:
– View
– Numbering
– Boundary Index
8/20/2012
14
Pre-Processing: ElmerGUI
Model
Boundary Condition Add
– Name: inflow
Go to tab General
– Toggle Boundary 1
– Velocity 1 and 2: 0
– External Pressure: -0.1
Go to tab Heat Equation
– Temperature: 10
OK
Pre-Processing: ElmerGUI
Model
Boundary Condition Add
Go to tab Navier Stokes
– Toggle Boundary 2
– Toggle Use normal-tangential …
– Velocity 2 and 3: 0 (only normal
outflow)
– Name: outflow
OK
8/20/2012
15
Pre-Processing: ElmerGUI
Model
Boundary Condition Add
– Name: Adiabatic walls
Go to tab General
– Toggle Boundary 3 and 4
(collecting the two
boundaries into one)
OK
Pre-Processing: ElmerGUI
Model
Boundary Condition Add
– Name: periodic target
Go to tab General
– Toggle Boundary 6
– Periodic Boundary ID 7
(links variable values
of boundary 6 to
boundary 7)
OK
8/20/2012
16
Pre-Processing: ElmerGUI
Model
Boundary Condition Add
– Name: periodic source
– Toggle Boundary 7
OK
Pre-Processing: ElmerGUI
Model
Boundary Condition Add
– Name: Fixed Temperature
Go to tab Heat Equation
– Toggle Boundary 8
– Temperature: 30
OK
8/20/2012
17
Pre-Processing: ElmerGUI
Model
Boundary Condition Add
– Name: Fixed Heat Flux
Go to tab Heat Equation
– Toggle Boundary 9
– Heat Flux: 200.0
OK
Pre-Processing: ElmerGUI
That’s it! Only almost, though.
Sif
Generate
Save Current Project:
– You can make a new directory by clicking on Create Folder
– Open
Save the files:
Once again, save Current Project:
– Open
OK
8/20/2012
18
Run
Run the case:
– Either Run→start solver or
– The symbol then will change color
– A log window will occur
– And a convergence graph
– Ready, when
Post-processing
Two post processors:
1. Internal VTK based:
Run →
Postprocessor (VTK)
2. Externally linked
ElmerPost (legacy
postprocessor of
Elmer): – Either Run → Start
postprocessor or
– Changes color if
active
8/20/2012
19
Post-processing
We want to use external
postprocessor ParaView
To that end, we add another
solver to both, Equation 1
and 2
Model
Equation: Equation 1
Change to tab Result output
– Toggle Active
– Toggle Body 1
– Edit Solver Settings
Post-processing
Change to tab General:
– Toggle After Simulation
Change to tab Solver
Specific options:
– Output Format: Vtu
– Toggle Binary Output
– Toggle Save Geometry Ids
– Output File Name: caseVTU
– Scalar Field 1: Temperature
– Vector Field 1: Velocity
– Apply
Redo the whole saving
procedure
– Sif, Generate, ,
– Re-run:
8/20/2012
20
Post-processing
Launch ParaView in your terminal: paraview – File, Open: choose casevtu0001.vtu