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/)
-   -   add a source term in kEpsilon model (http://www.cfd-online.com/Forums/openfoam-solving/64639-add-source-term-kepsilon-model.html)

maurice May 18, 2009 07:54

add a source term in kEpsilon model
 
Dear All,

I am going to add a new source term (only non-zero at a few cells and not varying with time) in the kinetic energy equation in the kEpsilon code. I have followed a tutorial from the forum to make a new copy of the kEpsilon code and called it mykEpsilon. I also changed simpleFoam to read a new scalar field, mySource. My question is how to pass this scalar field into mykEpsilon so that I can write:

tmp<fvScalarMatrix> kEqn
(
fvm::ddt(k_)
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
==
G
+ mySource
- fvm::Sp(epsilon_/k_, k_)
);

I read somewhere that this can be done by passing the field into the class through a pointer, but not exactly know now. Any hints?

Thanks,
Qi


All times are GMT -4. The time now is 13:05.