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

Setting new material for DPM injection

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 13, 2016, 12:16
Default Setting new material for DPM injection
  #1
New Member
 
Sagar
Join Date: Apr 2016
Posts: 18
Rep Power: 3
ksgr is on a distinguished road
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 15:44.
ksgr is offline   Reply With Quote

Old   July 13, 2016, 18:59
Default
  #2
Super Moderator
 
diamondx's Avatar
 
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,382
Blog Entries: 23
Rep Power: 22
diamondx will become famous soon enough
are there two way of hooking up a UDF, have you tried both ??
__________________
Regards,
New to ICEM CFD, try this document --> https://goo.gl/KAOIwm
Ali
diamondx is offline   Reply With Quote

Old   July 13, 2016, 19:03
Default
  #3
New Member
 
Sagar
Join Date: Apr 2016
Posts: 18
Rep Power: 3
ksgr is on a distinguished road
Quote:
Originally Posted by diamondx View Post
are there two way of hooking up a UDF, have you tried both ??
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.
ksgr is offline   Reply With Quote

Reply

Tags
dpm fluent, fluent

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
injection problem Mark New FLUENT 0 August 4, 2013 01:30
jou file command for the injection! asal FLUENT 0 June 4, 2013 04: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 11:24


All times are GMT -4. The time now is 18:34.