Skip to content

Commit

Permalink
Merge branch 'development' into amrw-coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Feb 9, 2024
2 parents 70dadec + a054824 commit 82a9ceb
Show file tree
Hide file tree
Showing 15 changed files with 443 additions and 187 deletions.
15 changes: 11 additions & 4 deletions Docs/sphinx_doc/Discretizations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,21 @@ The midpoint values given above :math:`q_{m - \frac{1}{2}}`, where :math:`q` may
\left. q_{m - \frac{1}{2}} \right|^{4th} = \frac{7}{12}\left( q_{m} + q_{m - 1} \right) & \hspace{-5pt} - \frac{1}{12}\left( q_{m + 1} + q_{m - 2} \right) & \\
\left. q_{m - \frac{1}{2}} \right|^{6th} = \frac{37}{60}\left( q_{m} + q_{m - 1} \right) & \hspace{-5pt} - \frac{2}{15}\left( q_{m + 1} + q_{m - 2} \right) & \hspace{-5pt} + \frac{1}{60}\left( q_{m + 2} + q_{m - 3} \right) \\
& & \\
\left. q_{m - \frac{1}{2}} \right|^{3rd} = \left. q_{m - \frac{1}{2}} \right|^{4th} & \hspace{-5pt} + \frac{U_{d}}{\left| U_{d} \right|}\frac{1}{12}\left\lbrack \left( q_{m + 1} - q_{m - 2} \right) \right.\ & \hspace{-5pt} - 3\left. \ \left( q_{m} - q_{m - 1} \right) \right\rbrack \\
\left. q_{m - \frac{1}{2}} \right|^{3rd} = \left. q_{m - \frac{1}{2}} \right|^{4th} & \hspace{-5pt} + \beta_{\text{up}}\frac{U_{d}}{\left| U_{d} \right|}\frac{1}{12}\left\lbrack \left( q_{m + 1} - q_{m - 2} \right) \right.\ & \hspace{-5pt} - 3\left. \ \left( q_{m} - q_{m - 1} \right) \right\rbrack \\
& & \\
\left. q_{m - \frac{1}{2}} \right|^{5th} = \left. q_{m - \frac{1}{2}} \right|^{6th} & \hspace{-5pt} - \frac{U_{d}}{\left| U_{d} \right|}\frac{1}{60}\left\lbrack \left( q_{m + 2} - q_{m - 1} \right) \right.\ & \hspace{-5pt} - 5\left( q_{m + 1} - q_{m - 2} \right) + 10\left. \left( q_{m} - q_{m - 1} \right) \right\rbrack
\left. q_{m - \frac{1}{2}} \right|^{5th} = \left. q_{m - \frac{1}{2}} \right|^{6th} & \hspace{-5pt} - \beta_{\text{up}}\frac{U_{d}}{\left| U_{d} \right|}\frac{1}{60}\left\lbrack \left( q_{m + 2} - q_{m - 1} \right) \right.\ & \hspace{-5pt} - 5\left( q_{m + 1} - q_{m - 2} \right) + 10\left. \left( q_{m} - q_{m - 1} \right) \right\rbrack
\end{array}
An extra blending factor (:math:`\beta_{\text{up}}`) has been added to allow control
over the amount of upwinding added to the scheme. This hybrid scheme has been
demonstrated by Sauer and Muñoz-Esparza (2020, JAMES).

Refs:

Skamarock, W. C., Klemp, J. B., Dudhia, J., Gill, D. O., Liu, Z., Berner, J., ... Huang, X. -yu. (2019). A Description of the Advanced Research WRF Model Version 4 (No. NCAR/TN-556+STR). `doi:10.5065/1dfh-6p97 <http://dx.doi.org/10.5065/1dfh-6p97>`_

Sauer, J. A., & Muñoz-Esparza, D. (2020). The FastEddy® resident-GPU accelerated large-eddy simulation framework: Model formulation, dynamical-core validation and performance benchmarks. Journal of Advances in Modeling Earth Systems, 12, e2020MS002100. doi:10.1029/2020MS002100

Ref: Skamarock, W. C., Klemp, J. B., Dudhia, J., Gill, D. O., Liu, Z., Berner, J., ... Huang, X. -yu. (2019). A Description of the Advanced Research WRF Model Version 4 (No. NCAR/TN-556+STR). doi:10.5065/1dfh-6p97
`doi:10.5065/1dfh-6p97 <http://dx.doi.org/10.5065/1dfh-6p97>`_

