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

Source term for decay

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2005, 04:46
Default Source term for decay
  #1
Chimwemwe
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

  Reply With Quote

Old   February 7, 2005, 13:06
Default Re: Source term for decay
  #2
Robin
Guest
 
Posts: n/a
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
  Reply With Quote

Old   February 8, 2005, 06:27
Default Re: Source term for decay
  #3
Chimwemwe Banda
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
  Reply With Quote

Old   February 8, 2005, 09:28
Default Re: Source term for decay
  #4
Robin
Guest
 
Posts: n/a
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
  Reply With Quote

Old   February 8, 2005, 09:37
Default Re: Source term for decay
  #5
Robin
Guest
 
Posts: n/a
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
  Reply With Quote

Old   February 8, 2005, 11:02
Default Re: Source term for decay
  #6
Chimwemwe Banda
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
  Reply With Quote

Old   February 8, 2005, 13:36
Default Re: Source term for decay
  #7
Robin
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
  Reply With Quote

Old   February 9, 2005, 05:00
Default Re: Source term for decay
  #8
Chimwemwe Banda
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 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

  Reply With Quote

Old   February 9, 2005, 09:55
Default Re: Source term for decay
  #9
Chimwemwe Banda
Guest
 
Posts: n/a
Robin,

Sorry, I forget to provide additional information of inlet flow rate which is 6.05e-6 cubic metres per second.

Thanks,

Chimwemwe
  Reply With Quote

Old   February 10, 2005, 05:07
Default Re: Source term for decay
  #10
Jon
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=C0-6.2t (t in days).
  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
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 Post-Processing 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


All times are GMT -4. The time now is 02:31.