CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Parallel UDF DEFINE_PROPERTY problem (https://www.cfd-online.com/Forums/fluent/141856-parallel-udf-define_property-problem.html)

lehoanganh07 September 18, 2014 00:42

Parallel UDF DEFINE_PROPERTY problem
 
Hi, Fluent user,
I make a UDF file which modify vapor pressure as the function of temperature. The UDF complie successful in single calculation. But when using parallel calculation, it have problem: The value Vapor_pre must be return

Single calculation:
#include "udf.h"
#include "math.h"

#define aa1 8.07131
#define aa2 1730.63
#define aa3 233.426

DEFINE_PROPERTY(Vapor_pre,c,t)
{
real T;
real P;
real temp;
T=C_T(c,t);
temp=aa1-aa2/(aa3+T-273.0);
P=pow(10,temp)*133.322368;
return P;
}

Parallel calculation


#include "udf.h"
#include "math.h"

#define aa1 8.07131
#define aa2 1730.63
#define aa3 233.426

DEFINE_PROPERTY(Vapor_pre,c,t)
{
#if !RP_HOST
real T;
real P;
real temp;
T=C_T(c,t);
temp=aa1-aa2/(aa3+T-273.0);
P=pow(10,temp)*133.322368;
return P;
#endif
}

please help me how to fix this. Thank in advance


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