scieee AI-readable full text Open interactive document viewer

Development of a utility in OpenFOAM to predict fiber orientation in fiber reinforced thermoplastic materials

Oliveira, Marta Cláudia Baptista

Abstract

Os termoplásticos reforçados com fibras utilizam frequentemente fibras de vidro ou carbono para melhorar as propriedades de termoplásticos simples. As propriedades deste tipo de materiais compósitos depende das propriedades dos seus constituintes base, no ambiente termo-mecânico desenvolvido durante o seu processamento e nos parâmetros de distribuição das fibras, nomeadamente a sua concentração e orientação, tendo a última uma relevância maior na propriedades finais da peça. Atualmente existem vários modelos fenomenológicos desenvolvidos com o objetivo de prever a evolução da orientação das fibras para diversos fluxos. Alguns destes modelos estão presentes em software proprietário, cujo acesso ao código é limitado ou inexistente, o que compromete a verificação e adaptação do mesmo. Como alternativa, software de código-aberto oferecem aos utilizadores acesso irrestrito ao código, permitindo assim análises cientificas detalhadas e contínuo melhoramentos. O OpenFOAM® é uma biblioteca computacional de fonte aberta, que contém diversos solvers capazes de simular diferentes problemas da mecânica computacional, com especialização na dinâmica computacional de fluídos, o que o torna uma ferramenta adequada para o trabalho a realizar. Neste dissertação é proposta uma estratégia inovadora para a implementação de um modelos estado-de-arte de orientação de fibras no ambiente do OpenFOAM®. Os modelos foram implementados na forma de um utilitário, que pode ser utilizado juntamente com outros solvers, desde que exista acesso ao campo de velocidades. Com a finalidade de realizar verificações numéricas, foi desenvolvido um código em python capaz de calcular a evolução da orientação das fibras num domínio sujeito a um campo de velocidades variável e os resultados obtidos foram verificados com base em informação obtida da literatura. Este código foi posteriormente implementado como uma referência para verificar o utilitário introduzido no OpenFOAM®, que foi testado em casos semelhantes aos encontrados em condições realistas para típicas aplicações poliméricas, como fluxo de corte simples e estiramento, tal como o fluxo na injeção de um disco ao centro. Os resultados obtidos nos casos de estudo permitiram concluir que a implementação dos modelos foi adequada, o que transforma esta ferramenta numa alternativa confiável a software proprietário, para a previsão da evolução da orientação de fibras em diversos tipos de fluxo.

Full text

