Read in initial conditions U(x,0), evaluate the fields at the element quadrature points. Set n=0.
Step 2:
Calculate the upwinded fluxes Fn at the Gauss quadrature points on the element interfaces. At domain boundaries use the prescribed boundary conditions for the exterior values of the fields.
Step 3:
Calculate the Euler flux terms:
at the element quadrature points.
Step 4:
For each component of the state vector
Uk=(U(x,tn))k calculate
.
Step 5:
Interpolate the upwinded flux to the correct quadrature for the element interface. Scale the fluxes with the edge Jacobian divided by the volume Jacobians. Add this to the divergence of the Euler fluxes calculated in Step 4.
Step 6:
Take inner product of the fluxes with the orthogonal basis Evaluate the resulting polynomials at the quadrature points.
Step 7:
Calculate the spatial derivatives of the primitive fields. For example, we will need
.
We evaluate this using the DGM to compensate for the derivative across element interfaces, and the average of u at the element interface.
Step 8:
Use the derivatives of the primitive fields to construct the Viscous flux terms:
.
Step 9:
Take the divergence of the viscous flux terms.
Step 10:
Subtract the divergence of the Euler fluxes obtained in Step 6 from the divergence of viscous fluxes obtained in Step 9.
Step 11:
Take inner product of the result from Sep 10 with the orthogonal basis. Evaluate the resulting polynomials at the quadrature points and place it in Uf(x,tn-q).
Step 12:
Update the state vector
using an Adams-Bashforth integration scheme.
Step 13:
Increase n by one. If tn is less than the termination time return to Step 2.
Step 14:
Output final values of the state vector U(x,tend).