From 8005fb368f6db8dbd5b6cf97feca5bf794783e0e Mon Sep 17 00:00:00 2001 From: Hannah Klion Date: Mon, 26 Aug 2024 14:10:38 -0700 Subject: [PATCH 1/3] added more BC options and add option to specify it by varialbe, like in ROMS --- .../BoundaryConditions/REMORA_FillPatch.cpp | 12 +- Source/IndexDefines.H | 13 +- Source/Initialization/REMORA_init_bcs.cpp | 498 ++++++++++++------ Source/REMORA.H | 5 +- 4 files changed, 365 insertions(+), 163 deletions(-) diff --git a/Source/BoundaryConditions/REMORA_FillPatch.cpp b/Source/BoundaryConditions/REMORA_FillPatch.cpp index 36400bc..e87800d 100644 --- a/Source/BoundaryConditions/REMORA_FillPatch.cpp +++ b/Source/BoundaryConditions/REMORA_FillPatch.cpp @@ -425,7 +425,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel) if (!Geom(lev).isPeriodic(0)) { // Low-x side if (bx.smallEnd(0) <= domain.smallEnd(0)) { - Real mult = (phys_bc_type[0] == REMORA_BC::no_slip_wall) ? -1. : 1.; + Real mult = (phys_bc_type[BCVars::xvel_bc][0] == REMORA_BC::no_slip_wall) ? -1. : 1.; ParallelFor(makeSlab(bx,0,0), [=] AMREX_GPU_DEVICE(int , int j, int k) noexcept { vel_arr(-1,j,k,1) = mult*vel_arr(0,j,k,1); // v @@ -435,7 +435,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel) // High-x side if (bx.bigEnd(0) >= domain.bigEnd(0)) { - Real mult = (phys_bc_type[3] == REMORA_BC::no_slip_wall) ? -1. : 1.; + Real mult = (phys_bc_type[BCVars::xvel_bc][3] == REMORA_BC::no_slip_wall) ? -1. : 1.; ParallelFor(makeSlab(bx,0,0), [=] AMREX_GPU_DEVICE(int , int j, int k) noexcept { vel_arr(ihi+1,j,k,1) = mult*vel_arr(ihi,j,k,1); // v @@ -447,7 +447,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel) if (!Geom(lev).isPeriodic(1)) { // Low-y side if (bx.smallEnd(1) <= domain.smallEnd(1)) { - Real mult = (phys_bc_type[1] == REMORA_BC::no_slip_wall) ? -1. : 1.; + Real mult = (phys_bc_type[BCVars::yvel_bc][1] == REMORA_BC::no_slip_wall) ? -1. : 1.; ParallelFor(makeSlab(bx,1,0), [=] AMREX_GPU_DEVICE(int i, int , int k) noexcept { vel_arr(i,-1,k,0) = mult*vel_arr(i,0,k,0); // u @@ -457,7 +457,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel) // High-y side if (bx.bigEnd(1) >= domain.bigEnd(1)) { - Real mult = (phys_bc_type[4] == REMORA_BC::no_slip_wall) ? -1. : 1.; + Real mult = (phys_bc_type[BCVars::yvel_bc][4] == REMORA_BC::no_slip_wall) ? -1. : 1.; ParallelFor(makeSlab(bx,1,0), [=] AMREX_GPU_DEVICE(int i, int , int k) noexcept { vel_arr(i,jhi+1,k,0) = mult*vel_arr(i,jhi,k,0); // u @@ -469,7 +469,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel) if (!Geom(lev).isPeriodic(2)) { // Low-z side if (bx.smallEnd(2) <= domain.smallEnd(2)) { - Real mult = (phys_bc_type[2] == REMORA_BC::no_slip_wall) ? -1. : 1.; + Real mult = (phys_bc_type[BCVars::zvel_bc][2] == REMORA_BC::no_slip_wall) ? -1. : 1.; ParallelFor(makeSlab(bx,2,0), [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept { vel_arr(i,j,-1,0) = mult*vel_arr(i,j,0,0); // u @@ -479,7 +479,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel) // High-z side if (bx.bigEnd(2) >= domain.bigEnd(2)) { - Real mult = (phys_bc_type[5] == REMORA_BC::no_slip_wall) ? -1. : 1.; + Real mult = (phys_bc_type[BCVars::zvel_bc][5] == REMORA_BC::no_slip_wall) ? -1. : 1.; ParallelFor(makeSlab(bx,2,0), [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept { vel_arr(i,j,khi+1,0) = mult*vel_arr(i,j,khi,0); // u diff --git a/Source/IndexDefines.H b/Source/IndexDefines.H index 27c9922..e1a845f 100644 --- a/Source/IndexDefines.H +++ b/Source/IndexDefines.H @@ -21,6 +21,10 @@ namespace BCVars { xvel_bc = NCONS, yvel_bc, zvel_bc, + ubar_bc, + vbar_bc, + zeta_bc, + tke_bc, foextrap_bc, NumTypes }; @@ -44,7 +48,8 @@ namespace BdyVars { } enum struct REMORA_BC { - symmetry, inflow, outflow, no_slip_wall, slip_wall, periodic, undefined + symmetry, inflow, outflow, no_slip_wall, slip_wall, periodic, + clamped, chapman, flather, orlanski_rad, undefined }; // NOTE: the first of these must match up with the BCType enum @@ -56,7 +61,11 @@ enum mathematicalBndryTypes : int { bogus = -666, int_dir = 0, reflect_even = 1, foextrap = 2, - ext_dir = 3 + ext_dir = 3, + clamped = 4, + chapman = 5, + flather = 6, + orlanski_rad = 7 }; } #endif diff --git a/Source/Initialization/REMORA_init_bcs.cpp b/Source/Initialization/REMORA_init_bcs.cpp index f9f444d..49cb67f 100644 --- a/Source/Initialization/REMORA_init_bcs.cpp +++ b/Source/Initialization/REMORA_init_bcs.cpp @@ -8,106 +8,163 @@ using namespace amrex; void REMORA::init_bcs () { - auto f = [this] (std::string const& bcid, Orientation ori) - { - // These are simply defaults for Dirichlet faces -- they should be over-written below - m_bc_extdir_vals[BCVars::Temp_bc_comp ][ori] = 1.e19_rt; - m_bc_extdir_vals[BCVars::Salt_bc_comp ][ori] = 1.e20_rt; - m_bc_extdir_vals[BCVars::Scalar_bc_comp][ori] = 1.e21_rt; - - m_bc_extdir_vals[BCVars::xvel_bc][ori] = 0.0_rt; // default - m_bc_extdir_vals[BCVars::yvel_bc][ori] = 0.0_rt; - m_bc_extdir_vals[BCVars::zvel_bc][ori] = 0.0_rt; - - ParmParse pp(bcid); - std::string bc_type_in = "null"; - pp.query("type", bc_type_in); - std::string bc_type = amrex::toLower(bc_type_in); - - if (bc_type == "symmetry") + auto f_set_var_bc = [this] (ParmParse& pp, int bcvar_type, Orientation ori, std::string bc_type_string) { + if (bc_type_string == "symmetry") { - phys_bc_type[ori] = REMORA_BC::symmetry; + phys_bc_type[bcvar_type][ori] = REMORA_BC::symmetry; domain_bc_type[ori] = "Symmetry"; } - else if (bc_type == "outflow") + else if (bc_type_string == "outflow") { - phys_bc_type[ori] = REMORA_BC::outflow; + phys_bc_type[bcvar_type][ori] = REMORA_BC::outflow; domain_bc_type[ori] = "Outflow"; } - else if (bc_type == "inflow") + else if (bc_type_string == "inflow") { - phys_bc_type[ori] = REMORA_BC::inflow; + phys_bc_type[bcvar_type][ori] = REMORA_BC::inflow; domain_bc_type[ori] = "Inflow"; - std::vector v; - pp.getarr("velocity", v, 0, AMREX_SPACEDIM); - m_bc_extdir_vals[BCVars::xvel_bc][ori] = v[0]; - m_bc_extdir_vals[BCVars::yvel_bc][ori] = v[1]; - m_bc_extdir_vals[BCVars::zvel_bc][ori] = v[2]; - - Real scalar_in = 0.; - if (pp.query("scalar", scalar_in)) - m_bc_extdir_vals[BCVars::Scalar_bc_comp][ori] = scalar_in; + if (bcvar_type == BCVars::xvel_bc || bcvar_type == BCVars::yvel_bc || + bcvar_type == BCVars::zvel_bc) { + std::vector v; + pp.getarr("velocity", v, 0, AMREX_SPACEDIM); + m_bc_extdir_vals[bcvar_type][ori] = v[bcvar_type - BCVars::xvel_bc]; + } else if (bcvar_type == BCVars::Scalar_bc_comp) { + Real scalar_in = 0.; + if (pp.query("scalar", scalar_in)) + m_bc_extdir_vals[BCVars::Scalar_bc_comp][ori] = scalar_in; + } } - else if (bc_type == "noslipwall") + else if (bc_type_string == "noslipwall") { - phys_bc_type[ori] = REMORA_BC::no_slip_wall; + phys_bc_type[bcvar_type][ori] = REMORA_BC::no_slip_wall; domain_bc_type[ori] = "NoSlipWall"; - std::vector v; + if (bcvar_type == BCVars::xvel_bc || bcvar_type == BCVars::yvel_bc || + bcvar_type == BCVars::zvel_bc) { + std::vector v; - // The values of m_bc_extdir_vals default to 0. - // But if we find "velocity" in the inputs file, use those values instead. - if (pp.queryarr("velocity", v, 0, AMREX_SPACEDIM)) - { - v[ori.coordDir()] = 0.0_rt; - m_bc_extdir_vals[BCVars::xvel_bc][ori] = v[0]; - m_bc_extdir_vals[BCVars::yvel_bc][ori] = v[1]; - m_bc_extdir_vals[BCVars::zvel_bc][ori] = v[2]; + // The values of m_bc_extdir_vals default to 0. + // But if we find "velocity" in the inputs file, use those values instead. + if (pp.queryarr("velocity", v, 0, AMREX_SPACEDIM)) + { + v[ori.coordDir()] = 0.0_rt; + m_bc_extdir_vals[bcvar_type][ori] = v[bcvar_type - BCVars::xvel_bc]; + } } } - else if (bc_type == "slipwall") + else if (bc_type_string == "slipwall") { - phys_bc_type[ori] = REMORA_BC::slip_wall; + phys_bc_type[bcvar_type][ori] = REMORA_BC::slip_wall; domain_bc_type[ori] = "SlipWall"; } + else if (bc_type_string == "clamped") + { + phys_bc_type[bcvar_type][ori] = REMORA_BC::clamped; + domain_bc_type[ori] = "Clamped"; + } + else if (bc_type_string == "periodic") + { + phys_bc_type[bcvar_type][ori] = REMORA_BC::periodic; + domain_bc_type[ori] = "Periodic"; + } else { - phys_bc_type[ori] = REMORA_BC::undefined; + phys_bc_type[bcvar_type][ori] = REMORA_BC::undefined; } if (geom[0].isPeriodic(ori.coordDir())) { domain_bc_type[ori] = "Periodic"; - if (phys_bc_type[ori] == REMORA_BC::undefined) + if (phys_bc_type[bcvar_type][ori] == REMORA_BC::undefined) { - phys_bc_type[ori] = REMORA_BC::periodic; - } else { + phys_bc_type[bcvar_type][ori] = REMORA_BC::periodic; + } else if (phys_bc_type[bcvar_type][ori] != REMORA_BC::periodic) { amrex::Abort("Wrong BC type for periodic boundary"); } } - if (phys_bc_type[ori] == REMORA_BC::undefined) + if (phys_bc_type[bcvar_type][ori] == REMORA_BC::undefined) { - amrex::Print() << "BC Type specified for face " << bcid << " is " << bc_type_in << std::endl; + amrex::Print() << "BC Type specified for fac is " << bc_type_string << std::endl; amrex::Abort("This BC type is unknown"); } - if ((bcid == "xlo" || bcid == "xhi" || - bcid == "ylo" || bcid == "yhi") && + if ((ori == Orientation(Direction::x,Orientation::low) || ori == Orientation(Direction::y,Orientation::low) || + ori == Orientation(Direction::x,Orientation::high) || ori == Orientation(Direction::y,Orientation::high)) && solverChoice.ic_bc_type == IC_BC_Type::Real && - phys_bc_type[ori] != REMORA_BC::outflow) + phys_bc_type[bcvar_type][ori] != REMORA_BC::clamped) { amrex::Abort("BC type must be outflow in x and y when reading BCs from file"); } }; - f("xlo", Orientation(Direction::x,Orientation::low)); - f("xhi", Orientation(Direction::x,Orientation::high)); - f("ylo", Orientation(Direction::y,Orientation::low)); - f("yhi", Orientation(Direction::y,Orientation::high)); - f("zlo", Orientation(Direction::z,Orientation::low)); - f("zhi", Orientation(Direction::z,Orientation::high)); + auto f_by_side = [this, &f_set_var_bc] (std::string const& bcid, Orientation ori) + { + ParmParse pp(bcid); + std::string bc_type_in = "null"; + pp.query("type", bc_type_in); + std::string bc_type = amrex::toLower(bc_type_in); + + for (int icomp=0; icomp orientations = {Orientation(Direction::x,Orientation::low), Orientation(Direction::y,Orientation::high),Orientation(Direction::x,Orientation::high),Orientation(Direction::y,Orientation::low)}; // west, south, east, north [matches ROMS] + std::vector bc_types; + ParmParse pp(varname); + std::string bc_type_in = "null"; + pp.queryarr("type", bc_types); + AMREX_ASSERT(bc_types.size() == 4); + for (int i=0; i<4; i++) { + std::string bc_type = amrex::toLower(bc_types[i]); + auto ori = orientations[i]; + f_set_var_bc(pp, bcvar_type, ori, bc_type); + } + }; + + for (OrientationIter oit; oit; ++oit) { + Orientation ori = oit(); + // These are simply defaults for Dirichlet faces -- they should be over-written below if needed + m_bc_extdir_vals[BCVars::Temp_bc_comp ][ori] = 1.e19_rt; + m_bc_extdir_vals[BCVars::Salt_bc_comp ][ori] = 1.e20_rt; + m_bc_extdir_vals[BCVars::Scalar_bc_comp][ori] = 1.e21_rt; + + m_bc_extdir_vals[BCVars::xvel_bc][ori] = 0.0_rt; // default + m_bc_extdir_vals[BCVars::yvel_bc][ori] = 0.0_rt; + m_bc_extdir_vals[BCVars::zvel_bc][ori] = 0.0_rt; + } + + // Whether to specify boundary conditions by variable (then side). + // Alternative is to do it by side by indicating keywords that indicate multiple variables + set_bcs_by_var = false; + + ParmParse pp("remora"); + pp.query("boundary_per_side", set_bcs_by_var); + if (!set_bcs_by_var) { + f_by_side("xlo", Orientation(Direction::x,Orientation::low)); + f_by_side("xhi", Orientation(Direction::x,Orientation::high)); + f_by_side("ylo", Orientation(Direction::y,Orientation::low)); + f_by_side("yhi", Orientation(Direction::y,Orientation::high)); + } else { + f_by_var("temp", BCVars::Temp_bc_comp); + f_by_var("salt", BCVars::Salt_bc_comp); + f_by_var("scalar", BCVars::Scalar_bc_comp); + f_by_var("u", BCVars::xvel_bc); + f_by_var("v", BCVars::yvel_bc); + f_by_var("w", BCVars::zvel_bc); + f_by_var("ubar", BCVars::ubar_bc); + f_by_var("vbar", BCVars::vbar_bc); + f_by_var("zeta", BCVars::zeta_bc); + f_by_var("tke", BCVars::tke_bc); + } + + // Always specify z direction by side keyword + f_by_side("zlo", Orientation(Direction::z,Orientation::low)); + f_by_side("zhi", Orientation(Direction::z,Orientation::high)); // ***************************************************************************** // @@ -116,81 +173,75 @@ void REMORA::init_bcs () // // ***************************************************************************** { - domain_bcs_type.resize(AMREX_SPACEDIM+NCONS+1); - domain_bcs_type_d.resize(AMREX_SPACEDIM+NCONS+1); + domain_bcs_type.resize(AMREX_SPACEDIM+NCONS+5); + domain_bcs_type_d.resize(AMREX_SPACEDIM+NCONS+5); for (OrientationIter oit; oit; ++oit) { Orientation ori = oit(); int dir = ori.coordDir(); Orientation::Side side = ori.faceDir(); - auto const bct = phys_bc_type[ori]; - if ( bct == REMORA_BC::symmetry ) - { - if (side == Orientation::low) { - for (int i = 0; i < AMREX_SPACEDIM; i++) + for (int i = 0; i < AMREX_SPACEDIM; i++) { + auto const bct = phys_bc_type[BCVars::xvel_bc+i][ori]; + if ( bct == REMORA_BC::symmetry ) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::xvel_bc+i].setLo(dir, REMORABCType::reflect_even); - domain_bcs_type[BCVars::xvel_bc+dir].setLo(dir, REMORABCType::reflect_odd); - } else { - for (int i = 0; i < AMREX_SPACEDIM; i++) + if (i==2) + domain_bcs_type[BCVars::xvel_bc+dir].setLo(dir, REMORABCType::reflect_odd); + } else { domain_bcs_type[BCVars::xvel_bc+i].setHi(dir, REMORABCType::reflect_even); - domain_bcs_type[BCVars::xvel_bc+dir].setHi(dir, REMORABCType::reflect_odd); + if (i==2) + domain_bcs_type[BCVars::xvel_bc+dir].setHi(dir, REMORABCType::reflect_odd); + } } - } - else if (bct == REMORA_BC::outflow) - { - if (side == Orientation::low) { - for (int i = 0; i < AMREX_SPACEDIM; i++) + else if (bct == REMORA_BC::outflow || bct == REMORA_BC::clamped) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::xvel_bc+i].setLo(dir, REMORABCType::foextrap); - } else { - for (int i = 0; i < AMREX_SPACEDIM; i++) + } else { domain_bcs_type[BCVars::xvel_bc+i].setHi(dir, REMORABCType::foextrap); + } } - } - else if (bct == REMORA_BC::inflow) - { - if (side == Orientation::low) { - for (int i = 0; i < AMREX_SPACEDIM; i++) { + else if (bct == REMORA_BC::inflow) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::xvel_bc+i].setLo(dir, REMORABCType::ext_dir); - } - } else { - for (int i = 0; i < AMREX_SPACEDIM; i++) { + } else { domain_bcs_type[BCVars::xvel_bc+i].setHi(dir, REMORABCType::ext_dir); } } - } - else if (bct == REMORA_BC::no_slip_wall) - { - if (side == Orientation::low) { - for (int i = 0; i < AMREX_SPACEDIM; i++) + else if (bct == REMORA_BC::no_slip_wall) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::xvel_bc+i].setLo(dir, REMORABCType::ext_dir); - } else { - for (int i = 0; i < AMREX_SPACEDIM; i++) + } else { domain_bcs_type[BCVars::xvel_bc+i].setHi(dir, REMORABCType::ext_dir); + } } - } - else if (bct == REMORA_BC::slip_wall) - { - if (side == Orientation::low) { - for (int i = 0; i < AMREX_SPACEDIM; i++) + else if (bct == REMORA_BC::slip_wall) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::xvel_bc+i].setLo(dir, REMORABCType::foextrap); - // Only normal direction has ext_dir - domain_bcs_type[BCVars::xvel_bc+dir].setLo(dir, REMORABCType::ext_dir); + if (i==2) { + // Only normal direction has ext_dir + domain_bcs_type[BCVars::xvel_bc+dir].setLo(dir, REMORABCType::ext_dir); + } - } else { - for (int i = 0; i < AMREX_SPACEDIM; i++) + } else { domain_bcs_type[BCVars::xvel_bc+i].setHi(dir, REMORABCType::foextrap); - // Only normal direction has ext_dir - domain_bcs_type[BCVars::xvel_bc+dir].setHi(dir, REMORABCType::ext_dir); + if (i==2) { + // Only normal direction has ext_dir + domain_bcs_type[BCVars::xvel_bc+dir].setHi(dir, REMORABCType::ext_dir); + } + } } - } - else if (bct == REMORA_BC::periodic) - { - if (side == Orientation::low) { - for (int i = 0; i < AMREX_SPACEDIM; i++) + else if (bct == REMORA_BC::periodic) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::xvel_bc+i].setLo(dir, REMORABCType::int_dir); - } else { - for (int i = 0; i < AMREX_SPACEDIM; i++) + } else { domain_bcs_type[BCVars::xvel_bc+i].setHi(dir, REMORABCType::int_dir); + } } } } @@ -207,67 +258,206 @@ void REMORA::init_bcs () Orientation ori = oit(); int dir = ori.coordDir(); Orientation::Side side = ori.faceDir(); - auto const bct = phys_bc_type[ori]; - if ( bct == REMORA_BC::symmetry ) - { - if (side == Orientation::low) { - for (int i = 0; i < NCONS; i++) + for (int i = 0; i < NCONS; i++) { + auto const bct = phys_bc_type[BCVars::cons_bc+i][ori]; + if ( bct == REMORA_BC::symmetry ) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::cons_bc+i].setLo(dir, REMORABCType::reflect_even); - } else { - for (int i = 0; i < NCONS; i++) + } else { domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::reflect_even); + } } - } - else if ( bct == REMORA_BC::outflow ) - { - if (side == Orientation::low) { - for (int i = 0; i < NCONS; i++) + else if ( bct == REMORA_BC::outflow ) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::cons_bc+i].setLo(dir, REMORABCType::foextrap); - } else { - for (int i = 0; i < NCONS; i++) + } else { domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::foextrap); + } } - } - else if ( bct == REMORA_BC::no_slip_wall) - { - if (side == Orientation::low) { - for (int i = 0; i < NCONS; i++) + else if ( bct == REMORA_BC::no_slip_wall) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::cons_bc+i].setLo(dir, REMORABCType::foextrap); - } else { - for (int i = 0; i < NCONS; i++) + } else { domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::foextrap); + } } - } - else if (bct == REMORA_BC::slip_wall) - { - if (side == Orientation::low) { - for (int i = 0; i < NCONS; i++) + else if (bct == REMORA_BC::slip_wall) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::cons_bc+i].setLo(dir, REMORABCType::foextrap); - } else { - for (int i = 0; i < NCONS; i++) + } else { domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::foextrap); + } } - } - else if (bct == REMORA_BC::inflow) - { - if (side == Orientation::low) { - for (int i = 0; i < NCONS; i++) { + else if (bct == REMORA_BC::inflow) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::cons_bc+i].setLo(dir, REMORABCType::ext_dir); - } - } else { - for (int i = 0; i < NCONS; i++) { + } else { domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::ext_dir); } } - } - else if (bct == REMORA_BC::periodic) - { - if (side == Orientation::low) { - for (int i = 0; i < NCONS; i++) + else if (bct == REMORA_BC::periodic) + { + if (side == Orientation::low) { domain_bcs_type[BCVars::cons_bc+i].setLo(dir, REMORABCType::int_dir); - } else { - for (int i = 0; i < NCONS; i++) - domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::int_dir); + } else { + domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::int_dir); + } + } + } + } + } + + // ***************************************************************************** + // + // Here we translate the physical boundary conditions -- one type per face -- + // into logical boundary conditions for ubar and vbar + // + // ***************************************************************************** + { + for (OrientationIter oit; oit; ++oit) { + Orientation ori = oit(); + int dir = ori.coordDir(); + Orientation::Side side = ori.faceDir(); + for (int i = 0; i < 2; i++) { + auto const bct = phys_bc_type[BCVars::ubar_bc+i][ori]; + if ( bct == REMORA_BC::symmetry ) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::ubar_bc+i].setLo(dir, REMORABCType::reflect_even); + if (i==1) + domain_bcs_type[BCVars::ubar_bc+dir].setLo(dir, REMORABCType::reflect_odd); + } else { + domain_bcs_type[BCVars::ubar_bc+i].setHi(dir, REMORABCType::reflect_even); + if (i==1) + domain_bcs_type[BCVars::ubar_bc+dir].setHi(dir, REMORABCType::reflect_odd); + } + } + else if (bct == REMORA_BC::outflow || bct == REMORA_BC::clamped) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::ubar_bc+i].setLo(dir, REMORABCType::foextrap); + } else { + domain_bcs_type[BCVars::ubar_bc+i].setHi(dir, REMORABCType::foextrap); + } + } + else if (bct == REMORA_BC::inflow) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::ubar_bc+i].setLo(dir, REMORABCType::ext_dir); + } else { + domain_bcs_type[BCVars::ubar_bc+i].setHi(dir, REMORABCType::ext_dir); + } + } + else if (bct == REMORA_BC::no_slip_wall) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::ubar_bc+i].setLo(dir, REMORABCType::ext_dir); + } else { + domain_bcs_type[BCVars::ubar_bc+i].setHi(dir, REMORABCType::ext_dir); + } + } + else if (bct == REMORA_BC::slip_wall) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::ubar_bc+i].setLo(dir, REMORABCType::foextrap); + if (i==1) { + // Only normal direction has ext_dir + domain_bcs_type[BCVars::ubar_bc+dir].setLo(dir, REMORABCType::ext_dir); + } + + } else { + domain_bcs_type[BCVars::ubar_bc+i].setHi(dir, REMORABCType::foextrap); + if (i==1) { + // Only normal direction has ext_dir + domain_bcs_type[BCVars::ubar_bc+dir].setHi(dir, REMORABCType::ext_dir); + } + } + } + else if (bct == REMORA_BC::periodic) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::ubar_bc+i].setLo(dir, REMORABCType::int_dir); + } else { + domain_bcs_type[BCVars::ubar_bc+i].setHi(dir, REMORABCType::int_dir); + } + } + } + } + } + + // ***************************************************************************** + // + // Here we translate the physical boundary conditions -- one type per face -- + // into logical boundary conditions for zeta and tke + // + // ***************************************************************************** + { + for (OrientationIter oit; oit; ++oit) { + Orientation ori = oit(); + int dir = ori.coordDir(); + Orientation::Side side = ori.faceDir(); + for (int i = 0; i < 2; i++) { + auto const bct = phys_bc_type[BCVars::zeta_bc+i][ori]; + if ( bct == REMORA_BC::symmetry ) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::reflect_even); + } else { + domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::reflect_even); + } + } + else if ( bct == REMORA_BC::outflow ) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::foextrap); + } else { + domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::foextrap); + } + } + else if ( bct == REMORA_BC::no_slip_wall) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::foextrap); + } else { + domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::foextrap); + } + } + else if (bct == REMORA_BC::slip_wall) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::foextrap); + } else { + domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::foextrap); + } + } + else if (bct == REMORA_BC::inflow) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::ext_dir); + } else { + domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::ext_dir); + } + } + else if (bct == REMORA_BC::periodic) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::int_dir); + } else { + domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::int_dir); + } + } + else if (bct == REMORA_BC::chapman) + { + if (side == Orientation::low) { + domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::chapman); + } else { + domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::chapman); + } } } } diff --git a/Source/REMORA.H b/Source/REMORA.H index f69da0d..c932099 100644 --- a/Source/REMORA.H +++ b/Source/REMORA.H @@ -841,6 +841,9 @@ private: amrex::Vector t_old; amrex::Vector dt; + // whether to set boundary conditions by variable rather than just by side + bool set_bcs_by_var; + amrex::Vector> physbcs; // array of multifabs to store the solution at each level of refinement // after advancing a level we use "swap". @@ -867,7 +870,7 @@ private: amrex::Array,AMREX_SPACEDIM+NCONS> m_bc_extdir_vals; // These are the "physical" boundary condition types (e.g. "inflow") - amrex::GpuArray phys_bc_type; + amrex::GpuArray,BCVars::NumTypes> phys_bc_type; int last_plot_file_step; From 896b239f202cfd740c6ce47d0411d2bdcb8a9ba7 Mon Sep 17 00:00:00 2001 From: Hannah Klion Date: Tue, 27 Aug 2024 11:17:20 -0700 Subject: [PATCH 2/3] call it clamped instead of outflow --- Source/Initialization/REMORA_init_bcs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Initialization/REMORA_init_bcs.cpp b/Source/Initialization/REMORA_init_bcs.cpp index 49cb67f..aad5ec3 100644 --- a/Source/Initialization/REMORA_init_bcs.cpp +++ b/Source/Initialization/REMORA_init_bcs.cpp @@ -95,7 +95,7 @@ void REMORA::init_bcs () solverChoice.ic_bc_type == IC_BC_Type::Real && phys_bc_type[bcvar_type][ori] != REMORA_BC::clamped) { - amrex::Abort("BC type must be outflow in x and y when reading BCs from file"); + amrex::Abort("BC type must be clamped in x and y when reading BCs from file"); } }; @@ -268,7 +268,7 @@ void REMORA::init_bcs () domain_bcs_type[BCVars::cons_bc+i].setHi(dir, REMORABCType::reflect_even); } } - else if ( bct == REMORA_BC::outflow ) + else if ( bct == REMORA_BC::outflow || bct == REMORA_BC::clamped) { if (side == Orientation::low) { domain_bcs_type[BCVars::cons_bc+i].setLo(dir, REMORABCType::foextrap); @@ -411,7 +411,7 @@ void REMORA::init_bcs () domain_bcs_type[BCVars::zeta_bc+i].setHi(dir, REMORABCType::reflect_even); } } - else if ( bct == REMORA_BC::outflow ) + else if ( bct == REMORA_BC::outflow || bct == REMORA_BC::clamped) { if (side == Orientation::low) { domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::foextrap); From ba75622604e468108e6962d09f0e6ad72bbda574 Mon Sep 17 00:00:00 2001 From: Hannah Klion Date: Tue, 27 Aug 2024 11:20:06 -0700 Subject: [PATCH 3/3] pass BCVar into FillPatch rather than inferring it --- Exec/IdealMiniGrid/inputs | 8 ++--- .../BoundaryConditions/REMORA_FillPatch.cpp | 6 +--- Source/IO/Checkpoint.cpp | 8 ++--- .../REMORA_init_from_netcdf.cpp | 1 + .../Initialization/REMORA_make_new_level.cpp | 29 ++++++++++--------- Source/REMORA.H | 1 + Source/REMORA.cpp | 20 ++++++------- Source/TimeIntegration/REMORA_TimeStepML.cpp | 6 ++-- Source/TimeIntegration/REMORA_advance_2d.cpp | 6 ++-- Source/TimeIntegration/REMORA_advance_3d.cpp | 2 +- .../TimeIntegration/REMORA_advance_3d_ml.cpp | 12 ++++---- Source/TimeIntegration/REMORA_gls.cpp | 10 +++---- Source/TimeIntegration/REMORA_setup_step.cpp | 2 +- 13 files changed, 55 insertions(+), 56 deletions(-) diff --git a/Exec/IdealMiniGrid/inputs b/Exec/IdealMiniGrid/inputs index 716fbe6..b2447ab 100644 --- a/Exec/IdealMiniGrid/inputs +++ b/Exec/IdealMiniGrid/inputs @@ -16,10 +16,10 @@ geometry.is_periodic = 0 0 0 zlo.type = "SlipWall" zhi.type = "SlipWall" -xlo.type = "outflow" -xhi.type = "outflow" -ylo.type = "outflow" -yhi.type = "outflow" +xlo.type = "clamped" +xhi.type = "clamped" +ylo.type = "clamped" +yhi.type = "clamped" # TIME STEP CONTROL remora.fixed_dt = 200.0 # Timestep size (seconds) diff --git a/Source/BoundaryConditions/REMORA_FillPatch.cpp b/Source/BoundaryConditions/REMORA_FillPatch.cpp index e87800d..60bffe7 100644 --- a/Source/BoundaryConditions/REMORA_FillPatch.cpp +++ b/Source/BoundaryConditions/REMORA_FillPatch.cpp @@ -14,6 +14,7 @@ PhysBCFunctNoOp null_bc; // void REMORA::FillPatch (int lev, Real time, MultiFab& mf_to_fill, Vector const& mfs, + const int bccomp, #ifdef REMORA_USE_NETCDF const int bdy_var_type, #else @@ -25,7 +26,6 @@ REMORA::FillPatch (int lev, Real time, MultiFab& mf_to_fill, Vector c const int n_not_fill) { BL_PROFILE_VAR("REMORA::FillPatch()",REMORA_FillPatch); - int bccomp; amrex::Interpolater* mapper = nullptr; Box mf_box(mf_to_fill.boxArray()[0]); @@ -72,24 +72,20 @@ REMORA::FillPatch (int lev, Real time, MultiFab& mf_to_fill, Vector c if (mf_box.ixType() == IndexType(IntVect(0,0,0))) { - bccomp = 0; mapper = &cell_cons_interp; mask = vec_mskr[lev].get(); } else if (mf_box.ixType() == IndexType(IntVect(1,0,0))) { - bccomp = BCVars::xvel_bc; mapper = &face_linear_interp; mask = vec_msku[lev].get(); } else if (mf_box.ixType() == IndexType(IntVect(0,1,0))) { - bccomp = BCVars::yvel_bc; mapper = &face_linear_interp; mask = vec_mskv[lev].get(); } else { - bccomp = BCVars::zvel_bc; mapper = &face_linear_interp; mask = vec_mskr[lev].get(); } diff --git a/Source/IO/Checkpoint.cpp b/Source/IO/Checkpoint.cpp index a23f8ec..6aad4db 100644 --- a/Source/IO/Checkpoint.cpp +++ b/Source/IO/Checkpoint.cpp @@ -18,10 +18,10 @@ REMORA::WriteCheckpointFile () // should be necessary and could instead be replaced by a FillPatch in a more natural // location for (int lev = 0; lev <= finest_level; ++lev) { - FillPatch(lev, t_new[lev], *cons_new[lev], cons_new, BdyVars::t,0,true,false); - FillPatch(lev, t_new[lev], *xvel_new[lev], xvel_new, BdyVars::u,0,true,false); - FillPatch(lev, t_new[lev], *yvel_new[lev], yvel_new, BdyVars::v,0,true,false); - FillPatch(lev, t_new[lev], *zvel_new[lev], zvel_new, BdyVars::null,0,true,false); + FillPatch(lev, t_new[lev], *cons_new[lev], cons_new, BCVars::cons_bc, BdyVars::t, 0,true,false); + FillPatch(lev, t_new[lev], *xvel_new[lev], xvel_new, BCVars::xvel_bc, BdyVars::u, 0,true,false); + FillPatch(lev, t_new[lev], *yvel_new[lev], yvel_new, BCVars::yvel_bc, BdyVars::v, 0,true,false); + FillPatch(lev, t_new[lev], *zvel_new[lev], zvel_new, BCVars::zvel_bc, BdyVars::null,0,true,false); } // chk00010 write a checkpoint file with this root directory diff --git a/Source/Initialization/REMORA_init_from_netcdf.cpp b/Source/Initialization/REMORA_init_from_netcdf.cpp index 630476e..5eaeafb 100644 --- a/Source/Initialization/REMORA_init_from_netcdf.cpp +++ b/Source/Initialization/REMORA_init_from_netcdf.cpp @@ -201,6 +201,7 @@ REMORA::init_bathymetry_from_netcdf (int lev) const double dummy_time = 0.0_rt; FillPatch(lev,dummy_time,*vec_hOfTheConfusingName[lev],GetVecOfPtrs(vec_hOfTheConfusingName), + BCVars::cons_bc, BdyVars::null,0,true,true,1); int ng = vec_pm[lev]->nGrow(); diff --git a/Source/Initialization/REMORA_make_new_level.cpp b/Source/Initialization/REMORA_make_new_level.cpp index b0a84a8..ec043f7 100644 --- a/Source/Initialization/REMORA_make_new_level.cpp +++ b/Source/Initialization/REMORA_make_new_level.cpp @@ -157,23 +157,24 @@ REMORA::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionM init_masks(lev, ba, dm); // This will fill the temporary MultiFabs with data from previous fine data as well as coarse where needed - FillPatch(lev, time, tmp_cons_new, cons_new, BdyVars::t,0,true,false); - FillPatch(lev, time, tmp_xvel_new, xvel_new, BdyVars::u,0,true,false); - FillPatch(lev, time, tmp_yvel_new, yvel_new, BdyVars::v,0,true,false); - FillPatch(lev, time, tmp_zvel_new, zvel_new, BdyVars::null,0,true,false); - - FillPatch(lev, time, tmp_h, GetVecOfPtrs(vec_hOfTheConfusingName), BdyVars::null,0,false,false); - FillPatch(lev, time, tmp_h, GetVecOfPtrs(vec_hOfTheConfusingName), BdyVars::null,1,false,false); - FillPatch(lev, time, tmp_Zt_avg1_new, GetVecOfPtrs(vec_Zt_avg1), BdyVars::null,0,true,false); + FillPatch(lev, time, tmp_cons_new, cons_new, BCVars::cons_bc, BdyVars::t,0,true,false); + FillPatch(lev, time, tmp_xvel_new, xvel_new, BCVars::xvel_bc, BdyVars::u,0,true,false); + FillPatch(lev, time, tmp_yvel_new, yvel_new, BCVars::yvel_bc, BdyVars::v,0,true,false); + FillPatch(lev, time, tmp_zvel_new, zvel_new, BCVars::zvel_bc, BdyVars::null,0,true,false); + + FillPatch(lev, time, tmp_h, GetVecOfPtrs(vec_hOfTheConfusingName), BCVars::cons_bc, BdyVars::null,0,false,false); + FillPatch(lev, time, tmp_h, GetVecOfPtrs(vec_hOfTheConfusingName), BCVars::cons_bc, BdyVars::null,1,false,false); + FillPatch(lev, time, tmp_Zt_avg1_new, GetVecOfPtrs(vec_Zt_avg1), BCVars::cons_bc, BdyVars::null,0,true,false); for (int icomp=0; icomp<3; icomp++) { - FillPatch(lev, time, tmp_ubar_new, GetVecOfPtrs(vec_ubar), BdyVars::ubar, icomp,false,false); - FillPatch(lev, time, tmp_vbar_new, GetVecOfPtrs(vec_vbar), BdyVars::vbar, icomp,false,false); + FillPatch(lev, time, tmp_ubar_new, GetVecOfPtrs(vec_ubar), BCVars::ubar_bc, BdyVars::ubar, icomp,false,false); + FillPatch(lev, time, tmp_vbar_new, GetVecOfPtrs(vec_vbar), BCVars::vbar_bc, BdyVars::vbar, icomp,false,false); } for (int icomp=0; icomp<2; icomp++) { - FillPatch(lev, time, tmp_ru_new, GetVecOfPtrs(vec_ru), BdyVars::null, icomp,false,false); - FillPatch(lev, time, tmp_rv_new, GetVecOfPtrs(vec_rv), BdyVars::null, icomp,false,false); - FillPatch(lev, time, tmp_ru2d_new, GetVecOfPtrs(vec_ru2d), BdyVars::null, icomp,false,false); - FillPatch(lev, time, tmp_rv2d_new, GetVecOfPtrs(vec_rv2d), BdyVars::null, icomp,false,false); + FillPatch(lev, time, tmp_ru_new, GetVecOfPtrs(vec_ru),BCVars::xvel_bc, BdyVars::null, icomp,false,false); + FillPatch(lev, time, tmp_rv_new, GetVecOfPtrs(vec_rv),BCVars::yvel_bc, BdyVars::null, icomp,false,false); + // These might want to have BCVars::ubar_bc and vbar_bc + FillPatch(lev, time, tmp_ru2d_new, GetVecOfPtrs(vec_ru2d),BCVars::xvel_bc, BdyVars::null, icomp,false,false); + FillPatch(lev, time, tmp_rv2d_new, GetVecOfPtrs(vec_rv2d),BCVars::yvel_bc, BdyVars::null, icomp,false,false); } MultiFab::Copy(tmp_cons_old,tmp_cons_new,0,0,NCONS,tmp_cons_new.nGrowVect()); diff --git a/Source/REMORA.H b/Source/REMORA.H index c932099..e5f28f4 100644 --- a/Source/REMORA.H +++ b/Source/REMORA.H @@ -666,6 +666,7 @@ public: void FillPatch (int lev, amrex::Real time, amrex::MultiFab& mf_to_be_filled, amrex::Vector const& mfs, + const int bccomp, const int bdy_var_type = BdyVars::null, const int icomp=0, const bool fill_all=true, diff --git a/Source/REMORA.cpp b/Source/REMORA.cpp index 4c30012..50a04e1 100644 --- a/Source/REMORA.cpp +++ b/Source/REMORA.cpp @@ -287,10 +287,10 @@ REMORA::InitData () Construct_REMORAFillPatchers(lev); } - FillPatch(lev, t_new[lev], *cons_new[lev], cons_new, BdyVars::t, 0, true, false); - FillPatch(lev, t_new[lev], *xvel_new[lev], xvel_new, BdyVars::u, 0, true, false); - FillPatch(lev, t_new[lev], *yvel_new[lev], yvel_new, BdyVars::v, 0, true, false); - FillPatch(lev, t_new[lev], *zvel_new[lev], zvel_new, BdyVars::null, 0, true, false); + FillPatch(lev, t_new[lev], *cons_new[lev], cons_new, BCVars::cons_bc, BdyVars::t, 0, true, false); + FillPatch(lev, t_new[lev], *xvel_new[lev], xvel_new, BCVars::xvel_bc, BdyVars::u, 0, true, false); + FillPatch(lev, t_new[lev], *yvel_new[lev], yvel_new, BCVars::yvel_bc, BdyVars::v, 0, true, false); + FillPatch(lev, t_new[lev], *zvel_new[lev], zvel_new, BCVars::zvel_bc, BdyVars::null, 0, true, false); if (restart_chkfile == "") { // Copy from new into old just in case when initializing from scratch @@ -541,7 +541,7 @@ REMORA::set_coriolis(int lev) { } Real time = 0.0_rt; - FillPatch(lev, time, *vec_fcor[lev], GetVecOfPtrs(vec_fcor)); + FillPatch(lev, time, *vec_fcor[lev], GetVecOfPtrs(vec_fcor),BCVars::cons_bc); } } @@ -563,9 +563,9 @@ void REMORA::set_analytical_vmix(int lev) { Real time = 0.0_rt; init_custom_vmix(geom[lev], *vec_Akv[lev], *vec_Akt[lev], *vec_z_w[lev], solverChoice); - FillPatch(lev, time, *vec_Akv[lev], GetVecOfPtrs(vec_Akv),BdyVars::null,0,true,false); + FillPatch(lev, time, *vec_Akv[lev], GetVecOfPtrs(vec_Akv),BCVars::zvel_bc,BdyVars::null,0,true,false); for (int n=0; n 0; 2) fill from physical boundaries; // 3) fine-fine fill of ghost cells with FillBoundary call - FillPatch(lev, t_old[lev], *cons_new[lev], cons_new, BdyVars::t); + FillPatch(lev, t_old[lev], *cons_new[lev], cons_new, BCVars::cons_bc, BdyVars::t); xvel_new[lev]->FillBoundary(geom[lev].periodicity()); yvel_new[lev]->FillBoundary(geom[lev].periodicity()); - FillPatch(lev, t_old[lev], *zvel_new[lev], zvel_new, BdyVars::null); + FillPatch(lev, t_old[lev], *zvel_new[lev], zvel_new, BCVars::zvel_bc, BdyVars::null); - FillPatch(lev, t_old[lev], *vec_sstore[lev], GetVecOfPtrs(vec_sstore), BdyVars::t); + FillPatch(lev, t_old[lev], *vec_sstore[lev], GetVecOfPtrs(vec_sstore), BCVars::cons_bc, BdyVars::t); auto N = Geom(lev).Domain().size()[2]-1; // Number of vertical "levs" aka, NZ @@ -35,16 +35,16 @@ void REMORA::advance_3d_ml (int lev, Real dt_lev) FillPatchNoBC(lev, t_old[lev], *vec_vbar[lev], GetVecOfPtrs(vec_vbar), BdyVars::vbar,1,false,false); FillPatchNoBC(lev, t_old[lev], *vec_ubar[lev], GetVecOfPtrs(vec_ubar), BdyVars::ubar,2,false,false); FillPatchNoBC(lev, t_old[lev], *vec_vbar[lev], GetVecOfPtrs(vec_vbar), BdyVars::vbar,2,false,false); - FillPatch(lev, t_old[lev], *vec_sstore[lev], GetVecOfPtrs(vec_sstore), BdyVars::t); + FillPatch(lev, t_old[lev], *vec_sstore[lev], GetVecOfPtrs(vec_sstore), BCVars::cons_bc, BdyVars::t); // Fill in three ways: 1) interpolate from coarse grid if lev > 0; 2) fill from physical boundaries; // 3) fine-fine fill of ghost cells with FillBoundary call // Note that we need the fine-fine and physical bc's in order to correctly move the particles - FillPatch(lev, t_old[lev], *cons_new[lev], cons_new, BdyVars::t); + FillPatch(lev, t_old[lev], *cons_new[lev], cons_new, BCVars::cons_bc, BdyVars::t); xvel_new[lev]->FillBoundary(geom[lev].periodicity()); yvel_new[lev]->FillBoundary(geom[lev].periodicity()); - FillPatch(lev, t_old[lev], *zvel_new[lev], zvel_new, BdyVars::null); + FillPatch(lev, t_old[lev], *zvel_new[lev], zvel_new, BCVars::zvel_bc, BdyVars::null); // Apply land/sea mask to tracers for ( MFIter mfi(*cons_new[lev], TilingIfNotGPU()); mfi.isValid(); ++mfi ) diff --git a/Source/TimeIntegration/REMORA_gls.cpp b/Source/TimeIntegration/REMORA_gls.cpp index 8a7cf5f..a34d769 100644 --- a/Source/TimeIntegration/REMORA_gls.cpp +++ b/Source/TimeIntegration/REMORA_gls.cpp @@ -206,8 +206,8 @@ REMORA::gls_prestep (int lev, MultiFab* mf_gls, MultiFab* mf_tke, } for (int icomp=0; icomp<3; icomp++) { - FillPatch(lev, t_old[lev], *vec_tke[lev], GetVecOfPtrs(vec_tke), BdyVars::null, icomp, false, false); - FillPatch(lev, t_old[lev], *vec_gls[lev], GetVecOfPtrs(vec_gls), BdyVars::null, icomp, false, false); + FillPatch(lev, t_old[lev], *vec_tke[lev], GetVecOfPtrs(vec_tke), BCVars::zvel_bc, BdyVars::null, icomp, false, false); + FillPatch(lev, t_old[lev], *vec_gls[lev], GetVecOfPtrs(vec_gls), BCVars::zvel_bc, BdyVars::null, icomp, false, false); } } @@ -893,11 +893,11 @@ REMORA::gls_corrector (int lev, MultiFab* mf_gls, MultiFab* mf_tke, } for (int icomp=0; icomp<3; icomp++) { - FillPatch(lev, t_old[lev], *mf_tke, GetVecOfPtrs(vec_tke), BdyVars::null, icomp, false, false); - FillPatch(lev, t_old[lev], *mf_gls, GetVecOfPtrs(vec_gls), BdyVars::null, icomp, false, false); + FillPatch(lev, t_old[lev], *mf_tke, GetVecOfPtrs(vec_tke), BCVars::zvel_bc, BdyVars::null, icomp, false, false); + FillPatch(lev, t_old[lev], *mf_gls, GetVecOfPtrs(vec_gls), BCVars::zvel_bc, BdyVars::null, icomp, false, false); } for (int icomp=0; icomp