Documentation
Generates a CrossSectionInputFile for FM2PROF from an existing 1D network.
A CrossSectionInputFile is a file that contains the locations of cross-sections
as X,Y coordinates, the lengths of each cross-section and the branch and offset/chainage on which
they are located. For a conceptual overview of how this data is used in FM2PROF, see
Control Volumes.
This is a vitally important file for FM2PROF, as it defines not only where the cross-sections are located, but also how 2D volumes are mapped to 1D widths. This utility helps to generate a valid and consistent input file. Manual editing of this file is only recommended for advanced users.
Cross-Section Placement
By default, cross-sections are placed at all computational points in the 1D network. However, this can lead to cross-sections in places where they are not desired. See Troubleshooting for examples of how to diagnose such issues.
To customise the placement of cross-sections, it supports an optional Branch Rule File (see below).
Example usage
Example
This illustrates how to use the tool in Python code:
Branch Rule File
This optional file is used to exclude certain computational points from being used as the location of a cross-section. This is particularly useful when smaller branches connect to a major branch, see Troubleshooting.
The branch_rule_file is a comma-separated file with the following syntax:
Rules
Rules are general rules to exclude cross-sections. Supported general rules are:
- onlyFirst: only keep the first cross-section, and exclude all others
- onlyLast: only keep the last cross-section, and exclude all others
- onlyEdges: only keep the first and last cross-section, and exclude all others
- ignoreFirst: exclude the first cross-section on a branch
- ignoreLast: exclude the last cross-section on a branch
- ignoreEdges: exclude the first and last cross-section on a branch
- noRule: use to not use any of the above rules
Exclusions
Exclusions are used to exclude specific cross-sections by id.
Usage
To only exclude one specific cross-section:
In this case, the computational point with name channel_1_350.000 will
not be used as the location of a cross-section, but all other computational points
on branch Channel1 will be used.
Rules and individual exclusions can be mixed, e.g.:
More than one exclusion can be specified, e.g.:
Generate cross section location file object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network_definition_file
|
str | Path
|
network definition file |
required |
cross_section_location_file
|
str | Path
|
cross-section location file |
required |
branch_rule_file
|
str | Path
|
branch rule file. Defaults to "". |
''
|