diff --git a/amr-wind/wind_energy/ABLBoundaryPlane.cpp b/amr-wind/wind_energy/ABLBoundaryPlane.cpp index 80895ceb22..c9422739ed 100644 --- a/amr-wind/wind_energy/ABLBoundaryPlane.cpp +++ b/amr-wind/wind_energy/ABLBoundaryPlane.cpp @@ -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; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cda1c2129c..704fb427a9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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) diff --git a/test/test_files/abl_bndry_input_amr_native_xhi/abl_bndry_input_amr_native_xhi.inp b/test/test_files/abl_bndry_input_amr_native_xhi/abl_bndry_input_amr_native_xhi.inp new file mode 100644 index 0000000000..9e9ba2d073 --- /dev/null +++ b/test/test_files/abl_bndry_input_amr_native_xhi/abl_bndry_input_amr_native_xhi.inp @@ -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 diff --git a/test/test_files/abl_bndry_input_amr_native_xhi/static_box.txt b/test/test_files/abl_bndry_input_amr_native_xhi/static_box.txt new file mode 100644 index 0000000000..913e19106d --- /dev/null +++ b/test/test_files/abl_bndry_input_amr_native_xhi/static_box.txt @@ -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 diff --git a/test/test_files/abl_bndry_output_native/abl_bndry_output_native.inp b/test/test_files/abl_bndry_output_native/abl_bndry_output_native.inp index 4d659c9cc5..f944ce8b2b 100644 --- a/test/test_files/abl_bndry_output_native/abl_bndry_output_native.inp +++ b/test/test_files/abl_bndry_output_native/abl_bndry_output_native.inp @@ -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