Skip to content

Commit

Permalink
Fix case of multiple tracers with default initial conditions. Issue
Browse files Browse the repository at this point in the history
introduced in PR#131
  • Loading branch information
cgilet committed Sep 11, 2024
1 parent f3f129b commit a1a96cb
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/setup/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,23 @@ void incflo::ReadParameters ()
amrex::Abort("We currently require cfl <= 1.0 when using this advection scheme");
}

pp.query("ntrac", m_ntrac);

if (m_ntrac <= 0) m_advect_tracer = false;

if (m_ntrac < 1) {
amrex::Abort("We currently require at least one tracer");
}

// Initial conditions
pp.query("probtype", m_probtype);
pp.query("ic_u", m_ic_u);
pp.query("ic_v", m_ic_v);
pp.query("ic_w", m_ic_w);
pp.query("ic_p", m_ic_p);
pp.queryarr("ic_t", m_ic_t);
if ( !pp.queryarr("ic_t", m_ic_t, 0, m_ntrac) ) {
m_ic_t.resize(m_ntrac, 0.);
}

// Viscosity (if constant)
pp.query("mu", m_mu);
Expand All @@ -138,14 +148,6 @@ void incflo::ReadParameters ()
pp.query("ro_0", m_ro_0);
AMREX_ALWAYS_ASSERT(m_ro_0 >= 0.0);

pp.query("ntrac", m_ntrac);

if (m_ntrac <= 0) m_advect_tracer = false;

if (m_ntrac < 1) {
amrex::Abort("We currently require at least one tracer");
}

// Scalar diffusion coefficients
m_mu_s.resize(m_ntrac, 0.0);
pp.queryarr("mu_s", m_mu_s, 0, m_ntrac );
Expand Down

0 comments on commit a1a96cb

Please sign in to comment.