Ahmed Ktari

Mohamed El Mansori

Digital twin of functional gating system in 3D printed molds for sand casting using a neural network

Keywords: Digital twin, Sand casting, Gating system design, FEM simulation, Neural Network

The filling stage is a critical phenomenon in sand casting for making reliable castings. Latest research has demonstrated that for most liquid engineering alloys, the critical meniscus velocity of the melt at the ingate is in the range of 0.4-0.6 m s -1 . The work described in this research paper is to use neural network (NN) technology to propose digital twin approach for gating system design that allow to understand and model its performances faster and more reliable than traditional methods. This approach was applied in the case of sand casting of liquid aluminum alloy (EN AC-44200). The approach is based first on a digital representation of filling process to perform the melt flow simulations using a combination of the gating system design parameters, selected as a training cases from Taguchi orthogonal array (OA). The second step of the approach is the data capture of functional gating design system to train up the feed-forward back-propagation NN model. The validation of the well-trained NN model is assessed by interrogating predicted ingate velocity to it and making reliable predictions with high accuracy. The claim is that such digital twin approach is an effective solution to recognize the functional design parameters from the entire filling systems used during casting process.

Introduction

Sand casting is an economical metal forming process that has been employed, since antiquity, to manufacture metal parts with a wide range of sizes and complexity. However, to have a good quality castings, several rules should be respected in the mold designs in particular the gating system since it permits to control the melt flow in the cavity. The transition from laminar to turbulent flow during the mold filling can lead to drastic effects on the quality of castings [START_REF] Campbell | Complete casting handbook: Metal casting processes, metallurgy, techniques and design[END_REF].

The filling process is typically comprised of free surface flow of the metal front inside the mold cavity. The exposure of liquid metals to air and moisture during free surface flows leads to the formation of surface oxide films [START_REF] Gopalan | Oxide bifilms in aluminium alloy castings: A review[END_REF]. Folding of free dry oxide surfaces result in B Ahmed Ktari ahmed.ktari@ensam.eu 1 MSMP-EA7350, Arts et Métiers ParisTech, 2 Cours des Arts et Métiers, 13617 Aix-En-Provence, France harmful double oxide films named bifilms [START_REF] Campbell | The consolidation of metals: The origin of bifilms[END_REF][START_REF] Raiszadeh | A method to study the history of a double oxide film defect in liquid aluminium alloys[END_REF]. Because these bifilms are necessarily folded on their dry sides during their creation, they act as cracks and initiate failure [START_REF] Cao | The nucleation of Fe-rich phases on oxide films in Al-11.5Si-0.4Mg cast alloys[END_REF]. The rate of bifilm formation increases with increase in turbulence as the oxide layers continuously stretch, rupture and regrow [START_REF] Modaresi | Gating system design and simulation of gray iron casting to eliminate oxide layers caused by turbulence[END_REF][START_REF] Bakhtiarani | Healing of double-oxide film defects in commercial purity aluminium melt[END_REF]. Entrained defects as oxide inclusions, sand inclusions, blowholes, bubbles, bifilms among others are significantly detrimental to the castings mechanical properties [START_REF] Basuny | Effect of casting conditions on the fracture strength of Al-5Mg alloy castings[END_REF][START_REF] Campbell | Complete casting handbook: Metal casting processes, metallurgy, techniques and design[END_REF][START_REF] Dai | Influence of oxide film defects generated in filling on mechanical strength of aluminium alloy castings[END_REF][START_REF] Divandari | Mechanisms of bubble damage in castings[END_REF]. Hence, oxide films can affects tensile strength [START_REF] Zhao | Effect of double oxide film defects on mechanical properties of As-cast C95800 alloy[END_REF][START_REF] Mi | Effects of the entrained surface film on the reliability of castings[END_REF][START_REF] Sirrell | Mechanism of filtration in reduction of casting defects due to surface turbulence during mold filling[END_REF], fracture strength [START_REF] Green | Influence of oxide film filling defects on the strength of Al-7Si-Mg alloy castings (94-114)[END_REF], fatigue life [START_REF] Nyahumwa | Effect of mold-filling turbulence on fatigue properties of cast aluminium alloys (98-58)[END_REF]) and also act as initiation sites for shrinkage [START_REF] Bangyikhan | Effects of oxide film, Fe-rich phase, porosity and their interactions on tensile properties of cast Al-Si-Mg alloys[END_REF]) and hydrogen gas pore formation [START_REF] Raiszadeh | A semi-empirical mathematical model to estimate the duration of the atmosphere within a double oxide film defect in pure aluminium alloy[END_REF] in castings. As a result, to reduce defects due to entrainment since they cause 80% of the total effective problems in castings [START_REF] Bozchaloei | Effect of oxide bifilms on the mechanical properties of cast Al-7Si-0.3 Mg alloy and the roll of runner height after filter on their formation[END_REF], it is critical to design proper gating systems that permit to control the liquid metal flow during the mold filling phase by reducing the velocity at ingate to less than 0.5 m s -1 (Sama et al. 2019a, b;[START_REF] Campbell | Invisible macrodefects in castings[END_REF][START_REF] Runyoro | Critical gate velocity for film-forming casting alloys. A basis for process specification[END_REF]). This will improve product quality and foundry productivity.