Universidade do Minho Escola de Engenharia Marta Cláudia Baptista Oliveira Development of a utility in OpenFOAM to predict fiber orientation in fiber reinforced thermoplastic materials October 2023 UMinho | 2023 Marta Oliveira Development of a utility in OpenFOAM to predict fiber orientation in fiber reinforced thermoplastic materials Marta Cláudia Baptista Oliveira Development of a utility in OpenFOAM to predict fiber orientation in fiber reinforced thermoplastic materials Master's Dissertation Integrated Masters in Polymer Engineering Work accomplished under the supervision of: Professor Doctor João Miguel Nóbrega MSc. Bruno Ramôa Universidade do Minho Escola de Engenharia October 2023 Direitos de autor e condições de utilização do trabalho por terceiros Este é um trabalho académico que pode ser utilizado por terceiros desde que respeitadas as regras e boas práticas internacionalmente aceites, no que concerne aos direitos de autor e direitos conexos. Assim, o presente trabalho pode ser utilizado nos termos previstos na licença abaixo indicada. Caso o utilizador necessite de permissão para poder fazer um uso do trabalho em condições não previstas no licenciamento indicado, deverá contactar o autor, através do RepositóriUM da Universidade do Minho. Licença concedida aos utilizadores deste trabalho: Atribuição CC BY https://creativecommons.org/licenses/by/4.0/ ii Acknowledgements My deepest gratitude goes to my advisors, Professor Miguel and Master Bruno. Not only for offering me the opportunity to learn from them, but also for their patience with me. I would also like to thank my friend Castro and those who did not give up on me. iii Statement of integrity I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho. University of Minho, 6th October 2023 Name: Marta Cláudia Baptista Oliveira Signature: iv Resumo Os termoplásticos reforçados com fibras utilizam frequentemente fibras de vidro ou carbono para melhorar as propriedades de termoplásticos simples. As propriedades deste tipo de materiais compósitos depende das propriedades dos seus constituintes base, no ambiente termo-mecânico desenvolvido durante o seu processamento e nos parâmetros de distribuição das fibras, nomeadamente a sua concentração e orientação, tendo a última uma relevância maior na propriedades finais da peça. Atualmente existem vários modelos fenomenológicos desenvolvidos com o objetivo de prever a evolução da orientação das fibras para diversos fluxos. Alguns destes modelos estão presentes em software proprietário, cujo acesso ao código é limitado ou inexistente, o que compromete a verificação e adaptação do mesmo. Como alternativa, software de código-aberto oferecem aos utilizadores acesso irrestrito ao código, permitindo assim análises cientificas detalhadas e contínuo melhoramentos. O OpenFOAM®é uma biblioteca computacional de fonte aberta, que contém diversos solvers capazes de simular diferentes problemas da mecânica computacional, com especialização na dinâmica computacional de fluídos, o que o torna uma ferramenta adequada para o trabalho a realizar. Neste dissertação é proposta uma estratégia inovadora para a implementação de um modelos estado-de-arte de orientação de fibras no ambiente do OpenFOAM®. Os modelos foram implementados na forma de um utilitário, que pode ser utilizado juntamente com outros solvers, desde que exista acesso ao campo de velocidades. Com a finalidade de realizar verificações numéricas, foi desenvolvido um código em python capaz de calcular a evolução da orientação das fibras num domínio sujeito a um campo de velocidades variável e os resultados obtidos foram verificados com base em informação obtida da literatura. Este código foi posteriormente implementado como uma referência para verificar o utilitário introduzido no OpenFOAM®, que foi testado em casos semelhantes aos encontrados em condições realistas para típicas aplicações poliméricas, como fluxo de corte simples e estiramento, tal como o fluxo na injeção de um disco ao centro. Os resultados obtidos nos casos de estudo permitiram concluir que a implementação dos modelos foi adequada, o que transforma esta ferramenta numa alternativa confiável a software proprietário, para a previsão da evolução da orientação de fibras em diversos tipos de fluxo. Palavras-chave: orientação de fibras, termoplásticos reforçados com fibras, modelação numérica, OpenFOAM® v Abstract Fiber reinforced thermoplastic materials commonly employ glass or carbon fibers as structural reinforcements to enhance the properties of single thermoplastic materials. The properties of this class of composite materials depend on the properties of the individual constituents, the thermomechanical environment developed during its processing, but also on the fibers distribution parameters, namely the concentration and orientation. The latter has a special relevance in the final part performance. Currently, there are various phenomenological models devised to predict the evolution of fiber orientation in general flows. Some fiber orientation models are available in proprietary software, which work on a black-box concept, where the users are not allowed to check the underlying code and have limited or no possibilities to adapt the code to their own needs. On the other side, open-source software supplies the end-users with full access to the code, making it available for scientific scrutiny and continuous improvement. OpenFOAM®is an open-source computational library with a wide range of solvers able to simulate different continuum mechanics problems, with special focus on computational fluid dynamics. Such properties make the software a suitable tool to work as base to the proposed work. In this dissertation a novel strategy for implementing state-of-the-art fiber orientation models is proposed and implemented in the OpenFOAM®framework. The fiber orientation models were implemented as an utility, which can be used with other existing solvers, in which there is access to the velocity field. For numerical verification purposes, a python script able to compute the fiber orientation evolution in a location subjected to variable velocity gradient field, was implemented and verified against data found in literature. This python script was subsequently employed as a benchmark to verify the implementation of the novel OpenFOAM®utility, which was tested considering some flows that represent the ones found in practice, in typical polymer processing applications (simple shear flow and stretch flow), as well as the flow in a standard center-gated disk. The results obtained in the tested case studies allowed to conclude that the fiber orientation models were properly implemented. Consequently, this new OpenFOAM®utility is now a reliable alternative to proprietary software for predicting the evolution of fiber orientation in different flow environments. Keywords: fiber orientation, fiber reinforced thermoplastic materials, numerical modeling, OpenFOAM® vi Table of contents Chapter 1 -- Introduction ......................................................... 1 1.1 Processingandresultingproperties ............................................. 2 1.2 Computationaltools .......................................................... 3 1.3 MotivationandObjectives ..................................................... 4 1.4 Dissertationorganization ...................................................... 4 Chapter 2 -- State-of-the-art ...................................................... 5 2.1 Descriptorsoffiberorientation ................................................. 5 2.2 Fiberorientationmodeling ..................................................... 7 2.3 Closureapproximations ...................................................... 14 Chapter 3 -- Computational tools ................................................ 20 3.1 Python ................................................................... 20 3.1.1 Calculation of fiber orientation in a given flow field . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.1.2 Calculation of fiber orientation in a center-gated disk . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.1.3 Symbolic computation of the double dot contraction A:D..................... 29 3.2 OpenFOAM®.............................................................. 35 3.2.1 Finite Volume Method in OpenFOAM®..................................... 35 3.2.2 GeneralCaseSetUp .................................................... 36 3.2.3 Development of a OpenFOAM®utility ...................................... 37 Chapter 4 -- Verification of the Developed Computational Tools .................... 44 4.1 Python benchmarktool ..................................................... 44 4.1.1 SimpleShearflow ...................................................... 44 4.1.2 Shear/Elongationalflow ................................................. 47 4.1.3 Center-gateddisk ...................................................... 48 4.2 OpenFOAM®utility ......................................................... 50 4.2.1 Test cases and Time-Position Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.2.1.1 Simple-shearFlow ................................................. 50 4.2.1.2 Planarelongationalflow ............................................. 51 vii 𝑎Acceleration 𝑏Half-thickness of a disk 𝑏𝑖Parameters for the definition of the rotary diffusion tensor 𝑐Fiber concentration 𝑑Fiber diameter eEigenvectors 𝑓Blending coefficient 𝑙Fiber length pFiber orientation vector 𝑟Radius of a disk 𝑡Time uVelocity vector 𝑧Thickness of a disk Greek Symbols 𝛼Strain reduction factor 𝛽Objective parameter 𝛽𝑖Functions of the second and third invariants of A 𝜹Unit vector 𝜖Elongational rate 𝜀Error 𝛾Shear rate 𝜅Slow-down parameter 𝜆Eigenvalues 𝚲IOK Diagonal tensor calculated under the intrinsic orientation kinetics xiv ∇𝑠Gradient operator on the surface of the unit sphere 𝜓Probability distribution function 𝜉Particle shape function Superscripts/subscripts ¯ □Average ¤ □Material derivative □𝑇Transpose operation □0Initial value □𝑓Final value ˜ □Normalized value xv CHAPTER1Introduction Fiber reinforced polymers (FRP) are a subclass of composite materials, where thermoplastics or thermoset polymers are used as the continuous phase matrix, and either glass or carbon fibers comprise the reinforcing dispersed phase. The main purpose of the reinforcements is to enhance the ratio mechanical properties per weight of the final parts, however, thermal and electrical behavior can also be tailored to some extent to devise products with additional functionalities [1, 2]. Due to the wide range of properties that FRP can present, they are attractive to several industries, as is the case for the automotive, aerospace and construction sectors [1--3], which benefit from the load bearing capabilities allied with low density of this class of materials. For instance, it is common practice in the automotive industry to replace metallic components by FRP to create lighter components and, therefore, improve fuel consumption [4]. Commercially, most FRP incorporate thermoset resins for the matrix, such as epoxy [3]. This type of polymers can be reshaped until undergoing an irreversible chemical reaction, usually triggered by heat. On the other side, to be reshaped, thermoplastics need to go through a cycle that comprises, at least, heating-forming-cooling phases. Thermoplastic materials can be reheated and reshaped a (limited) number of times, which makes them reusable [5]. Despite the more difficult processing associated with thermoplastics matrices [3], mainly due to their high viscosity at the melt state when compared with uncured thermoset resins, they have been growing in use, not only for their increased recyclability, but also because thermoplastics processing can be much faster [6]. FRP materials can also be grouped by the length of the fiber employed, which can be discontinuous or continuous. The latter results in materials with high strength and stiffness, due to their high orientation along the desired direction. Meanwhile, discontinuous fibers tend to have random orientation and therefore lower strength. However, they can still provide a significant reinforcement, are cheaper and can be used to produce complex parts [1, 2]. 1 1.2 Computational tools Discontinuous fibers can be further divided into two categories, depending on the fibers’ length. Long fiber reinforced composites are usually obtained through a pultrusion process, to obtain continuous fiber filaments, which are subsequently pelletized, resulting in pellets comprising fibers with a length of around 12 mm. On the other side, short fiber reinforced composites are produced by compounding extrusion, where chopped fibers are mixed with the matrix, which are subsequently shaped in filaments and then pelletized. These materials comprise fibers having a typical length of around 1 mm [7, 8]. Discontinuous fiber reinforced thermoplastic materials (FRTM) join the advantages of a thermoplastic matrix and discontinuous fibers. Discontinuous FRTM can be processed through conventional thermoplastic processes, like 3D printing, compression molding or injection molding [1]. The latter is widely used by the industry for large scale production, due to its high dimensional precision, variety of complex geometries, high rates of production and ease of automation [3, 6]. 1.1 Processing and resulting properties The injection molding (IM) technique consists of a cyclic process in which the molten plastic, conveyed from the plasticizing unit, is forced into a mold cavity with a predetermined geometry, where it is held under pressure until it cools down and solidifies. The mold can integrate a single or multiple cavities of similar or dissimilar shapes. The processing cycle ends with the opening of the mold and the subsequent extraction of the part(s) [9]. The behavior of FRTM parts manufactured by IM are highly dependent upon processing conditions and fiber-related parameters, such as: orientation, length and concentration, among others. All these interrelated parameters are difficult to control. Fiber orientation can greatly impact the properties of the final part, such as its mechanical properties, for instance, the part will present a better performance in regions where the fibers are more aligned with the direction of the applied load. The fiber orientation is mostly determined by the flow of the polymeric matrix during injection into the mold cavity, which usually results in a complex anisotropic distribution. Based on the above, for design purposes it is important to predict fibers distribution and orientation. This knowledge allows for better comprehension of related phenomena such as shrinkage and warpage [10], and also the mechanical behaviour [11], which are mandatory to support part design. 2 1.3 Motivation and Objectives 1.2 Computational tools Nowadays, computational modeling is widely used to predict the filling of mold cavities during the IM process, and some of the available software has the capability of predicting the resulting fiber orientation [12, 13], thanks to phenomenological numerical models based on Jeffery’s work [14]. Despite being a powerful ally for design and analysis tasks, the accuracy and generality of the available software present several limitations. Proprietary software, such as Autodesk Moldflow®[15] and Moldex3D®[16], offer fiber orientation numerical modeling. Despite the availability of these software, the validation work performed with these models is still scarce, which limits significantly the capability of selecting the best option for a specific case. The scarcity in information can be partially attributed to limitations of proprietary software, such as: •Proprietary software works as a black-box, where the user is not allowed to verify the underlying code, and, therefore, cannot assess how adequate the software is for the envisaged use. •The source code cannot be accessed, analyzed or modified, limiting the possibility of detecting bugs, performing improvements or customize it. •Due to the their commercial nature, these software comprise expensive licensing fees, which limits the possibility of their use to only large companies. An alternative to proprietary software, are the open-source counterparts, such as the OpenFOAM® toolbox [17]. OpenFOAM®is an open-source computational library with a wide range of solvers able to simulate different continuum mechanics problems, with special focus on computational fluid dynamics (CFD) (e.g., incompressible, compressible, multi-phase, conjugate heat transfer). The library, that also includes several tools for pre and post-processing tasks, can be executed in parallel, and is under continuous active development, with two versions being released annually. The open-source character has the advantage of supplying the end-user with full access to the code, making it available for scientific scrutiny and improvement. This framework makes OpenFOAM®a highly suitable vehicle for building numerical tools to model fiber orientation, and to foster the industry to progress in its digital transformation. 3 1.4 Dissertation organization 1.3 Motivation and Objectives Due to the limitations of proprietary software, which limit a through analysis and verification of the available models developed to predict the evolution of fiber orientation, the objective of this dissertation is the implementation and verification of state-of-art numerical models for fiber orientation in the open source computational library, OpenFOAM®. To achieve the objective, firstly, the fiber orientation models will be studied, as well as the computational tools that will be used, OpenFOAM® and Python. The later will be utilized to create a benchmark tool to verify the results obtained from the developed OpenFOAM®utility. 1.4 Dissertation organization The remaining dissertation is organized as follows. Firstly, the state-of-art fiber orientation models will be described and discussed in Chapter 2. Chapter 3 describes the computational tools utilized, Python and OpenFOAM®, as well as the code developed within the respective libraries of both tools. Additionally, the test cases that will be examined in this dissertation are described by expounding the appropriate definition of explored flows. Finally, in Chapter 4, the verification of the developed code will be presented. The python script is verified trough comparison with data from available literature, and, by using this tool as a benchmark, the OpenFOAM®’s utility will be verified against it. The main conclusions from this work and the proposals for future activities are reported in Chapter 5. 4 CHAPTER2State-of-the-art 2.1 Descriptors of fiber orientation In the literature, fibers are usually treated as a straight and rigid cylinder. Under these conditions, its orientation can be described by two angles, 𝜃and 𝜙. A unit vector, p, oriented along the fiber’s symmetry axis, as shown in Figure 2.1, is an appropriate micro-descriptor for single fiber orientation and it is related to 𝜃and 𝜙by: p= 𝑝1 𝑝2 𝑝3  = sin𝜃cos 𝜙 sin𝜃sin 𝜙 cos𝜃  (2.1) p 1 2 3 1 p 2 p 3 p 𝒑 Figure 2.1: Orientation of a fiber. In FRTM there might be thousands of fibers per cubic millimetre [7]. Consequently, in a general case, the usage of the previous descriptor for each individual fiber is cumbersome and 5 2.1 Descriptors of fiber orientation significantly demanding to compute, thus, approaches based in statistical methods were proposed in the literature [7]. In these, the proposed descriptor for large groups of fibers is the a probability distribution function (PDF), 𝜓(p,𝑡), which reflects a meso-scale descriptor and is defined in such a way that 𝜓(p,𝑡)dpdefines the probability of a fiber being oriented in the range pand p+dp. The PDF has the following properties: •Periodicity: 𝜓(p)=𝜓(−p)(The fibers ends are not distinguished); •Normalized: ∮𝜓(p,𝑡)dp=1(The integral over all possible orientations in space adds to unity); •Continuity: 𝐷𝜓 𝐷𝑡 =−∇𝑠·(𝜓¤ p)(If the orientation of a fraction of fibers changes, the remaining fibers will suffer a consequent change on their orientation). The computation of the PDF is possible for planar orientation, but for practical cases in three-dimensions the PDF becomes excessively expensive [18]. For this reason, Advani and Tucker [18] proposed the use of orientation tensors as a macro-scale descriptor. The most commonly used tensors are the 2nd and 4th order orientation tensors, defined as: A=∮𝜓pp dp(2.2) A=∮𝜓pppp dp(2.3) The orientation tensors have the following properties: •Symmetry [18]: –A𝑖 𝑗 =A𝑗𝑖, –A𝑖 𝑗 𝑘𝑙 =A𝑗𝑖𝑘𝑙 =A𝑘 𝑗𝑖𝑙 =A𝑙 𝑗 𝑘𝑖 =A𝑖𝑘 𝑗𝑙 =A𝑖𝑙𝑘 𝑗 ; •Due to the normalization condition of the PDF, the 2nd order orientation tensor has an unitary trace, tr(A)=1[18]; •Higher order tensors provide complete information about lower order tensors: A𝑖 𝑗 =A𝑖 𝑗 𝑘 𝑘 [18]; •The orientation state described by the orientation tensors is not unique [7, 19]; The second-order tensor provides information about the principal directions of the orientation state, as well as its principal values. The principal directions define how the orientation distribution 6 2.2 Fiber orientation modeling is situated in space, and the principal values quantify the alignment of the fibers with the principal directions. The principal directions are defined by the eigenvectors of the orientation tensor, and the magnitude of said vectors, are defined by its corresponding eigenvalues [7]. Figure 2.2 shows a general representation of the principal directions. e1 λ1 λ2 λ3 e2 e3x y z Figure 2.2: Representation of principal directions and values of a second-order orientation tensor. As it will be further evidenced in this work, the use of tensors to describe the fiber orientation leads to the need of a closure approximation. Despite this, these macro-descriptor are still the state-of-the-art fiber orientation descriptors [7, 19]. 2.2 Fiber orientation modeling Modeling of fiber orientation started with the seminal work of Jeffery in 1922 [14], who modeled a fiber as an inertialess rigid spheroid, suspended in a Newtonian fluid. The proposed equation for the rate of change preads: ¤ p=W·p+𝜉(D·p−D:ppp),(2.4) where: •Wis the vorticity tensor, defined as W=1 2∇u−(∇u)T; 7 2.2 Fiber orientation modeling •Dis the rate-of-deformation tensor, defined as D=1 2∇u+(∇u)Twith ∇uas the velocity gradient, defined as ∇u=𝜕ui/𝜕xj; •𝜉is the particle shape function defined as 𝜉=(𝑙/𝑑)2−1 (𝑙/𝑑)2+1 , where 𝑙is the length of the fiber and 𝑑its diameter. The term W·pin Equation (2.4) represents the effect of rigid-body rotation on fiber orientation. If the fluid has a rotation motion, this term adds it to the fiber rotation-rate. The second term, 𝜉(D·p−D:ppp)represents the effect of fluid deformation on the fiber orientation. The unusual term, where the rate-of-deformation tensor is contracted with the triple dyadic product of p, is defined by Tucker [7], and aims at subtracting the portion of D·pthat is parallel to p, which assures that the time rate of change of pis always perpendicular to p, and that the length of pdoes not change. This model was proved to be useful in dilute suspensions, where fibers interaction can be neglected [20]. The suspension state is characterized by the concentration of fibers, 𝑐, and the fiber aspect ratio, 𝑙/𝑑. When 𝑐 < (𝑙/𝑑)2, the distance in-between fibers is greater than its length, and, therefore, the fibers can rotate freely, which corresponds to the dilute regime [20]. Given the large number of fibers that can exist in FRTM, concentrated suspensions must be considered, where fiber interactions become a relevant, or a dominant effect. To tackle this, Folgar and Tucker (FT) [20], in 1984, formulated a phenomenological model extending the one proposed by Jeffery, which accounts for the effect of fiber interactions through a scalar rotary diffusivity. The model reads: ¤ 𝜓=−∇𝑠·(𝜓¤ p−𝐶𝐼¤𝛾∇𝑠𝜓),(2.5) where: •CIis a phenomenological constant, the fiber-fiber interaction coefficient; •¤𝛾is the scalar magnitude of the rate of deformation tensor, defined as ¤𝛾=√2D:D; •∇sis the gradient operator on the surface of the unit sphere, defined as ∇s=ˆ 𝛿𝜃𝜕 𝜕𝜃 +ˆ 𝛿𝜙1 sin𝛿 𝜕 𝜕𝜙 ; •¤ 𝜓is the material derivative of 𝜓. Since the computation of the PDF is too expensive in general 3D cases, orientation tensors are used as macro-descriptors of the fibers’ orientation state. For this, Equation (2.5) is rewritten for the 8 2.3 Closure approximations 𝑓. AHybrid =(1−𝑓)A𝐿𝑖𝑛𝑒𝑎𝑟 +𝑓AQuadratic 𝑓=1−27det(A). (2.41) The hybrid closure over-predicts the actual fiber alignment, but despite of this, it is still widely used within the industry due to its simplicity and ease of computation [43]. Not satisfied with the solution offered by the hybrid approximation, Verleye and Dupret [44] introduced the natural closure (NAT), that describes Ain terms of Aand the identity second order tensor 𝛿, through a fitting process, which is only valid when the fiber-fiber interactions are neglected (the dilute flow regime), and reads as: ANatural ijkl =𝛽1𝑆𝛿ij𝛿kl+𝛽2S𝛿ijAkl+𝛽3SAijAkl +𝛽4S𝛿ijAkmAml+𝛽5SAijAkmAml+𝛽6SAimAmjAknAnl, (2.42) where the coefficients 𝛽1−𝛽6are functions of the second and third invariants of A. These coefficients have to satisfy the normalization condition, Aijkk =Aij.Sis a function that returns the symmetric part of a 4th order tensor, as: STijkl=1 24 Aijkl +Ajikl +Aijlk +Ajilk +Aklij +Alkij +Aklji +Alkji +Aikjl +Akijl +Aiklj +Akilj +Ajlik +Aljik +Ajlki +Aljki +Ailjk +A𝑙𝑖 𝑗 𝑘 +Ailkj +Alikj +Ajkil +Akjil +Ajkli +Akjli!. (2.43) It is known that the NAT closure suffers from singularity issues for asymmetric orientation states [44]. Later, Cintra and Tucker [45] developed an orthotropic fitted (ORF) closure approximation and proved the increasing accuracy of this closure approximation over the previous ones. Due to the symmetry restrictions of the second order tensor, the tensor has three orthogonal eigenvectors, that define its principal axes, and the three corresponding eigenvalues, that define its principal values. Since the fourth order tensor can only be obtained trough the information that the second order tensor provides, the fourth order tensor must be orthotropic, and therefore, have the same principal axes as 15 2.3 Closure approximations the second order tensor, and the remaining components are a function of the principal values. ˆ Amm =Cm+C2 m𝜆1+C3 m𝜆2 1+C4 m𝜆2+C5 m𝜆2 2+C6 m𝜆1𝜆2𝑚=1,2,3,4,5,6,(2.44) where 𝜆𝑖are the eigenvalues and 𝐶𝑚are coefficients obtained from fitting data obtained from calculations of the distribution function for specific types of flow. ˆ Amm stands for the fourth order tensor in contracted notation, that can be obtained from establishing the following symmetries: Aijkl =Ajikl =Aijlk, and then the following relationship: Aijkl =Amn, where 𝑚and 𝑛are related to 𝑖 𝑗 and 𝑘𝑙, respectively, according to Table 2.1. Tensor indices 𝑖 𝑗 11 22 33 23 or 32 31 or 13 12 or 21 Contracted index 𝑚or 𝑛1 2 3 4 5 6 Table 2.1: Relationship between tensor indices and contracted indices. The ORF approximation performs better than previous closure approximations, but suffers from nonphysical oscillations at low values of 𝐶𝐼. Chaubal and Leal [46] opted to use a known probability density function to obtain the unknown parameters 𝐶𝑚, the Bingham distribution, and like this created the Bingham closure. Wetzel [47] and Verweyst [48] introduced another version of an orthotropic fitted closure approximation, ORE, that aimed to improve the ORF closure (Equation(2.44)). The flow data fitted was obtained from analytic solutions corresponding to 𝐶𝐼=0and 𝜆=1, as performed in the NAT closure approximation (Equation (2.42)). Chung and Kwon [49] also contributed to improve the ORF closure approximation, and were able to remove the nonphysical oscillations. They proposed the ORW and ORW3 closures, in which additional flow data was fitted, to comprise all fiber orientation states. The previous orthotropic fitted closure approximations (ORF, ORE, ORW and ORW3) are also called eigenvalue based optimal fitting (EBOF) closure approximations. These, when applied to real life flows, require a lot of computational power due the calculation of the eigenvalues [50]. To circumvent this, Chung and Kwon [50] developed the invariant-based optimal fitting (IBOF) closure approximation, that combined the NAT and EBOF closure approximations. They eliminated the singularity problems of the NAT closure, by fitting against data obtained from a more diverse flow types, and the computational burden of EBOF, by using the invariants of the tensor, instead of its eigenvalues. Similar to the NAT 16 2.3 Closure approximations approximation, the fourth order orientation tensor is defined in terms of the second order, but the unknown parameters are determined in a similar approach used in EBOF closure approximations. In the IBOF approximation, the fourth order tensor can be obtained by Equation (2.42), but unlike the natural closure, only the coefficients 𝛽3,𝛽4and 𝛽6are strictly functions of the second and third invariants of A. The remaining coefficients, 𝛽1,𝛽2and 𝛽5, are a function of the independent components and the invariants of the second-order orientation tensor, fitted with data obtained from calculations of the PDF. The equations for these coefficients are reported in Appendix A. The neural network closure, proposed in Jack et al. (NNET) [51], utilizes an artificial neural network to compute the forth-order tensor in function of the corresponding second-order tensor. The artificial neural network is able to map the relationship between input and outputs when a exact mathematical model for this relationship does not exist [51]. For this closure the neural network is trained using known the second-order tensors and the corresponding fourth-order tensors, obtained from experimental data. The neural network closure was shown to have better or equal accuracy to orthotropic closures, and higher efficiency (around 3 times faster than orthotropic closures). Verleye and Dupret [52] stated that there is an exact closure if the fiber orientation is at one time isotropic. Based on this work, Montgomery-Smith et al. [53] determined the exact closure using Cartesian coordinates on the sphere and the Carlson form of elliptic integrals. Under the assumption that at the initial condition the orientation is isotropic, the second order tensor can be expressed in the following way: A=∫𝑆 pp 4𝜋(B:pp)3 2 dp,(2.45) where ¤ B=−B·(W+𝜉D)−(−W+𝜉D)·B,(2.46) with B=Iat 𝑡=0𝑠. In the same article, Montgomery-Smith et al. [53] also introduced the fast exact closure (FEC), a more computational efficient form of the exact closure. For this, Bis computed via an ordinary differential equation, obtained from solving simultaneously the Equations 2.8 and 2.46. If the initial data is not isotropic, then Bmust be calculated for the initial condition by inverting the Equation 2.45. This format of the FEC is valid only for when the diffusion terms are absent, so later 17 2.3 Closure approximations Montgomery-Smith et al. [54] derived the FEC for other models, which account for diffusion. For this, two fourth-rank tensors, Cand D, defined as conversion tensors, are introduced, such that: DA Dt =−C:DB Dt , DB Dt =−D:DA Dt . (2.47) The FEC can be expressed in a general form as: DA Dt =−C: F(B)+G(A) DB Dt =F(B)−D: G(A) ,(2.48) where the definition of functions Fand Gdepend on the fiber orientation model that is being used [54]. Table 2.2 gives an overview of the presented state-of-the-art for the numerical models and closure approximations. 18 Name Acronym Reference Numerical models Jeffery - [14] Folgar and Tucker FT [20] Advani and Tucker - [18] Strain reduction factor SRF [14] Reduced Strain Closure RSC [24] Anisotropic rotary diffusion ARD [8] improved Anisotropic rotary diffusion iARD [27, 28] Retarding Principal Rate RPR [27] principal Anisotropic rotary diffusion pARD [29] Moldflow Rotational Diffusion MRD [30] Wang - [32] Flow-dependent model - [34, 35] Closure Approximations Linear - [38] Quadratic - [40--42] Hybrid - [39] Natural NAT [44] Orthotropic fitted ORF [45] Bingham - [46] Orthotropic fitted Eigenvalues based ORE [47, 48] Orthotropic fitted wide-𝐶𝑖ORW [49] Invariant-based optimal fitting IBOF [50] Neural network NNET [51] Exact - [53] Fast exact closure FEC [53, 54] Table 2.2: Literature overview of the state-of-art numerical models and closure approximations. 19 CHAPTER3Computational tools 3.1 Python As a benchmark tool, a script was developed in python language to model fiber orientation. This high-level programming language focuses on code readability, is open-source and has a wide range of libraries and tools that can be used for scientific (NumPy [55] and SciPy [56]) and symbolic (Sympy [57]) computations, as well as for data visualization (matplotlib [58]). The results from this script will be validated against data available in the literature and serve as a benchmark for the computed results in OpenFOAM®. The developed python script has the ability of calculating the ordinary derivative of the second-order orientation tensor as a function of time for a given flow field, dA d𝑡. The script can also compute the time-rate-of-change of the second order orientation tensor for a center-gated disk (CGD) as a function of the normalized radius (˜𝑟), given by the ratio between the radius and the disk half-thickness. Additionally, due the inability of OpenFOAM®to cope with fourth-order tensors, a script was developed to generate code in the C++ programming language for the calculation of the double dot contraction A:D, an mathematical operation present in all phenomenological fiber orientation models. The code is available online in GitHUB [59] and will be described in the following subsections. 3.1.1 Calculation of fiber orientation in a given flow field Listing 3.1 shows the python script main function, programmed to calculate the second-order tensor evolution along time, for simple-shear flow, with the Folgar-Tucker model (2.6) and hybrid closure approximation (2.41). 20 3.1 Python 21 3.1 Python   1import numpy as np 2from scipy.integrate import solve_ivp 3import fiberOrientationModels as FOM 4 5def gradU(t): 6return np.array([[0.0 , 1.0, 0.0], 7[0.0, 0.0, 0.0], 8[0.0, 0.0, 0.0]]) 9 10 time = np.arange(0,10.1,0.01) 11 12 A2_0 = np.eye(3)*(1/3) 13 14 closure = ’hybrid’ 15 16 xi = 1 17 18 CI = 0.01 19 20 sol = solve_ivp( 21 FOM.FT, 22 (time[0], time[-1]), 23 A2_0.ravel(), 24 method="RK45", 25 t_eval=time , 26 rtol=1e-6, 27 args=(gradU , closure , xi, CI) 28 ) 29 30 A2=np.transpose(sol.y)   Listing 3.1: Main function of the python script for a simple flow. In Lines 1-3, the required libraries and modules are imported. Numpy is used for standard numerical computations and data structures creation, the solve_ivp routine is imported from the scipy library to solve the ordinary differential equation (ODE), and the custom module fiberOrientationModels that contains the implemented fiber orientation models. The solve_ivp [60] routine is an ordinary differential equation(ODE) solver for initial value problems (IVP) in the form dA d𝑡=𝑅𝐻𝑆. This routine takes as input: •A function that allows calculating the right-hand size of the system; •The time interval to be considered 𝑡0, 𝑡 𝑓; •The initial condition, A0 22 3.1 Python •the numerical technique to solve the initial value problem; •Solver specific parameters (e.g., absolute/relative tolerances, max time-step, evaluation times, etc.); •The parameters required by the ODE. Lines 5-8 show the definition of the velocity gradient tensor function. By design, this function is defined as a function of time 𝑡to allow the consideration of a general time-varying velocity gradient. Lines 10-12 define the integration parameters, that are the time interval and initial value of the second order tensor, and in Lines 16 and 18 the fiber orientation model (FOM) dependent parameters. Finally, in lines 20-28 the numerical integration routine is used through a Runga-Kutta method of order 5(4) and the solution is stored for post-processing in Line 30. The beginning of the custom module fiberOrientationModels is shown in Listing 3.2. In line 2, similarly to was done in the main function, a costume module is imported, which contains the closure approximations. Line 85 marks the start of the function that contains the Folgar-Tucker model. Firstly, in line 8, the fourth-order tensor is calculated in function of the selected closure and the current value of the second-order tensor. In line 10, the rate-of-deformation tensor is calculated, in line 12, the vorticity tensor, and, in line 14, the shear rate scalar. The Folgar-Tucker method is then calculated, following the Equation (2.6).   1import numpy as np 2from fiberOrientationClosures import compute_closure 3 4def FT(t, A2, gradU , closure , xi, CI): 5 6A2 = np.reshape(A2, (3, 3)) 7 8A4 = compute_closure(A2, closure) 9 10 D = 0.5*( gradU(t)+np.transpose(gradU(t))) 11 12 W = 0.5*( gradU(t)-np.transpose(gradU(t))) 13 14 shrRate = np.sqrt(2*np.tensordot(D,D,axes=2)) 15 16 I = np.eye(3) 17 18 FT = ( 19 (np.tensordot(W,A2,axes=1)-np.tensordot(A2,W,axes=1)) 23 3.1 Python 20 +xi*(np.tensordot(D,A2,axes =1)+np.tensordot(A2,D,axes=1) 21 -2*np.tensordot(A4 ,D,axes=2)) 22 +6*(CI*shrRate)*(I/3-A2) 23 ) 24 25 return FT.ravel()   Listing 3.2: Custom module fiberOrientationModels which contains the fiber orientation models. Listing 3.3 shows exerts of the fiberOrientationClosures module, in which the function compute_closure resides. Inside this function, the closures are defined inside a if...else block.   1def compute_closure(A2, closure): 2 3if (closure==’linear’):     23 elif (closure==’quadratic’):     30 elif (closure==’hybrid’):     39 elif (closure==’IBOF’):     242 elif (closure==’ORE’): 243 244 lambda_ , Q = np.linalg.eig(A2) 245 246 idx = lambda_.argsort()[::-1] 247 lambda_ = lambda_[idx] 248 Q = Q[:,idx] 249 250 A4 = np.zeros ((3,3,3,3)) 251 252 Cm = np.array ([[0.636256796880687 , 0.636256796880687 , 2.74053289560253] , 253 [ -1.8726629637381 , -3.31527229742146 , -9.12196509782692] , 254 [-4.47970873193738 , -3.03709939825406 , -12.2570587036254] , 255 [11.9589562332320 , 11.8273285968852 , 34.3199018916987] , 256 [3.84459692420086 , 6.88153952058044 , 13.8294699121940] , 257 [11.3420924278159 , 8.43677746778325 , 25.8684755253884] , 258 [-10.9582626069691 , -15.9120667157641 , -37.7029118029384] , 259 [-20.7277994684132 , -15.1515872606307 , -50.2756431927485] , 260 [-2.11623214471004 , -6.48728933641926 , -10.8801761133174] , 261 [-12.3875632855619 , -8.63891419284016 , -26.9636915239716] , 262 [9.81598389716748 , 9.32520343452661 , 27.3346798054488] , 263 [3.47901510567439 , 7.74683751713295 , 15.2650686148651] , 264 [11.7492911177026 , 7.48146870624441 , 26.1134914005375] , 265 [0.508041387366637 , 2.28476531637958 , 3.4321384033477] , 266 [4.88366597771489 , 3.59772251134254 , 10.6117418066060] ]) 24 3.1 Python   256 def ORE(A2, eVecs , eVals): 257 258 A4 = sym.MutableDenseNDimArray(np.zeros((3 ,3 ,3,3))) 259 260 Cm = sym.Matrix ([[0.636256796880687 , 0.636256796880687 , 2.74053289560253] , 261 [ -1.8726629637381 , -3.31527229742146 , -9.12196509782692] , 262 [-4.47970873193738 , -3.03709939825406 , -12.2570587036254] , 263 [11.9589562332320 , 11.8273285968852 , 34.3199018916987] , 264 [3.84459692420086 , 6.88153952058044 , 13.8294699121940] , 265 [11.3420924278159 , 8.43677746778325 , 25.8684755253884] , 266 [-10.9582626069691 , -15.9120667157641 , -37.7029118029384] , 267 [-20.7277994684132 , -15.1515872606307 , -50.2756431927485] , 268 [-2.11623214471004 , -6.48728933641926 , -10.8801761133174] , 269 [-12.3875632855619 , -8.63891419284016 , -26.9636915239716] , 270 [9.81598389716748 , 9.32520343452661 , 27.3346798054488] , 271 [3.47901510567439 , 7.74683751713295 , 15.2650686148651] , 272 [11.7492911177026 , 7.48146870624441 , 26.1134914005375] , 273 [0.508041387366637 , 2.28476531637958 , 3.4321384033477] , 274 [4.88366597771489 , 3.59772251134254 , 10.6117418066060] ]) 275 276 for iin range(3): 277 A4[i,i,i,i] = Cm[0,i] + (Cm[1,i] * eVals[0]) + (Cm[2,i] * eVals[1]) + 278 (Cm[3,i] * eVals[0] * eVals [1]) + (Cm[4,i] * np.power(eVals[0] ,2)) + 279 (Cm[5,i] * np.power(eVals[1],2)) + (Cm[6,i] * np.power(eVals[0] ,2) * eVals [1]) + 280 (Cm[7,i] * eVals[0] * 281 np.power(eVals[1] ,2)) + (Cm[8,i] * np.power(eVals[0] ,3)) + (Cm[9,i] * 282 np.power(eVals[1] ,3)) + (Cm[10,i] * np.power(eVals[0],2) * 283 np.power(eVals[1] ,2)) + (Cm[11,i] * np.power(eVals[0],3) * eVals[1]) + 284 (Cm[12,i] * eVals[0] * np.power(eVals[1],3)) + (Cm[13,i] * 285 np.power(eVals[0],4) ) + (Cm[14,i] * np.power(eVals[1] ,4)) 286 287 A4[1,2,1,2] = 0.5*( 1.0 - 2.0*eVals[0] + A4[0,0,0,0] - A4[1,1,1,1] - A4[2,2,2,2] ) 288 A4[2,0,2,0] = 0.5*( 1.0 - 2.0* eVals[1] - A4[0,0,0,0] + A4[1,1,1,1] - A4[2,2,2,2] ) 289 A4[0,1,0,1] = 0.5*( -1.0 + 2.0* eVals[0] + 2.0*eVals[1] - A4[0,0,0,0] - A4[1,1,1,1] 290 + A4[2,2,2,2] ) 291 292 A4[2,1,2,1] = A4[1,2,2,1] = A4[2,1,1,2] = A4[1,2,1,2] 293 A4[0,2,0,2] = A4[2,0,0,2] = A4[0,2,2,0] = A4[2,0,2,0] 294 A4[1,0,1,0] = A4[1,0,0,1] = A4[0,1,1,0] = A4[0,1,0,1] 295 296 A4[0,0,1,1] = A4[0,1,0,1] 297 A4[1,1,0,0] = A4[0,0,1,1] 298 299 A4[1,1,2,2] = A4[1,2,1,2] 300 A4[2,2,1,1] = A4[1,1,2,2] 301 302 A4[2,2,0,0] = A4[2,0,2,0] 303 A4[0,0,2,2] = A4[2,2,0,0] 31 3.1 Python 304 305 A4_ORE = sym.MutableDenseNDimArray(np.zeros((3,3,3,3))) 306 307 for iin range(3): 308 for jin range(3): 309 for kin range(3): 310 for lin range(3): 311 for min range(3): 312 for nin range(3): 313 for oin range(3): 314 for pin range(3): 315 A4_ORE[i,j,k,l] += eVecs[i,m]*eVecs[j,n] 316 *eVecs[k,o]*eVecs[l,p]*A4[m,n,o,p] 317 318 return A4_ORE   Listing 3.7: ORE closure aprroximattion expressed in symbolic code. Firstly, the necessary libraries are imported. As done for the scientific code, in line 258 a empty tensor is created, but the sympy library is used to define it, so that it can be employed in symbolic calculations, as well as the necessary coefficients (lines 260-274), that are stored in a sympy matrix. The independent components are calculated and the tensor is populated following its symmetries, as it was previously done. Lastly, the transformation of coordinates as to be done. sympy does not have a routine similar to np.einsum, therefore a "for" loop was used for this operation. In Listing 3.8 it is shown how the double contraction is expressed in symbolic code. Firstly, the sympy library and custom modules are imported. The file variables was shown previously in Listing 3.6, and fiberOrientationClosures contains the closures approximations, as Listing 3.7.   1import sympy as sym 2from variables import * 3from fiberOrientationClosures import * 4from fiberOrientationClosures_RSC import tensorCombination 5from generate_code import generateCCode 6 7closure = hybrid(A2) 8 9D_doubleDot_A4 = sym.MutableDenseMatrix 10 (sym.tensorcontraction(sym.tensorproduct(hybrid(A2), D), (0,4),(1 ,5))) 11 12 generateCCode(D_doubleDot_A4 , nDecimalCases=17, OFSyntax=True)   Listing 3.8: Computation of the double contraction A:D. 32 3.1 Python The selected closure is indicated in Line 7. In line 9 and 10, the double contraction operation is done. The function generateCCode, from the module generate_code, is responsible for the optimization of the symbolic code, as well as its output to the terminal. This module makes use of sympy’s Pow expansion algorithm [63] , with which simple powers up to 6 are expanded, as well as the cse routine, abbreviation for Common Subexpression Detection and Collection, which allows for the identification of common subexpressions and their evaluation only once, which increases computation efficiency. The obtained code is shown in Listing 3.9.   1------------D_doubleDot_A4 ------------ 2const scalar tmp0 = A.yz()*A.yz(); 3const scalar tmp1 = A.xy()*A.xy(); 4const scalar tmp2 = 27*A.zz(); 5const scalar tmp3 = A.xz()*A.xz(); 6const scalar tmp4 = 27* tmp0*A.xx() + tmp1*tmp2 - tmp2*A.xx()*A.yy() + 27* tmp3*A.yy() 7- 54*A.xy()*A.xz()*A.yz(); 8const scalar tmp5 = tmp4 + 1; 9const scalar tmp6 = -tmp4; 10 const scalar tmp7 = (0.4285714285714286)* tmp6; 11 const scalar tmp8 = tmp7*A.xy(); 12 const scalar tmp9 = tmp5*A.xx(); 13 const scalar tmp10 = tmp8 + tmp9*A.xy(); 14 const scalar tmp11 = 2*D.xy(); 15 const scalar tmp12 = tmp7*A.xz(); 16 const scalar tmp13 = tmp12 + tmp9*A.xz(); 17 const scalar tmp14 = 2*D.xz(); 18 const scalar tmp15 = (0.1428571428571429)* tmp6; 19 const scalar tmp16 = tmp15*A.yz(); 20 const scalar tmp17 = tmp16 + tmp9*A.yz(); 21 const scalar tmp18 = 2*D.yz(); 22 const scalar tmp19 = (0.1428571428571429)*A.yy(); 23 const scalar tmp20 = (0.1428571428571429)*A.xx() - 0.02857142857142857; 24 const scalar tmp21 = tmp6*(tmp19 + tmp20 ); 25 const scalar tmp22 = tmp21 + tmp9*A.yy(); 26 const scalar tmp23 = (0.1428571428571429)*A.zz(); 27 const scalar tmp24 = tmp6*(tmp20 + tmp23 ); 28 const scalar tmp25 = tmp24 + tmp9*A.zz(); 29 const scalar tmp26 = tmp15*A.xy(); 30 const scalar tmp27 = tmp5*A.xy(); 31 const scalar tmp28 = tmp26 + tmp27*A.zz(); 32 const scalar tmp29 = tmp27*A.yy() + tmp8; 33 const scalar tmp30 = tmp15*A.xz(); 34 const scalar tmp31 = tmp27*A.yz() + tmp30; 35 const scalar tmp32 = tmp16 + tmp27*A.xz(); 36 const scalar tmp33 = tmp10*D.xx() + tmp11*(tmp1*tmp5 + tmp21) + tmp14*tmp32 + tmp18*tmp31 37 + tmp28*D.zz() + tmp29*D.yy(); 33 3.1 Python 38 const scalar tmp34 = tmp5*A.xz(); 39 const scalar tmp35 = tmp30 + tmp34*A.yy(); 40 const scalar tmp36 = tmp12 + tmp34*A.zz(); 41 const scalar tmp37 = tmp26 + tmp34*A.yz(); 42 const scalar tmp38 = tmp11*tmp32 + tmp13*D.xx() + tmp14*(tmp24 + tmp3*tmp5) 43 + tmp18*tmp37 + tmp35*D.yy() + tmp36*D.zz(); 44 const scalar tmp39 = tmp7*A.yz(); 45 const scalar tmp40 = tmp5*A.yy(); 46 const scalar tmp41 = tmp39 + tmp40*A.yz(); 47 const scalar tmp42 = tmp6*(tmp19 + tmp23 - 0.02857142857142857); 48 const scalar tmp43 = tmp40*A.zz() + tmp42; 49 const scalar tmp44 = tmp39 + tmp5*A.yz()*A.zz(); 50 const scalar tmp45 = tmp11*tmp31 + tmp14*tmp37 + tmp17*D.xx() + tmp18 *(tmp0*tmp5 + tmp42) 51 + tmp41*D.yy() + tmp44*D.zz(); 52 53 result.xx() = tmp10*tmp11 + tmp13*tmp14 + tmp17*tmp18 + tmp22*D.yy() + tmp25*D.zz() 54 + D.xx()*( tmp5*(A.xx()*A.xx()) 55 + tmp6*((0.8571428571428571)*A.xx() - 0.08571428571428572)); 56 result.xy() = tmp33; 57 result.xz() = tmp38; 58 result.yy() = tmp11*tmp29 + tmp14*tmp35 + tmp18*tmp41 + tmp22*D.xx() + tmp43*D.zz() 59 + D.yy()*( tmp5*(A.yy()*A.yy()) 60 + tmp6*((0.8571428571428571)*A.yy() - 0.08571428571428572)); 61 result.yz() = tmp45; 62 result.zz() = tmp11*tmp28 + tmp14*tmp36 + tmp18*tmp44 + tmp25*D.xx() + tmp43*D.yy() 63 + D.zz()*( tmp5*(A.zz()*A.zz()) 64 + tmp6*((0.8571428571428571)*A.zz() - 0.08571428571428572));   Listing 3.9: Example of code obtained for computation of the double contraction A:Dwith the Hybrid closure. 34 3.2 OpenFOAM® 3.2 OpenFOAM® OpenFOAM®, also known as Open-source Field Operation And Manipulation, is an open-source computational library with a wide range of numerical solvers able to simulate different continuum mechanics problems, with special focus on computational fluid dynamics (CFD) problems [64]. OpenFOAM®is programmed in C++, an object oriented programming language. This allows for modularity and easy code re-usability. The library, that also includes several tools for pre and post-processing tasks, is under continuous active development with two versions being released annually. The open-source character allows the end-user full access to the code, making it available for scientific scrutiny, continuous improvement and customization. For this reason, OpenFOAM®has a growing user base across different areas of industries, academic institutes and research organizations [64]. 3.2.1 Finite Volume Method in OpenFOAM® To numerically solve partial differential equations, OpenFOAM®resorts to the Finite Volume Method (FVM) [65]. This numerical approach discretizes the equations by partitioning the domain of the problem in a set of control volumes (or computational cells). Then, conservation equations, for example, of mass, momentum and energy, are applied to every control volume of the discretized domain, and by calculating the conserved quantity exchanged through the cell faces and source contributions, linear algebraic equations are obtained for each cell. These equations are then assembled and solved to obtain the numerical solution [66]. The set of control volumes from a domain form the computational mesh, being each delimited by planar faces, which can have different polyhedral shapes. The faces can be either internal, which are shared by two control volumes, or external, boundary faces. OpenFOAM®uses a co-located grid, that is, the problem unknowns are stored in a single point of the control volume, which is the centroid [65]. The size of the control volumes, or, the degree of mesh refinement, can be defined by the user, who looks for a balance between accuracy of the results, improved by refining the mesh, and computational power required, which is less for more coarse meshes. 35 3.2 OpenFOAM® 3.2.2 General Case Set Up OpenFOAM®does not have a graphical user interface, therefore a case is defined by a number of files distributed by a set of folders. In the following scheme, a general set up case is shown. iCase i0 AU Ap The 0 folder contains the initial conditions of the different variables, such as velocity and pressure. iconstant ipolyMesh AtransportProperties AturbulenceProperties In this folder, the files that contain material proprieties, such as density, can be found, and also others properties, such as the presence of turbulence. Additionally, the folder polyMesh can also be found, which contains information about the mesh. isystem AcontrolDict AfvSchemes AfvSolution The controlDict file controls the start and end point of the simulation, as well as its time step, and how the data is saved. The fvSchemes file sets the discretization schemes for each term of the equation being solved. The tolerances and algorithms for the solution can be selected on the fvSolution dictionary, as well as the residual control for different variables. The case set up and launch is executed trough command prompts. For the visualization of the data, Paraview [67], an open-source post-processing visualization engine, is usually employed. 36 3.2 OpenFOAM® 3.2.3 Development of a OpenFOAM®utility python is only capable of solving the fiber orientation in function of time, dA d𝑡, but the fiber orientation depends on space too. OpenFOAM®is capable of solving material derivatives, which describe the rate of change in function of time and space. The material derivative, 𝐷A 𝐷𝑡 , can be expressed as [7]: 𝐷A 𝐷𝑡 =𝜕A 𝜕𝑡 +u·∇A.(3.5) However, the term u·∇Acannot be solved implicitly, since OpenFOAM®does not support tensors beyond second-order, as is the case of the third-order tensor ∇A. For this reason and having in mind the following relation: ∇·(uA)=(∇·u)A+u·∇A,(3.6) the term that cannot be calculated in Equation (3.5) is replaced by: u·∇A=∇·(uA)−(∇·u)A.(3.7) Therefore, the governing equation to be solved in OpenFOAM®will be: 𝜕A 𝜕𝑡 +∇·(uA)−(∇·u)A=W·A−A·W+𝜉(D·A+A·D−2A:D) + ¤𝛾[2C−2(trC)A−5(C·A+A·C)+10A:C]. (3.8) In Figure 3.2, the methodology that the code follows to solve the ¤ Ais presented. Firstly, a solver capable of calculating the velocity field of the problem and geometry of interest is required. Generally, such solvers employ the PIMPLE algorithm, that is a segregated algorithm able to calculate the velocity and pressure fields in general flows. Using the velocity field provided by the solver, the developed OpenFOAM®code is capable of calculating the fiber orientation evolution induced by the calculated flow field. To allow the user the selection of fiber orientation model and closure approximation that they wish to be implemented, the factory method was employed. By calling the factory method instead of a constructor, an object can be 37 3.2 OpenFOAM® Start 𝑡𝑛=𝑡𝑛−1+Δ𝑡 Velocity equation Pressure equation Pressure converges? New pressure guess Velocity converges? New velocity guess n =+1 ¤ Aequation Final time step? Stop yes yes yes no no PIMPLE loop no PISO loop Utility Figure 3.2: Flow chart of the steps to solve Ain OpenFOAM®. 38 3.2 OpenFOAM® ¤ Aequation fModel→solve(); Fiber Model Closure Model FT iARD-RPR MRD-RSC Hybrid IBOF ORE = Figure 3.3: Structure of the factory method. created without instantiating a class, making this the task of the subclasses, which grants it the ability to modify the object’s instance [68]. The class diagram is shown in Figure 3.3. There is two main classes, one containing the implementation of the fiber orientation models and the other, the closure approximations. The fiber orientation models classes is capable of using the closure approximation class to create an object containing the selected closure, and implement it on the desired fiber orientation model. The selected model is then solved for the desired time inside the time loop in the selected solver. Listing 3.10 shows the header file for the base class of fiber orientation models. In Lines 21-31 the variables and parameters that are common to all models are declared. The velocity field (U_) and the face flux field(phi_) are passed by reference since these variables are calculated in the associated flow solver. In Line 31 the class contained the closure approximations is pointed to. In Lines 67 and 69, two purely virtual functions are declared. These functions cannot create objects, therefore they do not need to be defined. In derived classes, that can create objects, all purely virtual functions must be defined. The solve function will contain the implementation of the fiber orientation models in the derived classes and the read function will be used to get data from a dictionary file with the information needed by a specific model.   14 namespace Foam 15 { 16 class fiberModel 17 :public IOdictionary 18 { 19 20 protected: 21 const volVectorField& U_; 22 const surfaceScalarField& phi_; 23 volTensorField gradU_; 39 3.2 OpenFOAM® 24 volSymmTensorField D_; 25 volTensorField W_; 26 volScalarField shrRate_; 27 volSymmTensorField A2_; 28 volSymmTensorField D_doubleDot_A4_; 29 scalar CI_; 30 scalar xi_; 31 autoPtr <closureModel > closureModel_;     65 virtual ~fiberModel() = default; 66 67 virtual void solve() = 0; 68 69 virtual bool read() = 0; 70 }; 71 }   Listing 3.10: Header file for base class of fiber models. The library created for the closure approximations follows a similar approach. As shown in Listing 3.11, the variables common to all cases are declared in the base class, which are a reference to the dictionary that was declared in the fiber models class and the second-order tensor field A2_. The functions to be implemented in classes derived from the closureModel classe are the following: (i) the pure virtual function compute_D_doubleDot_A4, where the computation, trough Symbolic code, of the operation A:Dis implemented (Lines 48-49); (ii) the pure virtual function compute_D_doubleDot_A4_RSC, which will also contain the implementation of the double contraction between Aand D, in which case the operation to be computed is: [A+(1−𝜅)(L−M:A)] :D(Lines 51-53), as shown in Equation (2.11).   8namespace Foam 9{ 10 class closureModel 11 { 12 protected: 13 const dictionary& dict_; 14 const volSymmTensorField& A2_;     48 virtual void compute_D_doubleDot_A4(volSymmTensorField& D_doubleDot_A4 , 49 const volSymmTensorField& D) = 0; 50 51 virtual void compute_D_doubleDot_A4_RSC(volSymmTensorField& D_doubleDot_A4 , 52 const volSymmTensorField& D, const volTensorField& eVecs, const volVectorField& eVals, 53 const scalar& k) = 0; 40 4.1 Python benchmark tool components, therefore, the final state of orientation depends on its initial values. However, the final equilibrium state is affected. The probability of A11 and A33 shows a significant difference between the initial and final states, while, comparatively, A22 undergoes only a slight change. 4.1.2 Shear/Elongational flow A shearing/elongational flow combines simple shear with elongational flow. This pattern is comparable to the one observed in a center-gated disk, where shearing forces compete with the elongational forces along the thickness of the part. The velocity field of uniaxial elongation flow can be defined as: u= −¤𝜖𝑥 −¤𝜖 𝑦 2¤𝜖 𝑦  ,(4.2) and planar elongational flow can be defined as: u= ¤𝜖𝑥 −¤𝜖 𝑦 0  .(4.3) The velocity equation corresponding to shear/elongational flow can be obtained by the summation of Equation (4.2) or (4.3) and (4.1). The shear/elongational ratio (¤𝛾/¤𝜖)determines the steady-state orientation. When the ratio is less than 10, the elongational flow dominates the orientation, resulting in a orientation distribution similar to that one of an elongational flow. In an elongational flow the fibers tend to align themselves along the flow direction. On the other hand, for a ratio greater than 50, the shearing flow dominates. However, when the ratio is equal to 20, the effects of the two flows nearly balance each other, resulting in a steady orientation that is close to random in terms of the orientation direction imposed by the shearing flow and the direction imposed by the elongational flow [18, 45]. For the studied test cases corresponding to Hybrid and IBOF closure approximations, the fibers were subjected to a shear/elongation ratio of (¤𝛾/¤𝜖)=20, with elongation along axis 3 and shearing in 47 4.1 Python benchmark tool the plane 1-3. This corresponds to the following velocity field u=−1 20 𝑥+𝑧−1 20 𝑦1 10 𝑧T, with 𝐶𝐼=0.01 and 𝜉=1. As observed in Figure 4.4, the fibers are primarly aligned along the direction 𝐴11, which is imposed by the shearing flow, as well as the direction 𝐴33, which is imposed by the elongational flow. Figure 4.4: Orientation evolution predicted by the FT model using different closure approximation under simple shear/elongational flow. Hybrid and IBOF closures tested under ¤𝛾/¤𝜖=20 and ORE, ¤𝛾/¤𝜖=10. Data obtained from Hybrid[18], IBOF[50] and ORE[48]. For the ORE closure approximation, the orientation distribution was tested under a different flow condition, with a shear/elongation ration (¤𝛾/¤𝜖)=10. In this case, elongation occurred in the axis plane 2-2, while shearing took place in the plane 1-2. This corresponds to a velocity field of u=−1 10 𝑥+𝑧1 10 𝑦0with 𝐶𝐼=0.01 and 𝜉=1. As a result, the fibers preferred aligning along the directions 𝐴11 and 𝐴22. 4.1.3 Center-gated disk For a center-gated disk, the velocity and velocity gradient can be defined by the Equations (3.1) and (3.2), respectively. In injection moulded parts, it is common to observe the formation of a core-shell structure [7, 71]. In the shell region of a disk, the fibers are highly orientated in the flow direction. This is attributed to the parabolic velocity profile that forms along the thickness of the disk. The maximum velocity occurs in the middle of the thickness (˜𝑧=0), and it becomes zero at the wall. This velocity profile generates high shearing forces near the walls, resulting in significant orientation along the flow direction of the disk. Additionally, due to the small injection gate in comparison with the size of the cavity, a diverging 48 4.1 Python benchmark tool flow develops, leading to in in-plane elongation deformation across the flow direction. Consequently, in the core of the disk, the fiber orientation will be perpendicular to the flow direction [7, 71]. In Figure 4.5, the evolution of fiber orientation as a function of the normalized radius, ˜𝑟, is presented. At the normalized thickness ˜𝑧=0.9, representing the near-wall regions of the disk, the fibers exhibit a high orientation along the flow direction (A11), at the steady-state. On the other hand, at the middle of the thickness (˜𝑧=0), the orientation along the flow direction is absent, being, thus, consistent with the previous description of the core-shell morphology. Figure 4.5: FT model associated with IBOF closure approximation, applied to a center-gated disk. Data obtained from [50]. Figure 4.6 depicts the evolution of fiber orientation as a function of the normalized thickness, ˜𝑧, for a normalized radius of ˜𝑟=20. This plot clearly demonstrates the formation of a shell-core morphology. Near the walls, at ˜𝑧=−0.9and 0.9, the orientation component 𝐴11 exhibits the maximum value of orientation. Conversely, at ˜𝑧=0, the fibers show a preferred cross-flow orientation, corresponding to the component 𝐴22. The component 𝐴13 has the same magnitude, but different direction at ˜𝑧=−0.9and 0.9, resulting from the symmetry of the diverging flow. 49 4.2 OpenFOAM®utility Figure 4.6: iARD-RPR model allied with the IBOF closure approximation applied to a center-gated disk. Data obtained from [28]. 4.2 OpenFOAM®utility For the verification of the OpenFOAM®utility, three flow scenarios were considered, two simple flows (simple-shear and planar elongation) and one more representative of industrial processes (flow in a center-gated disk). For ease of verification, the utility setExprFields [72] was used to impose the velocity and velocity gradient fields for all the test cases, and the mesh was created with the blockMesh [72] utility. The codes verification were undertaken by comparing the results predicted by the developed code with data obtained from the python code presented in Section ??. Since the results obtained with the python script, correspond just to the time evolution in homogeneous flows, and the OpenFOAM® counterpart refer to flows that integrate space and time distributions, a relation between position and time has to be established. 4.2.1 Test cases and Time-Position Relations 4.2.1.1 Simple-shear Flow Simple-shear flow can be described by only having one non-null velocity component with a constant velocity gradient, as shown in Equation (4.1). For this test case ¤𝛾was defined as unitary and it was assumed to take place in an unitary square, which results in the velocity field depicted Figure 4.7, being the employed boundary conditions presented in Table 4.1. 50 4.2 OpenFOAM®utility x y z Top Bottom Left Right Figure 4.7: Velocity field of the simple shear flow test case. Boundary A u (m/s) Left fixedValue zeroGradient uniform (0.(3) 0 0 0.(3) 0 0.(3)) Right zeroGradient zeroGradient Top zeroGradient fixedValue uniform (1 0 0) Bottom zeroGradient fixedValue uniform (0 0 0) Front & Back symmetry symmetry Table 4.1: Boundary conditions used for the Simple Shear test case. Having in mind this flow, the residence time of a virtual particle that enters in the Left patch is obtained by dividing its 𝑥coordinate by its velocity. Accordingly, for this test case, the relationship between position and time can be obtained by dividing the position of the cell on the 𝑥coordinate by its velocity, i.e., 𝑡=𝑥/𝑢𝑥. 4.2.1.2 Planar elongational flow In a planar elongational flow, the material is stretched in one direction (the flow direction), and, due to the incompressibility restriction, and contracts equally in the other direction, as shown in Equation (4.3). For this test study, the velocity profile was defined by setting ¤𝜖=2𝑠−1. The resulting velocity field is shown in Figure 4.8, and the boundary conditions were defined as shown in Table 4.1. 51 4.2 OpenFOAM®utility x y z Top Bottom Left Right Figure 4.8: Velocity field of the planar elongational flow test case. Boundary A u (m/s) Left fixedValue fixedGradient uniform (0.(3) 0 0 0.(3) 0 0.(3)) uniform (-2 0 0) Right zeroGradient fixedGradient uniform (2 0 0) Top zeroGradient fixedGradient uniform (0 -2 0) Bottom zeroGradient fixedGradient uniform (0 2 0) Front & Back symmetry symmetry Table 4.2: Boundary conditions used for the planar elongation case. The relation between position and time can be obtained from the relation between velocity, position and time. The relationship that relates velocity and position is: 𝑢=𝑢0+∫𝑥 𝑑𝑢 =𝑢0+∫𝑥 𝑑𝑢 𝑑𝑥 𝑑𝑥 =𝑢0+∫𝑥 𝑎𝑑𝑥 =𝑢0+𝑎∫𝑥 𝑑𝑥 =𝑢0+𝑎𝑥 (4.4) and between velocity and time is: 𝑑𝑢 𝑑𝑡 =𝑑𝑢 𝑑𝑥 𝑑𝑥 𝑑𝑡 =𝑎𝑢 ⇔𝑑𝑢 𝑢=𝑎𝑑𝑡 ⇔ln𝑢=𝑎𝑡 +𝑐⇔𝑢=𝑐𝑒𝑎𝑡 ⇔𝑢=𝑢0𝑒𝑎𝑡 𝑡=0→𝑢=𝑢0⇔𝑐=𝑢0 (4.5) with 𝑢0being the initial velocity, and 𝑎=𝑑𝑢 𝑑𝑥 , the acceleration. 52 4.2 OpenFOAM®utility From these two relationships, we can obtain the relation between the residence time and the position given by the cell 𝑥coordinate. 𝑢=𝑢0+𝑎𝑥 =𝑢0𝑒𝑎𝑡 ⇔𝑥=𝑢0 𝑎𝑒𝑎𝑡 −1⇔𝑡= ln 𝑎𝑥 𝑢0+1 𝑎(4.6) Equation (4.6) only holds when the velocity in the 𝑦-axis is null(𝑣𝑦=0), which happens at the middle of the mesh, when 𝑦=0. 4.2.1.3 Center-gated disk The velocity field for the center-gated disk, in local Cartesian coordinates coordinates, is given by Equation (3.1), in which the radial velocity just depends on the radius, which corresponds to the position in the x-axis, and thickness, which corresponds to the position in the z-axis. The disk geometry was created as a 5◦slice as depicted in Figure 4.9, and the boundary conditions were defined as shown in Table 4.3. x y z Top Bottom Left Right Figure 4.9: Velocity field on the disk segment in which the flow was modelled for the center-gated disk test case. Boundary A u (m/s)/ grad(u)(m/s) Left fixedValue Calculated by setExprBoundaryFields utility uniform (0.(3) 0 0 0.(3) 0 0.(3)) Right zeroGradient Front & Back zeroGradient Top & Bottom symmetry Table 4.3: Boundary conditions used for the center-gated disk test case. For this case, the boundary conditions of the velocity and gradient velocity were imposed with the setExprBoundaryFields utility, according the Equations 3.1 and 3.2. 53 4.2 OpenFOAM®utility For the disk, the data is analyzed in function of the space, so there was no need for a time-position conversion. 4.2.2 Computational framework setup Table 4.4 shows the discretization schemes used for the test cases, and Table 4.5 presents the linear solver setup and respective tolerances. Time scheme Euler Gradient Scheme Least Squares Divergent Scheme Gauss Upwind Interpolation Scheme Linear Table 4.4: Temporal and spacial discretization schemes for the simple flow cases. For the center-gated disk case, the method of Crank–Nicolson was used for the time discretization scheme, and for the remaining schemes, the same as for the simple flow cases was employed. Since, as mentioned before, the velocity field was defined by an mathematical expression, and, therefore, it was not calculated, a linear solver for this parameter was not needed. The Parameter A Linear solver Stabilized Preconditioned (bi-)conjugate gradient Smooth solvers Diagonal incomplete-Cholesky with Gauss-Seidel Absolute residual tolerance 10-11 Relative tolerance 0 Table 4.5: Solution methods for the test cases. 4.2.3 Error Measure To evaluate the error between the results from the python script and the OpenFOAM®code predictions, a similar approach to the one employed by Cintra and Tucker[45] was used. Firstly, an second order error tensor (𝜺𝑖 𝑗 )was calculated as the difference between the python results, which 54 4.2 OpenFOAM®utility is assumed as the most exact result, and the one provided by OpenFOAM®, as follows: 𝜺𝑖 𝑗 =Apython 𝑖 𝑗 −AOpenFOAM 𝑖 𝑗 .(4.7) Then the scalar magnitude of the error tensor is used to estimate the overall error, with the following expression: ||𝜺|| =√︂1 2𝜺𝑖 𝑗 𝜺𝑗𝑖.(4.8) Following this procedure, two different error parameters were calculated. The steady state error that corresponds to the error magnitude obtained for the last calculated time, ||𝜺||(𝑡f), and the time average error, given by the integration of ||𝜺|| over time: ¯ ||𝜺|| =1 𝑡f∫𝑡f 0||𝜺||(𝑡)d𝑡. (4.9) 4.2.4 Mesh Sensitivity Studies Aiming at quantifying the error associated with the refinement of the mesh, calculations were performed with different mesh refinement levels. Since the flow takes place along in the 𝑥−𝑎𝑥𝑖𝑠 direction for all test cases, the mesh was just refined along 𝑥. In the case of the planar elongational flow, despite existing flow in the y-axis direction, both the velocity and velocity gradient were imposed by exact analytic expressions, and, therefore, mesh refinement along the y-axis direction does not have impact in the results obtained. For all test cases, the number of cells imposed along the 𝑥-axis was increased according the following equation: No.Cellsx=2𝑖+4,𝑖 =1,2,3,4,5,6,7.(4.10) 4.2.5 Results and Discussion Figures 4.10 - 4.14 were obtained with a 𝐶𝐼of 0.01 and 𝜉equal to 1, for a simple shear flow. The parameters for the iARD-RPR model were set as 𝐶𝑀=0.9and 𝛼=0.1, and for the MRD-RSC 55 4.2 OpenFOAM®utility model were set as 𝜅=0.9and 𝐶1=1,𝐶2=0.5,𝐶3=0.3. The reduction of the error with mesh refinement can be both visually examined and quantified. Figure 4.10: Prediction of Folgar-Tucker model with the Hybrid closure for the simple shear flow test case (left) and calculated errors (right), for different mesh refinement levels. Figure 4.11: Prediction of Folgar-Tucker model with the IBOF closure for the simple shear flow test case (left) and calculated errors (right), for different mesh refinement levels. By comparing of the Figure 4.10 and 4.11, it is clear the overprediction of the fiber orientation, that results from the Hybrid closure, that was referred to in Section 2.3. For the Hybrid closure, around 𝑡≈10𝑠, the orientation has already reached its steady state. Meanwhile, for the IBOF closure, the steady state is only reached around 𝑡≈15𝑠. 56 References References [1] P. Thori, P. Sharma, and M. Bhargava. An approach of composite materials in industrial machinery: Advantages, disadvantages and applications. International Journal of Research in Engineering Technology, 2(12):350--355, 2013. [2] Fiber-Reinforced Composites, Available online: https://fog.ccsf.edu/ wkaufmyn/ENGN45/ Course%20Handouts/14_CompositeMaterials/03_Fiber-reinforcedComposites.html (Accessed on 2 May 2023). [3] Fiber-Reinforced Thermoplastic Composites, Available online: www.mobilityengineeringtech.com/component/content/article/adt/pub/features/articles/33369 (Accessed on 10 April 2023). [4] Saijod Lau, M Yuhazri, and Mohd Amirhafizan Husin. Performance comparison on using metal and kenaf frp composite hollow structure in oblique crushing. Technology Reports of Kansai University, 62(9):5581--5585, 2020. [5] Junghoon Kim and Donghwan Cho. Effects of waste expanded polypropylene as recycled matrix on the flexural, impact, and heat deflection temperature properties of kenaf fiber/polypropylene composites. Polymers, 12(11), 2020. doi: 10.3390/polym12112578. [6] Special Issue "Fiber-Reinforced Thermoplastics", Available online: www.mdpi.com/journal/polymers/special_issues/fiber-reinforced_thermoplastics (Accessed on 10 April 2023). [7] Charles L. Tucker. Fundamentals of Fiber Orientation: Description, Measurement and Prediction. Hanser, 2022. ISBN 978-1-56990-875-4. doi: 10.3139/9781569908761.fm. [8] J. H. Phelps and C. L. Tucker. An anisotropic rotary diffusion model for fiber orientation in short- and long-fiber thermoplastics. Journal of Non-Newtonian Fluid Mechanics, 156(3):165--176, 2009. ISSN 0377-0257. doi: 10.1016/j.jnnfm.2008.08.002. [9] H.N. Gupta, R.C. Gupta, and Arun Mittal. Manufacturing Processes. New Age International, New Delhi, 2 edition, 2009. ISBN 978-0471185758. [10] Cathelin, Julien. Through-process modelling for accurate prediction of long term anisotropic mechanics in fibre reinforced thermoplastics. MATEC Web Conf., 165:17002, 2018. doi: 10.1051/matecconf/201816517002. [11] Jonathan Köbler, Matti Schneider, Felix Ospald, Heiko Andrä, and Ralf Müller. Fiber orientation interpolation for the multiscale analysis of short fiber reinforced composite parts. Computational Mechanics, 61(6):729--750, 2018. ISSN 01787675. doi: 10.1007/s00466-017-1478-0. [12] Moldex3D | Plastic Injection Molding Simulation Software, Available on: https://www.moldex3d.com/products/software/moldex3d/solution-add-on/fiber/ (Accessed on 11 February 2022). . 63 References [13] Moldflow’s fiber orientation models (Theory) | Search | Autodesk Knowledge Network, Available on: https://knowledge.autodesk.com/support/moldflow-insight/troubleshooting/caas /sfdcarticles/sfdcarticles/What-is-the-best-fiber-orientation-model-to-use-in-Moldflow-2018.html (Accessed on 11 February 2022). . [14] George Barker Jeffery and Louis Napoleon George Filon. The motion of ellipsoidal particles immersed in a viscous fluid. Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character, 102(715):161--179, 1922. doi: 10.1098/rspa.1922.0078. [15] Moldflow | Plastic Injection Compression Molding Software | Autodesk, Available on: https://www.autodesk.com/products/moldflow/overview (Accessed on 11 February 2022). . [16] Moldex3D | Plastic Injection Molding Simulation Software, Available on: https://www.moldex3d.com/ (Accessed on 11 February 2022). . [17] OpenFOAM®, Available on: https://www.openfoam.com/ (Accessed on 11 February 2022). . [18] Suresh G. Advani and Charles L. Tucker. The use of tensors to describe and predict fiber orientation in short fiber composites. Journal of Rheology, 31(8):751--784, 1987. doi: 10.1122/1.549945. [19] Susanne Katrin Kugler, Armin Kech, Camilo Cruz, and Tim Osswald. Fiber orientation predictions—a review of existing models. Journal of Composites Science, 4(2), 2020. ISSN 2504-477X. doi: 10.3390/jcs4020069. [20] Fransisco Folgar and Charles L. Tucker. Orientation behavior of fibers in concentrated suspensions. Journal of Reinforced Plastics and Composites, 3(2):98--119, 1984. doi: 10.1177/073168448400300201. [21] H. M. Huynh. Improved fiber orientation prediction for injection-molded composites, 2001. Master’s Thesis, University of Illinois Urbana-Champaign, Champaign County, IL, USA. [22] M. Sepehr, G. Ausias, and P.J. Carreau. Rheological properties of short fiber filled polypropylene in transient shear flow. Journal of Non-Newtonian Fluid Mechanics, 123(1):19--32, 2004. doi: 10.1016/j.jnnfm.2004.06.005. [23] H. M. Huynh. Improved fiber orientation prediction for injection-molded composites, 2001. Master’s Thesis, University of Illinois Urbana-Champaign, Champaign County, IL, USA. [24] Jin Wang, John F. O’Gara, and Charles L. Tucker. An objective model for slow orientation kinetics in concentrated fiber suspensions: Theory and rheological evidence. Journal of Rheology, 52(5): 1179--1200, 2008. doi: 10.1122/1.2946437. [25] N. Phan-Thien, X.-J. Fan, R.I. Tanner, and R. Zheng. Folgar–tucker constant for a fibre suspension in a newtonian fluid. Journal of Non-Newtonian Fluid Mechanics, 103(2):251--260, 2002. doi: https://doi.org/10.1016/S0377-0257(02)00006-X. [26] S. Kleindel, D. Salaberger, R. Eder, H. Schretter, and C. Hochenauer. Prediction and validation of short fiber orientation in a complex injection molded part with chunky geometry. International Polymer Processing, 30(3):366--380, 2015. doi: 10.3139/217.3047. [27] H.-C. Tseng, Rong-Yeu Chang, and Chia-Hsiang Hsu. Phenomenological improvements to predictive models of fiber orientation in concentrated suspensions. Journal of Rheology, 57(6): 1597--1631, 2013. doi: 10.1122/1.4821038. 64 References [28] Huan-Chang Tseng, R.-Y. Chang, and Chia-Hsiang Hsu. An objective tensor to predict anisotropic fiber orientation in concentrated suspensions. Journal of Rheology, 60(2):215--224, 2016. doi: 10.1122/1.4939098. [29] Huan-Chang Tseng, Rong-Yeu Chang, and Chia-Hsiang Hsu. The use of principal spatial tensor to predict anisotropic fiber orientation in concentrated fiber suspensions. Journal of Rheology, 62 (1):313--320, 2018. doi: 10.1122/1.4998520. [30] Bakharev Alexander, Yu Huagang, Ray Shishir, Speight Russell, and Jin Wang. Using new anisotropic rotational diffusion model to improve prediction of short fibers in thermoplastic injection molding. In SPE ANTEC Conference, 2018. [31] Anthony J. Favaloro and Charles L. Tucker. Analysis of anisotropic rotary diffusion models for fiber orientation. Composites Part A: Applied Science and Manufacturing, 126:105605, 2019. ISSN 1359-835X. doi: 10.1016/j.compositesa.2019.105605. [32] Moldflow Research & Development, Available online: damassets.autodesk.net/content/dam/autodesk/www/campaigns/autodesk-moldflow-summit -recording/7_RD-Update%20-%20Jin%20Wang.pdf (Accessed on 25 July 2023). [33] Gregory M. Lambert and Donald G. Baird. Evaluating Rigid and Semiflexible Fiber Orientation Evolution Models in Simple Flows. Journal of Manufacturing Science and Engineering, 139(3): 031012, 10 2016. doi: 10.1115/1.4034664. [34] Hongyu Chen, Peter Wapperom, and Donald G. Baird. A model incorporating the effects of flow type on fiber orientation for flows with mixed flow kinematics. Journal of Rheology, 63(3):455--464, 2019. doi: 10.1122/1.5086805. [35] Susanne Katrin Kugler, Argha Protim Dey, Sandra Saad, Camilo Cruz, Armin Kech, and Tim Osswald. A flow-dependent fiber orientation model. Journal of Composites Science, 4(3), 2020. doi: 10.3390/jcs4030096. [36] J. J. Cheng and I. Manas-Zloczower. Flow field characterization in a banbury mixer. International Polymer Processing, 5(3):178--183, 1990. [37] Hongyu Chen, Peter Wapperom, and Donald G. Baird. The use of flow type dependent strain reduction factor to improve fiber orientation predictions for an injection molded center-gated disk. Physics of Fluids, 31(12):123105, 2019. doi: 10.1063/1.5129679. [38] George L. Hand. A theory of anisotropic fluids. Journal of Fluid Mechanics, 13(1):33–46, 1962. doi: 10.1017/S0022112062000476. [39] Suresh G. Advani and Charles L. Tucker. Closure approximations for three-dimensional structure tensors. Journal of Rheology, 34(3):367--386, 1990. doi: 10.1122/1.550133. [40] Masao Doi. Molecular dynamics and rheological properties of concentrated solutions of rodlike polymers in isotropic and liquid crystalline phases. Journal of Polymer Science: Polymer Physics Edition, 19(2):229--243, 1981. doi: 10.1002/pol.1981.180190205. [41] G.G. Lipscomb, M.M. Denn, D.U. Hur, and D.V. Boger. The flow of fiber suspensions in complex geometries. Journal of Non-Newtonian Fluid Mechanics, 26(3):297--325, 1988. ISSN 0377-0257. doi: 10.1016/0377-0257(88)80023-5. 65 References [42] G. Marrucci and N. Grizzuti. Predicted effect of polydispersity on rodlike polymer behaviour in concentrated solutions. Journal of Non-Newtonian Fluid Mechanics, 14:103--119, 1984. ISSN 0377-0257. doi: 10.1016/0377-0257(84)80039-7. [43] David A. Jack and Douglas E. Smith. Assessing the use of tensor closure methods with orientation distribution reconstruction functions. Journal of Composite Materials, 38(21):1851--1871, 2004. doi: 10.1177/0021998304048413. [44] F. Dupret and V. Verleye. Modelling the flow of fiber suspensions in narrow gaps. In D.A. Siginer, D. De Kee, and R.P. Chhabra, editors, Advances in the Flow and Rheology of Non-Newtonian Fluids, volume 8 of Rheology Series, pages 1347--1398. Elsevier, 1999. doi: 10.1016/S0169-3107(99)80020-3. [45] Joaquim S. Cintra and Charles L. Tucker. Orthotropic closure approximations for flow-induced fiber orientation. Journal of Rheology, 39(6):1095--1122, 1995. doi: 10.1122/1.550630. [46] Charu V. Chaubal and L. Gary Leal. A closure approximation for liquid-crystalline polymer models based on parametric density estimation. Journal of Rheology, 42(1):177--201, 1998. doi: 10.1122/1.550887. [47] E. D. Wetzel. Modeling flow-induced microstructure of inhomogeneous liquid-liquid mixtures, 1999. Ph.D. thesis, University of Illinois at Urbana-Champaign, Champaign, IL, USA. [48] B. E. VerWeyst. Numerical predictions of flow-induced fiber orientation in 3-d geometries, 1999. Ph.D. thesis, University of Illinois at Urbana-Champaign, Urbana, IL, USA. [49] Du Hwan Chung and Tai Hun Kwon. Improved model of orthotropic closure approximation for flow induced fiber orientation. Polymer Composites, 22(5):636--649, 2001. doi: 10.1002/pc.10566. [50] D. H. Chung and Tai Hun Kwon. Invariant-based optimal fitting closure approximation for the numerical prediction of flow-induced fiber orientation. Journal of Rheology, 46(1):169--194, 2002. doi: 10.1122/1.1423312. [51] David A. Jack, Bryan Schache, and Douglas E. Smith. Neural network-based closure for modeling short-fiber suspensions. Polymer Composites, 31(7):1125--1141, 2010. doi: 10.1002/pc.20912. [52] F. Dupret and V. Verleye. Prediction of fiber orientation in complex injection molded parts. In Dev. Non-Newtonian Flows, 1993. [53] S. Montgomery-Smith, D. Jack, and D.E. Smith. Exact tensor closures for the three-dimensional jeffery’s equation. Journal of Fluid Mechanics, 680:321–335, 2011. doi: 10.1017/jfm.2011.165. [54] Stephen Montgomery-Smith, David Jack, and Douglas E. Smith. The Fast Exact Closure for Jeffery’s equation with diffusion. Journal of Non-Newtonian Fluid Mechanics, 166(7):343--353, 2011. doi: 10.1016/j.jnnfm.2010.12.010. [55] NumPy.The fundamental package for scientific computing with Python, Available on: https://numpy.org/ (Accessed on 11 February 2022). . [56] SciPy. Fundamental algorithms for scientific computing in Python, Available on: https://scipy.org/ (Accessed on 11 February 2022). . [57] SymPy, Available on: https://www.sympy.org/pt/index.html (Accessed on 11 February 2022). . 66 References [58] Matplotlib: Visualization with Python, Available on: https://matplotlib.org/ (Accessed on 11 February 2022). [59] Computational-Rheology / FiberOrientation_OFUtility, Available on: https://github.com/Computational-Rheology/FiberOrientation_OFUtility.git (Accessed on 28 July 2023). [60] scipy.integrate.solve_ivp, Available on: https://docs.scipy.org/doc/scipy/reference/generated/ scipy.integrate.solve_ivp.html (Accessed on 11 February 2022). . [61] numpy.einsum, Available on: https://numpy.org/doc/stable/reference/generated/numpy. einsum.html (Accessed on 10 May 2023). . [62] Introduction - SymPy 1.11 documentation, Available on: https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.htmlwhy-sympy (Accessed on 10 May 2023). . [63] Code Generation, Available on: https://docs.sympy.org/latest/modules/codegen.htmlsympy. codegen.rewriting.create_expand_pow_optimization (Accessed on 28 July 2023). [64] OpenFOAM: User Guide, Available online: https://www.openfoam.com/documentation/guides /latest/doc/index.html (Accessed on 10 April 2023). [65] OpenFOAM guide/Finite volume method (OpenFOAM), Available online: https://openfoamwiki.net/index.php/Finite_volume_method_(OpenFOAM) (Accessed on 10 April 2023). [66] Christopher Greenshields and Henry Weller. Notes on Computational Fluid Dynamics: General Principles. CFD Direct Ltd, Reading, UK, 2022. [67] ParaView - Open-source, multi-platform data analysis and visualization application, Available on: https://www.paraview.org/ (Accessed on 11 February 2022). [68] ames William Cooper. Java Design Patterns: A Tutorial. Addison-Wesley Professional, 2000. ISBN 9780201485394. [69] Susanne K. Kugler, Gregory M. Lambert, Camilo Cruz, Armin Kech, Tim A. Osswald, and Donald G. Baird. Macroscopic fiber orientation model evaluation for concentrated short fiber reinforced polymers in comparison to experimental data. Polymer Composites, 41(7):2542--2556, 2020. doi: 10.1002/pc.25553. [70] WebPlotDigitizer - Extract data from plots, images, and maps, Available on: https://automeris.io/WebPlotDigitizer/ (Accessed on 16 January 2023). [71] Randy S. Bay and Charles L. Tucker III. Fiber orientation in simple injection moldings. part i: Theory and numerical methods. Polymer Composites, 13(4):317--331, 1992. doi: 10.1002/pc.750130409. [72] Standard utilities, Available on: https://www.openfoam.com/documentation/user-guide/ a-reference/a.2-standard-utilities (Accessed on 28 July 2023). [73] Bruno Ramôa, Ricardo Costa, Francisco Chinesta, and J.M. Nobrega. A semi-automatic approach based on the method of manufactured solutions to assess the convergence order in openfoam. 2: 148--165, 11 2022. doi: 10.51560/ofj.v2.75. 67 References [74] GitHub - krebeljk/openInjMoldSim: Open source injection molding simulation. A solver for OpenFOAM , Available on: https://github.com/krebeljk/openInjMoldSim (Accessed on 11 February 2022). . 68 Appendices A Calculation of 𝛽for the IBOF closure 𝛽𝑖=A𝑖,1+A𝑖,2II +A𝑖,3II3+A𝑖,4III +A𝑖,5III2+A𝑖,6IIIII +A𝑖,7II2III +A𝑖,8IIIII2+A𝑖,9II3+ A𝑖,10III3+A𝑖,11II3III +A𝑖,12II2III2+A𝑖,13IIIII3+A𝑖,14II4+A𝑖,15III4+A𝑖,16II4III +A𝑖,17II3III2+ A𝑖,18II2III3+A𝑖,19IIIII4+A𝑖,20II5+A𝑖,21III5,(𝑖=3,4,6) 𝛽1=3 5[−1 7+1 5𝛽3(1 7+4 7II +8 3III)−𝛽4(1 5−8 15 II −14 15 III)−𝛽6(1 35 −24 105 III −4 35 II +16 15 II III+ 8 35 II2)] 𝛽2=6 7[1−1 5𝛽3(1+4II)+7 5𝛽4(1 6−II)−𝛽6(−1 5+2 3III +4 5II −8 5II2)] 𝛽5=−4 5𝛽3−7 5𝛽4−6 5𝛽6(1−4 3II) B Results and Discussion The parameters for the following test cases were the same as for the simple shear flow cases, indicated in Section 4.2.5. B.1 Planar Elongational flow Due the exponential relationship between time and space, a mesh with a large length along the x-axis would be needed for the analyses of times corresponding to the steady state. The necessary mesh’s length is not computationally possible with the available resources, and, therefore, the error for the steady state was not calculated. Figure B.1: Prediction of Folgar-Tucker model with the Hybrid closure for the planar elongational flow test case (left) and calculated errors (right), for different mesh refinement levels. i Figure B.2: Prediction of Folgar-Tucker model with the IBOF closure for the planar elongational flow test case (left) and calculated errors (right), for different mesh refinement levels. Figure B.3: Prediction of Folgar-Tucker model with the ORE closure for the planar elongational flow test case (left) and calculated errors (right), for different mesh refinement levels. ii Figure B.4: Prediction of iARD-RPR model with the IBOF closure for the planar elongational flow test case (left) and calculated errors (right), for different mesh refinement levels. Figure B.5: Prediction of MRD-RSC model with the IBOF closure for the planar elongational flow test case (left) and calculated errors (right), for different mesh refinement levels. iii B.2 Flow in a center-gated disk Since the center-gated disk is analysed in function of space, and not time, the error associated with it was not calculated. Figure B.6: Prediction of Folgar-Tucker model with the Hybrid closure for the center-gated disk case at ˜𝑧≈0.1 (left) and calculated errors (right), for different mesh refinement levels. Figure B.7: Prediction of Folgar-Tucker model with the IBOF closure for the center-gated disk case at ˜𝑧≈0.1 (left) and calculated errors (right), for different mesh refinement levels. iv