DNV Tools#

class pysubsea.dnv_tools.DNVGeneral(*, outer_diameter=0.0, corroded_wall_thickness=0.0, material=None, smys=0.0, smts=0.0, temperature=0.0, material_strength_factor=0.0)[source]#

Bases: object

Base class for DNV pipeline limit state calculations. Provides methods for temperature derating, yield and tensile strength, and characteristic material burst strength, supporting both scalar and array-based inputs.

Parameters:
  • outer_diameter (float or array-like, optional) – The outer diameter of the pipeline.

  • corroded_wall_thickness (float or array-like, optional) – The corroded wall thickness of the pipeline.

  • material (float or array-like, optional) – Material types: 1 for ‘CMn’ or ‘13CR’, 2 for ‘22Cr’ or ‘25CR’.

  • smys (float or array-like, optional) – Specified minimum yield strengths.

  • smts (float or array-like, optional) – Specified minimum tensile strengths.

  • temperature (float or array-like, optional) – Temperatures for calculations.

  • material_strength_factor (float or array-like, optional) – Material strength factor.

Notes

All calculations are vectorized using NumPy for efficiency and flexibility.

temperature_derating_stress()[source]#

Calculate the temperature derating stress of a material.

Returns:

temperature_derated_stress – The derating stress values for the given materials and temperatures.

Return type:

np.ndarray

Raises:

ValueError – If a material is not supported.

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> dnv = DNVGeneral(
...     material=materials,
...     temperature=temperatures
... )
>>> dnv.temperature_derating_stress()
array([18000000., 34000000., 70000000., 95000000.])
yield_stress()[source]#

Calculate the yield stress of a material.

Returns:

yield_stress – The yield stress values of the materials at the given temperatures and strength factor.

Return type:

np.ndarray

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> smys = np.array([450.0E+06, 450.0E+06, 550.0E+06, 550.0E+06])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> material_strength_factor = np.array([0.96, 0.96, 0.96, 0.96])
>>> dnv = DNVGeneral(
...     material=materials,
...     smys=smys,
...     temperature=temperatures,
...     material_strength_factor=material_strength_factor
... )
>>> dnv.yield_stress()
array([4.1472e+08, 3.9936e+08, 4.6080e+08, 4.3680e+08])
tensile_strength()[source]#

Calculate the tensile strength of a material.

Returns:

tensile_strength – The tensile strength values of the materials at the given temperatures and strength factor.

Return type:

np.ndarray

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> smts = np.array([485.0E+06, 485.0E+06, 590.0E+06, 590.0E+06])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> material_strength_factor = np.array([0.96, 0.96, 0.96, 0.96])
>>> dnv = DNVGeneral(
...     material=materials,
...     smts=smts,
...     temperature=temperatures,
...     material_strength_factor=material_strength_factor
... )
>>> dnv.tensile_strength()
array([4.4832e+08, 4.3296e+08, 4.9920e+08, 4.7520e+08])
characteristic_material_burst_strength()[source]#

Calculate the characteristic material burst strength.

Returns:

characteristic_burst_strength – The characteristic material burst strength values at the given temperatures and strength factor.

Return type:

np.ndarray

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> smys = np.array([450.0E+06, 450.0E+06, 550.0E+06, 550.0E+06])
>>> smts = np.array([600.0E+06, 600.0E+06, 700.0E+06, 700.0E+06])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> material_strength_factor = np.array([0.96, 0.96, 0.96, 0.96])
>>> dnv = DNVGeneral(
...     material=materials,
...     smys=smys,
...     smts=smts,
...     temperature=temperatures,
...     material_strength_factor=material_strength_factor
... )
>>> dnv.characteristic_material_burst_strength()
array([4.1472e+08, 3.9936e+08, 4.6080e+08, 4.3680e+08])
class pysubsea.dnv_tools.DNVLimitStates(*, outer_diameter=0.0, corroded_wall_thickness=0.0, material=None, smys=0.0, smts=0.0, temperature=0.0, material_strength_factor=0.0)[source]#

Bases: DNVGeneral

Class for DNV pipeline burst pressure limit state calculations.

Extends DNVGeneral to provide burst pressure calculations for corroded pipelines according to DNV standards, using material, geometric, and strength properties.

