CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Negative concentration

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2005, 15:45
Default 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
  Reply With Quote

Old   September 10, 2005, 13:25
Default 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
  Reply With Quote

Old   September 10, 2005, 20:17
Default 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

  Reply With Quote

Old   September 10, 2005, 20:55
Default 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<var> may have the same effect as I was trying to convey earlier...

Robin
  Reply With Quote

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

Best regards!

Gab
  Reply With Quote

Old   September 10, 2005, 23:46
Default 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
  Reply With Quote

Old   September 12, 2005, 09:26
Default 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

  Reply With Quote

Old   September 17, 2005, 06:21
Default 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
  Reply With Quote

Old   September 17, 2005, 13:16
Default 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)
  Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00
negative species concentration again Andrew Garrard FLUENT 0 March 22, 2005 11:36
negative concentration Andrew Garrard FLUENT 0 January 24, 2005 11:37


All times are GMT -4. The time now is 08:40.