Skip to content
Merged
Show file tree
Hide file tree
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
34 changes: 17 additions & 17 deletions src/incflo_advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ void incflo::Advance()
// Start timing current time step
Real strt_step = static_cast<Real>(ParallelDescriptor::second());

int ng = nghost_state();
for (int lev = 0; lev <= finest_level; ++lev) {
fillpatch_velocity(lev, m_cur_time, m_leveldata[lev]->velocity, ng);
fillpatch_density(lev, m_cur_time, m_leveldata[lev]->density, ng);
if (m_advect_tracer) {
fillpatch_tracer(lev, m_cur_time, m_leveldata[lev]->tracer, ng);
}
if (m_use_temperature) {
fillpatch_temperature(lev, m_cur_time, m_leveldata[lev]->temperature, ng);
}
}

copy_from_new_to_old_velocity(IntVect(ng));
copy_from_new_to_old_density(IntVect(ng));
copy_from_new_to_old_tracer(IntVect(ng));
copy_from_new_to_old_temperature(IntVect(ng));

// Compute time step size
int initialisation = ( m_dt < 0 );
bool explicit_diffusion = (m_diff_type == DiffusionType::Explicit);
Expand All @@ -29,23 +46,6 @@ void incflo::Advance()
<< " with dt = " << m_dt << ".\n" << "\n";
}

copy_from_new_to_old_velocity();
copy_from_new_to_old_density();
copy_from_new_to_old_tracer();
copy_from_new_to_old_temperature();

int ng = nghost_state();
for (int lev = 0; lev <= finest_level; ++lev) {
fillpatch_velocity(lev, m_t_old[lev], m_leveldata[lev]->velocity_o, ng);
fillpatch_density(lev, m_t_old[lev], m_leveldata[lev]->density_o, ng);
if (m_advect_tracer) {
fillpatch_tracer(lev, m_t_old[lev], m_leveldata[lev]->tracer_o, ng);
}
if (m_use_temperature) {
fillpatch_temperature(lev, m_t_old[lev], m_leveldata[lev]->temperature_o, ng);
}
}

#ifdef AMREX_USE_EB
if (m_eb_flow.enabled) {
for (int lev = 0; lev <= finest_level; ++lev) {
Expand Down
2 changes: 2 additions & 0 deletions src/incflo_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ void incflo::copy_from_old_to_new_tracer (int lev, IntVect const& ng)

void incflo::copy_from_new_to_old_temperature (IntVect const& ng)
{
if (!m_use_temperature) { return; }
for (int lev = 0; lev <= finest_level; ++lev) {
MultiFab::Copy(m_leveldata[lev]->temperature_o,
m_leveldata[lev]->temperature, 0, 0, 1, ng);
Expand All @@ -482,6 +483,7 @@ void incflo::copy_from_new_to_old_temperature (IntVect const& ng)

void incflo::copy_from_old_to_new_temperature (IntVect const& ng)
{
if (!m_use_temperature) { return; }
for (int lev = 0; lev <= finest_level; ++lev) {
MultiFab::Copy(m_leveldata[lev]->temperature,
m_leveldata[lev]->temperature_o, 0, 0, 1, ng);
Expand Down
34 changes: 17 additions & 17 deletions src/setup/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,22 @@ void incflo::InitialIterations ()
{
BL_PROFILE("incflo::InitialIterations()");

copy_from_new_to_old_velocity();
copy_from_new_to_old_density();
copy_from_new_to_old_tracer();
copy_from_new_to_old_temperature();
int ng = nghost_state();
for (int lev = 0; lev <= finest_level; ++lev) {
fillpatch_velocity(lev, m_cur_time, m_leveldata[lev]->velocity, ng);
fillpatch_density(lev, m_cur_time, m_leveldata[lev]->density, ng);
if (m_advect_tracer) {
fillpatch_tracer(lev, m_cur_time, m_leveldata[lev]->tracer, ng);
}
if (m_use_temperature) {
fillpatch_temperature(lev, m_cur_time, m_leveldata[lev]->temperature, ng);
}
}

copy_from_new_to_old_velocity(IntVect(ng));
copy_from_new_to_old_density(IntVect(ng));
copy_from_new_to_old_tracer(IntVect(ng));
copy_from_new_to_old_temperature(IntVect(ng));

int initialisation = 1;
bool explicit_diffusion = (m_diff_type == DiffusionType::Explicit);
Expand All @@ -456,23 +468,11 @@ void incflo::InitialIterations ()
for (int lev = 0; lev <= finest_level; ++lev) m_t_old[lev] = m_t_new[lev];
for (int lev = 0; lev <= finest_level; ++lev) mac_phi[lev]->setVal(0.);

int ng = nghost_state();
for (int lev = 0; lev <= finest_level; ++lev) {
fillpatch_velocity(lev, m_t_old[lev], m_leveldata[lev]->velocity_o, ng);
fillpatch_density(lev, m_t_old[lev], m_leveldata[lev]->density_o, ng);
if (m_advect_tracer) {
fillpatch_tracer(lev, m_t_old[lev], m_leveldata[lev]->tracer_o, ng);
}
if (m_use_temperature) {
fillpatch_temperature(lev, m_t_old[lev], m_leveldata[lev]->temperature_o, ng);
}
}

for (int iter = 0; iter < m_initial_iterations; ++iter)
{
if (m_verbose) amrex::Print() << "\n In initial_iterations: iter = " << iter << "\n";

ApplyPredictor(true);
ApplyPredictor(true);

copy_from_old_to_new_velocity();
copy_from_old_to_new_density();
Expand Down
Loading