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

Explanation of "solve"-function

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

Like Tree3Likes
  • 3 Post By alberto

Reply
 
LinkBack Thread Tools Display Modes
Old   February 15, 2012, 06:16
Default Explanation of "solve"-function
  #1
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 178
Blog Entries: 1
Rep Power: 7
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, 01:41
Default
  #2
New Member
 
Chenguang Zhang
Join Date: Jul 2012
Location: Baton Rouge Louisiana
Posts: 11
Rep Power: 5
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 2, 2015, 00:30
Default
  #3
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
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 and Taozi like this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods

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

Reply

Thread Tools
Display Modes

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 On
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 07:42
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00


All times are GMT -4. The time now is 00:07.