|
[Sponsors] |
How to use fvOption to define a constant source term? |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 9 ![]() |
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? |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Anders Utnes
Join Date: May 2017
Location: Norway
Posts: 34
Rep Power: 8 ![]() |
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? |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
|
Hi,
I successfully applied this source term for velocity field, maybe you can use as well. Code:
velocitySource { type vectorFixedValueConstraint; active true; vectorFixedValueConstraintCoeffs { selectionMode cellZone; cellZone heater; volumeMode absolute; fieldValues { U (0 1 0); } } } http://www.geocities.jp/penguinitis2...fvOptions.html (just use google translate) Regards |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11 ![]() |
Great link! Thank you sooo much!
|
|
![]() |
![]() |
![]() |
![]() |
#5 | |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 9 ![]() |
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. |
||
![]() |
![]() |
![]() |
![]() |
#6 | |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 9 ![]() |
Quote:
momentum or energy source. Should I define it myself in solver every time step? |
||
![]() |
![]() |
![]() |
![]() |
#7 |
Senior Member
|
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 |
|
![]() |
![]() |
![]() |
![]() |
#8 | |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 9 ![]() |
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. |
||
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
David
Join Date: Oct 2020
Posts: 21
Rep Power: 4 ![]() |
Hi,
I would like to implement some additional source code for my porous media. I have already applied the Darcy-Frochheimer source term with fvOptions and explicitpourouszone for the momentum therm. Now I would like to implement the turbulent kinetic energy (TKE) and the turbulent dissipation rate (TDR) source term of my porous material. Both terms are dependent on the magnitude of the flow, epsilon, k and some constants. Could you recommend me a strategy how to implement this or are there source terms which I could easily modify? My source terms are: ![]() ![]() Sorry if this is stupid question but I quite new to all of this and would greatly appreciate all recommendation or hints ![]() Best fidu |
|
![]() |
![]() |
![]() |
![]() |
#10 |
New Member
Join Date: Oct 2021
Posts: 5
Rep Power: 3 ![]() |
Quote:
|
|
![]() |
![]() |
![]() |
Tags |
fvoption, source terms, toposetsource |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] swak4foam for OpenFOAM 4.0 | mnikku | OpenFOAM Community Contributions | 80 | May 17, 2022 08:06 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 17:18 |
Installing OF 1.6 on Mac OS X | gschaider | OpenFOAM Installation | 129 | June 19, 2010 09:23 |
Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 11:48 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 01:24 |