Parameters:
  • outer_diameter (float or array-like, optional) – The outer diameter of the pipeline.

  • corroded_wall_thickness (float or array-like, optional) – The corroded wall thickness of the pipeline.

  • material (float or array-like, optional) – Material types: 1 for ‘CMn’ or ‘13CR’, 2 for ‘22Cr’ or ‘25CR’.

  • smys (float or array-like, optional) – Specified minimum yield strengths.

  • smts (float or array-like, optional) – Specified minimum tensile strengths.

  • temperature (float or array-like, optional) – Temperatures for calculations.

  • material_strength_factor (float or array-like, optional) – Material strength factor.

Notes

All parameters are passed to the parent class DNVGeneral.

burst_pressure()[source]#

Calculate the burst pressure of a pipeline.

Returns:

burst_pressure – The burst pressure values of the pipeline.

Return type:

np.ndarray

Raises:

ValueError – If a material is not supported.

Examples

>>> outer_diameter = np.array([0.2731, 0.3239, 0.2731, 0.3239])
>>> corroded_wall_thickness = np.array([0.0097, 0.0129, 0.0097, 0.0129])
>>> materials = np.array([1, 1, 2, 2])
>>> smys = np.array([450.0E+06, 450.0E+06, 550.0E+06, 550.0E+06])
>>> smts = np.array([600.0E+06, 600.0E+06, 700.0E+06, 700.0E+06])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> material_strength_factor = np.array([0.96, 0.96, 0.96, 0.96])
>>> dnv = DNVLimitStates(
...     outer_diameter=outer_diameter,
...     corroded_wall_thickness=corroded_wall_thickness,
...     material=materials,
...     smys=smys,
...     smts=smts,
...     temperature=temperatures,
...     material_strength_factor=material_strength_factor
... )
>>> dnv.burst_pressure()
array([35270393.70222808, 38255444.18258572, 39189326.33580898, 41841892.07470313])
characteristic_material_burst_strength()#

Calculate the characteristic material burst strength.

Returns:

characteristic_burst_strength – The characteristic material burst strength values at the given temperatures and strength factor.

Return type:

np.ndarray

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> smys = np.array([450.0E+06, 450.0E+06, 550.0E+06, 550.0E+06])
>>> smts = np.array([600.0E+06, 600.0E+06, 700.0E+06, 700.0E+06])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> material_strength_factor = np.array([0.96, 0.96, 0.96, 0.96])
>>> dnv = DNVGeneral(
...     material=materials,
...     smys=smys,
...     smts=smts,
...     temperature=temperatures,
...     material_strength_factor=material_strength_factor
... )
>>> dnv.characteristic_material_burst_strength()
array([4.1472e+08, 3.9936e+08, 4.6080e+08, 4.3680e+08])
temperature_derating_stress()#

Calculate the temperature derating stress of a material.

Returns:

temperature_derated_stress – The derating stress values for the given materials and temperatures.

Return type:

np.ndarray

Raises:

ValueError – If a material is not supported.

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> dnv = DNVGeneral(
...     material=materials,
...     temperature=temperatures
... )
>>> dnv.temperature_derating_stress()
array([18000000., 34000000., 70000000., 95000000.])
tensile_strength()#

Calculate the tensile strength of a material.

Returns:

tensile_strength – The tensile strength values of the materials at the given temperatures and strength factor.

Return type:

np.ndarray

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> smts = np.array([485.0E+06, 485.0E+06, 590.0E+06, 590.0E+06])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> material_strength_factor = np.array([0.96, 0.96, 0.96, 0.96])
>>> dnv = DNVGeneral(
...     material=materials,
...     smts=smts,
...     temperature=temperatures,
...     material_strength_factor=material_strength_factor
... )
>>> dnv.tensile_strength()
array([4.4832e+08, 4.3296e+08, 4.9920e+08, 4.7520e+08])
yield_stress()#

Calculate the yield stress of a material.

Returns:

yield_stress – The yield stress values of the materials at the given temperatures and strength factor.

Return type:

np.ndarray

Examples

>>> materials = np.array([1, 1, 2, 2])
>>> smys = np.array([450.0E+06, 450.0E+06, 550.0E+06, 550.0E+06])
>>> temperatures = np.array([80.0, 110.0, 80.0, 110.0])
>>> material_strength_factor = np.array([0.96, 0.96, 0.96, 0.96])
>>> dnv = DNVGeneral(
...     material=materials,
...     smys=smys,
...     temperature=temperatures,
...     material_strength_factor=material_strength_factor
... )
>>> dnv.yield_stress()
array([4.1472e+08, 3.9936e+08, 4.6080e+08, 4.3680e+08])
class pysubsea.dnv_tools.DNVSpanning(*, total_outer_diameter=0.0, water_density=0.0, submerged_weight=0.0, soil_type=None)[source]#

