- **CFX**
(*http://www.cfd-online.com/Forums/cfx/*)

- - **Source term for decay
**
(*http://www.cfd-online.com/Forums/cfx/20971-source-term-decay.html*)

Source term for decay
Hello,
I would like to simulate the decay of bacteria as a scalar based on first order kinetics. I wanted principles how I can go about it. Chims |

Re: Source term for decay
1. Create a user defined variable in CFX-Pre (call it "bacteria" for instance) using appropriate units. Specific variables are per unit mass (of fluid), whereas volumetric variables are per unit volume.
2. Go back to the domains form and define the Additional Variable Details. The option for "bacteria" should be "Transport Equation". This tells the solver to convect and diffuse your bacteria. Specify a kinematic diffusivity if different from your fluid. 3. Create a subdomain which includes the entire fluid region (if your bacteria are restricted to one area, only specify this for your subdomain). 4. Within the subdomain, define a source term for the bacteria. A negative source will remove the bacteria. Formulate the source in terms of your rate of decay. Regards, Robin |

Re: Source term for decay
Dear all,
Thanks for your help. I am failing to gras what you have advised. Let's say the rate of bacteria decay = -KN, where K = death rate per day, N = number of bacteria remaining. How can I write a program for the source term?? Regards Chimwemwe |

Re: Source term for decay
Hi Chimwemwe,
Firstly, since you are posting here I am assuming you are using CFX-5. In that case, no programming is required. Just create an additional variable as I have described and specify an expression equal to -KN for the Additional Variable Source.The following CCL defines the additional variable: LIBRARY: ADDITIONAL VARIABLE: bacteria Option = Definition Units = [m^-3 ] Variable Type = Volumetric END END |

Re: Source term for decay
Sorry, I hit Post when I meant to hit Preview... Note that the CFX-Pre GUI will create all of this CCL.
The following CCL defines the additional variable: LIBRARY: ADDITIONAL VARIABLE: bacteria Option = Definition Units = [m^-3 ] Variable Type = Volumetric END END This defines the AV within the domain: FLOW: DOMAIN: Domain 1 FLUID MODELS: ADDITIONAL VARIABLE: bacteria Option = Transport Equation END END END END And this defines the subdomain: FLOW: DOMAIN: Domain 1 SUBDOMAIN: Subdomain 1 Coord Frame = Coord 0 Location = Assembly SOURCES: EQUATION SOURCE: bacteria Option = Total Source Total Source = -K*bacteria Total Source Coefficient = -K END END END END END The source coefficient is simply the derivative of the source term with respect to the source variable "bacteria". You could enter the value of K directly, or save it as an expression: LIBRARY: CEL: EXPRESSIONS: K = 1e6 [day^-1] END END END At your boundaries, you will have to specify boundary condition values, such as the rate (per unit volume or per kg) at which the variable enters. When you initialize the solution, specify the initial amount of bacteria present. Regards, Robin |

Re: Source term for decay
Robin,
Thanks alot. On the last part of the program, the expression of K; K=1e6 [day^-1] Why are you assigning K=1e6?? Regards, Chimwemwe |

Re: Source term for decay
Perhaps because this is your application and I haven't the first clue what value is correct!!! I'm assuming you know what value to use.
What I showed you was also for a bulk equation. It would be much more accurate if you could specify a value per unit volume instead. Basically -K*N/V instead of -K*N, where V is volume. Regards, Robin |

Re: Source term for decay
Robin,
My problem is like this: The volume of tank is 55 cubic metres. The inlet concetration of bacteria is 1e8/100ml. The constant death rate per day of bacteria is 6.2 day-1 Decay rate = -KN You have advised of using a source term of = -KN/V where V is volume perhaps in m3. Please advise which volume should I use. Thanks, Chimwemwe |

Re: Source term for decay
Robin,
Sorry, I forget to provide additional information of inlet flow rate which is 6.05e-6 cubic metres per second. Thanks, Chimwemwe |

Re: Source term for decay
You have to solver the equation for K and then set this as a source as Robin described.
If the rate of decay is -KC (C for conecentration), the the solution will be C=C0*exp(-Kt). You can calculate K from your decay rate (half life). C0 is initial concentration You have stated that the rate of decay is 6.2/day. This is a rate of decay of -6.2 and not -6.2K. This gives the trivial solution C=C0-6.2t (t in days). |

All times are GMT -4. The time now is 00:23. |