1. Pipeline Corrosion Model
1.1 Water Content in Gas
The water content in gas is calculated using the following empirical formula:
W = 10^((-2992.8055 + 336.78316 × log₁₀(P + 100)) / (T + 273) - 1.079865 × log₁₀(P) + 12.11165)
Where:
- W = Water content in gas (kg/m³)
- P = Pressure (bar)
- T = Temperature (°C)
1.2 pH Calculation
The pH is calculated iteratively using the charge balance equation:
[H⁺] = 2[Fe²⁺] + [H⁺] - [OH⁻] - [HCO₃⁻] - 2[CO₃²⁻] - [HS⁻] - 2[S²⁻] - [HAc] + [HCO₃⁻]ᵢₙᵢₜ
Where the equilibrium constants are temperature-dependent:
K_w = 10^(-pKw), K_d1CO2 = 10^(-pKd1CO2), K_d2CO2 = 10^(-pKd2CO2)
1.3 CO₂ Solubility
CO₂ fugacity is calculated as:
fCO₂ = CO₂% × P × exp((P - 1) × (B + 2D) / (R × T))
Where B and D are virial coefficients, and dissolved CO₂ is:
[CO₂] = fCO₂ / H(T)
Henry's constant H(T) is temperature-dependent.
1.4 H₂S Solubility
H₂S solubility follows similar principles:
[H₂S] = (H₂S% × P) / H_H₂S(T)
1.5 Glycol Concentration
When glycol is injected, the concentration at distance x is:
GlycConcAtX = (KgGlycol × 1000) / (Gas_MMsm3d × 1000000) × 100
Where:
- KgGlycol = Glycol injection rate (kg/MMsm³)
- Gas_MMsm3d = Gas production rate (MMsm³/d)
1.6 Flow Pattern Determination
Flow patterns are determined using the ECE4 method based on:
- Liquid velocity V_liq
- Gas velocity V_gas
- Liquid hold-up H_L
- Pipe diameter and angle
1.7 Corrosion Rate Calculation
The bottom-of-line corrosion rate is calculated as:
CR = F_scale × F_oil × F_h2s × F_glyc × F_inhib × CR_base
Where the base corrosion rate uses the IFE (Inhibited Film Effect) model:
CR_base = f(T, fCO₂, pH, [Fe²⁺], V_liq, d_pipe)
1.8 Top-of-Line Corrosion
Top-of-line corrosion considers condensation rate:
CR_TOL = CR_bottom × WetPerimeterFraction × CondensationRate
2. Pipeline Alloy Evaluator
2.1 Material Suitability Assessment
Materials are evaluated based on ECE rules and ISO 15156 standards:
Carbon Steel (CS)
T_max_CS = f(pCO₂, NaCl_concentration)
Suitability: Green if T < T_max_CS
Duplex 22Cr
T_max_22Cr = f(NaCl_concentration, pH₂S)
Additional constraints for ISO 15156 compliance.
Alloy 825
T_max_825 = f(pH₂S)
2.2 pH Calculation for Alloy Selection
pH at service temperature is calculated using the same iterative method as the corrosion model.
2.3 Sour Service Assessment
For sour service (H₂S > 0), materials must meet ISO 15156 requirements:
- pH₂S partial pressure limits
- Temperature constraints
- Chloride concentration limits
3. Pipeline Lifecycle Calculator
3.1 Capital Costs
Carbon Steel Pipeline
CS_Cost = π × (OD² - ID²) × Length × Material_Cost × 1000
Where ID = OD - 2 × Wall_Thickness
CRA Pipeline
CRA_Cost = π × (OD² - ID²) × Length × CRA_Material_Cost × 1000
3.2 Fabrication Costs
Fabrication costs depend on laying method:
- S-lay: Based on barge size and pipe diameter
- Reel-lay: Similar to S-lay with different rates
- Onshore: Based on welding rates and labor
3.3 Operating Costs
Inhibition Costs
Annual_Inhibitor_Cost = Chemical_Cost + Equipment_Cost + Labor_Cost
Inspection Costs
Annual_Inspection_Cost = Inspection_Cost_per_km × Length / Inspection_Interval
3.4 Present Value Calculation
PV = Amount / (1 + Discount_Rate)^Year
3.5 Lifecycle Cost Comparison
The model calculates total lifecycle costs for three scenarios:
- Carbon Steel: CS_Cost + Fabrication + Operating_Costs
- CRA: CRA_Cost + Fabrication + Operating_Costs
- Carbon Steel with Inhibition: CS_Cost + Fabrication + Inhibition_Costs
4. Derived Values and Outputs
4.1 Corrosion Model Outputs
| Parameter |
Formula/Description |
Units |
| Gas-to-Oil Ratio |
GOR = (Gas_MMsm3d × 35.3147 × 10⁶) / (Oil_m3d × 6.29) |
scf/bbl |
| Water Cut |
WC = Water_Rate / (Oil_Rate + Water_Rate) × 100 |
% |
| Outlet Gas Velocity |
V_gas = Gas_Rate / (π × d²/4 × P_out) |
m/s |
| Outlet Liquid Velocity |
V_liq = Liquid_Rate / (π × d²/4) |
m/s |
| Erosional Velocity |
V_erosional = C × √(ρ_liq/ρ_gas) |
m/s |
4.2 Risk Assessment
Risk of failure is calculated using:
Risk = ∫ f(corrosion_rate, wall_thickness, time) × Normal_Distribution(corrosion_rate, σ)
Where σ is the standard deviation of corrosion rate.
4.3 Material Selection Criteria
| Material |
Primary Criteria |
Secondary Criteria |
| Carbon Steel |
Temperature < T_max |
pH₂S < limit |
| Duplex 22Cr |
Temperature < T_max |
NaCl < limit |
| Alloy 825 |
Temperature < T_max |
pH₂S < limit |