In this example we are going to use t4.geo
, which we will edit slightly.
All alterations are mentioned below the sample code:
t4.geo
// until here, no changes
Curve Loop(21) = {17,-15,18,19,-20,16};
// Plane Surface(22) = {21};
Curve Loop(23) = {11,-12,13,14,1,2,-3,4,5,6,7,-8,9,10};
Plane Surface(24) = {23,21};
Recombine Surface{24};
View "comments" {
T2(10, -10, 0) { StrCat("Created on ", Today, " - www.dolfyn.net") };
T3(0, 0.11, 0, TextAttributes("Align", "Center", "Font", "Helvetica")){ "Hole" };
// T3(0, 0.09, 0, TextAttributes("Align", "Center")){ "file://image.png@0.01x0" };
// T3(-0.01, 0.09, 0, 0){ "file://image.png@0.01x0,0,0,1,0,1,0" };
// T3(0, 0.12, 0, TextAttributes("Align", "Center")){ "file://image.png@0.01x0#" };
// T2(350, -7, 0){ "file://image.png@20x0" };
};
View[0].DoubleClickedCommand = "Printf('View[0] has been double-clicked!');";
Geometry.DoubleClickedLineCommand = "Printf('Curve %g has been double-clicked!',
Geometry.DoubleClickedEntityTag);";
Color Grey50{ Surface{ 22 }; }
Color Purple{ Surface{ 24 }; }
Color Red{ Curve{ 1:14 }; }
Color Yellow{ Curve{ 15:20 }; }
/* * * * * * * * * * * *
* Dolfyn added lines: *
* * * * * * * * * * * */
// Making a volume
Extrude {0,0,0.005} {Surface{24}; Layers{1}; Recombine; }
// Boundaries (non-default)
Physical Volume("Fluid") = {1};
Physical Surface("Swall") = {57,53,49,101,97,93,89,81,77,73,69,65};
Physical Surface("SwallHole") = {121,125,105,109,113,117};
Physical Surface("Sin") = {61};
Physical Surface("Sout") = {85};
Physical Surface("Ssym1") = {24};
Physical Surface("Ssym2") = {126};
Note
We edited the following (line numbers according to original document):
- line 66 – We don’t need this surface. We’ll define it when the hole is defined
- line 73 – Recombine the created surface to generate a different mesh
- Commented out lines:
- line 94, 98, 102, 105 – inserting pictures is not important
- Added lines (important!):
- line 121-127 – Added an extrude to create a volume
- line 128-136 – defined a new Physical Volume and Physical Surfaces for an In- and Outlet.
Visually the model will look like this:
Lastly, the t4d.din
file.
> See the DINGuide (on the Downloads page) for reference.
t4d.din
title Test Gmsh t4.geo model
#restart init
steps 600 1.e-4
output, every, 5
set T0 273.0
set T1 $T0 + 10.0
set T2 $T0 + 20.0
limit t lower $T0
limit t upper $T2
opendx off
use gmsh fluid
use vtk
#aluminium
density,2.7
conductivity,237
vislam 20.e-6
transient, 0.01
relax 0.7 0.3 0.7
#turbulence ke 0.001
thermal on
init,field,0.0 0.0 0.0,,1.e-4,1.e-4,$T0
init steps 0
gravity 0 0 0
scheme UVW LUX 0.8
scheme KEPS LUD 0.8
scheme T LUD 0.9
slope UVW vnf
slope P vnf
slope KEPS vnf
#post p vert
#post k vert
#post k cell
#post eps cell
#post vis cell
post T cell
post T vert
boundary,swall
wall
noslip
0.0 0.0 0.0
adiabatic
boundary,swallhole
wall
noslip
0.0 0.0 0.0
adiabatic
boundary,sin
wall
noslip
0.0 0.0 0.0
fixed
$T1 0.0
boundary,sout
wall
noslip
0.0 0.0 0.0
fixed
$T2 0.0
boundary,ssym1
symp
boundary,ssym2
symp
Again use gmsh fluid
is used (line 8), to produce a full *.msh
file, but ommitting the results on the boudaries.
Moreover, this time we added 2 symmetry planes.