In the past, several researchers have experimented with various parameters to design straight sprue based on the basic principles of fluid dynamics. Most of the current design knowledge on gating systems are derived from trial and error approaches [START_REF] Ruddle | The running and gating of Sand casting: A review of the literature[END_REF], water modelling [START_REF] Renukananda | Multi-gate systems in casting process: Comparative study of liquid metal and water flow[END_REF] and using computational simulation tools (Sama et al. 2019a;[START_REF] Nimbulkar | Design optimization of gating and feeding system through simulation technique for sand casting of wear plate[END_REF]. Since the kinematic viscosity of most liquid metals is similar to water [START_REF] Renukananda | Multi-gate systems in casting process: Comparative study of liquid metal and water flow[END_REF][START_REF] Swift | A study of principles of gating[END_REF], numerous researchers have experimented with water models using transparent molds usually made of Acrylic [START_REF] Shaikh | Optimization of multi-gate systems in casting process: Experimental and simulation studies[END_REF][START_REF] Renukananda | Multi-gate systems in casting process: Comparative study of liquid metal and water flow[END_REF] to visualize in real time the fluid flow in molds [START_REF] Juretzko | Comparison of mold filling simulation with high speed video recording of real-time mold filling[END_REF]. Newly, [START_REF] Sama | Measurement of metal velocity in sand casting during mold filing[END_REF] have proposed a novel method of embedded Internet of Things (IoT) sensors to monitor realtime melt flow velocity in 3D sand printing mold during metal casting.

Nowadays, in view of the evolution of artificial intelligence (AI) tools, several authors have applied neural network (NN) to solve casting quality problems in production. In this context, [START_REF] Lin | Segmentation of casting defect regions for the extraction of microstructural properties[END_REF] have proposed a 3D convolutional neural network, a nonlinear topological dimension parameter and an empirical model for extracting the microstructural properties of casting defect regions efficiently. [START_REF] Mrzyglod | Application of selected artificial intelligence methods in a system predicting the microstructure of compacted Graphite Iron[END_REF] have proposed an intelligent computing tool based on NN and fuzzy logic that permit to forecast the microstructure of the tested cast iron at the level of computer simulation. These authors have shown the possibility to apply the Adaptive Neuro-Fuzzy Inference System (ANFIS) model as a tool to control the chemical composition of compacted graphite iron in the production of castings with high-strength parameters. [START_REF] Krimpenis | Simulation-based selection of optimum pressure die-casting process parameters using neural nets and genetic algorithms[END_REF] have proposed a methodology based on FEM and NN that permit to predict, using real-life data, a variety of pressure die-casting components, structured in terms of product geometric characteristics and corresponding process parameters value ranges. Further literature review [START_REF] Ghosh | An artificial neural network model to characterize porosity defects during solidification of A356 aluminum alloy[END_REF][START_REF] Zhang | An intelligent system for low-pressure die-cast process parameters optimization[END_REF][START_REF] Vosniakos | The scope of artificial neural network metamodels for precision casting process planning[END_REF] shows that NN tools are relatively applied in the casting field to study and improve the castings product quality as a function of the process parameters.

The above discussion shows that various research have focused on trial and error experiment, FE methods and AI solutions for enhancing the casting process and improving the casting quality. However, most of the existing research is fragmented without a common vision towards a converging digital twin paradigm.

In this work, a digital twin of filling system is proposed, as a unifying paradigm, to use it for functional design and control of engineering gating systems in castings. The data would be measured using instrumented casting tests or collected based on numerical simulation of mold filling and fed directly into the trained NN quality control of functional gating design package. The NN package has been designed to perform a variety of tasks: i) Numerical characterisations of melt filling process for quality and casting process control. This would provide more detailed information as functions of gating system on surface melt turbulence, critical melt velocity, and liquid melt front in the mold cavity, etc. ii) Intradesign differentiation and classification. This involves signal to noise (S/N) ratio and analysis of variance (ANOVA) to analyse the effects and the contributions of the design parameters on the critical behaviour of melt filling process such as ingate velocity, surface turbulence, and iii) Feature identification of functional design: it is intended to enable users to decide on any features of interest to be modified in design of functional gating system using different parameters (feeder geometry, primitive 3D shapes of castings, casting modulus, filling direction, convection-induced damage).

Digital twin: a new concept of gating system design in 3D printed molds for sand casting

