
[Sponsors] 
July 27, 2009, 14:25 
UDF Radiation model for combustion

#1 
New Member
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 8 
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 09:39. 

July 29, 2009, 10:44 

#2 
Senior Member
Micael Boulet
Join Date: Mar 2009
Location: Quebec, Canada
Posts: 101
Rep Power: 9 
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 

July 29, 2009, 10:59 
Thank u very much Micaël

#3 
New Member
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 8 
i willl try that.....thank u very much for ur reply...keep in touch with me,,,,,


July 29, 2009, 12:28 
hey Micaël

#4 
New Member
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 8 
i have tried but it is not working man,,,,,???


July 29, 2009, 18:34 

#5 
Senior Member
Micael Boulet
Join Date: Mar 2009
Location: Quebec, Canada
Posts: 101
Rep Power: 9 
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 

July 30, 2009, 01:59 
Micaël

#6 
New Member
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 8 
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......??? 

July 30, 2009, 10:19 

#7 
Senior Member
Micael Boulet
Join Date: Mar 2009
Location: Quebec, Canada
Posts: 101
Rep Power: 9 
Here is what I did:
I enabled Species Transport. I choose "mixturetemplate" in the Mixture Material dropdown 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" 

July 30, 2009, 10:49 

#8 
New Member
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 8 
u have run that file...
did get running the fluent with out error....but mine is error is coming again,,,??? 

July 30, 2009, 11:33 

#9 
Senior Member
Micael Boulet
Join Date: Mar 2009
Location: Quebec, Canada
Posts: 101
Rep Power: 9 
You have defined 18 species in your mixture?
If yes, then I don't know what is the problem. 

July 30, 2009, 12:03 
miceal..

#10 
New Member
siva kumar
Join Date: Jul 2009
Posts: 13
Rep Power: 8 
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??? 

July 30, 2009, 12:58 

#11 
Senior Member
Micael Boulet
Join Date: Mar 2009
Location: Quebec, Canada
Posts: 101
Rep Power: 9 
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. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Modified ke turbulence model UDF  Travis  Fluent UDF and Scheme Programming  6  October 7, 2015 13:54 
can alternate combustion model by UDF?  Han Xingsi  FLUENT  0  September 1, 2008 02:08 
Radiation Model  Spectral Model  Ray  CFX  3  April 10, 2006 09: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 