Professional Documents
Culture Documents
Nigerian Society
of Physical
J. Nig. Soc. Phys. Sci. 4 (2022) 231–241
Sciences
Abstract
The temperature and fluid profiles of flow inside tilted square cavities are analysed with two different cases of thermal boundary conditions,
(1) Isothermally cold sidewalls of the cavity and the hot bottom wall kept parallel to the insulated top wall, (2) Hot left wall, cold right wall,
insulated top and bottom walls. The Galerkin finite element method with penalty parameter is used to solve the nonlinear coupled system of
partial differential equations governing the flow and thermal fields. The method is further used to solve the Poisson equation for stream function.
The results are presented in terms of isotherms and streamlines. The Gaussian rule with the hybrid function formed from the block-pulse function
and Lagrange polynomial is implemented for the evaluation of the definite integrals present in the residual equations. Attempting to affix the
hybrid methods in the integration part for solving Finite Element Method (FEM) turned efficacious as the convergence is achieved for streamlines
◦ ◦
and isotherms with the existing results. The tilted square cavities with inclination angles 0 ≤ φ ≤ 90 and Rayleigh number ranging between
10 ≤ Ra ≤ 10 for Pr = 0.71 (air) are investigated. The source code for the finite element analysis is written in Mathematica. The results thus
3 5
obtained are found to be competent with those of COMSOL, the Software for Multiphysics Simulation.
DOI:10.46481/jnsps.2022.637
Keywords: Penalty finite element analysis, inclined square cavities, thermal distribution, fluid distortion, Mathematica, hybrid function,
numerical integration, COMSOL
Article History :
Received: 04 February 2022
Received in revised form: 07 April 2022
Accepted for publication: 07 April 2022
Published: 29 May 2022
c 2022 Journal of the Nigerian Society of Physical Sciences. All rights reserved.
Communicated by: T. Latunde
tigated. The Rayleigh number above 103 will display a distinc- Figure 1. Square tilted at angle (Case 1) φ
tive change in the convective heat transfer rate as the inclination
angle is increased. At Ra = 103 and Ra = 105 gives the mini-
(Case 2) Hot left wall, cold right wall, insulated top and bottom
mum and maximum heat transfer rate as the angle increases [8].
walls.
Literature provides with various methods for solving ODEs and
are featured in the present work. An endeavour is made to in-
PDEs and differential equations are solved using block meth-
corporate this hybrid method in the integration part for solv-
ods, step points, numerical methods, etc., [18]-[22].In common
ing FEM turned efficacious as the convergence is achieved for
practice, Gaussian quadrature method is used for evaluating
streamlines and isotherms with the existing results in the litera-
the integrals present in the finite element equations. Among
ture [10, 12]. The source code for the finite element analysis is
the numerical methods available in the literature, a technique
written in Mathematica and the results obtained are compared
based on the Hybrid function approximation for solving non-
with COMSOL. Mathematical Procedure involving the Govern-
linear initial-value problems with applications to Lane-Emden
ing Differential Equations (GDEs) and finite element formu-
type equations was suggested [23]. They made use of the prop-
lation is discussed in the first section, Hybrid method for the
erties of block-pulse functions and Lagrange interpolating poly-
numerical integration is explained in the next section, and the
nomials to reduce the nonlinear initial-value problem to a sys-
results are detailed in the last section.
tem of non-algebraic equations to arrive at the accurate results.
The same method was also used to provide accurate results
for solving nonlinear integro-differential equations such as in 2. Methodology
Volterrra’s population model [24] and Volterra-Fredholm equa-
tion, and also for variational problems. A comparative study of 2.1. Computational technique
quadrature rules based on Haar wavelet and Hybrid function of The physical domain (D) of square cavity (PQRS) with
◦ ◦
block-pulse and Legendre polynomial, for finding the approx- angles of inclination 0 ≤ φ ≤ 90 for both thermal bound-
imate value of the definite integrals, was made and the proce- ary conditions is considered in the present study. The range
dure was extended to the numerical solution of double and triple of Rayleigh’s Numbers falls between 103 ≤ Ra ≤ 105 for the
integrals with variable limits [25, 26]. It was observed that study. Figure 1, shows a clear picture of the geometry consid-
the hybrid method provides faster convergence when related to ered, incorporating case 1 boundary conditions.
Haar Wavelet and that the orders of the block-pulse function Physical properties are kept constant during the calculation
and Legendre polynomial can be attuned to attain very precise except the density in buoyancy term, where change in den-
solution. Hybrid of Block-Pulse function using Lagrange poly- sity due to temperature variation is estimated using Boussi-
nomial was considered for evaluation by [27] for the evalua- nesq approximation. The phenomena of thermal and fluid flow
tion of general double and triple integrals with variable limits inside the domain are governed by the energy balance and
that shows better accuracy over Haar Wavelet. Solution of vari- Navier–Stokes equations, respectively. The governing equa-
ational problems are also derived using the same [28]. Vari- tions for steady natural convection flow using conservation of
able weights are used for the study in contrast with the constant mass, momentum and energy in dimensionless form are given
weights considered in [25]. below:
◦ ◦
The square cavities inclined at angles 0 ≤ φ ≤ 90 are studied
∂U ∂V
with the fluid (Pr = 0.71) flowing within a two dimensional, + =0 (1)
∂X ∂Y
steady and laminar flow across the calculation domain with two
different cases of thermal boundary conditions (BC), ∂U ∂U ∂P ∂2 U ∂2 U
!
(Case 1) Isothermally cold sidewalls of the cavity and the hot U +V =− + Pr + (2)
∂X ∂Y ∂X ∂X 2 ∂Y 2
bottom wall kept parallel to the insulated top wall,
232
Mariya & Prabhakar / J. Nig. Soc. Phys. Sci. 4 (2022) 231–241 233
∂V ∂V ∂P ∂ V ∂ V 2 2 Z X
! 9
9
9 ∂N j X ∂N j
+V =− + Pr + + Ra Pr θ
X
i =
R(2) + V j N j
U (3) Vj × U j N j Ni dXdY
∂X ∂Y ∂Y ∂X 2 ∂Y 2
j=1 D j=1
∂X j=1
∂Y
9
X Z ∂Ni ∂N j 9
∂Ni ∂N j
∂θ ∂θ ∂2 θ ∂2 θ
X Z
U +V = + (4) + γ U j
dXdY + Vj dXdY
∂X ∂Y ∂X 2 ∂Y 2 j=1 D ∂Y ∂X j=1 D ∂Y ∂Y
(10)
∂Ni ∂N j ∂Ni ∂N j
9 Z !
The penalty finite element method [17] is used to eliminate + Pr
X
Vj + dXdY
the pressure term by the inclusion of the penalty parameter (γ) j=1 D ∂X ∂X ∂Y ∂Y
in the equations (2) and (3) with the following relationship in- 9
X Z
volving the incompressibility. − Ra Pr θj N j dXdY
j=1 D
∂U ∂V
!
P = −γ + (5) 9 Z X 9
∂N j X
∂N j
∂X ∂Y X 9
R(3) = θj × U j N j + V j N j
Ni dXdY
i
∂X j=1 ∂Y
j=1 D j=1
Generally, (γ = 107 ) is considered for reliable solutions (11)
∂Ni ∂N j ∂Ni ∂N j
9 Z !
[10]. Applying (5) to (2) and (3) yields +
X
θj + dXdY
D ∂X ∂X ∂Y ∂Y
∂U ∂U ∂ ∂U ∂V ∂2 U ∂2 U j=1
! !
U +V = −γ + + Pr + (6)
∂X ∂Y ∂X ∂X ∂Y ∂X 2 ∂Y 2 For nine-noded biquadratic element (Figure 2) with three
degrees of freedom, residual equations (9) − (11) consists of 27
∂V ∂V ∂ ∂U ∂V
! unknowns in 27 equations.
U +V = −γ +
∂X ∂Y ∂Y ∂X ∂Y
2.2. Stream function
∂2 V ∂2 V
!
+ Pr + + Ra Pr θ (7) The stream function is used to display the fluid flow and is
∂X 2 ∂Y 2
acquired from velocity components U and V. The relationships
The whole domain is discretized into bi-quadratic elements. between stream function, ψ and velocity components for 2D
Galerkin finite element method is applied to solve the system flows are
of governing differential equations (6), (7) and (4).
∂ψ ∂ψ
A numerical integration method involving hybrid functions U= and V = − (12)
explained in the section 2.3 is used for obtaining the finite el- ∂Y ∂X
ement solutions from the residual equations. The thermal (θ) On differentiating (12), the governing equation for stream
and then velocityo components (U&V) are expanded through ba- function is attained.
sis set 9j=1 N j given in equation (8). N j s are the shape func-
P
tions. The procedure to obtain N j s are detailed in [29] and those ∂2 ψ ∂2 ψ ∂U ∂V
+ = − (13)
functions considered for this study is provided in the Appendix. ∂X 2 ∂Y 2 ∂Y ∂X
Expanding the stream function ψ using the basis set
9
X 9
X 9
U≈ U j N j (X, Y), V ≈ V j N j (X, Y), X
j=1 j=1
ψ≈ ψ j N j (X, Y) (14)
j=1
9
X
θ≈ θ j N j (X, Y) (8) and the relation for U, V from (8), the residual equations
j=1 for (13) is,
∂Ni ∂N j ∂Ni ∂N j
The residual equations for an element are obtained by using 9
X Z ! Z
(8) in the governing equations, resulting in the following system R(ψ)
i = ψj + dXdY − Ni n.∇ψdΓ
D ∂X ∂X ∂Y ∂Y Γ
of nonlinear residual partial differential equations. j=1
(15)
9
∂N j 9
∂N j
Z Z
9 Z X 9
∂N j X
∂N j
9
X X
+ Uj ∂Ni dXdY − Vj ∂Ni dXdY
X
R(1) = Uj × U j N j + V j N j
Ni dXdY
∂Y ∂X
i
j=1 D j=1
∂X j=1 ∂Y j=1 D j=1 D
9
X Z ∂Ni ∂N j 9
∂Ni ∂N j Applying no-slip boundary condition (ψ = 0), ψ’s is ob-
X Z
+ γ U j
dXdY + Vj dXdY (9)
j=1 D ∂X ∂X j=1 D ∂X ∂Y tained from the linear system (15). Stream functions (ψ0 s)
thus obtained might be positive or negative denoting the anti-
∂Ni ∂N j ∂Ni ∂N j
X 9 Z !
+ Pr Uj + dXdY clockwise and clockwise circulation respectively.
D ∂X ∂X ∂Y ∂Y
j=1 The integrands of the definite integrals appearing in (9)-(11)
and (15) are functions of the global coordinates X and Y. Fig-
ure 2 shows the co-ordinate transformation for the discretized
elements from the X − Y plane to s − t the plane [11]. The
233
Mariya & Prabhakar / J. Nig. Soc. Phys. Sci. 4 (2022) 231–241 234
◦
15
◦
◦ 75
15
◦
15
◦
75
◦
45
integrals appearing in the transformed residual equations are
evaluated using hybrid function of block pulse function and La-
grange polynomial. The transformed residual equations solved
for every node in the domain provides the thermal and velocity
components. Finite element procedure to solve this is briefed ◦
in the Appendix. 75
It was shown that hybrid function based on block-pulse and
Lagrange polynomial gives better accuracy than Haar wavelets
and other hybrid functions [26], with comparatively lesser
nodal points. Motivated by the accuracy of this method in solv-
ing the differential equations (both linear and nonlinear), an in-
tegration scheme based on hybrid functions for definite single, 2.3. Hybrid Function
double and triple integrals was presented by [27]. An attempt Definition 1: Block pulse functions: A set of block-pulse
has been made in applying hybrid functions to obtain the finite function φ j (t), j = 1, 2, ...J defined on the interval [0, 1) are
element solutions. Details regarding the hybrid function and the denoted as
integration scheme are explained in the following section.
1, t j−1 ≤ t ≤ t j
φ j (t) =
(16)
0, otherwise
Table 4. Streamlines of Ra = 103 ; Pr = 0.71; PS & QR-cold; SR-adiabatic; Table 6. Streamlines of Ra = 105 ; Pr = 0.71; PS & QR-cold; SR-adiabatic;
PQ-hot PQ-hot
φ Mathematica results COMSOL results φ Mathematica results COMSOL results
◦ ◦
15 15
◦ ◦
45 45
◦ ◦
75 75
Table 5. Streamlines of Ra = 104 ; Pr = 0.71; PS & QR-cold; SR-adiabatic; Table 7. Isotherms of Ra = 103 ; Pr = 0.71; PS-hot; QR - Cold; PQ and SR
PQ-hot -adiabatic;
φ Mathematica results COMSOL results φ Mathematica results COMSOL results
◦ ◦
15 0
◦ ◦
45 30
◦ ◦
75 50
of the block pulse function in [0, 1). k = 0, 1, ...K − 1 on the interval [0, 1) are denoted as
h j−1 j i
Lk (2Jt − 2 j + 1), t ∈ J , J
h jk (t) =
Definition 2: Hybrid functions of block pulse and Lagrange (17)
0, otherwise
polynomial functions: A set of hybrid functions h jk (t), j =
Table 8. Isotherms of Ra = 104 ; Pr = 0.71; PS-hot; QR - Cold; PQ and SR Table 10. Streamlines of Ra = 103 ; Pr = 0.71; PS-hot; QR - Cold; PQ and SR
-adiabatic; -adiabatic;
φ Mathematica results COMSOL results φ Mathematica results COMSOL results
◦ ◦
0 0
◦ ◦
30 30
◦ ◦
50 50
Table 9. Isotherms of Ra = 105 ; Pr = 0.71; PS-hot; QR - Cold; PQ and SR Table 11. Streamlines of Ra = 104 ; Pr = 0.71; PS-hot; QR - Cold; PQ and SR
-adiabatic; -adiabatic;
φ Mathematica results COMSOL results φ Mathematica results COMSOL results
◦ ◦
0 0
◦ ◦
30 30
◦ ◦
50 50
Similarly,
Table 12. Streamlines of Ra = 105 ; Pr = 0.71; PS-hot; QR - Cold; PQ and SR
-adiabatic;
φ Mathematica results COMSOL results Z 1 Z 1 J0 K
X X 0
−1 X
J X
K−1
f (t, u)dtdu = c jklm w jk wlm (23)
0 0 j=1 k=0 j=1 k=0
◦ R1 R1
0 where w jk = 0 h jk (t)dt and wlm = 0 hlm (u)du are the weights.
For single integral J = 1 and K = 2; for double integrals J = 2,
K = 4, J 0 = 3 and K 0 = 5 are well accommodated for the
integrals present in the residual equations.
◦
3. Results and discussion
30
We consider a two dimensional, steady and laminar flow
across the inclined square cavity (PQRS) under two different
thermal boundary conditions as mentioned in section 1. The
physical domain (D) of square cavity with angle of inclination
◦ ◦
(φ), inclined with the X-axis within the acute angles of 15 , 45
◦ ◦ ◦ ◦
50
◦ and 75 for case 1 and 0 , 30 and 50 for case 2 thermal
boundary conditions is considered for the present study.
Pr = 0.7, and Ra varied from 103 to 105 for both the boundary
conditions are investigated. In order to assess the accuracy of
our numerical procedure, we have tested our algorithm for the
results presented in [10] for 28 × 28 elements and found to be
exactly matching. In this paper, however, we restrict our study
2.3.2. Approximation of function of two variables:
considering 20 × 20 elements (Figure 3) with the grid size of
Extending the function approximation of a single variable 51 × 51, which were also found to be in good agreement with
in terms of hybrid functions, the function f (t, u) defined in the isotherms and streamlines reported in [10]. Distributions of
[0, 1) × [0, 1) can be approximated as isotherms and streamlines of case (1) are portrayed in Tables
1-3 and 4-6 respectively; Similarly Tables 7-9 and 10-12
J0 K
X X 0
−1 X
J X
K−1 illustrates the heat and fluid contours of case (2).
f (t, u) ≈ c jklm h jk (t)hlm (u) (20)
j=1 k=0 j=1 k=0 Observing the isotherms for case (1), when Ra is 103 ,
by considering J partitions and K internal nodes in each however inclined the square cavity is, there is not much
partition for [0, 1) in the t-direction, and J 0 partitions and K 0 disruption, indicating heat transfer through conduction as
internal nodes in each partition for [0, 1) in the u-direction. It depicted in Table 1, whereas, when Ra is increased, isotherms
can be shown that are concentrated at the hot and cold walls. Both clockwise and
anticlockwise circulations seen in all the Rayleigh numbers
◦
are pondered at φ = 15 . When Ra is 103 , the secondary cells
c jklm = f r jk , rlm (21) are comparatively lesser in size but when it is 104 the cells
are slightly bigger and when the value of Ra is 105 the two
where Gaussian nodes along the t and u directions are and r jk axisymmetric flow exquisitely occupies the entire cavity. As φ
and rlm respectively [25]. ◦
increases to 45 , the strength of anticlockwise circulation cells
increases (Table 5). As the angle of inclination increases, there
2.3.3. Integration scheme for the integrals in residual equa- is a significant push of isotherms towards the right wall. At
tions: ◦
φ = 75 , the isotherms are found to be qualitatively similar to
◦
Using the function approximation from equations (19) and those of φ = 45 as the temperature contours are piling towards
(20), the integrals (both single and double) of the residual the right wall (Tables 2 and 3). The overall amount of heat
equations can be easily evaluated as follows. transfer along the right wall increases with inclination angle
and decreases along the left wall.
Z 1 J X
X K−1
◦
f (t)dt = c jk w jk (22) In Table 6 at 45 , strong primary anticlockwise circula-
0 j=1 k=0 tion cells occupy almost the entire part of cavity except top
R1 corner of the wall QR. As inclination angle φ further increases
where w jk = 0 h jk (t)dt are the weights. As the hybrid function ◦
to 75 , the primary circulation cells span the entire cavity
h jk (t) is a polynomial, its weight can be easily calculated. whereas secondary circulation cells completely disappear. It is
interesting to observe that the centre of left vortex for the fluid
237
Mariya & Prabhakar / J. Nig. Soc. Phys. Sci. 4 (2022) 231–241 238
A.Notations used:
θ j from all three residues
P9
x y Grouping the co-efficient of j=1
X = ,Y = , (X and Y - distance in dimensionless form)
L L
uL vL s31 = 0 (C.7)
U = ,Y = , (U and V - velocity components in dimen-
α α
sionless form) s32 = 0 (C.8)
T − Tc
θ = (θ - temperature component in dimensionless
9
Z X ∂N j X 9 ∂N j
Th − Tc s33 = U j N j + V j N j Ni dXdY
form; T h &T c -Temperature at hot and cold) D j=1
∂X j=1
∂Y
pL3 (C.9)
P= (P - pressure in the dimensionless form) Z
∂Ni ∂N j ∂Ni ∂N j
!
ρα2 + + dXdY
ν D ∂X ∂X ∂Y ∂Y
Pr = (Pr - Prandtl number)
α
gβ(T h − T c )L3 Pr Rewriting the governing equations, with the above substitu-
Ra = (Pr - Rayleigh number) tions, in matrix form
ν
k
α= (α - Thermal diffusivity) (1) i, j i, j i, j
s11 s12 s13
ρC p
Ri
X9 U j
= i, j i, j i, j
(2)
Vj (C.10)
Ri s21 s22 s23
R(3) j=1 si, j si, j si, j θ j
i 31 32 33
B.The shape functions of the transformed residuals from n o h in o
X − Y to s − t plane with reference to the local numbering Ri = ki j U j , 1 ≤ i ≤ 9 (C.11)
in the Figure 2.
The integrands, which leads to the element stiffness matrix,
N1 = (1 − 3s + 2s2 )(1 − 3t + 2t2 ); are functions of the global coordinates X and Y. The functions
N2 = (1 − 3s + 2s2 )(4t − 4t2 ); N j can be expressed in terms of the local coordinates s and t.
N3 = (1 − 3s + 2s2 )(−t + 2t2 ); Figure 2 gives an idea of co-ordinate transformation for the dis-
N4 = (4s − 4s2 (1 − 3t + 2t2 ); cretized elements in the X − Y plane to the s − t plane.
N5 = (4s − 4s2 )(4t − 4t2 );
N6 = (4s − 4s2 )(−t + 2t2 ); 9
X 9
X
N7 = (−s + 2t2 )(1 − 3t + 2t2 ); X= x j N j and Y = y jN j (C.12)
N8 = (−s + 2t2 )(4t − 4t2 ); j=1 j=1
N9 = (−s + 2t2 )(−t + 2t2 );
The integrand contains not only functions but also deriva-
tives with respect to the global coordinates (x j , y j ). There-
C.The nonlinear residual equations (9) - (11) are solved by ∂N ∂N ∂N ∂N
fore, ∂Xj and ∂Yj must be related to ∂s j and ∂t j . Applying
the following procedure the shape functions to equation (C.10), the transformed finite
Grouping the co-efficient of 9j=1 U j from all three residues element equation is obtained. Element stiffness matrices thus
P
obtained are assembled using the element connectivity (Table
9
Z X ∂N j X9 ∂N j
s11 = U j N j + V j N j
Ni dXdY
13) resulting in a global stiffness matrix.
∂X j=1 ∂Y
D j=1
(C.1) The global stiffness matrix is solved to get the thermal and
∂Ni ∂N j ∂Ni ∂N j ∂Ni ∂N j the velocity components. On applying of the boundary condi-
Z Z !
+γ dXdY + Pr + dXdY tions to the walls, matrix reduces to 9 nodes (internal), i.e., 27
D ∂X ∂X D ∂X ∂X ∂Y ∂Y
239
Mariya & Prabhakar / J. Nig. Soc. Phys. Sci. 4 (2022) 231–241 240
[21] Friday Obarhua, Oluwasemire John Adegbor, “An Order Four Continuous tegration based on Haar wavelets and hybrid functions”,Computers and
Numerical Method for Solving General Second Order Ordinary Differen- Mathematics with Applications, 59 (2009) 2026.
tial Equations”,J. Nig. Soc. Phys. Sci.3 (2021) 42. [26] I. Aziz, Siraj-Ul-Islam, & W. Khan, “Quadrature rules for numerical in-
[22] Olumide O. Olaiya, Rasaq A. Azeez, Mark I. Modebei, “Efficient Hy- tegration based on haar wavelets and hybrid functions”,Computers and
brid Block Method For The Numerical Solution Of Second-order Partial Mathematics with Applications, 61 (2011) 2770.
Differential Problems via the Method of Lines”,J. Nig. Soc. Phys. Sci.3 [27] G. Uma, V. Prabhakar & S. Hariharan, “Numerical integration using
(2021) 26. hybrid of block-pulse functions and Lagrange polynomial”,International
[23] H.R. Marzban, H.R. Tabrizidooz & M. Razzaghi, “Hybrid functions for Journal of Pure and Applied Mathematics, 106 (2016) 33.
nonlinear initial value problems with applications to Lane-Emden type [28] H.R. Marzban, H.R. Tabrizidooz & M.Razzaghi, “Solution of variational
equations”,Physics Letters A 372 (2008) 5883. problems via hybrid of block-pulse and Lagrange interpolating”,ET Con-
[24] H.R. Marzban, S.M. Hoseini & M. Razzaghi, “Solution of Volterra’s pop- trol Theory Appl, 3 (2009) 1363.
ulation model via block-pulse functions and lagrange interpolating poly- [29] Larry J.Segerlind, Applied finite element analysis, United States of Amer-
nomials”,Math Methods Appl Sci, 32 (2009) 127. ica, John Wiley & Sons, New York (1984).
[25] Siraj-Ul-Islam, I. Aziz & F. Haq, “A comparative study of numerical in-
241