5.3.8.1. gemini_application.wims.co2_corrosion
CO2 corrosion analysis application with caliper log processing and model optimization.
Classes
Class for CO2 Corrosion application. |
- class gemini_application.wims.co2_corrosion.CO2CorrosionApplication[source]
Bases:
ApplicationAbstractClass for CO2 Corrosion application.
Initialize CO2 corrosion application.
- coarsen_timeseries_by_change_point(df1, df2, df3, value_col='value', pen=3, plot=False)[source]
Coarsen a time series by detecting segments where the values do not change much.
- Parameters:
df (pd.DataFrame) – DataFrame with a DateTime index.
value_col (str) – The column name containing the values to analyze.
pen (float or int) – Penalty parameter for the PELT change-point detection algorithm.
plot (bool) – If True, plot the original time series with detected change points.
- Returns:
- A DataFrame with columns [‘start_date’, ‘end_date’,
’mean_value’] for each segment.
- Return type:
pd.DataFrame
- get_corrosion_rate_from_logs()[source]
Compute measured corrosion based on log scenarios.
- Scenarios:
No logs => ‘calculation not possible’
1 log => compare that log to well tally ID at baseline date
2+ logs => compare each log to the previous one (chronologically)
- get_corrosion_rate_from_models_segmented()[source]
Compute modelled corrosion in multiple intervals.
Baseline date -> 1st log date
1st log date -> 2nd log date
2nd log date -> 3rd log date
etc.
For each interval, we:
Filter the flow/pressure/temp data to [start_date, end_date)
Compute partial corrosion with a pairwise approach
Convert the sum of partial corrosion to [mm/year] over that interval
Store in a new column in
self.outputs['modelledCorrosionRate']
- get_prod_data_validation()[source]
Read monthly production data from Excel file for validation purposes.
- get_remaining_days_to_min_thickness(min_remaining_thickness_mm)[source]
Compute remaining days until remaining thickness reaches the minimum.
Uses the latest (by date) corrosion rate and remaining thickness: - Latest corrosion rate: last interval in measuredCorrosionRate (chronologically). - Latest remaining thickness: last log date column in remainingThicknessAtLogDate.
Formula: days = (remaining_thickness_mm - min_remaining_thickness_mm) / (corrosion_rate_mm_per_year) * 365.25
Output: self.outputs[“remainingDaysToMinThickness”] DataFrame with columns Joint No. and “Remaining days to min. thickness [days]”.
- get_remaining_thickness_at_log_dates()[source]
Compute remaining wall thickness [mm] at each log date.
For each processed log (sorted by date), remaining thickness at that date is (OD - Max. ID) from well tally and log, converted to mm. Output: self.outputs[“remainingThicknessAtLogDate”] DataFrame with columns Joint No. and one column per log date: “Remaining thickness [mm] (YYYY-MM-DD)”.