Conversion

Conversion Between Different Variables

It is possible to write the Euler equations in terms of different sets of variables. The default is to use conservative variables, but there are others as well, such as entropy variables. This page describes how to convert between the different sets of variables. The functions perform conversions back and forth between conservative variables and the "other" variables. The code generally does not support conversion directly between two different sets of "other variables. For example, if we call the conservative variables the q variables, the first set of "other" variables the w1 variables and the second set of "other" variables the w2 variables, it is possible to convert between q and w1 as well as q and w2 but not between w1 and w2.

The basic set of functions perform the conversion, and these function's names and in an underscore. Layered on top of these functions are a safer method of conversion, which uses the static parameters of the ParamType to determine what variables are stored in eqn.q and performs the appropriate conversion. This is important because if, for example, we are solving the equation using entropy variables, and the function convertToEntropy is called, it will (correctly) not do the conversion, because the variables are already the entropy variables. If convertToConservative is called, it will do the proper conversion from entropy to conservative variables.

The function describe here provide one additional bit of functionality. Lets say a function needs to convert it current variables to conservative variables, do some operation, then convert the result back to entropy variables. Converting to conservative variables is easy, that's what convertToConservative does. The problem is converting back. The code doesn't necessarily know what variables are stored in eqn.q, so it doesn't know what function to call. Should it call convertToW1 or convertToW2? The solution is convertFromNaturalToWorkingVars, which converts from the conservative variables to whatever the variables stored in eqn.q are (as determined by the static parameters of the ParamType object).

Functions

EulerEquationMod.convertFromNaturlaToWorkingVars

This function converts a vector qc from the "natural" set of variables to write the equation to the set of variables the equation is being solved in, defined by the static parameter var_type of the params. For the Euler equations, the "natural" variables are the conservative variables. Every new set of variables must extend this function with a new method.

Inputs: params: ParamType{Tdim, var_type} qc: vector of "natural" variables

Inputs/Outputs: qe: vector to be populated with the new variables

Low level function.

Aliasing restrictions: none (this requires that every method of this function support in-place conversion).

source

low level function

Converts conservative variables to conservative variables (ie. it copies the input to the output). This method exists to values can be converted without knowing whether they are conservative or entropy.

Aliasing restrictions: none (qc and qe can be the same vector)

source

EulerEquationMod.convertToConservative

Converts the entropy variables at a node to the conservative variables.

Inputs: params : ParamType{2, :entropy} used to dispatch to the proper method qe : vector (of length 4) of entropy variables

Inputs/outputs qc : vector (of length 4) of conservative variables. Contents of vector are overwritten

Aliasing: none (qc and qe can be the same vector)

Ths is a low level function.

source

mid level function

Converts the array (3D form) of entropy variables to conservative variables in place. If the array is already in conservative variables this is a no-op. Other methods exist if q_arr is a vector.

Inputs: mesh sbp eqn opts

Inputs/Outputs: q_arr: array of values (3D) to be converted

Aliasing: no restrictions

source

EulerEquationMod.convertToConservativeFromIR_

Converts the IR entropy variables at a node to the conservative variables regardless of the static parameter var_type.

Inputs: params : ParamType{Tdim} used to dispatch to the proper method qe : vector (of length 4 or 5) of entropy variables

Inputs/outputs qc : vector (of length 4 or 5) of conservative variables. Contents of vector are overwritten

Aliasing: none (qc and qe can be the same vector)

Ths is a low level function.

source

EulerEquationMod.convertToConservative_

Converts the entropy variables at a node to the conservative variables regardless of the static parameter var_type.

Inputs: params : ParamType{Tdim} used to dispatch to the proper method qe : vector (of length 4 or 5) of entropy variables

Inputs/outputs qc : vector (of length 4 or 5) of conservative variables. Contents of vector are overwritten

Aliasing: none (qc and qe can be the same vector)

Ths is a low level function.

source

EulerEquationMod.convertToEntropy

Converts the conservative variables at a node to entropy variables

Input: params : ParamType{s, :conservative} qc : vector (of length 4 or 5) of conservative variables

Outputs: qe : vector (of length 4 or 5) of conservative variables. Contents of vector areoverwritten

low level function

Aliasing restrictions: none (qc and qe can be the same vector)

source

EulerEquationMod.convertToEntropy

Converts the entropy variables to entropy variables (ie. it copies the input to the output). This method exists so variables can be converted to entropy variables without knowing what type they are.

low level function

Aliasing restrictions: none (qc and qe can be the same vector)

source

mid level function

Converts the array (3D form) of conservative variables to entropy variables in place. If the array is already in entropy variables this is a no-op

Methods also exist for the 1D form.

Inputs: mesh sbp eqn opts

Inputs/Outputs: q_arr: array of values (3D) to be converted

Aliasing: no restrictions

source

EulerEquationMod.convertToEntropy_

Converts the conservative variables at a node to the entropy variables regardless of the static parameter var_type.

Inputs: params : ParamType{Tdim} used to dispatch to the proper method qe : vector (of length 4 or 5) of conservative variables

Inputs/outputs qc : vector (of length 4 or 5) of entropy variables. Contents of vector are overwritten

Aliasing: none (qc and qe can be the same vector)

Ths is a low level function.

source

EulerEquationMod.convertToIR_

Converts the conservative variables at a node to the entropy variables of Ismail and Roe regardless of the static parameter var_type.

Inputs: params : ParamType{Tdim} used to dispatch to the proper method qe : vector (of length 4 or 5) of conservative variables

Inputs/outputs qc : vector (of length 4 or 5) of entropy variables. Contents of vector are overwritten

Aliasing: none (qc and qe can be the same vector)

Ths is a low level function.

source