Study of fluid flow inside closed cavities using computational numerical methods

The temperature distribution and distortion of fluid flow inside the closed cavities, square and triangle, are studied for different boundary conditions. Two different conditions of thermal boundary conditions are used for studying square cavities: (i) Left wall is hot, right wall is cold, top and bottom walls are adiabatic. (ii) Left and right walls are cold, top wall is adiabatic, bottom wall is hot. For triangular enclosure, the boundary conditions are (i) the vertical wall is insulated, bottom wall is hot. (ii) The vertical wall is hot, the bottom wall insulated and the inclined walls are kept cold in both conditions. The velocity of the flow is observed by means of stream function and the temperature distribution is displayed in the form of contours. The study is carried out in ANSYS software. The mathematical procedure for solving the nonlinear system of partial differential equations by penalty finite element method involving bi-quadratic elements is also discussed in detail.


Introduction
The temperature distribution and distortion of fluid flow inside the square and triangular cavities are mathematically formulated by means of finite elements and studied with the help of ANSYS. The cross section of a flow in rectangular and triangular ducts results in a square and triangular cavity. In the current study, behavior of the temperature and velocity of fluid flowing inside the closed cavities with different boundary conditions is considered. The literature explains a vivid usage of the natural convection flow within the closed entities because of its practical relevance in various applications, such as heat exchangers [1] and [2], room heating and ventilation design [3][4][5], melting [6], etc., Different shapes of cavities, circle [7], trapezoid [8], square [9] and [10], triangle [11][12][13] has been grabbing the attention of researchers since decades. The non-dimensional governing equations of the 2D flow problem is formulated with the penalty finite element method. Detailed solution procedure to obtain a finite element equation from a nonlinear system of partial differential equations is discussed. The studies of fluid flow inside the square and triangular enclosures is performed with ANSYS, a renowned, trustworthy and widely used tool by researchers. Two occurrences in square cavities and two from triangular structure are studied varying the temperature boundary condition. Thermal boundary condition is varied throughout the study, but the velocity of the fluid at the solid boundary will be zero. Study 1: Square cavity, Case 1: Left wall is hot, right wall is cold and the top and the bottom walls are adiabatic and. Case 2: Left and right walls are maintained cold, top wall is adiabatic and the bottom wall is heated. Study 2: Triangular enclosures, Case 1: The vertical wall is insulated, bottom wall heated up and the inclined wall is kept cold. Case 2: The vertical wall is hot, the bottom wall insulated and the inclined wall is kept cold. The governing equations, mathematical formulation and the study in ANSYS can be observed in the article.
2 Mathematical formulation 2.1 Governing equations and solution procedure The nonlinear system of partial differential equations, involving, Navier-Stokes and energy balance equation governs the fluid flow and the temperature distribution. The density due to temperature variation is calculated using Boussineq approximation. All the physical quantities are constant but for density. Equations (1)-(4) are the non-dimensional form of the governing equations. where u ¼ tÀt c t h Àt c , (u dimensionless temperature components, T h and T c are the temperatures at hot and cold walls respectively) The penalty finite element method [14] aids the formulation of governing differential equations, introducing the penalty parameter (g). To eliminate pressure P in equations (2) and (3), equation (5) containing the relationship between the penalty parameter (g) and the incompressibility is substituted. Generally, g = 10 7 , for reliable solutions.
Hence equations (2) and (3) becomes, The square and the triangular cavities considered for the study is discretized into biquadratic elements. Figure 1, depicts the discretization of the domains and mapping from X-Y plane to s-t plane.
Galerkin finite element method is employed in solving the system of governing differential equations (6), (7) and (4). The thermal and the velocity components are expanded through basis set given in equation (8).
Equation (8) expands the governing equations. A weighted function (N i ) is multiplied and integrated over the domain, resulting in the nonlinear residual partial differential equations.
Equations (9)-(11) are the nonlinear residues, from which the finite element equation should be formed.
Grouping the the co-efficient of X 9 j¼1 U j from all three residues Grouping the co-efficient of V j from all three residues Grouping the co-efficient of u j from all three residues Rewriting the governing equations, with the above substitutions, in matrix form Let It is evident that every node (i) has 3 degrees of freedom, resulting in 27 unknowns for one biquadratic element. The local nodal numbering with global nodal numbers yields the element connectivity which will support in 2D assembly.

Jacobian transformation
The integrand is a function of the global coordinates X and Y. Figure 1 shows the co-ordinate transformation for the discretized elements from the X À Y plane to the s À t plane.
The integrand contains not only functions but also derivatives with respect to the global coordinates ðx j ; y j Þ. Therefore,   The matrix [J] is called the Jacobian matrix of the transformation.
To evaluate ∂X ∂s , ∂X ∂t , ∂Y ∂s and ∂Y ∂t we use the transformation Therefore Equation (28) requires that the Jacobian matrix [J] should be nonsingular. Thus, given the global coordinates (x j , y j ) of element nodes and the interpolation functions, Nj used for geometry [15], the Jacobian matrix can be evaluated using equation (27).
Consequently, solving equation (21) for every node in the domain provides the thermal and velocity components. The commonly used numerical integration methods for the definite integrals can be classified into two groups: (i) Newton-Cotes formulae that employ values of the integrand at equally spaced points and (ii) Gaussian quadrature formula that employs unequally spaced points.

