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
EulerEquationMod.ICDict
— Constant.Map IC names to functions. Generally the name is the same as the function name
Initial Condition Functions
TODO: write a macro for calling common funcs repeatedly
EulerEquationMod.ICChannelMMS
— Method.Initial condition of channel MMS
EulerEquationMod.ICExp
— Method.Assigns exp(kxy*z) as the initial condition, of each node, where k is the index of the degree of freedom of the node
EulerEquationMod.ICFile
— Method.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.
EulerEquationMod.ICFreeStream
— Method.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.
EulerEquationMod.ICFreeStream0
— Method.Like calcFreeStream
, but uses calcFreeStream0
instead of calcFreeStream
.
EulerEquationMod.ICInvChannel
— Method.Initial condition for SU2 bump in inviscid channel case. See also The subsonic inflow and subsonic outflow boundary conditions.
EulerEquationMod.ICIsentropicVortex
— Method.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.
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.
EulerEquationMod.ICOnes
— Method.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.
EulerEquationMod.ICPeriodicMMS
— Method.Writes calcPeriodicMMS to the initial condition vector u0
EulerEquationMod.ICRho1E2
— Method.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.
EulerEquationMod.ICRho1E2U1VW0
— Method.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.
EulerEquationMod.ICRho1E2U3
— Method.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.
EulerEquationMod.ICSedovExplosion
— Method.Initial for square wave in 2D
EulerEquationMod.ICSquare1D
— Method.Initial for square wave in 1D
EulerEquationMod.ICSquare2D
— Method.Initial for square wave in 2D
EulerEquationMod.ICTaylorGreen
— Method.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
EulerEquationMod.ICUnsteadyVortex
— Method.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.
EulerEquationMod.ICUnsteadyVortex2
— Method.Vortex travelling at an angle
EulerEquationMod.ICZero
— Method.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.
EulerEquationMod.ICsmoothHeaviside
— Method.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.
EulerEquationMod.ICsmoothHeavisideder
— Method.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.