CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   spray source term in k-epsilon equations (

yejungong May 2, 2009 15:31

spray source term in k-epsilon equations
Hi OpenFOAMers

I am trying to add the spray source term to the k-epsilon equations?

the difficulty is that src/turbulenceModels/RAS/compressible/RNGkEpsilon has no interface to spray, furthermore, spray needs the runTime and Mesh info while turbulenceModels has not.

Thanks a lot
Best Regards

su_junwei May 2, 2009 15:38

You can get these two variable from U.
Hi Yejun

You can get these two variables from U.
const Time & runTime=U.time();
const fvMesh &mesh=U.mesh();


yejungong May 2, 2009 15:57

thanks Junwei,

but there are still missing some inputs. indeed, turbulence model only has rho, U, phi and thermo as inputs, but spray needs p, T, composition of fuel, gasProperties and environmentalProperties.

but still thank you. your answer inspired me that I may need just change the inputs of turbulenceModels.


su_junwei May 2, 2009 19:45

Hi Yejun
The terms p, T, composition of fuel, gasProperties and environmentalProperties are not related to turbulence model. These terms can be defined outside the turbulence model. If you want to incorporate these terms into turbulence model without disturbing the interface, just defined several pointers in the turbulence model file, and set these pointers after constructing the turbulence model but before invoking the function "correct".
Another possible way is defining a variable for the source term you want to add, calculating it outside the class. Just update the source term variables defined every time step before invoking the "correct"

Regards, Junwei

yejungong May 3, 2009 11:18

Hi Junwei,

thanks a lot. I got it.

according to your suggestion, I just add one inputs spray& to the inputs of RNGkEpsilonModel. and looks like it's much better. However, I also need change RASModel when it calls the RNGkEpsilonModel. I am still considering whether do I need to make such a big change.

maybe I need just make a new turbulenceModel module which always has spray source terms added.

thanks again.


su_junwei May 3, 2009 11:33

Yes you have to change the whole framework if you changed the interface.


flying May 4, 2009 02:13

I also think you only need to change the turbulence model. The turbulence model is given seprately with the spray, you don't need to change the source code.

yejungong May 4, 2009 11:23

thanks a lot. I have already rebuild the framework by add a new sprayRAS folder to the turbulence Models. and let sprayRAS and sprayRNGkEpsilon call each other. and the compilation has passed.

thanks again.


All times are GMT -4. The time now is 21:02.