Skip to content

Commit

Permalink
Renaming LM -> LMeX (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Sep 21, 2023
1 parent 940eb5d commit 5487435
Show file tree
Hide file tree
Showing 177 changed files with 566 additions and 558 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Compilation/Executable
*.ex
tmp_build*
compile_commands.json
.ccls-cache

# Run output
*.p3d
Expand Down
93 changes: 46 additions & 47 deletions CMake/BuildPeleLMeXExe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ function(build_pelelmex_exe pelelmex_exe_name pelelmex_lib_name)

target_sources(${pelelmex_exe_name}
PRIVATE
pelelm_prob_parm.H
pelelm_prob.H
pelelm_prob.cpp
pelelmex_prob_parm.H
pelelmex_prob.H
pelelmex_prob.cpp
)

#PeleLMeX include directories
Expand All @@ -29,7 +29,7 @@ function(build_pelelmex_exe pelelmex_exe_name pelelmex_lib_name)
target_compile_definitions(${pelelmex_exe_name} PRIVATE SPRAY_FUEL_NUM=${PELEMP_SPRAY_FUEL_NUM})
target_sources(${pelelmex_exe_name} PRIVATE
SprayParticlesInitInsert.cpp
${SRC_DIR}/PeleLMSprayParticles.cpp
${SRC_DIR}/PeleLMeX_SprayParticles.cpp
${PELEMP_SRC_DIR}/PP_Spray/SprayParticles.cpp
${PELEMP_SRC_DIR}/PP_Spray/SprayParticles.H
${PELEMP_SRC_DIR}/PP_Spray/SprayFuelData.H
Expand All @@ -56,7 +56,7 @@ function(build_pelelmex_exe pelelmex_exe_name pelelmex_lib_name)
message(FATAL_ERROR "NUM_SOOT_MOMENTS must be either 3 or 6")
endif()
target_sources(${pelelmex_exe_name} PRIVATE
${SRC_DIR}/Soot.cpp
${SRC_DIR}/PeleLMeX_Soot.cpp
${PELEMP_SRC_DIR}/Soot_Models/SootModel.cpp
${PELEMP_SRC_DIR}/Soot_Models/SootModel_react.cpp
${PELEMP_SRC_DIR}/Soot_Models/SootModel_derive.cpp
Expand All @@ -65,53 +65,52 @@ function(build_pelelmex_exe pelelmex_exe_name pelelmex_lib_name)
${PELEMP_SRC_DIR}/Soot_Models/SootReactions.H
${PELEMP_SRC_DIR}/Soot_Models/SootModel.H
${PELEMP_SRC_DIR}/Soot_Models/SootModel_derive.H
${SRC_DIR}/PeleLMSoot.cpp)
${SRC_DIR}/PeleLMeXSoot.cpp)
target_include_directories(${pelelmex_exe_name} PRIVATE ${PELEMP_SRC_DIR}/Soot_Models)
endif()

target_sources(${pelelmex_exe_name}
PRIVATE
${SRC_DIR}/DeriveUserDefined.cpp
${SRC_DIR}/DiffusionOp.H
${SRC_DIR}/DiffusionOp.cpp
${SRC_DIR}/EBUserDefined.H
${SRC_DIR}/PeleFlowControllerData.H
${SRC_DIR}/PeleLM.H
${SRC_DIR}/PeleLM.cpp
${SRC_DIR}/PeleLMAdvance.cpp
${SRC_DIR}/PeleLMAdvection.cpp
${SRC_DIR}/PeleLMBC.cpp
${SRC_DIR}/PeleLMBCfill.H
${SRC_DIR}/PeleLMData.cpp
${SRC_DIR}/PeleLMDerive.H
${SRC_DIR}/PeleLMDerive.cpp
${SRC_DIR}/PeleLMDeriveFunc.H
${SRC_DIR}/PeleLMDeriveFunc.cpp
${SRC_DIR}/PeleLMDiagnostics.cpp
${SRC_DIR}/PeleLMDiffusion.cpp
${SRC_DIR}/PeleLMEB.cpp
${SRC_DIR}/PeleLMEos.cpp
${SRC_DIR}/PeleLMEvaluate.cpp
${SRC_DIR}/PeleLMEvolve.cpp
${SRC_DIR}/PeleLMFlowController.cpp
${SRC_DIR}/PeleLMForces.cpp
${SRC_DIR}/PeleLMInit.cpp
${SRC_DIR}/PeleLMPlot.cpp
${SRC_DIR}/PeleLMProjection.cpp
${SRC_DIR}/PeleLMReactions.cpp
${SRC_DIR}/PeleLMRegrid.cpp
${SRC_DIR}/PeleLMSetup.cpp
${SRC_DIR}/PeleLMTagging.cpp
${SRC_DIR}/PeleLMTemporals.cpp
${SRC_DIR}/PeleLMTimestep.cpp
${SRC_DIR}/PeleLMTransportProp.cpp
${SRC_DIR}/PeleLMUMac.cpp
${SRC_DIR}/PeleLMUserKeys.H
${SRC_DIR}/PeleLMUtils.H
${SRC_DIR}/PeleLMUtils.cpp
${SRC_DIR}/PeleLM_Index.H
${SRC_DIR}/PeleLM_K.H
${SRC_DIR}/Utils.cpp
${SRC_DIR}/PeleLMeX_DeriveUserDefined.cpp
${SRC_DIR}/PeleLMeX_DiffusionOp.H
${SRC_DIR}/PeleLMeX_DiffusionOp.cpp
${SRC_DIR}/PeleLMeX_EBUserDefined.H
${SRC_DIR}/PeleLMeX_FlowControllerData.H
${SRC_DIR}/PeleLMeX.H
${SRC_DIR}/PeleLMeX.cpp
${SRC_DIR}/PeleLMeX_Advance.cpp
${SRC_DIR}/PeleLMeX_Advection.cpp
${SRC_DIR}/PeleLMeX_BC.cpp
${SRC_DIR}/PeleLMeX_BCfill.H
${SRC_DIR}/PeleLMeX_Data.cpp
${SRC_DIR}/PeleLMeX_Derive.H
${SRC_DIR}/PeleLMeX_Derive.cpp
${SRC_DIR}/PeleLMeX_DeriveFunc.H
${SRC_DIR}/PeleLMeX_DeriveFunc.cpp
${SRC_DIR}/PeleLMeX_Diagnostics.cpp
${SRC_DIR}/PeleLMeX_Diffusion.cpp
${SRC_DIR}/PeleLMeX_EB.cpp
${SRC_DIR}/PeleLMeX_Eos.cpp
${SRC_DIR}/PeleLMeX_Evaluate.cpp
${SRC_DIR}/PeleLMeX_Evolve.cpp
${SRC_DIR}/PeleLMeX_FlowController.cpp
${SRC_DIR}/PeleLMeX_Forces.cpp
${SRC_DIR}/PeleLMeX_Init.cpp
${SRC_DIR}/PeleLMeX_Plot.cpp
${SRC_DIR}/PeleLMeX_Projection.cpp
${SRC_DIR}/PeleLMeX_Reactions.cpp
${SRC_DIR}/PeleLMeX_Regrid.cpp
${SRC_DIR}/PeleLMeX_Setup.cpp
${SRC_DIR}/PeleLMeX_Tagging.cpp
${SRC_DIR}/PeleLMeX_Temporals.cpp
${SRC_DIR}/PeleLMeX_Timestep.cpp
${SRC_DIR}/PeleLMeX_TransportProp.cpp
${SRC_DIR}/PeleLMeX_UMac.cpp
${SRC_DIR}/PeleLMeX_UserKeys.H
${SRC_DIR}/PeleLMeX_Utils.H
${SRC_DIR}/PeleLMeX_Utils.cpp
${SRC_DIR}/PeleLMeX_Index.H
${SRC_DIR}/PeleLMeX_K.H
${SRC_DIR}/main.cpp
)

Expand Down
28 changes: 14 additions & 14 deletions Docs/sphinx/manual/Implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ in ``Exec/RegTests`` from which new users can pull for their new case.

The source code contains a few dozen files, organized around the pieces of the algorithm and major functionalities:

* ``PeleLMEvolve``: top level time advance loop, with IO/exit controls
* ``PeleLMSetup``: setting up the simulation parameters, parsing the input file
* ``PeleLMInit``: generating the initial solution from scratch or checkpoint file, performing initial projections/iteration(s)
* ``PeleLMAdvance``: top level implementation of the time step algorithm
* ``PeleLMProjection``: implement the various flavors of the nodal projection
* ``PeleLMUmac``: implement the construction and projection of MAC-velocities
* ``PeleLMAdvection``: functions to compute the explicit advection terms
* ``PeleLMDiffusion``: functions to compute the diffusion terms, using the operators defined in ``DiffusionOp``
* ``PeleLMReaction``: function using *PelePhysics* reactors to integrate the chemistry and linearized advection/diffusion
* ``PeleLMPlot``: implementation of plotfile and checkpoint file IOs
* ``PeleLMBC``: functions filling the ghost cells (at fine/fine, coarse/fine and domain boundaries)
* ``PeleLMRegrid``: creating new AMR level or remaking modified AMR level during adaptive refinement
* ``PeleLMTagging``: mark cells for refinement
* ``PeleLM_K.H``: low-level kernel functions
* ``PeleLMeX_Evolve``: top level time advance loop, with IO/exit controls
* ``PeleLMeX_Setup``: setting up the simulation parameters, parsing the input file
* ``PeleLMeX_Init``: generating the initial solution from scratch or checkpoint file, performing initial projections/iteration(s)
* ``PeleLMeX_Advance``: top level implementation of the time step algorithm
* ``PeleLMeX_Projection``: implement the various flavors of the nodal projection
* ``PeleLMeX_Umac``: implement the construction and projection of MAC-velocities
* ``PeleLMeX_Advection``: functions to compute the explicit advection terms
* ``PeleLMeX_Diffusion``: functions to compute the diffusion terms, using the operators defined in ``PeleLMex_DiffusionOp``
* ``PeleLMeX_Reaction``: function using *PelePhysics* reactors to integrate the chemistry and linearized advection/diffusion
* ``PeleLMeX_Plot``: implementation of plotfile and checkpoint file IOs
* ``PeleLMeX_BC``: functions filling the ghost cells (at fine/fine, coarse/fine and domain boundaries)
* ``PeleLMeX_Regrid``: creating new AMR level or remaking modified AMR level during adaptive refinement
* ``PeleLMeX_Tagging``: mark cells for refinement
* ``PeleLMeX__K.H``: low-level kernel functions

Data structure and containers
-----------------------------
Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx/manual/LMeXControls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ The following list of derived variables are available in PeleLMeX:
Note that `mixture_fraction` and `progress_variable` requires additional inputs from the users as described below.
The `derUserDefined` allow the user to define its own derived variable which can comprise several components. To do
so, the user need to copy the Source/DeriveUserDefined.cpp file into his run folder and update the file. The number of
components is defined based on the size of the vector returned by pelelm_setuserderives().
components is defined based on the size of the vector returned by pelelmex_setuserderives().

PeleLMeX algorithm
------------------
Expand Down
6 changes: 3 additions & 3 deletions Docs/sphinx/manual/Tutorials_BFSFlame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Problem specifications
.. _sec:TUTO_BFS::Problem:

The problem setup is mostly contained in the three C++ source/header files described in :doc:`Tutorials_FlameSheet`.
The user parameters are gathered in the struct defined in ``pelelm_prob_parm.H``: ::
The user parameters are gathered in the struct defined in ``pelelmex_prob_parm.H``: ::

struct ProbParm
{
Expand Down Expand Up @@ -183,8 +183,8 @@ The user parameters are gathered in the struct defined in ``pelelm_prob_parm.H`

The initial solution consists of a premixed methane/air mixture in the upper part of the domain
and pure hot air in the wake of the step. The default parameters provided above are overwritten
using AMReX ParmParse in ``pelelm_prob.cpp`` and the initial/boundary conditions implemented in
``pelelm_prob.H``.
using AMReX ParmParse in ``pelelmex_prob.cpp`` and the initial/boundary conditions implemented in
``pelelmex_prob.H``.

In addition to these three C++ files, an extra header is needed in the present case compared to
:doc:`Tutorials_FlameSheet` : ``EBUserDefined.H``. This file is necessary to specify more complex EB
Expand Down
22 changes: 11 additions & 11 deletions Docs/sphinx/manual/Tutorials_FlameSheet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ any additional files necessary for the simulation (solution of a Cantera 1D flam

The following three files in particular are necessary: ::

pelelm_prob_parm.H
pelelm_prob.H
pelelm_prob.cpp
pelelmex_prob_parm.H
pelelmex_prob.H
pelelmex_prob.cpp

The first file provides a C++ struct `ProbParm` containing the set of user-defined variables
used during the simulation (value of inlet temperature, amplitude of the initial
perturbation, ...). The `.cpp` file uses AMReX `ParmParse` to read these run-time
parameter and initialize the `ProbParm` container values. Finally, `pelelm_prob.H`
parameter and initialize the `ProbParm` container values. Finally, `pelelmex_prob.H`
provides C++ kernels for the initial and boundary conditions and will be detailed
later in this tutorial.

Expand Down Expand Up @@ -136,7 +136,7 @@ Problem specifications

.. _sec:TUTO_FS::Problem:

The problem setup is mostly contained in the three C++ source/header files mentioned above. Looking into ``pelelm_prob_parm.H`` first,
The problem setup is mostly contained in the three C++ source/header files mentioned above. Looking into ``pelelmex_prob_parm.H`` first,
we can see the set of parameters that will be used to specify the initial and boundary conditions: ::

struct ProbParm
Expand All @@ -158,7 +158,7 @@ periodicity of the initial solution.
.. note::
The ``P_mean`` parameters, providing the initial thermodynamic pressure, is always needed in the ProbParm struct.

Looking now into ``pelelm_prob.cpp``, we can see how the developer can provide access to the `ProbParm` parameters
Looking now into ``pelelmex_prob.cpp``, we can see how the developer can provide access to the `ProbParm` parameters
to overwrite the default values using AMReX's ParmParse: ::

void PeleLM::readProbParm()
Expand Down Expand Up @@ -190,8 +190,8 @@ ASCII file in the input file: ::

pmf.datafile = "drm19_pmf.dat"

Finally, ``pelelm_prob.H`` defines the two functions effectively filling the initial solution and boundary conditions:
`pelelm_initdata` and `bcnormal`. The arguments of the `pelelm_initdata` function are as follows:
Finally, ``pelelmex_prob.H`` defines the two functions effectively filling the initial solution and boundary conditions:
`pelelmex_initdata` and `bcnormal`. The arguments of the `pelelmex_initdata` function are as follows:

* ``int i, int j, int k,`` : indices of the current grid cell the function is called to fill

Expand All @@ -207,7 +207,7 @@ Finally, ``pelelm_prob.H`` defines the two functions effectively filling the ini

* ``pele::physics::PMF::PmfData::DataContainer const * pmf_data`` : the Cantera solution data struct

The reader is encouraged to look into the body of the `pelelm_initdata` function for more details, a skeletal
The reader is encouraged to look into the body of the `pelelmex_initdata` function for more details, a skeletal
version of the function reads:

* Compute the coordinate of the cell center using the cell indices and the `geomdata`.
Expand All @@ -228,7 +228,7 @@ function is only called in the direction/orientation where a Dirichlet boundary
:math:`y`-low domain face here since the transverse direction is periodic and the outflow is an homogeneous
Neumann for the state components.

A last function, ``zero_visc``, is included in ``pelelm_prob.H`` but is not used in the present case.
A last function, ``zero_visc``, is included in ``pelelmex_prob.H`` but is not used in the present case.

Numerical parameters
^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -356,7 +356,7 @@ similar to :numref:`FS_InitSol`.

It is interesting to note that the initial solution has a transverse velocity component
even though only the axial velocity was extracted from a 1D Cantera solution to initialize
the solution in the `pelelm_initdata` function. This is because `PeleLMeX` performs an
the solution in the `pelelmex_initdata` function. This is because `PeleLMeX` performs an
initial projection (more than one actually). At this point, the `divU` constraint is
mostly negative, which is counter-intuitive for a flame, but this is the consequence of
the initialization process and the solution will rapidly relax to adapt to the `PeleLMeX` grid.
Expand Down
8 changes: 4 additions & 4 deletions Docs/sphinx/manual/Tutorials_FlowPastCyl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ Problem specifications
This very simple problem only has three user-defined problem parameters: the inflow velocity magnitude, the pressure and the temperature.
Specifying dirichlet ``Inflow`` conditions in `PeleLMeX` can seem daunting at first. But it is actually a very flexible process. We walk the user through the details which involve the following files:

- ``pelelm_prob_parm.H``, assemble in a C++ struct ``ProbParm`` the input variables as well as other variables used in the initialization process.
- ``pelelm_prob.cpp``, initialize and provide default values to the entries of ``ProbParm`` and allow the user to pass run-time value using the `AMReX` parser (``ParmParse``). In the present case, the parser will read the parameters in the ``Problem`` block: ::
- ``pelelmex_prob_parm.H``, assemble in a C++ struct ``ProbParm`` the input variables as well as other variables used in the initialization process.
- ``pelelmex_prob.cpp``, initialize and provide default values to the entries of ``ProbParm`` and allow the user to pass run-time value using the `AMReX` parser (``ParmParse``). In the present case, the parser will read the parameters in the ``Problem`` block: ::

#--------------------------- Problem -------------------------------
prob.T_mean = 300.0
prob.P_mean = 101325.0
prob.meanFlowMag = 4.255
prob.meanFlowDir = 1

- finally, ``pelelm_prob.H`` contains the ``pelelm_initdata`` and ``bcnormal`` functions responsible for generating the initial and boundary conditions, respectively.
- finally, ``pelelmex_prob.H`` contains the ``pelelmex_initdata`` and ``bcnormal`` functions responsible for generating the initial and boundary conditions, respectively.

Finally, this test uses a constant set of transport parameters rather relying on the Simple library. These transport parameters are specified in the ``CONSTANT TRANSPORT`` block: ::

Expand All @@ -162,7 +162,7 @@ Initial solution

An initial field of the main variables is always required to start a simulation. In the present case, the computational domain is filled with air in the condition of pressure and temperature provided by the user (or the default ones). An initial constant velocity of ``meanFlowMag`` is used, but note that `PeleLMeX` performs an initial velocity projection to enforce the low Mach number constraint which overwrite this initial velocity.

This initial solution is constructed via the routine ``pelelm_initdata()``, in the file ``pelelm_prob.H``. Additional information is provided as comments in this file for the eager reader, but nothing is required from the user at this point.
This initial solution is constructed via the routine ``pelelmex_initdata()``, in the file ``pelelmex_prob.H``. Additional information is provided as comments in this file for the eager reader, but nothing is required from the user at this point.


Numerical scheme
Expand Down
8 changes: 4 additions & 4 deletions Docs/sphinx/manual/Tutorials_HotBubble.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Problem specifications
.. _sec:TUTO_HB::Problem:

The problem setup is mostly contained in the three C++ source/header files described in :doc:`Tutorials_FlameSheet`.
The user parameters are gathered in the struct defined in ``pelelm_prob_parm.H``: ::
The user parameters are gathered in the struct defined in ``pelelmex_prob_parm.H``: ::

struct ProbParm
{
Expand Down Expand Up @@ -153,9 +153,9 @@ The user parameters are gathered in the struct defined in ``pelelm_prob_parm.H`
The initial solution consists of air at the pressure/temperature specified by the user, with a bubble
of a different temperature/mixture intended to be lighter such that the bubble will rise under the
influence of gravity. Note that the user can easily reverse the problem with a heavier bubble.
The default parameters provided above are overwritten using AMReX ParmParse in ``pelelm_prob.cpp``
and the initial/boundary conditions implemented in ``pelelm_prob.H``. Because this case does not feature
any dirichlet BC on the state variables, the ``bcnormal`` function in ``pelelm_prob.H`` will not be called
The default parameters provided above are overwritten using AMReX ParmParse in ``pelelmex_prob.cpp``
and the initial/boundary conditions implemented in ``pelelmex_prob.H``. Because this case does not feature
any dirichlet BC on the state variables, the ``bcnormal`` function in ``pelelmex_prob.H`` will not be called
and can thus be left empty (but its definition is still required).

The interesting aspect of this case is the inclusion of buoyancy effects in the presence of gravity.
Expand Down
Loading

0 comments on commit 5487435

Please sign in to comment.