The interaction and convergence between physical and virtual world of manufacturing is getting more and more attention thanks to the advances of AI, IoT, big data, and other new generation information technologies. Besides, the digital twin paves a way for the cyber-physical integration of manufacturing, which is an important bottleneck to achieve smart manufacturing. Indeed, digital twin consist to create the virtual models for physical objects in the digital way to simulate their behaviours. The virtual models could understand the state of the physical entities through sensing data, to predict, estimate, and analyse the dynamic changes. While the physical objects would respond to the changes according to the optimized scheme from simulation [START_REF] Redelinghuys | A sixlayer architecture for the digital twin: A manufacturing case study implementation[END_REF][START_REF] Tong | Real-time machining data application and service based on IMT digital twin[END_REF][START_REF] Mukherjee | A digital twin for rapid qualification of 3D printed metallic components[END_REF].

The digital twin of functional gating system of 3D printed sand mold, presented in this paper, consists of a closed loop, which includes an hybrid mechanistic/NN model, big data, data classification/intra-design classification model and machine learning, as shown in Fig. 1. The functions of each of these units and how they may help in the production of high quality castings in a timely manner are discussed below.

The mechanistic models are frequently applied in the casting field to estimate generally, the metallurgical attributes such as the solidification morphology [START_REF] Nastac | Numerical modeling of solidification morphologies and segregation patterns in cast dendritic alloys[END_REF]) and grain structure [START_REF] Gu | Predicting grain structure in high pressure die casting of aluminum alloys: A coupled cellular automaton and process model[END_REF], and to predict the micro/macro-scale defect formation such as shrinkage (Kwon 2019;[START_REF] Stefanescu | Computer simulation of shrinkage related defects in metal castings: A review[END_REF] based on well-established theories. Furthermore, these models can be applied to simulate the melt flow behaviour based on classical fluid dynamic equations and uses control volume-finite element to solve the momentum and energy equations to obtain solution for the

Model update Training

Fig. 1 Schematic representation of the digital twin of gating system functional design variable parameters. In the proposed digital twin, the mechanistic model can be coupled with NN model as presented in Fig. 1. The hybrid mechanistic/NN model can be made bidirectional, so that they can switch between input and output variables. In other words, they can compute a set of functional gating system design parameters necessary to limit the flow velocity in molds, during the filling phase, less than 0.5 m s -1 to achieve desired casting properties (Sama et al. 2019a).

A sensing and control model could be interfaced during casting part with multiple sensors such capacitive or magnetic sensors used to measure the melt flow velocity in mold cavities [START_REF] Sama | Measurement of metal velocity in sand casting during mold filing[END_REF]) and wireless sensors for temperature measurements at several deeps inside molds [START_REF] Walker | 3D printed smart molds for sand casting[END_REF]. These models can be used for online control of the filling process. During the filling phase, the model continuously assesses the sensing data to check if they are within the acceptable limits. If any deviation is found, the control model offers a new filling system design by adjusting its geometrical dimensions, to avoid for example a turbulent melt flow in the cavity.

Both mechanistic and control models are complex and their outputs may have errors due to several used assumptions in the FE model such errors in thermo-physical and thermomechanical properties data, errors caused by the spatial discretization of the FE method and the common numerical errors. In order to minimize theses errors, the mechanistic and the control models should be combined with advanced statistical models.

In sand casting process, many variables can affect the value of the ingate velocity during the filling phase and FE model predictions are not always in agreement with experimental data because the complexity of the melt flow in the mold cavity. As a result, the advanced statistical model can correct the inaccuracies of the FE model predictions based on previous results from a set of classified records within a large set of data known as the big data of casting.

The big data is a huge collection of variety of digital data that cannot be stored and analysed by usual resources. In the proposed digital twin, the big data for 3D printed molds for sand casting is independent from the data-capture techniques and can be divided in four main types of records as shown in Fig. 1. First, it contains the data obtained by sensing such as the melt and mold temperature, the melt velocity in the gate and features of liquid melt front in the mold cavity. Second, data from the test results of previously casted parts such as mechanical properties, which largely depends on melt filling conditions. Third, the computational results from valid FE model and finally, data can also be collected from literature.

The data must be appropriately used for continuous improvement of model prediction based, as mentioned above, on the data gathered from new experiment, simulations and growing literature. The data classification is performed in two steps. In the first one, the classification is based on the intended purpose using advanced algorithms [START_REF] Qi | Digital twin and big data towards smart manufacturing and industry 4.0: 360 degree comparison[END_REF][START_REF] Tao | Digital twin-driven product design, manufacturing and service with big data[END_REF]. Then, intra-design differentiation and classification is done in the second step [START_REF] Huang | Intelligent parametric design for a multiple-quality-characteristic glue-dispensing process[END_REF][START_REF] Tsai | An inverse model for injection molding of optical lens using artificial neural network coupled with genetic algorithm[END_REF]. This involves signal to noise (S/N) ratio and analysis of variance (ANOVA) to analyse the effects and the contributions of the design parameters on the critical behaviour of melt filling process such as ingate velocity and surface turbulence.

