Skip to content

Commit

Permalink
fill boundary in corners and overridesync winds
Browse files Browse the repository at this point in the history
  • Loading branch information
hklion committed Aug 23, 2024
1 parent 1d912d0 commit 4ac546b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Source/BoundaryConditions/BoundaryConditions_xvel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,34 @@ void REMORAPhysBCFunct::impose_xvel_bcs (const Array4<Real>& dest_arr, const Box
);
} // z

if ((!is_periodic_in_x or bccomp==BCVars::foextrap_bc) and
(!is_periodic_in_y or bccomp==BCVars::foextrap_bc)) {
Box xlo(bx); xlo.setBig (0,dom_lo.x );
Box xhi(bx); xhi.setSmall(0,dom_hi.x+1);
Box ylo(bx); ylo.setBig (1,dom_lo.y-1);
Box yhi(bx); yhi.setSmall(1,dom_hi.y+1);
Box xlo_ylo = xlo & ylo;
Box xlo_yhi = xlo & yhi;
Box xhi_ylo = xhi & ylo;
Box xhi_yhi = xhi & yhi;
ParallelFor(xlo_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y,k) + dest_arr(dom_lo.x+1,j,k));
});
ParallelFor(xlo_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_lo.x+1,j,k));
});
ParallelFor(xhi_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y,k) + dest_arr(dom_hi.x,j,k));
});
ParallelFor(xhi_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_hi.x,j,k));
});
}


Gpu::streamSynchronize();
}
28 changes: 28 additions & 0 deletions Source/BoundaryConditions/BoundaryConditions_yvel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,33 @@ void REMORAPhysBCFunct::impose_yvel_bcs (const Array4<Real>& dest_arr, const Box
);
}

if ((!is_periodic_in_x or bccomp==BCVars::foextrap_bc) and
(!is_periodic_in_y or bccomp==BCVars::foextrap_bc)) {
Box xlo(bx); xlo.setBig (0,dom_lo.x-1);
Box xhi(bx); xhi.setSmall(0,dom_hi.x+1);
Box ylo(bx); ylo.setBig (1,dom_lo.y );
Box yhi(bx); yhi.setSmall(1,dom_hi.y+1);
Box xlo_ylo = xlo & ylo;
Box xlo_yhi = xlo & yhi;
Box xhi_ylo = xhi & ylo;
Box xhi_yhi = xhi & yhi;
ParallelFor(xlo_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y+1,k) + dest_arr(dom_lo.x,j,k));
});
ParallelFor(xlo_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_lo.x,j,k));
});
ParallelFor(xhi_ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_lo.y+1,k) + dest_arr(dom_hi.x,j,k));
});
ParallelFor(xhi_yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
dest_arr(i,j,k) = 0.5 * (dest_arr(i,dom_hi.y,k) + dest_arr(dom_hi.x,j,k));
});
}

Gpu::streamSynchronize();
}
3 changes: 3 additions & 0 deletions Source/REMORA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,10 @@ REMORA::init_only (int lev, Real time)
init_set_vmix(lev);
set_hmixcoef(lev);
set_coriolis(lev);

init_custom_smflux(geom[lev], time, *vec_sustr[lev], *vec_svstr[lev], solverChoice);
vec_sustr[lev]->OverrideSync(geom[lev].periodicity());
vec_svstr[lev]->OverrideSync(geom[lev].periodicity());

}

Expand Down

0 comments on commit 4ac546b

Please sign in to comment.