|
[Sponsors] |
September 9, 2005, 16:45 |
Negative concentration
|
#1 |
Guest
Posts: n/a
|
Hi, all
For a Additional variable(say 'bacteria'), a source term was given to describe the bacteria decay kinetics. The question is that, if the inital concentration in certain zones of the domain is very small,can the the concentration of 'bacteria' gradually reduce to less than zero. If yes, how to avoid this? Thanks! Regards! Gab |
|
September 10, 2005, 14:25 |
Re: Negative concentration
|
#2 |
Guest
Posts: n/a
|
Hi, To prevent concentrations diving below zero, I would try Putting a MAX statement (assuming you're using USER FORTRAN).
(1) If your additional variable is a function of CFX VARIABLE, then, (say for TEMPERATURE,T or SCALAR1), MAX(T(INODE,IPHASE),SMALL) or MAX(SCAL(INODE,IPHASE,ISC1),SMALL) (2) OR, for one of your own variable (e.g., DENT), then you can try something like this: MAX(DENT, 1.0E-08) Hope this helps, RK |
|
September 10, 2005, 21:17 |
Re: Negative concentration
|
#3 |
Guest
Posts: n/a
|
Thanks, Robin.
Unfortunitely, I am not using User Fortran. Are there other ways to solve this problem? Regards! Gab |
|
September 10, 2005, 21:55 |
Re: Negative concentration
|
#4 |
Guest
Posts: n/a
|
Hi, Gab
Sorry, then I assume ur using CFX 5/10. I am a user of CFX 4 only...and so not aware of syntax in CFX 5. Sorry, can't be much of help in this regards, but if you have a look at the CFX 5 reference guide on the CEL. maxVal<var> may have the same effect as I was trying to convey earlier... Robin |
|
September 10, 2005, 23:43 |
Re: Negative concentration
|
#5 |
Guest
Posts: n/a
|
Thanks anyway. I will search this in helpfile.
Best regards! Gab |
|
September 11, 2005, 00:46 |
Re: Negative concentration
|
#6 |
Guest
Posts: n/a
|
Bacterial decay rates are usually exponential functions of the local concentration. As the concentration gets smaller, the rate gets smaller as well. A sufficiently small time step should prevent negative concentrations, at least it has in the calcs I've done.
Jeff |
|
September 12, 2005, 10:26 |
Re: Negative concentration
|
#7 |
Guest
Posts: n/a
|
Thanks, Jeff
I did see some negative values in my solution. This may be caused by relative big time step or by wrong cel fuction I defined. I will try as you suggested. Best Regards! Gab |
|
September 17, 2005, 07:21 |
Re: Negative concentration
|
#8 |
Guest
Posts: n/a
|
Hi,
I guess you define the kinetics in CEL under CFX5 or 10? then you can use the min and max as Robin posted in the Expression editor too! matej |
|
September 17, 2005, 14:16 |
Re: Negative concentration
|
#9 |
Guest
Posts: n/a
|
Hi,
I think Gab is using a transport equation to solve the bacteria concentration. Thus, it isn't possible via CEL to define the bacteria concentration with min or max functions.But, as Jeff mentioned, if the decay rate gets to zero as the concentration gets to zero, a "sufficiently" small time step shall prevent negative concentrations. But I think that even with a quite small time you may get negative concentrations, but those negative values will be so small you may ignore them. If you need the bacteria concentration (C) for other calculations, and if it's important that the concentration isn't negative, you may create another expression, or if you need so another variable, C'=max(0,C) or C'=max(1e-8,C) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |
negative species concentration again | Andrew Garrard | FLUENT | 0 | March 22, 2005 12:36 |
negative concentration | Andrew Garrard | FLUENT | 0 | January 24, 2005 12:37 |