-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* compiles but allocation issue, needs docs, needs testing. * This ran. * Test Case Works * Added documentation * Fix when we don't use canopy model. --------- Co-authored-by: AMLattanzi <[email protected]> Co-authored-by: Aaron M. Lattanzi <[email protected]>
- Loading branch information
1 parent
d63c6ae
commit dade055
Showing
17 changed files
with
386 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Forest Model | ||
-------------- | ||
|
||
The forest model provides an option to include the drag from forested regions to be included in the momentum equation. The | ||
drag force is calculated as follows: | ||
|
||
.. math:: | ||
F_i= - C_d L(x,y,z) U_i | U_i | | ||
Here :math:`C_d` is the coefficient of drag for the forested region and :math:`L(x,y,z)` is the leaf area density (LAD) for the | ||
forested region. A three-dimensional model for the LAD is usually unavailable and is also cumbersome to use if there are thousands | ||
of trees. Two different models are available as an alternative: | ||
|
||
.. math:: | ||
L=\frac{LAI}{h} | ||
.. math:: | ||
L(z)=L_m \left(\frac{h - z_m}{h - z}\right)^n exp\left[n \left(1 -\frac{h - z_m}{h - z}\right )\right] | ||
Here :math:`LAI` is the leaf area index and is available from measurements, :math:`h` is the height of the tree, :math:`z_m` is the location | ||
of the maximum LAD, :math:`L_m` is the maximum value of LAD at :math:`z_m` and :math:`n` is a model constant with values 6 (below :math:`z_m`) and 0.5 | ||
(above :math:`z_m`), respectively. :math:`L_m` is computed by integrating the following equation (see `Lalic and Mihailovic (2004) | ||
<https://doi.org/10.1175/1520-0450(2004)043<0641:AERDLD>2.0.CO;2>`_): | ||
|
||
.. math:: | ||
LAI = \int_{0}^{h} L(z) dz | ||
The simplified model with uniform LAD is recommended for forested regions with no knowledge of the individual trees. LAI values can be used from | ||
climate model look-up tables for different regions around the world if no local remote sensing data is available. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1 1024 512 45 200 0.2 6 0.8 | ||
1 1024 1024 35 200 0.2 6 0.8 | ||
1 1024 1224 75 200 0.2 6 0.8 | ||
2 1024 1524 120 200 0.2 10 0.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# ------------------ INPUTS TO MAIN PROGRAM ------------------- | ||
max_step = 50 | ||
|
||
amrex.fpe_trap_invalid = 1 | ||
|
||
fabarray.mfiter_tile_size = 1024 1024 1024 | ||
|
||
# PROBLEM SIZE & GEOMETRY | ||
geometry.prob_extent = 2048 2048 1024 | ||
amr.n_cell = 64 64 32 | ||
|
||
geometry.is_periodic = 1 1 0 | ||
|
||
zlo.type = "SlipWall" | ||
zhi.type = "SlipWall" | ||
|
||
# TIME STEP CONTROL | ||
erf.fixed_dt = 2.0 # fixed time step depending on grid resolution | ||
erf.cfl = 0.5 | ||
|
||
# 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 = 50 # number of timesteps between checkpoints | ||
|
||
# PLOTFILES | ||
erf.plot_file_1 = plt # prefix of plotfile name | ||
erf.plot_int_1 = 50 # number of timesteps between plotfiles | ||
erf.plot_vars_1 = density rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta | ||
|
||
# SOLVER CHOICE | ||
erf.alpha_T = 0.0 | ||
erf.alpha_C = 1.0 | ||
erf.use_gravity = false | ||
|
||
erf.molec_diff_type = "None" | ||
erf.les_type = "Smagorinsky" | ||
erf.Cs = 0.1 | ||
|
||
erf.init_type = "uniform" | ||
|
||
#erf.forest_file = erf_forest_def | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef ERF_FORESTDRAG_H_ | ||
#define ERF_FORESTDRAG_H_ | ||
|
||
#include <memory> | ||
#include <AMReX_MultiFab.H> | ||
|
||
/* | ||
ForestDrag flow physics adapted from: | ||
Lalic & Mihailovic (2004) | ||
https://doi.org/10.1175/1520-0450(2004)043<0641:AERDLD>2.0.CO;2 | ||
*/ | ||
class ForestDrag | ||
{ | ||
public: | ||
|
||
explicit ForestDrag (std::string forestfile); | ||
|
||
~ForestDrag () = default; | ||
|
||
void | ||
define_drag_field (const amrex::BoxArray& ba, | ||
const amrex::DistributionMapping& dm, | ||
amrex::Geometry& geom, | ||
amrex::MultiFab* z_phys_nd); | ||
|
||
amrex::MultiFab* | ||
get_drag_field () { return m_forest_drag.get(); } | ||
|
||
private: | ||
amrex::Vector<amrex::Real> m_type_forest; | ||
amrex::Vector<amrex::Real> m_x_forest; | ||
amrex::Vector<amrex::Real> m_y_forest; | ||
amrex::Vector<amrex::Real> m_height_forest; | ||
amrex::Vector<amrex::Real> m_diameter_forest; | ||
amrex::Vector<amrex::Real> m_cd_forest; | ||
amrex::Vector<amrex::Real> m_lai_forest; | ||
amrex::Vector<amrex::Real> m_laimax_forest; | ||
std::unique_ptr<amrex::MultiFab> m_forest_drag; | ||
}; | ||
#endif |
Oops, something went wrong.