Skip to content

Commit

Permalink
Add regression test that shows how to use Ascent (Exawind#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Jun 22, 2022
1 parent a27e9c1 commit ad8e321
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 1 deletion.
1 change: 1 addition & 0 deletions amr-wind/utilities/ascent/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target_sources(${amr_wind_lib_name}
PRIVATE
ascent.H
ascent.cpp
)
2 changes: 1 addition & 1 deletion amr-wind/utilities/ascent/ascent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void AscentPostProcess::post_advance_work()
ascent::Ascent ascent;
conduit::Node open_opts;

#ifdef BL_USE_MPI
#ifdef AMREX_USE_MPI
open_opts["mpi_comm"] =
MPI_Comm_c2f(amrex::ParallelDescriptor::Communicator());
#endif
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ if(AMR_WIND_ENABLE_HDF5)
endif()
endif()

if(AMR_WIND_ENABLE_ASCENT)
add_test_re(abl_godunov_ascent)
endif()

#=============================================================================
# Regression tests excluded from CI with a test dependency
#=============================================================================
Expand Down
80 changes: 80 additions & 0 deletions test/test_files/abl_godunov_ascent/abl_godunov_ascent.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# 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.5 # Use this constant dt if > 0
time.cfl = 0.95 # CFL factor

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# INPUT AND OUTPUT #
#.......................................#
time.plot_interval = 10 # Steps between plot files
time.checkpoint_interval = 5 # Steps between checkpoint files

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# PHYSICS #
#.......................................#
incflo.gravity = 0. 0. -9.81 # Gravitational force (3D)
incflo.density = 1.0 # Reference density

incflo.use_godunov = 1
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 = BoussinesqBuoyancy CoriolisForcing ABLForcing
BoussinesqBuoyancy.reference_temperature = 300.0
ABL.reference_temperature = 300.0
CoriolisForcing.latitude = 41.3
ABLForcing.abl_forcing_height = 90

incflo.velocity = 6.128355544951824 5.142300877492314 0.0

ABL.temperature_heights = 650.0 750.0 1000.0
ABL.temperature_values = 300.0 308.0 308.75

ABL.kappa = .41
ABL.surface_roughness_z0 = 0.15

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# ADAPTIVE MESH REFINEMENT #
#.......................................#
amr.n_cell = 48 48 48 # Grid cells at coarsest AMRlevel
amr.max_level = 0 # Max AMR level in hierarchy

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# GEOMETRY #
#.......................................#
geometry.prob_lo = 0. 0. 0. # Lo corner coordinates
geometry.prob_hi = 1000. 1000. 1000. # Hi corner coordinates
geometry.is_periodic = 1 1 0 # Periodicity x y z (0/1)

# Boundary conditions
zlo.type = "wall_model"

zhi.type = "slip_wall"
zhi.temperature_type = "fixed_gradient"
zhi.temperature = 0.003 # tracer is used to specify potential temperature gradient

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# VERBOSITY #
#.......................................#
incflo.verbose = 0 # incflo_level


#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# ASCENT #
#.......................................#
incflo.post_processing = ascent
ascent.type = Ascent
ascent.fields = p temperature
ascent.output_frequency = 5
16 changes: 16 additions & 0 deletions test/test_files/abl_godunov_ascent/ascent_actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-
action: "add_scenes"
scenes:
scene1:
image_prefix: "pressure_"
plots:
plt1:
type: "pseudocolor"
field: "p"
scene2:
image_prefix: "temperature_"
plots:
plt1:
type: "pseudocolor"
field: "temperature"

0 comments on commit ad8e321

Please sign in to comment.