-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix Spherical Grid capability (#78) #79
Conversation
* Add spherical fix to main kurganov * add cm and fm functions for spherical correction * replaced dx with delta where necessary delta is the cell size in m. whereas dx is for spherical grid units. for metric type grids dx == delta * Fix Spherical calculations * Update Makefile * Create codemap.md * add synonym for spherical * debug Nesting SPHerical * Fix Spherical adaptive * Fix error_new CalcFM funct * Missed a fix for new CalcFM * Try fix CalcFM * Arggggh * test fix fmvp * testfix2 * Reverting non-working fix * revert the non-working CPU fix * DEBUG spherical correction
Check forcing in spherical mode
|
Does the Spherical code and the projected code produce similar results?BG_Flood can run on a spherical grid or a crtesian (project) grid. One of the sanity check for validating the code is to run a similar simulation both in projected coordinate and in spherical coordinates Comparing apples and orangesbecause the calculations are somewhat different on a sphere then on a projected grid we can't really assume that both model produce exactly identical results. However we can check if thay are sensibly similar. Samoa Tsunami testThe first test is using a constant resolution: 100 m in cartesian and 0.001 degree in spherical wich is 10ish % larger. As you can see theyr are comparable resolution but not exactly the same.
Cartesian domainUTM modelSpherical modelAdaptive domainHere you can see that the small differences in the grid layout lead to different adaptation even though the original data is different UTM modelSpherical modelAlso working for Buttinger reconstructionRuntime considerationUsing the example above we can compare whether there is an advantage of using the spherical vs the projected coordinate. All the test are done on my NVidia Quadro P620.
As you can see the computational cost of using spherical grid is about 8% for a cartesian grid, which isn't much compared with the adaptivity cost (~20%). But the combined cost (adaptivity+spherical) is much more with 52% slower per block. That is because there are additional steps/calculation for adaptive run in spherical mode. SummaryCorrections for spherical grids does what is expected for tsunami and essenytially produce the same results. However, when running small domain in spherical grid you might end up spending more time in computation (>25%) then if you project your DEM in projected coordinate. In many case, the spherical solution is the only way to simulate the hazard (e.g. trans-pacific tsunami). in this case, make sure you think about your adaptation strategy. if you can reduce the number of nodes to 40% less than a cartesian grid your model will run faster! |
Not compiled yet
* Add dy to forcing and interpolation * swich on the change
Verification of Atm Press forcingRunning a UTM and spherical model with similar forcing (projected to UTM to be as similar as possible) show that both models are essentially similar. Minor difference are due to refinement difference and possibly how we treat the roughness in spherical mode (?) Spherical:UTM:Verification of Wind forcingAs above they are both essentially similar: Spherical:UTM: |
River checkSpherical implementation should also work . We can compare the volume discharge from a river in a UTM grid vs from a Spherical grid. The table show that the simulated injected water is very similar to the theoretical volume. The errors here are likely due to the steep slope the water is injected to which causes mass to be imbalanced (see pic below).
|
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 a very good and useful development. It is well documented and tested.
As discussed, a continuous integration test might be added for the spherical grid and perhaps for the hotstart too (with pressure and without?)... but it can also go in the "completing the tests" part for a later PR!
Fix Spherical grid correction
Spherical grid capability has been shaky!. Added to a previous branch (#78) still had a serious bug. This may have been solved in the development branch.
This branch tris to bring it all together and resolve any remaining bugs.
Basework
Test
Demo