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/)
-   -   Scalar Field Source Terms (http://www.cfd-online.com/Forums/openfoam-programming-development/86378-scalar-field-source-terms.html)

tidal_Tom March 21, 2011 11:45

Scalar Field Source Terms
 
I am trying to add source terms of K and epsilon using the explicitSource class found in /src/finiteVolume/cfdTools/general/fieldSources/basicSource/

I am not having much success, and I do not know if my method is correct?

I have modified the simpleFoam solver, using the SimpleWindFoam tutorial as a guide that is included with version 1.7.1.

I added the following to the header of simpleFoam.C

#include IObasicSourceList.H

added the following line at the end of createFileds.H

IObasicSourceList explicitSources(mesh)

and added mesh tools to the INC and LIBS in make/Options as in simpleWindFoam.

I have compiled the solver OK, and tried running the solver. It reads the sourceProperties file but gives an error saying 'Header not OK' when it gets to the fieldData (where the fields and source values are defined. fieldData is defined as:

fieldData
{
k 1.2;
epsilon 0.5;
}

I am not sure why this doesn't work as I have successfully run the simpleWindFoam solver that uses the actuatorDisk source.

What have I missed? Is there a better way to add source terms?

many thanks
Tom

JimKnopf March 23, 2011 07:25

Maybe you can add your source term directly into the k and epsilion or what ever equation using fvm::SuSp() oder just fvm::Su() /fvm:::SP()
it depends.

Greetz Jim


All times are GMT -4. The time now is 11:25.