# Systems of Nonlinear Equations

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 24, 2010, 21:04 Systems of Nonlinear Equations #1 New Member   Tanay Deshpande Join Date: Aug 2010 Posts: 20 Rep Power: 9 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?

 September 25, 2010, 00:23 #2 Senior Member   Hamid Zoka Join Date: Nov 2009 Posts: 212 Rep Power: 11 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

 September 25, 2010, 12:46 #3 New Member   Tanay Deshpande Join Date: Aug 2010 Posts: 20 Rep Power: 9 Right. Thanks a lot.

 September 28, 2010, 01:54 #4 New Member   Tanay Deshpande Join Date: Aug 2010 Posts: 20 Rep Power: 9 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?

 October 7, 2010, 15:51 #5 New Member   Join Date: May 2010 Posts: 8 Rep Power: 9 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...

November 2, 2010, 16:27
Linear System solvers
#6
Senior Member

Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 612
Rep Power: 22
Quote:
 Originally Posted by Tanay 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

 Tags nonlinear, systems

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post pete Site Help, Feedback & Discussions 20 June 16, 2015 13:52 enoch Main CFD Forum 1 August 25, 2010 09:25 Demonwolf Main CFD Forum 1 June 15, 2009 14:21 ashish OpenFOAM Running, Solving & CFD 2 June 16, 2006 07:02 Marco Kupiainen (Kupiainen) OpenFOAM Running, Solving & CFD 3 February 2, 2005 13:55

All times are GMT -4. The time now is 21:32.