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

UDF Radiation model for combustion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2009, 15:25
Question UDF Radiation model for combustion
  #1
New Member
 
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 17
shshiva17 is on a distinguished road
Hi,,,This is siva kumar from IIT MADRAS....while am interpret my udf the error is showing like.....
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()
this error is coming in my fluent model when i interpret the source code as shown in below....fuel is methane
#include "udf.h"
DEFINE_SOURCE(energy,c,t,ds,eqn)
{
/*FILE *fp;*/
real source,tep,sigma,Pamb,tamb;
real MW[18];
real Xh2o,Xco,Xco2,Xch4,ph2o,pco,pco2,pch4;
real MWmix,sum=0;
real kapa,absh2o,absco,absco2,absch4;
real a0,a1,a2,a3,a4,a5;
real b0,b1,b2,b3,b4,b5;
real c0,c1,c2,c3,c4;
real d0,d1,d2,d3,d4;
int i;
/*fp=fopen("properties.txt","w");*/
tep=C_T(c,t);
MW[0]=1;
MW[1]=32;
MW[2]=17;
MW[3]=16;
MW[4]=2;
MW[5]=18;
MW[6]=33;
MW[7]=28;
MW[8]=44;
MW[9]=16;
MW[10]=15;
MW[11]=14;
MW[12]=30;
MW[13]=29;
MW[14]=31;
MW[15]=34;
MW[16]=13;
MW[17]=28;
sigma=0.000000056697;
Pamb=1.0;
tamb=298.0;
a0=18.741;
a1=-121.310;
a2=273.500;
a3=-194.05;
a4=56.31;
a5=-5.8169;
b0=-0.23093;
b1=1.12393;
b2=9.4153;
b3=-2.99880;
b4=0.51382;
b5=-.000018684;
c0=6.6334;
c1=-0.0035686;
c2=0.000000016682;
c3=0.00000000025611;
c4=-0.000000000000026558;
if(tep<=750)
{
d0=4.7869;
d1=-0.06953;
d2=0.000295775;
d3=-0.000000425732;
d4=0.000000000202894;
}
else
if(tep>750)
{
d0=10.09;
d1=-0.01183;
d2=0.0000047753;
d3=-0.000000000587209;
d4=-0.000000000000025334;
}
for(i=0;i<18;i++)
{
sum=sum+C_YI(c,t,i)/MW[i];
}
MWmix=1/sum;
Xh2o=C_YI(c,t,5)*MWmix/18;
Xco=C_YI(c,t,7)*MWmix/28;
Xco2=C_YI(c,t,8)*MWmix/44;
Xch4=C_YI(c,t,9)*MWmix/16;
ph2o=Xh2o*Pamb;
pco=Xco*Pamb;
pco2=Xco2*Pamb;
pch4=Xch4*Pamb;
absch4=c0+(c1*tep)+(c2*pow(tep,2))+(c3*pow(tep,3)) +(c4*pow(tep,4)
);
absco2=a0+(a1*(1000/tep))+(a2*pow(1000/tep,2))+(a3*pow(1000/tep,3
))+(a4*pow(1000/tep,4))+(a5*pow(1000/tep,5));
absco=d0+(d1*tep)+(d2*pow(tep,2))+(d3*pow(tep,3))+ (d4*pow(tep,4))
;
absh2o=b0+(b1*(1000/tep))+(b2*pow(1000/tep,2))+(b3*pow(1000/tep,3
))+(b4*pow(1000/tep,4))+(b5*pow(1000/tep,5));
kapa=(absch4*pch4)+(absco*pco)+(absco2*pco2)+(absh 2o*ph2o);
source=-(4*sigma*kapa*(pow(tep,4)-pow(tamb,4)));
/*fprintf(fp,"%f%f%f\n",tep,source,MWmix);*/
ds[eqn]=0;
return source;
}

why the error is coming i don't know please help me??????

Last edited by shshiva17; July 28, 2009 at 10:39.
shshiva17 is offline   Reply With Quote

Old   July 29, 2009, 11:44
Default
  #2
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
Hello Siva,

Notice the space into your variable:
kapa=(absch4*pch4)+(absco*pco)+(absco2*pco2)+(absh 2o*ph2o);

Delete that space and it should be ok:
kapa=(absch4*pch4)+(absco*pco)+(absco2*pco2)+(absh2o*ph2o);