WENO Methods
------------
Expand Down
9 changes: 5 additions & 4 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ List of Parameters
| | advection type | | |
| | for dry scalars | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.dryscal_vert_adv_type** | Vertical | see below | Upwind_3rd |
| **erf.dryscal_vert_adv_type** | Vertical | see below | Upwind_3rd |
| | advection type | | |
| | for dry scalars | | |
+----------------------------------+--------------------+---------------------+--------------+
Expand All @@ -583,12 +583,13 @@ List of Parameters
| | for scalars | | |
+----------------------------------+--------------------+---------------------+--------------+


The allowed advection types for the dycore variables are
"Centered_2nd", "Upwind_3rd", "Centered_4th", "Upwind_5th" and "Centered_6th".
"Centered_2nd", "Upwind_3rd", "Blended_3rd4th", "Centered_4th", "Upwind_5th", "Blended_5th6th",
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,
"Centered_2nd", "Upwind_3rd", "Blended_3rd4th", "Centered_4th", "Upwind_5th", "Blended_5th6th",
"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
Expand Down
2 changes: 2 additions & 0 deletions Source/Advection/Advection.H
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void AdvectionSrcForScalars (const amrex::Box& bx,
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
const amrex::Array4<const amrex::Real>& mf_m,
const AdvType horiz_adv_type, const AdvType vert_adv_type,
const amrex::Real horiz_upw_frac, const amrex::Real vert_upw_frac,
const bool use_terrain,
const amrex::GpuArray<const amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_arr);

Expand All @@ -57,6 +58,7 @@ void AdvectionSrcForMom (const amrex::Box& bxx, const amrex::Box& bxy, const amr
const amrex::Array4<const amrex::Real>& mf_u,
const amrex::Array4<const amrex::Real>& mf_v,
const AdvType horiz_adv_type, const AdvType vert_adv_type,
const amrex::Real horiz_upw_frac, const amrex::Real vert_upw_frac,
const bool use_terrain, const int domhi_z);

AMREX_GPU_HOST_DEVICE
Expand Down
12 changes: 12 additions & 0 deletions Source/Advection/AdvectionSrcForMom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ AdvectionSrcForMom (const Box& bxx, const Box& bxy, const Box& bxz,
const Array4<const Real>& mf_v,
const AdvType horiz_adv_type,
const AdvType vert_adv_type,
const Real horiz_upw_frac,
const Real vert_upw_frac,
const bool use_terrain,
const int domhi_z)
{
Expand Down Expand Up @@ -147,34 +149,39 @@ AdvectionSrcForMom (const Box& bxx, const Box& bxy, const Box& bxz,
rho_u, rho_v, Omega, u, v, w,
cellSizeInv, mf_m,
mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Upwind_3rd) {
AdvectionSrcForMomVert_N<UPWIND3>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w,
cellSizeInv, mf_m,
mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Centered_4th) {
AdvectionSrcForMomVert_N<CENTERED4>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w,
cellSizeInv, mf_m,
mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Upwind_5th) {
AdvectionSrcForMomVert_N<UPWIND5>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w,
cellSizeInv, mf_m,
mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Centered_6th) {
AdvectionSrcForMomVert_N<CENTERED6>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w,
cellSizeInv, mf_m,
mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else {
AMREX_ASSERT_WITH_MESSAGE(false, "Unknown advection scheme!");
Expand Down Expand Up @@ -271,30 +278,35 @@ AdvectionSrcForMom (const Box& bxx, const Box& bxy, const Box& bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w, z_nd, detJ,
cellSizeInv, mf_m, mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Upwind_3rd) {
AdvectionSrcForMomVert_T<UPWIND3>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w, z_nd, detJ,
cellSizeInv, mf_m, mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Centered_4th) {
AdvectionSrcForMomVert_T<CENTERED4>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w, z_nd, detJ,
cellSizeInv, mf_m, mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Upwind_5th) {
AdvectionSrcForMomVert_T<UPWIND5>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w, z_nd, detJ,
cellSizeInv, mf_m, mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else if (horiz_adv_type == AdvType::Centered_6th) {
AdvectionSrcForMomVert_T<CENTERED6>(bxx, bxy, bxz,
rho_u_rhs, rho_v_rhs, rho_w_rhs,
rho_u, rho_v, Omega, u, v, w, z_nd, detJ,
cellSizeInv, mf_m, mf_u_inv, mf_v_inv,
horiz_upw_frac, vert_upw_frac,
vert_adv_type, domhi_z);
} else {
AMREX_ASSERT_WITH_MESSAGE(false, "Unknown advection scheme!");
Expand Down
Loading

0 comments on commit 82a9ceb

Please sign in to comment.