Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbulent inflow generation (patch) #1665

Merged
merged 38 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cb98f45
Generalized size of boxes. Start implementing CPB. Still need user in…
Jun 25, 2024
7cc0570
Added my own folder in Exec, ABL_perturbation_inflow
Jun 25, 2024
3d515c0
Generalized BPM so it can transform into CPM. Added more user input v…
Jun 25, 2024
2f0f220
Merge branch 'development' into perturbation_box_method
Jun 25, 2024
8c995b9
manually got rid of tabs
Jun 25, 2024
7b7bfc7
added in calc_tpi_meanMag_firstCell() function and direct field add w…
Jun 26, 2024
bc0c152
amr.v=0 helps with runtime. Added random numbers for PB_intervals. Ad…
Jun 27, 2024
29ffa5a
Fixed CUDA private member issue. CONTINUE with CPM debug, fast_rhs_fu…
Jun 27, 2024
efaa839
Added output format into file + verbose tags. Fixed parallel issue of…
Jun 28, 2024
fa9eb9a
Added output format into file + verbose tags. Fixed parallel issue of…
Jun 28, 2024
d901103
Merge branch 'development' into perturbation_box_method. Added output…
Jun 28, 2024
3750cdd
Get rid of trailing white space. Added output format into file + verb…
Jun 28, 2024
71d77d9
update DOI links for build-and-deploy fail test.
Jun 28, 2024
2af1b18
404 Client Error: Not Found for url error fix.
Jun 28, 2024
8f2cc95
404 Client Error: Not Found for url error fix.
Jun 28, 2024
278e536
404 Client Error: Not Found for url error fix.
Jun 28, 2024
9708fbf
Error 403 with Munoz-Esparza 2015 paper. Last attempt
Jun 28, 2024
071488c
Added in perturbation inflow .rst documents. CONTINUE with pb tests. …
Jun 28, 2024
72cfc8c
fix for doc push
Jun 28, 2024
23a1882
manual rerun for DOI link in docs
Jul 1, 2024
401f6c4
link replacement for syntax error
Jul 1, 2024
16a9409
manual check for munoz link
Jul 1, 2024
a887abd
what is going on with these links?
Jul 1, 2024
a037fb0
using link I know that works
Jul 1, 2024
8e59e0d
testing DeLeon link
Jul 1, 2024
cc769ca
DeLeon: maybe it's a syntax error?
Jul 1, 2024
535bc2f
DeLeon: Trying the other way of linking
Jul 1, 2024
ef89302
maybe special character problem?
Jul 1, 2024
e2b821e
commented out links to DeLeon et al. (2018), and Munoz-Esparza et al.…
Jul 1, 2024
9100974
testing perturbation inflow method, qualitativly for now
Jul 2, 2024
a0a95c3
Added trigger tags for PBM in ERF.cpp. This should fix compile error …
Jul 2, 2024
2463350
Document update
Jul 2, 2024
3d0820b
Docs update + merge
Jul 2, 2024
008a52f
resolved erroneous error with pseduo gravity (ignores scales with mec…
Jul 3, 2024
9a2dbc0
resolved erroneous error with pseduo gravity (ignores scales with mec…
Jul 3, 2024
db200c1
updating PR
Jul 10, 2024
9b0d41f
fixing codespell
Jul 10, 2024
9055a70
resolve merge conflict
Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions Docs/sphinx_doc/BoundaryConditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,125 @@ The sponge data is input as a text file with 3 columns containing :math:`z, u, v
erf.sponge_strength = 1000.0
erf.use_xlo_sponge_damping = true
erf.xlo_sponge_end = 4.0

Inflow turbulence generation
---------------------------

ERF provides the capability to apply a perturbation zone at the inflow domain boundary to mechanically trip turbulence into the domain.

.. |PBinflw| image:: figures/PBIllustration.png
:width: 600

.. _fig:pb_fig:

.. table:: Box perturbation method

+-----------------------------------------------------+
| |PBinflw| |
+-----------------------------------------------------+
| Image taken from `DeLeon et al. (2018)` |
+-----------------------------------------------------+

Two different types of perturbation are currently available, ``source``, adopted from `DeLeon et al. (2018)`_

..
_`DeLeon et al. (2018)`: https://doi.org/10.2514/1.J057245

and ``direct``, adopted from `Munoz-Esparza et al. (2015)`_. The ``source`` option applies the perturbation amplitude range, `\pm \Phi_{PB}`, to each cell within the perturbation box as a source term. It's important to note that while this perturbation starts as white noise, it becomes colored noise due to the eddy viscosity turbulence closure. Conversely, the ``direct`` option applies the calculated temperature difference directly onto the `\rho \theta field`.

The current implementation only supports West and South face perturbations, specified by ``erf.perturbation_direction``, where the 3 integer inputs represent the `x`, `y`, and `z` directions, respectively. The flow perturbation method requires the dimensions of an individual box input through ``erf.perturbation_box_dim``, with 3 integer inputs representing `nx_{pb}`, `ny_{pb}`, and `nz_{pb}`, respectively. Following the guidance of `Ma and Senocak (2023)`_,

.. _`Ma and Senocak (2023)`: https://link.springer.com/article/10.1007/s10546-023-00786-1

the general rule of thumb is to use `H_{PB} = 1/8 \delta` as the height of the perturbation box, where `\delta` is the boundary layer height. The length of the box in the x-direction should be `L_{PB} = 2H_{PB}`. Depending on the direction of the bulk flow, the width of the box in the y-direction should be defined as `W_{PB} = L_{PB} \tan{\theta_{inflow}}`. Note that the current implementation only accepts ``int`` entries. Therefore, considering the domain size and mesh resolution, the dimensions of a singular box can be determined.

The specification of the number of layers and the offset into the domain of the perturbation boxes can be made through ``erf.perturbation_layers`` and ``erf.perturbation_offset``, respectively.

::

erf.inlet_perturbation_type = "source"

erf.perturbation_direction = 1 0 0
erf.perturbation_box_dims = 8 8 4
erf.perturbation_layers = 3
erf.perturbation_offset = 1

erf.perturbation_nondimensional = 0.042
erf.perturbation_T_infinity = 300.0
erf.perturbation_T_intensity = 0.1

Before delving into the details, it's important to note that the two methods are interchangeable. While we adhere to the guidelines from the referenced publications, the use of ``direct`` type forcing is not restricted to having unity cell height, nor is ``source`` type forcing limited to boxes. We have generalized the perturbation methods to allow for flexibility in mixing and matching different types of turbulence generation.

Source type forcing
-------------------

The perturbation update interval is determined by the equation,

.. math::

\frac{t_p \langle U(z) \rangle_{PB}}{D_{PB}} = 1,

The change in the perturbation is defined as,

.. math::

{Ri}_{PB} = \frac{g \beta \Delta \overline{\phi} H_{PB}}{{\langle U(z) \rangle}^2_{PB}}.

The magnitude of the perturbation, ignoring the advection and diffusion effects in the transport equation can be made through a proportionality ratio between the update time and change in the box temperature,

.. math::

\Phi_{PB} \propto \frac{\Delta \overliner{\phi}}{t_p}

and the perturbation amplitude is determined by the equation,

.. math::

\Phi_{PB} = \frac{Ri_{PB} {\langle U(z) \rangle}^3_{PB}}{g \beta D_{PB} H_{PB}}.

The ``source`` type forcing can adopt the box perturbation method by having the following inputs list.

::

erf.inlet_perturbation_type = "source"

erf.perturbation_direction = 1 0 0
erf.perturbation_box_dims = 8 8 4
erf.perturbation_layers = 3
erf.perturbation_offset = 1

erf.perturbation_nondimensional = 0.042 # Ri
erf.perturbation_T_infinity = 300.0
erf.perturbation_T_intensity = 0.1

Direct type forcing
-------------------

The perturbation update interval is determined by the equation,
.. math::

\frac{t_p U_{1}}{d_{c}}

and the perturbation amplitude is determined by the equation,
.. math::

Ec = \frac{{U_g}^2}{\rho c_p \theta_{pm}}.

The ``direct`` type forcing can adopt the cell perturbation method by having the following inputs list.
::

erf.inlet_perturbation_type = "direct"

erf.perturbation_direction = 1 0 0
erf.perturbation_box_dims = 8 8 1
erf.perturbation_layers = 3
erf.perturbation_offset = 1

erf.perturbation_nondimensional = 0.16 #Ec
erf.perturbation_rho_0 = 1.0
erf.perturbation_cp = 1250

From `Munoz-Esparza et al. (2015)`_ the choice of the Eckert number is 0.16.

..
_`Munoz-Esparza et al. (2015)`: https://doi.org/10.1063/1.4913572
Binary file added Docs/sphinx_doc/figures/PBIllustration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Exec/DevTests/ABL_perturbation_inflow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(erf_exe_name erf_abl_perturbation_inflow)

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})
34 changes: 34 additions & 0 deletions Exec/DevTests/ABL_perturbation_inflow/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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 = TRUE

TEST = TRUE
USE_ASSERTION = TRUE

#USE_POISSON_SOLVE = TRUE

# GNU Make
Bpack := ./Make.package
Blocs := .
ERF_HOME := ../../..
ERF_PROBLEM_DIR = $(ERF_HOME)/Exec/DevTests/ABL_perturbation_inflow
include $(ERF_HOME)/Exec/Make.ERF
2 changes: 2 additions & 0 deletions Exec/DevTests/ABL_perturbation_inflow/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CEXE_headers += prob.H
CEXE_sources += prob.cpp
7 changes: 7 additions & 0 deletions Exec/DevTests/ABL_perturbation_inflow/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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 from an input sounding file,
and initializes turbulence at the inflow. The target is to transition turbulence
from coarse to fine grid interface.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
0.0 300.0 0.0
1.00000000e-02 3.00000000e+02 0.00000000e+00 1.25066641e+01 0.00000000e+00
3.22187500e-01 3.00000000e+02 0.00000000e+00 2.09762948e+01 0.00000000e+00
6.34375000e-01 3.00000000e+02 0.00000000e+00 2.26287499e+01 0.00000000e+00
9.46562500e-01 3.00000000e+02 0.00000000e+00 2.36048395e+01 0.00000000e+00
1.25875000e+00 3.00000000e+02 0.00000000e+00 2.43000527e+01 0.00000000e+00
1.57093750e+00 3.00000000e+02 0.00000000e+00 2.48404269e+01 0.00000000e+00
1.88312500e+00 3.00000000e+02 0.00000000e+00 2.52825246e+01 0.00000000e+00
2.19531250e+00 3.00000000e+02 0.00000000e+00 2.56566509e+01 0.00000000e+00
2.50750000e+00 3.00000000e+02 0.00000000e+00 2.59809480e+01 0.00000000e+00
2.81968750e+00 3.00000000e+02 0.00000000e+00 2.62671427e+01 0.00000000e+00
3.13187500e+00 3.00000000e+02 0.00000000e+00 2.65232545e+01 0.00000000e+00
3.44406250e+00 3.00000000e+02 0.00000000e+00 2.67550102e+01 0.00000000e+00
3.75625000e+00 3.00000000e+02 0.00000000e+00 2.69666429e+01 0.00000000e+00
4.06843750e+00 3.00000000e+02 0.00000000e+00 2.71613695e+01 0.00000000e+00
4.38062500e+00 3.00000000e+02 0.00000000e+00 2.73416924e+01 0.00000000e+00
4.69281250e+00 3.00000000e+02 0.00000000e+00 2.75095964e+01 0.00000000e+00
5.00500000e+00 3.00000000e+02 0.00000000e+00 2.76666826e+01 0.00000000e+00
5.31718750e+00 3.00000000e+02 0.00000000e+00 2.78142609e+01 0.00000000e+00
5.62937500e+00 3.00000000e+02 0.00000000e+00 2.79534168e+01 0.00000000e+00
5.94156250e+00 3.00000000e+02 0.00000000e+00 2.80850600e+01 0.00000000e+00
6.25375000e+00 3.00000000e+02 0.00000000e+00 2.82099603e+01 0.00000000e+00
6.56593750e+00 3.00000000e+02 0.00000000e+00 2.83287750e+01 0.00000000e+00
6.87812500e+00 3.00000000e+02 0.00000000e+00 2.84420696e+01 0.00000000e+00
7.19031250e+00 3.00000000e+02 0.00000000e+00 2.85503344e+01 0.00000000e+00
7.50250000e+00 3.00000000e+02 0.00000000e+00 2.86539970e+01 0.00000000e+00
7.81468750e+00 3.00000000e+02 0.00000000e+00 2.87534328e+01 0.00000000e+00
8.12687500e+00 3.00000000e+02 0.00000000e+00 2.88489730e+01 0.00000000e+00
8.43906250e+00 3.00000000e+02 0.00000000e+00 2.89409114e+01 0.00000000e+00
8.75125000e+00 3.00000000e+02 0.00000000e+00 2.90295098e+01 0.00000000e+00
9.06343750e+00 3.00000000e+02 0.00000000e+00 2.91150023e+01 0.00000000e+00
9.37562500e+00 3.00000000e+02 0.00000000e+00 2.91975993e+01 0.00000000e+00
9.68781250e+00 3.00000000e+02 0.00000000e+00 2.92774905e+01 0.00000000e+00
1.00000000e+01 3.00000000e+02 0.00000000e+00 2.93548477e+01 0.00000000e+00
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
1.00000000e-02 1.25066641e+01 0.00000000e+00
3.22187500e-01 2.09762948e+01 0.00000000e+00
6.34375000e-01 2.26287499e+01 0.00000000e+00
9.46562500e-01 2.36048395e+01 0.00000000e+00
1.25875000e+00 2.43000527e+01 0.00000000e+00
1.57093750e+00 2.48404269e+01 0.00000000e+00
1.88312500e+00 2.52825246e+01 0.00000000e+00
2.19531250e+00 2.56566509e+01 0.00000000e+00
2.50750000e+00 2.59809480e+01 0.00000000e+00
2.81968750e+00 2.62671427e+01 0.00000000e+00
3.13187500e+00 2.65232545e+01 0.00000000e+00
3.44406250e+00 2.67550102e+01 0.00000000e+00
3.75625000e+00 2.69666429e+01 0.00000000e+00
4.06843750e+00 2.71613695e+01 0.00000000e+00
4.38062500e+00 2.73416924e+01 0.00000000e+00
4.69281250e+00 2.75095964e+01 0.00000000e+00
5.00500000e+00 2.76666826e+01 0.00000000e+00
5.31718750e+00 2.78142609e+01 0.00000000e+00
5.62937500e+00 2.79534168e+01 0.00000000e+00
5.94156250e+00 2.80850600e+01 0.00000000e+00
6.25375000e+00 2.82099603e+01 0.00000000e+00
6.56593750e+00 2.83287750e+01 0.00000000e+00
6.87812500e+00 2.84420696e+01 0.00000000e+00
7.19031250e+00 2.85503344e+01 0.00000000e+00
7.50250000e+00 2.86539970e+01 0.00000000e+00
7.81468750e+00 2.87534328e+01 0.00000000e+00
8.12687500e+00 2.88489730e+01 0.00000000e+00
8.43906250e+00 2.89409114e+01 0.00000000e+00
8.75125000e+00 2.90295098e+01 0.00000000e+00
9.06343750e+00 2.91150023e+01 0.00000000e+00
9.37562500e+00 2.91975993e+01 0.00000000e+00
9.68781250e+00 2.92774905e+01 0.00000000e+00
1.00000000e+01 2.93548477e+01 0.00000000e+00
Loading
Loading