In this example we are going to use t3.geo
, which we will edit slightly to obtain t3a.geo
and t3b.geo
.
All alterations are mentioned below the sample code:
t3a.geo
Include "t1.geo";
h = 0.1;
Extrude {0,0,h} {
Surface{1}; Layers{h/(lc*2)}; Recombine;
}
Extrude { {0,1,0} , {-0.1,0,0.1} , -Pi/2 } {
Surface{26}; Layers{9}; Recombine;
}
DefineConstant[ angle = {180, Min 0, Max 180, Step 1,
Name "Parameters/Twisting angle"} ];
out[] = Extrude { {-6*h,0,0}, {1,0,0} , {0,0.15,0.25} , angle * Pi / 180 } {
Surface{news-1}; Layers{6*h/(lc*2)}; Recombine;
};
Geometry.PointNumbers = 1;
Geometry.Color.Points = Orange;
General.Color.Text = White;
Mesh.Color.Points = {255,0,0};
Geometry.Color.Surfaces = Geometry.Color.Points;
/* * * * * * * * * * * *
* Dolfyn added lines: *
* * * * * * * * * * * */
// For decent outlet we need to extrude once again...
Extrude {-4*h,0,0} {
Surface{news-1}; Layers{4*h/(lc*2)}; Recombine;
}
// Boundaries (non-default)
Physical Volume("Fluid") = {1, 2, 3, 4};
Physical Surface("S1") = {1};
Physical Surface("S2") = {92};
Note
We edited the following (line numbers according to original document):
- line 22 – We define the extrude differently than the original file, using only 1 layer with subdivisions based on the characteristic length. Also we add the
Recombine
command to have the mesh produce prisms. - line 31 – We define 9 layers in the extrude
- line 40 – You could remove this definition entirely, but we chose to set the variable to and increase the range to 180 degrees
- line 43 – We define the extrude to translate
-6h
- line 44 – Changed the surface number to news-1, which returns the last created surface
- line 44 – The number of subdivisions is again based on the characteristic length
- Commented out lines:
- line 55 – custom Physical Volume created later
- Added lines (important!):
- line 80-88 – added an extrude to obtain a decent outlet
- line 89-94 – defined a new Physical Volume and Physical Surfaces for an In- and Outlet.
Visually the model will look like this:
Now we will also make t3b.geo
, which is exaclty the same, except for the Recombine
command.
t3b.geo
Note
We removed the Recombine
commands on lines:
- line 22
- line 31
- line 44
- line 87
Visually, nothing has changed, but in the next step, we will see that the mesh will be different.
Lastly, we want to briefly talk about the t3ad.din
and t3bd.din
files.
> See the DINGuide (on the Downloads page) for reference.
t3d.din
title Test Gmsh t3.geo model
steps 200 1.e-3
density 1.2
vislam 20.e-6
opendx off
use gmsh fluid
relax 0.5 0.15 0.5
turbulence ke 0.01
init,field,0.0 0.0 0.0,,1.e-4,1e-4
scheme UVW LUX 0.8
scheme KEPS LUD 0.8
slope UVW vnf
slope P vnf
slope KEPS vnf
#post p vert
#post k vert
#post k cell
#post eps cell
#post vis cell
boundary,0
wall
noslip
0.0 0.0 0.0
adiabatic
boundary,S1
inlet
0.0 0.0 0.1
1.2
293
inle
0.05 0.01
boundary,S2
outlet
1.0
File t3ad.din
and t3bd.din
are exact copies of the file above. The reason will be to show the difference in mesh choice in the output.
Again use gmsh fluid
is used (line 8), to produce a full *.msh
file, but ommitting the results on the boudaries.