corrosim 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- corrosim-1.0.0/LICENSE +21 -0
- corrosim-1.0.0/PKG-INFO +258 -0
- corrosim-1.0.0/README.md +223 -0
- corrosim-1.0.0/corrosim/__init__.py +19 -0
- corrosim-1.0.0/corrosim/app.py +206 -0
- corrosim-1.0.0/corrosim/database.py +85 -0
- corrosim-1.0.0/corrosim/main.py +37 -0
- corrosim-1.0.0/corrosim/splash_screen.py +234 -0
- corrosim-1.0.0/corrosim/tabs/__init__.py +8 -0
- corrosim-1.0.0/corrosim/tabs/comparison_tab.py +136 -0
- corrosim-1.0.0/corrosim/tabs/import_tab.py +225 -0
- corrosim-1.0.0/corrosim/tabs/prediction_tab.py +177 -0
- corrosim-1.0.0/corrosim/tabs/tafel_tab.py +249 -0
- corrosim-1.0.0/corrosim/tafel_engine.py +235 -0
- corrosim-1.0.0/corrosim/theme.py +151 -0
- corrosim-1.0.0/corrosim/utils/__init__.py +11 -0
- corrosim-1.0.0/corrosim/utils/constants.py +24 -0
- corrosim-1.0.0/corrosim.egg-info/PKG-INFO +258 -0
- corrosim-1.0.0/corrosim.egg-info/SOURCES.txt +25 -0
- corrosim-1.0.0/corrosim.egg-info/dependency_links.txt +1 -0
- corrosim-1.0.0/corrosim.egg-info/entry_points.txt +2 -0
- corrosim-1.0.0/corrosim.egg-info/requires.txt +6 -0
- corrosim-1.0.0/corrosim.egg-info/top_level.txt +2 -0
- corrosim-1.0.0/setup.cfg +4 -0
- corrosim-1.0.0/setup.py +46 -0
- corrosim-1.0.0/tests/__init__.py +0 -0
- corrosim-1.0.0/tests/test_tafel.py +74 -0
corrosim-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 khadev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
corrosim-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: corrosim
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Professional Corrosion Analysis Platform
|
|
5
|
+
Home-page: https://github.com/khadev/CorroSim
|
|
6
|
+
Author: Khaled Oukil
|
|
7
|
+
Author-email: oukil.khaled@gmail.com
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: PyQt6>=6.5.0
|
|
20
|
+
Requires-Dist: matplotlib>=3.7.0
|
|
21
|
+
Requires-Dist: numpy>=1.24.0
|
|
22
|
+
Requires-Dist: pandas>=2.0.0
|
|
23
|
+
Requires-Dist: scipy>=1.10.0
|
|
24
|
+
Requires-Dist: openpyxl>=3.1.0
|
|
25
|
+
Dynamic: author
|
|
26
|
+
Dynamic: author-email
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
Dynamic: requires-dist
|
|
33
|
+
Dynamic: requires-python
|
|
34
|
+
Dynamic: summary
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# โก CorroSim - Professional Corrosion Analysis Platform
|
|
38
|
+
|
|
39
|
+
[](https://www.python.org/)
|
|
40
|
+
[](https://www.riverbankcomputing.com/software/pyqt/)
|
|
41
|
+
[](LICENSE)
|
|
42
|
+
[](tests/)
|
|
43
|
+
|
|
44
|
+
A comprehensive desktop application for electrochemical corrosion analysis, featuring Tafel polarization fitting, lifetime prediction, and multi-sample comparison.
|
|
45
|
+
|
|
46
|
+
## โจ Features
|
|
47
|
+
|
|
48
|
+
### ๐ฌ Tafel Polarization Analysis
|
|
49
|
+
- Automatic detection of current units (A, mA, ฮผA)
|
|
50
|
+
- Proper Tafel region identification (80-200 mV from Ecorr)
|
|
51
|
+
- Verified Butler-Volmer kinetics fitting
|
|
52
|
+
- Real-time visualization with Matplotlib
|
|
53
|
+
- Export plots as PNG or PDF
|
|
54
|
+
|
|
55
|
+
### ๐ฎ Lifetime Prediction
|
|
56
|
+
- Linear, Power Law, and Exponential degradation models
|
|
57
|
+
- Confidence band visualization
|
|
58
|
+
- Service life estimation with threshold detection
|
|
59
|
+
- Interactive parameter adjustment
|
|
60
|
+
|
|
61
|
+
### ๐ Sample Comparison
|
|
62
|
+
- Multi-sample database with SQLite storage
|
|
63
|
+
- Search and filter functionality
|
|
64
|
+
- Color-coded corrosion rate indicators
|
|
65
|
+
- Export to Excel for further analysis
|
|
66
|
+
|
|
67
|
+
### ๐ Data Import
|
|
68
|
+
- Support for Excel (.xlsx, .xls) and CSV files
|
|
69
|
+
- Automatic column detection
|
|
70
|
+
- Data preview with statistics
|
|
71
|
+
- Unit specification options
|
|
72
|
+
|
|
73
|
+
### ๐จ Professional UI
|
|
74
|
+
- Modern, responsive interface with PyQt6
|
|
75
|
+
- Custom splash screen with progress indicator
|
|
76
|
+
- Consistent styling with professional color theme
|
|
77
|
+
- Sidebar navigation with active state indicators
|
|
78
|
+
|
|
79
|
+
## ๐ธ Screenshots
|
|
80
|
+
|
|
81
|
+
<div align="center">
|
|
82
|
+
|
|
83
|
+
### ๐ฅ๏ธ Main Application
|
|
84
|
+
<img src="screenshots/main_window.png" alt="Main Window" width="800"/>
|
|
85
|
+
|
|
86
|
+
### โก Tafel Analysis
|
|
87
|
+
<img src="screenshots/tafel_tab.png" alt="Tafel Analysis" width="800"/>
|
|
88
|
+
|
|
89
|
+
### ๐ Data Import
|
|
90
|
+
<img src="screenshots/import_tab.png" alt="Data Import" width="800"/>
|
|
91
|
+
|
|
92
|
+
### ๐ฎ Lifetime Prediction
|
|
93
|
+
<img src="screenshots/prediction_tab.png" alt="Prediction" width="800"/>
|
|
94
|
+
|
|
95
|
+
### ๐ Sample Comparison
|
|
96
|
+
<img src="screenshots/comparison_tab.png" alt="Comparison" width="800"/>
|
|
97
|
+
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
## ๐ Installation
|
|
101
|
+
|
|
102
|
+
### Prerequisites
|
|
103
|
+
- Python 3.8 or higher
|
|
104
|
+
- pip package manager
|
|
105
|
+
|
|
106
|
+
### Quick Install
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# Clone the repository
|
|
110
|
+
git clone https://github.com/khadev/corrosim.git
|
|
111
|
+
cd corrosim
|
|
112
|
+
|
|
113
|
+
# Install dependencies
|
|
114
|
+
pip install -r requirements.txt
|
|
115
|
+
|
|
116
|
+
# Run the application
|
|
117
|
+
python run.py
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Install as Package
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
pip install -e .
|
|
124
|
+
corrosim
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Direct Install from GitHub
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
pip install git+https://github.com/khadev/corrosim.git
|
|
131
|
+
corrosim
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## ๐ฆ Dependencies
|
|
135
|
+
|
|
136
|
+
txt
|
|
137
|
+
PyQt6>=6.5.0
|
|
138
|
+
matplotlib>=3.7.0
|
|
139
|
+
numpy>=1.24.0
|
|
140
|
+
pandas>=2.0.0
|
|
141
|
+
scipy>=1.10.0
|
|
142
|
+
openpyxl>=3.1.0
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## ๐งช Running Tests
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
python tests/test_tafel.py
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
Expected output:
|
|
152
|
+
|
|
153
|
+
โ Test data generation passed
|
|
154
|
+
โ All accuracy checks passed!
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
## ๐ Usage Guide
|
|
158
|
+
|
|
159
|
+
### 1. Import Data
|
|
160
|
+
1. Click **๐ Import** in the sidebar
|
|
161
|
+
2. Browse and select your Excel/CSV file
|
|
162
|
+
3. Click **Load Preview** to verify data
|
|
163
|
+
4. Enter sample name and select test type
|
|
164
|
+
5. Specify current units (or use Auto-detect)
|
|
165
|
+
6. Click **Import to Database**
|
|
166
|
+
|
|
167
|
+
### 2. Tafel Analysis
|
|
168
|
+
1. Navigate to **โก Tafel** tab
|
|
169
|
+
2. Click **Load Data** to retrieve imported data
|
|
170
|
+
3. Verify current units and electrode area
|
|
171
|
+
4. Click **โก Run Tafel Analysis**
|
|
172
|
+
5. View results: Ecorr, Icorr, Corrosion Rate, Tafel slopes
|
|
173
|
+
6. Export plot as PNG or PDF
|
|
174
|
+
|
|
175
|
+
### 3. Lifetime Prediction
|
|
176
|
+
1. Go to **๐ฎ Prediction** tab
|
|
177
|
+
2. Select degradation model (Linear/Power Law/Exponential)
|
|
178
|
+
3. Set initial corrosion rate and failure threshold
|
|
179
|
+
4. Set analysis period
|
|
180
|
+
5. Click **๐ฎ Calculate Prediction**
|
|
181
|
+
6. View predicted lifetime and degradation curve
|
|
182
|
+
|
|
183
|
+
### 4. Compare Samples
|
|
184
|
+
1. Open **๐ Compare** tab
|
|
185
|
+
2. Search and filter samples by name
|
|
186
|
+
3. View all analysis results in sortable table
|
|
187
|
+
4. Color-coded CR values: Green (low), Yellow (medium), Red (high)
|
|
188
|
+
5. Export data to Excel
|
|
189
|
+
|
|
190
|
+
## ๐๏ธ Project Structure
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
corrosim/
|
|
194
|
+
โโโ corrosim/ # Main package
|
|
195
|
+
โ โโโ __init__.py
|
|
196
|
+
โ โโโ main.py # Entry point
|
|
197
|
+
โ โโโ app.py # Main window
|
|
198
|
+
โ โโโ theme.py # UI styling
|
|
199
|
+
โ โโโ database.py # SQLite database
|
|
200
|
+
โ โโโ tafel_engine.py # Analysis algorithms
|
|
201
|
+
โ โโโ splash_screen.py # Splash screen
|
|
202
|
+
โ โโโ tabs/ # Tab modules
|
|
203
|
+
โ โ โโโ import_tab.py
|
|
204
|
+
โ โ โโโ tafel_tab.py
|
|
205
|
+
โ โ โโโ prediction_tab.py
|
|
206
|
+
โ โ โโโ comparison_tab.py
|
|
207
|
+
โ โโโ utils/
|
|
208
|
+
โ โโโ constants.py # Physical constants
|
|
209
|
+
โโโ tests/
|
|
210
|
+
โ โโโ test_tafel.py # Validation tests
|
|
211
|
+
โโโ screenshots/ # Application screenshots
|
|
212
|
+
โโโ requirements.txt
|
|
213
|
+
โโโ setup.py
|
|
214
|
+
โโโ run.py
|
|
215
|
+
โโโ README.md
|
|
216
|
+
โโโ LICENSE
|
|
217
|
+
โโโ .gitignore
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
## ๐ฌ Algorithm Verification
|
|
221
|
+
|
|
222
|
+
The Tafel engine has been validated using synthetic Butler-Volmer data:
|
|
223
|
+
|
|
224
|
+
| Parameter | Expected | Recovered | Error |
|
|
225
|
+
|-----------|----------|-----------|-------|
|
|
226
|
+
| Ecorr | -0.500 V | -0.502 V | 0.4% |
|
|
227
|
+
| Icorr | 10.0 ฮผA/cmยฒ | 9.5 ฮผA/cmยฒ | 5.0% |
|
|
228
|
+
| ฮฒa | 120 mV/dec | 118.1 mV/dec | 1.6% |
|
|
229
|
+
| ฮฒc | 120 mV/dec | 118.4 mV/dec | 1.3% |
|
|
230
|
+
| Rยฒ | โ | 0.9997 | โ |
|
|
231
|
+
|
|
232
|
+
## ๐ค Contributing
|
|
233
|
+
|
|
234
|
+
1. Fork the repository
|
|
235
|
+
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
|
|
236
|
+
3. Commit your changes (`git commit -m 'Add feature'`)
|
|
237
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
238
|
+
5. Open a Pull Request
|
|
239
|
+
|
|
240
|
+
## ๐ License
|
|
241
|
+
|
|
242
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
243
|
+
|
|
244
|
+
## ๐ค Author
|
|
245
|
+
|
|
246
|
+
**Khaled Oukil**
|
|
247
|
+
- GitHub: [@khadev](https://github.com/khadev)
|
|
248
|
+
- Email: oukil.khaled@gmail.com
|
|
249
|
+
|
|
250
|
+
## ๐ References
|
|
251
|
+
|
|
252
|
+
1. Stern, M., & Geary, A. L. (1957). Electrochemical Polarization. *Journal of the Electrochemical Society*, 104(1), 56-63.
|
|
253
|
+
2. Tafel, J. (1905). รber die Polarisation bei kathodischer Wasserstoffentwicklung. *Zeitschrift fรผr Physikalische Chemie*, 50(1), 641-712.
|
|
254
|
+
3. ASTM G102-89(2015) - Standard Practice for Calculation of Corrosion Rates from Electrochemical Measurements.
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
**Built with โค๏ธ for the corrosion science community**
|
corrosim-1.0.0/README.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
|
|
2
|
+
# โก CorroSim - Professional Corrosion Analysis Platform
|
|
3
|
+
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
[](https://www.riverbankcomputing.com/software/pyqt/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](tests/)
|
|
8
|
+
|
|
9
|
+
A comprehensive desktop application for electrochemical corrosion analysis, featuring Tafel polarization fitting, lifetime prediction, and multi-sample comparison.
|
|
10
|
+
|
|
11
|
+
## โจ Features
|
|
12
|
+
|
|
13
|
+
### ๐ฌ Tafel Polarization Analysis
|
|
14
|
+
- Automatic detection of current units (A, mA, ฮผA)
|
|
15
|
+
- Proper Tafel region identification (80-200 mV from Ecorr)
|
|
16
|
+
- Verified Butler-Volmer kinetics fitting
|
|
17
|
+
- Real-time visualization with Matplotlib
|
|
18
|
+
- Export plots as PNG or PDF
|
|
19
|
+
|
|
20
|
+
### ๐ฎ Lifetime Prediction
|
|
21
|
+
- Linear, Power Law, and Exponential degradation models
|
|
22
|
+
- Confidence band visualization
|
|
23
|
+
- Service life estimation with threshold detection
|
|
24
|
+
- Interactive parameter adjustment
|
|
25
|
+
|
|
26
|
+
### ๐ Sample Comparison
|
|
27
|
+
- Multi-sample database with SQLite storage
|
|
28
|
+
- Search and filter functionality
|
|
29
|
+
- Color-coded corrosion rate indicators
|
|
30
|
+
- Export to Excel for further analysis
|
|
31
|
+
|
|
32
|
+
### ๐ Data Import
|
|
33
|
+
- Support for Excel (.xlsx, .xls) and CSV files
|
|
34
|
+
- Automatic column detection
|
|
35
|
+
- Data preview with statistics
|
|
36
|
+
- Unit specification options
|
|
37
|
+
|
|
38
|
+
### ๐จ Professional UI
|
|
39
|
+
- Modern, responsive interface with PyQt6
|
|
40
|
+
- Custom splash screen with progress indicator
|
|
41
|
+
- Consistent styling with professional color theme
|
|
42
|
+
- Sidebar navigation with active state indicators
|
|
43
|
+
|
|
44
|
+
## ๐ธ Screenshots
|
|
45
|
+
|
|
46
|
+
<div align="center">
|
|
47
|
+
|
|
48
|
+
### ๐ฅ๏ธ Main Application
|
|
49
|
+
<img src="screenshots/main_window.png" alt="Main Window" width="800"/>
|
|
50
|
+
|
|
51
|
+
### โก Tafel Analysis
|
|
52
|
+
<img src="screenshots/tafel_tab.png" alt="Tafel Analysis" width="800"/>
|
|
53
|
+
|
|
54
|
+
### ๐ Data Import
|
|
55
|
+
<img src="screenshots/import_tab.png" alt="Data Import" width="800"/>
|
|
56
|
+
|
|
57
|
+
### ๐ฎ Lifetime Prediction
|
|
58
|
+
<img src="screenshots/prediction_tab.png" alt="Prediction" width="800"/>
|
|
59
|
+
|
|
60
|
+
### ๐ Sample Comparison
|
|
61
|
+
<img src="screenshots/comparison_tab.png" alt="Comparison" width="800"/>
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
## ๐ Installation
|
|
66
|
+
|
|
67
|
+
### Prerequisites
|
|
68
|
+
- Python 3.8 or higher
|
|
69
|
+
- pip package manager
|
|
70
|
+
|
|
71
|
+
### Quick Install
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# Clone the repository
|
|
75
|
+
git clone https://github.com/khadev/corrosim.git
|
|
76
|
+
cd corrosim
|
|
77
|
+
|
|
78
|
+
# Install dependencies
|
|
79
|
+
pip install -r requirements.txt
|
|
80
|
+
|
|
81
|
+
# Run the application
|
|
82
|
+
python run.py
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Install as Package
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
pip install -e .
|
|
89
|
+
corrosim
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
### Direct Install from GitHub
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
pip install git+https://github.com/khadev/corrosim.git
|
|
96
|
+
corrosim
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## ๐ฆ Dependencies
|
|
100
|
+
|
|
101
|
+
txt
|
|
102
|
+
PyQt6>=6.5.0
|
|
103
|
+
matplotlib>=3.7.0
|
|
104
|
+
numpy>=1.24.0
|
|
105
|
+
pandas>=2.0.0
|
|
106
|
+
scipy>=1.10.0
|
|
107
|
+
openpyxl>=3.1.0
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## ๐งช Running Tests
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
python tests/test_tafel.py
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
Expected output:
|
|
117
|
+
|
|
118
|
+
โ Test data generation passed
|
|
119
|
+
โ All accuracy checks passed!
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## ๐ Usage Guide
|
|
123
|
+
|
|
124
|
+
### 1. Import Data
|
|
125
|
+
1. Click **๐ Import** in the sidebar
|
|
126
|
+
2. Browse and select your Excel/CSV file
|
|
127
|
+
3. Click **Load Preview** to verify data
|
|
128
|
+
4. Enter sample name and select test type
|
|
129
|
+
5. Specify current units (or use Auto-detect)
|
|
130
|
+
6. Click **Import to Database**
|
|
131
|
+
|
|
132
|
+
### 2. Tafel Analysis
|
|
133
|
+
1. Navigate to **โก Tafel** tab
|
|
134
|
+
2. Click **Load Data** to retrieve imported data
|
|
135
|
+
3. Verify current units and electrode area
|
|
136
|
+
4. Click **โก Run Tafel Analysis**
|
|
137
|
+
5. View results: Ecorr, Icorr, Corrosion Rate, Tafel slopes
|
|
138
|
+
6. Export plot as PNG or PDF
|
|
139
|
+
|
|
140
|
+
### 3. Lifetime Prediction
|
|
141
|
+
1. Go to **๐ฎ Prediction** tab
|
|
142
|
+
2. Select degradation model (Linear/Power Law/Exponential)
|
|
143
|
+
3. Set initial corrosion rate and failure threshold
|
|
144
|
+
4. Set analysis period
|
|
145
|
+
5. Click **๐ฎ Calculate Prediction**
|
|
146
|
+
6. View predicted lifetime and degradation curve
|
|
147
|
+
|
|
148
|
+
### 4. Compare Samples
|
|
149
|
+
1. Open **๐ Compare** tab
|
|
150
|
+
2. Search and filter samples by name
|
|
151
|
+
3. View all analysis results in sortable table
|
|
152
|
+
4. Color-coded CR values: Green (low), Yellow (medium), Red (high)
|
|
153
|
+
5. Export data to Excel
|
|
154
|
+
|
|
155
|
+
## ๐๏ธ Project Structure
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
corrosim/
|
|
159
|
+
โโโ corrosim/ # Main package
|
|
160
|
+
โ โโโ __init__.py
|
|
161
|
+
โ โโโ main.py # Entry point
|
|
162
|
+
โ โโโ app.py # Main window
|
|
163
|
+
โ โโโ theme.py # UI styling
|
|
164
|
+
โ โโโ database.py # SQLite database
|
|
165
|
+
โ โโโ tafel_engine.py # Analysis algorithms
|
|
166
|
+
โ โโโ splash_screen.py # Splash screen
|
|
167
|
+
โ โโโ tabs/ # Tab modules
|
|
168
|
+
โ โ โโโ import_tab.py
|
|
169
|
+
โ โ โโโ tafel_tab.py
|
|
170
|
+
โ โ โโโ prediction_tab.py
|
|
171
|
+
โ โ โโโ comparison_tab.py
|
|
172
|
+
โ โโโ utils/
|
|
173
|
+
โ โโโ constants.py # Physical constants
|
|
174
|
+
โโโ tests/
|
|
175
|
+
โ โโโ test_tafel.py # Validation tests
|
|
176
|
+
โโโ screenshots/ # Application screenshots
|
|
177
|
+
โโโ requirements.txt
|
|
178
|
+
โโโ setup.py
|
|
179
|
+
โโโ run.py
|
|
180
|
+
โโโ README.md
|
|
181
|
+
โโโ LICENSE
|
|
182
|
+
โโโ .gitignore
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## ๐ฌ Algorithm Verification
|
|
186
|
+
|
|
187
|
+
The Tafel engine has been validated using synthetic Butler-Volmer data:
|
|
188
|
+
|
|
189
|
+
| Parameter | Expected | Recovered | Error |
|
|
190
|
+
|-----------|----------|-----------|-------|
|
|
191
|
+
| Ecorr | -0.500 V | -0.502 V | 0.4% |
|
|
192
|
+
| Icorr | 10.0 ฮผA/cmยฒ | 9.5 ฮผA/cmยฒ | 5.0% |
|
|
193
|
+
| ฮฒa | 120 mV/dec | 118.1 mV/dec | 1.6% |
|
|
194
|
+
| ฮฒc | 120 mV/dec | 118.4 mV/dec | 1.3% |
|
|
195
|
+
| Rยฒ | โ | 0.9997 | โ |
|
|
196
|
+
|
|
197
|
+
## ๐ค Contributing
|
|
198
|
+
|
|
199
|
+
1. Fork the repository
|
|
200
|
+
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
|
|
201
|
+
3. Commit your changes (`git commit -m 'Add feature'`)
|
|
202
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
203
|
+
5. Open a Pull Request
|
|
204
|
+
|
|
205
|
+
## ๐ License
|
|
206
|
+
|
|
207
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
208
|
+
|
|
209
|
+
## ๐ค Author
|
|
210
|
+
|
|
211
|
+
**Khaled Oukil**
|
|
212
|
+
- GitHub: [@khadev](https://github.com/khadev)
|
|
213
|
+
- Email: oukil.khaled@gmail.com
|
|
214
|
+
|
|
215
|
+
## ๐ References
|
|
216
|
+
|
|
217
|
+
1. Stern, M., & Geary, A. L. (1957). Electrochemical Polarization. *Journal of the Electrochemical Society*, 104(1), 56-63.
|
|
218
|
+
2. Tafel, J. (1905). รber die Polarisation bei kathodischer Wasserstoffentwicklung. *Zeitschrift fรผr Physikalische Chemie*, 50(1), 641-712.
|
|
219
|
+
3. ASTM G102-89(2015) - Standard Practice for Calculation of Corrosion Rates from Electrochemical Measurements.
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
**Built with โค๏ธ for the corrosion science community**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CorroSim - Professional Corrosion Analysis Platform
|
|
3
|
+
|
|
4
|
+
A comprehensive tool for electrochemical corrosion analysis including:
|
|
5
|
+
- Tafel polarization analysis
|
|
6
|
+
- Lifetime prediction
|
|
7
|
+
- Multi-sample comparison
|
|
8
|
+
- Data import/export
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__version__ = "1.0.0"
|
|
12
|
+
__author__ = "Your Name"
|
|
13
|
+
__description__ = "Professional Corrosion Analysis Platform"
|
|
14
|
+
|
|
15
|
+
from .tafel_engine import TafelEngine
|
|
16
|
+
from .database import Database
|
|
17
|
+
from .theme import Theme
|
|
18
|
+
|
|
19
|
+
__all__ = ['TafelEngine', 'Database', 'Theme']
|