scieee AI-readable full text Open interactive document viewer

Verification and validation of openInjMoldSim, an open-source solver to model the filling stage of thermoplastic injection molding

Pedro, João; Ramôa, Bruno; Nóbrega, J. M.; Fernandes, C.

Abstract

In the present study, the simulation of the three-dimensional (3D) non-isothermal, non-Newtonian fluid flow of polymer melts is investigated. In particular, the filling stage of thermoplastic injection molding is numerically studied with a solver implemented in the open-source computational library <inline-formula> <math display="inline"> <semantics> <mrow> <mi>O</mi> <mi>p</mi> <mi>e</mi> <mi>n</mi> <mi>F</mi> <mi>O</mi> <mi>A</mi> <msup> <mi>M</mi> <mi>®</mi> </msup> </mrow> </semantics> </math> </inline-formula>. The numerical method is based on a compressible two-phase flow model, developed following a cell-centered unstructured finite volume discretization scheme, combined with a volume-of-fluid (VOF) technique for the interface capturing. Additionally, the Cross-WLF (Williams–Landel–Ferry) model is used to characterize the rheological behavior of the polymer melts, and the modified Tait equation is used as the equation of state. To verify the numerical implementation, the code predictions are first compared with analytical solutions, for a Newtonian fluid flowing through a cylindrical channel. Subsequently, the melt filling process of a non-Newtonian fluid (Cross-WLF) in a rectangular cavity with a cylindrical insert and in a tensile test specimen are studied. The predicted melt flow front interface and fields (pressure, velocity, and temperature) contours are found to be in good agreement with the reference solutions, obtained with the proprietary software <inline-formula> <math display="inline"> <semantics> <mrow> <mi>M</mi> <mi>o</mi> <mi>l</mi> <mi>d</mi> <mi>e</mi> <mi>x</mi> <mn>3</mn> <msup> <mi>D</mi> <mi>®</mi> </msup> </mrow> </semantics> </math> </inline-formula>. Additionally, the computational effort, measured by the elapsed wall-time of the simulations, is analyzed for both the open-source and proprietary software, and both are found to be similar for the same level of accuracy, when the parallelization capabilities of <inline-formula> <math display="inline"> <semantics> <mrow> <mi>O</mi> <mi>p</mi> <mi>e</mi> <mi>n</mi> <mi>F</mi> <mi>O</mi> <mi>A</mi> <msup> <mi>M</mi> <mi>®</mi> </msup> </mrow> </semantics> </math> </inline-formula> are employed.

Full text

