-
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
wall model refactor #335
wall model refactor #335
Conversation
michaeljbrazell
commented
Feb 5, 2021
•
edited
Loading
edited
- added more wall models
- I'm not fully confident in any of the non Moeng heat flux wall model implementations
- @jrood-nrel this will cause a small diff for abl_stable due to order of operations: taux * den * utau2 vs. taux * utau2 * den
@@ -266,12 +267,19 @@ void ABLWallFunction::computeusingheatflux() | |||
|
|||
ABLVelWallFunc::ABLVelWallFunc(Field&, const ABLWallFunction& wall_func) | |||
: m_wall_func(wall_func) | |||
{} | |||
{ | |||
amrex::ParmParse pp("ShearStress"); |
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.
I would prefer not adding another namespace here. Instead use ABL.wall_shear_stress_type = moeng
?
@@ -349,11 +379,17 @@ void ABLVelWallFunc::operator()(Field& velocity, const FieldState rho_state) | |||
|
|||
ABLTempWallFunc::ABLTempWallFunc(Field&, const ABLWallFunction& wall_fuc) | |||
: m_wall_func(wall_fuc) | |||
{} | |||
{ | |||
amrex::ParmParse pp("HeatFlux"); |
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.
Can reuse ABL.wall_shear_stress_type
here? I don't think that we have a use-case where we would do things differently for vel/temperature, is there? So one input parameter would suffice?
} | ||
void ABLTempWallFunc::operator()(Field& temperature, const FieldState rho_state) |
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.
clang-format hopefully complained here
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.
it missed it!
} else { | ||
amrex::Abort("Shear Stress temperature wall model input mistake"); | ||
} |
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.
We should check this during input parsing time and remove this else.
amr-wind/wind_energy/ShearStress.H
Outdated
// | ||
// ShearStress.H | ||
// amr-wind | ||
// | ||
// | ||
|
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.
// | |
// ShearStress.H | |
// amr-wind | |
// | |
// |
amr-wind/wind_energy/ShearStress.H
Outdated
term1 = mo.utau * mo.kappa / mo.phi_h(); | ||
} | ||
|
||
AMREX_GPU_HOST_DEVICE amrex::Real |
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.
We should also add AMREX_DEVICE_FORCE_INLINE
amr-wind/wind_energy/ShearStress.H
Outdated
|
||
struct ShearStressConstant | ||
{ | ||
ShearStressConstant(amr_wind::MOData mo) |
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.
ShearStressConstant(amr_wind::MOData mo) | |
ShearStressConstant(const amr_wind::MOData& mo) |
avoid a copy here.
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.
Also should declare these constructors explicit
amr-wind/wind_energy/ShearStress.H
Outdated
, theta_mean(mo.theta_mean) | ||
, theta_surface(mo.surf_temp) | ||
{ | ||
term1 = mo.utau * mo.kappa / mo.phi_h(); |
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.
This can be initialized in the constructor initialization list also.
amrex::Real term1; | ||
}; | ||
|
||
struct ShearStressMoeng |
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.
May be add doxygen docs and assign them to ABL group?
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.
This is fantastic!