Skip to content

Commit

Permalink
Merge branch 'development' into test_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Nov 21, 2024
2 parents d6a11c6 + 7c751f2 commit b23a381
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 16 deletions.
2 changes: 0 additions & 2 deletions Exec/DevTests/EB_Test/ERF_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,5 @@ Problem::init_custom_pert(

// Populate terrain height
z_arr(i,j,k0) = height;

// z_arr(i,j,k0) = 2.5;
});
}
6 changes: 4 additions & 2 deletions Exec/DevTests/EB_Test/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fabarray.mfiter_tile_size = 1024 1024 1024
geometry.prob_lo = 0. 0. 0.
geometry.prob_hi = 10. 1. 4.

amr.n_cell = 256 8 64 # dx=dy=dz=100 m, Straka et al 1993 / Xue et al 2000
amr.n_cell = 128 8 64

geometry.is_periodic = 0 1 0

Expand Down Expand Up @@ -51,7 +51,7 @@ erf.plot_int_1 = 20 # number of timesteps between plotfiles
erf.plot_vars_1 = density rhoadv_0 x_velocity y_velocity z_velocity pressure scalar volfrac

# SOLVER CHOICE
erf.use_gravity = true
erf.use_gravity = false
erf.use_coriolis = false
erf.les_type = "None"

Expand All @@ -65,4 +65,6 @@ erf.alpha_C = 0.0
erf.init_type = "uniform"

# PROBLEM PARAMETERS
prob.rho_0 = 1.0
prob.T_0 = 1.0
prob.u_0 = 1.0
2 changes: 0 additions & 2 deletions Source/EB/ERF_TerrainIF.H
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public:

amrex::Array4<amrex::Real const> const& terr_arr = m_terr.const_array();

if (i == 128 and j == 3) amrex::Print() <<" TERRARR " << amrex::IntVect(i,j,0) << " " << z << " " << terr_arr(i,j,0) << std::endl;

return -(z - terr_arr(i,j,0));
}

Expand Down
6 changes: 5 additions & 1 deletion Source/ERF.H
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ private:
const amrex::Vector<std::string> derived_names {"soundspeed", "temp", "theta", "KE", "scalar",
"vorticity_x","vorticity_y","vorticity_z",
"magvel", "divU",
"pres_hse", "dens_hse", "pressure", "pert_pres", "pert_dens",
"pres_hse", "dens_hse", "theta_hse", "pressure", "pert_pres", "pert_dens",
"eq_pot_temp", "num_turb", "SMark0", "SMark1",
"dpdx", "dpdy", "pres_hse_x", "pres_hse_y",
"z_phys", "detJ" , "mapfac", "lat_m", "lon_m",
Expand All @@ -957,6 +957,10 @@ private:
// moisture vars
"qt", "qv", "qc", "qi", "qp", "qrain", "qsnow", "qgraup", "qsat",
"rain_accum", "snow_accum", "graup_accum"
#ifdef ERF_USE_EB
// EB variables
,"volfrac",
#endif
#ifdef ERF_COMPUTE_ERROR
// error vars
,"xvel_err", "yvel_err", "zvel_err", "pp_err"
Expand Down
2 changes: 1 addition & 1 deletion Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ ERF::ERF_shared ()
// We define m_factory even with no EB
m_factory.resize(max_level+1);

#ifdef AMREX_USE_EB
#ifdef ERF_USE_EB
// We will create each of these in MakeNewLevel.../RemakeLevel

// This is needed before initializing level MultiFabs
Expand Down
2 changes: 1 addition & 1 deletion Source/ERF_make_new_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void ERF::MakeNewLevelFromScratch (int lev, Real time, const BoxArray& ba_in,

if (lev == 0) init_bcs();

#ifdef AMREX_USE_EB
#ifdef ERF_USE_EB
m_factory[lev] = makeEBFabFactory(geom[lev], grids[lev], dmap[lev],
{nghost_eb_basic(),
nghost_eb_volume(),
Expand Down
14 changes: 9 additions & 5 deletions Source/IO/ERF_Plotfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,20 +354,24 @@ ERF::WritePlotFile (int which, PlotFileType plotfile_type, Vector<std::string> p
mf_comp += 1;
}

MultiFab r_hse(base_state[lev], make_alias, 0, 1); // r_0 is first component
MultiFab p_hse(base_state[lev], make_alias, 1, 1); // p_0 is second component
MultiFab r_hse(base_state[lev], make_alias, 0, BaseState::r0_comp);
MultiFab p_hse(base_state[lev], make_alias, 1, BaseState::p0_comp);
MultiFab th_hse(base_state[lev], make_alias, 1, BaseState::th0_comp);
if (containerHasElement(plot_var_names, "pres_hse"))
{
// p_0 is second component of base_state
MultiFab::Copy(mf[lev],p_hse,0,mf_comp,1,0);
mf_comp += 1;
}
if (containerHasElement(plot_var_names, "dens_hse"))
{
// r_0 is first component of base_state
MultiFab::Copy(mf[lev],r_hse,0,mf_comp,1,0);
mf_comp += 1;
}
if (containerHasElement(plot_var_names, "theta_hse"))
{
MultiFab::Copy(mf[lev],th_hse,0,mf_comp,1,0);
mf_comp += 1;
}

if (containerHasElement(plot_var_names, "pressure"))
{
Expand Down Expand Up @@ -1321,7 +1325,7 @@ ERF::WritePlotFile (int which, PlotFileType plotfile_type, Vector<std::string> p
#endif
}

#ifdef EB_USE_EB
#ifdef ERF_USE_EB
for (int lev = 0; lev <= finest_level; ++lev) {
EB_set_covered(mf[lev], 0.0);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/TimeIntegration/ERF_ComputeTimestep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ ERF::estTimeStep (int level, long& dt_fast_ratio) const
Real estdt_comp_inv = ReduceMax(S_new, ccvel, detJ, 0,
[=] AMREX_GPU_HOST_DEVICE (Box const& b,
Array4<Real const> const& s,
Array4<Real const> const& vf,
Array4<Real const> const& u) -> Real
Array4<Real const> const& u,
Array4<Real const> const& vf) -> Real
#else
Real estdt_comp_inv = ReduceMax(S_new, ccvel, 0,
[=] AMREX_GPU_HOST_DEVICE (Box const& b,
Expand Down

0 comments on commit b23a381

Please sign in to comment.