Creating and Editing the Model#

The model can consist of up to six layers:

  • three node layers: junctions, reservoirs and tanks

  • three link layers: pipes, valve, and pumps

Each of the six objects is represented in QGIS by it’s own layer. Layers do not need to be created if they are not used for the model. There is a convenience function to create these empty layers with appropriate fields and some default styling, but any layer with the appropriate geometry type (points for nodes and linestrings for links) and with the minimum necessary fields can be used.

Creating Layers#

You can use the ‘new’ button on the toolbar to create a set of layers with default properties.

../_images/new_button.png

Alternatively, for more control, you can use the ‘Create Template Layers’ processing tool.

It is also possible to use any layer - you do not have to use the layers created by the plugin.

Attributes#

Attributes are based on the attributes within WNTR.

All attributes are optional, and unless otherwise stated will use WNTR default values if not defined.

Name All layers can optionally use the attribute name to give a name to each item, which will be visible on the output layer. This must be a string. If no name is given, it will be automatically generated.

Patterns All patterns are string fields. This can be left blank. Otherwise, it should be input as a series of numbers seperated by spaces:

1  1.2 1.3 0.8

Patterns will also accept a field of type list, where each item in the list is a number.

Curves Curves should be inputted with the following form, where each pair of numbers in brackets is an x, y point on the curve.

(0, 10), (2, 5), (3.3, 7)

Geographical attributes All geographical (coordinates, vertices) and network-related (start_node_name and end_node_name) WNTR attributes are not used. This is because they are calculated automatically based on the geometry of the features.

Table 2 Possible Junction Attributes#

Attribute

QGIS Field Type

Value(s)

Used for

name

Text (string)

Will calculate if blank

elevation

Decimal (double)

base_demand

Decimal (double)

demand_pattern

Text (string) or Decimal list

Pattern

emitter_coefficient

Decimal (double)

initial_quality

Decimal (double)

Water Quality Analysis

minimum_pressure

Decimal (double)

Pressure Dependent Demand

required_pressure

Decimal (double)

Pressure Dependent Demand

pressure_exponent

Decimal (double)

Pressure Dependent Demand

Table 3 Possible Reservoir Attributes#

Attribute

QGIS Field Type

Value(s)

Used for

name

Text (string)

Will calculate if blank

base_head

Decimal (double)

head_pattern

Text (string) or Decimal list

Pattern

initial_quality

Decimal (double)

Water Quality Analysis

Table 4 Possible Tank Attributes#

Attribute

QGIS Field Type

Value(s)

Used for

name

Text (string)

Will calculate if blank

elevation

Decimal (double)

init_level

Decimal (double)

min_level

Decimal (double)

max_level

Decimal (double)

diameter

Decimal (double)

min_vol

Decimal (double)

vol_curve

Text (string)

Curve

overflow

Boolean

initial_quality

Decimal (double)

Water Quality Analysis

mixing_fraction

Decimal (double)

Water Quality Analysis

mixing_model

Decimal (double)

Water Quality Analysis

bulk_coeff

Decimal (double)

Water Quality Analysis

Table 5 Possible Pipes Attributes#

Attribute

QGIS Field Type

Value(s)

Used for

name

Text (string)

Will calculate if blank

length

Decimal (double)

Will calculate if blank

diameter

Decimal (double)

roughness

Decimal (double)

minor_loss

Decimal (double)

initial_status

InitialStatus

OPEN, CLOSED

check_valve

Boolean

bulk_coeff

Decimal (double)

Water Quality Analysis

wall_coeff

Decimal (double)

Water Quality Analysis

Table 6 Possible Pumps Attributes#

Attribute

QGIS Field Type

Value(s)

Used for

name

Text (string)

Will calculate if blank

pump_type

PumpTypes

POWER, HEAD

pump_curve

Text (string)

Curve

power

Decimal (double)

base_speed

Decimal (double)

speed_pattern

Text (string) or Decimal list

Pattern

initial_status

InitialStatus

OPEN, CLOSED

initial_setting

Decimal (double)

efficiency

Text (string)

Curve

Energy

energy_pattern

Text (string) or Decimal list

Pattern

Energy

energy_price

Decimal (double)

Energy

Table 7 Possible Valve Attributes#

Attribute

QGIS Field Type

Value(s)

Used for

name

Text (string)

Will calculate if blank

diameter

Decimal (double)

valve_type

ValveType

PRV, PSV, PBV, FCV, TCV, GPV

minor_loss

Decimal (double)

initial_status

InitialStatus

ACTIVE, OPEN, CLOSED

initial_setting

Decimal (double)

headloss_curve

Text (string)

Curve