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

Forest Canopy Model #1324

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Forest Canopy Model #1324

wants to merge 8 commits into from

Conversation

hgopalan
Copy link
Contributor

@hgopalan hgopalan commented Nov 3, 2024

This PR provides a forest canopy model in AMR-Wind. Two kinds of forests are supported: (i) homogeneous forest and (ii) heterogeneous forest using an empirical model for leaf area density.

Forest overlap is allowed and is not checked. It is expected that the users provide accurate inputs and currently no checking is included. The model requires following inputs from the user: (i) tree type (ii) tree center x (iii) tree center y (iv) tree height (v) tree girth preferably at the widest point (vi) tree drag coefficient (vii) tree leaf area index (viii) location of maximum leaf area density for heterogeneous forests.

The model will work with any LES model as the drag forcing due to the turbulence is required only in momentum equation. It is also possible to include a turbulence forcing term in one equation kegs model.

The model will be extended to the one-equation RANS model in a future PR by including the turbulence contribution.

Please check the type of change introduced:

  • Bugfix
  • [X ] Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

The following is included:

  • new unit-test(s)
  • [X ] new regression test(s)
  • documentation for new capability

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • [X ] on CPU

Issue Number: #1322

@hgopalan hgopalan added the enhancement New feature or request label Nov 3, 2024
@hgopalan hgopalan linked an issue Nov 3, 2024 that may be closed by this pull request
@hgopalan hgopalan marked this pull request as ready for review November 3, 2024 21:24
@hgopalan
Copy link
Contributor Author

hgopalan commented Nov 4, 2024

Sample result. Top is a heterogeneous tree model while other three are homogeneous.
forest_drag


namespace amr_wind::pde::icns {

/** Adds the forcing term to include the presence of immersed boundary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of date comment

amr-wind/physics/ForestDrag.H Outdated Show resolved Hide resolved
amrex::Vector<amrex::Real> m_x_forest;
amrex::Vector<amrex::Real> m_y_forest;
amrex::Vector<amrex::Real> m_ht_forest;
amrex::Vector<amrex::Real> m_dia_forest;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if dia is diameter, spell it out?

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_ht_forest;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ht -> height

amrex::Vector<amrex::Real> m_dia_forest;
amrex::Vector<amrex::Real> m_cd_forest;
amrex::Vector<amrex::Real> m_lai_forest;
amrex::Vector<amrex::Real> m_lm_forest;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spell out lm

amr-wind/physics/ForestDrag.cpp Outdated Show resolved Hide resolved
levelDrag(i, j, k) = 0.0;
for (unsigned ii = 0; ii < forestSize; ++ii) {
const amrex::Real radius = std::sqrt(
std::pow(x - x_forest_ptr[ii], 2) +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pow 2 should be written out as x * x for performance.

const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];
const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];
levelDrag(i, j, k) = 0.0;
for (unsigned ii = 0; ii < forestSize; ++ii) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this for loop combined with the while loop below. Let's chat and see if we can come up with something better.

@hgopalan hgopalan changed the base branch from forest_drag to main November 4, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forest Canopy Model
3 participants