DNV Tools#

This module provides classes and functions for calculating DNV pipeline limit states and material properties.

Features:

  • The DNVGeneral class implements calculations for temperature derating, yield and tensile strength, and characteristic material burst strength, supporting both scalar and array-based inputs.

  • The DNVLimitStates class extends DNVGeneral and provides burst pressure calculations for pipelines according to DNV standards.

  • Designed for use in subsea pipeline and riser engineering, but general enough for any DNV-based pipeline property calculations.

All calculations are vectorized using NumPy for efficiency and flexibility.


class refpy.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 refpy.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])