Class IncompressiblePipeFlow

All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, PipeLineInterface, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface

public class IncompressiblePipeFlow extends AdiabaticPipe
Incompressible pipe flow model for liquid flow with fittings.

This class models incompressible (liquid) flow through pipes using the Darcy-Weisbach equation. It extends AdiabaticPipe and inherits fitting support from the Pipeline base class.

Pressure Drop Calculation

The total pressure drop consists of friction loss and elevation change:

ΔP_total = ΔP_friction + ΔP_elevation

ΔP_friction = f × (L_eff / D) × (ρV² / 2)
ΔP_elevation = ρg(z_in - z_out)

where:

  • f = Darcy friction factor
  • L_eff = effective length (physical + fittings equivalent)
  • D = pipe internal diameter
  • ρ = fluid density
  • V = fluid velocity
  • g = gravitational acceleration
  • z = elevation

Equivalent Length Method for Fittings

Pipe fittings (bends, valves, tees, etc.) add pressure loss that is accounted for using the equivalent length method. Each fitting is assigned an L/D ratio representing the length of straight pipe (in diameters) that would produce the same pressure drop.

L_eff = L_physical + Σ(L/D)_i × D

Usage Example


// Create water stream
SystemInterface water = new SystemSrkEos(298.15, 5.0);
water.addComponent("water", 100.0, "kg/hr");
Stream feed = new Stream("Water", water);
feed.run();

// Create pipe with fittings
IncompressiblePipeFlow pipe = new IncompressiblePipeFlow("Process Line", feed);
pipe.setLength(100.0); // 100 m physical length
pipe.setDiameter(0.05); // 50 mm diameter
pipe.setPipeWallRoughness(4.5e-5); // Commercial steel

// Add fittings
pipe.addFitting("90-degree elbow", 30.0); // L/D = 30
pipe.addFitting("90-degree elbow", 30.0); // Another elbow
pipe.addFittingFromDatabase("Gate valve, fully open"); // From database

// Set elevation change
pipe.setInletElevation(10);
pipe.setOutletElevation(0);

pipe.run();

// Results
double pressureDrop = pipe.getInletPressure() - pipe.getOutletPressure();
double effectiveLength = pipe.getEffectiveLength(); // Physical + fittings

Version:
2.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • momentum

      double momentum
      Momentum term for pressure drop calculation (ρV²).
  • Constructor Details

    • IncompressiblePipeFlow

      public IncompressiblePipeFlow(String name)
      Constructor for IncompressiblePipeFlow.
      Parameters:
      name - name of pipeline
    • IncompressiblePipeFlow

      public IncompressiblePipeFlow(String name, StreamInterface inStream)
      Constructor for IncompressiblePipeFlow with inlet stream.
      Parameters:
      name - name of pipe
      inStream - input stream
  • Method Details

    • calcPressureOut

      public double calcPressureOut()
      Calculate the outlet pressure based on friction and elevation losses.

      Uses the Darcy-Weisbach equation with effective length (physical + fittings):

      ΔP_friction = f × (L_eff / D) × (ρV² / 2)
      
      Overrides:
      calcPressureOut in class AdiabaticPipe
      Returns:
      the outlet pressure in bara
    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Specified by:
      run in interface SimulationInterface
      Overrides:
      run in class AdiabaticPipe
      Parameters:
      id - UUID
    • main

      public static void main(String[] name)
      Example usage demonstrating pipe flow with fittings.
      Parameters:
      name - command line arguments (not used)