A Machine Learning-Driven Framework for Simulating Dynamic Solidification Shrinkage in Casting Parts

The solidification process of metallic alloys is a critical phase in manufacturing, fundamentally determining the final quality, mechanical integrity, and performance of the resulting casting part. Among the various phenomena occurring during solidification, volumetric shrinkage stands out as a primary source of defects such as shrinkage cavities and porosity. This contraction is an inherent physical consequence of the phase transformation from liquid to solid, coupled with thermal contraction as the temperature drops. When this volumetric reduction is not adequately compensated by the inflow of liquid metal from residual molten pools or feeding systems, voids form within the casting part. These defects act as stress concentrators, significantly degrading mechanical properties like tensile strength and fatigue resistance, ultimately compromising the component’s service life and reliability in demanding applications.

Traditionally, predicting and mitigating these defects has relied heavily on empirical knowledge, trial-and-error methodologies in foundries, and various numerical simulation techniques. Early numerical approaches, including the temperature gradient method and the widely used Niyama criterion, provided valuable insights but were often limited by their empirical nature, material-specific parameters, or idealized assumptions about the solidification process. More advanced models, such as those based on Darcy’s law for flow in the mushy zone or fully coupled thermal-fluid-solid models, offer improved accuracy. However, they frequently come at the cost of prohibitive computational complexity, significant parameter sensitivity, and long solution times, especially for industrially relevant, geometrically complex casting parts.

This persistent challenge motivates the exploration of novel computational paradigms. In recent years, the integration of machine learning (ML) techniques into computational physics and engineering simulation has emerged as a transformative avenue. ML algorithms excel at identifying complex, non-linear patterns within high-dimensional data, offering the potential to build surrogate models, optimize processes, and even enhance core simulation mechanics. This work presents a pioneering framework that leverages machine learning, specifically within a dynamic mesh (arbitrary Lagrangian-Eulerian) context, to directly simulate the dynamic, evolving shrinkage behavior during the solidification of a casting part. The core innovation lies in using ML not merely for post-processing analysis but as an integral engine for calculating mesh deformation in real-time, enabling a high-fidelity representation of the moving boundaries and internal distortions caused by solidification shrinkage.

1. Introduction and Motivation

The quest for high-integrity casting parts free from shrinkage defects has been a central theme in foundry science for decades. Shrinkage cavities and porosity formation is a multiscale, multiphysics problem involving intricate couplings between heat transfer, solute redistribution, fluid flow in the mushy zone, and the mechanics of a deforming solid network. Numerical simulation has long been heralded as a tool to virtualize this process, allowing for the prediction of defect locations and the optimization of gating and riser systems before any metal is poured.

Classical simulation approaches for shrinkage prediction can be broadly categorized. Criteria-based methods, like the Niyama criterion, use local thermal parameters (cooling rate and temperature gradient) to indicate regions prone to porosity. While useful for steel castings, their generality across different alloys and geometries can be limited. Mass continuity methods track the volume deficit caused by solidification shrinkage and attempt to model the feeding flow. The most physically comprehensive are the fully coupled models that solve conservation equations for mass, momentum, energy, and species simultaneously, often incorporating a porous media approach (Darcy’s law) for the mushy zone. These models, while accurate, are computationally intensive and their convergence can be highly sensitive to the numerous material and interfacial parameters required.

Several key limitations persist in state-of-the-art simulations for a casting part:

  1. Computational Cost: High-fidelity, fully coupled multiphysics simulations remain prohibitively expensive for rapid iterative design or the simulation of large, complex components.
  2. Parameter Sensitivity: Predictions often depend critically on parameters that are difficult to measure precisely at processing conditions, such as interfacial heat transfer coefficients, dendritic permeability, and shrinkage coefficients.
  3. Dynamic Geometry Handling: Accurately capturing the large deformation of the free surface (the formation of the shrinkage pipe) and the internal rearrangement of material points is challenging for traditional Eulerian (fixed-grid) or simple Lagrangian methods. Remeshing techniques can be computationally costly and introduce errors.

This work addresses these challenges by proposing a hybrid methodology. We combine a well-established microscopic/mesoscopic solidification model—Cellular Automaton (CA) coupled with the Lattice Boltzmann Method (LBM)—with a dynamic mesh technique whose core displacement solver is powered by machine learning algorithms. The CA-LBM model handles the evolution of the solid-liquid interface, temperature, and solute fields. The dynamic mesh component, driven by either Radial Basis Function (RBF) networks or Support Vector Machines (SVM), calculates the displacement of every node in the domain based on the localized shrinkage computed from the physics model. This approach aims to decouple the complex geometric deformation problem from the multiphysics solution, delegating the former to efficient, data-driven ML interpolators. The result is a simulation capable of dynamically visualizing the sinking of the free surface and the internal distortion of the casting part with high computational efficiency and robust handling of the moving boundaries.

2. Theoretical and Computational Framework

The proposed framework rests on two pillars: a physics-based model for solidification and a machine learning-based model for mesh deformation. They operate in a staggered but coupled manner during the simulation.

2.1 Physics Model: CA-LBM for Solidification

To simulate the solidification process of the casting part, we employ a coupled Cellular Automaton and Lattice Boltzmann Method. This approach is particularly effective for capturing detailed dendritic morphology and microsegregation. The domain is discretized into uniform cells, each representing a small volume of material. Each cell \( i \) has associated state variables: temperature \( T_i \), solute concentration \( C_i \), solid fraction \( f_s^i \), and a state identifier (liquid, interface, solid).

The LBM solves for the transport phenomena using discrete distribution functions. We use a multi-distribution function (MDF) approach based on the Boussinesq approximation:

  • Flow Field: Solved using a density distribution function \( f_i(\mathbf{x}, t) \).
  • Temperature Field: Solved using a thermal distribution function \( g_i(\mathbf{x}, t) \).
  • Solute Field: Solved using a concentration distribution function \( h_i(\mathbf{x}, t) \).

The general evolution equation with a phase-dependent treatment for the solidifying interface cells is:
$$ \phi_i(\mathbf{x} + \mathbf{e}_i \Delta t, t + \Delta t) = [1 – f_s(\mathbf{x}, t+\Delta t)] \cdot \left\{ \phi_i(\mathbf{x}, t) + \frac{1}{\tau_\phi} [\phi_i^{eq}(\mathbf{x}, t) – \phi_i(\mathbf{x}, t)] + S_\phi \right\} + f_s(\mathbf{x}, t+\Delta t) \cdot \phi_{inv(i)}(\mathbf{x} + \mathbf{e}_i \Delta t, t) $$
where \( \phi \) represents \( f, g, \) or \( h \); \( \tau_\phi \) is the relaxation time; \( \phi_i^{eq} \) is the equilibrium distribution function; \( \mathbf{e}_i \) are the discrete lattice velocities (D2Q9 model); \( f_s \) is the solid fraction; and \( inv(i) \) denotes the opposite direction of \( i \). The source term \( S_\phi \) incorporates buoyancy forces (for flow) and latent heat release (for temperature).

The CA model governs the growth of the solid phase. The growth velocity of the interface cell is determined by the local kinetics, typically using the KGT model:
$$ v_n = \mu \cdot \Delta T^n $$
where \( \mu \) is the kinetic coefficient, \( \Delta T \) is the local undercooling (sum of constitutional, thermal, and curvature undercooling), and \( n \) is an exponent. The increase in solid fraction \( \Delta f_s \) for an interface cell in a time step \( \Delta t \) is then:
$$ \Delta f_s = \frac{A_{int} \cdot v_n \cdot \Delta t}{V_{cell}} $$
where \( A_{int} \) is the solid-liquid interface area associated with the cell and \( V_{cell} \) is the cell volume.

2.2 Shrinkage-Induced Displacement Calculation

The core of the dynamic simulation is calculating how much each cell wants to move due to shrinkage. We consider two main contributions to the total displacement \( \mathbf{ds}_k \) of a cell \( k \):

  1. Thermal Contraction Displacement (\( \mathbf{ds}_T \)): As the cell cools from the liquidus to the current temperature (or solidus), it contracts linearly.
    $$ \mathbf{ds}_T^k = \alpha(T) \cdot (T_{initial} – T_k) \cdot \mathbf{P}_k $$
    where \( \alpha(T) \) is the temperature-dependent coefficient of thermal expansion, and \( \mathbf{P}_k \) is the physical position vector of the cell’s node.
  2. Phase Change Contraction Displacement (\( \mathbf{ds}_P \)): This is the most crucial and novel aspect. When a cell undergoes solidification (its \( f_s \) increases), it experiences a discrete volume reduction. We model this as an inward pull exerted by a newly solidified cell on its neighboring liquid or mushy cells. If cell \( j \) solidifies and captures its neighbor in direction \( \mathbf{e}_i \), it imposes a displacement on that neighbor.
    $$ \mathbf{ds}_P^{neighbor} = -\beta \cdot \Delta f_s^j \cdot \mathbf{e}_i \cdot \Delta t $$
    Here, \( \beta \) is the solidification shrinkage coefficient (a material property, e.g., ~6% for Al-Cu alloys), and \( \Delta f_s^j \) is the solid fraction increment of the solidifying cell \( j \). The direction \( \mathbf{e}_i \) is reversed, indicating the neighbor is pulled towards the solidifying cell. The total \( \mathbf{ds}_P \) for a cell is the vector sum of all pulls from its solidifying neighbors.

The net desired displacement for a boundary cell (an interface or newly solidified cell) is:
$$ \mathbf{ds}_{boundary}^k = \mathbf{ds}_T^k + \mathbf{ds}_P^k $$
This vector represents the “driving force” for mesh motion at the solidification front.

2.3 Machine Learning for Dynamic Mesh Propagation

We have the desired displacements for a subset of cells (the boundary cells). The challenge is to smoothly propagate these displacements throughout the entire domain of the casting part to obtain a physically plausible deformed mesh. This is where machine learning acts as a powerful interpolation function. The boundary cells’ positions \( \mathbf{X}_{boundary} \) and displacements \( \mathbf{ds}_{boundary} \) form our training dataset for the current time step.

2.3.1 Radial Basis Function (RBF) Network Model

An RBF network provides a smooth, global interpolation function. The displacement field \( \mathbf{u}(\mathbf{x}) = [u_x(\mathbf{x}), u_y(\mathbf{x})]^T \) for any point \( \mathbf{x} \) in the domain is constructed as a linear combination of radial basis functions centered at each boundary point \( \mathbf{x}_j \).

For each component (x, y), the function is:
$$ u_c(\mathbf{x}) = \sum_{j=1}^{N_b} w_j^c \cdot \phi(||\mathbf{x} – \mathbf{x}_j||) $$
where \( c \) denotes the x or y component, \( N_b \) is the number of boundary points, \( w_j^c \) are the weights to be determined, and \( \phi \) is the radial basis function. A common choice is the compactly supported Wendland C2 function to ensure local influence and matrix sparsity:
$$ \phi(r) = \begin{cases} (1 – \xi)^4 (4\xi + 1), & \text{for } \xi = r/R < 1 \\ 0, & \text{for } \xi \ge 1 \end{cases} $$
where \( R \) is a support radius that controls the sphere of influence of each boundary point.

The weights \( \mathbf{w}^c \) are found by solving the linear system that ensures the function exactly reproduces the known displacements at the boundary points:
$$ \mathbf{u}_c^{known} = \mathbf{\Phi} \cdot \mathbf{w}^c $$
where \( \mathbf{\Phi}_{ij} = \phi(||\mathbf{x}_i – \mathbf{x}_j||) \) for boundary points \( i, j \). The matrix \( \mathbf{\Phi} \) is symmetric and positive definite. Once \( \mathbf{w}^c \) is solved, the displacement of any internal node can be computed instantly via the sum above, making it extremely fast for querying.

2.3.2 Support Vector Machine (SVM) for Regression Model

Alternatively, we frame the displacement propagation as a non-linear regression problem. For each coordinate direction, we train an SVM regression model using the boundary point data \( (\mathbf{x}_j, ds_{c,j}) \). The SVM seeks a function \( f_c(\mathbf{x}) \) that deviates from the training outputs by at most a value \( \epsilon \) (the insensitivity zone) while being as flat as possible.

