CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Source term problem in UEqn of simpleFoam (http://www.cfd-online.com/Forums/openfoam-programming-development/89618-source-term-problem-ueqn-simplefoam.html)

fisch June 17, 2011 09:52

Source term problem in UEqn of simpleFoam
 
Hi,

i want to add a (nondependent) source term to the UEqn of my simpleFoam solver.
I tried different ways where to place the term and the problem is that it lead to two different results and i don't know what is wrong...

way a) was:
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
- fvm::laplacian(nu, U)
-sourceterm
);
eqnResidual = solve
(
UEqn() == -fvc::grad(p)
).initialResidual();


way b) was:
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
- fvm::laplacian(nu, U)
);
eqnResidual = solve
(
UEqn() == -fvc::grad(p) + sourceterm
).initialResidual();


Can anybody help me please? What is the difference between these two ways?
Thanks a lot,
rupert

l_r_mcglashan June 17, 2011 10:57

Can you post a complete case up? How do they differ?


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