CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

How to remove "invalid type conversion: double -> pointer to char" Error?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 27, 2019, 06:32
Default How to remove "invalid type conversion: double -> pointer to char" Error?
  #1
New Member
 
Azim Memon
Join Date: Jul 2019
Posts: 12
Rep Power: 6
Azim07 is on a distinguished road
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.
Azim07 is offline   Reply With Quote

Old   August 28, 2019, 01:18
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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
AlexanderZ is offline   Reply With Quote

Old   August 28, 2019, 02:37
Default
  #3
New Member
 
Azim Memon
Join Date: Jul 2019
Posts: 12
Rep Power: 6
Azim07 is on a distinguished road
Thanks AlaxenderZ
Azim07 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 01:21
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 08:11
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 10:28
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31


All times are GMT -4. The time now is 11:44.