From daec721b3c06754b5d4c404530c3dadf82516f37 Mon Sep 17 00:00:00 2001 From: Hannah Klion Date: Wed, 13 Nov 2024 12:18:12 -0800 Subject: [PATCH] add bc. prefix to bc options, and make zlo/zhi optional --- Exec/Advection/inputs | 5 ---- Exec/Advection/inputs_ml | 5 ---- Exec/Channel_Test/inputs | 7 ++---- Exec/Channel_Test/inputs_orlanski | 24 +++++++------------ Exec/DoubleGyre/inputs | 11 ++++----- Exec/DoublyPeriodic/inputs | 5 ---- Exec/IdealMiniGrid/inputs | 10 ++++---- Exec/IdealMiniGrid/inputs_cf_orlanski | 22 ++++++++--------- Exec/IdealMiniGrid/inputs_chapman_flather | 20 +++++++--------- Exec/ParticlesOverSeaMount/inputs | 5 ---- Exec/ParticlesOverSeaMount/inputs_ml | 5 ---- Exec/Seamount/inputs | 5 ---- Exec/Upwelling/inputs | 7 ++---- Exec/Upwelling/inputs_gls | 7 ++---- Exec/Upwelling_ML/inputs | 6 ----- Source/Initialization/REMORA_init_bcs.cpp | 9 +++++-- Tests/test_files/Advection/Advection.i | 5 ---- Tests/test_files/Advection_ML/Advection_ML.i | 5 ---- Tests/test_files/Channel_Test/Channel_Test.i | 7 ++---- Tests/test_files/DoubleGyre/DoubleGyre.i | 11 ++++----- .../DoublyPeriodic/DoublyPeriodic.i | 5 ---- .../DoublyPeriodic_bathy.i | 5 ---- Tests/test_files/Seamount/Seamount.i | 5 ---- Tests/test_files/Upwelling/Upwelling.i | 7 ++---- .../test_files/Upwelling_GLS/Upwelling_GLS.i | 7 ++---- 25 files changed, 59 insertions(+), 151 deletions(-) diff --git a/Exec/Advection/inputs b/Exec/Advection/inputs index 1eb5070..e73e12b 100644 --- a/Exec/Advection/inputs +++ b/Exec/Advection/inputs @@ -12,12 +12,7 @@ geometry.prob_hi = 41000. 41000. 0. amr.n_cell = 81 81 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Exec/Advection/inputs_ml b/Exec/Advection/inputs_ml index 99f0262..dd9452a 100644 --- a/Exec/Advection/inputs_ml +++ b/Exec/Advection/inputs_ml @@ -12,12 +12,7 @@ geometry.prob_hi = 40000. 40000. 0. amr.n_cell = 80 80 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 100.0 # Timestep size (seconds) diff --git a/Exec/Channel_Test/inputs b/Exec/Channel_Test/inputs index c81d9b7..113e918 100644 --- a/Exec/Channel_Test/inputs +++ b/Exec/Channel_Test/inputs @@ -14,11 +14,8 @@ amr.n_cell = 20 60 50 geometry.is_periodic = 1 0 0 -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 400.0 # Timestep size (seconds) diff --git a/Exec/Channel_Test/inputs_orlanski b/Exec/Channel_Test/inputs_orlanski index 3869c32..5e3ed15 100644 --- a/Exec/Channel_Test/inputs_orlanski +++ b/Exec/Channel_Test/inputs_orlanski @@ -14,22 +14,16 @@ amr.n_cell = 20 60 50 geometry.is_periodic = 0 0 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" - remora.boundary_per_variable = 1 -temp.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad -salt.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad -scalar.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad -u.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad -v.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad -ubar.type = outflow outflow outflow outflow -vbar.type = outflow outflow outflow outflow -zeta.type = outflow outflow outflow outflow -tke.type = outflow outflow outflow outflow +bc.temp.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad +bc.salt.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad +bc.scalar.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad +bc.u.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad +bc.v.type = orlanski_rad orlanski_rad orlanski_rad orlanski_rad +bc.ubar.type = outflow outflow outflow outflow +bc.vbar.type = outflow outflow outflow outflow +bc.zeta.type = outflow outflow outflow outflow +bc.tke.type = outflow outflow outflow outflow # TIME STEP CONTROL remora.fixed_dt = 400.0 # Timestep size (seconds) diff --git a/Exec/DoubleGyre/inputs b/Exec/DoubleGyre/inputs index 5545078..e1494cb 100644 --- a/Exec/DoubleGyre/inputs +++ b/Exec/DoubleGyre/inputs @@ -13,14 +13,11 @@ amr.n_cell = 54 108 4 geometry.is_periodic = 0 0 0 -xlo.type = "SlipWall" -xhi.type = "SlipWall" +bc.xlo.type = "SlipWall" +bc.xhi.type = "SlipWall" -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 3600.0 # Timestep size (seconds) diff --git a/Exec/DoublyPeriodic/inputs b/Exec/DoublyPeriodic/inputs index 5868dcb..66f5058 100644 --- a/Exec/DoublyPeriodic/inputs +++ b/Exec/DoublyPeriodic/inputs @@ -12,12 +12,7 @@ geometry.prob_hi = 41000. 80000. 0. amr.n_cell = 41 80 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Exec/IdealMiniGrid/inputs b/Exec/IdealMiniGrid/inputs index 703964e..d8cacd3 100644 --- a/Exec/IdealMiniGrid/inputs +++ b/Exec/IdealMiniGrid/inputs @@ -13,13 +13,11 @@ geometry.prob_hi = 320000. 320000. 0. amr.n_cell = 10 16 20 geometry.is_periodic = 0 0 0 -zlo.type = "SlipWall" -zhi.type = "SlipWall" -xlo.type = "clamped" -xhi.type = "clamped" -ylo.type = "clamped" -yhi.type = "clamped" +bc.xlo.type = "clamped" +bc.xhi.type = "clamped" +bc.ylo.type = "clamped" +bc.yhi.type = "clamped" # TIME STEP CONTROL remora.fixed_dt = 200.0 # Timestep size (seconds) diff --git a/Exec/IdealMiniGrid/inputs_cf_orlanski b/Exec/IdealMiniGrid/inputs_cf_orlanski index 972104c..bc2a776 100644 --- a/Exec/IdealMiniGrid/inputs_cf_orlanski +++ b/Exec/IdealMiniGrid/inputs_cf_orlanski @@ -13,20 +13,18 @@ geometry.prob_hi = 320000. 320000. 0. amr.n_cell = 10 16 20 geometry.is_periodic = 0 0 0 -zlo.type = "SlipWall" -zhi.type = "SlipWall" remora.boundary_per_variable = 1 -## WEST SOUTH EAST NORTH -temp.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg -salt.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg -scalar.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg -u.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg -v.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg -ubar.type = flather flather flather flather -vbar.type = flather flather flather flather -zeta.type = chapman chapman chapman chapman -tke.type = outflow outflow outflow outflow +## WEST SOUTH EAST NORTH +bc.temp.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg +bc.salt.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg +bc.scalar.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg +bc.u.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg +bc.v.type = orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg orlanski_rad_nudg +bc.ubar.type = flather flather flather flather +bc.vbar.type = flather flather flather flather +bc.zeta.type = chapman chapman chapman chapman +bc.tke.type = outflow outflow outflow outflow # TIME STEP CONTROL remora.fixed_dt = 200.0 # Timestep size (seconds) diff --git a/Exec/IdealMiniGrid/inputs_chapman_flather b/Exec/IdealMiniGrid/inputs_chapman_flather index 0770663..9413971 100644 --- a/Exec/IdealMiniGrid/inputs_chapman_flather +++ b/Exec/IdealMiniGrid/inputs_chapman_flather @@ -13,20 +13,18 @@ geometry.prob_hi = 320000. 320000. 0. amr.n_cell = 10 16 20 geometry.is_periodic = 0 0 0 -zlo.type = "SlipWall" -zhi.type = "SlipWall" remora.boundary_per_variable = 1 ## WEST SOUTH EAST NORTH -temp.type = clamped clamped clamped clamped -salt.type = clamped clamped clamped clamped -scalar.type = clamped clamped clamped clamped -u.type = clamped clamped clamped clamped -v.type = clamped clamped clamped clamped -ubar.type = flather flather flather flather -vbar.type = flather flather flather flather -zeta.type = chapman chapman chapman chapman -tke.type = outflow outflow outflow outflow +bc.temp.type = clamped clamped clamped clamped +bc.salt.type = clamped clamped clamped clamped +bc.scalar.type = clamped clamped clamped clamped +bc.u.type = clamped clamped clamped clamped +bc.v.type = clamped clamped clamped clamped +bc.ubar.type = flather flather flather flather +bc.vbar.type = flather flather flather flather +bc.zeta.type = chapman chapman chapman chapman +bc.tke.type = outflow outflow outflow outflow # TIME STEP CONTROL remora.fixed_dt = 200.0 # Timestep size (seconds) diff --git a/Exec/ParticlesOverSeaMount/inputs b/Exec/ParticlesOverSeaMount/inputs index af264f2..091c018 100644 --- a/Exec/ParticlesOverSeaMount/inputs +++ b/Exec/ParticlesOverSeaMount/inputs @@ -13,12 +13,7 @@ geometry.prob_hi = 41000. 80000. 0. amr.n_cell = 41 80 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Exec/ParticlesOverSeaMount/inputs_ml b/Exec/ParticlesOverSeaMount/inputs_ml index f16b187..9ae8bce 100644 --- a/Exec/ParticlesOverSeaMount/inputs_ml +++ b/Exec/ParticlesOverSeaMount/inputs_ml @@ -13,12 +13,7 @@ geometry.prob_hi = 41000. 80000. 0. amr.n_cell = 41 80 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Exec/Seamount/inputs b/Exec/Seamount/inputs index 239e612..6a8a088 100644 --- a/Exec/Seamount/inputs +++ b/Exec/Seamount/inputs @@ -13,12 +13,7 @@ geometry.prob_hi = 320000. 320000. 0. amr.n_cell = 49 48 13 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 60.0 # Timestep size (seconds) diff --git a/Exec/Upwelling/inputs b/Exec/Upwelling/inputs index a9b0341..6265404 100644 --- a/Exec/Upwelling/inputs +++ b/Exec/Upwelling/inputs @@ -13,11 +13,8 @@ amr.n_cell = 41 80 16 geometry.is_periodic = 1 0 0 -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Exec/Upwelling/inputs_gls b/Exec/Upwelling/inputs_gls index 1b01c57..39fed5a 100644 --- a/Exec/Upwelling/inputs_gls +++ b/Exec/Upwelling/inputs_gls @@ -13,11 +13,8 @@ amr.n_cell = 41 80 16 geometry.is_periodic = 1 0 0 -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Exec/Upwelling_ML/inputs b/Exec/Upwelling_ML/inputs index 568857d..a9bbf3f 100644 --- a/Exec/Upwelling_ML/inputs +++ b/Exec/Upwelling_ML/inputs @@ -14,12 +14,6 @@ amr.n_cell = 41 80 16 geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" - # TIME STEP CONTROL remora.fixed_dt = 5 # Timestep size (seconds) diff --git a/Source/Initialization/REMORA_init_bcs.cpp b/Source/Initialization/REMORA_init_bcs.cpp index 92e8a2e..3a3b33c 100644 --- a/Source/Initialization/REMORA_init_bcs.cpp +++ b/Source/Initialization/REMORA_init_bcs.cpp @@ -93,6 +93,9 @@ void REMORA::init_bcs () } else if (bc_type_string == "periodic") { + if (!geom[0].isPeriodic(ori.coordDir())) { + amrex::Abort("Periodic boundary specified in a non-periodic direction"); + } phys_bc_type[bcvar_type][ori] = REMORA_BC::periodic; domain_bc_type[ori] = "Periodic"; } @@ -121,8 +124,10 @@ void REMORA::init_bcs () auto f_by_side = [this, &f_set_var_bc] (std::string const& bcid, Orientation ori) { - ParmParse pp(bcid); + ParmParse pp("bc."+bcid); std::string bc_type_in = "null"; + // Default z directions to slipwall + if (bcid=="zlo" or bcid=="zhi") bc_type_in = "slipwall"; pp.query("type", bc_type_in); std::string bc_type = amrex::toLower(bc_type_in); @@ -135,7 +140,7 @@ void REMORA::init_bcs () { amrex::Vector 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 = {"null","null","null","null"}; - ParmParse pp(varname); + ParmParse pp("bc."+varname); std::string bc_type_in = "null"; // default zvel to outflow if (bcvar_type == BCVars::zvel_bc) { diff --git a/Tests/test_files/Advection/Advection.i b/Tests/test_files/Advection/Advection.i index d35721b..0cecfc7 100644 --- a/Tests/test_files/Advection/Advection.i +++ b/Tests/test_files/Advection/Advection.i @@ -12,12 +12,7 @@ geometry.prob_hi = 41000. 41000. 0. amr.n_cell = 81 81 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Tests/test_files/Advection_ML/Advection_ML.i b/Tests/test_files/Advection_ML/Advection_ML.i index e4805df..025e3f2 100644 --- a/Tests/test_files/Advection_ML/Advection_ML.i +++ b/Tests/test_files/Advection_ML/Advection_ML.i @@ -12,12 +12,7 @@ geometry.prob_hi = 40000. 40000. 0. amr.n_cell = 80 80 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 100.0 # Timestep size (seconds) diff --git a/Tests/test_files/Channel_Test/Channel_Test.i b/Tests/test_files/Channel_Test/Channel_Test.i index 2114bcd..c168ec0 100644 --- a/Tests/test_files/Channel_Test/Channel_Test.i +++ b/Tests/test_files/Channel_Test/Channel_Test.i @@ -14,11 +14,8 @@ amr.n_cell = 20 60 50 geometry.is_periodic = 1 0 0 -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 400.0 # Timestep size (seconds) diff --git a/Tests/test_files/DoubleGyre/DoubleGyre.i b/Tests/test_files/DoubleGyre/DoubleGyre.i index 38eb901..35d03cc 100644 --- a/Tests/test_files/DoubleGyre/DoubleGyre.i +++ b/Tests/test_files/DoubleGyre/DoubleGyre.i @@ -11,14 +11,11 @@ amr.n_cell = 54 108 4 geometry.is_periodic = 0 0 0 -xlo.type = "SlipWall" -xhi.type = "SlipWall" +bc.xlo.type = "SlipWall" +bc.xhi.type = "SlipWall" -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 3600.0 # Timestep size (seconds) diff --git a/Tests/test_files/DoublyPeriodic/DoublyPeriodic.i b/Tests/test_files/DoublyPeriodic/DoublyPeriodic.i index 9bc5b03..7057f9e 100644 --- a/Tests/test_files/DoublyPeriodic/DoublyPeriodic.i +++ b/Tests/test_files/DoublyPeriodic/DoublyPeriodic.i @@ -12,12 +12,7 @@ geometry.prob_hi = 41000. 80000. 0. amr.n_cell = 41 80 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Tests/test_files/DoublyPeriodic_bathy/DoublyPeriodic_bathy.i b/Tests/test_files/DoublyPeriodic_bathy/DoublyPeriodic_bathy.i index ea5b7fe..98f8af6 100644 --- a/Tests/test_files/DoublyPeriodic_bathy/DoublyPeriodic_bathy.i +++ b/Tests/test_files/DoublyPeriodic_bathy/DoublyPeriodic_bathy.i @@ -12,12 +12,7 @@ geometry.prob_hi = 41000. 80000. 0. amr.n_cell = 41 80 16 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Tests/test_files/Seamount/Seamount.i b/Tests/test_files/Seamount/Seamount.i index 28dd6c7..bfb6fb4 100644 --- a/Tests/test_files/Seamount/Seamount.i +++ b/Tests/test_files/Seamount/Seamount.i @@ -13,12 +13,7 @@ geometry.prob_hi = 320000. 320000. 0. amr.n_cell = 49 48 13 -# periodic in x to match WRF setup geometry.is_periodic = 1 1 0 -#ylo.type = "SlipWall" -#yhi.type = "SlipWall" -zlo.type = "SlipWall" -zhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 60.0 # Timestep size (seconds) diff --git a/Tests/test_files/Upwelling/Upwelling.i b/Tests/test_files/Upwelling/Upwelling.i index 68c0a69..f6e7eb6 100644 --- a/Tests/test_files/Upwelling/Upwelling.i +++ b/Tests/test_files/Upwelling/Upwelling.i @@ -13,11 +13,8 @@ amr.n_cell = 41 80 16 geometry.is_periodic = 1 0 0 -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds) diff --git a/Tests/test_files/Upwelling_GLS/Upwelling_GLS.i b/Tests/test_files/Upwelling_GLS/Upwelling_GLS.i index 18c3f0b..ee0b47a 100644 --- a/Tests/test_files/Upwelling_GLS/Upwelling_GLS.i +++ b/Tests/test_files/Upwelling_GLS/Upwelling_GLS.i @@ -13,11 +13,8 @@ amr.n_cell = 41 80 16 geometry.is_periodic = 1 0 0 -ylo.type = "SlipWall" -yhi.type = "SlipWall" - -zlo.type = "SlipWall" -zhi.type = "SlipWall" +bc.ylo.type = "SlipWall" +bc.yhi.type = "SlipWall" # TIME STEP CONTROL remora.fixed_dt = 300.0 # Timestep size (seconds)