This calculator determines the general corrosion rate of metals using the standard weight loss method (ASTM G1). By measuring the weight of a specimen before and after exposure to a corrosive environment, along with the specimen's surface area, density, and exposure time, we can calculate the average rate of material loss.
Common Material Densities
Use the following density values (g/cm³) for common engineering materials if the specific density is unknown:
Material
Density (g/cm³)
Carbon Steel
7.85
Stainless Steel (304/316)
7.90
Aluminum Alloys
2.70
Copper
8.96
Brass (Yellow)
8.47
Titanium
4.50
Zinc
7.13
Lead
11.35
Understanding the Formulas
The corrosion rate is calculated using the following formulas derived from Faraday's Law and standard unit conversions:
Imperial (mpy – mils per year):
$$CR = \frac{3.45 \times 10^6 \times (W_i – W_f)}{D \times A \times T}$$
Where:
Wi – Wf = Weight Loss in grams (g)
D = Density in grams per cubic centimeter (g/cm³)
A = Surface Area in square centimeters (cm²)
T = Time of exposure in hours (h)
Interpreting Results (mpy)
< 1 mpy: Outstanding corrosion resistance. Suitable for critical parts.
1 – 5 mpy: Good corrosion resistance. Acceptable for most equipment.
5 – 20 mpy: Fair resistance. Regular maintenance may be required.
> 20 mpy: Poor resistance. Material likely unsuitable for the environment.
function calculateCorrosionRate() {
// 1. Get input values
var initW = document.getElementById("initialWeight").value;
var finalW = document.getElementById("finalWeight").value;
var area = document.getElementById("surfaceArea").value;
var time = document.getElementById("exposureTime").value;
var density = document.getElementById("density").value;
// 2. Validate inputs
if (initW === "" || finalW === "" || area === "" || time === "" || density === "") {
alert("Please fill in all fields.");
return;
}
var iW = parseFloat(initW);
var fW = parseFloat(finalW);
var A = parseFloat(area);
var T = parseFloat(time);
var D = parseFloat(density);
if (isNaN(iW) || isNaN(fW) || isNaN(A) || isNaN(T) || isNaN(D)) {
alert("Please enter valid numbers.");
return;
}
if (A <= 0 || T <= 0 || D iW) {
alert("Final weight cannot be greater than Initial weight. This implies weight gain (e.g., plating or oxidation scale accumulation) rather than corrosion loss.");
return;
}
// 3. Calculate Weight Loss
var weightLoss = iW – fW; // in grams
// 4. Calculate Constants
// Constant K for mm/y when W is in grams, A in cm2, T in hours, D in g/cm3
// Standard formula usually uses W in mg, but we used grams input.
// Formula: (K * W) / (A * T * D)
// K standard for mm/y (W in g) = 87,600
// K standard for mpy (W in g) = 3,450,000 (approx 3.45 x 10^6)
var k_mmy = 87600;
var k_mpy = 3450000;
// 5. Compute Rates
var rateMmy = (k_mmy * weightLoss) / (D * A * T);
var rateMpy = (k_mpy * weightLoss) / (D * A * T);
// 6. Qualitative Assessment based on mpy
var assessment = "";
var color = "";
if (rateMpy < 1) {
assessment = "Outstanding Resistance";
color = "green";
} else if (rateMpy < 5) {
assessment = "Good Resistance";
color = "#8db600"; // yellow-green
} else if (rateMpy < 20) {
assessment = "Fair Resistance (Monitor Closely)";
color = "orange";
} else {
assessment = "Poor Resistance (High Corrosion)";
color = "red";
}
// 7. Update UI
document.getElementById("resWeightLoss").innerText = weightLoss.toFixed(4);
document.getElementById("resMmy").innerText = rateMmy.toFixed(4);
document.getElementById("resMpy").innerText = rateMpy.toFixed(2);
var catDiv = document.getElementById("categoryResult");
catDiv.innerText = "Assessment: " + assessment;
catDiv.style.color = color;
document.getElementById("corrosionResult").style.display = "block";
}