-
Notifications
You must be signed in to change notification settings - Fork 82
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
using mac vel within wall function. #874
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,6 +160,8 @@ | |
|
||
constexpr int idim = 2; | ||
const auto& repo = velocity.repo(); | ||
auto& umac = repo.get_field("u_mac"); | ||
auto& vmac = repo.get_field("v_mac"); | ||
const auto& density = repo.get_field("density", rho_state); | ||
const auto& viscosity = repo.get_field("velocity_mueff"); | ||
const int nlevels = repo.num_active_levels(); | ||
|
@@ -178,6 +180,8 @@ | |
|
||
const auto& rho_lev = density(lev); | ||
auto& vold_lev = velocity.state(FieldState::Old)(lev); | ||
auto& umac_lev = umac(lev); | ||
auto& vmac_lev = vmac(lev); | ||
auto& vel_lev = velocity(lev); | ||
const auto& eta_lev = viscosity(lev); | ||
|
||
|
@@ -191,6 +195,8 @@ | |
const auto& bx = mfi.validbox(); | ||
auto varr = vel_lev.array(mfi); | ||
auto vold_arr = vold_lev.array(mfi); | ||
auto umac_arr = umac_lev.array(mfi); | ||
auto vmac_arr = vmac_lev.array(mfi); | ||
auto den = rho_lev.array(mfi); | ||
auto eta = eta_lev.array(mfi); | ||
|
||
|
@@ -200,8 +206,12 @@ | |
amrex::bdryLo(bx, idim), | ||
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { | ||
const amrex::Real mu = eta(i, j, k); | ||
const amrex::Real uu = vold_arr(i, j, k, 0); | ||
const amrex::Real vv = vold_arr(i, j, k, 1); | ||
// const amrex::Real uu = vold_arr(i, j, k, 0); | ||
// const amrex::Real vv = vold_arr(i, j, k, 1); | ||
const amrex::Real uu = | ||
0.5 * (umac_arr(i, j, k) + umac_arr(i + 1, j, k)); | ||
const amrex::Real vv = | ||
0.5 * (vmac_arr(i, j, k) + umac_arr(i, j + 1, k)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make sure that you don't mix vmac_arr with umac_arr ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch! |
||
const amrex::Real wspd = std::sqrt(uu * uu + vv * vv); | ||
|
||
// Dirichlet BC | ||
|
@@ -299,6 +309,8 @@ | |
|
||
BL_PROFILE("amr-wind::ABLTempWallFunc"); | ||
auto& velocity = repo.get_field("velocity"); | ||
auto& umac = repo.get_field("u_mac"); | ||
auto& vmac = repo.get_field("v_mac"); | ||
const auto& density = repo.get_field("density", rho_state); | ||
const auto& alpha = repo.get_field("temperature_mueff"); | ||
const int nlevels = repo.num_active_levels(); | ||
|
@@ -310,6 +322,8 @@ | |
|
||
const auto& rho_lev = density(lev); | ||
auto& vold_lev = velocity.state(FieldState::Old)(lev); | ||
auto& umac_lev = umac(lev); | ||
auto& vmac_lev = vmac(lev); | ||
auto& told_lev = temperature.state(FieldState::Old)(lev); | ||
auto& theta = temperature(lev); | ||
const auto& eta_lev = alpha(lev); | ||
|
@@ -323,6 +337,8 @@ | |
for (amrex::MFIter mfi(theta, mfi_info); mfi.isValid(); ++mfi) { | ||
const auto& bx = mfi.validbox(); | ||
auto vold_arr = vold_lev.array(mfi); | ||
auto umac_arr = umac_lev.array(mfi); | ||
auto vmac_arr = vmac_lev.array(mfi); | ||
auto told_arr = told_lev.array(mfi); | ||
auto tarr = theta.array(mfi); | ||
auto den = rho_lev.array(mfi); | ||
|
@@ -334,8 +350,12 @@ | |
amrex::bdryLo(bx, idim), | ||
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { | ||
const amrex::Real alphaT = eta(i, j, k); | ||
const amrex::Real uu = vold_arr(i, j, k, 0); | ||
const amrex::Real vv = vold_arr(i, j, k, 1); | ||
// const amrex::Real uu = vold_arr(i, j, k, 0); | ||
// const amrex::Real vv = vold_arr(i, j, k, 1); | ||
Comment on lines
+353
to
+354
Check notice Code scanning / CodeQL Commented-out code Note
This comment appears to contain commented-out code.
|
||
const amrex::Real uu = | ||
0.5 * (umac_arr(i, j, k) + umac_arr(i + 1, j, k)); | ||
const amrex::Real vv = | ||
0.5 * (vmac_arr(i, j, k) + umac_arr(i, j + 1, k)); | ||
const amrex::Real wspd = std::sqrt(uu * uu + vv * vv); | ||
const amrex::Real theta2 = told_arr(i, j, k); | ||
tarr(i, j, k - 1) = den(i, j, k) * | ||
|
Check notice
Code scanning / CodeQL
Commented-out code Note