Source

Create Function

create_source(net, junction, mdot_kg_per_s, scaling=1.0, name=None, index=None, in_service=True, type='source', **kwargs)

Adds one source in table net[“source”].

Parameters
  • net (pandapipesNet) – The net for which this source should be created

  • junction (int) – The index of the junction to which the source is connected

  • mdot_kg_per_s (float, default None) – The required mass flow

  • scaling (float, default 1) – An optional scaling factor to be set customly

  • name (str, default None) – A name tag for this source

  • index (int, default None) – Force a specified ID if it is available. If None, the index one higher than the highest already existing index is selected.

  • in_service (bool, default True) – True for in service, false for out of service

  • type (str, default None) – Type variable to classify the sink

  • kwargs – Additional keyword arguments will be added as further columns to the net[“source”] table

Returns

index - The unique ID of the created element

Return type

int

Example
>>> create_source(net,junction=2,mdot_kg_per_s=0.1)

Component Table Data

net.source

Parameter

Datatype

Value Range

Explanation

name

string

Name of the source

junction

integer

Index of connected junction

mdot_kg_per_s

float

\(\geq\) 0

The mass flow injected by the source [kg/s]

scaling

float

\(\geq\) 0

Scaling factor for the injected mass flow

in_service

boolean

True / False

Specifies if the source is in service.

type

string

Type variable to classify sources

Physical Model

A source component injects a specified mass flow into the system. The source is connected to a specified node.

Sources are typically used to model producing units in hydraulic systems. Please note that sources cannot be used to model heat sources for the pandapipes heat mode. In this case, to model a heat flow entering the system, the heat exchanger component can be used.

Result Table Data

net.res_source

Parameter

Datatype

Explanation

mdot_kg_per_s

float

Mass flow injection [kg/s]