Skip to content

Commit

Permalink
Merge branch 'development' into Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Oct 15, 2024
2 parents 354f64e + 778f852 commit fcfbd43
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Source/BoundaryConditions/ERF_PhysBCFunct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ void ERFPhysBCFunct_w::operator() (MultiFab& mf, MultiFab& xvel, MultiFab& yvel,
gdomainz.grow(i, nghost[i]);
}
}
//
// We want to make sure we impose the z-vels at k=0 if the box includes k=0
//
if (gdomainz.smallEnd(2) == 0) gdomainz.setSmall(2,1);

Box ndomain = convert(domain,IntVect(1,1,1));
Expand Down Expand Up @@ -318,39 +320,35 @@ void ERFPhysBCFunct_w::operator() (MultiFab& mf, MultiFab& xvel, MultiFab& yvel,
//
// These are the boxes we use to test on relative to the domain
//
Box zbx1 = surroundingNodes(bx,2); zbx1.grow(nghost);
if (zbx1.smallEnd(2) < domain.smallEnd(2)) zbx1.setSmall(2,domain.smallEnd(2));
if (zbx1.bigEnd(2) > domain.bigEnd(2)) zbx1.setBig(2,domain.bigEnd(2)+1);
Box zbx = surroundingNodes(bx,2); zbx.grow(nghost);
if (zbx.smallEnd(2) < domain.smallEnd(2)) zbx.setSmall(2,domain.smallEnd(2));
if (zbx.bigEnd(2) > domain.bigEnd(2)) zbx.setBig(2,domain.bigEnd(2)+1);

Box zbx2 = surroundingNodes(bx,2); zbx2.grow(nghost);

//
// These are the boxes we use to test on relative to the domain
//
// Box zbx = surroundingNodes(bx,2); zbx.grow(0,nghost[0]);
// zbx.grow(1,nghost[1]);
Array4<const Real> z_nd_arr;

if (m_z_phys_nd)
{
z_nd_arr = z_nd_mf_loc.const_array(mfi);
}

if (!gdomainz.contains(zbx2))
//
// Recall that gdomainz.smallEnd(2) = 1 not 0!
//
if (!gdomainz.contains(zbx))
{
Array4<const Real> const& velx_arr = xvel.const_array(mfi);
Array4<const Real> const& vely_arr = yvel.const_array(mfi);
Array4< Real> const& velz_arr = mf.array(mfi);

if (!m_use_real_bcs)
{
if (!gdomainz.contains(zbx1))
if (!gdomainz.contains(zbx))
{
impose_lateral_zvel_bcs(velz_arr,velx_arr,vely_arr,zbx1,domain,z_nd_arr,dxInv,bccomp_w);
impose_lateral_zvel_bcs(velz_arr,velx_arr,vely_arr,zbx,domain,z_nd_arr,dxInv,bccomp_w);
}
}

impose_vertical_zvel_bcs(velz_arr,velx_arr,vely_arr,zbx2,domain,z_nd_arr,dxInv,
impose_vertical_zvel_bcs(velz_arr,velx_arr,vely_arr,zbx,domain,z_nd_arr,dxInv,
bccomp_u, bccomp_v, bccomp_w, m_terrain_type);
}
} // MFIter
Expand Down

0 comments on commit fcfbd43

Please sign in to comment.