# Verification of PeleC

Verification of PeleC uses MASA and auto-differention tools to implement the Method of Manufactured Solutions into PeleC.

The $$L_2$$ error norm for a quantity $$s$$ is defined as

$e_s = \sqrt{ \frac{\sum_{i=1}^{N_e} \int_{V_i} (s^h-s^*)^2 \mathrm{d}V}{\sum_{i=1}^{N_e} \|V_i\|}}$

where $$s^h$$ is the numerical solution, $$s^*$$ is the exact solution, and $$N_e$$ is the number of elements. $$N$$, used below, is the number of element on a side of the cube ($$N_e = N^3$$).

## Building and running MMS

The user must first build and install MASA. This can be done from source or using Spack.

### Building MASA from source

The user must build both Metaphysicl and MASA. After defining METAPHYSICL_ROOT_DIR and MASA_ROOT_DIR:

$git clone https://github.com/roystgnr/MetaPhysicL$ ./bootstrap
$./configure --prefix=$METAPHYSICL_ROOT_DIR
$make$ make install

$git clone https://github.com/manufactured-solutions/MASA$ ./bootstrap
$./configure --enable-fortran-interfaces METAPHYSICL_DIR=$METAPHYSICL_ROOT_DIR --prefix=$MASA_ROOT_DIR --enable-python-interfaces$ make
$make check$ make install


### Building MASA using Spack

Assuming the user has Spack configured for their system, building and installing MASA is as easy as:



## Testing the Euler equations

We can turn off diffusion in Pele and set the coefficients for those terms to zero in MASA to test the hydrodynamic update. A convergence study shows second order for Pele’s treatment of the hydrodynamic source. The initial solution was initialized to the exact solution and 100 pseudo-time steps were taken (fixed to $$10^{-8}$$). Periodic boundaries are imposed everywhere.

• Density $$L_2$$ error norm:

• Velocity (u, v, w) $$L_2$$ error norm:

• Pressure $$L_2$$ error norm:

## Testing the compressible Navier-Stokes equations

For these cases, the Reynolds, Mach, and Prandtl numbers were set to 1 to ensure that the different physics were equally important (viscosity, conductivity, and bulk viscosity are non-zero and determined by the appropriate non-dimensional number). The CFL condition was fixed to 0.1 to ensure that the predictor-corrector time stepping method found a solution to the system of equations. The initial solution was initialized to the exact solution. Periodic boundaries are imposed everywhere. A convergence study shows second order for Pele’s treatment of the compressible Navier-Stokes equations.

Initial difficulties in getting the solution to reach steady state for the Euler equations (no diffusion) were overcome by incorporating diffusion effects and reducing the CFL number. Setting the Reynolds, Mach, and Prandtl to 1, and taking small time steps ensures that the pseudo-time integration (predictor/corrector) does not oscillate wildly and fail to find the steady-state solution. The iterative error was monitored and the final time (identical for all simulations) was chosen so that the iterative error was small, $$\mathcal{O}(10^{6})$$ smaller than the discretization error. The iterative error never reaches machine zero. This is most likely due to the way in which the predictor/correct pseudo-time integration uses time steps based on the wave speeds and viscosity and not adjusting the time step based on the Jacobian of the system. An actual steady-state solver (rather than a pseudo-time integration to steady state) would be more efficient and more robust at finding the steady state solution of the MMS system of equations. While this would test the spatial discretization scheme, an MMS simulation with a steady state solver would fail to test the temporal discretization scheme.

• Density $$L_2$$ error norm:

• Velocity (u, v, w) $$L_2$$ error norm:

• Pressure $$L_2$$ error norm:

## Testing the adaptive mesh refinement algorithm

This setup is similar to the previous one except for the fact that this test uses the AMR framework. There are two grid refinement levels: a coarse grid covering the entire domain and a fine grid on top of this one covering 50% of the domain. The grids are fixed in time, i.e. they do not adapt based on the solution value. This test ensures that the algorithms dealing with the grid interfaces, time integration of the different levels, and level synchronization preserve the second order accuracy of the code.

• Magnitude of velocity and mesh:

• Velocity $$L_2$$ error norm:

## Testing the constant Smagorinsky Large Eddy Simulation model

This setup is identical to the MMS study for the compressible Navier-Stokes equations. The Large Eddy Simulation (LES) constants, $$C_s$$ and $$C_I$$, were chosen such that the turbulent eddy viscosity was comparable to the viscosity, i.e. $$\frac{\mu_t}{\mu} = \mathcal{O}(1)$$. Since the model scales with the mesh spacing, $$C_s$$ and $$C_I$$ were scaled inversely with the mesh spacing for the mesh refinement studies. For example, $$C_s$$ is set to 2 for the $$8^3$$ mesh and set to 4 for the $$16^3$$ mesh (for $$C_I$$, it is 1 and 4, respectively). A convergence study shows second order for Pele’s treatment of the compressible Navier-Stokes equations with the constant Smagorinsky Large Eddy Simulation model.

• Density $$L_2$$ error norm:

• Velocity (u, v, w) $$L_2$$ error norm:

• Pressure $$L_2$$ error norm: