Learn R Programming

pipenostics

R-package for diagnostics, reliability and predictive maintenance of pipeline systems.


Intro

The package aggregates to some extent the separate knowledge concerning engineering, reliability, diagnostics and predictive maintenance of pipeline systems. For the present time the package contains utilities for processing corrosion data commonly gathered by inline inspection, as well as empirical models for calculations of local thermal-hydraulic regimes of district heating network.

Installation

For the latest version leverage r-universe:

install.packages("pipenostics", repos = "https://omega1x.r-universe.dev")

⚠ Starting from version 0.1.8 the package is not supported on CRAN due to its resource limitations of checking parallel algorithms

Usage examples

Corrosion diagnostics

By using of b31crvl() simply imitate the output of CRVL.BAS which is the honored software for determining the allowable length and maximum allowable working pressure presented in ASME B31G-1991:

library(pipenostics)
    
b31crvl(maop = 910, d = 30, wth = .438, smys = 52000, def  = .72, depth = .1, l = 7.5)
-- Calculated data --
Intermediate factor (A) = 1.847
Design pressure = 1093 PSI; Safe pressure = 1093 PSI
Pipe may be operated safely at MAOP, 910 PSI
With corrosion length 7.500 inch, maximum allowed corrosion depth is 0.2490 inch; A = 1.847
With corrosion depth 0.100 inch, maximum allowed corrosion length is Inf inch; A = 5.000

Probability of failure

Let's consider a pipe in district heating network with

diameter           <- 762         # [mm]
wall_thickness     <-  10         # [mm]
UTS                <- 434.3697    # [MPa]

which transfers heat-carrier (water) at

operating_pressure <-   0.588399  # [MPa]
temperature        <-  95         # [°C]

During inline inspection four corroded areas (defects) are detected with:

depth  <- c(2.45,  7.86,   7.93,   8.15)  # [mm]

whereas the length of all defects is not greater 200 mm:

length <- rep(200, 4)  # [mm]
print(length)
[1] 200 200 200 200

Corrosion rates in radial and in longitudinal directions are not well-known and may vary in range .01 - .30 mm/year:

rar = function(n) stats::runif(n, .01, .30) / 365
ral = function(n) stats::runif(n, .01, .30) / 365

Then probabilities of failure (POFs) related to each corroded area are near:

pof <- mepof(depth, length, rep(diameter, 4), rep(wall_thickness, 4),
             rep(UTS, 4), rep(operating_pressure, 4), rep(temperature, 4),
             rar, ral, method = "dnv")
pipenostics::mepof: process case [4/4] - 100 % . All done, thanks!                 
print(pof)
[1] 0.000000 0.252935 0.368741 0.771299

So, the POF of the pipe is near

print(max(pof))
[1] 0.771299

The value of POF changes in time. So, in a year after inline inspection of the pipe we can get something near

pof <- mepof(depth, length, rep(diameter, 4), rep(wall_thickness, 4),
             rep(UTS, 4), rep(operating_pressure, 4), rep(temperature, 4),
             rar, ral, method = "dnv", days = 365)
pipenostics::mepof: process case [4/4] - 100 % . All done, thanks!             
print(pof)
[1] 0.000000 0.526646 0.647422 0.928825

For entire pipe we get something near:

print(max(pof))
[1] 0.928825

Two years ago before inline inspection the pipe state was rather good:

pof <- mepof(depth, length, rep(diameter, 4), rep(wall_thickness, 4),
             rep(UTS, 4), rep(operating_pressure, 4), rep(temperature, 4),
             rar, ral, method = "dnv", days = -2 * 365)
pipenostics::mepof: process case [4/4] - 100 % . All done, thanks!
print(pof)
[1] 0.000000 0.040849 0.072734 0.272358

For entire pipe we get something near:

print(max(pof))
[1] 0.272358

Regime tracing

Let's consider the next 4-segment tracing path:

Suppose we have the next sensor readings for forward tracing:

t_fw <- 130         # [°C]
p_fw <-   0.588399  # [MPa]
g_fw <- 250         # [ton/hour]

Let's discharges to network for each pipeline segment are somehow determined as

discharges <- seq(0, 30, 10)  # [ton/hour]
print(discharges)
[1]  0 10 20 30

Then the calculated regime (red squares) for forward tracing is

