Is this UDF correct?
Hi all,
I am a novice in C programming, I wrote the following in an attempt to generate a two layer flow in my domain. But when I try to compile it, fluent keeps giving me error msg. Not sure what is wrong. Can anybody help? Thanx. #include "udf.h" DEFINE_PROPERTY(cell_density, cell, threads) { real density; real grid_y = NODE_Y(c,t); if (grid_y<0.81) density = 998; else density = 968; return density; } Regards, JJ |
Re: Is this UDF correct?
try grid_y = NODE_Y(cell,threads);
|
Re: Is this UDF correct?
Hi Greg,
Thanx for your help, tried it and I was able to compile it. But I am still stuck cos when I try to initialize the flow, I obtain the following error msg "2ldensity.cpp:6: macro `NODE_Y' used with too many (2) args" 2ldensity is the name of the UDF. May I know what can be done? Thanx in advance. JJ |
Re: Is this UDF correct?
Actually you'd be better to use C_CENTROID to determine the location of the cell centroid. Check this out in the udf manual.
Greg |
All times are GMT -4. The time now is 22:35. |