Giter VIP home page Giter VIP logo

pipenostics's Introduction

pipenostics

License: GPLv3 R-CMD-check pages-build-deployment pipenostics status badge CodeFactor codecov

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.

pipenostics's People

Contributors

omega1x avatar

pipenostics's Issues

Add m325tracebwm()

Add prototyped m325tracebwm() for backward tracing when there is a lack of temperature and pressure sensors on terminal nodes

Normative temperature loss

On the basis of tdrop and m325nhl create tdropn - normative temperature loss as a function of heat carrier

Reveal water-steam state properties

The next water-steam property calculations are used internally:

  • Specific isobaric heat capacity - according to IAPWS R7-97(2012)
  • Pressure on saturation curve - according to IAPWS R7-97(2012)
  • Specific volume - according to IAPWS R7-97(2012)
  • Dynamic viscosity - according to IAPWS R12-08

These calculations must be revealed as ordinary package functions.

Plug into `testthat`

Extract unit tests from Example sections of function docs to individual testthat tests.

Designate types in argument descriptions as in checkmate

Use the next notation for argument description as example:

x [any]
Object to check.

lower [numeric(1)]
Lower value all elements of x must be greater than or equal to.
finite [logical(1)]
Check for only finite values? Default is FALSE.

Add temperature scale convertes

In utils family add temperature scale converters:

From Kelvin scale:

  • c_k() - to Celsius
  • f_k() - to Fahrenheit
  • r_k() - to Rankine

From Celsius scale:

  • k_c() - to Kelvin
  • f_c() - to Fahrenheit
  • r_c() - to Rankine

From Fahrenheit scale:

  • k_f() - to Kelvin
  • c_f() - to Celsius
  • r_f() - to Rankine

From Rankine scale:

  • k_r() - to Kelvin
  • c_r() - to Celsius
  • f_r() - to Fahrenheit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.