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

udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 19, 2003, 07:47
Default udf
  #1
DAE
Guest
 
Posts: n/a
Hi

Below is a udf that I intend to evaporate particles if they enter the primary phase in the VOF multiphase model.

The purpose of this is because in practice, the particles will not enter the primary phase, thus evaporating them is a way of terminating their trajectories.

I am getting errors when compiling though telling me that the mixture may not be initialized.

Does anyone know how I can correct this?

Thanks

/************************************************** **********************/ /* A DPM udf to terminate particles that enter the air phase */ /************************************************** **********************/

#include "udf.h" /* Always include udf.h when writing a UDF. It translates the DEFINE */ /* and other macros into C, which is what the compiler understands */

#include "dpm.h" /* dpm.h contains macros for use with the discrete phase model. dpm.h */ /* is included in the udf.h header file */

#include "sg_mphase.h" /* sg_mphase.h contains macros for use with multiphase model. sg_mphase.h */ /* is included in the udf.h header file */

#include "surf.h" /* surf.h is not included in the udf.h file. */ /* surf.h must be included for use with the macros: */ /* RP_Cell() & RP_Thread() */

#define P_CELL(p)RP_CELL(&(p->cCell)) #define P_CELL_THREAD(p)RP_THREAD(&(p->cCell)) /* Non-standard macros - Used for: fuck knows! */

DEFINE_DPM_SCALAR_UPDATE(terminateair, c, t, initialize, p) /* This macro is used to update a scalar quantity ever time a particle */ /* position is updated */ /* c.f. DEFINE_DPM_SCALAR_UPDATE(name, c, t, initialize, p) */ /* name: the name of the udf */ /* c: an index that identifies the cell that the particle is currently in */ /* t: pointer to the thread the particle is currently in */ /* initialize: an integer that has a value of 1 when the function is */ /* called at the start of the particle integration and 0 thereafter */ /* p: pointer to a Tracked_Particle structure that contains data relating */ /* to the particle being tracked */

{

Thread *mixture_thread; Thread **pt; /* pointer to a phase thread, initialize pt */ pt = THREAD_SUB_THREADS(mixture_thread);

if (initialize)

{

P_DIAM(p) = P_INIT_DIAM(p); /* P_MASS(p) is the mass of the particle */

P_MASS(p) = P_INIT_MASS(p); /* P_DIAM(p) is the diameter of the particle */

} /* P_INIT_DIAM(p) is the mass of the particle */

/* at injection into domain */

/* P_INIT_MASS(p) is the mass of the particle */

/* at injection into the domain */

else

{

if( C_VOF(c,pt[0]) > 0.99 ) /* If volume fraction of primary phase > 0.99 */

{

(P_MASS(p) = (0.0));

(P_DIAM(p) = (0.0));

}

else

{

P_DIAM(p) = P_INIT_DIAM(p);

P_MASS(p) = P_INIT_MASS(p);

}

} }
  Reply With Quote

Old   May 20, 2003, 13:29
Default Re: udf
  #2
Raja Banerjee
Guest
 
Posts: n/a
Hi, I seem to have found one error is that code. You seem to have one extra } at the end of your udf. It might be the problem.
  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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
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 22:38
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 06:37.