![]() |
How to use fvOption to define a constant source term?
Hi Foamers,
I am trying to define a constant source term with the solver pimpleFoam and I use channel395 case to test. I modified the solver of pimpleFoam and add concentration equation to it: fvScalarMatrix CEqn ( fvm::ddt(C)+fvm::div(phi,C)+ fvm::laplacian(turbulence->nu()/Sc,C) ); CEqn.solve(); then I want to define a constant source for concentration equation in certain area. How can I do this? 1,I try to use setFields but it only works on initial field 2,I found it can set in fvOption files momentumSource { type meanVelocityForce; active yes; meanVelocityForceCoeffs { selectionMode all; fields (U); Ubar (0.1335 0 0); relaxation 1.0; } } In my case, I think openFoam dose not have concentration equation, what should I do, can you please give me some suggestions? |
The meanVelocityForce in fvOptions seem to be quite videly used for these kinds of things. It will be applied for all timesteps.
Do you get any errors by simply trying to run it? |
Hi,
I successfully applied this source term for velocity field, maybe you can use as well. Code:
velocitySource http://www.geocities.jp/penguinitis2...fvOptions.html (just use google translate) Regards |
Great link! Thank you sooo much!
|
Quote:
Sorry for my bad explanation, I mean people can use this method to define a source in momentum equation but in my case how can I add a constant source to concentration equation. |
Quote:
momentum or energy source. Should I define it myself in solver every time step? |
Hi,
sorry, I thought you needed a velocity field source term. Are you meaning you have to add a constant scalar source for a species? If that's the case, https://www.researchgate.net/publica...ers%27_version has some more tutorials. If you give more informations about your needs and what you're doing, others on this forum could be of much more help. Regards |
Quote:
Thank you for help. What I am doing now is add convection diffusion equation to the solver 'pimpleFoam'. I want to simulate a constant pollutant source dispersion, for instance, in a channel. I do not know what's the proper way to define the source in some certain of the area. |
All times are GMT -4. The time now is 10:30. |