diff --git a/src_compressible_stag/boundaryStag.cpp b/src_compressible_stag/boundaryStag.cpp index 0fd944ef..5f7715a8 100644 --- a/src_compressible_stag/boundaryStag.cpp +++ b/src_compressible_stag/boundaryStag.cpp @@ -484,7 +484,6 @@ void BCWallReservoirFluxStag(std::array< MultiFab, AMREX_SPACEDIM >& faceflux, }); } if ((bc_mass_lo[0] == 4) && (bx.smallEnd(0) < dom.smallEnd(0))) { - int lo = dom.smallEnd(0); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { if (i < dom.smallEnd(0)) cenx(i,j,k) = cenx(i+1,j,k); @@ -499,7 +498,6 @@ void BCWallReservoirFluxStag(std::array< MultiFab, AMREX_SPACEDIM >& faceflux, }); } if ((bc_mass_hi[0] == 4) && (bx.bigEnd(0) > dom.bigEnd(0))) { - int hi = dom.bigEnd(0); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { if (i > dom.bigEnd(0)) cenx(i,j,k) = cenx(i-1,j,k); @@ -514,7 +512,6 @@ void BCWallReservoirFluxStag(std::array< MultiFab, AMREX_SPACEDIM >& faceflux, }); } if ((bc_mass_lo[1] == 4) && (bx.smallEnd(1) < dom.smallEnd(1))) { - int lo = dom.smallEnd(1); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { if (j < dom.smallEnd(1)) ceny(i,j,k) = ceny(i,j+1,k); @@ -529,7 +526,6 @@ void BCWallReservoirFluxStag(std::array< MultiFab, AMREX_SPACEDIM >& faceflux, }); } if ((bc_mass_hi[1] == 4) && (bx.bigEnd(1) > dom.bigEnd(1))) { - int hi = dom.bigEnd(1); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { if (j > dom.bigEnd(1)) ceny(i,j,k) = ceny(i,j-1,k); @@ -544,7 +540,6 @@ void BCWallReservoirFluxStag(std::array< MultiFab, AMREX_SPACEDIM >& faceflux, }); } if ((bc_mass_lo[2] == 4) && (bx.smallEnd(2) < dom.smallEnd(2))) { - int lo = dom.smallEnd(2); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { if (k < dom.smallEnd(2)) cenz(i,j,k) = cenz(i,j,k+1);; @@ -559,7 +554,6 @@ void BCWallReservoirFluxStag(std::array< MultiFab, AMREX_SPACEDIM >& faceflux, }); } if ((bc_mass_hi[2] == 4) && (bx.bigEnd(2) > dom.bigEnd(2))) { - int hi = dom.bigEnd(2); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { if (k > dom.bigEnd(2)) cenz(i,j,k) = cenz(i,j,k-1);; diff --git a/src_compressible_stag/compressible_functions_stag.H b/src_compressible_stag/compressible_functions_stag.H index 67d6bd11..66f068f2 100644 --- a/src_compressible_stag/compressible_functions_stag.H +++ b/src_compressible_stag/compressible_functions_stag.H @@ -165,12 +165,12 @@ ResetReservoirMom(std::array& cumom, const std::array& cumom_res, const amrex::Geometry& geom); -void -ReFluxCons(MultiFab& cu, const MultiFab& cu0, - const std::array& faceflux_res, - const std::array& faceflux_cont, - const amrex::Geometry& geom, - const amrex::Real dt); +//void +//ReFluxCons(MultiFab& cu, const MultiFab& cu0, +// const std::array& faceflux_res, +// const std::array& faceflux_cont, +// const amrex::Geometry& geom, +// const amrex::Real dt); void WriteCheckPoint3D(int step, diff --git a/src_compressible_stag/reservoirStag.cpp b/src_compressible_stag/reservoirStag.cpp index 7e5ac607..b59bf562 100644 --- a/src_compressible_stag/reservoirStag.cpp +++ b/src_compressible_stag/reservoirStag.cpp @@ -22,9 +22,6 @@ ComputeFluxMomReservoir(const MultiFab& cons0_in, const MultiFab& prim0_in, Box dom(geom.Domain()); Real N_A = Runiv/k_B; // Avagadro's number - Real vol = dx[0]*dx[1]*dx[2]; - Real PI = 4.0*atan(1.0); - Real sqrtPI = sqrt(PI); GpuArray mass; for (int l=0;l& cumom, // Reflux conserved qtys at the cell next to reservoir //////////////////// // not used in the current implementation ///////////////////////////////// /////////////////////////////////////////////////////////////////////////// -void -ReFluxCons(MultiFab& cu, const MultiFab& cu0, - const std::array& faceflux_res, - const std::array& faceflux_cont, - const amrex::Geometry& geom, - const amrex::Real dt) -{ - BL_PROFILE_VAR("ReFluxCons()",ReFluxCons); - - const GpuArray dx = geom.CellSizeArray(); - Box dom(geom.Domain()); - - for ( MFIter mfi(cu0); mfi.isValid(); ++mfi) { - - const Box& bx = mfi.validbox(); - - AMREX_D_TERM(Array4 const& xflux_res = faceflux_res[0].array(mfi);, - Array4 const& yflux_res = faceflux_res[1].array(mfi);, - Array4 const& zflux_res = faceflux_res[2].array(mfi);); - AMREX_D_TERM(Array4 const& xflux_cont = faceflux_cont[0].array(mfi);, - Array4 const& yflux_cont = faceflux_cont[1].array(mfi);, - Array4 const& zflux_cont = faceflux_cont[2].array(mfi);); - - const Array4& cons = cu.array(mfi); - const Array4& cons0 = cu0.array(mfi); - - // Reservoir in LO X - if ((bc_mass_lo[0] == 4) and (bx.smallEnd(0) <= dom.smallEnd(0))) { - amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept - { - if (i == dom.smallEnd(0)) { - cons(i,j,k,0) = cons0(i,j,k,0) - - (dt/dx[0])*(xflux_cont(i,j,k,0) - xflux_res(i,j,k,0)); // correct density - cons(i,j,k,4) = cons0(i,j,k,4) - - (dt/dx[0])*(xflux_cont(i,j,k,4) - xflux_res(i,j,k,4)); // correct en. density - for (int n=0;n= dom.bigEnd(0))) { - amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept - { - if (i == dom.bigEnd(0)) { - cons(i,j,k,0) = cons0(i,j,k,0) - + (dt/dx[0])*(xflux_cont(i+1,j,k,0) - xflux_res(i+1,j,k,0)); // correct density - cons(i,j,k,4) = cons0(i,j,k,4) - + (dt/dx[0])*(xflux_cont(i+1,j,k,4) - xflux_res(i+1,j,k,4)); // correct en. density - for (int n=0;n& faceflux_res, +// const std::array& faceflux_cont, +// const amrex::Geometry& geom, +// const amrex::Real dt) +//{ +// BL_PROFILE_VAR("ReFluxCons()",ReFluxCons); +// +// const GpuArray dx = geom.CellSizeArray(); +// Box dom(geom.Domain()); +// +// for ( MFIter mfi(cu0); mfi.isValid(); ++mfi) { +// +// const Box& bx = mfi.validbox(); +// +// AMREX_D_TERM(Array4 const& xflux_res = faceflux_res[0].array(mfi);, +// Array4 const& yflux_res = faceflux_res[1].array(mfi);, +// Array4 const& zflux_res = faceflux_res[2].array(mfi);); +// AMREX_D_TERM(Array4 const& xflux_cont = faceflux_cont[0].array(mfi);, +// Array4 const& yflux_cont = faceflux_cont[1].array(mfi);, +// Array4 const& zflux_cont = faceflux_cont[2].array(mfi);); +// +// const Array4& cons = cu.array(mfi); +// const Array4& cons0 = cu0.array(mfi); +// +// // Reservoir in LO X +// if ((bc_mass_lo[0] == 4) and (bx.smallEnd(0) <= dom.smallEnd(0))) { +// amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept +// { +// if (i == dom.smallEnd(0)) { +// cons(i,j,k,0) = cons0(i,j,k,0) +// - (dt/dx[0])*(xflux_cont(i,j,k,0) - xflux_res(i,j,k,0)); // correct density +// cons(i,j,k,4) = cons0(i,j,k,4) +// - (dt/dx[0])*(xflux_cont(i,j,k,4) - xflux_res(i,j,k,4)); // correct en. density +// for (int n=0;n= dom.bigEnd(0))) { +// amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept +// { +// if (i == dom.bigEnd(0)) { +// cons(i,j,k,0) = cons0(i,j,k,0) +// + (dt/dx[0])*(xflux_cont(i+1,j,k,0) - xflux_res(i+1,j,k,0)); // correct density +// cons(i,j,k,4) = cons0(i,j,k,4) +// + (dt/dx[0])*(xflux_cont(i+1,j,k,4) - xflux_res(i+1,j,k,4)); // correct en. density +// for (int n=0;n& mass, while(!stop) { // add a particle for each species (if stop[n] = false) + amrex::Real vel_rand; for (int n=0;n= 2) { - amrex::Real vel_rand = random_cross_vel(speed_ratio[n],thermal_speed[n],true,VT1,engine); // get random velocity + vel_rand = random_cross_vel(speed_ratio[n],thermal_speed[n],true,VT1,engine); // get random velocity mom_cross[1] += mass[n]*vel_rand; // add a particle crossing for total momentum en_cross += 0.5*mass[n]*(vel_rand)*(vel_rand); // add a particle crossing for total energy } // tangential component 2 if (dim == 3) { - amrex::Real vel_rand = random_cross_vel(speed_ratio[n],thermal_speed[n],true,VT2,engine); // get random velocity + vel_rand = random_cross_vel(speed_ratio[n],thermal_speed[n],true,VT2,engine); // get random velocity mom_cross[2] += mass[n]*vel_rand; // add a particle crossing for total momentum en_cross += 0.5*mass[n]*(vel_rand)*(vel_rand); // add a particle crossing for total energy } diff --git a/src_compressible_stag/timeStepStag.cpp b/src_compressible_stag/timeStepStag.cpp index b0f6aef9..caeeefab 100644 --- a/src_compressible_stag/timeStepStag.cpp +++ b/src_compressible_stag/timeStepStag.cpp @@ -360,8 +360,8 @@ void RK3stepStag(MultiFab& cu, compute_chemistry_source_CLE(dt, dx[0]*dx[1]*dx[2], prim, source, ranchem); } - amrex::Real energy_in = amrex::Real(0.0); #if defined(TURB) + amrex::Real energy_in = amrex::Real(0.0); if (turbForcing == 2) { // random forcing tubulence : get average energy input ReduceOps reduce_op; ReduceData reduce_data(reduce_op); @@ -687,8 +687,8 @@ void RK3stepStag(MultiFab& cu, compute_chemistry_source_CLE(dt, dx[0]*dx[1]*dx[2], prim, source, ranchem); } - amrex::Real energyp_in = amrex::Real(0.0); #if defined(TURB) + amrex::Real energyp_in = amrex::Real(0.0); if (turbForcing == 2) { // random forcing tubulence : get average energy input ReduceOps reduce_op; ReduceData reduce_data(reduce_op); @@ -1021,8 +1021,8 @@ void RK3stepStag(MultiFab& cu, compute_chemistry_source_CLE(dt, dx[0]*dx[1]*dx[2], prim, source, ranchem); } - amrex::Real energyp2_in = amrex::Real(0.0); #if defined(TURB) + amrex::Real energyp2_in = amrex::Real(0.0); if (turbForcing == 2) { // random forcing tubulence : get average energy input ReduceOps reduce_op; ReduceData reduce_data(reduce_op);