Class Fittings
- All Implemented Interfaces:
Serializable
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)
| 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInner class representing a single pipe fitting. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) ArrayList<Fittings.Fitting> List of fittings in this collection.(package private) static org.apache.logging.log4j.LoggerLogger object for class.private static final longSerialization version UID.Standard L/D values for common fittings (from Crane TP-410). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a fitting by name, loading L/D from database.voidAdd a fitting with a specified L/D ratio.voidaddMultiple(String name, double LdivD, int count) Add multiple identical fittings.booleanaddStandard(String type) Add a standard fitting type with predefined L/D value.booleanaddStandardMultiple(String type, int count) Add multiple standard fittings of the same type.voidclear()Clear all fittings from the collection.Get the list of all fittings.Get list of available standard fitting types.Generate a summary of all fittings in the collection.doublegetTotalEquivalentLength(double diameter) Calculate total equivalent length of all fittings for a given pipe diameter.doubleGet the total L/D ratio of all fittings.booleanisEmpty()Check if the fittings collection is empty.intsize()Get the number of fittings in this collection.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
fittingList
ArrayList<Fittings.Fitting> fittingListList of fittings in this collection. -
STANDARD_LD_VALUES
-
-
Constructor Details
-
Fittings
public Fittings()Default constructor for Fittings.
-
-
Method Details
-
add
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 fittingLdivD- equivalent length ratio (L/D), dimensionless
-
add
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
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
Add multiple identical fittings.Convenience method for adding several fittings of the same type.
- Parameters:
name- fitting nameLdivD- L/D ratio for each fittingcount- number of fittings to add
-
addStandardMultiple
Add multiple standard fittings of the same type.- Parameters:
type- standard fitting typecount- number of fittings to add- Returns:
- true if all fittings were added, false if type not recognized
-
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
-
getSummary
Generate a summary of all fittings in the collection.- Returns:
- formatted string summary
-