Skip to content

Commit

Permalink
clean bugs for ccproj based VOF
Browse files Browse the repository at this point in the history
  • Loading branch information
Hua Tan committed Oct 4, 2024
1 parent cee1737 commit 1868861
Show file tree
Hide file tree
Showing 5 changed files with 986 additions and 986 deletions.
52 changes: 26 additions & 26 deletions src/convection/incflo_compute_MAC_projected_velocities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,49 +180,49 @@ incflo::compute_MAC_projected_velocities (
//add surface tension
if(m_vof_advect_tracer && m_use_cc_proj)
get_volume_of_fluid ()->velocity_face_source(lev,0.5*l_dt, AMREX_D_DECL(*u_mac[lev], *v_mac[lev], *w_mac[lev]),
AMREX_D_DECL(nullptr, nullptr, nullptr));
AMREX_D_DECL(nullptr, nullptr, nullptr));


if(0){
//The following is only used for testing the pure advection of VOF algorithm
//Average the cell-centered velocity to face center as MAC velocity
//Average the cell-centered velocity to face center as MAC velocity
#ifdef _OPENMP
#pragma omp parallel if (Gpu::notInLaunchRegion())
#endif
for (MFIter mfi(*vel[lev],TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
{
// Note nodaltilebox will not include the nodal index beyond boundaries between neighboring
// titles. Therefore,if we want to use face values (i.e., face_val) immediately below (commented
// out), we must create index space for the face-centered values of the tiled region
// (i.e., surroundingNodes()).
Box const& bx = mfi.tilebox();
AMREX_D_TERM(Box const& xbx = mfi.nodaltilebox(0);,
// titles. Therefore,if we want to use face values (i.e., face_val) immediately below (commented
// out), we must create index space for the face-centered values of the tiled region
// (i.e., surroundingNodes()).
Box const& bx = mfi.tilebox();
AMREX_D_TERM(Box const& xbx = mfi.nodaltilebox(0);,
Box const& ybx = mfi.nodaltilebox(1);,
Box const& zbx = mfi.nodaltilebox(2););
Array4<Real const> const& velocity = vel[lev]->const_array(mfi);
AMREX_D_TERM(Array4<Real > const& xfv = u_mac[lev]->array(mfi);,
Array4<Real > const& yfv = v_mac[lev]->array(mfi);,
Array4<Real > const& zfv = w_mac[lev]->array(mfi););
AMREX_D_TERM(
Box const& zbx = mfi.nodaltilebox(2););
Array4<Real const> const& velocity = vel[lev]->const_array(mfi);
AMREX_D_TERM(Array4<Real > const& xfv = u_mac[lev]->array(mfi);,
Array4<Real > const& yfv = v_mac[lev]->array(mfi);,
Array4<Real > const& zfv = w_mac[lev]->array(mfi););
AMREX_D_TERM(
ParallelFor(xbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
xfv(i,j,k) = .5*(velocity(i,j,k,0)+velocity(i-1,j,k,0));
});,
ParallelFor(ybx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
xfv(i,j,k) = .5*(velocity(i,j,k,0)+velocity(i-1,j,k,0));
});,
ParallelFor(ybx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
yfv(i,j,k) = .5*(velocity(i,j,k,1)+velocity(i,j-1,k,1));
});,
yfv(i,j,k) = .5*(velocity(i,j,k,1)+velocity(i,j-1,k,1));
});,

ParallelFor(zbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
ParallelFor(zbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
zfv(i,j,k) = .5*(velocity(i,j,k,2)+velocity(i,j,k-1,2));
zfv(i,j,k) = .5*(velocity(i,j,k,2)+velocity(i,j,k-1,2));
});
) // end AMREX_D_TERM
}
return;
) // end AMREX_D_TERM

}
return;
}//test
}
}

Vector<Array<MultiFab*,AMREX_SPACEDIM> > mac_vec(finest_level+1);
for (int lev=0; lev <= finest_level; ++lev)
Expand Down
Loading

0 comments on commit 1868861

Please sign in to comment.