CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Source Term implementation (

liton December 24, 2006 20: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

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

diegon December 25, 2006 11: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 18:39

Hi diego Thanks for your su
Hi diego

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


But still, I am getting error message.


liton December 26, 2006 19: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
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 18:12.