Skip to content

Commit

Permalink
Give credit where credit is due! (erf-model#1760)
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Lattanzi <[email protected]>
  • Loading branch information
AMLattanzi and Aaron Lattanzi authored Aug 28, 2024
1 parent e027c26 commit a646f6f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,10 @@ List of Parameters
| | advection scheme | | |
| | for scalars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.use_mono_adv** | Use order reduction| true/false | false |
| | for scalar | | |
| | boundedness | | |
+----------------------------------+--------------------+---------------------+--------------+

The allowed advection types for the dycore variables are
"Centered_2nd", "Upwind_3rd", "Blended_3rd4th", "Centered_4th", "Upwind_5th", "Blended_5th6th",
Expand All @@ -762,6 +766,12 @@ schemes are as follows when using efficient advection option: roughly 30% for Ce
and Centered_6th, 35% for Upwind_5th, roughly 45% for WENO5 and WENOZ5, and roughly 60% for
Upwind_3rd, WENO3, WENOZ3, and WENOMZQ3.

The monotonic advection option is an order reduction technique adapted from the PINACLES
software developed at PNNL by K. Pressel et al.; see `pnnl/pinacles github <https://github.com/pnnl/pinacles>`_.
When this flag is enabled, ERF will compute global mins and maxes for the scalar variables
and then test whether the selected advection operator (e.g., centered, upwind, or WENO)
will break these bounds. If boundedness is broken, the fluxes are recomputed with a
0-th order upwind approach.


Diffusive Physics
Expand Down
12 changes: 11 additions & 1 deletion Source/Advection/AdvectionSrcForState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,17 @@ AdvectionSrcForScalars (const Real& dt,
}
}

// Monotonicity preserving order reduction for SLOW SCALARS (0-th upwind)
/* =======================================================================
Monotonicity preserving order reduction for scalars (0-th upwind).
NOTE:
The following order reduction operations for scalar advection have been
adapted from the PINACLES code developed at PPNL by K. Pressel et al.;
see https://github.com/pnnl/pinacles.git and This version utilizes global
min/max values for simplicity rather than the local average around each
cell. Motivation for this modification is the compressible dycore in ERF
as opposed to incompressible/analestic in PINACLES.
======================================================================= */
if (use_mono_adv) {
// Copy flux data to flx_arr to avoid race condition on GPU
ParallelFor(bx, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand Down

0 comments on commit a646f6f

Please sign in to comment.