CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Profile for mass - UDF error (http://www.cfd-online.com/Forums/fluent-udf/101955-profile-mass-udf-error.html)

delaneyluke May 18, 2012 02:48

Profile for mass - UDF error
 
Get the error
invalid type for integral binary expression: double ^ int
when I try to interpret the following UDF

#include "udf.h"
DEFINE_PROFILE(mass_flow,thread,index)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = x[2];
F_PROFILE(f,thread,index)=35-((-0.75*(34.44-32.78)*y^2)+(1.75*(34.44-32.78)*y)+32.78);
}
end_f_loop(f,thread)
}

What could be the reason

regards
Luke

delaneyluke May 18, 2012 04:12

The error was using the operator ^ as in y^2
So switched to y*y and it works !!

Regards
Luke

Bionico May 18, 2012 04:12

Hi,
try y^2. (with dot) instead of y^2
even the command pow(y,2.) should be fine :)

Best regards


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