Skip to content

Commit

Permalink
Update custom MOST to not require a moisture model (erf-model#1470)
Browse files Browse the repository at this point in the history
* Rename custom MOST vars for clarity

* Remove moisture model requirement for MOST CUSTOM
  • Loading branch information
ewquon authored Mar 2, 2024
1 parent 3607689 commit ad8c916
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Exec/ABL/inputs_most_bomex
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ geometry.is_periodic = 1 1 0
# MOST BOUNDARY (DEFAULT IS ADIABATIC FOR THETA)
zlo.type = "Most"
erf.most.flux_type = "custom"
erf.most.surf_mom_flux = 0.28 # ustar
erf.most.surf_temp_flux = 8.0e-3 # theta flux
erf.most.surf_moist_flux = 5.2e-5 # qv flux
erf.most.ustar = 0.28
erf.most.tstar = 8.0e-3
erf.most.qstar = 5.2e-5
erf.most.z0 = 0.1
erf.most.zref = 8.0

Expand Down
15 changes: 9 additions & 6 deletions Source/BoundaryConditions/ABLMost.H
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ public:

// Custom type user must specify the fluxes
if (flux_type == FluxCalcType::CUSTOM) {
AMREX_ASSERT_WITH_MESSAGE(use_moisture, "Moisture model must be used with MOST CUSTOM!");
theta_type = ThetaCalcType::HEAT_FLUX;
pp.query("most.surf_mom_flux" , surf_mom_flux );
pp.query("most.surf_temp_flux" , surf_temp_flux );
pp.query("most.surf_moist_flux", surf_moist_flux);
pp.query("most.ustar", custom_ustar);
pp.query("most.tstar", custom_tstar);
pp.query("most.qstar", custom_qstar);
if (custom_qstar != 0) {
AMREX_ASSERT_WITH_MESSAGE(use_moisture, "Specified custom MOST qv flux without moisture model!");
}

// Specify surface temperature or surface flux
} else {
Expand Down Expand Up @@ -295,9 +297,10 @@ private:
amrex::Real z0_const;
amrex::Real surf_temp;
amrex::Real surf_heating_rate{0};
amrex::Real surf_mom_flux{0};
amrex::Real surf_temp_flux{0};
amrex::Real surf_moist_flux{0};
amrex::Real custom_ustar{0};
amrex::Real custom_tstar{0};
amrex::Real custom_qstar{0};
amrex::Real cnk_a{0.0185};
amrex::Real depth{30.0};
amrex::Real m_start_bdy_time;
Expand Down
8 changes: 4 additions & 4 deletions Source/BoundaryConditions/ABLMost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ ABLMost::update_fluxes (const int& lev,
}
} // theta flux
} else if (flux_type == FluxCalcType::CUSTOM) {
u_star[lev]->setVal(surf_mom_flux);
t_star[lev]->setVal(surf_temp_flux);
q_star[lev]->setVal(surf_moist_flux);
u_star[lev]->setVal(custom_ustar);
t_star[lev]->setVal(custom_tstar);
q_star[lev]->setVal(custom_qstar);
}
}

Expand Down Expand Up @@ -218,7 +218,7 @@ ABLMost::compute_most_bcs (const int& lev,
});

// TODO: Generalize MOST q flux with MOENG & DONELAN flux types
if (flux_type == FluxCalcType::CUSTOM) {
if ((flux_type == FluxCalcType::CUSTOM) && use_moisture) {
n = RhoQ1_comp;
ParallelFor(b2d, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
Expand Down
4 changes: 2 additions & 2 deletions Source/BoundaryConditions/MOSTAverage.H
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ protected:

// General vars for multiple or all policies
//--------------------------------------------
int m_nvar{4}; // 3 fields for U/V/T/Qv
int m_navg{5}; // 4 averages for U/V/T/Qv/Umag
int m_nvar{4}; // 4 fields for U/V/T/Qv
int m_navg{5}; // 5 averages for U/V/T/Qv/Umag
int m_maxlev{0}; // Total number of levels
int m_policy{0}; // Policy for type of averaging
amrex::Real m_zref{10.0}; // Height above surface for MOST BC
Expand Down

0 comments on commit ad8c916

Please sign in to comment.