5.5. psi.elements

Piping finite elements.

To create a model, the user must first define a series of runs that make the overall centerline of the model. After this process, additional components can be added by giving a point and a direction in which to place the new item or by “converting” a run to a different type of element.

Example

First define the model centerline using Point and Run.

>>> Model("test")
>>> Point(10, 0, 0, 0)
>>> Bend(20, -2, radius=...)    # can be created by a point
>>> Bend(30, 0, 2, radius=...)
>>> Run(40, 0, 0, 2)
>>> Bend(50, 0, 0, 2, radius=...)
>>> Bend(60, 0, -2, radius=...)
>>> Run(70, 2)
>>> Point(80, -10)
>>> Run(90, 0, 2)
>>> Run(100, 0, 0.5)
>>> Point(90)
>>> Run(40)                     # defined twice and loop-closed (1) (2)

Now define the other components by point.

>>> elements(20, 30).split(25)      # split a bend - create run and bend
>>> Valve(25, length, mass, "mid")      # two elements, 3 nodes made
>>> Tee(40, "welding")                  # sif.Tee by point only
>>> Flange(10, length, mass, "down")    # flanged nozzle
>>> Flange(70, length, mass, "up")

There are three possible ways in which a point defined for a component can be interpreted.

  1. If the point is defined as a midpoint, two elements are made, one on each adjacent run.

  2. If the component is defined to be upstream, it will be placed in the oposite direction to the flow, with respect to the element nodal direction.

  3. If the component is defined to be downstream, it will be placed in the same direction as the flow. In both the latter two cases, only one element is created.

When a component is defined at a boundary node, it is possible to create another boundary node by choosing the direction that ‘extends’ the model.

Components can also be created by picking a run element and ‘converting’ it to a different type of element such as a valve or a flange.

>>> elements(50, 60).split(54, 0.5, ref=50)     # used node 50 as reference
>>> elements(54, 60).split(55, 0.5, ref=54)
>>> elements(54, 55).convert(Valve, mass=...)

Note

Only runs can be split and merged. To split a valve for example, it must first be changed to a run and then split.

The following items require extra attention:

  • Dealing with element weight vs mass when it comes to units.

  • For Rigid elements the weight must be specified not the mass.

  • Bend and reducer having multiple run approximation.

  • How to easily create bends when defining geometry and how to update the geometry when point coordinates or bend radius is updated.

  • How to covert different types of elements to runs and vice versa.

  • Unit conversion should be disabled before the analysis is performed.

5.5.1. Run

class psi.elements.Run(point, dx, dy=0, dz=0, from_point=None, section=None, material=None, insulation=None, code=None)

Define a pipe run by incremental offsets in the global x, y and z directions.

Methods

__init__(point, dx, dy=0, dz=0, from_point=None, section=None, material=None, insulation=None, code=None)

Initialize self. See help(type(self)) for accurate signature.

Properties

property dx

Get and set the vertex x-coordinate of the ‘to’ point.

property dy

Get and set the vertex y-coordinate of the ‘to’ point.

property dz

Get and set the vertex z-coordinate of the ‘to’ point.

property length

Get and set the length of the element.

5.5.2. ElementContainer

class psi.elements.ElementContainer

Methods