Skip to content

Commit

Permalink
Fix abl bndry inflow at the high BCs (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Oct 12, 2024
1 parent 1cfd5f9 commit 32811b1
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 2 deletions.
2 changes: 1 addition & 1 deletion amr-wind/wind_energy/ABLBoundaryPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ bool ABLBoundaryPlane::box_intersects_boundary(
const int normal = ori.coordDir();
amrex::IntVect plo(domBox.loVect());
amrex::IntVect phi(domBox.hiVect());
plo[normal] = ori.isHigh() ? domBox.loVect()[normal] : 0;
plo[normal] = ori.isHigh() ? domBox.hiVect()[normal] : 0;
phi[normal] = ori.isHigh() ? domBox.hiVect()[normal] : 0;
const amrex::Box pbx(plo, phi);
const auto& intersection = bx & pbx;
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ endif()
add_test_red(abl_bndry_input_native abl_bndry_output_native)
add_test_red(abl_godunov_restart abl_godunov)
add_test_red(abl_bndry_input_amr_native abl_bndry_output_native)
add_test_red(abl_bndry_input_amr_native_xhi abl_bndry_output_native)
add_test_red(abl_bndry_input_amr_native_mlbc abl_bndry_output_amr_native)
add_test_red(abl_godunov_forcetimetable abl_godunov_timetable)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# SIMULATION STOP #
#.......................................#
time.stop_time = 22000.0 # Max (simulated) time to evolve
time.max_step = 10 # Max number of time steps
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# TIME STEP COMPUTATION #
#.......................................#
time.fixed_dt = 0.4 # Use this constant dt if > 0
time.cfl = 0.95 # CFL factor
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# INPUT AND OUTPUT #
#.......................................#
io.restart_file = "../abl_bndry_output_native/chk00005"
time.plot_interval = 10 # Steps between plot files
time.checkpoint_interval = -1 # Steps between checkpoint files
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# PHYSICS #
#.......................................#
incflo.gravity = 0. 0. -9.81 # Gravitational force (3D)
incflo.density = 1.0 # Reference density
incflo.use_godunov = 1
incflo.diffusion_type = 2
transport.viscosity = 1.0e-5
transport.laminar_prandtl = 0.7
transport.turbulent_prandtl = 0.3333
turbulence.model = Smagorinsky
Smagorinsky_coeffs.Cs = 0.135
incflo.physics = ABL
ICNS.source_terms = CoriolisForcing GeostrophicForcing
BoussinesqBuoyancy.reference_temperature = 290.0
ABL.reference_temperature = 290.0
CoriolisForcing.east_vector = 1.0 0.0 0.0
CoriolisForcing.north_vector = 0.0 1.0 0.0
CoriolisForcing.latitude = 90.0
CoriolisForcing.rotational_time_period = 125663.706143592
GeostrophicForcing.geostrophic_wind = 10.0 0.0 0.0
incflo.velocity = 10.0 0.0 0.0
ABL.temperature_heights = 0.0 2000.0
ABL.temperature_values = 290.0 290.0
ABL.perturb_temperature = false
ABL.cutoff_height = 50.0
ABL.perturb_velocity = true
ABL.perturb_ref_height = 50.0
ABL.Uperiods = 4.0
ABL.Vperiods = 4.0
ABL.deltaU = 1.0
ABL.deltaV = 1.0
ABL.kappa = .41
ABL.surface_roughness_z0 = 0.01
ABL.bndry_file = "../abl_bndry_output_native/bndry_files"
ABL.bndry_io_mode = 1
ABL.bndry_var_names = velocity temperature
ABL.bndry_output_format = native
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# ADAPTIVE MESH REFINEMENT #
#.......................................#
amr.n_cell = 48 48 48 # Grid cells at coarsest AMRlevel
amr.max_level = 2 # Max AMR level in hierarchy
tagging.labels = "static"
tagging.static.type = "CartBoxRefinement"
tagging.static.static_refinement_def = "static_box.txt"
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# GEOMETRY #
#.......................................#
geometry.prob_lo = 0. 0. 0. # Lo corner coordinates
geometry.prob_hi = 1000. 1000. 1000. # Hi corner coordinates
geometry.is_periodic = 0 0 0 # Periodicity x y z (0/1)
incflo.delp = 0. 0. 0. # Prescribed (cyclic) pressure gradient
# Boundary conditions
xlo.type = "pressure_outflow"
xhi.type = "mass_inflow"
xhi.density = 1.0
xhi.temperature = 0.0
ylo.type = "mass_inflow"
ylo.density = 1.0
ylo.temperature = 0.0
yhi.type = "pressure_outflow"
zlo.type = "wall_model"
zhi.type = "slip_wall"
zhi.temperature_type = "fixed_gradient"
zhi.temperature = 0.0
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# VERBOSITY #
#.......................................#
incflo.verbose = 0 # incflo_level
5 changes: 5 additions & 0 deletions test/test_files/abl_bndry_input_amr_native_xhi/static_box.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2
1
300.0 300.0 40.0 700.0 700.0 400.0
1
450.0 450.0 100.0 550.0 550.0 200.0
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ABL.kappa = .41
ABL.surface_roughness_z0 = 0.01
ABL.bndry_file = "bndry_files"
ABL.bndry_io_mode = 0
ABL.bndry_planes = ylo xlo
ABL.bndry_planes = ylo xlo xhi
ABL.bndry_output_start_time = 2.0
ABL.bndry_var_names = velocity temperature
ABL.bndry_output_format = native
Expand Down

0 comments on commit 32811b1

Please sign in to comment.