Euler Types
This page provides documentations for DataTypes and and simple functions that are defined in the Euler module
EulerEquationMod.EulerData_
— Type.EulerEquationMod.EulerData_
This type is an implementation of the abstract EulerData. It is parameterized by the residual datatype Tres and the mesh datatype Tmsh because it stores some arrays of those types. Tres is the 'maximum' type of Tsol and Tmsh, where Tsol is the type of the solution variables. It is also paramterized by var_type
, which should be a symbol describing the set of variables stored in eqn.q. Currently supported values are :conservative
and :entropy
, which indicate the conservative variables and the entropy variables described in:
'A New Finite Element Formulation for Computational Fluid Dynamics: Part I' by Hughes et al.`
Note: this constructor does not fully populate all fields. The [init
])@ref) function must be called to finish initialization.
Static Parameters:
Tsol : datatype of variables solution variables, ie. the q vector and array
Tres : datatype of residual. ie. eltype(res_vec)
Tdim : dimensionality of equation, integer, (2 or 3, currently only 2 is supported).
Tmsh : datatype of mesh related quantities
var_type : symbol describing variables used in weak form, (:conservative or :entropy)
Fields
This type has many fields, not all of them are documented here. A few of the most important ones are:
comm: MPI communicator
commsize: size of MPI communicator
myrank: MPI rank of this process
When computing the jacobian explicitly (options key calc_jac_explicit
), Tsol and Tres are typically Float64
, however node-level operations sometime use complex numbers or dual numbers. Also, some operations on entropy variables require doing parts of the computation with conservative variables. To support these use-cases, the fields
params: ParamType object with
Tsol
,Tres
,Tmsh
, andvar_type
matching the equation objectparams_conservative: ParamType object with
Tsol, Tres
, andTmsh
matching theEulerData_
object, butvar_type = :conservative
params_entropy: similar to
param_conservative
, butvar_type = :entropy
params_complex: ParamType object with
Tmsh
andvar_type
matching theEulerData_
object, butTsol = Tres = Complex128
exist.
EulerEquationMod.AbstractEulerData{Tsol, Tres}
This abstract type should be the supertype of all solution data objects that are related to the Euler equations.
It should be used for specifying the type of a function argument only when the function does no operations on the solution data object itself, it just passes it onto other functions that do the work (thus AbstractEulerData should be used for only the highest level functions).
Another way of saying say it is that this type should only be used when the function only needs to ensure that it is solving the Euler equations, but does not care even a little bit about how.
EulerEquationMod.EulerData
— Type.EulerEquationMod.EulerData
This type, although abstract, is the type functions should use for their input arguments if they do any operations on the solution data object. It stores all data used in evaluting the Euler Equations.
It is paramaterized on the types Tsol, the type of the conservative variables q, and Tdim, the dimension of the equation
It should have the following fields:
* res_type : datatype of residual (depreciated)
* q : 3D array holding conservative variables
* q_vec : vector to assemble q into
* aux_vars : 3D array holding auxiliary variables
* flux_parametric : 4D array [ndof per node, nnodes per element, nelements, Tdim]
holding the Euler flux in the xi and eta directions
* res : 3D array holding residual
* res_vec : vector form of res
* edgestab_alpha : paramater used for edge stabilization, 4d array
* bndryflux : 3D array holding boundary flux data
* stabscale : 2D array holding edge stabilization scale factor
* M : vector holding the mass matrix
* Minv : vector holding inverse mass matrix
# Minv3D : 3D array holding inverse mass matrix for application to res (not res_vec)
EulerEquationMod.ParamType
— Type.EulerEquationMod.ParamType
This type holds the values of any constants or parameters needed during the computation. These parameters can be specified in the opts dictionary or have default values set here. If there is no reasonable default, values are initialized to -1
There are also a bunch of arrays that are used as temporaries by low level functions (to avoid having to allocate arrays themselves, which is a performance trap). In general, this Type is used as a container to pass around values.
gamma and R are the independent themodynamic variables
Whether this type should be immutable or not is an open question
This type is paramaterized on the dimension of the equation for purposes of multiple dispatch
Static Parameters:
Tdim : dimensionality of the equation, integer, (used for dispatch)
var_type : type of variables used used in the weak form, symbol, (used for dispatch), currently supported values: :conservative, :entropy
Tsol : datatype of solution variables q
Tres : datatype of residual
Tmsh : datatype of mesh related quantities (mapping jacobian etc.)
Fields (with default values):
cv : specific heat constant
R : specific gas constant (J/(Kg*K))
gamma : ratio of specific heats
gamma_1 : gamma - 1
Fields (without default values):
Ma : free stream Mach number
Re : free stream Reynolds number
aoa : angle of attack (radians)
EulerEquationMod.ParamType2
— Type.Useful alias for 2D ParamType
EulerEquationMod.ParamType3
— Type.Useful alias for 3D ParamType
EulerEquationMod.cleanup
— Method.This function performs all cleanup activities before the run_physics() function returns. The mesh, sbp, eqn, opts are returned by run_physics() so there is not much cleanup that needs to be done, mostly closing files.
Inputs/Outputs:
mesh: an AbstractMesh object
sbp: an SBP operator
eqn: the EulerData object
opts: the options dictionary
EulerEquationMod.getTypeParameters
— Method.EulerEquationMod.getTypeParameters
Gets the type parameters for mesh and equation objects.
Input
mesh
: Object of abstract meshing type.eqn
: Euler Equation object.
Output
Tmsh
: Type parameter of the mesh.Tsol
: Type parameter of the solution array.Tres
: Type parameter of the residual array.
EulerEquationMod.openLoggingFiles
— Method.This function opens all used for logging data. In particular, every data file that has data appended to it in majorIterationCallback should be opened here. Most files are of type BufferedIO, so they must be flushed periodically.
This function requires each output to have two keys: "write_outname" and "write_outname_fname", where the first has a boolean value that controls whether or not to write the output, and the second is the file name (including extension) to write.
This function contains a list of all possible log files. Every new log file must be added to the list
Inputs:
mesh: an AbstractMesh (needed for MPI Communicator)
opts: options dictionary
Outputs:
file_dict: dictionary mapping names of files to the file object ie. opts["write_entropy_fname"] => f
Exceptions: this function will throw an exception if any two file names are the same
Implementation notes: When restarting, all files must be appended to. Currently, files are appended to in all cases.
ODLCommonTools.getAllTypeParams
— Method.EulerEquationMod.getAllTypeParameters
Gets the type parameters for mesh and equation objects.
Input
mesh
: Object of abstract meshing type.eqn
: Euler Equation object.opts
: Options dictionary
Output
tuple
: Tuple of type parameters. Ordering is same as that of the concrete eqn object within this physics module.
EulerEquationMod.PhysicsName
— Constant.This physics is named Euler
Functor type for faceElementIntegrals. These integrals operate on a face, but require data from the entirety of the elements that make up the face, rather than data interpolated to the face