KozCG: Slotted cylinder
This example uses KozCG in Inciter to compute a solid-body rotation problem. Such tests are frequently used to evaluate and compare numerical schemes for convection-dominated problems.
Here we evaluate the numerical method using Zalesak's slotted cylinder problem [1], augmented by Leveque [2] in order to examine the resolution of both smooth and discontinuous profiles.
Equations solved
In this example we numerically solve the linear advection equation coupled to the Euler equations, see also KozCG. as
where the summation convention on repeated indices has been applied, is the density, is the velocity vector, is the specific total energy, is the specific internal energy, and is the pressure. , , , and are source terms that arise from the application of the method of manufactured solutions, used for verification only; these source terms are zero when computing practical engineering problems. The system is closed with the ideal gas law equation of state
where is the ratio of specific heats.
Problem setup
The inital configuration for the scalar field, c, is depicted in the figure below.
While this is a 2D test problem, we calculate it on a 3D domain with the extents {0,1,0} x {0,1,0.05}, Since we are only interested in the evolution of the scalar, we prescribe the source terms that yield a stationary flow with a prescribed rotational velocity field ui = { 1/2 - y, x - 1/2, 0 } as
Each solid body lies within a radius r0 = 0.15 centered at a point {x0,y0,0}. In the rest of the domain the solution is initially zero. The shapes of the three bodies can be expressed in terms of the normalized distance function for the respective reference point {x0,y0,0}
The center of the slotted cylinder is located at {x0,y0,0} = {0.5,0.75,0} and its geometry is given by
The corresponding analytical expression for the conical body is
while the shape and location of the hump reads
The initial conditions are sampled from the analytic solutions above. We set inhomogeneous Dirichlet boundary conditions for the flow variables on all sides of the domain, sampling their analytic solutions. For the scalar, homogeneous Dirichlet conditions are set on those sides with normals in the x and y directions.
Code revision to reproduce
To reproduce the results below, use code revision 30fd9ff and the control file below.
Control file
# vim: filetype=lua: print "Scalar transport: slotted cylinder, cone, hump" term = math.pi ttyi = 100 cfl = 0.09 solver = "kozcg" part = "rcb" problem = { name = "slot_cyl" } freezeflow = 3.0 freezetime = 0.0 mat = { spec_heat_ratio = 5/3 } bc_dir = { { 1, 1, 1, 1, 1, 1, 1 }, { 2, 1, 1, 1, 1, 1, 1 }, { 3, 1, 1, 1, 1, 1, 1 }, { 4, 1, 1, 1, 1, 1, 0 }, { 5, 1, 1, 1, 1, 1, 1 }, { 6, 1, 1, 1, 1, 1, 0 } } fieldout = { iter = 1000 } diag = { iter = 10, format = "scientific", precision = 12 }
Run using on 32 CPUs
./charmrun +p32 Main/inciter -i unitsquare_01_1.9M.exo -c slot_cyl.q
Visualization
ParaView can be used for interactive visualization of the numerically computed fields as
paraview out.e-s.0.32.0
Results
The scalar field after half revolution is depicted below with several line-outs at various locations so the solution can be compared to the analytic solution.
References
- S.T. Zalesak, Fully multidimensional flux-corrected transport algorithms for fluids, J. Comput. Phys. 31,3, p.335-362, 1979.
- R.J. Leveque, High-resolution conservative algorithms for advection in incompressible flow, SIAM J. on Numerical Analysis, 33, p.627-665 1996.