diff --git a/amr-wind/boundary_conditions/BCInterface.cpp b/amr-wind/boundary_conditions/BCInterface.cpp index b363f38d0f..a45e95b612 100644 --- a/amr-wind/boundary_conditions/BCInterface.cpp +++ b/amr-wind/boundary_conditions/BCInterface.cpp @@ -59,9 +59,7 @@ void BCIface::read_bctype() continue; } - if ((bcstr == "pressure_inflow") || (bcstr == "pi")) { - ibctype[ori] = BC::pressure_inflow; - } else if ((bcstr == "pressure_outflow") || (bcstr == "po")) { + if ((bcstr == "pressure_outflow") || (bcstr == "po")) { ibctype[ori] = BC::pressure_outflow; } else if ((bcstr == "mass_inflow") || (bcstr == "mi")) { ibctype[ori] = BC::mass_inflow; @@ -202,7 +200,6 @@ void BCVelocity::set_bcrec() } break; - case BC::pressure_inflow: case BC::pressure_outflow: case BC::zero_gradient: if (side == amrex::Orientation::low) { @@ -303,7 +300,6 @@ void BCScalar::set_bcrec() } break; - case BC::pressure_inflow: case BC::pressure_outflow: case BC::zero_gradient: case BC::symmetric_wall: @@ -387,7 +383,7 @@ void BCPressure::read_values() const auto bct = bctype[ori]; amrex::ParmParse pp(bcid); - if ((bct == BC::pressure_inflow) || (bct == BC::pressure_outflow)) { + if ((bct == BC::pressure_outflow)) { pp.queryarr(fname.c_str(), bcval[ori], 0, ndim); } } diff --git a/amr-wind/boundary_conditions/README.org b/amr-wind/boundary_conditions/README.org index 040c25b55c..3cf5a7e5ad 100644 --- a/amr-wind/boundary_conditions/README.org +++ b/amr-wind/boundary_conditions/README.org @@ -32,7 +32,8 @@ The boundary conditions that can be specified in the input file are: - =pressure_outflow= :: =BCRec = foextrap= and =LinOpBCType = Neumann=. This is the standard outflow BC for velocity and scalars. For MAC projection and nodal-projection, it uses a Dirichlet BC for pressure. The value of pressure - at the boundary is specified in the input file (default = 0). + at the boundary is specified in the input file (default = 0). This can be + used as an inflow condition if ... - =no_slip_wall= :: Like =mass_inflow=, this sets =BCRec= to =ext_dir= and specifies Dirichlet BC for the linear solvers. However, it differs from @@ -85,7 +86,6 @@ possible for scalars and tangential component of velocity. | Name | Short | V_n | V_t | Scalar | Source | |------------------+-------+-------------+----------+----------+----------| -| pressure_inflow | pi | foextrap | foextrap | foextrap | foextrap | | pressure_outflow | po | foextrap | foextrap | foextrap | foextrap | | mass_inflow | mi | ext_dir | ext_dir | ext_dir | foextrap | | no_slip_wall | nsw | ext_dir (0) | ext_dir | ext_dir | foextrap | @@ -103,7 +103,6 @@ projection (pressure) and MAC projections. | Name | Short | Linear solver BC | |------------------+-------+------------------| -| pressure_inflow | pi | Dirichlet | | pressure_outflow | po | Dirichlet | | mass_inflow | mi | Neumann | | zero_gradient | zg | Neumann | @@ -118,7 +117,6 @@ projection (pressure) and MAC projections. | Name | Short | Normal component | Tangential component | |------------------+-------+------------------+----------------------| -| pressure_inflow | pi | Neumann | Neumann | | pressure_outflow | po | Neumann | Neumann | | mass_inflow | mi | Dirichlet | Dirichlet | | zero_gradient | zg | Dirichlet (0) | Neumann | @@ -134,7 +132,6 @@ projection (pressure) and MAC projections. | Name | Short | Linear solver BC | |------------------+-------+------------------| -| pressure_inflow | pi | Neumann | | pressure_outflow | po | Neumann | | mass_inflow | mi | Dirichlet | | zero_gradient | zg | Neumann | diff --git a/amr-wind/diffusion/incflo_diffusion.cpp b/amr-wind/diffusion/incflo_diffusion.cpp index da951dfa4c..5b02ceda7a 100644 --- a/amr-wind/diffusion/incflo_diffusion.cpp +++ b/amr-wind/diffusion/incflo_diffusion.cpp @@ -18,7 +18,6 @@ Vector> get_diffuse_tensor_bc( } else { auto bc = velocity.bc_type()[Orientation(dir, side)]; switch (bc) { - case BC::pressure_inflow: case BC::pressure_outflow: case BC::zero_gradient: { // All three components are Neumann @@ -76,7 +75,6 @@ get_diffuse_scalar_bc(amr_wind::Field& scalar, Orientation::Side side) noexcept } else { auto bc = scalar.bc_type()[Orientation(dir, side)]; switch (bc) { - case BC::pressure_inflow: case BC::pressure_outflow: case BC::zero_gradient: case BC::symmetric_wall: diff --git a/amr-wind/equation_systems/AdvOp_Godunov.H b/amr-wind/equation_systems/AdvOp_Godunov.H index a43daf9b28..78a76d530d 100644 --- a/amr-wind/equation_systems/AdvOp_Godunov.H +++ b/amr-wind/equation_systems/AdvOp_Godunov.H @@ -70,6 +70,11 @@ struct AdvectionOp< "between plm, ppm, ppm_nolim, bds, weno_js, and weno_z. If no " "godunov_type is specified, the default weno_z is used."); } + + amrex::ParmParse pp_eq{fields_in.field.base_name()}; + pp_eq.query( + "allow_inflow_at_pressure_outflow", m_allow_inflow_on_outflow); + // TODO: Need iconserv flag to be adjusted??? iconserv.resize(PDE::ndim, 1); } @@ -174,10 +179,7 @@ struct AdvectionOp< } else { limiter_type = PPM::default_limiter; } - if ((godunov_scheme == godunov::scheme::WENOZ) || - (godunov_scheme == godunov::scheme::WENO_JS)) { - m_allow_inflow_on_outflow = true; - } + // if state is NPH, then n and n+1 are known, and only // spatial extrapolation is performed const amrex::Real dt_extrap = diff --git a/amr-wind/equation_systems/icns/icns_advection.H b/amr-wind/equation_systems/icns/icns_advection.H index c7032fec89..ce084fdac6 100644 --- a/amr-wind/equation_systems/icns/icns_advection.H +++ b/amr-wind/equation_systems/icns/icns_advection.H @@ -144,6 +144,10 @@ struct AdvectionOp // Get copy of verbose pp.query("verbose", m_verbose); + + amrex::ParmParse pp_eq("ICNS"); + pp_eq.query( + "allow_inflow_at_pressure_outflow", m_allow_inflow_on_outflow); } void preadvect( @@ -378,7 +382,7 @@ struct AdvectionOp dof_field, dof_nph, src_term, rho_o, rho_nph, u_mac, v_mac, w_mac, dof_field.bcrec(), dof_field.bcrec_device().data(), rho_o.bcrec(), rho_o.bcrec_device().data(), dt, mflux_scheme, - godunov_use_forces_in_trans); + m_allow_inflow_on_outflow, godunov_use_forces_in_trans); } amrex::Vector> fluxes( diff --git a/amr-wind/equation_systems/icns/icns_advection.cpp b/amr-wind/equation_systems/icns/icns_advection.cpp index 92415663f2..f9bd28dacf 100644 --- a/amr-wind/equation_systems/icns/icns_advection.cpp +++ b/amr-wind/equation_systems/icns/icns_advection.cpp @@ -25,7 +25,6 @@ amrex::Array get_projection_bc( } else { auto bc = bctype[amrex::Orientation(dir, side)]; switch (bc) { - case BC::pressure_inflow: case BC::pressure_outflow: { r[dir] = amrex::LinOpBCType::Dirichlet; break; diff --git a/amr-wind/equation_systems/vof/vof_bciface.H b/amr-wind/equation_systems/vof/vof_bciface.H index 03d085d42b..8396754113 100644 --- a/amr-wind/equation_systems/vof/vof_bciface.H +++ b/amr-wind/equation_systems/vof/vof_bciface.H @@ -37,7 +37,6 @@ protected: // For the wall cases, the fillpatch BC is effectively a // contact-line model - case BC::pressure_inflow: case BC::pressure_outflow: case BC::zero_gradient: case BC::no_slip_wall: diff --git a/amr-wind/equation_systems/vof/vof_momentum_flux.H b/amr-wind/equation_systems/vof/vof_momentum_flux.H index f082f06dde..b99cc9c190 100644 --- a/amr-wind/equation_systems/vof/vof_momentum_flux.H +++ b/amr-wind/equation_systems/vof/vof_momentum_flux.H @@ -26,6 +26,7 @@ static void hybrid_fluxes( amrex::BCRec const* rhobc_d, const amrex::Real dt, godunov::scheme mflux_scheme, + bool allow_inflow_on_outflow, bool use_forces_in_trans) { // Get geometry @@ -106,7 +107,6 @@ static void hybrid_fluxes( const bool known_edge_state = false; const bool godunov_use_ppm = true; const bool is_velocity = false; - const bool allow_inflow_on_outflow = true; const bool fluxes_are_area_weighted = false; amrex::MFItInfo mfi_info; diff --git a/amr-wind/incflo_enums.H b/amr-wind/incflo_enums.H index 888ff0ae70..a4247e10b5 100644 --- a/amr-wind/incflo_enums.H +++ b/amr-wind/incflo_enums.H @@ -4,7 +4,6 @@ enum struct DiffusionType { Invalid, Explicit, Crank_Nicolson, Implicit }; enum struct BC { - pressure_inflow, pressure_outflow, mass_inflow, mass_inflow_outflow, diff --git a/amr-wind/physics/VortexRing.cpp b/amr-wind/physics/VortexRing.cpp index 49368852b2..c4ef1bcf13 100644 --- a/amr-wind/physics/VortexRing.cpp +++ b/amr-wind/physics/VortexRing.cpp @@ -205,7 +205,6 @@ void VortexRing::initialize_velocity(const VortexRingType& vorticity_theta) } else { switch (bctype[amrex::Orientation(dir, amrex::Orientation::low)]) { - case BC::pressure_inflow: case BC::pressure_outflow: { bclo[dir] = amrex::LinOpBCType::Dirichlet; break; @@ -216,7 +215,6 @@ void VortexRing::initialize_velocity(const VortexRingType& vorticity_theta) }; switch (bctype[amrex::Orientation(dir, amrex::Orientation::high)]) { - case BC::pressure_inflow: case BC::pressure_outflow: { bchi[dir] = amrex::LinOpBCType::Dirichlet; break; diff --git a/amr-wind/projection/incflo_apply_nodal_projection.cpp b/amr-wind/projection/incflo_apply_nodal_projection.cpp index be1b8e46d6..8faa0633f5 100644 --- a/amr-wind/projection/incflo_apply_nodal_projection.cpp +++ b/amr-wind/projection/incflo_apply_nodal_projection.cpp @@ -42,7 +42,6 @@ amr_wind::nodal_projection::get_projection_bc( } else { auto bc = bctype[Orientation(dir, side)]; switch (bc) { - case BC::pressure_inflow: case BC::pressure_outflow: { r[dir] = LinOpBCType::Dirichlet; break; diff --git a/docs/sphinx/user/inputs_Boundary_conditions.rst b/docs/sphinx/user/inputs_Boundary_conditions.rst index be809a7a0c..07dc5cfe4c 100644 --- a/docs/sphinx/user/inputs_Boundary_conditions.rst +++ b/docs/sphinx/user/inputs_Boundary_conditions.rst @@ -10,7 +10,7 @@ This section controls the boundary conditions. Only non-periodic BC's need to be **type:** String, mandatory if non-periodic Boundary condition type on the lo (or hi) side of the domain. - Current options are: periodic, pressure_inflow, pressure_outflow, mass_inflow, + Current options are: periodic, pressure_outflow, mass_inflow, mass_inflow_outflow, no_slip_wall, slip_wall, symmetric_wall and wall_model. .. input_param:: xlo.temperature (or ylo.temperature, etc) diff --git a/unit_tests/projection/test_pressure_offset.cpp b/unit_tests/projection/test_pressure_offset.cpp index 5a5838c942..06b02b74d4 100644 --- a/unit_tests/projection/test_pressure_offset.cpp +++ b/unit_tests/projection/test_pressure_offset.cpp @@ -152,7 +152,7 @@ class ProjPerturb : public AmrexTest amrex::ParmParse ppyhi("yhi"); ppyhi.add("type", (std::string) "slip_wall"); amrex::ParmParse ppzhi("zhi"); - ppzhi.add("type", (std::string) "pressure_inflow"); + ppzhi.add("type", (std::string) "pressure_outflow"); } const amrex::Real m_rho_0 = 1.0;