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

Switch problem! URGENT UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 15, 2004, 09:48
Default Switch problem! URGENT UDF
  #1
HP
Guest
 
Posts: n/a
Hi! I have written 2 custom udf laws (one for devolatilization and one for surface combustion). When I hook my custom devol law instead of Fluent's one, everything works fine. Similarly when I hook my surf combustion law (instead of Fluent's standard), but when I hook them both simultaneously, then surface combustion does not occur.

Can anybody tell me what the problem is? Is it a switching problem? Any suggestions would be appreciated.

Thanks in advance Ilias.

The laws are:

#include "udf.h" #define PI 3.14159265358979323

boolean just_started_dev_law=1; boolean just_started_cc_law=1;

/************************************************** ******************** constant diameter law for devolatilisation ************************************************** *********************/

DEFINE_DPM_LAW(devol_const_diam_law, p, ci) {

static real dp_law_init;

//Get particle state when law starts

if(just_started_dev_law){

dp_law_init=P_DIAM(p);

just_started_dev_law=0;

}

//first, call standard devolatilization routine to calculate

//the mass and heat transfer

DevolatilizationLaw(p);

//then set the current diameter (constant during the devolatilisation

//procedure) equal to the after drying diameter

P_DIAM(p)=dp_law_init;

//calculate and set the current density (according to the

//constant diameter)

//rho=m/V

P_RHO(p)=P_MASS(p)/(PI*dp_law_init*dp_law_init*dp_law_init/6);

}

/************************************************** ******************** constant density law for char combustion ************************************************** *********************/

DEFINE_DPM_LAW(char_comb_const_diam_law, p, ci) {

static real rhop_law_init;

//Get particle state when law starts

if(just_started_cc_law){

rhop_law_init=P_RHO(p);

just_started_cc_law=0;

}

//first, call standard char combustion routine to calculate

//the mass and heat transfer

SurfaceCombustionLaw(p);

//then set the current density (constant during the char combustion

//procedure) equal to the after devolatilisation density

P_RHO(p)=rhop_law_init;

//calculate and set the current diameter (according to the

//constant density)

//dp=f(rho,m)=(6m/rho/pi)^0.333

P_DIAM(p)=pow(6*P_MASS(p)/(PI*rhop_law_init),0.3333333333); }
  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
Pressure profile UDF for unsteady-state problem? Mohsen Keshavarzian FLUENT 2 August 20, 2008 04:22
parallel UDF problem kerem FLUENT 2 June 20, 2006 06:56
problem with running UDF in batch mode James FLUENT 0 June 6, 2006 06:49
UDF Problem ozgur FLUENT 15 March 11, 2004 12:52
UDF variables F1, y / problem with UDF Fabian FLUENT 6 June 2, 2003 10:22


All times are GMT -4. The time now is 23:56.