In my research, I focused on the development of a specialized system for predicting shrinkage cavities and porosity in sand casting parts, combined with a knowledge-based defect analysis module. The system was built on a general-purpose finite element analysis platform, using a three-layer development architecture, and incorporating graphical operation, parametric design, and modular functionality. The ultimate goal was to provide a practical engineering tool for foundry engineers to optimize casting processes and improve the quality of sand casting parts.
1. Introduction and Background
The foundry industry plays a vital role in manufacturing, and the production of high-quality sand casting parts is a complex task involving numerous physical and chemical phenomena. Shrinkage cavities and porosity are among the most common and serious defects in castings, often leading to rejection of the final product. Traditional trial-and-error methods in foundry practice are time-consuming and costly. With the rapid development of computer technology, numerical simulation has become a powerful tool for predicting solidification behavior and defects in sand casting parts.
In this thesis, I systematically studied the mechanisms of shrinkage cavity and porosity formation, reviewed various prediction criteria, and proposed new implementation algorithms for the temperature gradient method and the Niyama criterion. I also designed a defect analysis subsystem based on expert system technology, which helps in identifying causes and suggesting remedial actions. The whole system was integrated with the ANSYS finite element software as the secondary development platform, using its parametric design language (APDL) and user interface design language (UIDL), together with external development tools such as Visual Basic and Microsoft Access database.
2. Theoretical Foundation of Solidification Temperature Field Simulation
The simulation of solidification temperature fields follows the first law of thermodynamics. For a closed system, the energy balance is given by:
$$ Q – W = \Delta U + \Delta KE + \Delta PE $$
For most heat transfer problems in casting, the kinetic and potential energy changes are neglected, and the work term is zero. The simplified energy balance is:
$$ Q = \Delta U $$
If the heat transfer rate is balanced, the analysis is steady-state; otherwise, it is transient. The transient heat conduction equation for a solidifying casting can be written as:
$$ \rho c \frac{\partial T}{\partial t} = \frac{\partial}{\partial x}\left(k_x \frac{\partial T}{\partial x}\right) + \frac{\partial}{\partial y}\left(k_y \frac{\partial T}{\partial y}\right) + \frac{\partial}{\partial z}\left(k_z \frac{\partial T}{\partial z}\right) + \dot{q}_L $$
where \(\rho\) is density, \(c\) is specific heat, \(T\) is temperature, \(t\) is time, \(k_x, k_y, k_z\) are thermal conductivities, and \(\dot{q}_L\) is the latent heat release rate per unit volume.
In addition to heat conduction, heat transfer in the casting–mold system includes convection and radiation. The governing equations for these modes are:
Conduction (Fourier’s law):
$$ q” = -k \frac{dT}{dx} $$
Convection (Newton’s law of cooling):
$$ q = h(T_s – T_\infty) $$
Radiation (Stefan–Boltzmann law):
$$ q = \varepsilon \sigma A (T_1^4 – T_2^4) $$
Since radiation introduces strong nonlinearity, it was simplified to equivalent convection in my system to improve computational efficiency.
2.1 Shrinkage Characteristics of Casting Alloys
Solidification shrinkage is a primary cause of defects in sand casting parts. The total volume change from liquid to solid consists of three stages: liquid shrinkage, solidification shrinkage, and solid shrinkage. The liquid shrinkage rate is:
$$ \varepsilon_{l} = \alpha_{l} (T_{pour} – T_{liq}) $$
where \(\alpha_{l}\) is the liquid shrinkage coefficient, \(T_{pour}\) is the pouring temperature, and \(T_{liq}\) is the liquidus temperature.
The solidification shrinkage rate depends on the volume change during phase transformation and the freezing range. The solid shrinkage rate is:
$$ \varepsilon_{s} = \alpha_{s} (T_{sol} – T_{room}) $$
2.2 Solid Fraction and Phase Change
In solid–liquid coexisting regions, the solid fraction \(f_s\) is a key parameter. For practical alloys, I proposed two distributions:
Linear distribution:
$$ f_s = \frac{T_{liq} – T}{T_{liq} – T_{sol}} $$
Parabolic distribution:
$$ f_s = \left( \frac{T_{liq} – T}{T_{liq} – T_{sol}} \right)^2 $$
These relationships were used in the defect prediction algorithms. The latent heat release was handled using the enthalpy method or equivalent specific heat method, depending on the freezing range of the alloy.
3. System Architecture and Function Design
The developed system consists of four main subsystems:
- Casting process CAD subsystem
- Solidification temperature field simulation subsystem
- Shrinkage porosity prediction subsystem
- Defect analysis subsystem
Figure 1 shows a schematic of the overall structure. The system was designed as a tree structure with modular components to facilitate maintenance and expansion.
The casting process CAD subsystem handles the design of castings, risers, mold, and gating system. It provides parametric design capabilities and access to material databases. The solidification simulation subsystem performs mesh generation, sets boundary conditions, and solves the transient heat conduction equation.
The defect prediction subsystem implements two main criteria: the temperature gradient method and the Niyama criterion. The defect analysis subsystem uses expert system techniques to identify defect causes and suggest preventive measures.

