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/)
-   -   Density UDF Parallel (https://www.cfd-online.com/Forums/fluent-udf/218845-density-udf-parallel.html)

Daryun July 5, 2019 23:30

Density UDF Parallel
 
Code:

#include "udf.h"

int printStopper=0; /*This is a dummy counter */
DEFINE_PROPERTY(cell_density,c,t)
{
#if!RP_HOST /* SERIAL or NODE */
real rho;
real temp = C_T(c,t);
PROP_rho=(-0.00357*(pow(temp,2))+(1.88*temp+753.2));

#if PARALLEL
if(I_AM_NODE_ZERO_P)
#endif

if(printStopper<=100)
{printStopper++;
CX_Message("*****Cell Temp: %3.2f Kelvin, Rho= %E kg/m3 \n",temp,rho);
}
#endif /* !RP_HOST */
return PROP_rho;
}

HTML Code:

Copied C:\Users\LENOVO\Desktop/C:\Users\LENOVO\Desktop\rho.c to libudf\src
udf_names.c and user_nt.udf files in 3ddp_host are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v193\fluent"\fluent19.3.0\src\udf\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ")
        1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_host")udf_names.c and user_nt.udf files in 3ddp_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v193\fluent"\fluent19.3.0\src\udf\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ")
        1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_node")# Generating ud_io1.h
rho.c
..\..\src\rho.c(9) : error C2106: '=' : left operand must be l-value

Done.


Where am I making a mistake? (Ansys v19.3)

AlexanderZ July 8, 2019 02:02

PROP_rho is OTHER macro, you don't need it
Code:

#include "udf.h"

int printStopper=0; /*This is a dummy counter */
DEFINE_PROPERTY(cell_density,c,t)
{
#if!RP_HOST /* SERIAL or NODE */
real rho;
real temp = C_T(c,t);
rho=(-0.00357*(pow(temp,2))+(1.88*temp+753.2));

#if PARALLEL
if(I_AM_NODE_ZERO_P)
#endif

if(printStopper<=100)
{printStopper++;
CX_Message("*****Cell Temp: %3.2f Kelvin, Rho= %E kg/m3 \n",temp,rho);
}
#endif /* !RP_HOST */
return rho;
}

also you counter is strange from my point of view

best regards


All times are GMT -4. The time now is 15:51.