Skip to content

Terrain Drag Marking Update #1668

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

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

Conversation

hgopalan
Copy link
Contributor

Summary

The existing approach for marking terrain is rudimentary. We only check the terrain height. This works well for neutral boundary layer as the terrain is forced to zero wind speed. However, for non-neutral condition at very stable or unstable states, soil temperature leaks into the domain providing a unrealistic stratification effect. This PR updates the terrain marking algorithm to account for the terrain effects in the horizontal direction. The horizontal wall function is computed using MOST.

Please check the type of change introduced:

  • [ X] 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)
  • new regression test(s)
  • [X ] documentation for new capability

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • on CPU

Additional background

Before

Original_Drag

After

modified_drag

@hgopalan hgopalan requested review from mchurchf and marchdf June 23, 2025 11:41
@hgopalan hgopalan requested a review from moprak-nrel June 23, 2025 12:15
@@ -8,7 +8,8 @@
#include "amr-wind/utilities/IOManager.H"
#include "amr-wind/utilities/io_utils.H"
#include "amr-wind/utilities/linear_interpolation.H"

#include "amr-wind/fvm/gradient.H"
#include "amr-wind/utilities/constants.H"
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 think these includes are necessary?

@@ -183,6 +199,36 @@ void KransAxell::operator()(
terrainforcing =
(ustar * ustar / (Cmu * Cmu) + rans_b - tke_arr(i, j, k)) /
dt;
if (drag_arr(i, j, k) > 1) {
//! West
ustar = compute_target_ustar(
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do a for loop? if you cast as iv and then loop on dir and to iv +/- thedimensionvector(dir) it should do this automatically.

} else {
levelDrag[nbx](i, j, k, 0) = 0;
}
const int blankxp = std::abs(
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do a for loop? see comment above

amrex::Real bc_forcing_t = -(tTarget - theta) / dt;
//! West
if (drag(i, j, k) > 1) {
amrex::Real tmp_temp_target = compute_target_theta(
Copy link
Contributor

Choose a reason for hiding this comment

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

Another for loop opportunity

compute_target_wind(
vel(i - 1, j, k, 2), vel(i - 1, j, k, 1), dx[0], z0,
kappa);
bc_forcing_z +=
Copy link
Contributor

Choose a reason for hiding this comment

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

for loop opportunity (see comments below)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants