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

Systems of Nonlinear Equations

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 24, 2010, 22:04
Default Systems of Nonlinear Equations
  #1
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 16
Tanay is on a distinguished road
Hello people,
I have a query regarding how to solve a system of nonlinear equations while writing a C++ code for an FVM algorithm. If we use QUICK differencing scheme and write the Navier-Stokes equations in the discretized form (assuming steady conditions) with convection, diffusion and pressure gradient terms, we finally end up with terms like u(P)^2 and v(P)^2. (u & v are velocities at the node P). How does one solve such a system of nonlinear equations for all the nodes?
Tanay is offline   Reply With Quote

Old   September 25, 2010, 01:23
Default
  #2
Senior Member
 
Hamid Zoka
Join Date: Nov 2009
Posts: 293
Rep Power: 19
Hamidzoka is on a distinguished road
When you are to solve a nonlinear equation like this you should consider terms like u(p)^2 as u(p)*u(p).
one u(p) will be set as variable while another simply is a coefficient which is pre-determined from previous iteration or an initial guess.
as the iteration goes on one u(p) is calculated and another one which is just a coefficient will be updated.

regards
Hamidzoka is offline   Reply With Quote

Old   September 25, 2010, 13:46
Default
  #3
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 16
Tanay is on a distinguished road
Right. Thanks a lot.
Tanay is offline   Reply With Quote

Old   September 28, 2010, 02:54
Default
  #4
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 16
Tanay is on a distinguished road
I have another query, now that I've got a linear system in my C++ program. I have two choices to solve the equations- the Gauss-Seidel scheme and the full Gaussian elimination matrix method (the coefficient matrix isn't tridiagonal, so TDMA is not an option). Gauss-Seidel is easier to implement but matrix elimination with scaling and partial pivoting will lead to convergence. So, which scheme do commercial softwares like OpenFOAM use to solve a system of linear equations?
Tanay is offline   Reply With Quote

Old   October 7, 2010, 16:51
Default
  #5
New Member
 
Join Date: May 2010
Posts: 8
Rep Power: 16
david_e is on a distinguished road
I don't know what OpenFOAM is using, but for general matrices I would recommend UMFPACK: it comes as an OSS C library (or bundled with Matlab), it's very easy to use and it's very efficient to solve large sparse linear systems (it uses a sparse LU factorization algorithm), as long as you are not looking for a parallel solver...
david_e is offline   Reply With Quote

Old   November 2, 2010, 16:27
Default Linear System solvers
  #6
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Quote:
Originally Posted by Tanay View Post
I have another query, now that I've got a linear system in my C++ program. I have two choices to solve the equations- the Gauss-Seidel scheme and the full Gaussian elimination matrix method (the coefficient matrix isn't tridiagonal, so TDMA is not an option). Gauss-Seidel is easier to implement but matrix elimination with scaling and partial pivoting will lead to convergence. So, which scheme do commercial softwares like OpenFOAM use to solve a system of linear equations?
OpenFoam uses several linear system solvers including:

1) Krylov Subspace solvers: preconditioned conjugate gradient (asymmetric systems), preconditioned Biconjugate gradient(symmetric systems).
2) Geometric Algebraic Multigrid solvers (works well for symmetric systems)
3) smooth solvers (works well for large asymmetric systems)

(I may have left out some)

several preconditioners including Diagonal incomplete cholesky, Diagonal LU factorization, GAMG, or just plain diagonal to name a few

A good brief source is (http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2008/TimBehrens/tibeh-report-fin.pdf)

if you are writing your own linear system solver then the krylov solvers aren't too bad. As long as you have programmed some operations (saxpy, mat-vec operations, dot product, etc.) then its pretty easy. A good book covering the basics is "iterative methods for sparse linear systems" by Yousef Saad. Good luck.

Dan
chegdan is offline   Reply With Quote

Reply

Tags
nonlinear, systems


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
Guide: Writing Equations in LaTeX on the CFD Online Forums pete Site Help, Feedback & Discussions 27 May 19, 2022 04:19
Dealing with nonlinear ODE with contraint equations enoch Main CFD Forum 1 August 25, 2010 10:25
Maths problem when deriving conservation of energy equations. Demonwolf Main CFD Forum 1 June 15, 2009 15:21
How nonlinear discretised equations are linearised in OpenFoam ashish OpenFOAM Running, Solving & CFD 2 June 16, 2006 08:02
Solving systems of equations Marco Kupiainen (Kupiainen) OpenFOAM Running, Solving & CFD 3 February 2, 2005 13:55


All times are GMT -4. The time now is 15:06.