3.1 Temperature Gradient Method
The temperature gradient method is based on the principle that when the temperature gradient in the mushy zone is sufficiently high, the feeding channel remains open and the riser can compensate for shrinkage. When the gradient falls below a critical value, the feeding channel is cut off, leading to shrinkage defects. The critical temperature gradient is usually determined experimentally or by numerical calibration.
In my system, the temperature gradient is calculated at the moment when the solid fraction reaches a critical value \(f_{cr}\). The implementation algorithm is flexible: the user can analyze the entire load step history or a specific substep. The flow chart of the temperature gradient method is shown below in simplified form.
3.2 Niyama Criterion
The Niyama criterion, proposed by Niyama, defines a parameter \(G/\sqrt{R}\), where \(G\) is the temperature gradient and \(R\) is the cooling rate. This parameter is used to predict microporosity. When the value is less than a critical threshold, porosity is expected. The criterion is particularly effective for steel castings.
According to Niyama, the critical value is approximately \(1\,^\circ C^{1/2} s^{1/2} cm^{-1}\). However, Li Wenzhen and others found that the critical value depends on the casting size, ranging from \(0.8\) to \(1.5\) \(^\circ C^{1/2} s^{1/2} cm^{-1}\), with larger castings requiring larger values.
4. Development Principles and Technologies
4.1 Expert System Technology
The defect analysis subsystem was designed using expert system methodology. The key components include:
- Knowledge base: stores domain knowledge in the form of production rules
- Working memory: holds information about the specific case
- Inference engine: applies rules to derive conclusions
- Knowledge acquisition mechanism: allows adding or modifying rules
- Explanation mechanism: provides reasoning traces
- User interface: facilitates interaction
A typical production rule for identifying shrinkage cavities is:
IF the defect type is cavity AND the shape is irregular AND the walls are rough with dendrites AND located at hot spots AND large and concentrated THEN the defect is shrinkage cavity (confidence = 0.95).
4.2 Development Tools
The internal development tools are APDL and UIDL. APDL allows parametric design, looping, branching, and access to the ANSYS database. For example, a macro to create a three-dimensional solid body can be written using APDL commands. The UIDL is used to create custom menus, dialog boxes, and help files, providing a user-friendly interface for foundry engineers.
External development tools include Visual Basic and Microsoft Access. Visual Basic is used for database applications and to build the executable defect analysis program. Microsoft Access serves as the back-end database for storing defect knowledge and casting material data.
The system architecture follows a three-layer structure: application layer, tool layer, and system layer. This structure ensures good compatibility and openness.
5. Implementation of Shrinkage Porosity Prediction
5.1 Solidification Temperature Field Simulation
For the simulation of sand casting parts, the finite element model includes the casting, gating system, risers, sand mold, core, and chill. The material properties such as density, specific heat, thermal conductivity, and enthalpy are stored in databases. Initial and boundary conditions are set according to the actual casting process.
The transient thermal analysis is performed using ANSYS. The temperature field results are used to calculate temperature gradients and cooling rates at each node or element.
5.2 Defect Prediction Using Temperature Gradient Method
The procedure for the temperature gradient method is as follows:
- Read the temperature field results from all load steps or a selected load step.
- For each element, determine the time when the solid fraction reaches the critical value.
- Calculate the temperature gradient at that time.
- If the gradient is below the critical temperature gradient \(G_{cr}\), the element is marked as a defect element.
- Display the defect elements in the post-processing stage.

The input parameters include liquidus temperature, solidus temperature, critical solid fraction, and critical temperature gradient. A dialog box allows the user to enter these values. Validation checks prevent mis-entry of liquidus and solidus temperatures.
5.3 Defect Prediction Using Niyama Criterion
The Niyama method requires the temperature gradient \(G\) and cooling rate \(R\). The parameter is computed as:
$$ \frac{G}{\sqrt{R}} < \text{critical value} $$
If the value is below the threshold, the element is predicted to have shrinkage porosity. The implementation is similar to the temperature gradient method, with user inputs for the critical Niyama value.
6. Defect Analysis Subsystem
6.1 Classification of Casting Defects
Defects in sand casting parts are numerous and varied. The international standard classification system (from the International Atlas of Casting Defects) uses a four-level code: class, group, subgroup, and specific defect. For example, code A123 might represent a certain defect. I also proposed a classification based on physical fields, which correlates with the numerical simulation outputs.
6.2 Knowledge Representation and Inference
The defect analysis subsystem uses production rules to represent knowledge. Each rule has a confidence factor. The inference engine uses backward chaining to ask the user questions and classify the defect. Once the defect is identified, the system provides a list of possible causes organized by process steps such as pattern design, molding, core making, melting, pouring, and solidification.
The system also includes a knowledge base maintenance module that allows users to add, delete, or modify rules, thus continuously improving the system.
7. Case Study: High-Chromium Cast Iron Sand Casting Parts
To validate the developed system, I conducted a comprehensive case study on a high-chromium cast iron hammer head produced by sand casting. The casting is a rectangular block with an internal cavity, as shown in Figure 2 (not reproduced here). The original process used chills and a side riser to promote directional solidification. However, shrinkage defects were observed at the internal corners and thick sections.
7.1 Material Properties and Process Parameters
The high-chromium cast iron is a hypoeutectic alloy with the following chemical composition (wt%): C 2.5-3.0, Cr 15-20, Mn 0.5-1.0, Si 0.5-1.0, and traces of Mo, Cu, etc. The thermal properties used in the simulation are given in Table 1.
| Material | Density (kg/m³) | Specific heat (J/(kg·K)) | Thermal conductivity (W/(m·K)) | Enthalpy (J/m³) |
|---|---|---|---|---|
| Casting and gating system (high-Cr iron) | 7.6e3 | 540 | 32 | 1.2e9 |
| Chill (medium carbon steel) | 7.8e3 | 460 | 45 | — |
| Sand mold (green sand) | 1.6e3 | 840 | 0.8 | — |
| Core and ingate (resin sand) | 1.5e3 | 820 | 0.6 | — |
The initial temperature of the casting and gating system was set to 1450°C, based on experimental measurements. The mold initial temperature was 20°C. The heat transfer coefficient at the mold–air interface was approximated as 12 W/(m²·K), including radiation effects.
7.2 Simulation Results and Defect Prediction
Using the temperature gradient method, I first simulated the solidification of the original process. The temperature field and temperature gradient field were obtained. The predicted defect regions were compared with actual production statistics. The critical temperature gradient was determined by a forward method: adjusting the critical value until the predicted defect locations matched experimental observations. The calibrated critical temperature gradient was found to be 0.5°C/mm.
The Niyama criterion was also applied. However, the predicted results did not agree well with actual defects. This is because high-chromium cast iron solidifies with austenite and graphite precipitation, which affects shrinkage behavior differently than steel. Therefore, the Niyama criterion is not suitable for this alloy.
7.3 Process Optimization
Based on the analysis, the original riser was redesigned. The rectangular riser was replaced with a square riser of the same volume, which has a larger modulus. Additionally, padding was added on the two thick walls to enhance directional solidification. The optimized process was simulated again. Figure 3 should show the temperature field at 1500 s and 3000 s. The simulation showed that with the optimized design, no defect elements were detected in the shrinkage porosity prediction, indicating a significant improvement in the quality of the high-chromium cast iron sand casting parts.
| Design | Riser dimensions (mm) | Modulus (cm) | Padding thickness (mm) | Predicted defects |
|---|---|---|---|---|
| Original | Rectangular 150×120×100 | 2.1 | 0 | Yes |
| Optimized | Square 120×120×120 | 2.4 | 15 | No |
This case study demonstrates that the developed system can effectively predict shrinkage defects in sand casting parts and assist in process optimization. The temperature gradient method with the calibrated critical value proved to be robust for this type of casting, while the Niyama criterion had limitations for cast iron due to its unique solidification characteristics.
8. Conclusions and Future Work
In this thesis, I designed and implemented a shrinkage porosity prediction and defect analysis system for sand casting parts. The main conclusions can be summarized as follows:
- The overall system architecture and analysis flow were improved to integrate various subsystems for casting process design, solidification simulation, defect prediction, and defect analysis.
- The linear and parabolic solid fraction distributions were proposed for determining the relationship between temperature and solid fraction. The linear distribution was successfully applied in the prediction algorithms.
- Flexible implementation algorithms for the temperature gradient method and the Niyama criterion were developed. The algorithms allow user selection of the entire load step or a specific substep for analysis.
- A physical-field-based defect classification system and an inference flow were proposed. The defect analysis subsystem provides functions such as defect query, cause analysis, remedial suggestions, and knowledge base maintenance.
- For high-chromium cast iron sand casting parts, the critical temperature gradient was determined to be 0.5°C/mm using the forward method. This value serves as an important reference for future defect prediction.
- The Niyama criterion was found to be unsuitable for high-chromium cast iron because it does not account for the expansion effects of graphite precipitation during solidification.
Future work should focus on further improving the prediction criteria, incorporating more physical mechanisms such as fluid flow and stress, and enhancing the expert system with learning capabilities. Also, the integration with a wider range of casting processes and alloys will increase the practical value of the system.
I believe that the developed system provides a solid foundation for the digitalization and intelligentization of foundry production, particularly for the quality control of sand casting parts. With continuous improvements, it will become a more valuable tool for engineers in the casting industry.