Bases: object

Class for DNV pipeline spanning calculations.

Parameters:
  • total_outer_diameter (float or array-like, optional) – Total outer diameter of the pipe. Default is 0.

  • water_density (float or array-like, optional) – Density of water. Default is 0.

  • submerged_weight (float or array-like, optional) – Submerged weight of the pipe. Default is 0.

  • soil_type (str or array-like, optional) – Soil type for lookup: ‘Loose Sand’, ‘Medium Sand’, ‘Dense Sand’, ‘Very Soft Clay’, ‘Soft Clay’, ‘Firm Clay’, ‘Stiff Clay’, ‘Very Stiff Clay’, or ‘Hard Clay’. Default is None.

Notes

All inputs support scalar and array-like values. When arrays are supplied, NumPy broadcasting rules apply.

Examples

>>> spanning = DNVSpanning(
...     total_outer_diameter=[0.2791, 0.3299],
...     water_density=[1025.0, 1025.0],
...     submerged_weight=[695.39794758, 1029.76124826],
...     soil_type=["Medium Sand", "Stiff Clay"]
... )
>>> spanning.specific_mass_ratio()
array([1.1307..., 1.1984...])
>>> spanning.dynamic_stiffness_horizontal()
array([9692100.2..., 3677788.3...])
>>> spanning.dynamic_stiffness_vertical()
array([12812348.9...,  5321131.0...])
SOIL_PROPERTIES = {'Dense Sand': {'Cl': 18000000.0, 'Cv': 21000000.0, 'Kv': 1350000.0, 'soil_poisson': 0.35}, 'Firm Clay': {'Cl': 2600000.0, 'Cv': 3000000.0, 'Kv': 800000.0, 'soil_poisson': 0.45}, 'Hard Clay': {'Cl': 10500000.0, 'Cv': 12000000.0, 'Kv': 4200000.0, 'soil_poisson': 0.45}, 'Loose Sand': {'Cl': 9000000.0, 'Cv': 10500000.0, 'Kv': 250000.0, 'soil_poisson': 0.35}, 'Medium Sand': {'Cl': 12500000.0, 'Cv': 14500000.0, 'Kv': 530000.0, 'soil_poisson': 0.35}, 'Soft Clay': {'Cl': 1200000.0, 'Cv': 1400000.0, 'Kv': 260000.0, 'soil_poisson': 0.45}, 'Stiff Clay': {'Cl': 3900000.0, 'Cv': 4500000.0, 'Kv': 1600000.0, 'soil_poisson': 0.45}, 'Very Soft Clay': {'Cl': 500000.0, 'Cv': 600000.0, 'Kv': 100000.0, 'soil_poisson': 0.45}, 'Very Stiff Clay': {'Cl': 9500000.0, 'Cv': 11000000.0, 'Kv': 3000000.0, 'soil_poisson': 0.45}}#
specific_mass_ratio()[source]#

Calculate the specific mass ratio of the pipe.

Returns:

specific_mass_ratio – The specific mass ratio of the pipe.

Return type:

np.ndarray

Notes

The specific mass ratio is calculated as the ratio of the submerged weight to the product of the water density and the total outer diameter of the pipe.

soil_properties()[source]#

Return lookup properties for the configured soil type(s).

Returns:

Dictionary with keys Cv, Cl, Kv, and soil_poisson.

Return type:

dict

dynamic_stiffness_horizontal()[source]#

Calculate the dynamic stiffness of the pipe based on soil type.

Returns:

k_horiz_dynamic – Horizontal dynamic stiffness.

Return type:

float or array-like

Raises:

ValueError – If the soil type is not supported.

Notes

The dynamic stiffness is calculated using the DNV soil lookup tables for sand and clay.

dynamic_stiffness_vertical()[source]#

Calculate the dynamic stiffness of the pipe based on soil type.

Returns:

k_vert_dynamic – Vertical dynamic stiffness.

Return type:

float or array-like

Raises:

ValueError – If the soil type is not supported.

Notes

The dynamic stiffness is calculated using the DNV soil lookup tables for sand and clay.