Skip to content

Commit

Permalink
Conditional operator for fstate
Browse files Browse the repository at this point in the history
  • Loading branch information
itopcuoglu committed Oct 9, 2024
1 parent f3976a0 commit d4de2ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion amr-wind/equation_systems/icns/icns.H
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ struct ICNS : VectorTransport
static constexpr bool has_diffusion = true;

// No n+1/2 state for velocity for now
static constexpr bool need_nph_state = true;
// static constexpr bool need_nph_state = true;
static constexpr bool need_nph_state = false;
};

} // namespace amr_wind::pde
Expand Down
21 changes: 12 additions & 9 deletions amr-wind/incflo_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,18 @@ void incflo::ApplyPredictor(bool incremental_projection, int inonlin)
}

// With scalars computed, compute advection of momentum
if (inonlin == 0) {
icns().compute_advection_term(amr_wind::FieldState::Old);
} else {
icns().compute_advection_term(amr_wind::FieldState::NPH);
}

// *************************************************************************************
// Define (or if use_godunov, re-define) the forcing terms and viscous terms
// independently for the right hand side, without 1/rho term
// if (inonlin == 0) {
// icns().compute_advection_term(amr_wind::FieldState::Old);
//} else {
// icns().compute_advection_term(amr_wind::FieldState::NPH);
//}
const auto fstate =
(inonlin == 0) ? amr_wind::FieldState::Old : amr_wind::FieldState::NPH;
icns().compute_advection_term(fstate);

// *************************************************************************************
// Define (or if use_godunov, re-define) the forcing terms and viscous
// terms independently for the right hand side, without 1/rho term
// *************************************************************************************
icns().compute_source_term(amr_wind::FieldState::NPH);
icns().compute_diffusion_term(amr_wind::FieldState::Old);
Expand Down
2 changes: 0 additions & 2 deletions amr-wind/utilities/console_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ void print_nonlinear_residual(
const auto& velocity_new = sim.pde_manager().icns().fields().field;
const auto& oset_mask = sim.repo().get_int_field("mask_cell");

const int ncomp = AMREX_SPACEDIM;

for (int lev = 0; lev < nlevels; ++lev) {

amrex::iMultiFab level_mask;
Expand Down

0 comments on commit d4de2ae

Please sign in to comment.