The expanding big data is used continuously to decide when and how to improve the model predictions using machine learning [START_REF] Lecun | Deep learning[END_REF]. Machine learning provides dynamic ability to improve the control model based on continuously growing knowledge base and provides the digital twin the agility to change with time. The machine learning is achieved by implementing smart algorithm such NN [START_REF] Sha | The use of artificial neural networks in materials science based research[END_REF] that can be developed in two steps starting by the training phase with a set appropriately data. Next, the trained neural network is tested and validated using additional set of data excluded during training.

In summary, the proposed digital twin concept of functional gating system, in 3D printed sand mold, is illustrated with more details through the following section on a case study.

Digital twin for functional gating system in 3D printed molds for sand casting: a case study

In this section, the digital twin approach for gating system design described above is applied on a simple case study example to understand and model its performances. The approach is based first on a digital representation of filling process to perform the melt flow simulations using a combination of the gating system design parameters, selected as training cases from Taguchi orthogonal array (OA).

Design of experiment and FE problem modeling

The process parameters influencing the cast quality are based on the gating system design, which include the dimensions of a conventional sprue, runner and gate. The relevant dimensions and design parameters of the model used in sand casting process is illustrated as shown in Fig. 2. The cast part and gating system geometry were adopted from [START_REF] Yang | Liquid metal flow in moulds with offset sprue[END_REF]. The advantage of the undercut at the base of pouring basin include minimizing the occurrence of splashing and the sprue cover prevents metal from directly falling into the sprue.

Given that Taguchi method requires a low number of experiment combinations, it can be applied to obtain useful information for reducing the number of experiments and converting quality characteristics into a signal to noise (S/N) ratio. Indeed, Taguchi orthogonal array is applied in this study to facilitate experimental design process as shown in Table 1.

A coupled 3D thermo-hydraulic fluid flow modelling of the mold filling studied cases was performed via ProCAST ® FE software with identical inlet, fluid and boundary conditions. Before calculation, some assumptions were made: (i) the liquid metal was incompressible Newton fluid, and (ii) the filling of molten metal is a non-isothermal flow accompanied by heat transfer losses. In the present study, the thermodynamic behaviour and flow field evolution are analysed via Continuity equation

∇ • u 0 ( 1 )
Navier-Stokes (momentum) equation

ρ ∂u ∂t + (u • ∇)u ∇ • μ ∇u + (∇u) T -∇ P + ρg (2)
Energy equation

ρc dT dt ∇ • (k∇T ) + Q (3)
where ρ is the density, t is the time, μ is the dynamic viscosity, P is the pressure, g is the gravitational acceleration component, u is the velocity vector, T is the temperature, k is the thermal conductivity, c is the specific heat and Q is an internal power source. The conservation equations are solved numerically using a fully implicit time-stepping scheme and a standard FE formulation [START_REF] Baoguang | A novel technique for reducing macrosegregation in heavy steel ingots[END_REF]. Further details of the numerical model are given in the user manual of ProCast ® (2009).

The VOF method [START_REF] Swaminathan | A time-implicit filling algorithm[END_REF] is used to compute the location and movement of the fluid front. An order parameter (F) having a value of unity in the fluid and zero outside is used to track the free-surface position.

∂ F ∂t + (u • ∇)F 0 ( 4 )
This equation is coupled to the Navier-Stokes equations by defining the domain over which the latter are solved.

The coupled model was chosen to make numerical model as close as possible to experimental conditions and to ensure that all selected combinations of gating system design parameters allows a complete filling of the mold cavity (i.e. avoid misrun risk). The problem modelling need geometrical information of the CAD model including the part, the gating system, and the sand mold. Hence, all studied cases of solid CAD models are generated using CATIA ® V5 software before being imported in ProCAST ® .

In this study, the FE model is meshed using linear tetrahedral elements with a mesh size of 1 mm and 3 mm respectively for the casting and the mold (Fig. 3). The mesh size is selected based on several mesh refinements study in order to achieve more accurate solutions (i.e. The dependence of the melt flow on the mesh size is investigated). It is to be noted that the number of elements in FE simulation is variable, with an average value of 2.36 10 6 , since it depends on the mold training case as presented in Table 1.

Aluminium alloy EN AC-44200 is used for the casted part. These alloys have a wide range of applications in automotive and aerospace industries due to their excellent castability, mechanical properties as well as good corrosion and wear resistance. Temperature dependent thermo-physical material properties for thermal conductivity, specific heat capacity and density are taken from ProCAST ® database. An initial temperature of 750 °C is applied to the inlet, which represents the pouring temperature of the molten metal. An inlet metal flow rate of 225 cm 3 .s -1 into the pouring basin was maintained constant during the filling phase (Sama et al. 2019a). The casting is cooled to room temperature in air with a convection coefficient of 10 W.m -2 . °C-1 applied to all six mold surfaces. The ambient (sink) temperature of the surrounding air is 25 °C. In addition, a heat transfer coefficient of 350 W.m -2 . °C-1 is applied at the metal/sand mold interface [START_REF] Sun | An investigation into the effective heat transfer coefficient in the casting of aluminium in a greensand mold[END_REF].

