diff --git a/Exec/Channel_Test/inputs_orlanski b/Exec/Channel_Test/inputs_orlanski index abb789c..933584d 100644 --- a/Exec/Channel_Test/inputs_orlanski +++ b/Exec/Channel_Test/inputs_orlanski @@ -1,7 +1,7 @@ # ------------------ INPUTS TO MAIN PROGRAM ------------------- max_step = 10 -amrex.fpe_trap_invalid = 0 +amrex.fpe_trap_invalid = 1 fabarray.mfiter_tile_size = 1024 1024 1024 @@ -33,7 +33,7 @@ zeta.type = outflow outflow outflow outflow tke.type = outflow outflow outflow outflow # TIME STEP CONTROL -remora.fixed_dt = 800.0 # Timestep size (seconds) +remora.fixed_dt = 400.0 # Timestep size (seconds) remora.fixed_ndtfast_ratio = 10 diff --git a/Exec/Channel_Test/prob.cpp b/Exec/Channel_Test/prob.cpp index b8b691a..dbae599 100644 --- a/Exec/Channel_Test/prob.cpp +++ b/Exec/Channel_Test/prob.cpp @@ -222,36 +222,15 @@ init_custom_smflux(const Geometry& geom, const Real time, MultiFab& mf_sustr, Mu bool NSPeriodic = geomdata.isPeriodic(1); //If we had wind stress and bottom stress we would need to set these: - Real pi = 3.14159265359_rt; Real tdays=time/Real(24.0*60.0*60.0); Real dstart=0.0_rt; - Real windamp; Real userval=0.01_rt; Real mf_fcor=1.0e-4_rt; - Real air_rho=1.0_rt; //It's possible these should be set to be nonzero only at the boundaries they affect // Don't allow doubly periodic in this case - AMREX_ALWAYS_ASSERT( !NSPeriodic || !EWPeriodic); - - // Flow in x-direction (EW): - if (NSPeriodic) { - mf_sustr.setVal(0.0_rt); - } - else if (EWPeriodic) { - windamp=userval*std::sin(0.9_rt*mf_fcor*86400.0_rt*(tdays-dstart))/m_solverChoice.rho0; - mf_sustr.setVal(windamp); - } - // Flow in y-direction (NS): - if (NSPeriodic) { - if ((tdays-dstart)<=2.0) - windamp=-0.1_rt*Real(sin(pi*(tdays-dstart)/4.0_rt))/Real(m_solverChoice.rho0); - else - windamp=-0.1_rt/m_solverChoice.rho0; - mf_svstr.setVal(windamp); - } - else if(EWPeriodic) { - mf_svstr.setVal(0.0_rt); - } + Real windamp_u = userval*std::sin(0.9_rt*mf_fcor*86400.0_rt*(tdays-dstart))/m_solverChoice.rho0; + mf_sustr.setVal(windamp_u); + mf_svstr.setVal(0.0_rt); } diff --git a/Source/BoundaryConditions/BoundaryConditions_cons.cpp b/Source/BoundaryConditions/BoundaryConditions_cons.cpp index 09602fe..7d38244 100644 --- a/Source/BoundaryConditions/BoundaryConditions_cons.cpp +++ b/Source/BoundaryConditions/BoundaryConditions_cons.cpp @@ -65,9 +65,9 @@ void REMORAPhysBCFunct::impose_cons_bcs (const Array4& dest_arr, const Box if (!is_periodic_in_x) { Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1); - bx_xlo.setSmall(1,valid_bx.smallEnd(1)-1); bx_xlo.setBig(1,valid_bx.bigEnd(1)+1); + bx_xlo.setSmall(1,std::max(valid_bx.smallEnd(1)-1,dom_lo.y)); bx_xlo.setBig(1,std::min(valid_bx.bigEnd(1)+1,dom_hi.y)); Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1); - bx_xhi.setSmall(1,valid_bx.smallEnd(1)-1); bx_xhi.setBig(1,valid_bx.bigEnd(1)+1); + bx_xhi.setSmall(1,std::max(valid_bx.smallEnd(1)-1,dom_lo.y)); bx_xhi.setBig(1,std::min(valid_bx.bigEnd(1)+1,dom_hi.y)); ParallelFor( bx_xlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) { if (bc_ptr[n].lo(0) == REMORABCType::ext_dir) { @@ -109,9 +109,9 @@ void REMORAPhysBCFunct::impose_cons_bcs (const Array4& dest_arr, const Box if (!is_periodic_in_y) { Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1); - bx_ylo.setSmall(0,valid_bx.smallEnd(0)-1); bx_ylo.setBig(0,valid_bx.bigEnd(0)+1); + bx_ylo.setSmall(0,std::max(valid_bx.smallEnd(0)-1,dom_lo.x)); bx_ylo.setBig(0,std::min(valid_bx.bigEnd(0)+1,dom_hi.x)); Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1); - bx_yhi.setSmall(0,valid_bx.smallEnd(0)-1); bx_yhi.setBig(0,valid_bx.bigEnd(0)+1); + bx_yhi.setSmall(0,std::max(valid_bx.smallEnd(0)-1,dom_lo.x)); bx_yhi.setBig(0,std::min(valid_bx.bigEnd(0)+1,dom_hi.x)); ParallelFor( bx_ylo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) { if (bc_ptr[n].lo(1) == REMORABCType::ext_dir) {