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

reaction rate as UDF variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2002, 16:44
Default reaction rate as UDF variable
  #1
sivakumar
Guest
 
Posts: n/a
hi all,

i need to know if it is possible for me to write the profile of a variable and read the values into a UDF - calculation. i run a incompressible reaction model to convergence initially and then i need to superimpose some scalars, the source term of which require the reaction rate in a cell. can any one suggest a way for doing this by the manner i have suggested or a new way please. any help would be greatly appreciated. thank you, siva
  Reply With Quote

Old   February 8, 2002, 19:56
Default Re: reaction rate as UDF variable
  #2
Greg Perkins
Guest
 
Posts: n/a
You can access reaction rates using the DEFINE_VR_RATE - the computed fluent values (for laminar and turbulent rates) are actually passed to this function - so you could save them to memory etc. and do nothing else in this routine and fluent would work fine.

This is a nifty feature which is not documented in the udf manuals anywhere - and one I found somewhat by accident - but its very useful if for example you want to modify the normal reaction rates by multiplying by a constant or turning them off in certain locations....etc....

Not sure about the second part of your question - you'll need to explain what you want to do in more detail.

Bascially, you can do (almost) anything using udfs...

Greg

  Reply With Quote

Old   February 11, 2002, 11:52
Default Re: reaction rate as UDF variable
  #3
sivakumar
Guest
 
Posts: n/a
hi greg,

thankz for the info, i dont quite understand how it works. i am using the uds to solve the transport equation for a scalar and the source term is,

S = a*reaction rate - b*(scalar)^2

so can u suggest a way for me to use the function to accompolish this, i would greatly appreciate the help. thank you, sivakumar.
  Reply With Quote

Old   February 11, 2002, 17:51
Default Re: reaction rate as UDF variable
  #4
Greg Perkins
Guest
 
Posts: n/a
I'm not quite sure what you want to do.

Are you saying the source term for your scalar is dependent upon the reaction rate for a homogeneous reaction that you have defined in Fluent??

If this is so, you can do something like:

DEFINE_VR_RATE(My_Rate_Udf,cell,thread,r,Sp_Mw,Sp_ Y,rate_lam,rate_turb) {

if (strcmp(r->name,"reaction-1")==0)

C_UDMI(cell,thread,0) = *rate_turb; }

Here you have stored the turbulent reaction rate for reaction 1 in the memory location, 0.

Now to define your source you'd do:

DEFINE_SOURCE(My_Srce,cell,thread,dS,eqn) {

real srce;

srce = A*C_UDMI(cell,thread,0) - B*pow(C_UDSI(cell,thread,my_uds),2.0);

dS[eqn] = -2*B*C_UDSI(cell,thread,my_uds);

return srce; }

here you have also added to derivative of the source term wrt to the scalar to the dS[eqn] to improve stability of the solver process.

my_uds = scalar uds location.

If you're trying to model some sort of hetrogeneous reaction rate expression, this sort of method may not be very good. It might be better to do the rate calculations yourself and ignore Fluent's inbuild single phase model.

Hope it helps,

Greg

Then your
  Reply With Quote

Old   February 12, 2002, 01:31
Default Re: reaction rate as UDF variable
  #5
sivakumar
Guest
 
Posts: n/a
thanks greg,

it is working fine and im trying to model aerosol dynamics using 3 additional scalar equation(first three volume based moments). iam having this problem, like my first scalar is converging to the experimental value but the other two are not, do u have any experience with such a problem?if not nevermind, thanks for the help again. regards, sivakumar
  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
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35
Reaction Rate in UDF mahdi FLUENT 2 August 7, 2007 09:31
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09
UDF : Chemical Reaction in Catalytic Converter adhimac FLUENT 1 March 27, 2001 15:04


All times are GMT -4. The time now is 17:26.