Class Fittings

java.lang.Object
neqsim.process.equipment.pipeline.Fittings
All Implemented Interfaces:
Serializable

public class Fittings extends Object implements Serializable
Collection of pipe fittings for equivalent length pressure drop calculations.

This class manages a collection of pipe fittings (bends, valves, tees, reducers, etc.) and calculates their contribution to pressure drop using the equivalent length method.

Equivalent Length Method

The equivalent length method converts the pressure loss through a fitting into an equivalent length of straight pipe that would produce the same pressure drop. This is expressed as an L/D ratio (equivalent length divided by pipe diameter).

Mathematical Basis

For a fitting with L/D ratio, the equivalent length is:

L_eq = (L/D) × D

where:

  • L_eq = equivalent length (m)
  • L/D = fitting's equivalent length ratio (dimensionless)
  • D = pipe internal diameter (m)

The total effective pipe length for pressure drop calculations becomes:

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

Relation to K-Factor Method

The L/D method is related to the resistance coefficient (K-factor) method by:

K = f × (L/D)

where f is the Darcy friction factor. For turbulent flow with f ≈ 0.02, K ≈ 0.02 × (L/D).

Standard L/D Values (from Crane TP-410)

Common fitting L/D values
Fitting Type L/D
90° elbow, standard (R/D=1) 30
90° elbow, long radius (R/D=1.5) 16
45° elbow, standard 16
Tee, through flow 20
Tee, branch flow 60
Gate valve, fully open 8
Globe valve, fully open 340
Ball valve, fully open 3
Check valve, swing 100

Usage Example


// Create fittings collection
Fittings fittings = new Fittings();

// Add fittings from database
fittings.add("Standard elbow (R=1.5D), 90deg"); // Loads L/D from database

// Add fittings with explicit L/D values
fittings.add("Custom bend", 25.0); // L/D = 25

// Add multiple identical fittings
fittings.addMultiple("90deg_elbow", 30.0, 4); // 4 elbows, L/D=30 each

// Calculate total equivalent length for a 200mm pipe
double eqLength = fittings.getTotalEquivalentLength(0.2); // in meters

Version:
2.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

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

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • fittingList

      List of fittings in this collection.
    • STANDARD_LD_VALUES

      private static final Map<String,Double> STANDARD_LD_VALUES
      Standard L/D values for common fittings (from Crane TP-410).
  • Constructor Details

    • Fittings

      public Fittings()
      Default constructor for Fittings.
  • Method Details

    • add

      public void add(String name, double LdivD)
      Add a fitting with a specified L/D ratio.

      The L/D ratio represents the equivalent length of the fitting in terms of pipe diameters. For example, an L/D of 30 means the fitting causes the same pressure drop as 30 diameters of straight pipe.

      Parameters:
      name - descriptive name for the fitting
      LdivD - equivalent length ratio (L/D), dimensionless
    • add

      public void add(String name)
      Add a fitting by name, loading L/D from database.

      The fitting name must exist in the 'fittings' database table. If not found, falls back to standard values or logs an error.

      Parameters:
      name - fitting name as stored in database
    • addStandard

      public boolean addStandard(String type)
      Add a standard fitting type with predefined L/D value.

      Uses built-in L/D values from Crane TP-410. Available types:

      • elbow_90_standard, elbow_90_long_radius, elbow_90_mitre
      • elbow_45_standard, elbow_45_long_radius
      • tee_through, tee_branch
      • valve_gate_open, valve_globe_open, valve_ball_open, valve_butterfly_open
      • valve_check_swing, valve_check_lift
      • reducer_sudden, expander_sudden, reducer_gradual, expander_gradual
      • entrance_sharp, entrance_rounded, exit
      Parameters:
      type - fitting type (must match a predefined type)
      Returns:
      true if fitting was added, false if type not recognized
    • addMultiple

      public void addMultiple(String name, double LdivD, int count)
      Add multiple identical fittings.

      Convenience method for adding several fittings of the same type.

      Parameters:
      name - fitting name
      LdivD - L/D ratio for each fitting
      count - number of fittings to add
    • addStandardMultiple

      public boolean addStandardMultiple(String type, int count)
      Add multiple standard fittings of the same type.
      Parameters:
      type - standard fitting type
      count - number of fittings to add
      Returns:
      true if all fittings were added, false if type not recognized
    • getFittingsList

      public ArrayList<Fittings.Fitting> getFittingsList()
      Get the list of all fittings.
      Returns:
      ArrayList of Fitting objects
    • size

      public int size()
      Get the number of fittings in this collection.
      Returns:
      number of fittings
    • isEmpty

      public boolean isEmpty()
      Check if the fittings collection is empty.
      Returns:
      true if no fittings have been added
    • clear

      public void clear()
      Clear all fittings from the collection.
    • getTotalLdRatio

      public double getTotalLdRatio()
      Get the total L/D ratio of all fittings.

      This is the sum of all individual fitting L/D ratios.

      Returns:
      total L/D ratio (dimensionless)
    • getTotalEquivalentLength

      public double getTotalEquivalentLength(double diameter)
      Calculate total equivalent length of all fittings for a given pipe diameter.

      Uses the formula: L_eq = Σ(L/D)_i × D

      Parameters:
      diameter - pipe internal diameter in meters
      Returns:
      total equivalent length in meters
    • getStandardFittingTypes

      public static Map<String,Double> getStandardFittingTypes()
      Get list of available standard fitting types.
      Returns:
      map of fitting types to their L/D values
    • getSummary

      public String getSummary()
      Generate a summary of all fittings in the collection.
      Returns:
      formatted string summary