PROB
The prob.h file creates the namespace PROB, that defines the probelm to be solved and the methods to do it. Check the file from one of the examples(LINK) as a starting point

Problem parameters
The code requires a ProbParm structure, which is passed to user deifned functions and allows to centralised one place where varibles are stored.
The file uses thet AMReX type Real instead of floats, which can be single or double precision. Check GNU_Makefilefor set-up Makefile
Global Constants
In some cases in convenient to defined a a few global constants , such as
These constants are defined as static constexpr, allowing them to be evaluated at compile time. This makes them efficient for use in other compile-time expressions. Global constants can be utilized within methods, the ProbParm structure, and as parameters to methods Unlike the ProbParm structure, global constants are directly accessible in all user-defined functions.
NOTE: By default Cerisse uses SI units (unlike PeleC) or no-units, include the file "Constants.h" to access conversion factors (CGS to SI and viceversa) as well as universal constants with appropiate precision.
Themodynamic and Transport Closures
The namespace PROB needs to define the closures_dt template, which creates the physical "closures" of the problems, that means which themrodynamics modesl are used as well as transport properties For example:
The line above selects a problem that uses the structure indicies_t, which variables to solve(and how are they stored) how many to solve. The above also selects the Sutherland viscosity model visc_suth_t and condictivity model cond_suth_t. As well as use a perdect ideal gas as thermodynamics model. All this is wrapped in the class ```ProbClosures``, which will then pass to the equations. Some of the tranpsort model required input from the user, which can use default values (or probelem specific). Options in closures_dt, all units in SI
visc_suth_t
no
μ=1.458⋅10−6 at T=110.4
Sutherland Viscosity
cond_suth_t
no
λ=2.495⋅10−3 at T=194
Sutherland Conductivity
visc_const_t
viscosity
μ=1.85⋅10−5
Constant Viscosity
cond_const_t
conductivity
λ=0.0262
Constant Conductivity
transport_const_t
viscosity
μ=1.85⋅10−5 and λ=0.0262
Constant Viscosity and Conductivity
calorifically_perfect_gas_t
no
γ=1.4 M=28.96⋅10−3
perfect gas
multispecies_perfect_gas_t
no
PelePhysics
Used for PelePhysics options
Smagorinsky_t
yes
none
Used for LES
Passing Arguments
Oprions and parameters can be passed to the closures by creating a small structure methodparm_t before the assembly of closures_dt, so all parameters are changed directly in prob.h. For example:
The problem will use a viscosity of 2.85e-5 and a conductivity of 0.0262 (default values using the structure defaultparm_t ). Check Options for detailed description on arguments.
To use the default values, the line #include <NumParam.h> has to be included in the headers
Numerical Method and Equations
The namespace PROB needs to define as well the rhs_dt template, which defines which tre,s in the equatison to solve and how. In general
where the RHS includes the inviscid (Euler) terms viscous (for Navier-Stokes) and source terms. The C++ template follows:
Splitting the RHS into Euler terms, diffusive (or viscous) terms and source terms, which need to be defined For example, the line below
will solve
corresponding to the Euler equations, with skew-symmetric numerical scheme (with order defined in methodparm_t, similar to closures_dt (see Options). Available options in rhs_dt are:
no_euler_t
no
yes
-
0 (not solving Euler)
Not all options available yet !!
diffusive options in rhs_dt (October 2024)
diffusiveheat_t
yes
no
4th order
2/4/6 central scheme only heat
skew_t
yes
yes
4th order
2/4/6 central scheme
no_diffusive_t
no
yes
0
0 (not diffusive part)
source options in rhs_dt (October 2024)
reactor_t
yes
yes
-
PelePhysics chemcail raection
user_source_t
no
yes
-
user-given source term
no_source_t
no
yes
0
0 (no source term part)
Initial Conditions
The prob_initdata function is called for every i,j,k cell
In most examples, a few auxiliar definitions follow that extract the size the domain and allow to define the spatial coordinate x (and y and z) of the cell
This allow to define, for example, different condition depending on the x coordinate. The structure prob_parmof type ProbParm is used to recall generic problem parameters
The function needs to fille the state array, where the conservative variables exist. The index URHO, UMX are defined in the template indicies_t and are accessed through the class as cls.URHO and so on.
Since this is pure C++ code, it allows for the construction of complex initial conditions. Additionally the Utility class (see below) can be used to incorporate chemistry profiles, turbulent inflows, etc.
The most common variable labels are in the template indicies_t. Cerisse expects 3D labels UMY and UMZ even in 1 or 2D. In 1D state(i,j,k,cls.UMY)=0 amd state(i,j,k,cls.UMZ)=0 and in 2D state(i,j,k,cls.UMZ)=0.
Source
A user-specific source term can be created by defining a template
Boundary Condition
The prob.h can be used to implement user-specific boundary conditions (transient, turbulent, etc). To do that, a local template is defined (see boundaries tab for detail).
Utility
The utility class can be used to incorporate chemistry profiles, turbulent inflows etc, in the initial and boundary conditions. It inspired in the Utility options in PelePhysics and is a placeholder for complex interactions not specified in this fie, such as new data read from files. Utility can access data from input and external files. Conditions and parameters defined in PROB are known at compile time.
To use the Utility requires an additional line in GNU_Makefile and to change the prob_initdata to allow an additional argument
This class allows access to multiples functions, for example PMF in PelePhysics.
Other (optional)
The names follow in the cons_var_names array
The type of variables, keep as it is, scalars are 0 and vectors are given by their components
Data missed from input file
Last updated