Skip to content

Commit

Permalink
Merge branch 'development' into ysu-pbl-moreprog
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Apr 24, 2024
2 parents f169c73 + 3403574 commit b3eeb82
Show file tree
Hide file tree
Showing 66 changed files with 2,619 additions and 297 deletions.
5 changes: 4 additions & 1 deletion CMake/BuildERFExe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function(build_erf_lib erf_lib_name)
${SRC_DIR}/Initialization/ERF_init_from_metgrid.cpp
${SRC_DIR}/Initialization/ERF_init_uniform.cpp
${SRC_DIR}/Initialization/ERF_init1d.cpp
${SRC_DIR}/Initialization/ERF_input_sponge.cpp
${SRC_DIR}/IO/Checkpoint.cpp
${SRC_DIR}/IO/ERF_ReadBndryPlanes.cpp
${SRC_DIR}/IO/ERF_WriteBndryPlanes.cpp
Expand All @@ -152,6 +153,7 @@ function(build_erf_lib erf_lib_name)
${SRC_DIR}/IO/writeJobInfo.cpp
${SRC_DIR}/IO/console_io.cpp
${SRC_DIR}/SourceTerms/ERF_ApplySpongeZoneBCs.cpp
${SRC_DIR}/SourceTerms/ERF_ApplySpongeZoneBCs_ReadFromFile.cpp
${SRC_DIR}/SourceTerms/ERF_make_buoyancy.cpp
${SRC_DIR}/SourceTerms/ERF_add_thin_body_sources.cpp
${SRC_DIR}/SourceTerms/ERF_make_mom_sources.cpp
Expand All @@ -174,7 +176,8 @@ function(build_erf_lib erf_lib_name)
${SRC_DIR}/Utils/MomentumToVelocity.cpp
${SRC_DIR}/Utils/TerrainMetrics.cpp
${SRC_DIR}/Utils/VelocityToMomentum.cpp
${SRC_DIR}/Utils/InteriorGhostCells.cpp
${SRC_DIR}/Utils/InteriorGhostCells.cpp
${SRC_DIR}/Utils/Time_Avg_Vel.cpp
${SRC_DIR}/Microphysics/SAM/Init_SAM.cpp
${SRC_DIR}/Microphysics/SAM/Cloud_SAM.cpp
${SRC_DIR}/Microphysics/SAM/IceFall.cpp
Expand Down
14 changes: 13 additions & 1 deletion Docs/sphinx_doc/BoundaryConditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ ERF provides the capability to apply sponge zones at the boundaries to prevent s
\frac{dQ}{dt} = \mathrm{RHS} - A\xi^n(Q-Q_\mathrm{target})
where RHS are the other right-hand side terms. The parameters to be set by the user are -- `A` is the sponge amplitude, `n` is the sponge strength and the :math:`Q_\mathrm{target}` -- the target solution in the sponge. `\xi` is a linear coordinate that is 0 at the beginning of the sponge and 1 at the end. An example of the sponge inputs can be found in ``Exec/RegTests/Terrain2d_Cylinder``.
where RHS are the other right-hand side terms. The parameters to be set by the user are -- `A` is the sponge amplitude, `n` is the sponge strength and the :math:`Q_\mathrm{target}` -- the target solution in the sponge. :math:`\xi` is a linear coordinate that is 0 at the beginning of the sponge and 1 at the end. An example of the sponge inputs can be found in ``Exec/RegTests/Terrain2d_Cylinder`` and is given below. This list of inputs specifies sponge zones in the inlet and outlet of the domain in the x-direction and the outlet of the domain in the z-direction. The `start` and `end` parameters specify the starting and ending of the sponge zones. At the inlet, the sponge starts at :math:`x=0` and at the outlet the sponge ends at :math:`x=L` -- the end of the domain. The sponge amplitude `A` has to be adjust
ed in a problem-specific manner. The density and the :math:`x, y, z` velocities to be used in the sponge zones have to be specified in the inputs list.

::

Expand All @@ -214,3 +215,14 @@ where RHS are the other right-hand side terms. The parameters to be set by the u
erf.sponge_x_velocity = 10.0
erf.sponge_y_velocity = 0.0
erf.sponge_z_velocity = 0.0

Another way of specifying sponge zones is by providing the sponge zone data as a text file input. This is currently implemented only for forcing :math:`x` and :math:`y` velocities in the sponge zones.
The sponge data is input as a text file with 3 columns containing :math:`z, u, v` values. An example can be found in ``Exec/SpongeTest`` and a sample inputs list for using this feature is given below. This list specifies a sponge zone in the inlet in the x-direction. The :math:`u` and :math:`v` velocity forcing in the sponge zones will be read in from the text file -- `input_sponge_file.txt`.

::

