Skip to content

Commit

Permalink
fix sign of fluxes for EB solve
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren committed Dec 2, 2024
1 parent fc0f5a9 commit e35af01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Source/LinearSolvers/ERF_PoissonSolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void ERF::project_velocities (int lev, Real l_dt, Vector<MultiFab>& mom_mf, Mult
// Now convert the rho0w MultiFab to hold Omega rather than rhow
// ****************************************************************************
//
#ifndef ERF_USE_EB
if (l_use_terrain && !SolverChoice::terrain_is_flat) {
for ( MFIter mfi(rhs[0],TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
Expand All @@ -65,6 +66,7 @@ void ERF::project_velocities (int lev, Real l_dt, Vector<MultiFab>& mom_mf, Mult
});
} // mfi
}
#endif

// ****************************************************************************
// Compute divergence which will form RHS
Expand Down
9 changes: 8 additions & 1 deletion Source/LinearSolvers/ERF_solve_with_EB_mlmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void ERF::solve_with_EB_mlmg (int lev, Vector<MultiFab>& rhs, Vector<MultiFab>&
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
bcoef[idim].define(convert(ba_tmp[0],IntVect::TheDimensionVector(idim)),
dm_tmp[0], 1, 0, MFInfo(), *m_factory[lev]);
bcoef[idim].setVal(1.0);
bcoef[idim].setVal(-1.0);
}
mleb.setBCoeffs(0, amrex::GetArrOfConstPtrs(bcoef));

Expand All @@ -83,6 +83,13 @@ void ERF::solve_with_EB_mlmg (int lev, Vector<MultiFab>& rhs, Vector<MultiFab>&

phi[0].FillBoundary(geom[lev].periodicity());

//
// This arises because we solve MINUS del dot beta grad phi = div (rho u)
//
fluxes[0][0].mult(-1.);
fluxes[0][1].mult(-1.);
fluxes[0][2].mult(-1.);

// ****************************************************************************
// Impose bc's on pprime
// ****************************************************************************
Expand Down

0 comments on commit e35af01

Please sign in to comment.