|
[Sponsors] |
July 13, 2016, 13:16 |
Setting new material for DPM injection
|
#1 |
New Member
Sagar
Join Date: Apr 2016
Posts: 23
Rep Power: 10 |
Hello all!
I have created a new material for injection of liquid droplets. In my case I want to have different properties for diesel fuel as I don't want to use the values provided by Fluent. I have written some UDF's for different liquid properties (density, Cp, latent heat, vapor pressure) which are required by Fluent. I am able to sccuessfully hook these UDF's to Fluent. When I go to injections in DPM settings, I select the newly defined material. But when I select it and say "OK", I get a segmentation fault error message. I have been pondering over this issue for hours and I am unable to figure out what is the error since the error message is so generic. EDIT: For completeness, following is one of the UDF which I used in Fluent: #include "udf.h" #include "stdio.h" #include "stdlib.h" #include "math.h" DEFINE_DPM_PROPERTY(particle_spheat,c,t,p,T) { double tgiven = C_T(c,t); int i, j; FILE * fp; static const int maxno = 726; double temparr[726],rhoarr[726],cpliqarr[726],pvaparr[726],hevaparr[726]; double intpart_temp,frac; double cpliqcalc,tempup,templow, tcrit=725.9; fp = fopen("liq_prop.txt", "r"); for(i=0;i<maxno;i++) { if(feof(fp)) break; fscanf(fp,"%lf %lf %lf %lf %lf",&(temparr[i]),&(rhoarr[i]),&(cpliqarr[i]),&(pvaparr[i]),&(hevaparr[i])); } fclose(fp); frac = modf(tgiven, &intpart_temp); for(i=0;i<maxno;i++) { if(tgiven>tcrit) { cpliqcalc = cpliqarr[725]; break; } else if(temparr[i] == intpart_temp) { j = i; templow = temparr[i]; tempup = templow + 1; cpliqcalc = cpliqarr[j] + ((cpliqarr[j+1]-cpliqarr[j]) * (tgiven - templow)/(tempup-templow)); } } p->enthalpy = cpliqcalc*(tgiven-T_REF); return cpliqcalc; } If anybody has any idea or facing similar issues kindly reply. Last edited by ksgr; July 15, 2016 at 16:44. |
|
July 13, 2016, 20:03 |
|
#3 |
New Member
Sagar
Join Date: Apr 2016
Posts: 23
Rep Power: 10 |
I'm afraid that I haven't tried both. I just followed the procedure which was outlined in the Fluent help. Could you tell what are the two ways of hooking up UDF?
In my case, when I create a new material, for every property I select in the drop down menu "user defined" to hook up the UDF's. |
|
Tags |
dpm fluent, fluent |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
injection problem | Mark New | FLUENT | 0 | August 4, 2013 02:30 |
jou file command for the injection! | asal | FLUENT | 0 | June 4, 2013 05:15 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |
setting a second phase material | atothep | FLUENT | 4 | June 23, 2011 12:24 |