-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide alternate solution path for imposing MOST (#1472)
* Add ERF_EXPLICIT_MOST_STRESS flag enable in CMake with ERF_ENABLE_EXPLICIT_MOST_STRESS * Add preprocessor directives for ERF_EXPLICIT_MOST_STRESS * Pass in second cell dz for terrain case * Set MOST ghost cell by extrapolating from first cell This is how the surface BC is set in SOWFA and is a simplification of Moeng 1984, in which the first-cell velocity gradient -- used to update the tke production term -- is determined by interpolating between the resolved velocity gradient at the first zface and the modeled velocity gradient at a test height below the first cell center. We neglect the latter contribution for now. * Remove dependence on eta * Return shear stress from MOST * Pass Tau13, Tau23, and SFS_hfx3 to the shear stress update * Oops * Set surface stresses based on MOST * Fix bug and make shear stress models consistent - custom_flux.compute_t_flux was incorrectly setting `moflux` - off-setting sign errors on `moflux` for moeng_flux; convention is for a +ve heat flux to correspond to tstar and dtheta/dz < 0 - fix sign on value set by donelan_flux.compute_t_flux - all stressx and stressy are multiplied by rho * Note if solver was compiled with ERF_EXPLICIT_MOST_STRESS * Set surface heat flux based on MOST * Super minor cleanup * Pass use_most flag to DiffusionSrcForState * Only overwrite surface flux if compiled with ERF_EXPLICIT_MOST_STRESS * Fix problem with valid box * Print out custom most info * Update SmnSmn calculation to use valid surface strains if available * Reenable wall treatment for ComputeSmnSmn NOTE: the current implementation assumes that dw/dx at the first zface above the surface is 0, which isn't strictly correct. But the expectation is that du/dz >> dw/dx in general * Surface temperature BC based on extrapolating dtheta/dz rather than d(rhotheta)/dz * Use first-order one-sided calc to be consistent with BC * Cleanup * Don't calculate strain at k=0 prior to first RK stage (unneeded) * Set velocity on boundary, not momenta * Fingers crossed When calculating the diffusion source, calculate the strain rate everywhere before resizing the box for the stress calc. This provides the correct strain rate on the surface, without making any implicit assumption about dw/dx, dw/dy. * Add alternative ComputeSmnSmn formulation This differs from the original formulation, which matches what is in the arw_v4 manual. Originally, the strain rates are averaged to cell centered and then squared. The alternative (not compiled by default) is to first calculate the square of the strain-rate tensor components and then average them. * Add comments about hfx * Store surface heat flux in ghost cell The kinematic heat flux SFS_hfx3_lev now has dual uses. - The surface value (at k=-1) is used when calculating the diffusive z-flux at k=0 (zflux is staggered in z). This is the modeled flux that comes from MOSTStress when applying BCs. - When using Deardorff, the interior values are the subgrid heat fluxes that go into the buoyancy term. These are based on resolved temperature gradients and modeled eddy diffusivity. --------- Co-authored-by: Ann Almgren <[email protected]> Co-authored-by: Aaron M. Lattanzi <[email protected]>
- Loading branch information
1 parent
78370fd
commit f97cda0
Showing
17 changed files
with
703 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.