
[Sponsors] 
February 7, 2005, 05:46 
Source term for decay

#1 
Guest
Posts: n/a

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 

February 7, 2005, 14:06 
Re: Source term for decay

#2 
Guest
Posts: n/a

1. Create a user defined variable in CFXPre (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 

February 8, 2005, 07:27 
Re: Source term for decay

#3 
Guest
Posts: n/a

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 

February 8, 2005, 10:28 
Re: Source term for decay

#4 
Guest
Posts: n/a

Hi Chimwemwe,
Firstly, since you are posting here I am assuming you are using CFX5. 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 

February 8, 2005, 10:37 
Re: Source term for decay

#5 
Guest
Posts: n/a

Sorry, I hit Post when I meant to hit Preview... Note that the CFXPre 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 

February 8, 2005, 12:02 
Re: Source term for decay

#6 
Guest
Posts: n/a

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 

February 8, 2005, 14:36 
Re: Source term for decay

#7 
Guest
Posts: n/a

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 

February 9, 2005, 06:00 
Re: Source term for decay

#8 
Guest
Posts: n/a

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 day1 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 

February 9, 2005, 10:55 
Re: Source term for decay

#9 
Guest
Posts: n/a

Robin,
Sorry, I forget to provide additional information of inlet flow rate which is 6.05e6 cubic metres per second. Thanks, Chimwemwe 

February 10, 2005, 06:07 
Re: Source term for decay

#10 
Guest
Posts: n/a

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=C06.2t (t in days). 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
momentum source term  zwdi  FLUENT  14  June 27, 2017 15:40 
[swak4Foam] swak4foam building problem  GGerber  OpenFOAM Community Contributions  54  April 24, 2015 16:02 
DxFoam reader update  hjasak  OpenFOAM PostProcessing  69  April 24, 2008 01:24 
DecomposePar links against liblamso0 with OpenMPI  jens_klostermann  OpenFOAM Bugs  11  June 28, 2007 17:51 
UDFs for Scalar Eqn  Fluid/Solid HT  Greg Perkins  FLUENT  0  October 13, 2000 23:03 