Skip to content

Commit

Permalink
Use incflo::m_ic_t to initialize tracer initial conditions. Also
Browse files Browse the repository at this point in the history
includes updating m_ic_t to hold multiple tracers.
  • Loading branch information
cgilet committed Sep 10, 2024
1 parent 3db46ad commit 982e264
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/incflo.H
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,16 @@ private:
// Be verbose?
int m_verbose = 0;

// number of tracers
int m_ntrac = 1;

// Member variables for initial conditions
int m_probtype = 0;
amrex::Real m_ic_u = amrex::Real(0.0);
amrex::Real m_ic_v = amrex::Real(0.0);
amrex::Real m_ic_w = amrex::Real(0.0);
amrex::Real m_ic_p = amrex::Real(0.0);
amrex::Real m_ic_t = amrex::Real(0.0);
amrex::Vector<amrex::Real> m_ic_t = amrex::Vector<amrex::Real> (m_ntrac, amrex::Real(0.0));

amrex::Vector<amrex::Real> m_t_old;
amrex::Vector<amrex::Real> m_t_new;
Expand Down Expand Up @@ -670,8 +673,6 @@ private:
amrex::Vector<int> m_iconserv_tracer;
amrex::Gpu::DeviceVector<int> m_iconserv_tracer_d;

int m_ntrac = 1;

std::unique_ptr<DiffusionTensorOp> m_diffusion_tensor_op;
std::unique_ptr<DiffusionScalarOp> m_diffusion_scalar_op;

Expand Down
4 changes: 3 additions & 1 deletion src/prob/prob_init_fluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ void incflo::prob_init_fluid (int lev)
ld.velocity.setVal(m_ic_v, 1, 1);,
ld.velocity.setVal(m_ic_w, 2, 1););

if (m_ntrac > 0) ld.tracer.setVal(0.0);
for (int comp = 0; comp < m_ntrac; comp++) {
ld.tracer.setVal(m_ic_t[comp], comp, 1);
}

for (MFIter mfi(ld.density); mfi.isValid(); ++mfi)
{
Expand Down
2 changes: 1 addition & 1 deletion src/setup/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void incflo::ReadParameters ()
pp.query("ic_v", m_ic_v);
pp.query("ic_w", m_ic_w);
pp.query("ic_p", m_ic_p);
pp.query("ic_t", m_ic_t);
pp.queryarr("ic_t", m_ic_t);

// Viscosity (if constant)
pp.query("mu", m_mu);
Expand Down

0 comments on commit 982e264

Please sign in to comment.