-
Notifications
You must be signed in to change notification settings - Fork 43
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
Updates for terrain / grid stretching #1361
Updates for terrain / grid stretching #1361
Conversation
…oblem domain It may make sense to update the problem domain if possible
init_terrain_grid() used to use ztop = geom.ProbHiArray()[2], which comes from the input file. For a stretched grid or user-specified "terrain_z_levels", there could have been a mismatch between ztop and the actual requested top of the domain.
…defintions in most prob.cpps
Note: The regression tests DynamicRefinement, IsentropicVortex, and ScalarAdvDiff all explicitly initialized z_phys_nd to be k*dz and then called FillBoundary(). However, if use_terrain==true (and init_custom_terrain() was called), then the default behavior should be equivalent: init_zlevels() called without grid stretching, then init_terrain_grid() called to populate z_phys_nd and then FillBoundary()
Draft for now, need to verify that the new default |
…grid_stretching_updates
Note: regtests fail for DensityCurrent_detJ2 and DensityCurrent_detJ2_nosub (both with terrain, default 3rd order) fail starting from ed6ae8c, i.e., after the bug fix. |
Notes: - Nominal z levels (e.g., from input terrain_z_levels) that are used for terrain smoothing should range from 0 (on the surface) to ztop - The same levels are used to calculate the base state by integrating the hydrostatic equation through a column of air - In the case of terrain or grid stretching, the base state profiles may have non-uniform vertical grid spacing - These 1-D profiles are then interpolated to the 3-D terrain grid; the state and hse fab arrays are interpolated at z_phys_cc whereas the velocity fab arrays are interpolated at face centers calculated from z_phys_nd
302d57e enables ideal input soundings to be used with terrain, resulting in comparable pressure and density base states with and without grid stretching. The commit message describes the implementation. Some additional comments:
|
This PR looks bigger than it actually is. I consolidated all the duplicated terrain initialization code (that set the surface z_phys_nd = 0) and cleaned up most of the prob source files. @asalmgren a heads up that the gold data were updated! |
prob_hi[2]
andzlevels_stag[nz]
-- the latter is the stretched grid levels that are used to populatez_phys_nd
and may differ from the input geometry if "grid_stretching_ratio" or "terrain_z_levels" is specifiedzlevels_stag[nz]
ininit_terrain_grid()
instead ofProbHiArray[2]
-- only has an effect if surface elevationz_arr(ii,jj,k0) != 0