CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Explanation of "solve"-function

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 5 Post By alberto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2012, 05:16
Default Explanation of "solve"-function
  #1
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
Hello out there in the big OpenFOAM-world.

Is there anybody who can really explain to me the solve-function?
If I look at
Code:
->solve(psiCmpt, sourceCmpt, cmpt);
within finiteVolume/lnInclude/fvMatrixSolve.C at line 148 it seems to me there the real solver is pointed to, which uses the parameters psiCmpt, sourceCmpt and cmpt.
- But where is that solver really defined?
- Where can i find the actual definition of the function "solve()"?

And if there is somebody really knowing about that solve-function:
- Is there a way to call that solve() for a specific cell only?

I am kind of lost with the C++ stuff or at least inside the structure of OpenFOAM, so any help is welcome!
Linse is offline   Reply With Quote

Old   February 1, 2015, 00:41
Default
  #2
New Member
 
Chenguang Zhang
Join Date: Jul 2012
Location: Baton Rouge Louisiana
Posts: 15
Rep Power: 13
Taozi is on a distinguished road
Hi Bernhard, did you find any information regarding the functionality of the solve() function? Thanks.
Taozi is offline   Reply With Quote

Old   February 1, 2015, 23:30
Default
  #3
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
The solve function you are looking at is a virtual function ( http://foam.sourceforge.net/docs/cpp/a02380.html ) which is redefined for each solver (diagonalSolver, GAMGSolver, ...).

If you want to solve a linear system directly in a cell or a limited number of cells, you probably want to follow a simpler way. You can, for example, use a scalarSquareMatrix and use LU decomposition on it (OF can do it).
snak, sharonyue, Taozi and 2 others like this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

Last edited by alberto; February 1, 2015 at 23:47. Reason: Corrected answer
alberto is offline   Reply With Quote

Reply


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
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 09:02.