# Numerical Simulation of KBKZ Integral Constitutive Equations in Hierarchical Grids
## 1 Introduction  
Over the years, several software programs have been developed to solve problems involving complex viscoelastic fluid flows. Due to a lack of generality, some challenges can arise when trying to solve problems with specific characteristics. In most works that develop numerical methods for simulating viscoelastic flows, the constitutive equations are approximated by differential equations, such as the Oldroyd-B [1; 2; 3], Upper-Convected-Maxwell (UCM) [4; 5], Phan-Thien-Tanner [6; 7], eXtended Pom-Pom [8; 9] models, among others. However, advances in computational resources have motivated researchers to consider more sophisticated rheological models that are expressed in integral form instead of differential equations. In this sense, integral models allow a better approximation of the behavior of viscoelastic fluids. However, they require a greater computational effort and this is because, at each moment of the simulation, it is necessary to store and access the history of the entire deformation of the fluid (since it previously started to be deformed). Among the integral models that we found in the literature, the constitutive equation KBKZ-PSM has been considered by many researchers who study numerical methods for this kind of fluid. A detailed discussion of the importance of the KBKZ-PSM integral constitutive model and the development of numerical techniques to approximate integral models can be found in the works of [PERSON] [10] and [PERSON] [11]. The vast majority of problems using the KBKZ-PSM integral model involve confined flows, such as channel-flows [12; 13] and flows in abrupt contractions [3; 14; 15]. Flow problems possessing free surface(s) have also been considered by some researchers. More interesting flow problems that involve transient free surface(s) and integral models are the filament stretching [16] and a numerical study of the die swell phenomenon [17; 18; 19; 20; 21].  
On the other hand, a numerical solution of partial differential equations in general grids has been questioned by many researchers in recent decades. Many schemes try to combine efficiency and simplicity with the flexibility of unstructured mesh networks. A major advantage of using such meshes is the ability to refine the mesh locally, improving accuracy in specific regions without dramatically increasing the number of unknowns. Among all possible ways of discretizing the spatial domain (simplified meshes, curvilinear meshes, among others), hierarchical meshes based on Cartesian trees are a common choice. They allow the development of finite difference methods, without the hassle of mapping and transforming distorted elements or dealing with general and complicated stencils, as in non-Cartesian grids. Since flows are generally computed on facets aligned with the Cartesian axis, numerical schemes are generally simpler to derive. However, these facets are generally shared by different numbers of elements on each side, which is the main challenge in implementing numerical methods. Different techniques to deal with this problem have been developed in the literature, most of them restricted to quadtree meshes (in 2D) or octree (3D) meshes, which are special cases of hierarchical grids represented by data structures quadtree/octree. Despite this restriction, these tree-based data structures are generally good enough and still an adequate choice for adaptive grids and moving borders [22]. Thus, we intend to implement in the present work the transient KBKZ-PSM model through a method of finite differences in hierarchical meshes that employ interpolations using the moving least squares (MLS) method [23]. The developed numerical method is verified by using mesh refinement in channel flow and we show results from the simulation of the 4:1 contraction problem using a KBKZ fluid. Our results are compared to the ones obtained using the OpenFOAM system [24], which uses finite volumes in the discretization of Navier-Stokes equations. We used the OpenFOAM v2006 version to implement the equations with the finite volume method.