Options

In this tutorial, we will take a look at the different modelling settings that users can modify.

Network objects have several attributes related to settings:

  • options contains general model settings (e.g., units, headloss formula)

  • times stores all time related settings (e.g., reporting time step, simulation duration)

  • report configures general report settings (e.g., whether the simulation report should contain all the nodes)

  • reportparameter is used to enable or disable the reporting on individual report parameters

  • reportprecision allows for configuring the precision of the individual report parameters

Note

By default, OOPNET uses SI units and will convert all units in a model to SI units.

We start by importing all required packages and reading a model. We will again use the Poulakis model for demonstration.

import os

import oopnet as on

filename = os.path.join('data', 'Poulakis.inp')
network = on.Network.read(filename)

We can check what kind of demand model (demand driven or pressure driven) is used in the model:

print(network.options.demandmodel)
DDA

The model we loaded is configured for steady state analysis. We can check this by looking at the duration setting:

print(network.times.duration)
0:00:00

All times settings have datetime.timedelta as type. We will use this later in this guide, to set up an extended period simulation.

You can also enable or disable the reporting of certain parameters (pressure, flow, length, velocity, headloss etc). Here, we disable the reporting of the velocity and enable length reporting:

network.reportparameter.velocity = 'NO'
network.reportparameter.length = 'YES'

To change the reporting precision of a parameter, you can do something like this:

network.reportprecision.flow = 3

Summary

import os

import oopnet as on

filename = os.path.join('data', 'Poulakis.inp')
network = on.Network.read(filename)

print(network.options.demandmodel)
print(network.times.duration)

network.reportparameter.velocity = 'NO'
network.reportparameter.length = 'YES'

network.reportprecision.flow = 3