|
[Sponsors] |
How to use fvOption to define a constant source term? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 30, 2017, 11:50 |
How to use fvOption to define a constant source term?
|
#1 |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 10 |
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? |
|
November 30, 2017, 16:16 |
|
#2 |
Member
Anders Utnes
Join Date: May 2017
Location: Norway
Posts: 34
Rep Power: 9 |
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? |
|
November 30, 2017, 23:20 |
|
#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 |
|
December 1, 2017, 08:06 |
|
#4 |
Senior Member
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 12 |
Great link! Thank you sooo much!
|
|
December 1, 2017, 09:22 |
|
#5 | |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 10 |
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. |
||
December 1, 2017, 09:33 |
|
#6 | |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 10 |
Quote:
momentum or energy source. Should I define it myself in solver every time step? |
||
December 2, 2017, 02:29 |
|
#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 |
|
December 2, 2017, 06:49 |
|
#8 | |
New Member
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 10 |
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. |
||
November 5, 2020, 13:34 |
Source therm for TKE and TDR for a porous material
|
#9 |
New Member
David
Join Date: Oct 2020
Posts: 21
Rep Power: 5 |
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 |
|
June 17, 2023, 13:02 |
|
#10 |
New Member
Join Date: Oct 2021
Posts: 5
Rep Power: 4 |
Quote:
|
|
November 3, 2023, 06:00 |
|
#11 |
Member
Marķa Rosales
Join Date: Mar 2023
Location: Spain
Posts: 47
Rep Power: 3 |
Hello,
For canopy sources/sinks you can adapt a new fvOption from https://www.openfoam.com/documentati...urbSource.html and from https://www.openfoam.com/documentati...urbSource.html |
|
November 12, 2023, 22:55 |
|
#12 | |
New Member
Join Date: Nov 2023
Posts: 1
Rep Power: 0 |
Quote:
plaintext Copy code dimensions [0 0 -2 0 0 0 0]; inletFractionSource { // Specify the regions where the source term should be active selectionMode all; // Specify the field to which the source term should be added fields (C); // Specify the value of the constant source term CSource 100; // Adjust the value as needed // Relaxation factor (if needed) relaxation 1.0; } This fvOptions file adds a constant source term to the concentration equation (C field) in the specified regions. |
||
Tags |
fvoption, source terms, toposetsource |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
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 |