Pipe is the space markup element used to graphically draw pipes in fluid simulation models.
It is the animation shape for a pipe defined logically with Fluid Library block Pipeline . You draw the Pipe according to the pipe topology, and customize its appearance via the pipe's properties (namely, set its color, diameter, and optionally alter Z-coordinates). Pipeline block defines all the logic for the pipe (its capacity, rate, initial amount of liquid inside the pipe, color of batches flowing through the pipe, etc.).
Pipe is displayed both in 2D and 3D animation (to see the pipe in 3D, add 3D window in your model). Pipe may have turning points and contain several segments, see the figure below.At model runtime batches flowing through the pipe will be animated as cylinders moving inside the pipe cylinder. The color of liquid cylinders is not defined in the pipe shape, but it is defined in the Fluid Library flowchart.
The pipe has start point and end point. The liquid will always flow from the pipe's start point to its end point, so the pipe direction is very important. Pipe end points can be put at storage tanks, or left just "hanging".
Demo model: Pipeline
To draw a pipe
Name – The name of the pipe. The name is used to refer to the pipe from the Pipeline block properties.
Ignore – If selected, the pipe is excluded from the model.
Visible on upper agent
– If selected, the pipe is also visible on the upper agent where this agent lives.
Lock
– If selected, the pipe is
locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them.
Visible – Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.
Color - Here you can set the pipe color.
Diameter - Here you can set the pipe diameter, in pixels.
Level – Level to which this element belongs.
X – X-coordinate of the pipe's start point.
Y – Y-coordinate of the pipe's start point.
Z – [Enabled if the shape is visible in 3D (advanced property Show in is set to 2D and 3D or 3D only)] Z-coordinate of the pipe's start point.
The table located in the Points properties section enables users to view and adjust coordinates of the pipe turning points. It is the place where you can adjust the Z coordinates for some pipe points.
Here you define relative coordinates, not the absolute ones. The first point always has coordinates (0, 0, 0) that can not be changed.
Other rows of the table define relative coordinates of the successive points. Coordinates of each point are actually offsets of the corresponding point from the start point along X, Y (and optionally Z) axes correspondingly.
Show in - Here you can choose whether you want the pipe to be shown both in 2D and 3D animation, or in 2D only, or in 3D only.
Show name – If selected, the pipe's name is displayed on the graphical diagram.
The pipe has direction. The liquid will always flow from the pipe's start point to its end point. So it is important when you draw your pipe, where you put the pipe's start point. However, you can always change the pipe direction (see below).
To know the direction of the pipe
To change the direction of the pipe
To continue drawing an existing pipe by adding more segments
You may want to split a pipe into several pipes (for example, to put a valve inside).
To split one pipe into two pipes
Function |
Description |
double getDiameter() |
Returns the diameter of the pipe (in pixels). |
double length() |
Returns the length of the pipe (in pixels). |
double length(LengthUnits units) |
Returns the length of the pipe in the specified length measurement units.
Parameter:
|
void setDiameter(double diameter) |
Sets the diameter of the pipe.
Parameter: |
Function |
Description |
Point getStartPoint() |
Returns the Point object with coordinates of the pipe's starting point. |
Point getStartPoint(Point out) |
Returns the Point object with coordinates of the pipe's starting point.
Parameter: |
Point getEndPoint() |
Returns the Point object with coordinates of the pipe's ending point. |
Point getEndPoint(Point out) |
Returns the Point object with coordinates of the pipe's ending point.
Parameter: |
Position getStartPosition() |
Returns the Position object with coordinates and orientation of the pipe's starting point. |
Position getStartPosition(Position out) |
Returns the Position object with coordinates and orientation of the pipe's starting point.
Parameter: |
Position getEndPosition() |
Returns the Position object with coordinates and orientation of the pipe's ending point. |
Position getEndPosition(Position out) |
Returns the Position object with coordinates and orientation of the pipe's ending point.
Parameter: |
Point getPointAtOffset(double offset, Point out) |
Returns the Point object with coordinates and orientation of the point that is located at the given offset distance (in pixels) from the pipe's starting point.
Parameters: |
Point getPointAtOffset(double offset, LengthUnits units, Point out) |
Returns the Point object with coordinates and orientation of the point that is located at the given offset distance from the pipe's starting point.
Parameters: |
Position getPositionAtOffset(double offset, Position out) |
Returns the Position object with coordinates and orientation of the point that is located at the given offset distance (in pixels) from the pipe's starting point.
Parameters: |
Position getPositionAtOffset(double offset, |
Returns the Position object with coordinates and orientation of the point that is located at the given offset distance from the pipe's starting point.
Parameters: |
boolean contains(double px, double py) |
Returns true if the pipe contains the point with the given coordinates.
Parameters: |
boolean contains(double px, double py, double distance) |
Returns true if the pipe contains the point with the given coordinates using the given distance tolerance; returns false otherwise.
Parameters: |
boolean containsSq(double px, double py, double squareDistance) |
Returns true if the pipe contains the point with the given coordinates using the given square distance tolerance; returns false otherwise.
Parameters: |
Function |
Description |
int getSegmentCount() |
Returns the number of the pipe's segments. |
MarkupSegment getSegment(int index) |
Returns the segment by the provided index.
Parameter: |
Function |
Description |
Level getLevel() |
Returns the
level
on which this pipe is located. |
Function |
Description |
Color getColor() |
Returns the color of the markup element, or null if markup element has no color or has textured (in this case use getTexture() to get the shape's texture). |
void setColor(Color color) |
Sets the color of the pipe shape.
Parameter: |
void setColor(Paint color) |
Sets the color of the pipe shape.
Parameter: |
Texture getTexture() |
Returns the texture of the pipe element if it has texture. |
Function |
Description |
boolean isVisible() |
Returns true is the pipe shape is visible; returns false otherwise. |
void setVisible(boolean v) |
Sets the visibility of the pipe shape.
Parameter: |
Function |
Description |
void remove() |
Removes the pipe from the presentation. If the pipe is not a part of presentation, the function does nothing. |