Skip to content

Commit

Permalink
in apply_bcs, only perform fillphysbc for new time (#1303)
Browse files Browse the repository at this point in the history
also added abl_godunov_wenoz_fixedpt to reg tests CMakeLists
  • Loading branch information
mbkuhn authored Oct 21, 2024
1 parent 935b17e commit 8972c0f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
9 changes: 4 additions & 5 deletions amr-wind/equation_systems/BCOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ struct BCOp<PDE, std::enable_if_t<std::is_base_of_v<ScalarTransport, PDE>>>
{
amrex::IntVect ng_diff(1);
auto& field = m_fields.field;
const auto bc_time = (rho_state == FieldState::Old)
? m_time.current_time()
: m_time.new_time();
if ((rho_state != FieldState::Old && rho_state != FieldState::New)) {
amrex::Abort(
"BCOps.H apply_bcs(): a state other than New or Old was used. "
"The method of setting bc_time must be evaluated before using "
"The time used for fillphysbc must be evaluated before using "
"a different state for this routine.");
}
field.fillphysbc(bc_time, ng_diff);
if (rho_state == FieldState::New) {
field.fillphysbc(m_time.new_time(), ng_diff);
}
field.apply_bc_funcs(rho_state);
}

Expand Down
11 changes: 5 additions & 6 deletions amr-wind/equation_systems/icns/icns_bcop.H
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,21 @@ struct BCOp<ICNS>
gradp.set_default_fillpatch_bc(m_time);
}

/** Apply boundary conditions before a linear solve
/** Apply boundary conditions before a linear solve or compute_diff_term
*/
void apply_bcs(const FieldState rho_state)
{
amrex::IntVect ng_diff(1);
auto& field = m_fields.field;
const auto bc_time = (rho_state == FieldState::Old)
? m_time.current_time()
: m_time.new_time();
if ((rho_state != FieldState::Old && rho_state != FieldState::New)) {
amrex::Abort(
"icns_bcop.H apply_bcs(): a state other than New or Old was "
"used. The method of setting bc_time must be evaluated before "
"used. The time used for fillphysbc must be evaluated before "
"using a different state for this routine.\n");
}
field.fillphysbc(bc_time, ng_diff);
if (rho_state == FieldState::New) {
field.fillphysbc(m_time.new_time(), ng_diff);
}
field.apply_bc_funcs(rho_state);
}

Expand Down
9 changes: 4 additions & 5 deletions amr-wind/equation_systems/vof/vof_bcop.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ struct BCOp<VOF>
{
amrex::IntVect ng_diff(1);
auto& field = m_fields.field;
const auto bc_time = (rho_state == FieldState::Old)
? m_time.current_time()
: m_time.new_time();
if ((rho_state != FieldState::Old && rho_state != FieldState::New)) {
amrex::Abort(
"vof_bcop.H apply_bcs(): a state other than New or Old was "
"used. The method of setting bc_time must be evaluated before "
"used. The time used for fillphysbc must be evaluated before "
"using a different state for this routine.");
}
field.fillphysbc(bc_time, ng_diff);
if (rho_state == FieldState::New) {
field.fillphysbc(m_time.new_time(), ng_diff);
}
field.apply_bc_funcs(rho_state);
}

Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ add_test_re(zalesak_disk_godunov)
add_test_re(dam_break_godunov)
#add_test_re(sloshing_tank)
add_test_re(abl_godunov_weno)
add_test_re(abl_godunov_wenoz_fixedpt)
add_test_re(abl_godunov_ppm)
add_test_re(abl_amd_wenoz)
add_test_re(ib_ctv_godunov_weno)
Expand Down

0 comments on commit 8972c0f

Please sign in to comment.