Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turb Inflow: move support codes to PelePhysics, add documentation #366

Merged
merged 8 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,22 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: System Dependencies
run: .github/workflows/dependencies/dependencies_gcc10.sh
run: |
.github/workflows/dependencies/dependencies_gcc10.sh
sudo apt-get install -y python3-setuptools
python3 -m pip install --user scipy
python3 -m pip install --user matplotlib
python3 -m pip install --user numpy
- name: Repo Dependencies
run: Utils/CloneDeps.sh
- name: GenerateTurbFile
env:
AMREX_HOME: ${GITHUB_WORKSPACE}/Submodules/PelePhysics/Submodules/amrex
working-directory: ./Exec/RegTests/TurbInflow/TurbFileHIT
working-directory: ./Submodules/PelePhysics/Support/TurbFileHIT
run: |
./gen_hit_ic.py -k0 4 -N 32 -Nk 256
make -j 2 COMP=gnu
./PeleTurb3d.gnu.ex input hit_file=../../HITDecay/hit_ic_4_32.dat input_ncell=32 amrex.abort_on_unused_inputs=1
./PeleTurb3d.gnu.ex input hit_file=hit_ic_4_32.dat input_ncell=32 amrex.abort_on_unused_inputs=1
mkdir ${GITHUB_WORKSPACE}/Exec/RegTests/TurbInflow/TurbFileHIT
cp -r TurbTEST ${GITHUB_WORKSPACE}/Exec/RegTests/TurbInflow/TurbFileHIT
- name: Build
working-directory: ./Exec/RegTests/TurbInflow/
run: |
Expand Down
15 changes: 12 additions & 3 deletions Docs/sphinx/manual/LMeXControls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ Computational domain definition
peleLM.lo_bc = Interior Interior Inflow
peleLM.hi_bc = Interior Interior Inflow

If specifying boundaries as ``Inflow``, the bcnormal function must be defined
in the ``pelelmex_prob.H`` file for the case to define the inflow conditions.
``Inflow`` boundaries may also be augmented with spatially and temporally
varying turbulent fluctuations using the ``TurbInflow`` utility from
PelePhysics. See the ``Exec/RegTests/TurbInflow`` test for an example of how
to use this capability and the
`PelePhysics documentation <https://amrex-combustion.github.io/PelePhysics/Utility.html#turbulent-inflows>`_
for the relevant input file flags.

Grid/AMR parameters
-------------------

Expand Down Expand Up @@ -239,7 +248,7 @@ PeleLMeX algorithm
peleLM.gravity = 0.0 0.0 -9.81 # [OPT, DEF=Vec{0.0}] Gravity vector [MKS]
peleLM.gradP0 = 0.0 0.0 10.0 # [OPT, DEF=Vec{0.0}] Average background pressure gradient [Pa/m]
peleLM.do_periodic_channel = 0 # [OPT, DEF= 0] Add an automatic pressure gradient to maintain initial condition mass flow rate in periodic channel
peleLM.periodic_channel_dir = 2 # [OPT, DEF= -1] Required if do_periodic_channel != 0. Direction to apply pressure gradient.
peleLM.periodic_channel_dir = 2 # [OPT, DEF= -1] Required if do_periodic_channel != 0. Direction to apply pressure gradient.
peleLM.closed_chamber = 0 # [OPT] Override the automatic detection of closed chamber (based on Outflow(s))
peleLM.floor_species = 0 # [OPT, DEF=0] Crudely enforce mass fraction positivity
peleLM.deltaT_verbose = 0 # [OPT, DEF=0] Verbose of the deltaT iterative solve algorithm
Expand All @@ -258,7 +267,7 @@ Transport coeffs and LES
peleLM.Prandtl = 0.7 # [OPT, DEF=0.7] If fixed_Pr or doing LES, specifies the Prandtl number
peleLM.Schmidt = 0.7 # [OPT, DEF=0.7] If doing LES, specifies the Schmidt number
peleLM.Lewis = 1.0 # [OPT, DEF=1.0] If fixed_Le, specifies the Lewis number

