Common Functions

Common Functions

The functions here evaluate some function at a single point. This is useful for defining manufactured solutions, initial conditions, and boundary conditions. In fact, is is generally recommended that every initial condition and Dirichlet boundary condition create a function here to compute the state. For boundary conditions, all the functor need to is call this function to get the state and call a numerical flux function.

Manufactured condition for a channel with y in [0, 1]. No source term. 2D only

source

Calculates a manufactured solution based on exponentials

source

EulerEquationMod.calcFreeStream

This function calculates the free stream solution for an airfoil problem based on the angle of attack and Mach number in nondimensionalized variables.

Density and energy are set to params.rho_free (usually 1.0) and params.E_free, (usually 1/(gammagamma_1) + 0.5Ma*Ma), and the x and y momenta as

rhoMacos(angle of attack) and rhoMasin(angle of attack).

The angle of attack must be in radians.

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

Like calcFreeStream, but assumes zero angle of attack, regardless of what the options dictionary says.

source

EulerEquationMod.calcFreeStream_daoa

This function calculates the free stream solution for an airfoil problem based on the angle of attack and Mach number in nondimensionalized variables.

Density and energy are set to params.rho_free (usually 1.0) and params.E_free, (usually 1/(gammagamma_1) + 0.5Ma*Ma), and the x and y momenta as

rhoMacos(angle of attack) and rhoMasin(angle of attack).

The angle of attack must be in radians.

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

Free stream conditions for SU2 inviscid channel

source

Initial condition for SU2 inviscid channel

source

EulerEquationMod.calcIsentropicVortex

This function calculates the isentropic vortex solution to the Euler equations at a node. This function uses an inner radius of 1, an inner radius density of 2, an inner radius Mach number of 0.95, and an inner radius pressure of 1/gamma. The denstiy as a function of radius r can be found in, for example, "Output Error Estimates for Summation-by-parts Finite-difference Schemes", JE Hicken.

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

EulerEquationMod.calcOnes

This function sets all the solution variables at a node to 1.0

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

Calculates a manufactured solution from Gassner, Winters, Kopriva: Split Form Nodal DG Schemes with SBP Propertiy for the Compressible Euler Equations. This is typically used with a mesh that spans [-1, 1] in all directions

source

EulerEquationMod.calcRho1Energy2

This function sets the density at a node to 1, energy to 2 and the momenta to zero.

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

EulerEquationMod.calcRho1Energy2U1VW0

Sets the density values 1.0, x momentum to 1.0, v & w momenta to 0.0, and energy to 2.0 at a node.

It should work for 2D and 3D meshes.

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

EulerEquationMod.calcRho1Energy2U3

Sets the density values 1.0, momenta to 0.35355, and energy to 2.0 at a node.

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

Sedov explosion, 2D only

Uniform fluid at rest with energetic region in the circle of radius 0.05 centered at the origin

source

One dimensional square wave, 2D only

The base flow is uniform, and if -0.05 < x < 0.05, then it is perturbed by a small amount.

source

Two dimensional square wave, 2D only

The base flow is uniform, and if -0.05 < x, y < 0.05, then it is perturbed by a small amount.

source

EulerEquationMod.calcUnsteadyVortex

This function calculates the unsteady vortex solution to the Euler equations at time params.t, where the vortex was centered at x = params.vortex_x0 at time t=0. The analytical solution can be found in, for example, K. Mattsson et al./ Computers & Fluxs 36 (2007) 636-649

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

Unsteady vortex for Carpenters paper "Entropy Stable Staggered Grid Spectral Collocation for hte Burgers and Compressible Navier-Stokes Equations

It is similar to the other unsteady vortex, except the vortex travels at an angle

Does not use params.Ma or params.vortex_strength, or vortex.x0

source

EulerEquationMod.calcVortex

Sets the density 1.0, energy to 2.0 at a node. The momenta are calculated according to solid body rotation with an angular velocity of 0.5 centered at x = 0.

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source

EulerEquationMod.calcZeros

This function sets all the solution variables at a node to 0.0

This function uses conservative variables regardless of the static parameter of params.

Inputs: coords: a vector of length 2 containing the x and y coordinates of the point params: the params object.

Inputs/Outputs: sol: vector of length 4 to be populated with the solution

Aliasing restrictions: none

source