-
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
Non Uniform Roughness, Temperature and Heat Flux at Surface #1133
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. Some things missing: docs, unit tests, reg tests ;) I haven't run any tests myself and will do so once you are closer to the finish line.
for (int lev = 0; lev < nlevels; ++lev) { | ||
const auto& geom = repo.mesh().Geom(lev); | ||
const auto& domain = geom.Domain(); | ||
amrex::MFItInfo mfi_info{}; | ||
|
||
const amrex::Real dz = geom.CellSize()[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use idim
here instead of 2?
alphaT; | ||
amrex::Real ustarthetastar = 0.0; | ||
if (is_multi && is_surf_temp) { | ||
const amrex::Real bh = 9.4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these hardcoded numbers never expected to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I can move it to class variables if that's the better way of doing it.
for (int lev = 0; lev < nlevels; ++lev) { | ||
const auto& geom = repo.mesh().Geom(lev); | ||
const auto& domain = geom.Domain(); | ||
// Read dz | ||
const amrex::Real dz = geom.CellSize()[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use idim here as well? and remove comment
const bool is_surf_temp = repo.field_exists("surf_temp"); | ||
const auto* m_surf_temp = | ||
is_surf_temp ? &repo.get_field("surf_temp") : nullptr; | ||
const bool is_multi = repo.field_exists("lowerz0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer a better name than is_multi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing came to mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has_variable_roughness
or has_variable_surface
?
@@ -292,12 +341,17 @@ void ABLTempWallFunc::wall_model( | |||
const auto& density = repo.get_field("density", rho_state); | |||
const auto& alpha = repo.get_field("temperature_mueff"); | |||
const int nlevels = repo.num_active_levels(); | |||
|
|||
const bool is_surf_temp = repo.field_exists("surf_temp"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe has_surf_temp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and maybe for consistency: has_variable_surf_temp
?
auto& surf_temp = m_surf_temp(level); | ||
auto& surf_temp_lower = m_surf_temp_lower(level); | ||
auto& surf_temp_upper = m_surf_temp_upper(level); | ||
// Copy Temperature to gpu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
const unsigned mesh_size = m_xloc.size(); | ||
const int index = | ||
std::max(0, int(m_current_time / m_separation) - 1); | ||
amrex::Print() << "Checking issues:" << m_Tloc.size() << " " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print statement
Tloc_ptr[(index + 1) * (mesh_size - 1) + ii]; | ||
} | ||
} | ||
level_surf_temp(i, j, k, 0) = locT1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be better to store these 3 numbers into a 3 component field instead of 3 different fields? It would remove a whole bunch of LOCs
} | ||
return; | ||
} | ||
amrex::Print() << "Changing:" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print statement
std::max(0, int(m_current_time / m_separation) - 1); | ||
amrex::ParallelFor( | ||
vbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { | ||
// compute the source term |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
clang Formatting
Adjusting for new clang
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Summary
This draft PR proposes a framework to include non-uniform roughness length, temperature and heat flux at the lower surface for handling spatially varying roughness length in large wind farms, spatial-temporal varying one-way roughness-based wave coupling, spatial-temporal varying temperature and sensible heat flux.
MOST is replaced with an explicit stratification based parametrization. Currently, the method does not work work terrains and will be updated in the future.
The data is read in an ascii format to avoid the netCDF dependency. Will create a separate preprocessing tool to convert netCDF data into the ascii format.
ToDo:
Caution: It is assumed that the time-period of input dataset is greater than CFD run-time. This avoids the need for special one-sided interpolation at the end of the dataset.
Please check the type of change introduced:
Checklist
The following is included:
This PR was tested by running:
Additional background
Issue Number: