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

pb with my UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 23, 2007, 11:01
Default pb with my UDF
  #1
Florent CHAMPET
Guest
 
Posts: n/a
Hi, I have a problem with my UDF for mass transfert. There is no pb during the compilation but at the beginning of the first iteration, a fatal signal (segmentation violation) occurred. Is someone able to help me ? Great thanks. This is my UDF #include "udf.h" #include "sg_mphase.h" #define T_SAT 418.2 #define LAT_HT 500 /* ID species : liquid1 = 2 ; vapor1 = 3 ; species3 = 5 ; liquid2 = 6 */

/************************************************** ************************************************** *******************/ /******************** Modelisation de la reaction chimique du liquide1 en liquide2****************************/ /************************************************** ************************************************** *******************/

DEFINE_MASS_TRANSFER(reaction_chimiq,cell,pri_th,f rom_0,from_3,to_1,to_6) /*from_phase_index, from_species_index,to_phase_index, to_species_index */ { real masse_transfert; /* [kg/s] */

Thread *mix_th, *sec_th; mix_th = THREAD_SUPER_THREAD(pri_th); sec_th = THREAD_SUB_THREAD(mix_th,1);

real pnt = C_T(cell,sec_th); real density = C_R(cell,sec_th); /* definition du taux de conversion du styrene X */

real w = C_YI(cell,sec_th,0); /* w is the mass fraction of liquid1 at current time step */ real w0 = 0.9; /* w0 is initial mass fraction of liquid1 at the inlet */ real X = 1.-w/w0; /* definition of the production rate Rp */ real Kd = 5.48*pow(10,15)*exp(-18240/pnt); real Kp = 6346*exp(-2600/pnt); real Ki = 212*exp(-15005/pnt); /* [s-1] */ real f = 0.7; real Ktc0 = 1.205*pow(10,7)*exp(-844/pnt); real A1 = 2.57-0.00505*pnt; real A2 = 9.56-0.0176*pnt; real A3 = -3.03+0.00785*pnt; real Ktc = Ktc0*exp(A1*X+A2*X*X+A3*X*X*X); /* [l.mol-1.s-1] */ real Rp = Kp*density*w*sqrt((2*Ki*(density*w0)*(density*w0)* (density*w0))/Ktc); /* [kg/m3/s] */

masse_transfert = Rp*CURRENT_TIMESTEP; /* [kg/m3] */

return masse_transfert;

}

  Reply With Quote

Old   August 23, 2007, 19:50
Default Re: pb with my UDF
  #2
Joe
Guest
 
Posts: n/a
Repost enclosing the code using the HTML tags: pre and /pre
  Reply With Quote

Reply

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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 04:48.