fluids Article Verification and Validation of openInjMoldSim, an Open-Source Solver to Model the Filling Stage of Thermoplastic Injection Molding João Pedro, Bruno Ramôa, João Miguel Nóbrega * and Célio Fernandes Institute for Polymers and Composites, University of Minho, Campus de Azurém, 4800-058 Guimarães, Portugal; [email protected] (J.P.); [email protected] (B.R.); [email protected] (C.F.) *Correspondence: mnobr[email protected] Received: 3 May 2020; Accepted: 25 May 2020; Published: 29 May 2020   Abstract: In the present study, the simulation of the three-dimensional (3D) non-isothermal, non-Newtonian fluid flow of polymer melts is investigated. In particular, the filling stage of thermoplastic injection molding is numerically studied with a solver implemented in the open-source computational library OpenFOAM R  . The numerical method is based on a compressible two-phase flow model, developed following a cell-centered unstructured finite volume discretization scheme, combined with a volume-of-fluid (VOF) technique for the interface capturing. Additionally, the Cross-WLF (Williams–Landel–Ferry) model is used to characterize the rheological behavior of the polymer melts, and the modified Tait equation is used as the equation of state. To verify the numerical implementation, the code predictions are first compared with analytical solutions, for a Newtonian fluid flowing through a cylindrical channel. Subsequently, the melt filling process of a non-Newtonian fluid (Cross-WLF) in a rectangular cavity with a cylindrical insert and in a tensile test specimen are studied. The predicted melt flow front interface and fields (pressure, velocity, and temperature) contours are found to be in good agreement with the reference solutions, obtained with the proprietary software Moldex 3 DR  . Additionally, the computational effort, measured by the elapsed wall-time of the simulations, is analyzed for both the open-source and proprietary software, and both are found to be similar for the same level of accuracy, when the parallelization capabilities of OpenFOAM R  are employed. Keywords: injection molding; filling stage; Cross-WLF model; Tait model; finite volume method; openInjMoldSim;OpenFOAM R  1. Introduction The ever-growing demand for plastic materials promoted an increase in the requirements of many transformation processes, as happens for injection molding (IM), which is currently the most used one to manufacture thermoplastic parts. IM allows producing parts with a wide range of geometries and presents a return on investment in the medium/long term. Moreover, this transformation process presents a high fixed cost, not only due to the molds used, but also due to the many process variables that are necessary to control and optimize, to achieve the optimal processing conditions. It is exactly due to these requirements that simulation started to gain more importance in IM, being currently an indispensable step in the design phase to, among others, minimize the amount of experimental iterations needed to manufacture a tool, to decrease the overall cost of development, and to be able to produce parts with the desired geometrical and mechanical requirements. There are several proprietary software solutions available for the simulation of the IM process and related techniques [ 1 ]. However, in addition to the expensive licenses, the proprietary software Fluids 2020,5, 84; doi:10.3390/fluids5020084 www.mdpi.com/journal/fluids Fluids 2020,5, 84 2 of 24 usually cannot be adapted to specific user needs, thus preventing the access of small to medium sized companies to these tools. Open-source free alternatives may allow turning around these limitations, and, additionally, one can have access and adapt the source code. In the broad area of computational fluid dynamics (CFD), OpenFOAM R  [ 2 ] became a very interesting alternative to proprietary software, due to the range of available continuum mechanics solvers and an active development community. In what concerns to polymer processing, OpenFOAM R  [ 2 ] has been used in different areas like extrusion, blow molding, and to some extent, injection molding. In the extrusion area, many OpenFOAM R  [ 2 ] based tools are already available; for example, the work in Habla et al. [3] presented the development and validation of a model to compute the temperature distribution in the calibration stage of extruded profiles. Later, the work in Rajkumar et al. [4] presented design guidelines to support die designers to obtain balanced flow distributions. For the numerical modeling of IM, Araújo et al. [ 5 ] provided a parallel 3D unstructured non-isothermal flow solver, with both polymer and air being considered as incompressible fluids. Their results presented a good accuracy and reasonable parallel efficiency and scalability. Making use of the OpenFOAM R  [ 2 ] computational library, the work in Nagy and Steinbichler [6] introduced a framework of a compressible two-phase (air and polymer melt) fluid model, with polymer-specific material models, for the description of the filling, packing, and cooling stages. Although for simple geometries, they proved that the framework of solving the compressible form of continuity, linear momentum, and energy equations resulted in a good agreement between experimental observations and theoretical predictions. Other researchers also tried to succeed in this task. Magalhães [7] in her Master Thesis implemented the energy equation, as well as the Bird–Carreau rheological model in the interFoam solver available in the OpenFOAM R  [ 2 ] CFD library. She studied the filling stage of the IM process and implemented a boundary condition, which allowed the air to escape from the cavity, but not the polymer, as happens in real-life molds. With the use of that boundary condition in the numerical simulations, she concluded that a higher percentage of filled cavity was obtained. She also showed that differences in polymer and air viscosities were some of the main reasons for the large number of instabilities observed in the numerical calculation procedure. Recently, also aiming to model the IM process, the works in Mole et al. [8] and Krebelj and Turk [9] implemented both the Cross-WLF and modified Tait models in the compressibleInterFoam (a solver designated by openInjMoldSim ). The objective was to simulate the filling and packing stages, considering compressible flow, and applying appropriate models for the polymeric materials’ behavior. The solver was validated with a simple 2D demo test case for an amorphous polystyrene grade. Subsequently, Fontaínhas [10] in her Master Thesis used the openInjMoldSim solver with a 3D case study (a simple thin rectangular geometry) and compared the results predicted by the solver (velocity, pressure, and temperature profiles) with the ones obtained by the proprietary software Moldex 3 DR  [ 11 ]. A mesh sensitivity analysis was performed, and she reached the conclusion that the results predicted with the openInjMoldSim solver were qualitatively similar to the ones obtained with Moldex 3 DR  [ 11 ]. However, the results obtained with the mesh refinement study did not converged to a level of accuracy with statistical significance. She also reported that the open-source solver was 18 times slower than the proprietary one. This work describes the numerical validation of an open-source solver, openInjMoldSim [ 8 , 9 ], able to simulate the filling stage of the thermoplastic IM process. For that purpose, mesh sensitivity studies were performed for all the validation case studies. This way, accurate/converged solutions were obtained for all the flow fields, which could not be found in preliminary studies performed with the same numerical algorithm. For that purpose, we used the Richardson extrapolation technique to estimate the discretization error. Additionally, to the best of the authors’ knowledge, this was the first time that compressible and incompressible formulations were compared, and the effect of the artificial interface compression term was assessed for the IM filling stage. Finally, to conclude about the novel contributions of the present work, the studies performed provided a detailed comparison of open-source and proprietary software, in terms of accuracy and performance. Fluids 2020,5, 84 3 of 24 This paper is organized in the following manner: In Section 2, we present the mathematical formulation of the modeling code that is used in this work, including the governing equations and numerical discretization. In Section 3, we present a number of case studies involving the filling of cavities with Newtonian and generalized Newtonian fluids. In each case study, a comparison of the results obtained with openInjMoldSim is performed with data reported in the literature and obtained with the proprietary software Moldex 3 DR  [ 11 ], in order to assess its accuracy, robustness, and performance. Finally, in Section 4, we summarize the main conclusions of this work. 2. Mathematical Formulation In this section, we present the mathematical formulation for an algorithm that is able to handle the polymer melt filling stage of the IM process efficiently. Contrarily to the commonly used assumption of fluids’ incompressibility [ 12 ], the employed algorithm considers a compressible, non-isothermal based formulation, which, in the future, will provide a rigorous basis for the simulation of the packing and cooling stages. The implementation was performed in the open-source framework code OpenFOAM R [2,9]. 2.1. Governing Equations In the approach employed, the air and the polymer melt phases are assumed to be immiscible and compressible, unless otherwise stated. During the filling stage, the flow is governed by the mass, momentum, and energy conservation equations, which can be written as follows [1]: ∂ρ ∂t+∇ · (ρu)=0, (1) ∂(ρu) ∂t+∇ · (ρuu)=∇ · σ, (2) ∂(ρcPT) ∂t+∇ · (ρcPuT)=βT∂p ∂t+u· ∇p+p∇ · u+σ:∇u+∇ · (k∇T), (3) where u , p , and T denote the velocity vector, pressure, and temperature fields, respectively, t is the time, and σ is the total, or Cauchy, stress tensor. The parameters ρ , β , cP , and k represent the fluid density, compressibility coefficient, specific heat capacity, and thermal conductivity, respectively. The Cauchy stress tensor is given by: σ=−pI+τ, (4) where I is the identity tensor and τ is the extra or deviatoric stress tensor, which, for the flow of a compressible generalized Newtonian fluid, is defined as: τ=2η(T,p,˙ γ)D−2 3η(T,p,˙ γ) (∇ · u)I, (5) where ˙ γ=p2(D:D) = q2 tr(D2) is the generalized shear rate, with D being the deformation rate tensor defined as D= (∇u+ (∇u)T)/ 2, and η(T,p,˙ γ) is the fluid viscosity, which is considered to be a function of T,pand ˙ γ(see Section 2.1.1 for detailed information about the rheological models used in this work). The simulation of the IM filling stage requires solving the fluid flow equations and capturing the melt front location at every time step. For that purpose, an advanced free-surface capturing model [ 13 ], based on the volume-of-fluid (VOF) method [ 14 ] is used. In this method, a species transport equation is used to track the relative volume fraction of the two phases, or phase fraction, α , Fluids 2020,5, 84 4 of 24 distribution. The phase fraction ranges from zero to one, zero being for air and one for the polymer melt. In this way, the fluid interface is located in regions where 0 <α< 1, and the physical properties can be calculated as an average weighted by α, as follows: ψ=ψmα+ψa(1−α), (6) where the subscripts m and a denote the melt and air phases’ properties, respectively, and ψ represents all the relevant fluid properties, namely ρ , η , cP , and k . The governing equation for the phase fraction, α, is defined as: ∂α ∂t+∇ · (αu)+∇ · [α(1−α)ur]=Sp+Su, (7) where ur is the relative velocity vector, commonly denominated by “compression velocity”. In this work, the compression velocity is given by: ur=nfmin  Cα|φ| Sf ,max  |φ| Sf  , (8) where φ is the volume flux at faces, Sf is the face normal vector pointing outwards from the cell, and Cα is an adjustable coefficient that determines the magnitude of the compression (usually Cα⩾ 1) [15]. nfis the interface unit normal vector taken from the phase fraction distribution as: nf=(∇α)f (∇α)f+δ , (9) where δis a stabilization factor [15]. The artificial interface compression term is an extra term added to the phase fraction evolution equation and is non-zero only when 0 <α< 1, i.e., at the fluid interface, and avoids its numerical diffusion (notice that in reality, the two fluid flow presents a sharp interface) [ 16 ]. Otherwise, a significant diffusion of α at the interface region might occur, predicting a nonphysical smeared interface, especially with coarse meshes. Spand Surepresent two terms that arise from considering a compressible material [ 16 ]. Detailed information about the advanced free-surface capturing model used in this work can be found in Berberovi´c et al. [13]. 2.1.1. Constitutive Models The rheological behavior of the melt and air phases is defined by a single-fluid two-phase model, where the average kinematic viscosity is given by Equation (6), in which ψ is replaced by the viscosity η . For the air phase, the kinematic viscosity is assumed to be constant, i.e., a Newtonian fluid. For the polymer melt, the Cross-WLF constitutive model is employed. This constitutive model is widely adopted for studying both the filling and packing stages of the IM process [ 17 ] and is given by: ηm(T,p,˙ γ)=η0(T,p) 1+(η0(T,p)˙ γ/τ∗)1−n, (10) where τ∗ is the material constant representing the shear stress, above which the pseudoplastic behavior of the melt is observed, n is the power-law index, and η0(T,p) is the viscosity at the null shear rate. In this work, we adopted the Williams–Landel–Ferry (WLF) model [ 18 ] to describe the dependence of η0on Tand p, given by: η0(T,p)=D1exp −C1(T−T0) C2+T−T0, (11) Fluids 2020,5, 84 5 of 24 where T0=D2+D3p and D1 , D2 , D3 , C1 , and C2 are parameters determined by experimental characterization [6]. 2.1.2. Equation of State Polymers shrink when pressure increases; thus, their specific volume (the reciprocal of the density) decreases [ 19 ]. On the other hand, with the increase of temperature, polymeric materials tend to expand, and, consequently, their specific volume increases. The relation of specific volume, pressure, and temperature is designated by the pressure-volume-temperature behavior (PVT) [ 20 ]. The most commonly used model to characterize the material PVT behavior of polymer melts is the modified Tait model [ 21 ], because it can describe properly the PVT relation of both amorphous and semi-crystalline polymers [19]. In the modified Tait model, the specific volume, b V, is given by: b V=c V0h1−Cln 1+p Bi+b Vt, (12) where: c V0=(b1S+b2S(T−b5), if T≤Tt b1L+b2L(T−b5), if T>Tt , (13) B=(b3Sexp (−b4S(T−b5)) , if T≤Tt b3Lexp (−b4L(T−b5)) , if T>Tt , (14) b Vt=(b7exp (b8(T−b5)−b9p), if T≤Tt 0, if T>Tt , (15) where C= 0.0894 is a dimensionless constant, the coefficients b1 to b9 are obtained by fitting experimental characterization data, and p and T are the material pressure and temperature, respectively [ 19 ]. The subscripts S , L , and t represent solid, liquid (or melt), and transition states, respectively. The transition temperatures for semi-crystalline and amorphous polymers are the melt (Tm) and glass (Tg) transition temperatures, respectively. The equation of state employed for the air phase is the ideal gas equation given by: ρ=p RT , (16) where Ris the ideal gas constant (R=8.314 J/(K.mol)). 2.2. Numerical Discretization The numerical solution of the equations presented in Section 2.1 relies on a collocated finite volume method (FVM) approach, which uses the conservative integral forms of the governing equations for the single-fluid two-phase model [ 22 ]. The implementation of the three conservation equations (continuity, momentum, and energy) is done using the OpenFOAM R  computational library [ 2 , 23 ]. For more details about the solver employed in this work, the reader is referred to Mole et al. [8] and Krebelj and Turk [9]. 3. Validation Case Studies This section presents the case studies employed for the validation of the solver applied to the filling stage of the IM process ( openInjMoldSim ) presented in Section 2. The first case study was devoted to the flow along a cylindrical channel, in which the fluid was considered to have Newtonian rheology. The objective was to make a comparison of the obtained numerical velocity and pressure fields with an analytical solution available for steady-state conditions [ 24 ]. In the second case study, an assessment Fluids 2020,5, 84 6 of 24 of the effect of the material compressibility in the filling stage of the IM process, in a rectangular cavity with a cylindrical insert, is presented. Finally, a detailed comparison between openInjMoldSim and Moldex3D R  [ 11 ] was performed in a more complex geometry, the cavity of a mold employed to manufacture tensile test specimens, a part representative of the typical ones produced by the IM process, which was used for material mechanical characterization purposes [24,25]. In all case studies considered in this work, the domain was divided into inlet, outlet, and boundary walls. Moreover, a fixed velocity was imposed at the inlet boundary patch, and at the same location, the homogeneous Neumann boundary condition was applied for the pressure field. Additionally, the no-slip velocity was imposed at the cavity walls. Furthermore, the walls only experience heat flux modeled by heat convection. Since the initial and boundary conditions were similar for all case studies, for organization purposes, Table 1shows the default initial and boundary conditions for all case studies. The particularities of each case study will be presented in the respective subsection. Table 1. Initial and boundary conditions for all case studies. Temperature (T) Velocity (U) Pressure (P) Phase Fraction (α) Inlet 230 ◦CUin Null normal gradient 1 Outlet Null normal gradient Null normal gradient 105Pa (atmospheric) Null normal gradient Walls Heat convection Tmold = 50 ◦C h = 1250 W/(m2. K) Null velocity Null normal gradient Null normal gradient Initial Condition 230 ◦C Null velocity 105Pa (atmospheric) 0 The material used in the simulations was the GPPS (general purpose polystyrene) Styron 678, from Americas Styrenics. The rheological model employed was the Cross-WLF presented in Section 2, and its parameters are given in Table 2. These parameters were obtained from the Moldex 3 DR  [ 11 ] materials database. The variation of viscosity with shear-rate, temperature, and pressure is given in Figure 1, which shows that the viscosity of the polymer melt decreases with the increase of both the shear-rate and the temperature. Table 2. Cross-WLF coefficients for GPPS (general purpose polystyrene) Styron 678 from Americas Styrenics [11]. Parameter Value n0.2903 τ∗(Pa)13,678 D1(Pa.s)7.44 ×1010 D2(K)373.15 D3(K/Pa)0.0 A125.971 A2(K)51.6 Fluids 2020,5, 84 7 of 24 1 10 100 1,000 10,000 110 100 1,000 10,000 100,000 Viscosity (Pa.s) Shear rate (1/s) T = 180 °C T = 213.3 °C T = 246.7 °C T = 280 °C Figure 1. Variation of the viscosity with shear-rate and temperature for the GPPS Styron 678. As stated before, the air was assumed to be a Newtonian fluid by making use of the Newtonian rheological model, and by setting a dynamic viscosity equal to 0.1 Pa.s. Additionally, the thermodynamic properties, specific heat capacity, cp , and thermal conductivity, k , were defined as 1007 J/(kg.K) and 0.0263 W/(m.K), respectively, for the air and 2100 J/(kg.K) and 0.15 W/(m.K), respectively, for the polymer melt. The PVT behavior of the material was modeled using the modified Tait model, illustrated in Figure 2. The compressibility model adopted show that the specific volume of the material decrease with the increase of pressure, and increase with the increase of temperature following a slope until T g (glass transition temperature) is reached. After T g , the slope increases (as is commonly observed in amorphous polymers). 0.90 0.95 1.00 1.05 1.10 1.15 1.20 050 100 150 200 250 300 Specific volume (cm3/g) Temperature (°C) P = 0 MPa P = 50 MPa P = 100 MPa P = 150 MPa P = 200 MPa Figure 2. Variation of the polymer specific volume with temperature and pressure fields for the GPPS Styron 678. Fluids 2020,5, 84 8 of 24 The coefficients of the modified Tait model are shown in Table 3. These coefficients were obtained from the Moldex3DR materials database [11]. Table 3. Modified Tait model coefficients for the GPPS Styron 678 from Americas Styrenics [11]. Parameters Compressible Formulation b1m(m3/kg) 0.0009881 b2m(m3/(kg.K)) 7.03 ×10−7 b3m(Pa) 1.71 ×108 b4m(1/K) 0.004495 b1s(m3/kg) 0.0009873 b2s(m3/(kg.K)) 2.89 ×10−7 b3s(Pa) 2.43 ×108 b4s(1/K) 0.003106 b5(K) 373.98 b6(K/Pa) 2.88 ×10−7 b7(m3/kg) 0 b8(1/K) 0 b9(1/Pa) 0 In the analysis of the case studies presented below, the methodologies used are common to more than one case study. Therefore, for organization purposes, the methods for assessment and verification used are presented here: IC and NIC variations : The abbreviation “IC” stands for interface compression, which means that the artificial interface compression term of Equation (7) is considered, and the abbreviation “NIC” stands for the simulation where it was neglected. Switch-over time : The time for the polymer melt to reach the switch-over position. This is an important instant for the analysis of the numerical calculation, since it coincides with the transition of the filling to the packing/holding stages. Assuming incompressibility, the equation to calculate the time the polymer melt takes to reach the switch-over point, tSO, is given by: tSO =V A×Uin , (17) where Uin is the imposed average velocity at the inlet face, A the area of the inlet face, and V the volume at the switch-over point. In all the case studies presented, the switch-over point was assumed to occur when 98% of the total cavity volume is filled, which is a value commonly employed in the IM process [26]. Average properties : For assessment purposes, throughout the three case studies, minimum, average, and maximum properties were calculated. Considering a number of cells n , the average values are given by: θ= n ∑ i=1 (|Ci|×θi) |Ci|, (18) where |Ci| can be either the cell face area, when analyzing a cross-section, or the cell volume, when analyzing all the geometry. When |Ci|is constant Equation (18) becomes the arithmetic mean. Richardson’s extrapolation (RE) : This is a widely employed method to estimate discretization errors [ 27 ]. It can be applied to any discretization procedure, either for differential or integral governing equations, such as the FVM [ 28 ]. This method was used in this work to extrapolate the value of the Fluids 2020,5, 84 9 of 24 variable under analysis to an infinitely refined mesh and, thus, allowed estimating the accuracy of the results at each level of mesh refinement. For a detailed description of this technique see Appendix A. 3.1. Case Study 1: Filling of a Cylindrical Cavity This first case study covered the flow of a Newtonian fluid along a cylindrical channel and was used to verify if the numerical algorithm was properly implemented. The cavity geometry employed in this first case study is illustrated in Figure 3. inlet walls outlet 𝜙20 Figure 3. Geometry of the cylindrical cavity for Case Study 1 (dimensions in mm). The initial and boundary conditions used in this case study are presented in Table 1, with an inlet velocity of Uin = 4 m/s. The mesh sensitivity analysis was undertaken with three levels of refinement, where the number of cells of the coarsest mesh (M1) was doubled in each direction to obtain the second degree of refinement (M2). The same procedure was applied to obtain the most refined level (M3). The software c f Mesh [29] was used to generate the three meshes, which had 4368, 34,280, and 263,016 cells for M1, M2, and M3, respectively. The polymer melt was considered to behave as a Newtonian fluid, with a dynamic viscosity value of 310.0 Pa.s, obtained by using n= 1 in the Cross-WLF rheological model presented in Section 3. The thermodynamic properties of the air and polymer melt are also the ones presented in Section 3. The PVT behavior of the material was prescribed using two formulations, the compressible one, given by the modified Tait model, which was already shown in Figure 2and Table 3, and the incompressible, where the melt density employed was constant and equal to 1.075 g/cm3. The first tests carried out were related to the time predicted by the algorithm to achieve the switch-over point, tSO , for the incompressible formulation and to compare it with the theoretical value calculated from Equation (17). The results obtained are given in Table 4for both the IC and NIC variations. Table 4. Comparison of the switch-over time obtained for the incompressible formulation, considering both interface compression (IC) and neglecting IC (NIC) variations. The analytical reference value calculated from Equation (17) is tSO =0.0245 s. Mesh IC NIC tSO (s) Error (%) tSO (s) Error (%) M1 0.0249 1.630 0.0462 88.60 M2 0.0246 0.408 0.0250 2.040 M3 0.0230 6.120 0.0247 0.816 Fluids 2020,5, 84 16 of 24 4 50 Main runner Sprue Secondary runner Gate Transverse direction Thickness direction Inlet walls Outlet Figure 8. Geometry and boundary walls for Case Study 3 (dimensions in mm). The initial and boundary conditions, prescribed in the OpenFOAM R  [ 2 ] library, are presented in Table 1, with an inlet velocity of Uin = 1.4 m/s. In Moldex 3 DR  [ 11 ], being proprietary software, many features cannot be defined by the user, as will be shown below for the pressure field. Anyway, the flow rate imposed in Moldex 3 DR  [ 11 ] and OpenFOAM R  [ 2 ] was the same and equal to Q=15.7 cm3/s . The temperature boundary conditions were also the same. The pressure field could not be accessed in the proprietary software and, therefore, was the only boundary condition that could not be imposed to be equal in both software. Since the objective of this study was to make a comparison between the two software, it would be useful to perform the simulations with the same meshes. However, as Moldex 3 DR  [ 11 ] only accepts meshes generated in its workbenches, and OpenFOAM R  [ 2 ] could not import those meshes. Consequently, the simulations could not be made exactly in the same meshes. Therefore, the approach employed was to make simulations in meshes with a similar number of cells, until reaching mesh converged results. The same procedure employed in the previous case studies for the mesh sensitivity analysis was also followed here. Tables 10 and 11 describe the meshes used in openInjMoldSim and Moldex 3 DR  [ 11 ], respectively. The utility c f Mesh [ 29 ] was used to generate the meshes for openInjMoldSim ; specifically, the Cartesian mesh application was employed to generate the majority of hexahedral cells. The Moldex 3 DR  [ 11 ] meshes were created using the program workbench Moldex 3 D R 16 Designer [ 11 ], applying a boundary layer mesh (BLM). The need to have an additional level of mesh refinement in Moldex3DR [11] will be explained below. Table 10. openInjMoldSim meshes employed in Case Study 3. Mesh Number of Cells Cells along Transverse Direction Cells along Thickness Direction M1 30,091 8 5 M2 272,149 18 11 M3 2,110,987 37 21 Fluids 2020,5, 84 17 of 24 Table 11. Moldex3D R [11] meshes employed in Case Study 3. Mesh Number of Cells Cells along Transverse Direction Cells along Thickness Direction M1 29,625 8 2 M2 272,409 12 5 M3 2,101,139 26 10 M4 15,304,010 54 21 Tables 10 and 11 show that the number of cells for each mesh refinement level are very close for both software. Additionally, the number of cells for each direction of the tensile test specimen was duplicated in consecutive mesh refinement levels, and consequently, the total number of cells presented a factor of approximately eight. A detailed view of mesh M2 is illustrated in Figure 9for both software. Figure 9. Mesh M2 for Moldex3DR [11] (left) and openInjMoldSim (right). The fluids employed in the simulation of the filling of the tensile test specimen were equal to the ones presented in the previous case study, and their properties are given in the introduction of Section 3. Again, the polymer melt was modeled as a generalized Newtonian fluid, while the air was assumed to present a Newtonian behavior. The aim of the mesh sensitivity analysis was to identify the refinement level required to obtain mesh independent results. To verify the level of refinement needed to ensure the desired accuracy, the Richardson’s extrapolation [ 30 ] was applied to the pressure field. Table 12 shows the values of the maximum pressure generated in the tensile test specimen cavity, the respective extrapolated value (RE), and the associated errors for both software. The values considered in this analysis were the ones corresponding to the switch-over point. Table 12. Maximum pressure values obtained with the proprietary software Moldex 3 DR  [ 11 ] and the open-source software openInjMoldSim at the switch-over point. The Richardson’s extrapolated (RE) values and the relative errors are also presented. Mesh Moldex3DR [11]openInjMoldSim Maximum Pressure (MPa) Error (%) Maximum Pressure (MPa) Error (%) M1 7.18 43.4 7.76 29.6 M2 8.32 34.4 14.07 27.8 M3 9.66 23.8 12.01 9.1 M4 11.61 8.41 - - RE 12.68 - 11.01 - Fluids 2020,5, 84 18 of 24 From Table 12, it is possible to understand the reason for the existence of four levels of mesh refinement in Moldex 3 DR  [ 11 ]. For this software, the error for mesh M3 was still very high ( > 20%); therefore, a fourth mesh was employed, which allowed reaching the same order of accuracy of openInjMoldSim . It is important to notice that the maximum values are more difficult to compute, since they tend to have larger errors, due to the fact that they were local values and, therefore, presenting larger sensitivity to numerical errors. Figure 10 shows the contour of the pressure field distribution in the cavity at the switch-over point. The pressure profiles obtained in both software are qualitatively identical, when using the most refined meshes for both (M4 for Moldex 3 DR  and M3 for openInjMoldSim ). However, as also shown in Figure 10, the melt flow front predicted by the open-source software seemed more realistic than that of the proprietary counterpart, which present a plug-like surface. openInjMoldSim Moldex3D Figure 10. Pressure distribution at the switch-over point and melt flow front shape predicted by the most refined mesh of both software. Additionally, as illustrated in Figure 11, the inlet pressure evolution along time was also monitored and compared between both software, using the results obtained with the most refined mesh. 0 2 4 6 8 10 12 14 00.1 0.2 0.30.4 0.5 0.60.7 0.8 0.91.0 Pressure (MPa) t/tSO openInjMoldSim (M3) Moldex3D (M4) Figure 11. Time evolution of the inlet pressure obtained with the most refined mesh for both openInjMoldSim and Moldex3DR [11] software. Fluids 2020,5, 84 19 of 24 The melt pressure evolution presented some perturbations, which were compared with the progression of the melt flow front. The time intervals where the pressure evolution was perturbed were 0.1 <t/tSO < 0.2, 0.3 <t/tSO < 0.4, and 0.5 <t/tSO < 0.8. The evolution of the melt flow front for the first interval is illustrated in Figure 12. This perturbation in the pressure field was only predicted by Moldex 3 DR  [ 11 ], but this behavior seems strange because at t/tSO = 0.1, the melt flow front was already at the main runner. t/tSO 0.100.15 0.20 openInjMoldSimMoldex3D® Figure 12. Melt front location for t/tSO = 0.1, 0.15, and 0.2 predicted by both openInjMoldSim and Moldex3DR [11]. The melt flow front evolution for the second perturbation identified on the inlet pressure evolution is shown in Figure 13, and it coincides with the flow of the melt through the gate. This second perturbation was only predicted by the openInjMoldSim software. t/tSO 0.310.360.41 openInjMoldSimMoldex3D® Figure 13. Melt front location for t/tSO = 0.31, 0.36, and 0.41 predicted by both openInjMoldSim and Moldex3DR [11]. As explained before, the gate was a very small and thin channel; thus, it presented a high resistance to the flow, which justifies the change in the slope on the pressure evolution [19]. The flow front location for the last perturbation observed in the time evolution of the inlet pressure is illustrated in Figure 14. As shown, this interval corresponds to the flow of the melt front through the thinner region of the tensile test specimen. As the cross-section is narrower in that location, a change of the slope in the pressure evolution was expected. Fluids 2020,5, 84 20 of 24 t/tSO 0.510.660.81 openInjMoldSim Moldex3D® Figure 14. Melt front location for t/tSO = 0.51, 0.66, and 0.81 predicted by both openInjMoldSim and Moldex3DR [11]. The graph presented in Figure 11 shows that for openInjMoldSim , the slope of the curve was higher in the third interval, when compared to the periods before and after it. In Moldex 3 DR  [ 11 ] for M4, the pressure evolution curve presents several nonphysical oscillations; however, the pressure is still increasing, as expected. Finally, a general overview of the accuracy and performance of both software can be obtained from the data presented in Table 13, where the errors that correspond to the three variables (pressure, velocity, and temperature), as well as the execution time for each level of mesh refinement are given. Table 13. General comparison of the accuracy and performance of both openInjMoldSim and Moldex3DR [11]. Software Mesh Errors (%) Number of Cores Execution Time Pmax Umax Tmax M1 43.4 14.2 0.7 1 88 s M2 34.4 19.6 0.6 1 23 min M3 23.8 20.4 0.5 8 3.8 h Moldex3D R [11] M4 8.41 7.22 0.2 8 24.5 h M1 29.6 33.2 1.0 1 12.8 h M2 27.8 26.7 0.1 8 41 h 48 98.5 h 96 59 h openInjMoldSim M3 9.1 8.2 0.0 192 34 h From the results shown in Table 13, one can conclude that, in general, openInjMoldSim present better accuracy than Moldex 3 DR  [ 11 ], with the exception of the temperature field, where the errors are similar. In order to reach the same accuracy for all fields, Moldex 3 DR  [ 11 ] needed at least one more degree of mesh refinement than openInjMoldSim . It should be noticed that for the proprietary Fluids 2020,5, 84 21 of 24 software, the results did not converge asymptotically with the mesh refinement, which forced to use the Richardson’s extrapolation approach given by Equation (A1), and estimate the apparent order. In terms of performance, the proprietary software was clearly faster than the open-source for the same level of refinement. Moldex 3 DR  [ 11 ] was 523, 107, and 9 times faster than openInjMoldSim , respectively for M1, M2, and M3, although they were not computed with the same number of cores. However, when analyzing degrees of mesh refinement for the same accuracy, M3 for openInjMoldSim and M4 for Moldex 3 DR  [ 11 ], the proprietary software was only 1.4 times faster than the open-source one; however, the number of cores used was not the same. Notice that, since Moldex 3 DR  [ 11 ] is a proprietary software, there is a restricted number of licenses, which did not allow us to solve the problem with more cores. On the other side, since in OpenFOAM R  [ 2 ] the only limitation is the computational resources available, if the number of cores are increased, a similar calculation time could be obtained. 4. Conclusions A numerical formulation available in the open-source computational library OpenFOAM R  [ 2 ], the openInjMoldSim solver, was assessed in different test cases related to the simulation of the filling stage of the injection molding process. The verification/validation of the open-source solver was performed with three case studies, where the results obtained with the open-source solver were compared both with analytical solutions, for simpler case studies, and with results obtained with Moldex 3 DR  [ 11 ], a proprietary software widely employed in the industry. The first case study allowed identifying the more appropriate modeling setup and to understand some details of the numerical algorithm developed to describe the injection molding process, by considering the simplified Newtonian constitutive model. The results obtained with this first case study allowed us to conclude that the artificial interface compression term, presented in the volume of fluid formulation, provided better results for coarse and medium meshes, but in refined meshes, it affected the mass conservation negatively. Furthermore, the open-source solver predictions presented a good agreement with the analytical reference solutions. Finally, the compressible formulation did not present substantial differences in relation to the incompressible one. In the second case study, two formulations for the equation of state (compressible and incompressible) based on the modified Tait model were used. This study allowed verifying that in the presence of incompressible formulations, the performance of the numerical algorithm was improved without a significant loss of accuracy. This observation further indicated that incompressible formulations were a good approximation for the filling stage of the injection molding process and may be a way of increasing the overall calculation efficiency. In the third case study, the results obtained with openInjMoldSim and Moldex 3 DR  [ 11 ] were compared. The open-source software presented results that practically converged, i.e., with relative errors below 10% within three levels of mesh refinement. Additionally, its accuracy was better than the proprietary software for each level of mesh refinement. In order to reach the same accuracy obtained with openInjMoldSim , Moldex 3 DR  [ 11 ] required an additional level of mesh refinement. Moreover, the latter did not present asymptotic convergence of the errors with the mesh refinement. Furthermore, a few nonphysical results were obtained with the proprietary software, both in terms of the flow front shape, and in the evolution of inlet pressure, in which, for instance, the flow of the melt front through the gate could not be identified. The open-source software did not present similar limitations. All these results led to the conclusion that the openInjMoldSim solver presented a better accuracy than Moldex 3 DR  [ 11 ]. In terms of performance, the scenario was reversed, with Moldex 3 DR  [ 11 ] being clearly faster than the openInjMoldSim solver. However, one of the main limitations of the proprietary software is the number of licenses available. Therefore, if there were enough computational resources available, open-source software could match the calculation speed of the proprietary one. Fluids 2020,5, 84 22 of 24 In summary, the results presented here showed that the injection molding code, developed using an open-source framework, could be used to model the filling stage of injection molding processes accurately. However, additional studies should be made to improve the calculation performance. Author Contributions: Conceptualization, J.M.N. and C.F.; Methodology, J.P., B.R., J.M.N. and C.F.; Formal Analysis, J.P., J.M.N. and C.F.; Writing—Original Draft Preparation, J.P. and C.F.; Writing—Review & Editing, J.P., B.R., J.M.N. and C.F.; Supervision, J.M.N. and C.F.; Project Administration, J.M.N.; Funding Acquisition, J.M.N. All authors read and agreed to the published version of the manuscript. Funding: This work is funded by FEDER funds through the COMPETE 2020 Programme and National Funds through FCT (Portuguese Foundation for Science and Technology) under the projects UID-B/05256/2020, UID-P/05256/2020, MOLDPRO-Aproximações multi-escala para moldação por injeção de materiais plásticos (POCI-01-0145-FEDER-016665), and FAMEST-Footwear, Advanced Materials, Equipment’s and Software Technologies (POCI-01-0247-FEDER-024529). Acknowledgments: The authors would like to acknowledge the Minho University cluster under the project NORTE-07-0162-FEDER-000086 and the Minho Advanced Computing Center (MACC) for providing HPC resources that contributed to the research results reported within this paper. Conflicts of Interest: The authors declare no conflicts of interest. Appendix A Richardson’s extrapolation is usually applied when the values of a property θ are known for three meshes with the same grid refinement factor ratio between them [ 27 ]. In this case, the Richardson extrapolation is given by: θext =Rapθ2−θ3 Rap −1, (A1) where, ap =ln |(θ3−θ2)/(θ2−θ1)| ln R, (A2) and then, the error is estimated by: ei(%) = θi−θext θext ×100, (A3) where θext is the variable of interest that we want to extrapolate, the subscripts 3, 2,1 represent the value of the variable obtained for the three levels of mesh refinement, and ap is the apparent order, given by Equation (A2) . R is the grid refinement factor that should be greater than 1.3 [ 31 ]. In all case studies presented in this work, we assumed the value of two; consequently, the number of cells in each direction was doubled for consecutive mesh refinement levels [ 31 ]. Following a common procedure, in this work, the results were considered to be converged when the relative error, given by Equation (A3) , was below 5% [27]. The above relation of Richardson’s extrapolation relied on the assumption that the convergence is asymptotic [ 31 ]. However, in several cases, this did not happen, and oscillatory convergence was observed for the variables [ 27 ]. In those cases, instead of using Equation (A1) , a different variation of the method could be used. Assuming that ap was the order of accuracy of the discretization schemes used in the calculation procedure, instead of using three meshes, the extrapolated value could be obtained by Equation (A1) using only the two most refined meshes [32]. References 1. Kennedy, P.; Zheng, R. Flow Analysis of Injection Molds, 2nd ed.; Hanser: Munich, Germany, 2001. 2. OpenFOAM. The Open Source CFD Toolbox. Available online: https://www.openfoam.com/ (accessed on 27 May 2020). Fluids 2020,5, 84 23 of 24 3. Habla, F.; Fernandes, C.; Maier, M.; Densky, L.; Ferrás, L.L.; Rajkumar, A.; Carneiro, O.S.; Hinrichsen, O.; Nóbrega, J.M. Development and validation of a model for the temperature distribution in the extrusion calibration stage. Appl. Therm. Eng. 2016,100, 538–552. [CrossRef] 4. Rajkumar, A.; Ferrás, L.L.; Fernandes, C.; Carneiro, O.S.; Nóbrega, J.M. Guidelines for balancing the flow in extrusion dies: The influence of the material rheology. J. Polym. Eng. 2017,38, 197–211. [CrossRef] 5. Araújo, B.J.; Teixeira, J.C.F.; Cunha, A.M.; Groth, C.P.T. Parallel three-dimensional simulation of injection molding process. Int. J. Numer. Methods Fluids 2009,59, 801–815. [CrossRef] 6. Nagy, J.; Steinbichler, G. Fluid Dynamic and Thermal Modeling of the Injection Molding Process in OpenFOAM. In OpenFOAM Selected Papers of the 11th Workshop; Nóbrega, J.M., Jasak, H., Eds.; Springer: Cham, Switzerland, 2019. 7. Magalhães, A. OpenFOAM Simulation of the Injection Moulding Filling Stage. Master’s Thesis, Integrated Master in Polymer Engineering, University of Minho, Braga, Portugal, September 2016. Available online: http://repositorium.sdum.uminho.pt/handle/1822/65291 (accessed on 27 May 2020). 8. Mole, N.; Krebelj, K.; St ˇ ok, B. Injection molding simulation with solid semi-crystalline polymer mechanical behavior for ejection analysis. Int. J. Adv. Manuf. Technol. 2017,93, 4111–4124. [CrossRef] 9. Krebelj, K.; Turk, J. An Open–Source Injection Molding Simulation. A Solver for OpenFOAM. Available online: https://github.com/krebeljk/openInjMoldSim (accessed on 10 September 2019). 10. Fontaínhas, A. Injection Moulding Simulation Using OpenFOAM. Master’s Thesis, Integrated Master in Polymer Engineering, University of Minho, Braga, Portugal, 2019. Available online: https://www.researchgate.net/ publication/341448307_Injection_moulding_simulation_using_OpenFOAM (accessed on 27 May 2020). 11. Moldex 3D. Plastic Injection Molding Simulation Software. Available online: https://www.moldex3d.com/ (accessed on 27 May 2020). 12. Pichelin, E.; Coupez, T. Finite element solution of the 3D mold filling problem for viscous incompressible fluid. Comput. Methods Appl. Mech. Eng. 1998,163, 359–371. [CrossRef] 13. Berberovi´c, E.; van Hinsberg, N.P.; Jakirli´c, S.; Roisman, I.V.; Tropea, C. Drop impact onto a liquid layer of finite thickness: Dynamics of the cavity evolution. Phys. Rev. E 2009,79, 036306. [CrossRef] [PubMed] 14. Hirt, C.W.; Nichols, B.D. Volume of fluid (VOF) method for the dynamics of free boundaries. J. Comput. Phys. 1981,39, 201–225. [CrossRef] 15. Haider, J. Numerical Modelling of Evaporation and Condensation Phenomena. Master’s Thesis, Universität of Stuttgart, Stuttgart, Germany, 2013. 16. Rusche, H. Computational Fluid Dynamics of Dispersed Two-Phase Flows at High Phase Fractions. Ph.D. Thesis, Department of Mechanical Engineering from the Imperial College of Science, Technology and Medicine, University of London, London, UK, 2002. 17. Chiang, H.H.; Hieber, C.A.; Wang, K.K. A unified simulation of the filling and postfilling stages in injection molding. Part I: Formulation. Polym. Eng. Sci. 1991,31, 116–124. [CrossRef] 18. Williams, M.L.; Landel, R.F.; Ferry, J.D. The Temperature Dependence of Relaxation Mechanisms in Amorphous Polymers and Other Glass-forming Liquids. J. Am. Chem. Soc. 1955,77, 3701–3707. [CrossRef] 19. Zhou, H. Computer Modelling for Injection Molding; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2013. 20. Rees, H. Understanding Injection Mold Design; Hanser Publications: Cincinnati, OH, USA, 2001. 21. Tait, P.G. Physics and Chemistry of the Voyage of H.M.S. Challenger; HMSO: London, UK, 1888; Volume 2, pp. 941–951. 22. Ferziger, J.H.; Peric, M. Computational Methods for Fluid Dynamics; Springer: Cham, Switzerland, 2001. 23. Jasak, H. Error Analysis and Estimation for the finite Volume Method with Application to Fluid Flows. Ph.D. Thesis, Imperial College, University of London, London, UK, 1996. 24. Liang, J.; Luo, W.; Huang, Z.; Zhou, H.; Zhang, Y.; Zhang, Y.; Fu, Y. A robust finite volume method for three-dimensional filling simulation of plastic injection molding. Eng. Comput. 2017 ,34, 814–831. [CrossRef] 25. Kim, K.H.; Isayev, A.I.; Kwon, K.; van Sweden, C. Modelling and experimental study of birefringence in injection molding of semicrystalline polymers. Elsevier Polym. 2005,46, 4183–4203. [CrossRef] 26. Rosato, D.V.; Rosato, M.G. Injection Molding Handbook; Springer: Cham, Switzerland, 2000. 27. Celik, I.; Ghia, U.; Freitas, C.J.; Coleman, H.; Raad, P.E. Procedure for Estimation and Reporting of Uncertainty Due to Discretization in CFD Applications. J. Fluids Eng. 2008,130, 1–4. [CrossRef] 28. Oberkampf, W.L.; Trucano, T.G.; Hirsch, C. Verification, validation, and predictive capability in computational engineering and physics. Appl. Mech. Rev. 2004,57, 345–384. [CrossRef] Fluids 2020,5, 84 24 of 24 29. Juretic, F. A Library for Automatic Mesh Generation. Available online: https://cfmesh.com/cfmesh/ (accessed on 27 May 2020). 30. Richardson, L.F. On the Approximate Arithmetical Solution by Finite Differences of Physical Problems Involving Differential Equations, With an Application to the Stresses in a Masonary Dam. Philos. Trans. R. Soc. Lond. 1910,210, 307–357. [CrossRef] 31. Celik, I.; Karatekin, O. Numerical experiments on application of Richardson extrapolation with non-uniform grids. J. Fluids Eng. 1997,119, 584–590. [CrossRef] 32. Fernandes, C.; Faroughi, S.A.; Carneiro, O.S.; Miguel Nóbrega, J.; McKinley, G.H. Fully-resolved simulations of particle-laden viscoelastic fluids using an immersed boundary method. J. Non Newton. Fluid Mech. 2019 , 266, 80–94. [CrossRef] c 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).