CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Navier Stokes FDM: Iterative Solvers (Component Form vs Matrix Form)

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By LuckyTran
  • 1 Post By FMDenaro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 30, 2023, 09:38
Default Navier Stokes FDM: Iterative Solvers (Component Form vs Matrix Form)
  #1
New Member
 
Join Date: Dec 2023
Posts: 2
Rep Power: 0
natsukashi_heiwa is on a distinguished road
Hello everybody

Currently, I am engrossed in a university assignment that involves conducting a benchmark with various solvers such as Jacobi, Gauss-Seidel, and the Conjugate Gradient for solving the Poisson pressure equation.

Now, both the Jacobi and Gauss-Seidel Solvers can be employed in component form. This means you don't solve them as a matrix-vector product but rather with classical two nested loops, iterating through each component. If the domain is discretized as nxn, then the complexity of the component-form corresponds to O(n^2). In this form, the pressure field is expressed as a matrix.

On the flip side, the matrix-form necessitates a matrix-vector product (Au=f). In this setup, the pressure field is expressed as a vector, and the matrix A represents the discretized Laplacian operator, where I use FDM for simplicity reasons.

The challenge I'm currently grappling with is converting an already coded Lid Driven Cavity from component-form to matrix-form. The issue arises because when converting a pressure matrix-field (nxn) to a matrix-form, the matrix A becomes substantial (nxn, nxn) since the pressure vector field becomes of size nxn. Even though the matrix-vector product of Au=f is O(n^2), the sheer size of n in the matrix-form leads to a significant slowdown in my simulation.

So, for Navier-Stokes on FDM, particularly in the case of the Lid Driven Cavity, should one avoid the matrix-form for the solvers? If so, how can the Conjugate Gradient compete with the component form? The challenge lies in the fact that the Conjugate Gradient cannot be used in component-form since its nature resides in vectors (Krylov spaces).

In conclusion, I suspect there might be a critical aspect I've overlooked, and any guidance or insights would be greatly appreciated. 🙈
natsukashi_heiwa is offline   Reply With Quote

Old   December 31, 2023, 03:29
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
The matrix is sparse


Indeed if the matrix was full there would never be any need to apply any linearization and to just brute force it.
natsukashi_heiwa likes this.
LuckyTran is offline   Reply With Quote

Old   December 31, 2023, 09:04
Default
  #3
New Member
 
Join Date: Dec 2023
Posts: 2
Rep Power: 0
natsukashi_heiwa is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
The matrix is sparse


Indeed if the matrix was full there would never be any need to apply any linearization and to just brute force it.
I see... right!!!!!

Having a sparse matrix, one does not need to do the full matrix-vector product but can instead do a sparse matrix-vector product and the size of the compressed sparse matrix is not (nxn,nxn) but (depth,nxn) where depth is the number of items in a row, which in 2D corresponds do 3 because the discretised laplacian has three elements (-1, 2, -1)

Thank you very much for your help, it really brought clarity to my mind.

Best regards
natsukashi_heiwa is offline   Reply With Quote

Old   December 31, 2023, 12:58
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
The variables we solve are always the components of a vector, thus formally the vector for the pressure is (Nx1) and you can link the topology to the computational structured grid in a simple way in which the n-th component is associated to the i,j,k node.
A table describing such association is in the textbook of Ferziger, Peric and Street. This way, you can work solving the formal product matrix-vector in a simple instruction of the components p(n) multiplied by scalar values.
natsukashi_heiwa likes this.
FMDenaro is offline   Reply With Quote

Reply

Tags
iterative pressure solver, lid driven cavity


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to understand FDM vs FVM vs Conservative form vs Non-conservative form granzer Main CFD Forum 5 December 4, 2019 04:00
Navier Stokes Solvers skumar112 Main CFD Forum 2 May 29, 2016 08:19
Conservative form of Navier Stokes equation. balkrishna OpenFOAM Running, Solving & CFD 2 January 25, 2012 09:33
Full navier stokes Equation descretized form rawin Main CFD Forum 1 September 21, 2005 13:42
Navier Stokes solvers for growing domains Naga Kiran Potluri FLUENT 0 August 11, 2005 11:24


All times are GMT -4. The time now is 18:43.