With all the above setting of the trained FE models, the obtained results are consistent with actual flow patterns as revealed by radiography [START_REF] Mi | Effects of the entrained surface film on the reliability of castings[END_REF][START_REF] Sirrell | Benchmark testing the flow and solidification modeling of AI castings[END_REF]. This experimental validation denotes that the information obtained from the ProCAST ® modeling can be used, with some confidence, as an important resource to enrich the big data. Finally, data set could be also analysed and then treated with traditional statistical techniques.

Data analysis and classification

The FE results must be appropriately analysed and treated to prepare the NN input design variables and their correspond-ing ingate velocity data. In this study case, the NN input data are only gathered from simulations results.

Data analysis

As shown in Fig. 4, Probes were placed at the end of the ingate along the mid-plane of the casting to monitor the evolution of the ingate velocity during the filling phase. It is clear that the molten metal arrives at the gate probe region after 1.28 s (Fig. 4). Then, the ingate velocity increase rapidly until attains a maximum velocity of 0.731 m s -1 at filling time value of 1.92 s. Then, during the rest of the filling phase, the ingate velocity decreases slowly until the entire mold cavity filling marked by a sharp decrease of the ingate velocity (t 2.58 s). In addition, Fig. 4 also shows in the presented case, when the velocity of the liquid metal is higher than the critical value, that melt surface become unstable because of surface turbulence. In these conditions, the melt surface forms a fountain and a breaking wave that lead to the formation of several defects in the final casted part. This result entirety adheres to the critical ingate velocity condition described above.

The maximum value of the ingate velocity is selected for all training cases as revealed in Fig. 4 and then signal to noise ratios are calculated according to Taguchi method (Table 2). This method is considered as a quantitative analysis, largely used to identify control parameters that affect mean and variation of the quality characteristics. A high value of S/N ratio indicates the optimum quality with minimum variation [START_REF] Roy | A primer on the Taguchi method[END_REF]. The S/N ratio, expressed in dB units, can be defined, as mentioned by Eq. ( 5), by logarithmic function based on the Mean Square Deviation (MSD) around target.

S/N -10 log(M S D)

( 5

)
where MSD is the mean square deviation for the output characteristic. The lower the better quality characteristic for the ingate velocity can be taken for obtaining the optimal casting quality. The MSD for the lower the better quality characteristic can be expressed as Eq. ( 6).

M S D 1 n n i 1 Y 2 i ( 6
)
where n is a total number of tests in a trial and Y i represents the value of the measured ingate velocity. This parameter is chosen due to its importance in the casting quality. In fact, decreasing of the ingate velocity can reduce turbulences and entrainment, which can lead to several casting defects [START_REF] Campbell | Invisible macrodefects in castings[END_REF][START_REF] Campbell | Complete casting handbook: Metal casting processes, metallurgy, techniques and design[END_REF].

Intra-design gating system classification

Based on the simulation results of the selected training cases (Table 2), the response of each factor to its individual level was calculated by averaging the S/N ratios of all experiments at each level and factor (Fig. 5). After that, analyse of variance (ANOVA) test was performed to identify the most effective gating system parameters that significantly affect the filling ingate velocity. The ANOVA was established on the sum of the square (SS), the degree of freedom (DOF), the variance (V) and the percentage of the contribution to the total variation [START_REF] Ross | Taguchi techniques for quality engineering: Loss function, orthogonal experiments, parameter and tolerance design[END_REF]. As shown in Table 3 at its confidence level of 90% (F 0.1, 2, 26 2.519), four design parameters (A, B, C, D and J) were found as significant for the ingate velocity. However, I is also considered as significant parameters for the gating system design, given that its F-ratio value is close to the acceptance value (difference less than 5.6%). In summary, the ANOVA result shows that gating system dimensions A, B, C, D, I and J play a crucial role on the value of the molten metal ingate velocity during the mold filling. Indeed, these six selected functional gating system design variables and their corresponding FEM simulated

Neural network for machine learning

A neural network is a machine learning algorithm based on the model of a human neuron. The architecture of an artificial neural include usually up of three layers: an input layer, one or many hidden layers and an output layer. The neuron forms of the fundamental unit in the neural network, and each layer consists of one or many neurons. Each neuron is connected to other such neurons with synapses. Weight factors are allocated to these synapses which can be modified. In this study, the NN was built and trained in Matlab ® environment using Feed Forward Back Propagation (FFBP) neural network type [START_REF] Daniel | Optimization of material removal rate in wire-EDM using Genetic Algorithm[END_REF][START_REF] Tsai | An inverse model for injection molding of optical lens using artificial neural network coupled with genetic algorithm[END_REF]. A single hidden layer was selected. In order to find the optimal architecture, different numbers of neuron in the hidden layer were considered (the number of neuron in the hidden layer was varied from 8 to 20) and RMSE for each network was calculated. In this study, the ability of the learning program to predict output response, using different parameters viz learning rate (l r ) and momentum constant (m c ) was also tested and optimized based on RMSE value (Eq. 7). The NN output with the lower RMSE value was identified as the best.

