|
[Sponsors] |
March 25, 2010, 16:52 |
UDF for the critical rate of strain.
|
#1 |
New Member
Ahmad
Join Date: Mar 2009
Posts: 5
Rep Power: 17 |
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 |
|
|
|
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 15:10 |
strain rate in UDF | Paulina | FLUENT | 11 | November 20, 2014 04:06 |
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 |