CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Source Term implementation (http://www.cfd-online.com/Forums/openfoam-solving/59876-source-term-implementation.html)

liton December 24, 2006 19:37

I am confusing about the sourc
 
I am confusing about the source term implementation. I have a fixed value source term (suppose 100) and want to use it in a diffusive equation. I have implemented as follows:

..
volScalarField SS=100
..
..
solve(Eqn==-fvm::Sp(SS))

But the compiler does not accept this syntax. Can anyone please help me?

diegon December 25, 2006 10:24

You just need to put "100" in
 
You just need to put "100" in the rhs of the equation without creating a new vol field that cannot be initialized in the way you are doing.

liton December 25, 2006 17:39

Hi diego Thanks for your su
 
Hi diego

Thanks for your suggestion. If I follow like you, the equation would be:

solve(Eqn==100)

But still, I am getting error message.

Liton

liton December 26, 2006 18:56

I have modified my code and fi
 
I have modified my code and finally compiled the code without any error. I have defined my source term as dimensionedScalar, then I have implemented the source term like following:

fvScalarMatrix UEqn
(
fvm::laplacian(kappa,T)
);
solve(UEqn ==-fvm::Sp(source, T)) // T is variable

The solution that I got from this equation is terrible. Could some one please tell me, what's wrong I have done?


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