CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Source terms in equations (https://www.cfd-online.com/Forums/openfoam/70470-source-terms-equations.html)

klilla November 25, 2009 07:23

Source terms in equations
 
Dear All,

I try to add source terms in all the equations in coodles. When I add one to the density - so to the continuity equation - I found a rather strange behaviour. I printed out the magnitude of my source term from the function it calculates and from the solver itself (like rhoEqn.source()). Good news, they coincide. On the other hand:

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0

It seems that the sources computed and assigned, but during the iterations they are not considered.

Can anyone help me on this issue?

Thanks,

Lilla

niklas November 25, 2009 07:35

If you're adding a source term to the continuity equations dont forget the addition to the PISO loop.

klilla November 25, 2009 07:39

I did modify it as well. Unfortunatelly.

klilla November 26, 2009 05:40

I've performed an other test as well. Now with the original OF solver, so without source terms. It is a cavity flow. In fact the simulation is running, and the results seems meaningful. But I still have that funny line:

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0

Have anyone idea why is it like that?

Thanks,

Lilla

niklas November 26, 2009 05:56

because your matrix is purely diagonal.

fvm::ddt(rho) + fvc::div(phi) = S

produces a matrix-vector system like A*rho = H

and if A dont have any offdiagonal elements you can solve for rho exactly in 1 iteration.


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