Skip to content

Commit

Permalink
add bc. prefix to bc options, and make zlo/zhi optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hklion committed Nov 13, 2024
1 parent 2558f41 commit daec721
Show file tree
Hide file tree
Showing 25 changed files with 59 additions and 151 deletions.
5 changes: 0 additions & 5 deletions Exec/Advection/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Exec/Advection/inputs_ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions Exec/Channel_Test/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 9 additions & 15 deletions Exec/Channel_Test/inputs_orlanski
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions Exec/DoubleGyre/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Exec/DoublyPeriodic/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 4 additions & 6 deletions Exec/IdealMiniGrid/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 10 additions & 12 deletions Exec/IdealMiniGrid/inputs_cf_orlanski
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 9 additions & 11 deletions Exec/IdealMiniGrid/inputs_chapman_flather
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Exec/ParticlesOverSeaMount/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Exec/ParticlesOverSeaMount/inputs_ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Exec/Seamount/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions Exec/Upwelling/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions Exec/Upwelling/inputs_gls
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions Exec/Upwelling_ML/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 7 additions & 2 deletions Source/Initialization/REMORA_init_bcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down Expand Up @@ -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);

Expand All @@ -135,7 +140,7 @@ void REMORA::init_bcs ()
{
amrex::Vector<Orientation> 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<std::string> 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) {
Expand Down
5 changes: 0 additions & 5 deletions Tests/test_files/Advection/Advection.i
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Tests/test_files/Advection_ML/Advection_ML.i
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions Tests/test_files/Channel_Test/Channel_Test.i
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions Tests/test_files/DoubleGyre/DoubleGyre.i
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Tests/test_files/DoublyPeriodic/DoublyPeriodic.i
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Tests/test_files/DoublyPeriodic_bathy/DoublyPeriodic_bathy.i
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Tests/test_files/Seamount/Seamount.i
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit daec721

Please sign in to comment.