Skip to main content

Professional Corrosion Analysis Platform - Tafel, Galvanic, EIS, Pitting, Prediction & Comparison

Project description

โšก CorroSim - Professional Corrosion Analysis Platform

Python PyQt6 License Tests

A comprehensive desktop application for electrochemical corrosion analysis, featuring Tafel polarization fitting, lifetime prediction, and multi-sample comparison.

โœจ Features

๐Ÿ”ฌ Tafel Polarization Analysis

  • Automatic detection of current units (A, mA, ฮผA)
  • Proper Tafel region identification (80-200 mV from Ecorr)
  • Verified Butler-Volmer kinetics fitting
  • Real-time visualization with Matplotlib
  • Export plots as PNG or PDF

๐Ÿ”ฎ Lifetime Prediction

  • Linear, Power Law, and Exponential degradation models
  • Confidence band visualization
  • Service life estimation with threshold detection
  • Interactive parameter adjustment

๐Ÿ“Š Sample Comparison

  • Multi-sample database with SQLite storage
  • Search and filter functionality
  • Color-coded corrosion rate indicators
  • Export to Excel for further analysis

๐Ÿ“ Data Import

  • Support for Excel (.xlsx, .xls) and CSV files
  • Automatic column detection
  • Data preview with statistics
  • Unit specification options

๐ŸŽจ Professional UI

  • Modern, responsive interface with PyQt6
  • Custom splash screen with progress indicator
  • Consistent styling with professional color theme
  • Sidebar navigation with active state indicators

๐Ÿ“ธ Screenshots

๐Ÿ–ฅ๏ธ Main Application

Main Window

โšก Tafel Analysis

Tafel Analysis

๐Ÿ“ Data Import

Data Import

๐Ÿ”ฎ Lifetime Prediction

Prediction

๐Ÿ“Š Sample Comparison

Comparison

๐Ÿš€ Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager

Quick Install

Clone the repository

git clone https://github.com/khadev/corrosim.git cd corrosim

Install dependencies

pip install -r requirements.txt

Run the application

python run.py

Install as Package

pip install -e . corrosim PyPI version Downloads

Direct Install from GitHub

pip install git+https://github.com/khadev/corrosim.git corrosim

๐Ÿ“ฆ Dependencies

txt PyQt6>=6.5.0 matplotlib>=3.7.0 numpy>=1.24.0 pandas>=2.0.0 scipy>=1.10.0 openpyxl>=3.1.0

๐Ÿงช Running Tests

python tests/test_tafel.py

Expected output:

โœ“ Test data generation passed โœ“ All accuracy checks passed!

๐Ÿ“– Usage Guide

1. Import Data

  1. Click ๐Ÿ“ Import in the sidebar
  2. Browse and select your Excel/CSV file
  3. Click Load Preview to verify data
  4. Enter sample name and select test type
  5. Specify current units (or use Auto-detect)
  6. Click Import to Database

2. Tafel Analysis

  1. Navigate to โšก Tafel tab
  2. Click Load Data to retrieve imported data
  3. Verify current units and electrode area
  4. Click โšก Run Tafel Analysis
  5. View results: Ecorr, Icorr, Corrosion Rate, Tafel slopes
  6. Export plot as PNG or PDF

3. Lifetime Prediction

  1. Go to ๐Ÿ”ฎ Prediction tab
  2. Select degradation model (Linear/Power Law/Exponential)
  3. Set initial corrosion rate and failure threshold
  4. Set analysis period
  5. Click ๐Ÿ”ฎ Calculate Prediction
  6. View predicted lifetime and degradation curve

4. Compare Samples

  1. Open ๐Ÿ“Š Compare tab
  2. Search and filter samples by name
  3. View all analysis results in sortable table
  4. Color-coded CR values: Green (low), Yellow (medium), Red (high)
  5. Export data to Excel

๐Ÿ”— Galvanic Corrosion Simulator (NEW in v1.1.0)

  • 14 metals database from ASTM G82 galvanic series
  • Mixed potential theory calculations
  • Cathode/Anode area ratio effect
  • Real-time galvanic series bar chart
  • Severity classification per NACE SP0775
  • Engineering recommendations

๐Ÿ—๏ธ Project Structure

