Initial Conditions

Initial Conditions

This page describes the functions that apply initial conditions. The initial condition is loaded into the solution vector (not the 3D array). Users should call the appropriate function if they want to transfer the solution from the vector to the 3D array.

It is important to note that the initial conditions functions do depend on the current time t. In general, an initial condition function is really a function that computes an exact solution at a given time t. Applying an initial condition is a special case of this (because t = 0). Having the initial condition functions depend on time is used to calculate errors at the end of a simulation (for cases where the exact solution is known).

Often, the initial condition function will call a function in common funcs to evalute the exact solution at each node on the mesh.

Unlike boundary conditions, which are called many times during the execution of the code, initial conditions are called infrequently, so we do not create functors for them.

Accessing Initial Conditions

Map IC names to functions. Generally the name is the same as the function name

source

Initial Condition Functions

TODO: write a macro for calling common funcs repeatedly

Initial condition of channel MMS

source

Assigns exp(kxy*z) as the initial condition, of each node, where k is the index of the degree of freedom of the node

source

EulerEquationMod.ICFile

This function reads a vector from a file on disk and set the solution to it. The vector must contain the same number of entries as there are degrees of freedom in the mesh.

This function is useful for things like restarting from a checkpoint. In this case, the file should be the output of writedlm(eqn.q). The degree of freedom number must be the same for both simulation for this to work (the file contains no degree of freedom number information).

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

EulerEquationMod.ICFreeStream

Sets all components of the solution to the free stream condition according to the angle of attack and and Mach number.

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

Like calcFreeStream, but uses calcFreeStream0 instead of calcFreeStream.

source

Initial condition for SU2 bump in inviscid channel case. See also The subsonic inflow and subsonic outflow boundary conditions.

source

EulerEquationMod.ICIsentropicVortex

Sets the solution to the steady isentropic vortex solution.

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

EulerEquationMod.ICIsentropicVortexWithNoise

Sets the solution to the steady isentropic vortex solution plus a small random noise component.

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

EulerEquationMod.ICOnes

Sets all components of the solution to 1.0

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

Writes calcPeriodicMMS to the initial condition vector u0

source

EulerEquationMod.ICRho1E2

Sets all density values to 1.0 and energy values to 2.0

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

EulerEquationMod.ICRho1E2U1VW0

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.

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

EulerEquationMod.ICRho1E2U3

Sets all components density values to 1.0, x and y momenta to 0.35355, and energy to 2.0

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

Initial for square wave in 2D

source

Initial for square wave in 1D

source

Initial for square wave in 2D

source

This function applies the initial condition for the Taylor Green vortex, using the constants in Gassner, Winters, and Kopriva's Split form Nodal DG paper

source

EulerEquationMod.ICUnsteadyVortex

Sets the solution to the unsteady vortex problem. eqn.params.t is used to determine what time to use for the solution.

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

Vortex travelling at an angle

source

EulerEquationMod.ICZero

Sets all components of the solution to zero

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

EulerEquationMod.ICZero

Sets the density to the smooth Heaviside function, all other components to zero.

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source

EulerEquationMod.ICsmoothHeavisideder

Sets the density to the derivative of the smooth Heaviside function, all other components to zero.

Inputs: mesh sbp eqn opts

Inputs/Outputs: u0: vector to populate with the solution

Aliasing restrictions: none.

source