# Negative concentration

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 9, 2005, 15:45 Negative concentration #1 Gab 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, 13:25 Re: Negative concentration #2 Robin K 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, 20:17 Re: Negative concentration #3 Gab 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, 20:55 Re: Negative concentration #4 Robin K 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 may have the same effect as I was trying to convey earlier... Robin

 September 10, 2005, 22:43 Re: Negative concentration #5 Gab Guest   Posts: n/a Thanks anyway. I will search this in helpfile. Best regards! Gab

 September 10, 2005, 23:46 Re: Negative concentration #6 Jeff 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, 09:26 Re: Negative concentration #7 Gab 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, 06:21 Re: Negative concentration #8 matej 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, 13:16 Re: Negative concentration #9 Rui 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)

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06 gaottino OpenFOAM Native Meshers: blockMesh 7 July 19, 2010 14:11 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00 Andrew Garrard FLUENT 0 March 22, 2005 12:36 Andrew Garrard FLUENT 0 January 24, 2005 12:37

All times are GMT -4. The time now is 19:52.