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 dd24307
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 15 additions & 12 deletions amr-wind/incflo_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ void incflo::advance(int inonlin)
ApplyPredictor(false, inonlin);

if (!m_use_godunov) {
if (inonlin > 0) {
amrex::Abort("Advection iterations are not supported for MOL");
}
// if (inonlin > 0) {
// amrex::Abort("Advection iterations are not supported for MOL");
// }

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

ApplyCorrector();
}
Expand Down 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 dd24307

Please sign in to comment.