CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Errors in UDF (http://www.cfd-online.com/Forums/fluent-udf/118609-errors-udf.html)

shashank312 May 30, 2013 18:57

Errors in UDF
 
Getting the following errors when I compile my code.


..\..\src\PhaseChangeModel.c(193) : error C2275: 'real' : illegal use of this type as an expression
c:\program files\ansys inc\v145\fluent\fluent14.5.0\src\global.h(166) : see declaration of 'real'
..\..\src\PhaseChangeModel.c(193) : error C2146: syntax error : missing ';' before identifier 'mass_liquid'
..\..\src\PhaseChangeModel.c(193) : error C2143: syntax error : missing ')' before 'type'
..\..\src\PhaseChangeModel.c(193) : error C2059: syntax error : ')'
..\..\src\PhaseChangeModel.c(196) : error C2275: 'Thread' : illegal use of this type as an expression
C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0\src\ mem.h(802) : see declaration of 'Thread'
..\..\src\PhaseChangeModel.c(196) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(198) : error C2065: 'massliquidsource' : undeclared identifier
..\..\src\PhaseChangeModel.c(198) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(198) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(198) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(198) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(199) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(199) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(199) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(199) : error C2065: 'massliquidsource' : undeclared identifier
..\..\src\PhaseChangeModel.c(201) : error C2065: 'dS' : undeclared identifier
..\..\src\PhaseChangeModel.c(201) : error C2065: 'eqn' : undeclared identifier
..\..\src\PhaseChangeModel.c(201) : error C2109: subscript requires array or pointer type
..\..\src\PhaseChangeModel.c(201) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(201) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(201) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(203) : error C2065: 'massliquidsource' : undeclared identifier
..\..\src\PhaseChangeModel.c(203) : warning C4098: 'massenergy_transfer' : 'void' function returning a value
..\..\src\PhaseChangeModel.c(206) : error C2275: 'real' : illegal use of this type as an expression
c:\program files\ansys inc\v145\fluent\fluent14.5.0\src\global.h(166) : see declaration of 'real'
..\..\src\PhaseChangeModel.c(206) : error C2146: syntax error : missing ';' before identifier 'mass_vapor'
..\..\src\PhaseChangeModel.c(206) : error C2143: syntax error : missing ')' before 'type'
..\..\src\PhaseChangeModel.c(206) : error C2059: syntax error : ')'
..\..\src\PhaseChangeModel.c(209) : error C2275: 'Thread' : illegal use of this type as an expression
C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0\src\ mem.h(802) : see declaration of 'Thread'
..\..\src\PhaseChangeModel.c(209) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(209) : error C2065: 'vt' : undeclared identifier
..\..\src\PhaseChangeModel.c(209) : error C2223: left of '->super_thread' must point to struct/union
..\..\src\PhaseChangeModel.c(211) : error C2065: 'massvaporsource' : undeclared identifier
..\..\src\PhaseChangeModel.c(211) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(211) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(211) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(211) : error C2065: 'vt' : undeclared identifier
..\..\src\PhaseChangeModel.c(211) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(211) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(212) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(212) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(212) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(212) : error C2065: 'massvaporsource' : undeclared identifier
..\..\src\PhaseChangeModel.c(214) : error C2065: 'dS' : undeclared identifier
..\..\src\PhaseChangeModel.c(214) : error C2065: 'eqn' : undeclared identifier
..\..\src\PhaseChangeModel.c(214) : error C2109: subscript requires array or pointer type
..\..\src\PhaseChangeModel.c(214) : error C2065: 'tm' : undeclared identifier
..\..\src\PhaseChangeModel.c(214) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(214) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(216) : error C2065: 'massvaporsource' : undeclared identifier
..\..\src\PhaseChangeModel.c(216) : warning C4098: 'massenergy_transfer' : 'void' function returning a value
..\..\src\PhaseChangeModel.c(219) : error C2275: 'real' : illegal use of this type as an expression
c:\program files\ansys inc\v145\fluent\fluent14.5.0\src\global.h(166) : see declaration of 'real'
..\..\src\PhaseChangeModel.c(219) : error C2146: syntax error : missing ';' before identifier 'energy'
..\..\src\PhaseChangeModel.c(219) : error C2143: syntax error : missing ')' before 'type'
..\..\src\PhaseChangeModel.c(219) : error C2059: syntax error : ')'
..\..\src\PhaseChangeModel.c(222) : error C2065: 'energysource' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2065: 'thread' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(222) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2065: 'thread' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(222) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2065: 'thread' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(222) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2065: 'thread' : undeclared identifier
..\..\src\PhaseChangeModel.c(222) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(222) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(223) : error C2065: 'thread' : undeclared identifier
..\..\src\PhaseChangeModel.c(223) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(223) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(223) : error C2065: 'energysource' : undeclared identifier
..\..\src\PhaseChangeModel.c(225) : error C2065: 'dS' : undeclared identifier
..\..\src\PhaseChangeModel.c(225) : error C2065: 'eqn' : undeclared identifier
..\..\src\PhaseChangeModel.c(225) : error C2109: subscript requires array or pointer type
..\..\src\PhaseChangeModel.c(225) : error C2065: 'thread' : undeclared identifier
..\..\src\PhaseChangeModel.c(225) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(225) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(225) : error C2065: 'thread' : undeclared identifier
..\..\src\PhaseChangeModel.c(225) : error C2223: left of '->storage' must point to struct/union
..\..\src\PhaseChangeModel.c(225) : error C2065: 'cell' : undeclared identifier
..\..\src\PhaseChangeModel.c(227) : error C2065: 'energysource' : undeclared identifier
..\..\src\PhaseChangeModel.c(227) : warning C4098: 'massenergy_transfer' : 'void' function returning a value


Any help will be appreciated.

Shashank

blackmask May 30, 2013 19:38

why is there a space before mem.h?

shashank312 May 30, 2013 19:51

Its written as:

#include "mem.h"

Is that wrong?

shashank312 May 30, 2013 20:25

I see what you mean. Maybe I should go and look into that src folder.

shashank312 May 30, 2013 20:28

I compiled the code again and it didn't give me space before mem.h, so I guess the error lies elsewhere.

shashank312 May 30, 2013 20:29

C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0\src\ mem.h(802) : see declaration of 'Thread'

shashank312 May 30, 2013 20:30

Once I copy-paste in here, it gives a space. There is no space in the FLUENT GUI.


All times are GMT -4. The time now is 23:45.