AI for Casting & Foundry Optimization
Defect Prediction, Simulation Surrogates, and SME Foundry Challenges
Defect Prediction from Process Parameters
Casting defects — shrinkage porosity, gas porosity, hot tears, cold shuts, misruns, sand inclusions — are the bane of every foundry. Rejection rates of 5-15% are common in Indian foundries, and for complex geometries (automotive manifolds, hydraulic valve bodies, pump impellers), rates can reach 25-30%. Each rejected casting wastes metal, energy, moulding sand, and furnace time.
The traditional approach: Methoding engineers use experience and empirical rules (modulus method for riser design, gating ratios from AFS guidelines, pouring temperature from metal fluidity tests). When defects occur, they adjust parameters iteratively — raise pouring temperature, change gating, modify risering. This trial-and-error cycle takes weeks and wastes dozens of castings.
Open data/casting-process-data.csv in the code panel. Each row represents a production casting with: alloy grade, pouring temperature, pouring time, gating ratio (sprue:runner:ingate), riser dimensions, mould type (green sand, no-bake, shell), sand properties (GCS, moisture, permeability), and the resulting quality (defect type, defect location, severity, accept/reject).
Building a Defect Prediction Model
Features:
alloy: grade, C%, Si%, Mn%, CE (carbon equivalent), liquidus_temp
process: pouring_temp, pouring_time, superheat, gating_ratio
riser: riser_modulus, riser_neck_ratio, number_of_risers
mould: mould_type, GCS, moisture%, permeability, mould_hardness
geometry: casting_weight, section_modulus_max, section_modulus_min,
modulus_ratio (max/min), volume_surface_area_ratio
Targets:
defect_probability (0-1)
defect_type (shrinkage, gas, hot_tear, cold_shut, sand_inclusion, none)
defect_location (cope, drag, junction, thin_section, riser_junction)
Model: XGBoost multi-output classifierThe most important predictive features, ranked by SHAP importance:
| Rank | Feature | Why It Matters |
|---|---|---|
| 1 | **Superheat** (pouring temp - liquidus) | Too high → gas pickup, metal penetration. Too low → cold shuts, misrun |
| 2 | **Section modulus ratio** (max/min) | High ratio → isolated heavy sections → shrinkage |
| 3 | Riser modulus / casting modulus | Must be > 1.2 for directional solidification. Below → the casting feeds the riser |
| 4 | Sand moisture | Excess moisture → steam generation → gas porosity |
| 5 | Gating ratio | Pressurized vs unpressurized systems affect turbulence and air aspiration |
Practical Application
At a Belgaum SG iron foundry producing automotive flywheel housings (15 kg, 400 castings/day), a defect prediction model trained on 6 months of production data (72,000 castings) reduced shrinkage rejection from 8.2% to 3.1%. The key finding: the model identified that sand moisture above 3.8% in combination with superheat above 80°C created gas-assisted shrinkage porosity that methoding engineers had been attributing to risering inadequacy. The fix was process control (tighter sand moisture monitoring), not design change (more risers).
Casting Simulation Surrogates
Full casting simulation (ProCAST, MAGMA, SOLIDCast) solves Navier-Stokes for mould filling, Fourier's equation for solidification, and Niyama criteria for shrinkage prediction. A single simulation takes 4-24 hours depending on mesh resolution and geometry complexity. For a foundry that needs to quote 20 new parts per week, running full simulations on each is impractical.
Open data/simulation-parameters.json — it contains input-output pairs from MAGMA simulations: casting geometry descriptors, process parameters, and simulation results (fill time, last point to solidify, hot spot locations, Niyama criterion values, shrinkage volume).
Training a Surrogate
A surrogate model learns the mapping from geometry + process parameters to simulation outputs, without solving PDEs:
Training data: 2,000 MAGMA simulation runs (varied geometries and parameters)
Geometry encoding: voxelized 64×64×64 occupancy grid
Process features: pouring_temp, pouring_time, mould_type, HTC_values
Targets: hot_spot_locations (3D coordinates), shrinkage_volume (cm³),
Niyama_min, fill_completeness (%)
Architecture: 3D-CNN on voxel grid + MLP on process features → concatenated → output headsThe surrogate runs in < 1 second vs 8+ hours for full simulation. Accuracy is ±15% on shrinkage volume prediction — not good enough to replace simulation for final validation, but excellent for:
Indian Foundry Context
Most Indian foundries (especially SMEs in Belgaum, Coimbatore, and Rajkot clusters) do not own simulation software — licenses cost ₹15-40 lakh/year. A cloud-based surrogate service, trained on simulations run centrally, could democratize casting simulation for the SME sector. The foundry uploads a 3D model and process parameters, gets hot spot predictions and risering suggestions in minutes.
Indian Foundry Clusters: SME Challenges
Open data/defect-analysis.json — it contains defect investigation reports from multiple foundries with root cause analysis.
Belgaum (SG Iron & Grey Iron)
Belgaum is India's foundry capital — 300+ foundries producing SG iron and grey iron castings for automotive, pump, and valve applications. Key AI opportunities:
Coimbatore (Pump & Valve Castings)
Coimbatore foundries produce complex pump impellers and valve bodies in grey iron, SG iron, and stainless steel. The challenge here is thin-section integrity — impeller vanes at 4-6mm thickness are prone to cold shuts and misruns.
AI contribution: predicting fluidity index from composition and pouring conditions, and recommending minimum pouring temperature for a given section thickness. This replaces the conservative approach of pouring 30-40°C above necessary — which wastes energy and increases gas defects.
Rajkot (Diesel Engine Components)
Rajkot foundries supply diesel engine blocks and heads — complex grey iron castings with tight porosity specifications (CT Level 2 or better per ASTM E446). AI-based radiographic image analysis automates shrinkage classification, replacing manual comparison with reference radiographs.
Input: digitized radiograph (DR panel, 16-bit greyscale)
Model: U-Net segmentation for indication detection +
classifier for ASTM E446 severity level
Output: indication_locations, severity_level (1-5), accept/reject per customer spec
Accuracy: 96% agreement with ASNT Level III radiographerProcess Control for Foundries
Spectrometer Data Integration
Modern foundries have OES (Optical Emission Spectrometry) for composition analysis, but the data often sits in isolated spectrometer software. AI integration pulls spectrometer results into the production system and:
Thermal Analysis Integration
Cooling curve thermal analysis (ATAS, QuiK-Cup) provides pre-pour quality indicators: liquidus arrest, eutectic undercooling (for grey/SG iron), and carbide risk. AI models correlate thermal analysis parameters with as-cast microstructure and properties — predicting graphite morphology (Type A vs D vs E in grey iron), carbide tendency, and nodule count in SG iron before the casting solidifies.
Key Takeaways
This is chapter 4 of AI for Metallurgy & Materials.
Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.
View course details