R M S E

1

n n i 1 (P -E) 2 (7)
where n is the total number of training case, P and E are the predicted and the experimental value respectively. The learning rate parameter plays an important role for the learning algorithm. This parameter controls how much to change the model in response to the estimated error each time the model weights are updated. Choosing the learning rate is challenging because, large value causes rapid convergence but the algorithm becomes unstable that may cause the increase of error and very small values can yield a more Table 4 The optimised NN parameters used to simulate the ingate velocity during sand mold filling

Parameter Value

Hidden layers 1

Neurons number

Input layer (IL) 6

Hidden layer (HL) 16

Output layer (OL) 1 The momentum constant is equally an important parameter that can affect learning algorithm. This parameter is used to prevent the system from converging to a local minimum or saddle point. A high momentum parameter can also help to increase the speed of convergence of the system. However, setting the momentum parameter too high can create a risk of overshooting the minimum, which can cause the system to become unstable. A momentum coefficient that is too low cannot reliably avoid local minima, and can slow down the system training. As a result, to ensure a relatively stable and fast algorithm convergence, a gradient descent with momentum and adaptive learning rate back propagation 'traingdx' was applied. This function can i) train any network as long as its weight, net input, and transfer functions have derivative functions, and ii) It calculates derivatives of performance (RMSE) with respect to the weight and bias variable (X) [START_REF] Martin | Neural network design (2nd edn)[END_REF]). Each variable is adjusted according to gradient descent with momentum (Eq. 8).

d X m c • d X pr + l r • m c • ∂ R M S E ∂ X (8)
where dX p presents the previous change in the weight or bias.

In the described model, random weights are assigned to each processing element as an arbitrary starting point in the training process, and then progressively modified in light of several repetition of training cases data. For the transfer function, the log-sigmoid 'logsig' function is used for all neurons in the hidden layer (Eq. 9). This transfer function takes the input (which may have any value between plus and minus infinity) and squashes the output into the range 0-1. The log-sigmoid transfer function is commonly used in multilayer networks that are trained using the back propagation algorithm, in part because this function is differentiable [START_REF] Dorofki | Comparison of artificial neural network transfer functions abilities to simulate extreme runoff data[END_REF].

log sig(x) 1/ 1 + exp -x (9)
The NN architecture and all its characteristic parameters are shown respectively in Fig. 6 and Table 4. A total data set of 27 gating system design parameter combinations was used to train the proposed NN. The data cases are divided in two subsets. The first subset is the training set (80% of the total data), which is used for computing the gradient and updating the network weights and biases. The remaining five cases data (20% of the total data) were used for validation.

The most common problem faced when training a neural network is the choice of the number of epochs. Too many epochs can lead to overfitting of the training dataset, while too few may result in an underfit model. In this work, the early stopping method is used in the NN training process. An epoch number of 1000 was specified as an arbitrary large number. The error on the validation set is monitored during the training process. The validation error decreases during the initial phase of training, as does the training set error. However, when the network begins to overfit the data, the error on the validation set typically begins to rise. The network weights and biases are saved at the minimum of the validation set error. This allows to obtain the optimal NN model with a complexity that achieves the optimal balance between bias and variance (Fortmann-Roe 2012). (E 110; F 50; G 9; H 40 and K 32) In this study, the optimised NN model, with sixteen neurons in the hidden layer has been tested with six additional cases to prove its generalisation capability as shown in Table 5. Indeed, the model is verified against randomly filling system design parameters simulated with FE code. This means that the additional testing data file is completely independent from the initial training data generated using Taguchi (L 27 ) design of experiment. Figure 7 shows a plot of predicted NN versus FE ingate velocity for the training (train and validation) data used in the training process and the test data used for the NN generalization. A reasonable prediction occur in both cases. The RMSE for the prediction of the training and test data are respectively 0.045 m s -1 and 0.039 m s -1 . This result proves that designed NN model gave a satisfactory approximation since it allowed the prediction of the ingate velocity for data not used in the learning process for the most testing data (except the case no. 29, in which the error percentage can reach the value of 14.36%). proves that 27 training cases are sufficient in practice to turn on the digital twin. After the validation of the NN model, the predicted results are compared to the values of the ingate velocity using the first order response surface methodology (RSM) (i.e. calculated with Eq. 11 in Appendices). It is found that optimised NN model presents better data prediction compared to the traditional RSM model. The RMSE of the NN ingate velocity prediction is 0.045 m s -1 compared to 0.075 for RSM prediction (Fig. 7).

