1. Lid driven flow in a cavity

Transcript

1. Lid driven flow in a cavity
CERN Intensive Course on CFD
27th, February 2007
Hands on computer session:
1. Lid driven flow in a cavity
[Time: 1 h 30’]
Objects
• choice of computational domain, problem adimensionalization and definition of boundary conditions;
• influence of the mesh refinement (uniform mesh vs. near wall refined mesh, increasingly refined
meshes);
• evaluation of different discretization schemes: accurancy and dissipative effects;
• identification of reference data, calculation of quantities to verify simulation accuracy (streamfunction, velocity profiles along vertical and horizontal midlines);
• Richardson extrapolation as a discretization error extimator.
Physical problem
A square cavity filled with flow; the top wall moves with a uniform velocity U:
• isothermal laminar incompressible problem;
• primary central vortex and secondary vortices at the corners;
• complex flow patterns at increasing Reynolds number;
• stability bounds for Central Difference Scheme.
Centro Interdipartimentale di Fluidodinamica e Idraulica
1
CERN Intensive Course on CFD
27th, February 2007
Non dimensional data
top wall velocity
cavity width
cavity height
Reynolds number
fluid adimensional density
fluid adimensional viscosity
U =1
L=2
H=2
Re = 1000 and Re = 10000
rho = 1
mu = 2/Re
Worksheet
Mesh generation
Boundary conditions
Solution method
Results
• mesh.4a: uniform mesh 20x20x1 cells;
• mesh.4b: near wall refined mesh 20x20x1 cells;
• mesh.4c: near wall refined mesh 40x40x1 cells;
• mesh.4d: near wall refined mesh 80x80x1 cells;
→ create a subdomain (a quarter domain) with block structure grid
→ create near wall refinement (uniform space factor)
→ use CGEN-REFLECT to replicate subdomain regions
→ use symmetry B.C. to set up a bidimensional simulation
→ use Wall B.C.(slip option) at the top wall
→ use Wall B.C.(no-slip option) at the bottom and side walls
• steady state simulation at Re=1000 (mesh 4a,4b,4c), solve for V , P
• steady state simulation at Re=10000 (mesh 4c,4d), solve for V , P
→ use of differencing scheme (UD,CD,MARS)
considerations over velocity field (velocity vectors and stream function contour plots)
extraction of u and v velocity component profiles along the vertical and the
horizontal midlines
comparison to the literature results
Richardson extrapolation
References
Ghia, U., Ghia, K. N., and Shin C.T., (1982), “High-Re solutions for incompressible flows using the
Navier-Stokes equations and a multigrid method”, J.Comput.Phys , 48, 387-411.
Shon, J.L., (1988), “Evaluation of FIDAP on some classical laminar and turbolent bench-marks”,
Int. J. Numer. Meth. Fluids, 8, 1469-1490.
Nonino, C., and Croce, G., (1997), “An equal-order velocity-pressure algorithm for incompressible
thermal flows, part 2: validation”, Numer. Heat Transfer, 32, 17-35.
Centro Interdipartimentale di Fluidodinamica e Idraulica
2
CERN Intensive Course on CFD
27th, February 2007
Geometry and Results
Figure 1: Refined grid 40x40
Figure 2: Streamfunction plot: right, Re=1000; left, Re=10000 [Ref.3]
Figure 3: Streamfunction plot: right, Re=1000 (CDS); left, Re=10000 (MARS)
Centro Interdipartimentale di Fluidodinamica e Idraulica
3
CERN Intensive Course on CFD
27th, February 2007
Re1000: u and v velocity components along vertical and horizontal midlines
Figure 4: mesh with 20x20 cells: left,uniform mesh; right: near wall refined mesh.Square[Ref.3]
Figure 5: Left: mesh with 20x20 cells; right: mesh comparison.Square[Ref.3].
Centro Interdipartimentale di Fluidodinamica e Idraulica
4
CERN Intensive Course on CFD
27th, February 2007
Re10000: u and v velocity components along vertical and horizontal midlines
Figure 6: Meshes and discretization schemes comparison.Square[Ref.3].
Centro Interdipartimentale di Fluidodinamica e Idraulica
5
CERN Intensive Course on CFD
27th, February 2007
Reference values
u components along vertical midline
y
1.0
0.9532
0.9376
0.9218
0.9062
0.7032
0.4688
0.2344
0.0
-0.0938
-0.4374
-0.6562
-0.7968
-0.8594
-0.875
-0.8906
-1.0
Re=1000
u
1.0
0.65928
0.57492
0.51117
0.46604
0.33304
0.18719
0.05702
-0.0608
-0.10648
-0.27805
-0.38289
-0.2973
-0.2222
-0.20196
-0.18109
0.0
Re=10000
u
1.0
0.47221
0.47783
0.4807
0.47804
0.34635
0.20673
0.08344
0.03111
-0.0754
-0.23186
-0.32709
-0.38
-0.41657
-0.42537
-0.42735
0.0
v components along horizontal midline
x
1.0
0.9376
0.9218
0.9062
0.8906
0.8126
0.7188
0.6094
0.0
-0.5312
-0.5468
-0.6874
-0.8124
-0.8438
-0.8594
-0.875
-1
Re=1000
v
0.0
-0.21388
-0.27669
-0.33714
-0.39188
-0.5155
-0.42665
-0.31966
0.02526
0.32235
0.33075
0.37095
0.32627
0.30353
0.29012
0.27485
0.0
Re=10000
v
0.0
-0.54302
-0.52987
-0.49099
-0.45863
-0.41496
-0.36737
-0.30719
0.00831
0.27224
0.28003
0.3507
0.41487
0.43124
0.43733
0.43983
0.0
Centro Interdipartimentale di Fluidodinamica e Idraulica
6
CERN Intensive Course on CFD
27th, February 2007
MACROS
!****************
! Geometry.MAC *
!****************
!——————————————————
!*** complete mesh generation by symmetry along x and y
!——————————————————
get vmax mxve
cset all
cgen,2,vmax,cset,cset,1,vref,1,2
cset all
cplot
get vmaxnew mxve
cgen,2,vmaxnew,cset,cset,1,vref,1,1
cset all
cplot
vmer all
vcomp all
ccomp all
cset all
cdirection,1,0,1,1,1
restructure,50000,,default, $y
vset news vran 0,49000,1
vcomp all $y
cset all
cplot
!****************
!Umidplane-x0-GU.MAC *
!****************
!————————————————————————————————–
!*** y coordinate and u velocity component extraction on vertical midline to screen and to file.usr
!————————————————————————————————–
vset all
vset subset gran -0.0001 0.0001,,, -0.01 0.01
greset
y
getv, None ,SU
gpost,vset,,,next
frame,1,xreg,init,4
frame,1,xtitle,4.3,1.5
Y LOCATION
frame,1,yreg,init,9
frame,1,ytitle,0.5,5.5
SU
term,,X
gdraw,1
rlabel,9,on
SU
Centro Interdipartimentale di Fluidodinamica e Idraulica
7
CERN Intensive Course on CFD
27th, February 2007
lint,9,9,3,1
symt,9,9,8,1
$rtab,9,y,y
bart,9,9,90,1
gredraw
oper,getv,x,1,1
oper,getv,y,1,2
oper,getv,z,1,3
oper,getv,su,4
savu,file.usr,both,user,vset
I9,6X,4G16.9
close file.usr
!****************
! Vmidplane-y0-GU.MAC *
!****************
!————————————————————————————————–
!*** x coordinate and v velocity component extraction on horizontal midline to screen and to file.usr
!————————————————————————————————–
vset all
vset subset gran ,,, -0.0001 0.0001 -0.01 0.01
greset
y
getv, None ,SV
gpost,vset,,,next
frame,1,xreg,init,3
frame,1,xtitle,4.3,1.5
X LOCATION
frame,1,yreg,init,9
frame,1,ytitle,0.5,5.5
SV
term,,X
gdraw,1
rlabel,9,on
SV
lint,9,9,3,1
symt,9,9,8,1
$rtab,9,y,y
bart,9,9,90,1
gredraw
oper,getv,x,1,1
oper,getv,y,1,2
oper,getv,z,1,3
oper,getv,sv,4
savu,file.usr,both,user,vset
I9,6X,4G16.9
close file.usr
Centro Interdipartimentale di Fluidodinamica e Idraulica
8
CERN Intensive Course on CFD
27th, February 2007
!****************
! U-V-midplane.MAC *
!****************
!———————————————————————
!*** comparison of u and v velocity profile from different file.pst
!———————————————————————load exe4-UD.pst
greset
y
vset all
vset subset gran -0.0001 0.0001,,, -0.01 0.01
greset
y
numreg,100
getv, None ,SU
gpost,vset,,,1
sens dele all
vset all
vset subset gran ,,, -0.0001 0.0001 -0.01 0.01
getv, None ,SV
gpost,vset,,,12
frame,1,xreg,init,14,9
frame,1,yreg,init,20,4
frame,1,xrange,-1,1
frame,1,xtitle,4.94,1.6
U
frame,1,yrange,-1,1
frame,1,ytitle,0.71,5.51
V
rlabel,20,on
SV
lint,20,11,3,1
symt,20,20,8,1
$rtab,20,y,n
bart,20,20,90,1
rlabel,4,on
Y LOCATION
lint,4,4,3,1
symt,4,4,8,1
$rtab,4,y,n
bart,4,4,90,1
term,,x
gdraw,1
load exe4MARS.pst
vset all
vset subset gran -0.0001 0.0001,,, -0.01 0.01
getv, None ,SU
gpost,vset,,,24
sens dele all
vset all
vset subset gran ,,, -0.0001 0.0001 -0.01 0.01
getv, None ,SV
Centro Interdipartimentale di Fluidodinamica e Idraulica
9
CERN Intensive Course on CFD
27th, February 2007
gpost,vset,,,36
frame,1,xreg,init,38,32,14,9
frame,1,yreg,init,44,27,20,4
frame,1,xrange,-1,1
frame,1,xtitle,4.94,1.6
U
frame,1,yrange,-1,1
frame,1,ytitle,0.71,5.51
V
rlabel,44,on
SV
lint,44,3,3,1
symt,44,44,8,1
$rtab,44,y,n
bart,44,44,90,1
rlabel,27,on
Y LOCATION
lint,27,27,3,1
symt,27,27,8,1
$rtab,27,y,n
bart,27,27,90,1
term,,x
gdraw,1
Centro Interdipartimentale di Fluidodinamica e Idraulica
10