V&V » RieCG: Nonlinear energy growth

This example uses RieCG in Inciter to compute a problem whose analytic solution is known, therefore it can be used to verify the accuracy of the numerical method and the correctness of the software implementation.

The purpose of this problem is to test nonlinear, time-dependent energy growth and the subsequent development of pressure gradients due to coupling between the internal energy and the equation of state. The derivation of this test problem is given in [1].

Equations solved

The system of equation solved is

\[ \begin{split} \frac{\partial U}{\partial t} + \frac{\partial F_j}{\partial x_j} = S,\qquad U = \begin{Bmatrix} \rho \\ \rho u_i \\ \rho E \end{Bmatrix}, \enskip F_j = \begin{Bmatrix} \rho u_j \\ \rho u_iu_j + p\delta_{ij} \\ u_j(\rho E + p) \end{Bmatrix}, \enskip S = \begin{Bmatrix} S_\rho \\ S_{u,i} \\ S_E \end{Bmatrix} \end{split} \]

detailed at the RieCG page describing its numerical method, with the exact solution

\[ \begin{split} \rho\left(x_i,t\right) & = \rho_0 + \exp(-\alpha t ) g(x_i) \\ u_i(x_i) & = 0 \\ p(x_i,t) & = \left[ \rho_0 + \exp(-\alpha t) g \right] (\gamma -1) \left( -3 c_e - 3 k h^2 t\right)^{-1/3} \\ e(x_i,t) & = \left( -3 c_e - 3 k h^2 t\right)^{-1/3} \\ g(x_i) & = 1 - (x_1^2 + x_2^2 + x_3^2) \\ h(x_i) & = \cos \left( \beta_{x_1} \pi x_1 \right) \cos \left( \beta_{x_2} \pi x_2 \right) \cos \left( \beta_{x_3} \pi x_3 \right)\\ \end{split} \]

and the source terms

\[ \begin{split} S_\rho & = -\alpha \exp(-\alpha t) g \\ S_{u,i} & = 2 k h t \left[\rho_0 + \exp(-\alpha t) g\right] (\gamma -1) \left(-3 c_e - 3 kh^2 t \right)^{-4/3} \frac{\partial h}{\partial x_i} \\ & \quad + \left(-3 c_e - 3 k h^2 t \right)^{-1/3} (\gamma -1) \exp(-\alpha t) \frac{\partial g}{\partial x_i} \\ S_E & = \rho k h^2 e^4 + e S_{\rho} \end{split} \]

For more details, see Papers.

Problem setup

The simulation domain is a cube centered around the point {0,0,0}. The initial conditions are sampled from the analytic solution at t=0. We set Dirichlet boundary conditions on the sides of the cube, sampling the analytic solution. The numerical solution is time-dependent. The simulation was run for a single time unit computing the numerical errors during time stepping and the errors at t=1 are used to assess the convergence rate. A time step of 0.001 was used for the coarsest mesh and was successively halved for the finer meshes.

To estimate the order of convergence, the numerical solution is computed using three different meshes, whose properties of are tabulated below, where h is the average edge length.

MeshPointsTetrahedrah
750K132,651750,0000.02
6M1,030,3016,000,0000.01
48M8,120,60148,000,0000.005

Code revision to reproduce

To reproduce the results below, use code revision 8c9d1db and the control file below.

Control file

-- vim: filetype=lua:

print "Euler equations computing nonlinear energy growth"

term = 1.0
ttyi = 10

solver = "riecg"

dt = 0.001      -- 750K
--dt = 0.0005     --   6M
--dt = 0.00025      --  48M

part = "rcb"

problem = {
  name = "nonlinear_energy_growth"
  alpha = 0.25,
  beta = { 1.0, 0.75, 0.5 },
  r0 = 2.0,
  ce = -1.0,
  kappa = 0.8
}

mat = { spec_heat_ratio = 5/3 }

bc_dir = {
  { 1, 1, 1, 1, 1, 1 },
  { 2, 1, 1, 1, 1, 1 },
  { 3, 1, 1, 1, 1, 1 },
  { 4, 1, 1, 1, 1, 1 },
  { 5, 1, 1, 1, 1, 1 },
  { 6, 1, 1, 1, 1, 1 }
}

fieldout = {
  iter = 1000
}

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

Run using the 750K mesh on 32 CPUs

./charmrun +p32 Main/inciter -i unitcube_750K.exo -c nonlinear_energy_growth.q

Visualization

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

paraview out.e-s.0.32.0

The figures below show the density, energy, and pressure distributions at four different times on center planes through the origin.

Image Image Image Image Image Image Image Image Image Image Image Image

Numerical errors and convergence rate

The table below shows the numerical L1 errors of the flow quantities computed. The L1 error is computed as

\[ \left| \left| \varepsilon \right| \right|_1 = \frac{\sum_{v=1}^n V^v \left| \hat{U}^v - U^{v} \right|} {\sum_{v=1}^n V^v} \]

where n is the total number of points of the mesh, $\hat{U}^v$ and $U^v$ are the exact and computed solutions at mesh point v, and $V^v$ denotes the volume associated to mesh point v. The order of convergence is estimated as

\[ p = \frac{ \log \left| \left| \varepsilon \right| \right|_1^{m+1} - \log \left| \left| \varepsilon \right| \right|_1^m}{ \log h^{m+1} - \log h^m} \]

where m is a mesh index. The following table summarizes the L1 errors in all flow variables at t=1.

MeshL1(r)L1(u)L1(v)L1(w)L1(e)
750K1.02e-31.07e-45.97e-54.34e-53.55e-4
6M2.58e-42.19e-51.26e-51.01e-58.03e-5
48M6.83e-54.65e-62.86e-62.43e-62.02e-5
p1.912.242.142.061.99

Here r, u, v, w, and e are the fluid density, velocity in the x, y, z directions, and the internal energy, respectively. The measured convergence rate in all variables approaches 2.0, consistent with expectations.

References

[1] J. Waltz and T.R. Canfield and N.R. Morgan and L.D. Risinger and J.G. Wohlbier, Manufactured solutions for the three-dimensional Euler equations with relevance to Inertial Confinement Fusion, Journal of Computational Physics, 267, 196–209, 2014.