Imitation of CVRL.BAS computer program presented in ASME B31G-1991 Appendix A for determining allowable length and allowable operating pressure
Arguments
- maop
maximum allowable operating pressure - MAOP, [PSI]. Type:
assert_double
.- d
nominal outside diameter of pipe, [inch]. Type:
assert_double
.- wth
nominal wall thickness of pipe, [inch]. Type:
assert_double
.- smys
specified minimum yield of stress (SMYS) as a characteristics of steel strength, [PSI]. Type:
assert_double
.- def
appropriate (combined) design factor from ASME B31.4, ASME B31.8, or ASME B31.11, []. Type:
assert_double
.- depth
measured maximum depth of the corroded area, [inch]. Type:
assert_double
.- l
measured maximum longitudinal length of the corroded area, [inch]. Type:
assert_double
.
Value
Object of S3-class crvl which is a data.frame with the next numeric columns:
- maop
maximum allowable operating pressure - MAOP, [PSI]. Type:
assert_double
.- d
nominal outside diameter of pipe, [inch]. Type:
assert_double
.- wth
nominal wall thickness of pipe, [inch]. Type:
assert_double
.- smys
specified minimum yield of stress (SMYS) as a characteristics of steel strength, [PSI]. Type:
assert_double
.- def
appropriate (combined) design factor from ASME B31.4, ASME B31.8, or ASME B31.11, []. Type:
assert_double
.- depth
measured maximum depth of the corroded area, [inch]. Type:
assert_double
.- l
measured maximum longitudial length of corroded area, [inch]. Type:
assert_double
.- status
operational status of pipe: 1 - excellent, 2 - monitoring is recommended, 3 - alert! replace the pipe immediately! Type:
assert_numeric
.- design_pressure
design pressure of pipe, [PSI]. Type:
assert_double
.- safe_pressure
safe maximum pressure for the corroded area, [PSI]. Type:
assert_double
.- pressure_exceeding
whether operator's action is required to reduce MOAP lower than the maximum safe pressure of the corroded area. Type:
assert_logical
.- allowed_corrosion_depth
allowable depth of the corroded area, [inch]. Type:
assert_double
.- A
intermediate factor related to the geometry of the corroded area, []. Type:
assert_double
.- allowed_corrosion_length
allowable length of the corroded area, [inch]. Type:
assert_double
.- AP
another intermediate factor related to the geometry of the corroded area, []. Type:
assert_double
.
Details
Columns maop, d, wth, smys, def, depth, l in the output data.frame come from function's input, other columns are calculated.
For univariate case (when lengths of all input vectors are one) messages that imitate CRVL.BAS console output are printed.
References
ASME B31 G-1991. Manual for determining the remaining strength of corroded pipelines. A supplement to ASME B31G code for pressure piping.
Examples
library(pipenostics)
## Further examples are inspired by those used in Appendix A of
## ASME B31G-1991 to verify correct entry of CRVL.BAS source code:
## Standard example 1
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
## Standard example 2
b31crvl(
maop = 400, d = 20, wth = .25, smys = 35000, def = 0.5, depth = 0.18,
l = 10
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 3.993
#> Design pressure = 438 PSI; Safe pressure = 284 PSI
#> Reduce operating pressure so it will not exceed 284 PSI, and so operate legally and safely
#> With corrosion length 10.000 inch, maximum allowed corrosion depth is 0.0790 inch; A = 3.993
#> With corrosion depth 0.180 inch, maximum allowed corrosion length is 2.0180 inch; A = 0.806
## Standard example 3
b31crvl(
maop = 910, d = 24, wth = .432, smys = 52000, def = .72, depth = 0.13,
l = 30
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 8.320
#> Design pressure = 1348 PSI; Safe pressure = 1037 PSI
#> Pipe may be operated safely at MAOP, 910 PSI
#> With corrosion length 30.000 inch, maximum allowed corrosion depth is 0.1670 inch; A = 8.320
#> With corrosion depth 0.130 inch, maximum allowed corrosion length is Inf inch; A = 5.000
## Standard example 4
b31crvl(
maop = 910, d = 24, wth = .432, smys = 52000, def = .72, depth = .3,
l = 30
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 8.320
#> Design pressure = 1348 PSI; Safe pressure = 453 PSI
#> Reduce operating pressure so it will not exceed 453 PSI, and so operate legally and safely
#> With corrosion length 30.000 inch, maximum allowed corrosion depth is 0.1670 inch; A = 8.320
#> With corrosion depth 0.300 inch, maximum allowed corrosion length is 12.8670 inch; A = 3.568
## Standard example 5
b31crvl(
maop = 731, d = 24, wth = .281, smys = 52000, def = 0.72, depth = 0.08,
l = 15
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 5.158
#> Design pressure = 877 PSI; Safe pressure = 690 PSI
#> Reduce operating pressure so it will not exceed 690 PSI, and so operate legally and safely
#> With corrosion length 15.000 inch, maximum allowed corrosion depth is 0.0680 inch; A = 5.158
#> With corrosion depth 0.080 inch, maximum allowed corrosion length is 11.6340 inch; A = 4.000
## Standard example 6
b31crvl(
maop = 1e3, d = 36, wth = .5, smys = 52000, def = 0.72, depth = 0.41,
l = 100
)
#> Alert! Corrosion depth exceeds 80 % of pipe wall! Pipe must be replaced!
#> -- Calculated data --
#> Intermediate factor (A) = 21.048
#> Design pressure = 1040 PSI; Safe pressure = 206 PSI
#> Repair or replace pipe because corrosion depth exceeds 80 % of pipe wall!
#> Reduce operating pressure so it will not exceed 206 PSI, and so operate legally and safely
#> With corrosion length 100.000 inch, maximum allowed corrosion depth is 0.0630 inch; A = 21.048
#> With corrosion depth 0.410 inch, maximum allowed corrosion length is 2.5560 inch; A = 0.538
#> But 0.410 inch exceeds allowable corrosion depth!!!
## Standard example 8
b31crvl(
maop = 877, d = 12.625, wth = .5, smys = 35000, def = .4, depth = .035,
l = 3
)
#> Corrosion depth is less than 10 % of pipe wall. No resrictions on operation
#> -- Calculated data --
#> Intermediate factor (A) = 1.066
#> Design pressure = 1109 PSI; Safe pressure = 1109 PSI
#> Pipe may be operated safely at MAOP, 877 PSI
#> With corrosion length 3.000 inch, maximum allowed corrosion depth is 0.4000 inch; A = 1.066
#> With corrosion depth 0.035 inch, maximum allowed corrosion length is Inf inch; A = 5.000
## Standard example 9
b31crvl(
maop = 790, d = 24, wth = .5, smys = 42000, def = .5, depth = .125, l = 12
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 3.093
#> Design pressure = 875 PSI; Safe pressure = 845 PSI
#> Pipe may be operated safely at MAOP, 790 PSI
#> With corrosion length 12.000 inch, maximum allowed corrosion depth is 0.1790 inch; A = 3.093
#> With corrosion depth 0.125 inch, maximum allowed corrosion length is 15.5190 inch; A = 4.000
## TEST #1
b31crvl(
maop = 790, d = 24, wth = .5, smys = 42000, def = .5, depth = .179, l = 12
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 3.093
#> Design pressure = 875 PSI; Safe pressure = 791 PSI
#> Pipe may be operated safely at MAOP, 790 PSI
#> With corrosion length 12.000 inch, maximum allowed corrosion depth is 0.1790 inch; A = 3.093
#> With corrosion depth 0.179 inch, maximum allowed corrosion length is 12.1820 inch; A = 3.140
## TEST #1A
b31crvl(
maop = 790, d = 24, wth = .5, smys = 42000, def = .5, depth = .179,
l = 12.182
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 3.140
#> Design pressure = 875 PSI; Safe pressure = 790 PSI
#> Pipe may be operated safely at MAOP, 790 PSI
#> With corrosion length 12.182 inch, maximum allowed corrosion depth is 0.1780 inch; A = 3.140
#> With corrosion depth 0.179 inch, maximum allowed corrosion length is 12.1820 inch; A = 3.140
## TEST #1B
b31crvl(
maop = 790, d = 24, wth = .5, smys = 42000, def = .5, depth = .180,
l = 12.182
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 3.140
#> Design pressure = 875 PSI; Safe pressure = 789 PSI
#> Reduce operating pressure so it will not exceed 789 PSI, and so operate legally and safely
#> With corrosion length 12.182 inch, maximum allowed corrosion depth is 0.1780 inch; A = 3.140
#> With corrosion depth 0.180 inch, maximum allowed corrosion length is 11.9610 inch; A = 3.083
## TEST #2
b31crvl(
maop = 790, d = 24, wth = .5, smys = 42000, def = .5, depth = .179,
l = 12.297
)
#>
#> -- Calculated data --
#> Intermediate factor (A) = 3.170
#> Design pressure = 875 PSI; Safe pressure = 789 PSI
#> Reduce operating pressure so it will not exceed 789 PSI, and so operate legally and safely
#> With corrosion length 12.297 inch, maximum allowed corrosion depth is 0.1780 inch; A = 3.170
#> With corrosion depth 0.179 inch, maximum allowed corrosion length is 12.1820 inch; A = 3.140
## All examples at once:
data(b31gdata)
with(b31gdata, b31crvl(maop, d, wth, smys, def, depth, l))
#> maop d wth smys def depth l design_pressure status A
#> 1 910 30.000 0.438 52000 0.72 0.100 7.500 1093 2 1.847
#> 2 400 20.000 0.250 35000 0.50 0.180 10.000 438 2 3.993
#> 3 910 24.000 0.432 52000 0.72 0.130 30.000 1348 2 8.320
#> 4 910 24.000 0.432 52000 0.72 0.300 30.000 1348 2 8.320
#> 5 731 24.000 0.281 52000 0.72 0.080 15.000 877 2 5.158
#> 6 1000 36.000 0.500 52000 0.72 0.410 100.000 1040 3 21.048
#> 7 877 12.625 0.500 35000 0.40 0.035 3.000 1109 1 1.066
#> 8 790 24.000 0.500 42000 0.50 0.125 12.000 875 2 3.093
#> 9 790 24.000 0.500 42000 0.50 0.179 12.000 875 2 3.093
#> 10 790 24.000 0.500 42000 0.50 0.179 12.182 875 2 3.140
#> 11 790 24.000 0.500 42000 0.50 0.180 12.182 875 2 3.140
#> 12 790 24.000 0.500 42000 0.50 0.179 12.297 875 2 3.170
#> safe_pressure allowed_corrosion_length allowed_corrosion_depth
#> 1 1093 Inf 0.249
#> 2 284 2.018 0.079
#> 3 1037 Inf 0.167
#> 4 453 12.867 0.167
#> 5 690 11.634 0.068
#> 6 206 2.556 0.063
#> 7 1109 Inf 0.400
#> 8 845 15.519 0.179
#> 9 791 12.182 0.179
#> 10 790 12.182 0.178
#> 11 789 11.961 0.178
#> 12 789 12.182 0.178
#> pressure_exceeding AP
#> 1 FALSE 5.000
#> 2 TRUE 0.806
#> 3 FALSE 5.000
#> 4 TRUE 3.568
#> 5 TRUE 4.000
#> 6 TRUE 0.538
#> 7 FALSE 5.000
#> 8 FALSE 4.000
#> 9 FALSE 3.140
#> 10 FALSE 3.140
#> 11 TRUE 3.083
#> 12 TRUE 3.140