CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF error ? (https://www.cfd-online.com/Forums/fluent/43183-udf-error.html)

Stéphane Champmartin December 21, 2006 12:24

UDF error ?
 
Does anyone understand why I get an error message when I try to compile the udf below? This udf is directly inspired by an example found in Fluent's help so i'm a bit confused... The mistake occurs at the line beginning with "sub_domain_loop(subdomain, mixture_domain, phase_domain_index)"

#include "udf.h"

#define Pi 3.14159

#define amp 0.1

#define l 1.

int phase_domain_index;

cell_t cell;

Thread *cell_thread;

Domain *subdomain;

real xc[ND_ND];

/* loop over all subdomains (phases) in the superdomain (mixture) */

sub_domain_loop(subdomain, mixture_domain, phase_domain_index)

{

/* loop if secondary phase */

if (DOMAIN_ID(subdomain) == 2)

/* loop over all cell threads in the secondary phase domain */

thread_loop_c (cell_thread,subdomain)

{

/* loop over all cells in secondary phase cell threads */

begin_c_loop_all (cell,cell_thread)

{

C_CENTROID(xc,cell,cell_thread);

if (x[1] >= amp*sin(2*Pi*x[0]/l))

/* set volume fraction to 1 for centroid */

C_VOF(cell,cell_thread) = 1.;

else

/* otherwise initialize to zero */

C_VOF(cell,cell_thread) = 0.; } end_c_loop_all (cell,cell_thread) } } } }



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