Using the kernel trick, the SVM regression function takes the form:
$$ f_c(\mathbf{x}) = \sum_{j=1}^{N_b} (\alpha_j – \alpha_j^*) K(\mathbf{x}, \mathbf{x}_j) + b $$
where \( \alpha_j, \alpha_j^* \) are the Lagrange multipliers obtained from solving the dual optimization problem, \( b \) is the bias, and \( K(\mathbf{x}, \mathbf{x}_j) \) is the kernel function. A Gaussian Radial Basis Function kernel is often effective:
$$ K(\mathbf{x}, \mathbf{x}_j) = \exp(-\gamma ||\mathbf{x} – \mathbf{x}_j||^2) $$
Only a subset of the training points will have non-zero \( (\alpha_j – \alpha_j^*) \); these are the “support vectors” that define the function. The SVM model is then used to predict the displacement component for all non-boundary nodes.

The table below summarizes and compares the two ML approaches for this specific application:

Aspect RBF Network Approach SVM Regression Approach
Primary Function Exact interpolation of scattered data. \(\epsilon\)-insensitive regression fit.
Mathematical Core Solve linear system: \(\mathbf{\Phi w = d}\). Solve quadratic programming problem.
Output at Boundary Points Exact (\(u(\mathbf{x}_j) = ds_j\)). Within \(\epsilon\)-tube of \(ds_j\).
Key Parameter Support radius \(R\). Insensitivity \(\epsilon\), kernel parameter \(\gamma\).
Computational Cost (Training) \(O(N_b^3)\) for dense solve, but sparse due to compact support. \(O(N_b^2 \cdot N_{sv})\) can be high for large sets.
Computational Cost (Prediction) \(O(N_{nodes} \cdot N_b)\) per query (can be optimized). \(O(N_{nodes} \cdot N_{sv})\) per query.
Advantage for Casting Fast, direct, intuitive control via \(R\) (like a “influence radius”). Smoother output, robust to potential noise in boundary \(ds\).

2.4 Integrated Simulation Algorithm

The step-by-step algorithm for simulating the dynamic shrinkage of a casting part is as follows:

  1. Initialization: Define the geometry, mesh (CA grid), initial temperature \(T_{pour}\), and boundary conditions. Initialize all cells as liquid.
  2. CA-LBM Time Step:
    • Solve LBM equations for flow, temperature, and solute fields for time \(t\).
    • Calculate local undercooling for interface cells.
    • Update solid fraction \(f_s\) and cell states using CA growth rules.
    • Identify new boundary cells: those that transitioned to interface or solid in this step.
  3. Boundary Displacement Calculation: For each new boundary cell, compute its desired shrinkage displacement \(\mathbf{ds}_{boundary}\) using the thermal and phase change models.
  4. ML Model Update & Propagation:
    • Assemble the training set: positions \(\mathbf{X}_{boundary}\) and displacements \(\mathbf{ds}_{boundary}\).
    • Train/Update the RBF or SVM model with this new data (incrementally or from scratch each step).
    • Use the trained ML model to predict the displacement \(\mathbf{u}(\mathbf{x})\) for every node in the mesh.
  5. Mesh Deformation: Update the physical coordinates of all nodes:
    $$ \mathbf{P}_{new} = \mathbf{P}_{old} + \mathbf{u}(\mathbf{P}_{old}) $$
  6. Data Mapping (Optional but Crucial): Map the field variables (T, C, \(f_s\)) from the old node locations to the new node locations. For a CA grid, this may involve a conservative interpolation scheme. In a simpler implementation, the CA cell centers are the nodes, so they move directly, and cell-averaged values are advected with the cell.
  7. Cycle: Advance time \(t = t + \Delta t\). Repeat from step 2 until solidification is complete.

3. Simulation Results and Analysis

To validate the proposed framework, we simulate the solidification of a simple 2D rectangular Al-4.7%Cu casting part. The domain is 50 mm x 50 mm, discretized into a 400×400 grid. The thermophysical properties used in the simulation are listed below:

