[in2TopoHyd]: Module for computing hydraulic inital conditions - #90
[in2TopoHyd]: Module for computing hydraulic inital conditions#90JuLa96 wants to merge 8 commits into
Conversation
initial conditions in time-dependent release mode Add documentation Add test case
❌ 2 blocking issues (2 total)
@qltysh one-click actions:
|
|
Coverage Impact This PR will not change total coverage. 🚦 See full report on Qlty Cloud »🛟 Help
|
There was a problem hiding this comment.
this file ends with "Levee", below in the documentation it says, the file needs to end with "levee" (lower case).
When running the example, I get this error:
File not found or there are more than one levee files in POINTS-folder!
Ensure that there is exactly one point-shapefile including the ending *levee.shp!
|
|
||
| return crossSection | ||
|
|
||
| def assignRasterCoords(cellSize, releaseLine): |
There was a problem hiding this comment.
why don't you use avaframe.in3Utils.geoTrans.getCellsAlongLine() instead?
There was a problem hiding this comment.
First, I used this function but then I realized that it returns more than one raster center point for a distance station along the release line and this is contradicts the concept of a cross section.
Setting addBuffer = False did not help.
Add test files to default debris-data folder Create separate folders for input data in order to avoid access conflicts modify core functions of the module adapt documentation and config file format documentation
0290d64 to
7107d3b
Compare
| return ratingCurve | ||
|
|
||
|
|
||
| def computeSlope(dem, crossSection): |
There was a problem hiding this comment.
| def computeSlope(dem, crossSection): | |
| def computeSlopeAlongChannel(dem, crossSection): |
| # compute two additional cross sections on both handsides of the release line, respectively, | ||
| # in distance d of original cross section | ||
| d = 2 * np.sqrt(csz**2 + csz**2) | ||
| # move starting and ending points of release line in direction of n1 and n2 | ||
| xcoordStart1 = xcoordStart + d * nx1 | ||
| ycoordStart1 = ycoordStart + d * ny1 | ||
| xcoordEnd1 = xcoordEnd + d * nx1 | ||
| ycoordEnd1 = ycoordEnd + d * ny1 | ||
| xcoordStart2 = xcoordStart + d * nx2 | ||
| ycoordStart2 = ycoordStart + d * ny2 |
There was a problem hiding this comment.
is this (and below) the same as in computeSlope() ?
Then I suggest moving that to a separate function.
You could also add d as a parameter to the config file?
| return wetCells | ||
|
|
||
|
|
||
| def plotCrossSection(crossSection, outputDir): |
There was a problem hiding this comment.
Would it make sense to make another script for plotting functions?
|
|
||
| ax.plot(crossSection["s"], crossSection["elevation"]) | ||
| ax.scatter(crossSection["sLevee"], crossSection["elevLevee"], color="red", label="Levee points") | ||
| ax.set_xlabel("distance [m]"), ax.set_ylabel("elevation [m]") |
There was a problem hiding this comment.
| ax.set_xlabel("distance [m]"), ax.set_ylabel("elevation [m]") | |
| ax.set_xlabel("distance [m]") | |
| ax.set_ylabel("elevation [m]") |
| ax[0].legend() | ||
|
|
||
| ax[1].plot(thickness, flowArea) | ||
| ax[1].set_xlabel("flow thickness [m]"), ax[1].set_ylabel("flow area [m²]") |
There was a problem hiding this comment.
| ax[1].set_xlabel("flow thickness [m]"), ax[1].set_ylabel("flow area [m²]") | |
| ax[1].set_xlabel("flow thickness [m]") | |
| ax[1].set_ylabel("flow area [m²]") |
| default="", | ||
| help="the avalanche/ debris directory", | ||
| ) | ||
| print(parser) |
There was a problem hiding this comment.
| print(parser) |
| Inputs/ | ||
| DEM raster file | ||
| CFGs/ - expert configuration files (optional) | ||
| REL/ - release line | ||
| LEVEE/ - levee points |
There was a problem hiding this comment.
PLease update here the right directories.
|
@JuLa96 , @fso42 : I've added in There is a related issue (#91), we could/should consider, at least in a separate PR. |
|
@fso42: If no |
Ah ok, I was just wondering. I would leave it then as it is now |

in2TopoHydis an input module for deriving initial hydraulic conditions for thec1TIFcomputation modulefor a debris-flow hydrograph at a prescribed release line. The module combines the topography of the release area with
a time-dependent discharge hydrograph (Topo-Hydrograph) to calculate the corresponding flow thickness and flow velocity at the release line.
The hydraulic conditions are derived from the terrain cross section along the release line.
A rating curve is calculated from the cross-sectional geometry, relating flow thickness to flow area.
For each discharge value of the input hydrograph, the module determines the corresponding mean flow velocity and flow thickness.
The flow thickness is then distributed over the wetted cells of the release cross section.
The resulting initial conditions contain the flow thickness as well as the velocity components in x, y and z direction for every wet cell and every hydrograph timestep.
closes #85
Compiled doc : https://docs.debrisframe.org/en/jl_addtopohydmodule/