Skip to content

Commit

Permalink
terrain initialization for GABLS1
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 committed Jan 17, 2024
1 parent 5561056 commit b0b7265
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Exec/RegTests/GABLS1/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Problem::init_custom_pert(
amrex::Array4<amrex::Real > const& r_hse,
amrex::Array4<amrex::Real > const& /*p_hse*/,
amrex::Array4<amrex::Real const> const& /*z_nd*/,
amrex::Array4<amrex::Real const> const& /*z_cc*/,
amrex::Array4<amrex::Real const> const& z_cc,
amrex::GeometryData const& geomdata,
amrex::Array4<amrex::Real const> const& /*mf_m*/,
amrex::Array4<amrex::Real const> const& /*mf_u*/,
Expand All @@ -71,21 +71,35 @@ Problem::init_custom_pert(
amrex::Print() << "Initializing QKE" << std::endl;
}

const bool use_terrain = sc.use_terrain;

if (parms.pert_ref_height > 0) {
if (parms.pert_deltaU != 0.0) {
amrex::Print() << "Adding divergence-free x-velocity perturbations" << std::endl;
if (use_terrain) {
amrex::Abort("u perturbations not supported for terrain");
}
}
if (parms.pert_deltaV != 0.0) {
amrex::Print() << "Adding divergence-free y-velocity perturbations" << std::endl;
if (use_terrain) {
amrex::Abort("v perturbations not supported for terrain");
}
}
if (parms.T_0_Pert_Mag != 0.0) {
amrex::Print() << "Adding random theta perturbations" << std::endl;
}
if (parms.U_0_Pert_Mag != 0.0) {
amrex::Print() << "Adding random x-velocity perturbations" << std::endl;
if (use_terrain) {
amrex::Abort("u perturbations not supported for terrain");
}
}
if (parms.V_0_Pert_Mag != 0.0) {
amrex::Print() << "Adding random y-velocity perturbations" << std::endl;
if (use_terrain) {
amrex::Abort("v perturbations not supported for terrain");
}
}
}

Expand All @@ -96,7 +110,7 @@ Problem::init_custom_pert(
const Real* dx = geomdata.CellSize();
const Real x = prob_lo[0] + (i + 0.5) * dx[0];
const Real y = prob_lo[1] + (j + 0.5) * dx[1];
const Real z = prob_lo[2] + (k + 0.5) * dx[2];
const Real z = use_terrain ? z_cc(i,j,k) : prob_lo[2] + (k + 0.5) * dx[2];

// Define a point (xc,yc,zc) at the center of the domain
const Real xc = 0.5 * (prob_lo[0] + prob_hi[0]);
Expand Down Expand Up @@ -196,4 +210,3 @@ Problem::init_custom_pert(
}
});
}

0 comments on commit b0b7265

Please sign in to comment.