peleLM.les_model = "None" # [OPT, DEF="None"] Model to compute turbulent viscosity: None, Smagorinsky, WALE, Sigma
peleLM.les_cs_smag = 0.18 # [OPT, DEF=0.18] If using Smagorinsky LES model, provides model coefficient
peleLM.les_cm_wale = 0.60 # [OPT, DEF=0.60] If using WALE LES model, provides model coefficient
Expand All @@ -280,7 +289,7 @@ Chemistry integrator
cvode.solve_type = denseAJ_direct # [OPT, DEF=GMRES] Linear solver employed for CVODE Newton direction
cvode.max_order = 4 # [OPT, DEF=2] Maximum order of the BDF method in CVODE
cvode.max_substeps = 10000 # [OPT, DEF=10000] Maximum number of substeps for the linear solver in CVODE

Note that the last five parameters belong to the Reactor class of PelePhysics but are specified here for completeness. In particular, CVODE is the adequate choice of integrator to tackle PeleLMeX large time step sizes. Several linear solvers are available depending on whether or not GPU are employed: on CPU, `dense_direct` is a finite-difference direct solver, `denseAJ_direct` is an analytical-jacobian direct solver (preferred choice), `sparse_direct` is an analytical-jacobian sparse direct solver based on the KLU library and `GMRES` is a matrix-free iterative solver; on GPU `GMRES` is a matrix-free iterative solver (available on all the platforms), `sparse_direct` is a batched block-sparse direct solve based on NVIDIA's cuSparse (only with CUDA), `magma_direct` is a batched block-dense direct solve based on the MAGMA library (available with CUDA and HIP. Different `cvode.solve_type` should be tried before increasing the `cvode.max_substeps`.

Embedded Geometry
Expand Down
21 changes: 2 additions & 19 deletions Exec/RegTests/HITDecay/README
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,8 @@ originally implemented in PeleC and used to study compressible turbulence in:
E. Motheau and J. Wakefield, "Investigation of finite-volume methods to capture shocks and turbulence spectra in compressible flows", Commun. in Appl. Math. and Comput. Sci, 15-1 (2020), 1--36.
https://arxiv.org/abs/1902.06665

The script gen_hit_ic.py can be used to generate an initial solution.
The script gen_hit_ic.py from PelePhysics/Support/TurbFileHIT can be used to generate an initial solution.

Here, there is no scaling by the turbulent Mach number and the density is kept constant, so that the Taylor-scale Reynolds number is defined by Re=0.5 urms / nu where umrs can be set in the input file (prob.urms0=...) and nu is computed from the mixture composition.

At the beginning of a simulation, a file initialConditions.txt is created to hold the values of urms0, lambda0 and tau, which will be used for post-processing.

The post-processing chain is composed of two major parts: computing the temporal evolution of the turbulent kinetic energy, the square of magnitude of vorticity as well as the square of the divergence. Then the turbulent spectra is computed for the last plotfile found.

IMPORTANT:
The following tools must be pre-compiled and the executable located at the root of this directory, where the post.sh script is located:
AmrDeriveSpectrum (https://github.com/AMReX-Astro/AmrDeriveSpectrum)
AugmentPlotfile (located in amrex/Tools/C_util/AugmentPlotfile)

To proceed to an analysis, please create a directory and copy inside all the plotfiles as well as the initialConditions.txt file. Then execute the post.sh script as in the following example:

./PeleLMeX3d.gnu.MPI.ex inputs.3d
mkdir ANALYSIS
cp -r plt_0000* ANALYSIS/
cp initialConditions.txt ANALYSIS/
./post.sh ANALYSIS/ 1

The output csv files will be located in the ANALYSIS directory.
At the beginning of a simulation, a file initialConditions.txt is created to hold the values of urms0, lambda0 and tau, which will be used for post-processing.
Loading
Loading