CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   FLUENT UDF Simple error. (https://www.cfd-online.com/Forums/fluent-udf/105961-fluent-udf-simple-error.html)

startup0820 August 14, 2012 03:54

FLUENT UDF Simple error.
 
Hello~!

first of all, Thank you for sharing this UDF code.

i tried to compile this source, However, the following error occurred.
-----------------------------------------------------------------
..\..\src\test23.c(53) : warning C4133: 'function' : incompatible types - from 'real [3]' to 'CX_Cell_Id *'
..\..\src\test23.c(53) : error C2197: 'SV_locate_point' : too many arguments for call
-----------------------------------------------------------------

i don't know why this problem occur.

Please advise if you know:) I`m using FLUENT 14.0

----------------------------------------------------------------


#include "udf.h"

#include "dpm.h"

DEFINE_ON_DEMAND(locate_point)

{

CX_Cell_Id *c;

cell_t ct;

Thread *t;

real z[3];

real x[3] = {0.0, 0.0, 0.0};

real pressure;

int N,i;

FILE *output,*points;

Domain *d = Get_Domain(1);

points = fopen("points.txt","r");

output = fopen("results.out","w");

fscanf(points,"%d \n",&N);

/* Read points from the file one by one and write corresponding cell centroid and pressure in 뱑esults.out?*/

for ( i=0;i<N;i++ )

{

fscanf(points,"%e%e%e\n",&x[0],&x[1],&x[2]);

SV_locate_point(x, z, c);

ct = c->ct.c;

t = c->ct.t;

C_CENTROID(z, ct, t); /*Returns centroid of the cell*/

pressure=C_P(ct,t);

fprintf(output, "Given point %e %e, %e\nFound Cell at %e, %e, %e\nPressure %e\n\n",x[0],x[1],x[2],z[0],z[1],z[2],pressure);

}

fclose(output);

fclose(points);

}


All times are GMT -4. The time now is 10:06.