Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix case of multiple tracers with default initial conditions. Issue #132

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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