Linepipe Tools#
This module provides the core class and functions for representing and calculating the main geometric and material properties of pipeline sections.
Features:
The Pipe class encapsulates the geometry and material characteristics of a pipeline section, supporting both scalar and array-based calculations for batch processing.
Methods for computing inner/outer diameters, areas, steel and coating cross-sections, stiffness, and moments of inertia.
Designed for use in subsea pipeline and riser engineering, but general enough for any pipeline property calculations.
All calculations are vectorized using NumPy for efficiency and flexibility.
- class refpy.linepipe_tools.Pipe(*, outer_diameter=0.0, wall_thickness=0.0, coating_thickness=0.0, corrosion_allowance=0.0, youngs_modulus=0.0)[source]#
Bases:
object
Class representing a pipeline section with geometric and material properties. Supports both scalar and array inputs for calculations.
- Parameters:
outer_diameter (float or array-like, optional) – Outer diameter of the pipe (m). Default is 0.
wall_thickness (float or array-like, optional) – Wall thickness of the pipe (m). Default is 0.
coating_thickness (float or array-like, optional) – Coating wall thickness (m). Default is 0.
corrosion_allowance (float or array-like, optional) – Corrosion allowance (m). Default is 0.
youngs_modulus (float or array-like, optional) – Young’s modulus of the material (Pa). Default is 0.
- wall_thickness_corroded()[source]#
Calculate the corroded wall thickness.
- Returns:
corroded_wall_thickness – Corroded wall thickness of the pipe.
- Return type:
np.ndarray
Examples
>>> wall_thickness = [0.0127, 0.0159] >>> corrosion_allowance = [0.003, 0.003] >>> pipe = Pipe( ... wall_thickness=wall_thickness, ... corrosion_allowance=corrosion_allowance ... ) >>> pipe.wall_thickness_corroded() array([0.0097, 0.0129])
- inner_diameter()[source]#
Calculate the pipe inner diameter.
- Returns:
inner_diameter – Inner diameter of the pipe.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> wall_thickness = [0.0127, 0.0159] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... wall_thickness=wall_thickness ... ) >>> pipe.inner_diameter() array([0.2477, 0.2921])
- inner_area()[source]#
Calculate the pipe inner area.
- Returns:
inner_area – Inner area of the pipe.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> wall_thickness = [0.0127, 0.0159] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... wall_thickness=wall_thickness ... ) >>> pipe.inner_area() array([0.04818833, 0.06701206])
- outer_area()[source]#
Calculate the pipe outer area.
- Returns:
outer_area – Outer area of the pipe.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> pipe = Pipe( ... outer_diameter=outer_diameter ... ) >>> pipe.outer_area() array([0.05857783, 0.08239707])
- steel_area()[source]#
Calculate the steel cross-sectional area.
- Returns:
steel_area – Steel cross-sectional area.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> wall_thickness = [0.0127, 0.0159] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... wall_thickness=wall_thickness ... ) >>> pipe.steel_area() array([0.0103895 , 0.01538501])
- total_outer_diameter()[source]#
Calculate the total outer diameter of steel and coating.
- Returns:
total_outer_diameter – Total outer diameter of steel and coating.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> coating_thickness = [0.003, 0.003] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... coating_thickness=coating_thickness ... ) >>> pipe.total_outer_diameter() array([0.2791, 0.3299])
- total_outer_area()[source]#
Calculate the outer area of steel and coating.
- Returns:
total_outer_area – Outer area of steel and coating.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> coating_thickness = [0.003, 0.003] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... coating_thickness=coating_thickness ... ) >>> pipe.total_outer_area() array([0.06118001, 0.08547803])
- coating_area()[source]#
Calculate the coating cross-sectional area.
- Returns:
coating_area – Coating cross-sectional area.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> coating_thickness = [0.003, 0.003] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... coating_thickness=coating_thickness ... ) >>> pipe.coating_area() array([0.00260218, 0.00308096])
- axial_stiffness()[source]#
Calculate the axial stiffness.
- Returns:
axial_stiffness – Axial stiffness of the pipe.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> wall_thickness = [0.0127, 0.0159] >>> youngs_modulus = [207.0e+09, 207.0e+09] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... wall_thickness=wall_thickness, ... youngs_modulus=youngs_modulus ... ) >>> pipe.axial_stiffness() array([2.15062613e+09, 3.18469656e+09])
- area_moment_inertia()[source]#
Calculate the area moment inertia.
- Returns:
area_moment_inertia – Area moment inertia.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> wall_thickness = [0.0127, 0.0159] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... wall_thickness=wall_thickness ... ) >>> pipe.area_moment_inertia() array([8.82710601e-05, 1.82921605e-04])
- bending_stiffness()[source]#
Calculate the bending stiffness.
- Returns:
bending_stiffness – Bending stiffness.
- Return type:
np.ndarray
Examples
>>> outer_diameter = [0.2731, 0.3239] >>> wall_thickness = [0.0127, 0.0159] >>> youngs_modulus = [207.0e+09, 207.0e+09] >>> pipe = Pipe( ... outer_diameter=outer_diameter, ... wall_thickness=wall_thickness, ... youngs_modulus=youngs_modulus ... ) >>> pipe.bending_stiffness() array([18272109.437121..., 37864772.21769765])