Have a good day.

Micaël
Micael is offline   Reply With Quote

Old   July 29, 2009, 11:59
Smile Thank u very much Micaël
  #3
New Member
 
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 17
shshiva17 is on a distinguished road
i willl try that.....thank u very much for ur reply...keep in touch with me,,,,,
shshiva17 is offline   Reply With Quote

Old   July 29, 2009, 13:28
Thumbs down hey Micaël
  #4
New Member
 
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 17
shshiva17 is on a distinguished road
i have tried but it is not working man,,,,,???
shshiva17 is offline   Reply With Quote

Old   July 29, 2009, 19:34
Default
  #5
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
Sorry, I had not tried the UDF, only saw this space and reported it. Now I can see too that there is another problem, more difficult to find.

That is not clear to me, but the problem seems to come from C_YI(c,t,i). Using only a Species Transport model, I can successfully use your UDF. Which model do you use?

Someone reported problem using C_YI(c,t,i) with a pdf combustion model:
http://university.fluent.com/forum/v...814ae1a27f690d

Hope this can helps.

Micaël
Micael is offline   Reply With Quote

Old   July 30, 2009, 02:59
Smile Micaël
  #6
New Member
 
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 17
shshiva17 is on a distinguished road
hi,,,,miceal,,,am using species transport model .......how can it be solved...?
see miceal am not using pdf combustion model am using only species transport model......???
shshiva17 is offline   Reply With Quote

Old   July 30, 2009, 11:19
Default
  #7
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
Here is what I did:
I enabled Species Transport. I choose "mixture-template" in the Mixture Material drop-down list. In the Materials panel, I added arbitrary fluid materials in that mixture up to 18. Finally, I hooked the UDF in the boundaries panel, adding energy source in the fluid zone. I did few iterations without bug. Do you use it that way?

If you have less then 18 species defined in your mixture there is a bug here in your code:
for(i=0;i<18;i++)
{
sum=sum+C_YI(c,t,i)/MW[i];
}

You can easily see how many species you have:
Define -> Models -> Species -> Transport & Reaction
Just look at the right of "Number of Volumetric Species"
Micael is offline   Reply With Quote

Old   July 30, 2009, 11:49
Thumbs down
  #8
New Member
 
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 17
shshiva17 is on a distinguished road
u have run that file...
did get running the fluent with out error....but mine is error is coming again,,,???
shshiva17 is offline   Reply With Quote

Old   July 30, 2009, 12:33
Default
  #9
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
You have defined 18 species in your mixture?
If yes, then I don't know what is the problem.
Micael is offline   Reply With Quote

Old   July 30, 2009, 13:03
Smile miceal..
  #10
New Member
 
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 17
shshiva17 is on a distinguished road
hi miceal my problem is 2 step methane combustion....total products are 6 how can i give 18 products ,,,,
i think we need to change the udf into 6 species,,,,,,isn't it???
shshiva17 is offline   Reply With Quote

Old   July 30, 2009, 13:58
Default
  #11
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
Did your write this UDF yourself? What it does? What is "MW"?

I thought you have 18 species because of this:
for(i=0;i<18;i++)
{
sum=sum+C_YI(c,t,i)/MW[i];
}
i in C_YI(c,t,i) is species index (integer)

What this loop intend to do?

Since you have 6 species, now it is clear to me that the problem is there.

Don't give up.
Micael is offline   Reply With Quote

Old   July 16, 2017, 14:11
Default absorption
  #12
New Member
 
Join Date: Jan 2017
Posts: 25
Rep Power: 9
sewgolam is on a distinguished road
Dear friends,

as I saw the UDF you are calculating absorption for each species that are present in the domain and give it as a source value. how is this source define in fluent

because the heat is only absorped in the cell where these species are present en not else were.

I want to used DPM to inject particle and that calculate the absorpted heat by radiation. how could I used this UDF

please help
sewgolam 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
Modified k-e turbulence model UDF Travis Fluent UDF and Scheme Programming 7 November 11, 2018 21:21
can alternate combustion model by UDF? Han Xingsi FLUENT 0 September 1, 2008 03:08
Radiation Model - Spectral Model Ray CFX 3 April 10, 2006 10:33
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07
RE: Radiation model Ashutosh Joshi FLUENT 1 January 30, 2001 11:50


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