|
[Sponsors] |
How to remove "invalid type conversion: double -> pointer to char" Error? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 27, 2019, 06:32 |
How to remove "invalid type conversion: double -> pointer to char" Error?
|
#1 |
New Member
Azim Memon
Join Date: Jul 2019
Posts: 12
Rep Power: 7 |
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. |
|
August 28, 2019, 01:18 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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; } |
|
August 28, 2019, 02:37 |
|
#3 |
New Member
Azim Memon
Join Date: Jul 2019
Posts: 12
Rep Power: 7 |
Thanks AlaxenderZ
|
|
|
|
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 |