A digital twin is a high fidelity computational model that simulates known casting states. However, given the complex physics of casting process, digital twin is viewed here as a continuous learning using real casting experimental data. Experimental data are hence needed to calibrate the computational model as well as for updating parameters. The developed NN model is fed by data from casting part with embedded sensors (i.e. so called big data of casting collected from casting library of reference data). Indeed, the NN model was trained again taken into account the six additional FE simulations (Table 5) collected from the big data. Figure 8 shows the predicted results of the NN model before and after the update process. The value of determination coefficient (R 2 0.956) indicates that the updated model does not explain only 4.4% of the total variations. However, this coefficient is about 0.912 for the first NN model. Furthermore, the RMSE of the updated NN prediction is 0.031 m s -1 compared to 0.044 for the first NN prediction. As a result, it is obvious that updated NN model presents better data prediction compared to the first model. In summary, it is clear that optimized NN model can accurately predict the ingate velocity of a large number of functional gating system design variable combinations. These predictions can be carried on quite rapidly and easily compared to FE simulations. Finally, the found NN model can greatly reduce the simulation time devote to reach the optimal design parameters combination in the entirely studied design space. For this digital twin approach, the result predicted by the NN must be validated by FEM. If the result is consistent, the optimised design solution is accepted for experimental casting. In addition, that FE model will became a training case for the NN in order to make it more knowledgeable, using a supervised machine learning. After updating the NN model, another functional gating system design solution can be suggested and validated by FEM again for continuous improvement of the NN model.

Conclusion and outlook

In today's highly competitive markets, the critical requirements for product quality, productivity and time to market have been become the most powerful driving force behind any new product development paradigm for seeking the best design solution and quality improvement. The current developments in digital technologies open up great possibilities for support designers to response to these new product design and development challenges through increased computing power, artificial intelligence tools, as wells as connected data.

Motivated by this need, the digital twins of functional gating system is proposed in this study as an artificial intelligence tool to allow an efficient prediction of the molten metal ingate velocity, in 3D printed molds for sand casting, in order to make the gating system design and optimization faster than traditional methods. To attain this objective, FE flow simulations were performed using a combination of the gating system design variables, selected as training cases from Taguchi OA. After that, an intra-design classification of the gating system parameters is achieved by the use of ANOVA tests to select the significant design variables on the ingate velocity. Finally, a NN model was trained and validated by using the set of significant design variables combination and their corresponding FE simulations. Then, machine learning allows the dynamic ability to improve the NN model based on a continuously growing of the knowledge base, and provides the digital twin the agility to change with time. This lead to obtain the desired product attributes and shorten the time to market and reduce the casting cost.

In future work, the main challenge is to define a consistent framework for the holistic use of the digital twin in entire 3D printed sand mold design issues in order to predict, control and optimize the design parameters for feeder geometry, primitive 3D shapes of castings, casting modulus, filling direction and convection-induced damage.

Appendix

The relationship between the selected gating design variables and their corresponding ingate velocity is described by the response surface methodology (RSM). A central composite design (CCD) with three level factorial design was employed in this study to construct an accurate RSM. Equation (10) shows the first-order regression model in RSM.

Y β 0 + m j 1 β j x j + m-1 j 1 m p 1 β j p x j x p ( 10
)
where Y is the response objective, x j is the independent design variables and x j x p is the interaction term. β 0 is the constant term, β j is the jth linear coefficient, and β jp is the jpth interaction coefficient. The six factors derived from the ANOVA results were used to construct the response objective. As shown in Table 6, the significant design variables three level CCD experiment, which are coded as -1 and + 1 and the midpoint coded as 0, was employed to determine the response surface model V ingate [START_REF] Chen | Optimization design of a gating system for sand casting aluminium A356 using a Taguchi method and multi-objective culture-based QPSO algorithm[END_REF].

According to the first order regression equations (Eq. 3) the relationship between selected parameters and objective was established as shown in Eq. ( 11) after eliminating the insignificant terms. (11)

Fig. 2

 2 Fig. 2 Design and dimensions of the casted part with the studied gating system (in mm)

Fig

  Fig.3CAD and FE mesh applied on the studied model

Fig. 5

 5 Fig.5Mean effect for S/N ratios of the filling velocity at ingate

Fig. 6

 6 Fig. 6 Schematic representation of the back-propagation NN used for the prediction the ingate velocity during the sand mold filling

Fig. 7

 7 Fig. 7 FE simulated versus predicted ingate velocity for NN (training and testing data) and RSM models

Fig. 8

 8 Fig. 8 FE simulated versus predicted ingate velocity before and after the NN model updating

V

  ingate 0.75 + 0.04 × A + 0.06 × B + 0.035 × C + 0.03 × D -0.036 × I -0.05 × J -0.024 × AB -0.055 × AC -0.047 × AD + 0.017 × AI -0.024 × BD + 0.024 × CD -0.012 × CI -0.006 × DJ -0.016 × IJ

