Skip to content

Commit

Permalink
FillPatch before tagging cells for regridding (#2086)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Jan 24, 2025
1 parent 202be36 commit ce96f80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions Source/ERF_Tagging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ ERF::ErrorEst (int levc, TagBoxArray& tags, Real time, int /*ngrow*/)
const int clearval = TagBox::CLEAR;
const int tagval = TagBox::SET;

//
// Make sure the ghost cells of the level we are tagging at are filled
// in case we take differences that require them
// NOTE: We are Fillpatching only the cell-centered variables here
//
MultiFab& S_new = vars_new[levc][Vars::cons];
MultiFab& U_new = vars_new[levc][Vars::xvel];
MultiFab& V_new = vars_new[levc][Vars::yvel];
MultiFab& W_new = vars_new[levc][Vars::zvel];
//
if (levc == 0) {
FillPatch(levc, time, {&S_new, &U_new, &V_new, &W_new});
} else {
FillPatch(levc, time, {&S_new, &U_new, &V_new, &W_new},
{&S_new, &rU_new[levc], &rV_new[levc], &rW_new[levc]},
base_state[levc], base_state[levc],
false, true);
}

for (int j=0; j < ref_tags.size(); ++j)
{
//
Expand Down
2 changes: 1 addition & 1 deletion Source/SourceTerms/ERF_MakeSources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ void make_sources (int level,
{
const Real t_blank = t_blank_arr(i, j, k);
cell_src(i, j, k, RhoTheta_comp) -= t_blank * CdT * U_s * (cell_data(i,j,k,RhoTheta_comp) - dptr_t_plane(k));
cell_src(i, j, k, Rho_comp) -= t_blank * CdT * U_s * (cell_data(i,j,k,Rho_comp) - dptr_r_plane(k));
cell_src(i, j, k, Rho_comp) -= t_blank * CdT * U_s * (cell_data(i,j,k,Rho_comp) - dptr_r_plane(k));
});
}

Expand Down

0 comments on commit ce96f80

Please sign in to comment.