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
2 changes: 1 addition & 1 deletion src/convection/incflo_compute_MAC_projected_velocities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ incflo::compute_MAC_projected_velocities (
{
MultiFab time_dep_inflow_vel(vel[lev]->boxArray(),vel[lev]->DistributionMap(),AMREX_SPACEDIM,1);
time_dep_inflow_vel.setVal(0.);
fillphysbc_velocity(lev, m_cur_time+0.5*l_dt, time_dep_inflow_vel, 1);
fillphysbc_velocity(lev, m_cur_time+Real(0.5)*l_dt, time_dep_inflow_vel, 1);

Box domain(geom[lev].Domain());
const auto dlo = lbound(domain);
Expand Down
4 changes: 2 additions & 2 deletions src/convection/incflo_compute_advection_term.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ incflo::compute_convective_term (Vector<MultiFab*> const& conv_u,

for (int lev = 0; lev <= finest_level; ++lev)
{
Real time_nph = m_cur_time + 0.5*m_dt;
Real time_nph = m_cur_time + Real(0.5)*m_dt;
if (nghost_mac() > 0)
{
// FillPatch umac.
Expand Down Expand Up @@ -458,7 +458,7 @@ incflo::compute_convective_term (Vector<MultiFab*> const& conv_u,
{
Real dux = dxinv[0]*(umac(i+1,j,k) - umac(i,j,k));
Real duy = dxinv[1]*(vmac(i,j+1,k) - vmac(i,j,k));
Real duz = (wmac) ? dxinv[2]*(wmac(i,j,k+1) - wmac(i,j,k)) : 0.0;
Real duz = (wmac) ? dxinv[2]*(wmac(i,j,k+1) - wmac(i,j,k)) : Real(0);

// To avoid inconsistencies between boxes, we make sure to fix box
// corners (2D) or edges (3D) that are not grid corners/edges.
Expand Down
4 changes: 2 additions & 2 deletions src/derive/incflo_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ void incflo::DiffFromExact (int /*lev*/, Geometry& lev_geom, Real time, Real dt,
exact = 0.0;

} else if (err_comp == 0) { // u
exact = 8.0 * (x*x*x*x - 2.0 * x*x*x + x*x) * (4.0*y*y*y - 2.0*y);
exact = Real(8) * (x*x*x*x - Real(2) * x*x*x + x*x) * (Real(4)*y*y*y - Real(2)*y);

} else if (err_comp == 1) { // v
exact = -8.0 * (4.0*x*x*x - 6.0 * x*x + 2.*x) * (y*y*y*y - y*y);
exact = -Real(8) * (Real(4)*x*x*x - Real(6) * x*x + Real(2)*x) * (y*y*y*y - y*y);
}

err(i,j,k,soln_comp) -= exact;
Expand Down
32 changes: 16 additions & 16 deletions src/incflo_compute_forces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ void incflo::compute_vel_forces_on_level (int lev,
});

} else if (m_probtype == 16) {
Real Re = 1./m_mu; // Note this assumes you are running exactly the problem set up, with U = 1 and L = 1 and rho = 1.
Real Re = Real(1)/m_mu; // Note this assumes you are running exactly the problem set up, with U = 1 and L = 1 and rho = 1.
ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
Real rhoinv = Real(1.0)/rho(i,j,k);
Real rhoinv = Real(1)/rho(i,j,k);

if (include_pressure_gradient)
{
Expand All @@ -137,29 +137,29 @@ void incflo::compute_vel_forces_on_level (int lev,
vel_f(i,j,k,2) = -( l_gp0[2])*rhoinv + l_gravity[2];);
}

Real x = (i+0.5) * dx[0];
Real y = (j+0.5) * dx[1];
Real x = (i+Real(0.5)) * dx[0];
Real y = (j+Real(0.5)) * dx[1];

Real f = x*x*x*x - 2.*x*x*x + x*x;
Real f = x*x*x*x - Real(2)*x*x*x + x*x;
Real g = y*y*y*y - y*y;
Real capF = 0.2 * x*x*x*x*x - 0.5 * x*x*x*x + (1./3.)* x*x*x;
Real capF1 = -4.0 * x*x*x*x*x*x + 12.0 * x*x*x*x*x - 14. * x*x*x*x + 8.0 * x*x*x - 2.0 * x*x;
Real capF2 = 0.5 * f * f;
Real capG1 = -24.0 * y*y*y*y*y + 8.0 * y*y*y - 4.0 * y;
Real capF = Real(0.2) * x*x*x*x*x - Real(0.5) * x*x*x*x + (Real(1)/Real(3)) * x*x*x;
Real capF1 = Real(-4) * x*x*x*x*x*x + Real(12) * x*x*x*x*x - Real(14) * x*x*x*x + Real(8) * x*x*x - Real(2) * x*x;
Real capF2 = Real(0.5) * f * f;
Real capG1 = Real(-24) * y*y*y*y*y + Real(8) * y*y*y - Real(4) * y;

Real fp = 4.0 * x*x*x - 6.0*x*x + 2.0*x;
//Real fpp = 12.0 * x*x - 12.0*x + 2.0;
Real fppp = 24.0 * x - 12.0;
Real fp = Real(4) * x*x*x - Real(6)*x*x + Real(2)*x;
//Real fpp = Real(12) * x*x - Real(12)*x + Real(2);
Real fppp = Real(24) * x - Real(12);

Real gp = 4.0 * y*y*y - 2.0*y;
Real gpp = 12.0 * y*y - 2.0;
Real gp = Real(4) * y*y*y - Real(2)*y;
Real gpp = Real(12) * y*y - Real(2);

vel_f(i,j,k,1) += 8.0 / Re * (24.0 * capF + 2.0 * fp * gpp + fppp * g) + 64.0 * (capF2 * capG1 - g * gp * capF1);
vel_f(i,j,k,1) += Real(8) / Re * (Real(24) * capF + Real(2) * fp * gpp + fppp * g) + Real(64) * (capF2 * capG1 - g * gp * capF1);
});
} else {
ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
Real rhoinv = Real(1.0)/rho(i,j,k);
Real rhoinv = Real(1)/rho(i,j,k);

if (include_pressure_gradient)
{
Expand Down
10 changes: 5 additions & 5 deletions src/incflo_tagging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ void incflo::ErrorEst (int levc, TagBoxArray& tags, Real time, int /*ngrow*/)

ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
Real x = problo[0] + (i+0.5)*l_dx;
Real y = problo[1] + (j+0.5)*l_dy;
Real x = problo[0] + (i+Real(0.5))*l_dx;
Real y = problo[1] + (j+Real(0.5))*l_dy;

// Tag if we are inside the specified box
if (x >= xlo && x <= xhi && y >= ylo && y <= yhi)
Expand All @@ -122,9 +122,9 @@ void incflo::ErrorEst (int levc, TagBoxArray& tags, Real time, int /*ngrow*/)

ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
Real x = problo[0] + Real(i+0.5)*l_dx;
Real y = problo[1] + Real(j+0.5)*l_dy;
Real z = problo[2] + Real(k+0.5)*l_dz;
Real x = problo[0] + Real(i+Real(0.5))*l_dx;
Real y = problo[1] + Real(j+Real(0.5))*l_dy;
Real z = problo[2] + Real(k+Real(0.5))*l_dz;

// Tag if we are inside the specified box
if (x >= xlo && x <= xhi && y >= ylo && y <= yhi && z >= zlo && z <= zhi)
Expand Down
2 changes: 1 addition & 1 deletion src/incflo_update_temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void incflo::update_temperature (StepType step_type, Vector<MultiFab>& tem_eta,
if (!m_use_temperature) { return; }

Real const new_time = m_cur_time + m_dt;
Real const half_time = m_cur_time + m_dt/2.;
Real const half_time = m_cur_time + m_dt * Real(0.5);

// *************************************************************************************
// Compute the temperature forcing terms
Expand Down
16 changes: 8 additions & 8 deletions src/prob/prob_bc.H
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,23 @@ struct IncfloVelFill
}
else if (31 == probtype)
{
amrex::Real y = amrex::Real(j+0.5)*(amrex::Real(1.0)/domain_box.length(1));
norm_vel = amrex::Real(6.) * y * (amrex::Real(1.0)-y);
amrex::Real y = amrex::Real(j+0.5)*(amrex::Real(1)/domain_box.length(1));
norm_vel = amrex::Real(6.) * y * (amrex::Real(1)-y);
}
else if (43 == probtype)
{
amrex::Real y = amrex::Real(j+0.5)*(amrex::Real(1.0)/domain_box.length(1));
norm_vel = amrex::Real(6.) * y * (amrex::Real(1.0)-y) - 1.0;
norm_vel = amrex::Real(6) * y * (amrex::Real(1)-y) - amrex::Real(1);
}
#if (AMREX_SPACEDIM == 3)
else if (311 == probtype)
{
amrex::Real z = amrex::Real(k+0.5)*(amrex::Real(1.0)/domain_box.length(2));
norm_vel = amrex::Real(6.) * z * (amrex::Real(1.0)-z);
amrex::Real z = amrex::Real(k+0.5)*(amrex::Real(1)/domain_box.length(2));
norm_vel = amrex::Real(6.) * z * (amrex::Real(1)-z);
}
else if (41 == probtype)
{
amrex::Real z = amrex::Real(k+0.5)*(amrex::Real(1.0)/domain_box.length(2));
amrex::Real z = amrex::Real(k+0.5)*(amrex::Real(1)/domain_box.length(2));
norm_vel = amrex::Real(0.5) * z;
}
#endif
Expand Down Expand Up @@ -113,7 +113,7 @@ struct IncfloVelFill
else if (43 == probtype)
{
amrex::Real y = amrex::Real(j+0.5)*(amrex::Real(1.0)/domain_box.length(1));
norm_vel = amrex::Real(6.) * y * (amrex::Real(1.0)-y) - 1.0;
norm_vel = amrex::Real(6) * y * (amrex::Real(1.0)-y) - amrex::Real(1);
}

// This is a special case -- all the logic is contained here
Expand Down Expand Up @@ -188,7 +188,7 @@ struct IncfloVelFill
if (16 == probtype)
{
amrex::Real x = amrex::Real(i+0.5)*(amrex::Real(1.0)/domain_box.length(0));
norm_vel = 16.0 * (x*x*x*x - 2.0 * x*x*x + x*x);
norm_vel = amrex::Real(16) * (x*x*x*x - amrex::Real(2) * x*x*x + x*x);
}

#if (AMREX_SPACEDIM == 3)
Expand Down
Loading
Loading