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

UDF for the critical rate of strain.

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 25, 2010, 16:52
Default UDF for the critical rate of strain.
  #1
New Member
 
Ahmad
Join Date: Mar 2009
Posts: 5
Rep Power: 8
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
strain rate in UDF Paulina FLUENT 11 November 20, 2014 04:06
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 21 February 15, 2014 03:18
UDF for critical strain rate to extinction Birute Bunkute FLUENT 1 March 25, 2010 16:40
Strain rate. MM? Main CFD Forum 1 February 15, 2006 09:55
strain rate at arbitrary position in a cell K. Kevala FLUENT 0 February 4, 2004 18:14


All times are GMT -4. The time now is 11:05.