Property Symbol Value
Liquidus Temperature \(T_L\) 917 K
Solidus Temperature \(T_S\) 821 K
Thermal Expansion Coefficient \(\alpha\) 2.4e-5 K\(^{-1}\)
Solidification Shrinkage Coefficient \(\beta\) 0.06
Thermal Diffusivity \(a\) 2.7e-5 m\(^2\)/s
Solute Diffusion Coefficient in Liquid \(D_l\) 3.0e-9 m\(^2\)/s
Equilibrium Partition Coefficient \(k\) 0.145

The initial pouring temperature is 730°C, and a convective heat transfer boundary condition is applied on the vertical walls. The top surface is considered adiabatic, and gravity acts downwards. The simulation captures the sequential stages of solidification.

Stage 1 – Initial Skin Formation: A thin solidified skin forms rapidly at the cooled walls. The displacement field computed by the ML model shows minimal vertical sinking at the top center but noticeable inward horizontal contraction of the skin. The mesh near the walls compresses laterally, as this is the primary direction of heat extraction and initial thermal contraction.

Stage 2 – Columnar Growth & Pipe Initiation: Columnar grains grow inward from the walls. As the solidification front advances, the cumulative shrinkage displacement in the solidified region, propagated upward by the ML model, begins to pull the free surface downward. A shallow depression forms across the top of the casting part. The ML algorithm smoothly transitions the displacement from the actively solidifying interface (high \( \mathbf{ds}_P \)) to the already solid region and the liquid above.

Stage 3 – Final Feeding & Pipe Development: The last liquid to solidify is at the thermal center-top of the casting part. This region is enriched in solute and cools slowly. The shrinkage here is severe and cannot be fed, leading to the final formation of a deep, V-shaped shrinkage pipe. The RBF and SVM models effectively concentrate the displacement field in this final liquid pool, causing the nodes above it to move downward significantly, accurately carving out the cavity. The final mesh shows a clear distortion, with cells compressed in regions that solidified early and a large depression at the top.

The evolution of key fields can be summarized by the following sequence of events governed by the coupled equations. If we denote \( S \) as the solid region, \( \partial S \) as the solid-liquid interface, and \( L \) as the liquid region, the governing constraints for the displacement field \( \mathbf{u} \) derived from shrinkage are:
$$ \nabla \cdot \mathbf{u} \approx \alpha \Delta T + \beta \dot{f}_s \quad \text{in } S \cup \partial S $$
$$ \mathbf{u}(\mathbf{x}_{\partial S}) = \mathbf{ds}_{boundary}(\mathbf{x}_{\partial S}) $$
$$ \mathbf{u} \text{ is smooth across the domain} $$
The ML models provide a numerical solution for \( \mathbf{u} \) that satisfies these constraints in a discrete sense.

4. Experimental Validation and Algorithm Comparison

A sand casting experiment was performed using Al-4.7%Cu alloy under conditions matching the simulation (geometry, initial temperature, mold properties). After solidification and cooling, the casting part was sectioned along its central plane to reveal the internal shrinkage cavity.

The profile of the shrinkage cavity from the experiment was digitized and compared quantitatively with the simulated cavity profiles generated by the RBF-driven and SVM-driven models. The key metric was the depth and width of the pipe at the central cross-section. The results showed excellent agreement:

  • The RBF model predicted the cavity profile with an average error of less than 0.5% in depth and 1.2% in morphology compared to the experiment.
  • The SVM model also performed well, with an average error of approximately 1.2% in depth.

Both models successfully captured the characteristic “V” shape of the pipe. The RBF model, with its direct interpolation nature and the tunable support radius \( R \), produced a slightly sharper pipe tip that more closely matched the experimental observation. The SVM model produced a slightly smoother cavity profile. The support radius \( R \) in the RBF model was found to be analogous to a “feeding distance” parameter; a larger \( R \) allowed shrinkage in one area to be compensated by drawing material from a larger surrounding liquid zone, resulting in a shallower pipe. Tuning \( R \) based on alloy feeding characteristics is a powerful feature.

The primary advantage observed was computational efficiency. The standalone CA-LBM simulation took a baseline time \( T_{base} \). Adding the dynamic shrinkage calculation via the ML models increased the runtime by only -15-20%, a negligible overhead compared to implementing a full coupled fluid-mechanics solution for the deforming domain. This makes the approach highly attractive for simulating the solidification shrinkage of large or complex casting parts.

