Skip to content

Commit

Permalink
Update advection flags (#1180)
Browse files Browse the repository at this point in the history
* Update advection_type flags

* fix trailing white space

* update advection stuff

* Remove WENO name conflict from interpolation struct and index defines.

---------

Co-authored-by: AMLattanzi <[email protected]>
  • Loading branch information
asalmgren and AMLattanzi authored Jul 24, 2023
1 parent a1a1243 commit 5f1f916
Show file tree
Hide file tree
Showing 58 changed files with 959 additions and 672 deletions.
9 changes: 6 additions & 3 deletions Docs/sphinx_doc/Discretizations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,15 @@ With the WENO5 scheme, one has :math:`N=3, \; \omega_{1} = 1/10, \; \omega_{2} =
q_{m + \frac{1}{2}}^{(3)} = \frac{1}{3} q_{m} + \frac{5}{6} q_{m+1} - \frac{1}{6} q_{m+2}
\end{array}
By default, the WENO3 scheme will be employed for moisture variables if the code is compiled with moisture support. However, users may utilize the WENO scheme for all scalar variables, with a specified order, via the following inputs:
By default, the WENO3 scheme will be employed for moisture variables if the code is compiled with moisture support.
However, users may utilize the WENO scheme for dry scalar variables as well. The scheme for each type is specified by

::

erf.all_use_WENO = true # Default is false
erf.spatial_order_WENO = 5 # Default is 3
erf.dryscal_horiz_adv_type =
erf.dryscal_vert_adv_type =
erf.moistscal_horiz_adv_type =
erf.moistscal_vert_adv_type =

Ref: Muñoz-Esparza, D., Sauer, J. A., Jensen, A. A., Xue, L., & Grabowski, W. W. (2022). The FastEddy® resident-GPU accelerated large-eddy simulation framework: Moist dynamics extension, validation and sensitivities of modeling non-precipitating shallow cumulus clouds. Journal of Advances in Modeling Earth Systems, 14, e2021MS002904.
`https://onlinelibrary.wiley.com/doi/10.1029/2021MS002904>`_
Expand Down
3 changes: 2 additions & 1 deletion Docs/sphinx_doc/ERFvsWRF.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ cloud water / ice mixing ratio.
**Time Integration**: Time-split integration using 3rd-order Runge-Kutta scheme with smaller time step for
acoustic and gravity wave modes. Variable time step capability.

**Spatial Discretization**: 2nd- to 6th-order advection options in horizontal and vertical
**Spatial Discretization**: 2nd- to 6th-order advection options in horizontal and vertical. In addition, several
different WENO schemes are available for scalar variables other than density and potential temperature.

**Turbulent Mixing**: Sub-grid scale turbulence formulation. Vertically implicit acoustic step off-centering.

Expand Down
130 changes: 76 additions & 54 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -491,60 +491,82 @@ Diffusive Physics
List of Parameters
------------------

+----------------------------------+--------------------+---------------------+-------------+
| Parameter | Definition | Acceptable | Default |
| | | Values | |
+==================================+====================+=====================+=============+
| **erf.alpha_T** | Diffusion coeff. | Real | 0.0 |
| | for temperature | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.alpha_C** | Diffusion coeff. | Real | 0.0 |
| | for scalar | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.rho0_trans** | Reference density | Real | 1.0 |
| | to compute const. | | |
| | rho*Alpha | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.les_type** | Using an LES | "None", | "None" |
| | model, and if so, | "Smagorinsky", | |
| | which type? | "Deardorff" | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.molec_diff_type** | Using molecular | "None", | "None" |
| | viscosity and | "Constant", or | |
| | diffusivity? | "ConstantAlpha" | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.dynamicViscosity** | Viscous coeff. if | Real | 0.0 |
| | DNS | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.Cs** | Constant | Real | 0.0 |
| | Smagorinsky coeff. | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.Pr_t** | Turbulent Prandtl | Real | 1.0 |
| | Number | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.Sc_t** | Turbulent Schmidt | Real | 1.0 |
| | Number | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.horiz/vert_spatial_order** | Horizontal and | 2 / 3 / 4 / 5 / 6 | 2 |
| | vertical spatial | | |
| | order | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.all_use_WENO** | Use WENO for all | "True", | "False" |
| | scalar variables | "False" | |
| | | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.spatial_order_WENO** | Spatial order | 3/5 | 3 |
| | for WENO | | |
| | | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.use_NumDiff** | Use 6th order | "True", | "False" |
| | numerical diffusion| "False" | |
| | | | |
+----------------------------------+--------------------+---------------------+-------------+
| **erf.NumDiffCoeff** | Coefficient for | Real | 0.0 |
| | 6th order | [0.0, 1.0] | |
| | numerical diffusion| | |
+----------------------------------+--------------------+---------------------+-------------+
+----------------------------------+--------------------+---------------------+--------------+
| Parameter | Definition | Acceptable | Default |
| | | Values | |
+==================================+====================+=====================+==============+
| **erf.alpha_T** | Diffusion coeff. | Real | 0.0 |
| | for temperature | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.alpha_C** | Diffusion coeff. | Real | 0.0 |
| | for scalar | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.rho0_trans** | Reference density | Real | 1.0 |
| | to compute const. | | |
| | rho*Alpha | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.les_type** | Using an LES | "None", | "None" |
| | model, and if so, | "Smagorinsky", | |
| | which type? | "Deardorff" | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.molec_diff_type** | Using molecular | "None", | "None" |
| | viscosity and | "Constant", or | |
| | diffusivity? | "ConstantAlpha" | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.dynamicViscosity** | Viscous coeff. if | Real | 0.0 |
| | DNS | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.Cs** | Constant | Real | 0.0 |
| | Smagorinsky coeff. | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.Pr_t** | Turbulent Prandtl | Real | 1.0 |
| | Number | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.Sc_t** | Turbulent Schmidt | Real | 1.0 |
| | Number | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.dycore_horiz_adv_type** | Horizontal | see below | Centered_2nd |
| | advection type | | |
| | for dycore vars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.dycore_vert_adv_type** | Vertical | see below | Centered_2nd |
| | advection type | | |
| | for dycore vars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.dryscal_horiz_adv_type** | Horizontal | see below | Centered_2nd |
| | advection type | | |
| | for dry scalars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.dryscal_vert_adv_type** | Vertical | see below | Centered_2nd |
| | advection type | | |
| | for dry scalars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.moistscal_horiz_adv_type** | Horizontal | see below | WENO3 |
| | advection type | | |
| | for dry scalars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.moistscal_vert_adv_type** | Vertical | see below | WENO3 |
| | advection type | | |
| | for dry scalars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.use_NumDiff** | Use 6th order | "True", | "False" |
| | numerical diffusion| "False" | |
| | | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.NumDiffCoeff** | Coefficient for | Real | 0.0 |
| | 6th order | [0.0, 1.0] | |
| | numerical diffusion| | |
+----------------------------------+--------------------+---------------------+--------------+

The allowed advection types for the dycore variables are
"Centered_2nd", "Upwind_3rd", "Centered_4th", "Upwind_5th" and "Centered_6th".

The allowed advection types for the dry and moist scalars are
"Centered_2nd", "Upwind_3rd", "Centered_4th", "Upwind_5th", "Centered_6th" and in addition,
"WENO3", "WENOZ3", "WENOMZQ3", "WENO5", and "WENOZ5."

Note: if using WENO schemes, the horizontal and vertical advection types must be set to
the same string.

Note: in the equations for the evolution of momentum, potential temperature and advected scalars, the
diffusion coefficients are written as :math:`\mu`, :math:`\rho \alpha_T` and :math:`\rho \alpha_C`, respectively.
Expand Down
10 changes: 5 additions & 5 deletions Docs/sphinx_doc/RegressionTests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ The following problems are currently tested in the CI:
| | | | | SlipWall | | |
+-------------------------------+----------+----------+----------+------------+-------+-----------------------+
| ScalarAdvDiff_order2 | 32 32 32 | Periodic | Periodic | SlipWall | None | advection + diffusion |
| | | | | SlipWall | | spatial_order = 2 |
| | | | | SlipWall | | "Centered_2nd" |
+-------------------------------+----------+----------+----------+------------+-------+-----------------------+
| ScalarAdvDiff_order3 | 32 32 32 | Periodic | Periodic | SlipWall | None | advection + diffusion |
| | | | | SlipWall | | spatial_order = 3 |
| | | | | SlipWall | | "Upwind_3rd" |
+-------------------------------+----------+----------+----------+------------+-------+-----------------------+
| ScalarAdvDiff_order4 | 32 32 32 | Periodic | Periodic | SlipWall | None | advection + diffusion |
| | | | | SlipWall | | spatial_order = 4 |
| | | | | SlipWall | | "Centered_4th" |
+-------------------------------+----------+----------+----------+------------+-------+-----------------------+
| ScalarAdvDiff_order5 | 32 32 32 | Periodic | Periodic | SlipWall | None | advection + diffusion |
| | | | | SlipWall | | spatial_order = 4 |
| | | | | SlipWall | | "Upwind_5th" |
+-------------------------------+----------+----------+----------+------------+-------+-----------------------+
| ScalarAdvDiff_order6 | 32 32 32 | Periodic | Periodic | SlipWall | None | advection + diffusion |
| | | | | SlipWall | | spatial_order = 6 |
| | | | | SlipWall | | "Centered_6th" |
+-------------------------------+----------+----------+----------+------------+-------+-----------------------+
| ScalarDiffusionGaussian | 16 16 16 | Periodic | Periodic | SlipWall | None | |
| | | | | SlipWall | | |
Expand Down
6 changes: 4 additions & 2 deletions Exec/ABL/inputs_most_msf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ erf.molec_diff_type = "Constant"
erf.les_type = "Smagorinsky"
erf.Cs = 0.1

erf.horiz_spatial_order = 3
erf.vert_spatial_order = 3
erf.dycore_horiz_adv_type = "Upwind_3rd"
erf.dycore_vert_adv_type = "Upwind_3rd"
erf.dryscal_horiz_adv_type = "Upwind_3rd"
erf.dryscal_vert_adv_type = "Upwind_3rd"

# PROBLEM PARAMETERS
prob.rho_0 = 1.0
Expand Down
6 changes: 4 additions & 2 deletions Exec/ABL/inputs_most_no_msf
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ erf.molec_diff_type = "Constant"
erf.les_type = "Smagorinsky"
erf.Cs = 0.1

erf.horiz_spatial_order = 3
erf.vert_spatial_order = 3
erf.dycore_horiz_adv_type = "Upwind_3rd"
erf.dycore_vert_adv_type = "Upwind_3rd"
erf.dryscal_horiz_adv_type = "Upwind_3rd"
erf.dryscal_vert_adv_type = "Upwind_3rd"

# PROBLEM PARAMETERS
prob.rho_0 = 1.0
Expand Down
7 changes: 5 additions & 2 deletions Exec/ABL_input_sounding/abl_mwe.i
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ erf.plot_int_1 = 100 # number of timesteps between plotfiles
erf.plot_vars_1 = density x_velocity y_velocity z_velocity pressure theta rhoKE pres_hse dens_hse pert_pres pert_dens

# SOLVER CHOICES
erf.horiz_spatial_order = 2
erf.vert_spatial_order = 2
erf.dycore_horiz_adv_type = "Centered_2nd"
erf.dycore_vert_adv_type = "Centered_2nd"
erf.dryscal_horiz_adv_type = "Centered_2nd"
erf.dryscal_vert_adv_type = "Centered_2nd"

erf.use_gravity = true
erf.use_gravity = false

Expand Down
1 change: 0 additions & 1 deletion Exec/DevTests/ParticlesOverWoA/inputs_zlevels
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ erf.plot_vars_1 = density x_velocity y_velocity z_velocity pressure theta pr
erf.use_gravity = true
erf.use_coriolis = false
erf.use_rayleigh_damping = false
erf.spatial_order = 2
erf.les_type = "None"

# MULTILEVEL
Expand Down
1 change: 0 additions & 1 deletion Exec/RegTests/Bubble/inputs_squall2d_x
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ erf.plot_int_1 = 10 # number of timesteps between plotfiles
erf.plot_vars_1 = density x_velocity y_velocity z_velocity pressure theta pres_hse

# SOLVER CHOICES
erf.spatial_order = 2
erf.use_gravity = true
erf.use_coriolis = true
erf.latitude = 40.0 # hard-coded in dyn_em/module_initialize_ideal.F
Expand Down
13 changes: 8 additions & 5 deletions Exec/RegTests/ScalarAdvDiff/inputs_WENO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ------------------ INPUTS TO MAIN PROGRAM -------------------
p ------------------ INPUTS TO MAIN PROGRAM -------------------
max_step = 20

amrex.fpe_trap_invalid = 1
Expand All @@ -18,9 +18,12 @@ zhi.type = "SlipWall"
erf.use_lowM_dt = 1
erf.cfl = 0.5 # cfl number for hyperbolic system

# TEST WENO SCHEMES
erf.all_use_WENO = true
erf.spatial_order_WENO = 5 # MUST BE 3 or 5
erf.dycore_horiz_adv_type = "Centered_2nd"
erf.dycore_vert_adv_type = "Centered_2nd"
erf.dryscal_horiz_adv_type = "WENO5"
erf.dryscal_vert_adv_type = "WENO5"
erf.moistscal_horiz_adv_type = "WENO5"
erf.moistscal_vert_adv_type = "WENO5"

# DIAGNOSTICS & VERBOSITY
erf.sum_interval = 1 # timesteps between computing mass
Expand Down Expand Up @@ -64,4 +67,4 @@ prob.prob_type = 11
#prob.rad_0 = 0.25
#prob.xc_frac = 0.5
#prob.yc_frac = 0.5
#prob.zc_frac = 0.5
#prob.zc_frac = 0.5
Loading

0 comments on commit 5f1f916

Please sign in to comment.