erf.sponge_type = "input_sponge"
erf.input_sponge_file = "input_sponge_file.txt"
erf.sponge_strength = 1000.0
erf.use_xlo_sponge_damping = true
erf.xlo_sponge_end = 4.0
34 changes: 30 additions & 4 deletions Docs/sphinx_doc/Plotfiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ PlotFile Outputs
================

Plotfiles can include the quantities of several simulation parameters as output.
They are summarized in the list below.
They are summarized in the list below. Note that temporally averaged quantities
(e.g., ``u_t_avg, v_t_avg, w_t_avg, umag_t_avg``) require the user to enable the
storage of the time averaged variables with ``erf.time_avg_vel = true``.

Output Options
--------------
Expand Down Expand Up @@ -201,18 +203,34 @@ Output Options
| | |
| | |
+-----------------------------+------------------+
| **vorticity_x* | x-component of |
| **vorticity_x** | x-component of |
| | vorticity |
| | |
+-----------------------------+------------------+
| **vorticity_y* | y-component of |
| **vorticity_y** | y-component of |
| | vorticity |
| | |
+-----------------------------+------------------+
| **vorticity_z* | z-component of |
| **vorticity_z** | z-component of |
| | vorticity |
| | |
+-----------------------------+------------------+
| **u_t_avg** | time average of |
| | x-component of |
| | velocity |
+-----------------------------+------------------+
| **v_t_avg** | time average of |
| | y-component of |
| | velocity |
+-----------------------------+------------------+
| **w_t_avg** | time average of |
| | z-component of |
| | velocity |
+-----------------------------+------------------+
| **umag_t_avg** | time average of |
| | velocity mag |
| | |
+-----------------------------+------------------+
| **rhoadv_0** | Conserved scalar |
| | |
| | |
Expand All @@ -233,6 +251,14 @@ Output Options
| | |
| | |
+-----------------------------+------------------+
| **lat_m** | Latitude at mass |
| | points |
| | |
+-----------------------------+------------------+
| **lon_m** | Longitude at |
| | mass points |
| | |
+-----------------------------+------------------+
| **Kmv** | Vertical |
| | Eddy Diffusivity |
| | of Momentum |
Expand Down
65 changes: 65 additions & 0 deletions Exec/ABL/inputs_vel_avg
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# ------------------ INPUTS TO MAIN PROGRAM -------------------
max_step = 4000

amrex.fpe_trap_invalid = 1

fabarray.mfiter_tile_size = 1024 1024 1024

# PROBLEM SIZE & GEOMETRY
geometry.prob_extent = 1024 1024 1024
amr.n_cell = 64 64 64

geometry.is_periodic = 1 1 0

zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

# TIME STEP CONTROL
erf.fixed_dt = 0.1 # fixed time step depending on grid resolution

# DIAGNOSTICS & VERBOSITY
erf.sum_interval = 1 # timesteps between computing mass
erf.v = 1 # verbosity in ERF.cpp
amr.v = 1 # verbosity in Amr.cpp

# REFINEMENT / REGRIDDING
amr.max_level = 0 # maximum level number allowed

# CHECKPOINT FILES
erf.check_file = chk # root name of checkpoint file
erf.check_int = 100 # number of timesteps between checkpoints

# PLOTFILES
erf.time_avg_vel = true
erf.plot_file_1 = plt # prefix of plotfile name
erf.plot_int_1 = 10 # number of timesteps between plotfiles
erf.plot_vars_1 = density rhoKE rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta u_t_avg v_t_avg w_t_avg umag_t_avg

# SOLVER CHOICE
erf.alpha_T = 0.0
erf.alpha_C = 1.0
erf.use_gravity = false

erf.molec_diff_type = "None"
erf.les_type = "Deardorff"
erf.Ck = 0.1
erf.sigma_k = 1.0
erf.Ce = 0.1

erf.init_type = "uniform"
erf.KE_0 = 0.1 # for Deardorff

# PROBLEM PARAMETERS
prob.rho_0 = 1.0
prob.A_0 = 1.0

prob.U_0 = 10.0
prob.V_0 = 0.0
prob.W_0 = 0.0
prob.T_0 = 300.0

# Higher values of perturbations lead to instability
# Instability seems to be coming from BC
prob.U_0_Pert_Mag = 0.08
prob.V_0_Pert_Mag = 0.08 #
prob.W_0_Pert_Mag = 0.0
2 changes: 1 addition & 1 deletion Exec/DevTests/MetGrid/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ erf.check_int = 100 # number of timesteps between checkpoints
# PLOTFILES
erf.plot_file_1 = plt # prefix of plotfile name
erf.plot_int_1 = 10 # number of timesteps between plotfiles
erf.plot_vars_1 = density dens_hse rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta z_phys mapfac pres_hse pert_pres
erf.plot_vars_1 = lat_m lon_m density dens_hse rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta z_phys mapfac pres_hse pert_pres

