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/32352-udf-error.html)

Nandu October 20, 2003 09:33

UDF error
 
Hi,

I am trying to use a UDF to determine the gradient of density for use in generating numerical schlieren images. the following error keeps cropping up despite using a script obtained from the fluent user website.

get_udf_function: function adjust_gradient has wrong type: 9 != 8

the script i am using is the following:

# include "udf.h" # define domain_ID 2

enum {

density_grad,

mag_grad_density };

DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f;

domain = Get_Domain(domain_ID);

/* Fill UDS with the variable. */ thread_loop_c(t,domain)

{

begin_c_loop(c,t)

{

real density = C_R(c,t);

C_UDSI(c,t,density_grad) = pow(density,1);

}

end_c_loop (c,t)

} }

DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t;

domain=Get_Domain(1);

/* Fill the UDM with magnitude of gradient. */ thread_loop_c(t,domain)

{

begin_c_loop(c,t)

{

C_UDMI(c,t,mag_grad_density) = NV_MAG(C_UDSI_G(c,t,density_grad));

}

end_c_loop(c,t)

} }

can any one explain to me what this error actually means?

cheers nandu


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