V&V » ZalCG: Square cavity

This example uses ZalCG in Inciter to a perform a numerical study of the interaction of a planar shock wave with a square cavity. The computed numerical results are compared to the experimental data published in [1].

Shock wave diffractions arise in a number of practical applications. An example is internal combustion engines, where inflow/outflow valves are periodically opened and shut in a dynamic fashion, giving rise to waves, which then interact with the cylinder walls. Another example is building vulnerability assessments to air blasts. Important engineering features predicted from such simulations are wave structures and the resulting pressure-load time-histories in various locations of the complex geometries of the simulation domains. Such time-dependent problems test the ability of numerical methods for compressible flows to accurately propagate waves at distances as well as the accuracy of complex wave interaction patterns.

Problem setup

The problem setup is illustrated in the following figure:

Image

A planar shock wave is created by two disparate states separated by a diaphragm. Removing the diaphragm at time t=0 produces a shock wave, moving toward the square cavity which produces an elaborate interaction with shocks reflected from the cavity walls. The initial state at t=0 correspond to Ms=1.3 in [1] as

\[ \begin{aligned} \rho_2 & = 1.689\times 10^{-3}\;\text{g}/\text{cm}^3 & \rho_0 & = 1.1155\times 10^{-3}\;\text{g}/\text{cm}^3 \\ p_2 & = 1.753 \times 10^{-6}\;\text{Mbar} & p_0 & = 0.97 \times 10^{-6}\;\text{Mbar}\\ u_2 & = 0.01544 \;\text{cm}/\mu\text{s} & u_0 & = 0 \;\text{cm}/\mu\text{s} \end{aligned} \]

Since the problem is 2D, the computational domain consists of a single cell in the z direction. Characteristic boundary conditions are applied at the left side of State 2 and symmetry (free-slip) conditions are set at walls. The numerical simulations are also instrumented to record time histories of the pressure in time at the 3 gauge locations depicted in the figure above.

Code revision to reproduce

To reproduce the results below, use code revision 7b4edaf and the control file below.

Control file

-- vim: filetype=lua:

print "Square cavity"
print [[Igra, Falcovitz, Reichenbach, Heilig, 'Experimental and
        numerical study of the interaction between a planar shock
        wave and a square cavity', Journal of Fluid Mechanics, 313,
        105-130, 1996.]]

term = 200.0
ttyi = 100
cfl = 0.9

solver = "zalcg"
fctclip = true

part = "rcb"

mat = { spec_heat_ratio = 1.407 }

ic = { -- bg: state 2
  density = 1.689e-3,
  pressure = 1.753e-6,
  velocity = { 0.01544, 0.0, 0.0 },
  boxes = { -- state 0
    { x = { 4.35, 20.5 },
      y = { -0.5, 12.0 },
      z = { -0.5, 0.5 },
      density = 1.1155e-3,
      pressure = 0.96e-6,
      velocity = { 0, 0, 0 }
    }
  }
}

bc_sym = {
  sideset = { 1, 2 }
}

bc_far = { -- inflow (state 2)
  density = 1.689e-3,
  pressure = 1.753e-6,
  velocity = { 0.01544, 0.0, 0.0 },
  sideset = { 3 }
}

fieldout = {
  --iter = 100,
  time = 20.0
}

histout = {
  iter = 1,
  points = {
    { 5.01, 2.5, 0.01 },
    { 7.5, 0.01, 0.01 },
    { 9.99, 2.5, 0.01 }
  }
}

diag = {
  iter = 1,
  format = "scientific"
}

Run on 4 CPUs

./charmrun +p4 Main/inciter -i squarecav_100K.exo -c squarecav.q

Visualization

ParaView can be used for interactive visualization of the numerically computed 3D fields as

paraview out.e-s.0.4.0

Time-evolution of pressure

The figure below depicts the computed pressure field together with a shadowgraph taken from the experiments at t=200us. It is clear from the figure, that the unique wave pattern of primary and reflected shocks as well as a vortex forming at the upper-left corner of the cavity are all accurately reproduced by the numerical simulation. Excellent agreement can be found between the curvature, the geometry, and the location of the computed wave patterns and the experimental data. For more a detailed discussion of the process with more snapshots in time, see Papers.

Image Image

Mesh sensitivity

To investigate the effect of mesh resolution, we simulated the problem using 4 different meshes listed in the following table.

MeshPointsTetrahedrah
033,983100,6200.0911
1138,518423,8260.0475
2545,9821,664,3330.0268
36,656,30029,960,3400.0100

Here h is the average edge length.

The following figures show the computed fluid density fields at t=200us from the calculations using mesh 0 and 3.

Image Image

As expected, increasing the mesh resolution yields sharper resolution of the shocks and diffuses the vortex, however, due to the conservative nature of the numerical scheme, the predicted locations of the shocks do not change with mesh refinement.

Pressure time-histories

The figure below depicts the evolution of the pressure time-histories recorded from the numerical simulations at the 3 gauges depicted in the problem setup. The pressure histories are displayed from the calculations using Meshes 0 and 2. The pressure values are normalized by the pre-shock pressure, p_0.

Image

It is evident that mesh resolution does not significantly change the numerical pressure gauge readouts, only the temporal gradients become sharper with increased resolution. The first pressure peaks, the highest pressures encountered at the walls when a shock first hits them, are available from the experiments, and compared to those obtained from the numerical simulations in the table below.

GaugeExperimentComputationError
#01.251.26-0.8%
#11.511.52-0.66%
#21.771.78-0.57%

The errors in the last column are computed by

\[ \frac{(p_s/p_0)_\textrm{exp} - (p_s/p_0)_\textrm{comp}}{(p_s/p_0)_\textrm{exp}} \times 100\]

where p_s is the first peak in the pressure and p_0 is the pre-shock pressure. Again, there is excellent agreement between the experimental and computed data.

References

[1] O. Igra, J. Falcovitz, H. Reichenbach, W. Heilig, Experimental and numerical study of the interaction between a planar shock wave and a square cavity, J. Fluid Mech. 313., 105-130, 1996.