Skip to content

Commit a497bd2

Browse files
authored
make mass_inflow_outflow compatible with VOF (#1528)
* make mass_inflow_outflow compatible with VOF * reg test for this scenario. not working yet, not sure why * following Marc's rec on the reg test; does not run because of AMReX-Hydro issues with AMReX-Hydro updated, reg tests are running properly
1 parent ef2cbf2 commit a497bd2

File tree

6 files changed

+209
-1
lines changed

6 files changed

+209
-1
lines changed

amr-wind/equation_systems/vof/vof_bciface.H

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ protected:
5959

6060
case BC::wave_generation:
6161
case BC::mass_inflow:
62+
case BC::mass_inflow_outflow:
6263
if (side == amrex::Orientation::low) {
6364
set_bcrec_lo(dir, amrex::BCType::ext_dir);
6465
} else {
@@ -86,7 +87,7 @@ protected:
8687
const auto bct = bctype[ori];
8788

8889
amrex::ParmParse pp(bcid);
89-
if (bct == BC::mass_inflow) {
90+
if (bct == BC::mass_inflow || bct == BC::mass_inflow_outflow) {
9091
pp.getarr(fname.c_str(), bcval[ori], 0, ndim);
9192
} else {
9293
pp.queryarr(fname.c_str(), bcval[ori], 0, ndim);

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ add_test_re(abl_unstable_local_wall_model)
206206
add_test_re(abl_unstable_schumann_wall_model)
207207
add_test_re(abl_anelastic)
208208
add_test_re(abl_multiphase_laminar)
209+
add_test_re(abl_multiphase_laminar_2planes)
209210
add_test_re(abl_waves_terrain)
210211
add_test_re(act_abl_joukowskydisk)
211212
add_test_re(act_abl_uniformctdisk)
@@ -390,6 +391,7 @@ if(AMR_WIND_TEST_WITH_FCOMPARE)
390391
add_test_red(abl_bndry_input_amr_native_mlbc abl_bndry_output_amr_native)
391392
add_test_red(abl_godunov_forcetimetable abl_godunov_timetable)
392393
add_test_red(abl_multiphase_laminar_input abl_multiphase_laminar)
394+
add_test_red(abl_multiphase_laminar_inout abl_multiphase_laminar_2planes)
393395
endif()
394396

395397
if(AMR_WIND_ENABLE_NETCDF)
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
2+
# SIMULATION STOP #
3+
#.......................................#
4+
time.stop_time = 28800.0 # Max (simulated) time to evolve
5+
time.max_step = 10 # Max number of time steps
6+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
7+
# TIME STEP COMPUTATION #
8+
#.......................................#
9+
time.fixed_dt = 0.05 # Use this constant dt if > 0
10+
time.cfl = 0.95 # CFL factor
11+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
12+
# INPUT AND OUTPUT #
13+
#.......................................#
14+
time.plot_interval = 10 # Steps between plot files
15+
time.checkpoint_interval = 5 # Steps between checkpoint files
16+
io.outputs = velocity_mueff temperature_mueff
17+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
18+
# PHYSICS #
19+
#.......................................#
20+
incflo.gravity = 0.0 0.0 -9.81 # Gravitational force (3D)
21+
incflo.use_godunov = 1
22+
incflo.diffusion_type = 1
23+
incflo.godunov_type = "weno_z"
24+
incflo.mflux_type = "minmod"
25+
transport.model = TwoPhaseTransport
26+
transport.viscosity_fluid1 = 1e-3
27+
transport.viscosity_fluid2 = 1e-5
28+
transport.laminar_prandtl_fluid1 = 7.2
29+
transport.laminar_prandtl_fluid2 = 0.7
30+
transport.turbulent_prandtl = 0.3333
31+
transport.reference_temperature = 263.5
32+
turbulence.model = Laminar
33+
incflo.physics = MultiPhase ABL OceanWaves
34+
ICNS.source_terms = BoussinesqBuoyancy CoriolisForcing GeostrophicForcing GravityForcing
35+
ICNS.use_perturb_pressure = true
36+
MultiPhase.density_fluid1=1020.
37+
MultiPhase.density_fluid2=1.3223
38+
CoriolisForcing.east_vector = 1.0 0.0 0.0
39+
CoriolisForcing.north_vector = 0.0 1.0 0.0
40+
CoriolisForcing.latitude = 90.0
41+
CoriolisForcing.rotational_time_period = 90405.5439881955
42+
GeostrophicForcing.geostrophic_wind = 8.0 0.0 0.0
43+
GeostrophicForcing.wind_forcing_off_height = 3.0
44+
GeostrophicForcing.wind_forcing_ramp_height = 7.0
45+
incflo.velocity = 8.0 0.0 0.0
46+
ABL.temperature_heights = 0.0 100 400.0
47+
ABL.temperature_values = 265.0 265.0 268.0
48+
ABL.perturb_temperature = false
49+
ABL.cutoff_height = 50.0
50+
ABL.perturb_velocity = true
51+
ABL.perturb_ref_height = 50.0
52+
ABL.Uperiods = 4.0
53+
ABL.Vperiods = 4.0
54+
ABL.deltaU = 1e-5
55+
ABL.deltaV = 1e-5
56+
ABL.normal_direction = 2
57+
# frequency is rapid for the sake of reg test
58+
ABL.stats_output_frequency = 5
59+
OceanWaves.label = Wave1
60+
OceanWaves.Wave1.type = LinearWaves
61+
OceanWaves.Wave1.wave_height=2.0
62+
OceanWaves.Wave1.wave_length=40.0
63+
OceanWaves.Wave1.water_depth=133
64+
OceanWaves.Wave1.relax_zone_gen_length=40.0
65+
OceanWaves.Wave1.relax_zone_out_length=40.0
66+
67+
ABL.bndry_file = "bndry_files"
68+
ABL.bndry_io_mode = 0
69+
ABL.bndry_planes = xlo xhi
70+
ABL.bndry_output_start_time = 0.2
71+
ABL.bndry_var_names = velocity temperature vof density
72+
ABL.bndry_output_format = native
73+
74+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
75+
# ADAPTIVE MESH REFINEMENT #
76+
#.......................................#
77+
amr.n_cell = 48 48 64 # Grid cells at coarsest AMRlevel
78+
amr.max_level = 1 # Max AMR level in hierarchy
79+
tagging.labels = static
80+
tagging.static.type = CartBoxRefinement
81+
tagging.static.static_refinement_def = static_box.txt
82+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
83+
# GEOMETRY #
84+
#.......................................#
85+
geometry.prob_lo = 0. 0. -133. # Lo corner coordinates
86+
geometry.prob_hi = 400. 400. 400. # Hi corner coordinates
87+
geometry.is_periodic = 1 1 0 # Periodicity x y z (0/1)
88+
# Boundary conditions
89+
zlo.type = "slip_wall"
90+
zhi.type = "slip_wall"
91+
zhi.temperature_type = "fixed_gradient"
92+
zhi.temperature = 0.01
93+
incflo.verbose = 0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2
2+
1
3+
0.0 0.0 -20. 400. 400. 20.
4+
1
5+
0.0 0.0 -8. 400. 400. 8.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
2+
# SIMULATION STOP #
3+
#.......................................#
4+
time.stop_time = 28800.0 # Max (simulated) time to evolve
5+
time.max_step = 10 # Max number of time steps
6+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
7+
# TIME STEP COMPUTATION #
8+
#.......................................#
9+
time.fixed_dt = 0.05 # Use this constant dt if > 0
10+
time.cfl = 0.95 # CFL factor
11+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
12+
# INPUT AND OUTPUT #
13+
#.......................................#
14+
io.restart_file = "../abl_multiphase_laminar_2planes/chk00005"
15+
time.plot_interval = 10 # Steps between plot files
16+
time.checkpoint_interval = -1 # Steps between checkpoint files
17+
io.outputs = velocity_mueff temperature_mueff
18+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
19+
# PHYSICS #
20+
#.......................................#
21+
incflo.gravity = 0.0 0.0 -9.81 # Gravitational force (3D)
22+
incflo.use_godunov = 1
23+
incflo.diffusion_type = 1
24+
incflo.godunov_type = "weno_z"
25+
incflo.mflux_type = "minmod"
26+
transport.model = TwoPhaseTransport
27+
transport.viscosity_fluid1 = 1e-3
28+
transport.viscosity_fluid2 = 1e-5
29+
transport.laminar_prandtl_fluid1 = 7.2
30+
transport.laminar_prandtl_fluid2 = 0.7
31+
transport.turbulent_prandtl = 0.3333
32+
transport.reference_temperature = 263.5
33+
turbulence.model = Laminar
34+
incflo.physics = MultiPhase ABL OceanWaves
35+
ICNS.source_terms = BoussinesqBuoyancy CoriolisForcing GeostrophicForcing GravityForcing
36+
ICNS.use_perturb_pressure = true
37+
MultiPhase.density_fluid1=1020.
38+
MultiPhase.density_fluid2=1.3223
39+
CoriolisForcing.east_vector = 1.0 0.0 0.0
40+
CoriolisForcing.north_vector = 0.0 1.0 0.0
41+
CoriolisForcing.latitude = 90.0
42+
CoriolisForcing.rotational_time_period = 90405.5439881955
43+
GeostrophicForcing.geostrophic_wind = 8.0 0.0 0.0
44+
GeostrophicForcing.wind_forcing_off_height = 3.0
45+
GeostrophicForcing.wind_forcing_ramp_height = 7.0
46+
incflo.velocity = 8.0 0.0 0.0
47+
ABL.temperature_heights = 0.0 100 400.0
48+
ABL.temperature_values = 265.0 265.0 268.0
49+
ABL.perturb_temperature = false
50+
ABL.cutoff_height = 50.0
51+
ABL.perturb_velocity = true
52+
ABL.perturb_ref_height = 50.0
53+
ABL.Uperiods = 4.0
54+
ABL.Vperiods = 4.0
55+
ABL.deltaU = 1e-5
56+
ABL.deltaV = 1e-5
57+
ABL.normal_direction = 2
58+
# frequency is rapid for the sake of reg test
59+
ABL.stats_output_frequency = 5
60+
OceanWaves.label = Wave1
61+
OceanWaves.Wave1.type = LinearWaves
62+
OceanWaves.Wave1.wave_height=2.0
63+
OceanWaves.Wave1.wave_length=40.0
64+
OceanWaves.Wave1.water_depth=133
65+
OceanWaves.Wave1.relax_zone_gen_length=40.0
66+
OceanWaves.Wave1.relax_zone_out_length=40.0
67+
68+
ABL.bndry_file = "../abl_multiphase_laminar_2planes/bndry_files"
69+
ABL.bndry_io_mode = 1
70+
ABL.bndry_planes = xlo xhi
71+
ABL.bndry_output_start_time = 0.2
72+
ABL.bndry_var_names = velocity temperature vof density
73+
ABL.bndry_output_format = native
74+
75+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
76+
# ADAPTIVE MESH REFINEMENT #
77+
#.......................................#
78+
amr.n_cell = 48 48 64 # Grid cells at coarsest AMRlevel
79+
amr.max_level = 1 # Max AMR level in hierarchy
80+
tagging.labels = static
81+
tagging.static.type = CartBoxRefinement
82+
tagging.static.static_refinement_def = static_box.txt
83+
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
84+
# GEOMETRY #
85+
#.......................................#
86+
geometry.prob_lo = 0. 0. -133. # Lo corner coordinates
87+
geometry.prob_hi = 400. 400. 400. # Hi corner coordinates
88+
geometry.is_periodic = 0 1 0 # Periodicity x y z (0/1)
89+
# Boundary conditions
90+
xlo.type = "mass_inflow_outflow"
91+
xlo.density = 1.3223
92+
xlo.vof = 0.0
93+
xlo.temperature = 0.0
94+
xhi.type = "mass_inflow_outflow"
95+
xhi.density = 1.3223
96+
xhi.vof = 0.0
97+
xhi.temperature = 0.0
98+
zlo.type = "slip_wall"
99+
zhi.type = "slip_wall"
100+
zhi.temperature_type = "fixed_gradient"
101+
zhi.temperature = 0.01
102+
incflo.verbose = 0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2
2+
1
3+
0.0 0.0 -20. 400. 400. 20.
4+
1
5+
0.0 0.0 -8. 400. 400. 8.

0 commit comments

Comments
 (0)