-
Notifications
You must be signed in to change notification settings - Fork 44
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
Refactor ConstantAlpha to allow running with turbulence model #1391
Conversation
- ComputeStress*() now have cell_data as an argument - cell_data is set if l_use_constAlpha, otherwise a nullptr is passed - mu_eff is now converted to alpha prior to being passed to ComputeStress*()
For generality, rho scaling is applied when tau is calculated. This enables ConstantAlpha to be used with a turbulence model.
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.
Fairly certain the cell_data must be averaged to the strain locations (as is done in DiffusionSrcForState_N/T.cpp. Once that is completed, I am good with this PR.
}, | ||
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { | ||
tau23(i,j,k) *= -cell_data(i, j, k, Rho_comp) * mu_eff; | ||
}); |
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.
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, you're right. I have a fix coming.
@AMLattanzi, 23d55a5 fixes the segfault that showed up in the CI and 1834373 does the averaging that's needed. |
Actually hold on, I only updated the terrain solver path. |
Ok, @AMLattanzi, this latest commit makes the rest of the changes. I've verified that the rho averaging for the ConstantAlpha path matches the original mu_turb averaging. |
Otherwise ref solution crashes on step 938 (t=234.25). Orig fixed dt ratio was 4; allowing a variable dt ratio results in a constant dt ratio of 6.
Previous approach:
New approach
Tests based on DensityCurrent
les_type=none
:dynamicViscosity=75
,rho0_trans=1
(default) vsdynamicViscosity=150
,rho0_trans=2
-- verified results were identicalles_type=Smagorinsky
:dynamicViscosity=75
,rho0_trans=1
(default) vsdynamicViscosity=150
,rho0_trans=2
-- verified results were identical