Pipeline

Pipeline design functions

This module provides simple functions for creating pipeline components (pipes, elbows, and tees), joining them together, and calculating ideal head loss/flow rates. When they are created, pipeline components are checked against a set of standard component sizes to ensure that they are readily constructible.

Constants:
  • AVAILABLE_SIZES (numpy.ndarray * u.inch): Set of available sizes for pipeline components

  • AVAILABLE_IDS_SCH40 (numpy.ndarray * u.inch): Set of available pipe inner diameters for SCH40 pipes

  • AVAILABLE_FITTING_SIZES (numpy.ndarray * u.inch): Set of available sizes for pipeline fittings

  • AVAILABLE_FITTING_IDS (numpy.ndarray * u.inch): Set of available inner diameters for pipeline fittings

class aguaclara.design.pipeline.PipelineComponent(**kwargs)[source]

An abstract representation of pipeline components

This abstract base class (ABC) contains common functionality for:

  1. describing and designing readily constructible pipeline components

  2. calculating the head loss of a pipeline given its flow rate, and vice-versa.

  3. printing the dimensions of either an individual pipe or an entire pipeline

Design Inputs:
  • q (float * u.L/u.s): Flow rate (recommended, defaults to 20 L/s)

  • temp (float * u.degC): Water temperature (recommended, defaults to 20°C)

  • size (float * u.inch): Nominal size (recommended, defaults to 0.5 in)

  • fluid_type (str): Fluid type. Must be ‘water’, ‘pacl’, or ‘alum’ (optional, defaults to ‘water’)

  • next (PipelineComponent): The next pipeline component with respect to the flow direction. This can be either a newly-instantiated PipelineComponent child class, or a variable that contains such a component (optional, defaults to None)

  • k_minor (float): The minor loss coefficient (k-value) (optional, defaults to 0)

property nu

The kinematic viscosity of the fluid passing through the pipeline component.

abstract headloss()[source]

The head loss of this pipeline component.

property headloss_pipeline

The head loss of the entire pipeline following this component.

flow_pipeline(target_headloss)[source]

Calculate the required flow through a pipeline component and all of its next components to reach a desired head loss.

Args:
  • target_headloss (float * u.m): The desired head loss through the pipeline

abstract format_print()[source]

The string representation of a pipeline component, disregarding other components in its pipeline.

class aguaclara.design.pipeline.Pipe(**kwargs)[source]

Design class for a pipe

Instantiate this class to create a readily constructible pipe and calculate its hydraulic features.

Pipe’s may be instantiated from a nominal size (to fit into an existing pipeline) or inner diameter (to follow hydraulic constraints), but not both.

Design Inputs:
  • q (float * u.L/u.s): Flow rate (recommended, defaults to 20 L/s)

  • temp (float * u.degC): Water temperature (recommended, defaults to 20°C)

  • size (float * u.inch): Nominal size (recommended, defaults to 0.5 in)

  • fluid_type (str): Fluid type. Must be ‘water’, ‘pacl’, or ‘alum’ (optional, defaults to ‘water’)

  • next (PipelineComponent): The next pipeline component with respect to the flow direction. This can be either a newly-instantiated PipelineComponent child class, or a variable that contains such a component (optional, defaults to None)

  • id (float * u.inch): Inner diameter (optional, defaults to 0.476 in)

  • spec (str): The pipe specification. Must be one of ‘sdr26’, ‘sdr41’, or ‘sch40’. (optional, defaults to ‘sdr41’)

  • l (float * u.m): Length of the pipe (optional, defaults to 1 m)

  • pipe_rough (float * u.mm): Pipe roughness (optional, defaults to PVC pipe roughness of 12 mm)

  • k_minor (float): The minor loss coefficient (k-value) (optional, defaults to 0)

property od

The outer diameter of the pipe

ID_SDR_all_available(SDR)[source]

Return an array of inner diameters with a given SDR.

property headloss

Return the total head loss from major and minor losses in a pipe.

format_print()[source]

Return the string representation of this pipe.

class aguaclara.design.pipeline.Elbow(**kwargs)[source]

Design class for an Elbow

Instantiate this class to create a readily constructible Elbow fitting and calculate its hydraulic features.

Elbow’s may be instantiated from a nominal size (to fit into an existing pipeline) or inner diameter (to follow hydraulic constraints), but not both.

Constants:
  • AVAILABLE_ANGLES (int * u.deg list): The possible angles for this fitting.

Design Inputs:
  • q (float * u.L/u.s): Flow rate (recommended, defaults to 20L/s)

  • temp (float * u.degC): Water temperature (recommended, defaults to 20°C)

  • size (float * u.inch): The nominal size (recommended, defaults to 0.5 in.)

  • fluid_type (str): Fluid type. Must be ‘water’, ‘pacl’, or ‘alum’ (optional, defaults to ‘water’)

  • next (PipelineComponent): The next pipeline component after the outlet, cannot be another Elbow or a Tee fitting. outlet, cannot be another Elbow or a Tee fitting. outlet, cannot be another Elbow or a Tee fitting. (optional, defaults to None)

  • angle (float * u.deg): The angle of the fitting, which must be found in AVAILABLE_ANGLES (recommended, defaults to 90 °)

  • id (float * u.inch): The inner diameter. (recommended, defaults to 0.848 * u.inch)

property headloss

The headloss

format_print()[source]

The string representation for an Elbow Fitting.

class aguaclara.design.pipeline.Tee(**kwargs)[source]

Design class for a Tee

Instantiate this class to create a readily constructible tee fitting and calculate its hydraulic features.

Tee’s may be instantiated from a nominal size (to fit into an existing pipeline) or inner diameter (to follow hydraulic constraints), but not both.

Constants:
  • AVAILABLE_PATHS (str list): The available paths for the left and right outlet. Branch meaning the flow would turn, run meaning the flow stays straight, and stopper meaning there is no flow for that outlet due to a stopper.

Design Inputs:
  • q (float * u.L / u.s): Flow rate (recommended, defaults to 20L/s)

  • temp (float * u.degC): Water temperature (recommended, defaults to 20°C )

  • size (float * u.inch): The size (recommended, defaults to 0.5 in.)

  • fluid_type (str): The type of fluid flowing inside (optional, defaults to water)

  • left (PipelineComponent): The type of piping for the left outlet, cannot be an elbow or tee (recommended, defaults to None)

  • left_type (str): The type of path for the left outlet, can only be one of the elements in AVAILABLE_PATHS. can only be one of the elements in AVAILABLE_PATHS. can only be one of the elements in AVAILABLE_PATHS. (recommended, defaults to ‘branch’)

  • right (PipelineComponent): The type of piping for the right outlet, cannot be an elbow or tee. (recommended, defaults to None)

  • right_type (str): The type of path for the right outlet, can only be one of the elements in AVAILABLE_PATHS. can only be one of the elements in AVAILABLE_PATHS. can only be one of the elements in AVAILABLE_PATHS. (recommended, defaults to ‘stopper’)

  • id (float * u.inch): The inner diameter. (recommended, defaults to 0.848 * u.inch)

property headloss

The headloss

format_print()[source]

The string representation of this tee.