Stream function
The stream function is used to display the fluid flow and is acquired from velocity components U and V. The relationships between stream function, c and velocity components for 2D flows are It yields the governing equation for stream function Expanding the stream function c using the basis set and the relation for U, V from the Galerkin finite element method yields in the linear residual equations.
The no-slip condition is imposed at all boundaries as mentioned earlier and there is no cross flow too, hence c = 0 at the nodes of the walls. The bi-quadratic basis function is used to evaluate the integrals in equation (33) and c's are obtained by solving the same. Stream functions (c's) thus obtained might be positive or negative. The positive and negative signs of c denotes anti-clockwise and clockwise circulation respectively.

Studies of fluid flow inside closed cavities using ANSYS
How heat moves from point A to B, precisely explains heat transfer. Three ways in which the heat transfers, is as follows. Conduction, heat transfer by molecular contact; Convection, result of density differences and Radiation happening by wave motion. This article concentrates only on natural convection, driving force is the natural gravity as always. Fluid flow inside closed triangular and square cavities is calculated employing ANSYS, Workbench 2020 R1. Geometry is built in the Design Modeler. Many flow problems solved in engineering practice involve complex geometries; Here the simple 2D geometry is meshed with quadrilateral elements. This simulation is limited to steady state. The free convection dealing with the gravity is added in y-direction. Enable heat transfer by checking energy in the model. The energy dialogue box favors the input of parameters related to energy or heat transfer. The fluid taken for this study is air, Pr = 0.71. In all the cases laminar nature of the fluid is sustained. The solid within which the flow takes place is aluminum. In the cell zone conditions, the operating conditions are set. Boundary conditions for square and the triangular cavities are detailed in their respective sections. Post initialization, the calculations are carried out. Temperature distribution and flow distortion are visualized as contours and are substantiated with the existing literature.

Square cavity
The square cavity, cross section of a rectangular duct, is built with 1 m all sides. The fluid with Pr = 0.71 and Ra = 10 5 is taken for studying the flow with varying thermal boundary conditions. The fluid in contact with the walls are at rest. Quadrilateral elements are involved in the meshing. The heat inputs are given on the walls, hence, the edges are meshed with bias factor 5.0. For a square cavity with the left wall, DA, experiencing the heat source, right wall, BC, cold and the top wall, CD, and the bottom wall, AB, are adiabatic, Figures 2 and 3 explains the temperature distribution and velocity respectively. From the contour it is evident that the temperature reduces from the left wall to right. The stream function clearly states that the clockwise flow is laminar. The results obtained are aligned with Singh et al. [10]. In other circumstance of square cavity taken for study, walls DA and BC are maintained cold, wall CD is adiabatic and the wall AB is alone heated up. There is a temperature flow from the bottom to the top, the temperature descends as it moves upward, can be seen in Figure 4. The laminar flow for this case, displayed in Figure 5, is unique consisting of clockwise and anticlockwise flows. This pattern is observed to be in relevance with Basak et al. [9].

Triangular enclosure
The base and the height of the right angled triangle is 1 m. The quadrilateral elements are used for meshing the triangular enclosure. Bias factor 5.0 is applied for the edges while meshing to get a thick mesh considering the thermal inputs in the boundary. Two different sets of boundary condition are taken for study. In both situations the inclined wall is kept cold. In the triangular entity, the velocity boundary condition is restricted to no slip condition on all sides. The triangle with fluid parameters Pr = 0.71 and Ra = 710, and the boundary conditions on wall AB, bottom wall has the heat source, wall BC, inclined wall is cold and the wall CA, is adiabatic. A clear picture of the anticlockwise laminar flow can be seen in Figure 7. The temperature distribution is observed in Figure 6; the heat reduces from the base as it moves upwards. This can be related to [12] and the similarity is perceived. The other situation dealing with the triangle, wall AB insulated, BC cold and CA hot with Pr = 0.71 and Ra = 10 3 . Figure 8 briefs the temperature increase, as it moves to the vertical wall. Figure 9 delineates the flow of stream function with its laminar nature maintained and the flow is clockwise as in [13] makes the contour look promising as it is identical with those in the literature.    The temperature distribution and distortion of fluid flow inside the square and triangular cavities, for different boundary conditions are analyzed with ANSYS. Fluids in the present study for specific boundary conditions is observed to be laminar. Absence of variation with temperature spreading and fluid alteration is observed from the contours of the closed cavities, Figures 2-9 and the result agrees well with [9,10,12,13]. In future, the closed form solution of the current work will be pondered using a programming language in a numerical environment with penalty finite element method involving bi-quadratic elements. Upcoming studies in the same category can be done by varying a set of Rayleigh number and Prandtl number. When making it time dependent, the flow inside the full length of the pipe can be investigated. Keeping the flow laminar throughout, at various boundary conditions will support practical real time problems like injection molding processes [16].