Skip to content

Commit

Permalink
Merge branch 'development' into update_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Sep 20, 2024
2 parents 0669d71 + fd7eb02 commit fdf2bed
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Exec/RegTests/DensityCurrent/inputs_anelastic
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ geometry.prob_lo = 0. 0. 0.
geometry.prob_hi = 25600. 1600. 6400.
xlo.type = "Symmetry"

xhi.type = "Outflow"
xhi.type = "HO_Outflow"

geometry.is_periodic = 0 1 0

Expand Down
12 changes: 6 additions & 6 deletions Exec/SquallLine_2D/inputs_moisture_WRF
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ erf.alpha_C = 100.0
erf.moisture_model = "Kessler"
erf.use_moist_background = true

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.moistscal_horiz_adv_type = "Centered_2nd"
erf.moistscal_vert_adv_type = "Centered_2nd"
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
erf.moistscal_horiz_adv_type = Upwind_3rd
erf.moistscal_vert_adv_type = Upwind_3rd

# PROBLEM PARAMETERS (optional)
prob.z_tr = 12000.0
Expand Down
18 changes: 12 additions & 6 deletions Source/BoundaryConditions/ERF_BoundaryConditions_cons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ void ERFPhysBCFunct_cons::impose_lateral_cons_bcs (const Array4<Real>& dest_arr,
} else if (l_bc_type == ERFBCType::reflect_odd) {
dest_arr(i,j,k,dest_comp) = -dest_arr(iflip,j,k,dest_comp);
} else if (l_bc_type == ERFBCType::hoextrapcc) {
dest_arr(i,j,k,dest_comp) = 2.0*dest_arr(dom_lo.x,j,k,dest_comp) - dest_arr(dom_lo.x+1,j,k,dest_comp) ;
Real delta_i = (dom_lo.x - i);
dest_arr(i,j,k,dest_comp) = (1.0 + delta_i)*dest_arr(dom_lo.x,j,k,dest_comp) - delta_i*dest_arr(dom_lo.x+1,j,k,dest_comp) ;
}
},
bx_xhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
Expand All @@ -183,7 +184,8 @@ void ERFPhysBCFunct_cons::impose_lateral_cons_bcs (const Array4<Real>& dest_arr,
} else if (h_bc_type == ERFBCType::reflect_odd) {
dest_arr(i,j,k,dest_comp) = -dest_arr(iflip,j,k,dest_comp);
} else if (h_bc_type == ERFBCType::hoextrapcc) {
dest_arr(i,j,k,dest_comp) = 2.0*dest_arr(dom_hi.x,j,k,dest_comp) - dest_arr(dom_hi.x-1,j,k,dest_comp) ;
Real delta_i = (i - dom_hi.x);
dest_arr(i,j,k,dest_comp) = (1.0 + delta_i)*dest_arr(dom_hi.x,j,k,dest_comp) - delta_i*dest_arr(dom_hi.x-1,j,k,dest_comp) ;
}
}
);
Expand Down Expand Up @@ -213,7 +215,8 @@ void ERFPhysBCFunct_cons::impose_lateral_cons_bcs (const Array4<Real>& dest_arr,
} else if (l_bc_type == ERFBCType::reflect_odd) {
dest_arr(i,j,k,dest_comp) = -dest_arr(i,jflip,k,dest_comp);
} else if (l_bc_type == ERFBCType::hoextrapcc) {
dest_arr(i,j,k,dest_comp) = 2.0*dest_arr(i,dom_lo.y,k,dest_comp) - dest_arr(i,dom_lo.y+1,k,dest_comp) ;
Real delta_j = (dom_lo.y - j);
dest_arr(i,j,k,dest_comp) = (1.0 + delta_j)*dest_arr(i,dom_lo.y,k,dest_comp) - delta_j*dest_arr(i,dom_lo.y+1,k,dest_comp) ;
}

},
Expand All @@ -231,7 +234,8 @@ void ERFPhysBCFunct_cons::impose_lateral_cons_bcs (const Array4<Real>& dest_arr,
} else if (h_bc_type == ERFBCType::reflect_odd) {
dest_arr(i,j,k,dest_comp) = -dest_arr(i,jflip,k,dest_comp);
} else if (h_bc_type == ERFBCType::hoextrapcc) {
dest_arr(i,j,k,dest_comp) = 2.0*dest_arr(i,dom_hi.y,k,dest_comp) - dest_arr(i,dom_hi.y-1,k,dest_comp);
Real delta_j = (j - dom_hi.y);
dest_arr(i,j,k,dest_comp) = (1.0 + delta_j)*dest_arr(i,dom_hi.y,k,dest_comp) - delta_j*dest_arr(i,dom_hi.y-1,k,dest_comp);
}
}
);
Expand Down Expand Up @@ -373,7 +377,8 @@ void ERFPhysBCFunct_cons::impose_vertical_cons_bcs (const Array4<Real>& dest_arr
dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_lo.z,dest_comp) -
delta_z*l_bc_neumann_vals_d[bc_comp][2]*dest_arr(i,j,dom_lo.z,Rho_comp);
} else if (l_bc_type == ERFBCType::hoextrapcc) {
dest_arr(i,j,k,dest_comp) = 2.0*dest_arr(i,j,dom_lo.z,dest_comp) - dest_arr(i,j,dom_lo.z+1,dest_comp);
Real delta_k = (dom_lo.z - k);
dest_arr(i,j,k,dest_comp) = (1.0 + delta_k)*dest_arr(i,j,dom_lo.z,dest_comp) - delta_k*dest_arr(i,j,dom_lo.z+1,dest_comp);
}
},
bx_zhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
Expand Down Expand Up @@ -402,7 +407,8 @@ void ERFPhysBCFunct_cons::impose_vertical_cons_bcs (const Array4<Real>& dest_arr
delta_z*l_bc_neumann_vals_d[bc_comp][5]*dest_arr(i,j,dom_hi.z,Rho_comp);
}
} else if (h_bc_type == ERFBCType::hoextrapcc){
dest_arr(i,j,k,dest_comp) = 2.0*dest_arr(i,j,dom_hi.z,dest_comp) - dest_arr(i,j,dom_hi.z-1,dest_comp);
Real delta_k = (k - dom_hi.z);
dest_arr(i,j,k,dest_comp) = (1.0 + delta_k)*dest_arr(i,j,dom_hi.z,dest_comp) - delta_k*dest_arr(i,j,dom_hi.z-1,dest_comp);
}
}
);
Expand Down
35 changes: 22 additions & 13 deletions Source/Initialization/ERF_init_bcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ using namespace amrex;
void ERF::init_bcs ()
{
bool rho_read = false;
Vector<Real> cons_dir_init(NBCVAR_max,0.0);
cons_dir_init[BCVars::Rho_bc_comp] = 1.0;
cons_dir_init[BCVars::RhoTheta_bc_comp] = -1.0;
auto f = [this,&rho_read] (std::string const& bcid, Orientation ori)
{
// These are simply defaults for Dirichlet faces -- they should be over-written below
Expand Down Expand Up @@ -206,6 +209,12 @@ void ERF::init_bcs ()
{
m_bc_neumann_vals[BCVars::RhoTheta_bc_comp][ori] = theta_grad_in;
}

Real qv_in;
if (pp.query("qv", qv_in))
{
m_bc_extdir_vals[BCVars::RhoQ1_bc_comp][ori] = qv_in*m_bc_extdir_vals[BCVars::Rho_bc_comp][ori];
}
}
else if (bc_type == "slipwall")
{
Expand Down Expand Up @@ -453,17 +462,17 @@ void ERF::init_bcs ()
domain_bcs_type[BCVars::cons_bc+i].setHi(dir, ERFBCType::open);
}
}
else if ( bct == ERF_BC::no_slip_wall)
else if ( bct == ERF_BC::no_slip_wall )
{
if (side == Orientation::low) {
for (int i = 0; i < NBCVAR_max; i++) {
domain_bcs_type[BCVars::cons_bc+i].setLo(dir, ERFBCType::foextrap);
}
if (m_bc_extdir_vals[BCVars::RhoTheta_bc_comp][ori] > 0.) {
if (rho_read) {
domain_bcs_type[BCVars::RhoTheta_bc_comp].setLo(dir, ERFBCType::ext_dir);
} else {
domain_bcs_type[BCVars::RhoTheta_bc_comp].setLo(dir, ERFBCType::ext_dir_prim);
if (m_bc_extdir_vals[BCVars::cons_bc+i][ori] != cons_dir_init[BCVars::cons_bc+i]) {
if (rho_read) {
domain_bcs_type[BCVars::cons_bc+i].setLo(dir, ERFBCType::ext_dir);
} else {
domain_bcs_type[BCVars::cons_bc+i].setLo(dir, ERFBCType::ext_dir_prim);
}
}
}
if (std::abs(m_bc_neumann_vals[BCVars::RhoTheta_bc_comp][ori]) > 0.) {
Expand All @@ -472,12 +481,12 @@ void ERF::init_bcs ()
} else {
for (int i = 0; i < NBCVAR_max; i++) {
domain_bcs_type[BCVars::cons_bc+i].setHi(dir, ERFBCType::foextrap);
}
if (m_bc_extdir_vals[BCVars::RhoTheta_bc_comp][ori] > 0.) {
if (rho_read) {
domain_bcs_type[BCVars::RhoTheta_bc_comp].setHi(dir, ERFBCType::ext_dir);
} else {
domain_bcs_type[BCVars::RhoTheta_bc_comp].setHi(dir, ERFBCType::ext_dir_prim);
if (m_bc_extdir_vals[BCVars::cons_bc+i][ori] != cons_dir_init[BCVars::cons_bc+i]) {
if (rho_read) {
domain_bcs_type[BCVars::cons_bc+i].setHi(dir, ERFBCType::ext_dir);
} else {
domain_bcs_type[BCVars::cons_bc+i].setHi(dir, ERFBCType::ext_dir_prim);
}
}
}
if (std::abs(m_bc_neumann_vals[BCVars::RhoTheta_bc_comp][ori]) > 0.) {
Expand Down

0 comments on commit fdf2bed

Please sign in to comment.