== Introduction ==
This tool createsgenerates loss geometry and attributes for a SWMM conduit layer. Losses are dependent uponon whether a conduit is the furthest upstream, furthest downstream, and which nodes are connected to inlets. Upstream entrance losses are assigned to the furthest upstream channels where the upstream node is <u>not</u> connected to an inlet, and other entrance losses are assigned to all other conduits (may be 0.0). Downstream exit losses are assigned to the furthest downstream channels where the downstream node is <u>not</u> connected to an inlet, and other exit losses are assigned to the rest of the channels (may be 0.0). This tool creates entrance and exit losses specified by the user throughout the domain. Channels that experience atypical size changes may need higher or lower loss coefficients.<br>
This tool supports in-place editing if selected in the QGIS processing window.<br>
'''Note:''' This tool relies on the "From Node" and "To Node" fields to determine the position in the network. The <u>[[QGIS SWMM Conduits Assign Node Fields|Conduits - Assign node fields]]</u> processing tool will ensure the "From Node" and "To Node" fields are correctly assigned.
<br>
== Usage ==
This tool, '''Conduits - Assign losses''', can be found in the QGIS processing toolbox panel under 'TUFLOW >> SWMM'. To open the Processing Toolbox Panelpanel, navigate to 'Processing' in the menubar and select 'Toolbox'.<br>
<br>
[[File:open_processing_toolbox.png]]<br>
=== Parameters ===
This tool populates the 'losses_Kentry', losses_Kexit', and 'losses_Kavg' fields of the input conduit layer. The 'losses_Kentry' and losses_Kexit' fields are determined by the input parameters below. The 'losses_Kavg' field is set to 0.0; however if the field is already populated, the tool will not override the existing value.
<ol>
<li>'''Input layer:''' The existing conduits layer thatto will be assignedwhich the losses fields. Towill onlybe update the fields of some of the layers' features, tick on 'Selected features only'assigned. The tool will only update the fields of the conduits which have been selected.
<li>'''Selected features only:''' If channel(s) in the conduits layer have been selected using the 'Select Features' tool, this option will become available. If checked on, the tool will only assign losses fields to the selected channel(s).
<li>'''Input inlet usage features [optional]:''' The layer containing the physical location of inlets and site specific geometry.
<li>'''Culvert opening:'''
<li>'''Entrance loss furthest upstream channels:''' The data to populate the 'losses_Kentry' field for the furthest upstream conduits features. ▼
<li>''':*Entrance loss for channels not furthest upstreamLoss:''' The data to populate the 'losses_Kentry' field for the otherfurthest upstream conduits' features. Default value is 0.5.
<li>'''Culvert or pipe network outlet:'''
<li>'''Exit loss furthest downstream channels:''' The data to populate the 'losses_Kexit' field for the furthest downstream conduits features. ▼
<li>''':*Exit loss for channels not furthest downstream:''' The data to populate the 'losses_Kexit' field for the otherfurthest downstream conduits' features. Default value is 1.0.
<li>'''Pipe network (manholes and pit inlets):'''
<li>'''Conduits:''' Determines the filename and location of the output conduits layer. Details on the output options are below. ▼
▲<li>''':*Entrance loss furthest upstream channels: ''' The data to populate the 'losses_Kentry' field for the furthestother upstream conduits ' features. Default value is 0.2.
▲<li>''':*Exit loss furthest downstream channels: ''' The data to populate the 'losses_Kexit' field for the furthestother downstream conduits ' features. Default value is 0.4.
▲<li>''' ConduitsOutput conduits:''' Determines the filename and location of the output conduits layer. Details on the output options are below.
</ol>
'''Note:''' If 'Edit Feature In-Place' is selected, the tool does not require the 'Input layer' or the 'Conduits' parameters, as the tool will override the existing junctionsconduits file with the updated attributes.
<br><br>
[[File:Assign_Losses_DialogConduits_Assign_Losses_Dialog_01b.png]]
<br><br>
:'''Output Options:'''<br>
:For each of the following options, the tool will create a new conduits layer and won't override the existing one.
{{Video|name=Animation_Conduits_Assign_Losses_01d.mp4|width=1236}}
<ol>
<br>
Using the 'Edit FeaturesFeature In-Place' tool: ▼
[[File:Assign_Nodes_Dialog_output_options_02.png]]
<br><br>
{{Video|name=Animation_Conduits_Assign_Losses_02d.mp4|width=1236}}
:<li>Create Temporary Layer:
:*Creates a temporary scratch layer. This layer will open into the QGIS workspace but it will '''not''' be saved anywhere.
:<li>Save to File...:
:*The user can navigate to a folder and save the updated conduits layer to a new GeoPackage Database.
:<li>Save to GeoPackage...:
:*The user can navigate to an existing GeoPackage Database. Once selected, a 'Layer Name' dialog will appear. Enter the new layer name, and the updated conduits layer will be saved as that name in the GPKG.
::[[File:Layer_Name_dialog.png]]
:<li>Save to Database Table...:
:*'''<font color=red>???</font>'''
:<li>Append to Layer...:
:*'''<font color=red>???</font>'''<br>
</ol>
Save to an existing GeoPackage:
<br><br>
{{Video|name=|width=1235}}
<br>
▲Using 'Edit Features In-Place':
<br><br>
{{Video|name=|width=1235}}
<br>
|