Fluid Properties in pandapipes

The pipelines in the pandapipes network are run with a certain fluid. This can be chosen individually for the net from the fluid library or by own creation. The fluids are defined by certain properties. In the fluid library currently high or low caloric natural gas (hgas and lgas), water and air are implemented with default properties.

The Fluid Class

Inside this class, different properties with their values are implemented. These properties can be called by different functions. There exists a general function, which returns the values of the requested property. Furthermore, there are different specified functions to return directly the value of the density, viscosity and heat capacity.

In addition to the already existing properties there is a function, which allows to add new properties. It also warns if the there is already a property with the same name and can overwrite an existing property with a new value.

class Fluid(name, fluid_type, **kwargs)
add_property(self, property_name, prop, overwrite=True, warn_on_duplicates=True)

This function adds a new property.

Parameters
  • property_name (str) – Name of the new property

  • prop

  • overwrite (bool) – True if existing property with the same name shall be overwritten

  • warn_on_duplicates (bool) – True, if a warning of properties with the same name should be returned

get_density(self, temperature)

This function returns the density at a certain temperature.

Parameters

temperature (float) – Temperature at which the density is queried

Returns

Density at the required temperature

get_heat_capacity(self, temperature)

This function returns the heat capacity at a certain temperature.

Parameters

temperature (float) – Temperature at which the heat capacity is queried

Returns

Heat capacity at the required temperature

get_property(self, property_name, \*at_values)

This function returns the value of the requested property.

Parameters
  • property_name (str) – Name of the searched property

  • at_values – Value for which the property should be returned

Returns

Returns property at the certain value

Return type

get_viscosity(self, temperature)

This function returns the viscosity at a certain temperature.

Parameters

temperature (float) – Temperature at which the viscosity is queried

Returns

Viscosity at the required temperature

Properties

The idea behind the properties is a functional correlation between physical quantities, e. g. a linear correlation between pressure and temperature based on the ideal gas law. This way the pandapipes components can ask for a specific fluid property, such as the density, at a given operation point. Some classes for different functional correlations have already been implemented. All properties have to inherit from the Property base class in order to be used in a fluid. These classes shall be introduced in the following. They all inherit from the pandapower JSONSerializableClass, as they shall also be saved and reloaded savely (see also the chapter Save and Load Networks).

Property Base Class

class FluidProperty

Property Base Class

Property With Constant Value

class FluidPropertyConstant(value)

Creates Property with a constant value.

get_property(self, arg)
Parameters

arg

Returns

Return type

Property With Linear Correlation

class FluidPropertyLinear(slope, offset)

Creates Property with a linear course.

get_property(self, arg)
Parameters

arg

Returns

Return type

Property With Interpolated Measure Points

class FluidPropertyInterExtra(x_values, y_values, method='interpolate_extrapolate')

Creates Property with interpolated or extrapolated values.

classmethod from_path(path, method='interpolate_extrapolate')

Reads a text file with temperature values in the first column and property values in second column. :param path: :type path: :param method: :type method: :return: :rtype:

get_property(self, arg)
Parameters

arg

Returns

Return type