-
Notifications
You must be signed in to change notification settings - Fork 21
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 sediment model #463
Conversation
* Remove vertical concept `FLEXTopo` * Remove vertical concept `HBV` * Update download test data for build * Cleanup docs Removed `HBV` and `FLEXTopo` concepts. * Removed code related to `FLEXTopo` Use of extra dim `classes`. * Remove and change river and land `inwater` functions As a result of removing `HBV` and `FLEXTopo` concepts. * Update changelog * Fix typo in docs Co-authored-by: JoostBuitink <[email protected]> --------- Co-authored-by: JoostBuitink <[email protected]>
* Cleanup metadata structs Remove `exchange`, `grid_type` and `grid_location` from metadata structs. `grid_type` is not required, it is already implemented as part of BMI. `exhange` and `grid_location` are now implemented without the use of the FieldMetadata package. * Update changelog * Fix `exchange` function for `ShallowWaterLand` * Add tests * Move `exchange` and `grid_location` functions To file bmi.jl as these functions are quite specific to BMI functionality. * Add `v1` branch to CI
* Add configuration file for Julia Formatter * Add format on save in vscode settings file * Remove .vscode from gitignore * Format all Julia files * Sync wflow's style guide with ribasim's style guide * Update formatting * Update .vscode/settings.json * Remove outdated comments * Add workaround for VS Code bugs
* Stop using local JULIAUP_DEPOT_PATH * Avoid error when override is already set Co-authored-by: Martijn Visser <[email protected]>
* Remove vertical concept `FLEXTopo` * Remove vertical concept `HBV` * Update download test data for build * Cleanup docs Removed `HBV` and `FLEXTopo` concepts. * Removed code related to `FLEXTopo` Use of extra dim `classes`. * Remove and change river and land `inwater` functions As a result of removing `HBV` and `FLEXTopo` concepts. * Update changelog * Fix typo in docs Co-authored-by: JoostBuitink <[email protected]> --------- Co-authored-by: JoostBuitink <[email protected]>
* Cleanup metadata structs Remove `exchange`, `grid_type` and `grid_location` from metadata structs. `grid_type` is not required, it is already implemented as part of BMI. `exhange` and `grid_location` are now implemented without the use of the FieldMetadata package. * Update changelog * Fix `exchange` function for `ShallowWaterLand` * Add tests * Move `exchange` and `grid_location` functions To file bmi.jl as these functions are quite specific to BMI functionality. * Add `v1` branch to CI
* Add configuration file for Julia Formatter * Add format on save in vscode settings file * Remove .vscode from gitignore * Format all Julia files * Sync wflow's style guide with ribasim's style guide * Update formatting * Update .vscode/settings.json * Remove outdated comments * Add workaround for VS Code bugs
…es/Wflow.jl into refactor/sediment_concept
Hi @verseve Anyhow, I think it is ready for review. For the leftover TODOS in the main message, I tried some of them myself but did not manage easily so it would be really great if you could have a look at these, this would be more efficient and I don't think for you it's too much:
The two others in lateral.land and lateral.river are more questions or up for discussions with your review. Thanks in advance! |
Add `@grid_loc` and remove units of non-vector fields.
For structs `SoilLoss`, `LandSediment` and `RiverSediment`.
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.
Nice work!
I added a couple of comments. Besides these comments: the code coverage went down > 2%, would be good to check what is causing this and to get this back to ~90%.
I think I addressed all of your comments @vers-w ! A few are still open and if you are happy with my solutions then feel free to close them. |
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.
LGTM!
Issue addressed
Fixes #382
Explanation
For now this is a tentative to restructure the vertical part (ie soil erosion) of the sediment model.
General
The main features of the restructuration are:
SoilLoss struct
and a new sediment_flux.jl forOverlandFlowSediment
andRiverSediment
RiverGeometry
andLandGeometry
struct that contains cell properties such as width, slope, length, area etc to avoid defining and passing these parameters that can be common to many structs.TODO left:
Vertical: SoilLoss
The main features of the restructuration are:
AbstractRainfallErosionModel
(with three modelsNoRainfallErosionModel
,RainfallErosionEurosemModel
,RainfallErosionAnswersModel
),AbstractOverlandFlowModel
(with two modelsNoOverlandFlowErosionModel
,OverlandFlowAnswersModel
) andSoilErosionModel
which is in charge of summing erosion from the different sources (for now rainfall and overland flow but in the future we could add wind, mass wasting from landslide etc.) and differentiating for the different particle classes. Each struct is defined in its own script but the equations are in a common file (erosion_process.jl)SoilLoss
struct, timestep is passed directly to the update functions.TODO left:
Lateral.land: OverlandFlowSediment
The main features of the restructuration are:
TransportCapacityGoversModel
,TransportCapacityYalinModel
,TransportCapacityYalinDifferentiationModel
); a sediment_flux model for the overland flow transport with two equations for with/without particle differentiation and a to_river to summarize the sediment reaching the river (with/without particle differentiation).TODO left:
Lateral.river: River Sediment
I thought I would be able to split more but because we need the upstream to compute the downstream, I ended up with less structures than planned and still quite a large structure for the mass balances (that still include then erosion and deposition). In the end this means the construction looks similar to lateral.land so this may not be for the worst. I also could not easily separate the reservoirs into an extra struct so I left it as is in master.
The main features of the restructuration are:
TransportCapacityBagnoldModel
,TransportCapacityEngelundModel
,TransportCapacityYangModel
,TransportCapacityMolinasModel
,TransportCapacityKodatieModel
); a potential_river_erosion model to get the maximum allowed direct bed and bank erosion (for example in the future to use delwaq concept this could be turned into none allowed); a sediment_flux model for the river flow transport (mass balance from upstream to downstream including deposition and erosion); and a concentrations to convert loads to concentrations and get the suspended vs bed part.TODO left:
Particle
structTesting of this PR
Checklist
v1
Additional Notes (optional)
Add any additional notes or information that may be helpful.