CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Questions about simplefoam (http://www.cfd-online.com/Forums/openfoam/114122-questions-about-simplefoam.html)

maoyanren March 5, 2013 13:11

Questions about simplefoam
 
Hi all,

I am relatively new to OpenFOAM and I have a question about the solver simpleFoam. I am using OF 2.1.1.

I read a little bit about the solver and algorithm and had some understanding of it. One thing confuses me though. In the source code of simpleFoam

UEqn.H
"tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
==
sources(U)
);

UEqn().relax();

sources.constrain(UEqn());

solve(UEqn() == -fvc::grad(p));"

why is there a "sources(U)" term in the UEqn and it is even a function of U? And what is "sources.constrain(UEqn())" for?

Any help will be appreciated.

anishtain4 March 6, 2013 03:16

Digging it in doxygen you first get to IObasicSourceList which is a derivative of IOdictionary and basicSourceList. In latter you find operator() and constraint function:
http://foam.sourceforge.net/docs/cpp/a00081.html
However in operator() code addSup does nothing according to:
Foam::basicSource::addSup

In case it was set to something else constraint clips it in a defined range.


All times are GMT -4. The time now is 17:19.