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

UDF for the critical rate of strain.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 25, 2010, 15:52
Default UDF for the critical rate of strain.
  #1
New Member
 
Ahmad
Join Date: Mar 2009
Posts: 5
Rep Power: 17
cryogenicT is on a distinguished road
Hi,

I am trying to implement the following expression in fluent for the critical rate of strain:

gcr = 0.5*lam_flame_speed^2/unburnt_therm_diff

I tried to do it first using DEFINE_PROPERTY:

DEFINE_PROPERTY(udf_critical_strain_rate,c,t)
{
real gcr;
real ul;
real therm_diff;
real fmean;

real CA0 = 3.84e-5;
real CA1 = -2.4e-6;
real CA2 = 4.48e-7;
real CA3 = -6.1e-8;

fmean = C_FMEAN(c,t);
therm_diff = CA0 + CA1*fmean + CA2*pow(fmean,2.0) + CA3*pow(fmean,3.0);
ul = C_LAM_FLAME_SPEED(c,t);
gcr = 0.50*pow(ul,2.0)/therm_diff;

return gcr;
}

In the above, I'm using mean mixture fraction polynomial fits. I obtained the coefficients from Fluent. However, when I run my case, the data are off the charts with a minimum of 1.E+8 (which is the default value set by fluent).

So I tried to do it using DEFINE_ADJUST:
DEFINE_ADJUST(udf_critical_strain_rate,d)
{
Thread *t;
cell_t c;

real ul;
real therm_diff;
real fmean;
real gcr;

real CA0 = 3.84e-5;
real CA1 = -2.4e-6;
real CA2 = 4.48e-7;
real CA3 = -6.1e-8;

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{

fmean = C_FMEAN(c,t);
therm_diff = CA0 + CA1*fmean + CA2*pow(fmean,2.0) + CA3*pow(fmean,3.0);
ul = C_LAM_FLAME_SPEED(c,t);
gcr = 0.50*pow(ul,2.0)/therm_diff;

C_CRITICAL_STRAIN_RATE(c,t) = gcr;
}
end_c_loop(c,t)
}
}

Bu this time, when I interpret it I get the following error message:
Invalid lvalue in assignment at the line where I set C_CRITICAL_STRAIN_RATE(c,t) = gcr.

Going through the UDF documentation, I realized that DEFINE_)ADJUST is only valid to modify variables that are not passed as arguments, which is not the case here. So DEFINE_ADJUST is not suitable.

Can anyone tell me if there is something wrong in my first UDF, or if there is a more elegant way to compute the unburnt thermal diffusivity?

Thanks,

Ace
cryogenicT is offline   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
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 31 October 4, 2018 14:10
strain rate in UDF Paulina FLUENT 11 November 20, 2014 03:06
UDF for critical strain rate to extinction Birute Bunkute FLUENT 1 March 25, 2010 15:40
Strain rate. MM? Main CFD Forum 1 February 15, 2006 08:55
strain rate at arbitrary position in a cell K. Kevala FLUENT 0 February 4, 2004 17:14


All times are GMT -4. The time now is 21:41.