Skip to content

Commit

Permalink
Add KE_min param for ABL
Browse files Browse the repository at this point in the history
  • Loading branch information
ewquon committed Oct 2, 2024
1 parent 483d9da commit 71ab914
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions Exec/ABL/ERF_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct ProbParm : ProbParmDefaults {
amrex::Real A_0 = 1.0;
amrex::Real KE_0 = 0.1;

amrex::Real KE_min = 1e-13;
amrex::Real KE_decay_height = -1;
amrex::Real KE_decay_order = 1;

Expand Down
11 changes: 7 additions & 4 deletions Exec/ABL/ERF_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Problem::Problem(const amrex::Real* problo, const amrex::Real* probhi)
pp.query("T_0", parms.T_0);
pp.query("A_0", parms.A_0);
pp.query("KE_0", parms.KE_0);
pp.query("KE_min", parms.KE_min);
pp.query("KE_decay_height", parms.KE_decay_height);
pp.query("KE_decay_order", parms.KE_decay_order);

Expand Down Expand Up @@ -130,19 +131,21 @@ Problem::init_custom_pert(
if (parms_d.KE_decay_height > 0) {
// scale initial SGS kinetic energy with height
state_pert(i, j, k, RhoKE_comp) *= max(
std::pow(1 - min(z/parms_d.KE_decay_height,1.0), parms_d.KE_decay_order),
1e-12);
std::pow(1.0 - min(z/parms_d.KE_decay_height,1.0), parms_d.KE_decay_order),
0.0);
}
state_pert(i, j, k, RhoKE_comp) = max(state_pert(i, j, k, RhoKE_comp), r_hse(i,j,k)*parms_d.KE_min);
}
if (state_pert.nComp() > RhoQKE_comp) {
// PBL
state_pert(i, j, k, RhoQKE_comp) = r_hse(i,j,k) * 2.0 * parms_d.KE_0;
if (parms_d.KE_decay_height > 0) {
// scale initial SGS kinetic energy with height
state_pert(i, j, k, RhoQKE_comp) *= max(
std::pow(1 - min(z/parms_d.KE_decay_height,1.0), parms_d.KE_decay_order),
1e-12);
std::pow(1.0 - min(z/parms_d.KE_decay_height,1.0), parms_d.KE_decay_order),
0.0);
}
state_pert(i, j, k, RhoQKE_comp) = max(state_pert(i, j, k, RhoQKE_comp), 2.0*r_hse(i,j,k)*parms_d.KE_min);
}

if (use_moisture) {
Expand Down

0 comments on commit 71ab914

Please sign in to comment.