# SOLVER CHOICE
erf.alpha_T = 1.0
Expand Down
12 changes: 12 additions & 0 deletions Exec/EWP/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(erf_exe_name erf_fitch)

add_executable(${erf_exe_name} "")
target_sources(${erf_exe_name}
PRIVATE
prob.cpp
)

target_include_directories(${erf_exe_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

include(${CMAKE_SOURCE_DIR}/CMake/BuildERFExe.cmake)
build_erf_exe(${erf_exe_name})
37 changes: 37 additions & 0 deletions Exec/EWP/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AMReX
COMP = gnu
PRECISION = DOUBLE

# Profiling
PROFILE = FALSE
TINY_PROFILE = TRUE
COMM_PROFILE = FALSE
TRACE_PROFILE = FALSE
MEM_PROFILE = FALSE
USE_GPROF = FALSE

# Performance
USE_MPI = TRUE
USE_OMP = FALSE

USE_CUDA = FALSE
USE_HIP = FALSE
USE_SYCL = FALSE

# Debugging
DEBUG = FALSE

TEST = TRUE
USE_ASSERTION = TRUE

USE_WINDFARM = TRUE


#USE_POISSON_SOLVE = TRUE

# GNU Make
Bpack := ./Make.package
Blocs := .
ERF_HOME := ../..
ERF_PROBLEM_DIR = $(ERF_HOME)/Exec/EWP
include $(ERF_HOME)/Exec/Make.ERF
2 changes: 2 additions & 0 deletions Exec/EWP/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CEXE_headers += prob.H
CEXE_sources += prob.cpp
6 changes: 6 additions & 0 deletions Exec/EWP/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This problem setup is for simulation of the Atmospheric Boundary Layer (ABL)
using one of two turbulence schemes (Smagorinsky or Deardorff) and the bottom
boundary condition possibly specified by Monin Obukhov Similarity Theory (MOST).

This version of the ABL problem initializes the data using a hydrostatic profile
with random perturbations in velocity and potential temperature.
78 changes: 78 additions & 0 deletions Exec/EWP/inputs_EWP_WindFarm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# ------------------ INPUTS TO MAIN PROGRAM -------------------
max_step = 100000

amrex.fpe_trap_invalid = 1

fabarray.mfiter_tile_size = 1024 1024 1024

# PROBLEM SIZE & GEOMETRY
erf.latitude_lo = 35.0
erf.longitude_lo = -100.0
geometry.prob_extent = 200150 202637 1000
amr.n_cell = 50 50 40

#erf.grid_stretching_ratio = 1.025
#erf.initial_dz = 16.0

geometry.is_periodic = 0 0 0

# MOST BOUNDARY (DEFAULT IS ADIABATIC FOR THETA)
#zlo.type = "MOST"
#erf.most.z0 = 0.1
#erf.most.zref = 8.0

zlo.type = "SlipWall"
zhi.type = "SlipWall"
xlo.type = "Outflow"
xhi.type = "Outflow"
ylo.type = "Outflow"
yhi.type = "Outflow"

# TIME STEP CONTROL
erf.use_native_mri = 1
erf.fixed_dt = 0.25 # fixed time step depending on grid resolution
#erf.fixed_fast_dt = 0.0025

# DIAGNOSTICS & VERBOSITY
erf.sum_interval = 1 # timesteps between computing mass
erf.v = 1 # verbosity in ERF.cpp
amr.v = 1 # verbosity in Amr.cpp

# REFINEMENT / REGRIDDING
amr.max_level = 0 # maximum level number allowed

# CHECKPOINT FILES
erf.check_file = chk # root name of checkpoint file
erf.check_int = 10000 # number of timesteps between checkpoints
#erf.restart = chk02000

# PLOTFILES
erf.plot_file_1 = plt # prefix of plotfile name
erf.plot_int_1 = 1000 # number of timesteps between plotfiles
erf.plot_vars_1 = density rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta QKE num_turb vorticity

# SOLVER CHOICE
erf.alpha_T = 0.0
erf.alpha_C = 1.0
erf.use_gravity = false

erf.molec_diff_type = "ConstantAlpha"
erf.les_type = "None"
erf.Cs = 1.5
erf.dynamicViscosity = 100.0

erf.pbl_type = "None"

erf.init_type = "uniform"

erf.windfarm_type = "EWP"

# PROBLEM PARAMETERS
prob.rho_0 = 1.0
prob.A_0 = 1.0

prob.U_0 = 10.0
prob.V_0 = 10.0
prob.W_0 = 0.0
prob.T_0 = 300.0

Loading

0 comments on commit b3eeb82

Please sign in to comment.