Professional Corrosion Analysis Platform
Project description
โก CorroSim - Professional Corrosion Analysis Platform
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
โก Tafel Analysis
๐ Data Import
๐ฎ Lifetime Prediction
๐ Sample 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
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
- Click ๐ Import in the sidebar
- Browse and select your Excel/CSV file
- Click Load Preview to verify data
- Enter sample name and select test type
- Specify current units (or use Auto-detect)
- Click Import to Database
2. Tafel Analysis
- Navigate to โก Tafel tab
- Click Load Data to retrieve imported data
- Verify current units and electrode area
- Click โก Run Tafel Analysis
- View results: Ecorr, Icorr, Corrosion Rate, Tafel slopes
- Export plot as PNG or PDF
3. Lifetime Prediction
- Go to ๐ฎ Prediction tab
- Select degradation model (Linear/Power Law/Exponential)
- Set initial corrosion rate and failure threshold
- Set analysis period
- Click ๐ฎ Calculate Prediction
- View predicted lifetime and degradation curve
4. Compare Samples
- Open ๐ Compare tab
- Search and filter samples by name
- View all analysis results in sortable table
- Color-coded CR values: Green (low), Yellow (medium), Red (high)
- Export data to Excel
๐๏ธ Project Structure
corrosim/ โโโ corrosim/ # Main package โ โโโ init.py โ โโโ main.py # Entry point โ โโโ app.py # Main window โ โโโ theme.py # UI styling โ โโโ database.py # SQLite database โ โโโ tafel_engine.py # Analysis algorithms โ โโโ splash_screen.py # Splash screen โ โโโ tabs/ # Tab modules โ โ โโโ import_tab.py โ โ โโโ tafel_tab.py โ โ โโโ prediction_tab.py โ โ โโโ comparison_tab.py โ โโโ utils/ โ โโโ constants.py # Physical constants โโโ tests/ โ โโโ test_tafel.py # Validation tests โโโ screenshots/ # Application screenshots โโโ requirements.txt โโโ setup.py โโโ run.py โโโ README.md โโโ LICENSE โโโ .gitignore
๐ฌ 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add feature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Author
Khaled Oukil
- GitHub: @khadev
- Email: oukil.khaled@gmail.com
๐ References
- Stern, M., & Geary, A. L. (1957). Electrochemical Polarization. Journal of the Electrochemical Society, 104(1), 56-63.
- Tafel, J. (1905). รber die Polarisation bei kathodischer Wasserstoffentwicklung. Zeitschrift fรผr Physikalische Chemie, 50(1), 641-712.
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file corrosim-1.0.0.tar.gz.
File metadata
- Download URL: corrosim-1.0.0.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcc3f12dd3728aacb8b5d09438ba376404a862ca4ad830f162d3a48659d35ea6
|
|
| MD5 |
fb02a9ffd3e0adc89e49119b2f17a56f
|
|
| BLAKE2b-256 |
489c6d051e0805dcf48fffc3562a9e26164444798d477f8aa8eb51e9496ac144
|
File details
Details for the file corrosim-1.0.0-py3-none-any.whl.
File metadata
- Download URL: corrosim-1.0.0-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
074f1c56371715aa0c2be882ff9059089bff4a6540e403eb447175322584622e
|
|
| MD5 |
567054e32b0b7299c87efd1324bc0384
|
|
| BLAKE2b-256 |
4e96c021b006b45c4bccee55490e513c0335d6bf6961a78af4b7d8d4bad075c1
|