Table 1

 1 Gating system parameters and levels used in experimental plan following Taguchi's standard L 27 (3 11 ) orthogonal array

	Training case	A B C D	E	F G H I	J K
	No.
	1	12 12 6 160 90 30 8 30 10 40 24
	2	12 12 6 160 110 50 9 40 15 50 32
	3	12 12 6 160 130 70 10 50 20 60 40
	4	12 15 8 200 90 30 8 40 15 50 40
	5	12 15 8 200 110 50 9 50 20 60 24
	6	12 15 8 200 130 70 10 30 10 40 32
	7	12 18 10 240 90 30 8 50 20 60 32
	8	12 18 10 240 110 50 9 30 10 40 40
	9	12 18 10 240 130 70 10 40 15 50 24
	10	16 12 8 240 90 50 10 30 15 60 24
	11	16 12 8 240 110 70 8 40 20 40 32
	12	16 12 8 240 130 30 9 50 10 50 40
	13	16 15 10 160 90 50 10 40 20 40 40
	14	16 15 10 160 110 70 8 50 10 50 24
	15	16 15 10 160 130 30 9 30 15 60 32
	16	16 18 6 200 90 50 10 50 10 50 32
	17	16 18 6 200 110 70 8 30 15 60 40
	18	16 18 6 200 130 30 9 40 20 40 24
	19	16 12 10 200 90 70 9 30 20 50 24
	20	20 12 10 200 110 30 10 40 10 60 32
	21	20 12 10 200 130 50 8 50 15 40 40
	22	20 15 6 240 90 70 9 40 10 60 40
	23	20 15 6 240 110 30 10 50 15 40 24
	24	20 15 6 240 130 50 8 30 20 50 32
	25	20 18 8 160 90 70 9 50 15 40 32
	26	20 18 8 160 110 30 10 30 20 50 40
	27	20 18 8 160 130 50 8 40 10 60 24

Table 2

 2 Ingate velocity and their corresponding S/N ratio in orthogonal array

	Training case no.	Ingate velocity 'V' (m/s)	S/N ratio 'V' (dB)
	1	0.586	4.642
	2	0.535	5.433
	3	0.416	7.618
	4	0.672	3.453
	5	0.579	4.746
	6	0.737	2.651
	7	0.769	2.281
	8	1.070	-0.587
	9	0.829	1.629
	10	0.543	5.304
	11	0.791	2.036
	12	0.875	1.160
	13	0.744	2.569
	14	0.856	1.351
	15	0.770	2.270
	16	0.717	2.890
	17	0.744	2.569
	18	0.745	2.557
	19	0.602	4.408
	20	0.693	3.185
	21	0.842	1.494
	22	0.820	1.724
	23	0.880	1.110
	24	0.795	1.993
	25	1.090	-0.748
	26	0.747	2.534
	27	0.795	1.993
	ingate velocity are used, respectively, as input/output data set
	for the NN learning process.

Table 3

 3 ANOVA results for signal to noise for the ingate velocity response

	Gating parameters Sum of square (SS) Degree of freedom	Variance (V) F-ratio Contribution (%) Rank Significant
			(DOF)					(confidence > 90%)
	A	12.032	2	6.016	4.094	14.155	2	Yes
	B	20.506	2	10.253	6.977	24.125	1	Yes
	C	10.578	2	5.289	3.599	12.445	4	Yes
	D	8.553	2	4.276	2.910	10.062	5	Yes
	E	1.266	2	0.633	0.431	1.489	9	No
	F	0.840	2	0.420	0.286	0.988	11	No
	G	4.076	2	2.038	1.387	4.796	7	No
	H	0.977	2	0.489	0.332	1.150	10	No
	I	6.983	2	3.492	2.376	8.216	6	Yes a
	J	11.571	2	5.786	3.937	13.613	3	Yes
	K	1.739	2	0.870	0.592	2.046	8	No
	Error	5.878	4	1.470		6.915
	Total	85.000	26			100
	a This parameter is considered as significant

Table 5

 5 Additional FE cases and their corresponding ingate velocity compared to NN predicted values The rest of design parameters are maintained constant for the testing cases

	Validation FE cases	Design parameters combination a				Ingate velocity (m/s)
		A	B	C	D	I	J	FEM	NN	Error (%)
	Case 28	13	17	10	230	14	45	0.908	0.926	1.98
	Case 29	14	13	6	170	19	55	0.571	0.489	14.36
	Case 30	19	18	7	210	16	60	0.872	0.882	1.15
	Case 31	18	15	8	220	10	50	0.820	0.854	4.14
	Case 32	12	14	9	160	12	40	0.703	0.692	1.56
	Case 33	20	16	8	180	18	48	0.724	0.696	3.87
								Average error: 4.51

a

Table 6

 6

	Factors and levels selected from ANOVA test	Design parameters	Unit	Level -1	L e v e l0	L e v e l+1
		Sprue
		A	Top section Sprue width	mm	12	16	20
		B	Top section Sprue length	mm	12	15	18
		C	Bottom section Sprue width	mm	6	8	10
		D	Sprue higher	mm	160	200	240
		Gate
		I	Ingate length	mm	40	50	60
		J	Runner higher	mm	24	32

Department of Mechanical Engineering, Texas A&M University, College Station, TX 77840, USA

Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.