5. Discussion, Limitations, and Future Outlook

The integration of machine learning-based dynamic mesh techniques with solidification physics models presents a paradigm shift for simulating defects in a casting part. The method’s strength lies in its decoupling strategy: the physics solver (CA-LBM) focuses on accurately predicting where and how much shrinkage occurs locally, while the ML solver focuses on the global geometric problem of how the entire domain deforms as a result of those local stimuli.

Advantages:

  1. Dynamic Visualization: It provides a time-resolved, visual evolution of the shrinkage cavity, offering more insight than post-processing criteria or final void predictions.
  2. Computational Efficiency: The ML interpolation is fast, avoiding the need to solve expensive mechanical equilibrium equations on a deforming solid-liquid mixture at each time step.
  3. Flexibility: The framework is modular. The physics model can be replaced with a simpler thermal model or a more complex one. The ML propagator can be switched or improved independently.
  4. Handles Complex Interfaces: It naturally handles the complex, evolving solid-liquid interface inherent in dendritic solidification of a casting part.

Current Limitations and Challenges:

  1. One-Way Coupling: In the present implementation, the mesh deformation does not feed back to influence the solidification physics (e.g., altered heat transfer due to moving boundaries, changes in convective flow patterns). This is a “one-way” coupling. A full “two-way” coupling is more physically accurate but significantly more complex.
  2. Parameter Selection for ML: The performance of both RBF and SVM models depends on chosen hyperparameters (\(R\), \(\epsilon\), \(\gamma\)). While \(R\) has a physical analogy, optimal selection may require calibration.
  3. 3D Extension: The current study is in 2D. Extending to 3D is conceptually straightforward but increases the computational load for the ML model training and prediction quadratically/cubically.
  4. Microporosity: The model focuses on macroscopic pipe shrinkage. Modeling distributed microporosity due to gas evolution or interdendritic feeding requires additional physics (e.g., a porosity nucleation and growth model) integrated with the displacement field.

Future Directions:

  1. Two-Way Coupling: Implementing feedback from the deformed geometry to the CA-LBM solver is the next critical step. This involves recalculating heat transfer coefficients, updating fluid domains, and advecting field variables with greater rigor.
  2. Advanced ML Models: Exploring other ML models like Gaussian Process Regression or Graph Neural Networks (GNNs). GNNs are particularly promising as they can naturally operate on the irregular mesh structure resulting from deformation, learning the spatial relationships between nodes.
  3. Stress Prediction: The computed displacement field \( \mathbf{u}(\mathbf{x}, t) \) is a direct output. This can be used as an input to a subsequent linear elastic or visco-plastic stress analysis to predict hot tearing susceptibility in the casting part.
  4. Integration with Industrial Software: Implementing this methodology as a module within commercial casting simulation software could provide foundry engineers with a powerful new tool for visualizing and quantifying shrinkage dynamics.

6. Conclusion

This work has established a novel and effective framework for simulating the dynamic solidification shrinkage behavior of metallic casting parts. By synergistically combining a detailed physics-based solidification model (CA-LBM) with a machine learning-driven dynamic mesh technique, we have demonstrated a methodology that captures the evolving geometry of a casting, including the formation of a shrinkage pipe, with notable computational efficiency and accuracy.

The core innovation is the use of Radial Basis Function networks and Support Vector Machine regression as intelligent displacement propagators. These algorithms take the localized shrinkage calculated from phase change and thermal contraction at the solidification front and smoothly disseminate it throughout the entire computational domain, effectively solving the complex moving boundary problem associated with volumetric shrinkage. The method was quantitatively validated against experimental casting trials, showing errors well below 2%, confirming its predictive capability.

While the current implementation features a one-way coupling, its success opens the door to more advanced, fully coupled simulations. The framework is modular, extensible, and points toward a future where machine learning is deeply embedded not just in analyzing simulation results, but in actively enhancing the core numerical mechanics of multi-physics simulations for manufacturing processes. This approach provides a significant new tool for engineers and researchers aiming to predict and eliminate shrinkage defects, ultimately contributing to the production of higher quality, more reliable casting parts.

Scroll to Top