CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to remove "invalid type conversion: double -> pointer to char" Error? (https://www.cfd-online.com/Forums/fluent/220163-how-remove-invalid-type-conversion-double-pointer-char-error.html)

Azim07 August 27, 2019 05:32

How to remove "invalid type conversion: double -> pointer to char" Error?
 
I have written a UDF to define the Specific Heat of the PCM in the melting range by the following equation

Cp= (1934+(131*(temp-300.35))+(245000*((exp(-(temp-301.35)*temp))/(1.77245))));

The UDF is as follows

#include "udf.h"
DEFINE_SPECIFIC_HEAT(cp_pcm,c,t,temp,Tref, h, yi)
{
real cp;
real temp=C_T(c,t);
if (temp<=300.35)
cp=1934;
else if (temp>=302.35)
cp=2196;
else
cp=(1934+(131*(temp-300.35))+(245000*((exp(-(temp-301.35)*temp))/(1.77245))));
return cp;
}


When i interpret it, It shows the following Error in Line - 5.
"invalid type conversion: double -> pointer to char"

Please Suggest me something how to remove this Error????

Thanks.

AlexanderZ August 28, 2019 00:18

where did you get macro DEFINE_SPECIFIC_HEAT(cp_pcm,c,t,temp,Tref, h, yi) ?

should be DEFINE_SPECIFIC_HEAT (name,T,Tref,h,yi)
and
Code:

#include "udf.h"
DEFINE_SPECIFIC_HEAT (name,temp,Tref,h,yi)
{
real cp;
if (temp <= 300.35)
cp=1934;
else if (temp >= 302.35)
cp=2196;
else
cp=(1934+(131*(temp-300.35))+(245000*((exp(-(temp-301.35)*temp))/(1.77245))));
return cp;
}

best regards

Azim07 August 28, 2019 01:37

Thanks AlaxenderZ


All times are GMT -4. The time now is 17:26.