This repo is my 3rd assignment submission of the course 11110PME511300 Computational Fluid Dynamics in 2022 Fall, lectured by Prof. Chao-An Lin. I wrote the original report in LaTeX on 2023 Jan 11, and commited the files to GitHub on 2025 Aug 20.
To run the program, just download the CA3_2022.m file and the MAIN LIBRARY/ folder in the same directory, and you're good to go on MATLAB. Do Not Change The Folder Name, lest the path commands produce error warnings.
Consider the continuity equation in a 2D.
Consider the continuity equation in a 2D.
And the steady-state Navier-Stokes equation in 2D.
the Dirichlet boundary conditions are imposed strongly,
- Please compute the cavity flows with Reynolds numbers 100, 1000, and 5000.
- Please use mesh sizes at least 81x81 and 161x161.
- Please also compare your results with the benchmark solutions from Gihia et al. (1982) for u(y) at x=0.5 and v(x) at y=0.5.
- Please compare the accuracy of the central difference, QUICK and MUSCL schemes.
Let the correction terms be the velocity at the current time step minus the one in the previous time step.
Integrate Equation (2) over a single mesh,
And then, we have the discretized momentum equation in the x-direction.
Then, integrate Equation (3) over a single mesh,
And then, we have the discretized momentum equation in the y-direction.
Given the lid velocity
Using the central differencing (CD) scheme to demonstrate the derivation of the SIMPLE algorithm. The mass flow rates for x-directional momentum conservation are
And those in y-directional momentum conservation are
The diffusive coefficients are all the same regardless of directions,
The CD suggests that the pointal value
And the point value
Substitute Equation (15) in Equation (9), the x-directional momentum conservation is rewritten as
In the same way, substitute Equation (16) in Equation (11), the y-directional momentum conservation is rewritten as
Add the flux limiter to Equations (17) and (18),
Thus, the solutions
where
Notice that the term,
Add the correction terms to Equations (23) and (24) to satisfy Equation (1). By the SIMPLE algorithm, the correction terms are reduced to the corrected pressure term, that are,
where the corrected pressure term for the x-directional momentum equation is
and the corrected pressure term for the y-directional momentum equation is
And this is the SIMPLE implementation using central differencing scheme. For other schemes: LUD (Linear Upwind Differencing), QUICK (Quadratic Upstream Interpolation for Convective Kinematics), TVD (Total Variation Diminishing), TVD QUICK, MUSCL (Monotonic Upstream-centered Scheme for Conservation Laws), etc., a slight modification of the
![]() (a) |
![]() (b) |
![]() (c) |
![]() (d) |
![]() (e) |
![]() (f) |
![]() (a) |
![]() (b) |
![]() (c) |
![]() (d) |
![]() (e) |
![]() (f) |
![]() (a) |
![]() (b) |
![]() (c) |
![]() (d) |
![]() (e) |
![]() (f) |
From Figures (3), (4), and (5), I drew the centered lines at
Notice that the schemes produce similar characteristics at low Reynolds numbers in Fig (6) and (9), but variate at high Reynolds numbers in Fig (8) and (11). The MUSCL and QUICK schemes resemble because of the same ground rock on which they are built, the upwind differencing scheme. While they look similar, the values are slightly different. Choosing the Reynolds number of
Table 2. First ten values of
| y (m) |
|
|
|
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0.006172840 | 0.076742197 | 0.049134526 | 0.049183673 |
| 0.012345679 | 0.14049004 | 0.090517207 | 0.090604849 |
| 0.018518519 | 0.190035281 | 0.123695103 | 0.123809749 |
| 0.024691358 | 0.227110941 | 0.149204069 | 0.149335855 |
| 0.030864198 | 0.255237398 | 0.168315656 | 0.16845755 |
| 0.037037037 | 0.277773476 | 0.182590392 | 0.182738206 |
| 0.043209877 | 0.296858955 | 0.193486394 | 0.193638087 |
| 0.049382716 | 0.31339041 | 0.202128973 | 0.202283633 |
| 0.055555556 | 0.32749287 | 0.209261662 | 0.209418771 |
Table 3. First ten values of
| x (m) |
|
|
|
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0.006172840 | -0.136405976 | -0.094255483 | -0.094363291 |
| 0.012345679 | -0.187299161 | -0.135710999 | -0.135861958 |
| 0.018518519 | -0.227580313 | -0.169952973 | -0.170136119 |
| 0.024691358 | -0.260391073 | -0.196824535 | -0.197029379 |
| 0.030864198 | -0.288312577 | -0.217209931 | -0.21742801 |
| 0.037037037 | -0.31248656 | -0.232395834 | -0.23262089 |
| 0.043209877 | -0.3329256 | -0.243638087 | -0.243865661 |
| 0.049382716 | -0.349175307 | -0.25194424 | -0.252171117 |
| 0.055555556 | -0.360808374 | -0.258018899 | -0.258242631 |
Overall, despite the deviation in values, the trend displays consistency. To better compare the results, the following figures are drawn.
![]() (a) |
![]() (b) |
![]() (c) |
![]() (d) |
![]() (e) |
![]() (f) |
![]() (a) |
![]() (b) |
![]() (c) |
![]() (d) |
![]() (e) |
![]() (f) |
In this study, the Lid-driven cavity is explored using finite volume analysis. Different schemes (CD, QUICK, and MUSCL) are employed in the SIMPLE algorithm with the benchmark solution (Ghia et al). The four results are similar at low Reynolds numbers, but not at high Reynolds numbers. Despite the deviated values, the trends are consistent regardless of the magnitude of the Reynolds number. And QUICK and MUSCL schemes bear a resemblance in accuracy.


_N(81)_Re(1e+02)_VelocityMagnitude.png)
_N(81)_Re(1e+03)_VelocityMagnitude.png)
_N(81)_Re(5e+03)_VelocityMagnitude.png)
_N(161)_Re(1e+02)_VelocityMagnitude.png)
_N(161)_Re(1e+03)_VelocityMagnitude.png)
_N(161)_Re(5e+03)_VelocityMagnitude.png)
_N(81)_Re(1e+02)_VelocityMagnitude.png)
_N(81)_Re(1e+03)_VelocityMagnitude.png)
_N(81)_Re(5e+03)_VelocityMagnitude.png)
_N(161)_Re(1e+02)_VelocityMagnitude.png)
_N(161)_Re(1e+03)_VelocityMagnitude.png)
_N(161)_Re(5e+03)_VelocityMagnitude.png)
_N(81)_Re(1e+02)_VelocityMagnitude.png)
_N(81)_Re(1e+03)_VelocityMagnitude.png)
_N(81)_Re(5e+03)_VelocityMagnitude.png)
_N(161)_Re(1e+02)_VelocityMagnitude.png)
_N(161)_Re(1e+03)_VelocityMagnitude.png)
_N(161)_Re(5e+03)_VelocityMagnitude.png)