corrosim/
โ”œโ”€โ”€ corrosim/                    # Main package
โ”‚   โ”œโ”€โ”€ __init__.py              # Package initialization
โ”‚   โ”œโ”€โ”€ main.py                  # Application entry point
โ”‚   โ”œโ”€โ”€ app.py                   # Main window controller
โ”‚   โ”œโ”€โ”€ theme.py                 # UI styling and theme
โ”‚   โ”œโ”€โ”€ database.py              # SQLite database operations
โ”‚   โ”œโ”€โ”€ tafel_engine.py          # Tafel analysis algorithms
โ”‚   โ”œโ”€โ”€ splash_screen.py         # Splash screen widget
โ”‚   โ”œโ”€โ”€ engines/                 # Analysis engines (NEW in v1.1.0)
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ galvanic_engine.py   # Galvanic corrosion prediction
โ”‚   โ”œโ”€โ”€ tabs/                    # Tab modules
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ import_tab.py        # Data import interface
โ”‚   โ”‚   โ”œโ”€โ”€ tafel_tab.py         # Tafel analysis interface
โ”‚   โ”‚   โ”œโ”€โ”€ prediction_tab.py    # Lifetime prediction
โ”‚   โ”‚   โ”œโ”€โ”€ comparison_tab.py    # Sample comparison
โ”‚   โ”‚   โ””โ”€โ”€ galvanic_tab.py      # Galvanic simulator (NEW)
โ”‚   โ””โ”€โ”€ utils/                   # Utility modules
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ constants.py         # Physical constants
โ”œโ”€โ”€ tests/                       # Test suite
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ test_tafel.py            # Tafel engine validation
โ”œโ”€โ”€ screenshots/                 # Application screenshots
โ”œโ”€โ”€ dist/                        # Built packages (PyPI)
โ”œโ”€โ”€ requirements.txt             # Python dependencies
โ”œโ”€โ”€ setup.py                     # Package setup script
โ”œโ”€โ”€ run.py                       # Quick launcher
โ”œโ”€โ”€ README.md                    # Documentation
โ”œโ”€โ”€ LICENSE                      # MIT License
โ””โ”€โ”€ .gitignore                   # Git ignore rules

๐Ÿ”ฌ Algorithm Verification

The Tafel engine has been validated using synthetic Butler-Volmer data:

Parameter Expected Recovered Error
Ecorr -0.500 V -0.502 V 0.4%
Icorr 10.0 ฮผA/cmยฒ 9.5 ฮผA/cmยฒ 5.0%
ฮฒa 120 mV/dec 118.1 mV/dec 1.6%
ฮฒc 120 mV/dec 118.4 mV/dec 1.3%
Rยฒ โ€” 0.9997 โ€”

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add feature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ค Author

Khaled Oukil

๐Ÿ“š References

  1. Stern, M., & Geary, A. L. (1957). Electrochemical Polarization. Journal of the Electrochemical Society, 104(1), 56-63.
  2. Tafel, J. (1905). รœber die Polarisation bei kathodischer Wasserstoffentwicklung. Zeitschrift fรผr Physikalische Chemie, 50(1), 641-712.
  3. ASTM G102-89(2015) - Standard Practice for Calculation of Corrosion Rates from Electrochemical Measurements.

Built with โค๏ธ for the corrosion science community

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

corrosim-1.3.0.tar.gz (38.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

corrosim-1.3.0-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

Details for the file corrosim-1.3.0.tar.gz.

File metadata

  • Download URL: corrosim-1.3.0.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for corrosim-1.3.0.tar.gz
Algorithm Hash digest
SHA256 0921b50b55112d5306979e60c9432e7c04a681d095eb228388860508c83619e2
MD5 4a20131fc15f620051c63bf3a6825f79
BLAKE2b-256 a192e8a5d39a05d5292ff618e8a59cc7c3d16b663ed6240a3b5c157eedd63a95

See more details on using hashes here.

File details

Details for the file corrosim-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: corrosim-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 45.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for corrosim-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5355b331dfc182d6b2d46c00dfab9e27152505083283ee785435caf2eef1b12
MD5 841fcf0889bc219669a18da52cba3c96
BLAKE2b-256 e805625b7af056bb9d0d1856b4733c391423a0977c089825b8d4e57608f63a4a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page