regime_fw <- m325traceline(t_fw, p_fw, g_fw, discharges, forward = TRUE)
print(regime_fw)
$temperature
[1] 129.1799 128.4269 127.9628 127.3367

$pressure
[1] 0.5878607 0.5874226 0.5872143 0.5870330

$flow_rate
[1] 250 240 220 190

ℹ Read article Concepts and useful notes for a deeper dive into the topic.

Copy Link

Version

Install

install.packages('pipenostics')

Monthly Downloads

191

Version

0.2.0

License

GPL-3

Maintainer

Yuri Possokhov

Last Published

April 4th, 2024

Functions in pipenostics (0.2.0)

b31gpf

ASME B31G. Failure pressure of the corroded pipe (original)
c_k

Convert to Celsius scale
dropg

Flow rate drop in pipe
b31gsap

ASME B31G. Safe maximum pressure for the corroded area of pipe
dnvpf

DNV-RP-F101. Failure pressure of the corroded pipe
dropp

Pressure drop in pipe
dropt

Temperature drop in cylindrical steel pipe due heat loss
loss_flux

Convert heat flux to specific heat loss power
m278insdata

Minenergo-278. Thermal conductivity terms of pipe insulation materials
m278hlund

Minenergo-278. Normative heat loss of underground pipe
fric_buzelli

Estimate pipe friction factor with Buzelli formula
f_k

Convert to Fahrenheit scale
flowls

List all possible flow paths in district heating network
geoarea

Calculate geographical metrics
inch_mm

Millimeters to inches
kgf_mpa

Megapascals to kilogram-force per square
k_c

Covert to Kelvin scale
m278hlair

Minenergo-278. Normative heat loss of open-air pipe
m278hlcha

Minenergo-278. Normative heat loss of pipe in channel
mepof

Probability of failure of the corroded pipe within maximum entropy
m325traceline

Minenergo-325. Trace thermal-hydraulic regime for linear segment of district heating network
fric_vatankhan

Estimate pipe friction factor with Vatankhah formula
m325nhl

Minenergo-325. Normative heat loss of pipe
fric_romeo

Estimate pipe friction factor with Romeo's formula
m325beta

Minenergo-325. Local heat loss coefficient
shell92pf

Shell92. Failure pressure of the corroded pipe
re_u

Estimate Reynolds number
pipenostics-package

pipenostics: Diagnostics, Reliability and Predictive Maintenance of Pipeline Systems
psi_mpa

Megapascals to pounds per square inch
mpa_kgf

Kilogram-force per square cm to megapascals
mm_inch

Inches to mm
tracefw

Massively trace forwards thermal-hydraulic regime for district heating network
m278inshcm

Minenergo-278. Thermal conductivity of pipe insulation materials
m278soildata

Minenergo-278. Thermal conductivity of subsoil surrounding pipe
traceline

Trace thermal-hydraulic regime for linear segment of district heating network
mpa_psi

Pounds per square inch to megapascals
m325testbench

Minenergo-325. Test bench of district heating network
wth_d

Derive the wall thickness depending on the outside diameter of pipe
pcorrcpf

PCORRC. Failure pressure of the corroded pipe
m325nhldata

Minenergo-325. Normative heat loss data
m325tracebw

Minenergo-325. Massively trace backwards thermal-hydraulic regime for district heating network
strderate

DNV-RP-F101. De-rate yield stress and tensile strength of pipe due to temperature
m325tracefw

Minenergo-325. Massively trace forwards thermal-hydraulic regime for district heating network
meteos

Get list of weather stations (meteos)
mgtdhid

Get ground temperature
tracebw

Massively trace backwards thermal-hydraulic regime for district heating network
b31gacl

ASME B31G. Allowable corrosion length in pipe
b31gacd

ASME B31G. Allowable corrosion depth in pipe
b31gdep

ASME B31G. Design pressure of pipe
b31gops

ASME B31G. Operational status of pipe
api5l3t

API 5L. Values of SMYS and UTS
b31gafr

ASME B31G. A-factor
b31gmodpf

ASME B31G. Failure pressure of the corroded pipe (modified)
b31crvl

ASME B31G. Basic computer program CRVL.BAS
b31gdata

ASME B31G. Corrosion state of 12 pipes