Skip to content

Commit

Permalink
fix number of ghost cells for ABLMost -- it needs to depend on advect…
Browse files Browse the repository at this point in the history
…ion scheme (erf-model#1241)
  • Loading branch information
asalmgren authored Sep 16, 2023
1 parent 0b54adf commit 18fb3a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Source/BoundaryConditions/ABLMost.H
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public:
explicit ABLMost (const amrex::Vector<amrex::Geometry>& geom,
amrex::Vector<amrex::Vector<amrex::MultiFab>>& vars_old,
amrex::Vector<std::unique_ptr<amrex::MultiFab>>& Theta_prim,
amrex::Vector<std::unique_ptr<amrex::MultiFab>>& z_phys_nd)
amrex::Vector<std::unique_ptr<amrex::MultiFab>>& z_phys_nd,
int ng)
: m_geom(geom), m_ma(geom,vars_old,Theta_prim,z_phys_nd)
{
amrex::ParmParse pp("erf");
Expand Down Expand Up @@ -88,8 +89,7 @@ public:
{
// Z0 heights
//--------------------------------------------------------
// TODO: generalize the "3" for the number of ghost cells
amrex::Box bx = amrex::grow(m_geom[lev].Domain(),3);
amrex::Box bx = amrex::grow(m_geom[lev].Domain(),ng);
bx.setSmall(2,0);
bx.setBig(2,0);
z_0[lev].resize(bx,1);
Expand Down
3 changes: 2 additions & 1 deletion Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ ERF::InitData ()
// WritePlotFile calls FillPatch in order to compute gradients
if (phys_bc_type[Orientation(Direction::z,Orientation::low)] == ERF_BC::MOST)
{
m_most = std::make_unique<ABLMost>(geom,vars_old,Theta_prim,z_phys_nd);
int ng_for_most = ComputeGhostCells(solverChoice.advChoice,solverChoice.use_NumDiff)+1;
m_most = std::make_unique<ABLMost>(geom,vars_old,Theta_prim,z_phys_nd,ng_for_most);

// We now configure ABLMost params here so that we can print the averages at t=0
// Note we don't fill ghost cells here because this is just for diagnostics
Expand Down

0 comments on commit 18fb3a6

Please sign in to comment.