Pipeline integrity calculation
Project description
PipelineIntegrity library
Free, open source PipelineIntegrity library designed to calculate the degree of danger of pipeline metal loss defects according to the ASME B31G method.
Installation
pip install pipeline-integrity
Usage
A pipe under pressure, with a length, diameter and wall thickness from specified material.
from pipeline_integrity.material import Material
from pipeline_integrity.pipe import Pipe
pipe = Pipe(
440, # length, inches
56, # diameter, inches
0.63, # wall thickness, inches
Material( # pipe material
"Steel",
52000 # SMYS, psi
),
900 # pressure, psi
)
)
Metal loss defect with a specified position on the pipe and a specified depth.
defect = pipe.add_metal_loss(
40, # the defect starts at a distance of 40 inches from the beginning of the pipe
4, # defect length 4 inches
10, # along the circumference of the pipe, the defect begins
# at 10 arc minutes from the top of the pipe
20, # the size of the defect along the circumference is 20 arc minutes
0.039 # defect depth 0.039 inches
)
Context for calculating the degree of severity of the defect according to the ASME B31G method
from pipeline_integrity.method.asme_b31g import Context
asme = Context(defect)
Defect depth less than 10% wall thickness, no danger.
from pipeline_integrity.method.asme_b31g import State
assert asme.pipe_state() == State.Ok
The depth of the defect is more than 80% of the pipe wall thickness, repair or replacement of the pipe is necessary.
defect.depth = 0.6
assert asme.pipe_state() == State.Replace
The depth of the defect is 50% of the pipe wall thickness, but the length of the defect does not exceed its maximum allowable length. The defect is not dangerous.
defect.depth = 0.31
assert asme.pipe_state() == State.Safe
A defect with a length of 20 inches and a depth of 50% of the pipe wall thickness requires repair at the specified working pressure in the pipe.
defect.length = 20
assert asme.pipe_state() == State.Repair
When the operating pressure is reduced to a safe value, the defect does not require repair.
assert pipe.maop == 900
assert round(asme.safe_pressure, 2) == 700.68
pipe.maop = 700
assert asme.pipe_state() == State.Defected
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pipeline_integrity-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d971ce53105767945d5f9f89118e22e6722638e9fb6b5026761d087264d3c00c |
|
MD5 | 5cc5c80836a9e2642617a741406f83a4 |
|
BLAKE2b-256 | 8230db30c748e43e123c3c7d86b44fb388b757a606337a1fad5f8764d368466a |