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 con-ditions;
• 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 (stream-function, 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.
top wall velocity U = 1
cavity width L= 2
cavity height H= 2
Reynolds number Re= 1000 andRe= 10000 fluid adimensional density rho= 1
fluid adimensional viscosity mu= 2/Re
Worksheet
Mesh generation • 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 Boundary conditions → 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
Solution method • steady state simulation at Re=1000 (mesh 4a,4b,4c), solve forV, P • steady state simulation at Re=10000 (mesh 4c,4d), solve forV, P → use of differencing scheme (UD,CD,MARS)
Results considerations over velocity field (velocity vectors and stream function con-tour 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.
Geometry and Results
Figure 1: Refined grid 40x40
Figure 2: Streamfunction plot: right, Re=1000; left, Re=10000 [Ref.3]
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]
Re10000: u and v velocity components along vertical and horizontal midlines
Reference values
u components along vertical midline
Re=1000 Re=10000 y u u 1.0 1.0 1.0 0.9532 0.65928 0.47221 0.9376 0.57492 0.47783 0.9218 0.51117 0.4807 0.9062 0.46604 0.47804 0.7032 0.33304 0.34635 0.4688 0.18719 0.20673 0.2344 0.05702 0.08344 0.0 -0.0608 0.03111 -0.0938 -0.10648 -0.0754 -0.4374 -0.27805 -0.23186 -0.6562 -0.38289 -0.32709 -0.7968 -0.2973 -0.38 -0.8594 -0.2222 -0.41657 -0.875 -0.20196 -0.42537 -0.8906 -0.18109 -0.42735 -1.0 0.0 0.0v components along horizontal midline
Re=1000 Re=10000 x v v 1.0 0.0 0.0 0.9376 -0.21388 -0.54302 0.9218 -0.27669 -0.52987 0.9062 -0.33714 -0.49099 0.8906 -0.39188 -0.45863 0.8126 -0.5155 -0.41496 0.7188 -0.42665 -0.36737 0.6094 -0.31966 -0.30719 0.0 0.02526 0.00831 -0.5312 0.32235 0.27224 -0.5468 0.33075 0.28003 -0.6874 0.37095 0.3507 -0.8124 0.32627 0.41487 -0.8438 0.30353 0.43124MACROS
!**************** ! 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
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
!**************** ! 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
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