|
[Sponsors] |
January 3, 2017, 13:06 |
Compilation Error
|
#1 |
New Member
Vignesh Veeresparan
Join Date: Jan 2017
Posts: 6
Rep Power: 9 |
Hi Everyone,
I'm trying to compile an UDF using DEFINE_PROFILE for thermal BC at wall. My code is as below HTML Code:
#include "udf.h" DEFINE_PROFILE(htcTube,t,i) { cell_t c; face_t f; Thread *ct; ct=THREAD_T0(t); c=F_C0(f,t); real Re, Pr, mu, muw, k, d ; real rho, u, cp, h; begin_f_loop(f,t) { rho = C_R(c,ct); mu = C_MU_EFF(c,ct); muw = C_MU_L(c,ct); k = C_K_L(c,ct); cp = C_CP(c,ct); u = ND_MAG(C_U(c,ct),C_V(c,ct),C_W(c,ct)); d = 10/1000; Re = rho * u * d /mu ; Pr = cp * mu/k ; h = (0.023 * pow(Re,0.8) * pow(Pr, 0.4) * pow((mu/muw),0.14))*k/d; F_PROFILE(f,t,i) = h ; } end_f_loop(f,t) } HTML Code:
(chdir "libudf")(chdir "win64\3ddp")# Generating ud_io1.h 01.c ..\..\src\01.c(50) : error C2275: 'real' : illegal use of this type as an expression C:\PROGRA~1\ANSYSI~1\v160\fluent\fluent16.0.0\src\main\global.h(174) : see declaration of 'real' ..\..\src\01.c(50) : error C2146: syntax error : missing ';' before identifier 'Re' ..\..\src\01.c(50) : error C2065: 'Re' : undeclared identifier ..\..\src\01.c(50) : error C2065: 'Pr' : undeclared identifier ..\..\src\01.c(50) : error C2065: 'mu' : undeclared identifier ..\..\src\01.c(50) : error C2065: 'muw' : undeclared identifier ..\..\src\01.c(50) : error C2065: 'k' : undeclared identifier ..\..\src\01.c(50) : error C2065: 'd' : undeclared identifier ..\..\src\01.c(51) : error C2275: 'real' : illegal use of this type as an expression C:\PROGRA~1\ANSYSI~1\v160\fluent\fluent16.0.0\src\main\global.h(174) : see declaration of 'real' ..\..\src\01.c(51) : error C2146: syntax error : missing ';' before identifier 'rho' ..\..\src\01.c(51) : error C2065: 'rho' : undeclared identifier ..\..\src\01.c(51) : error C2065: 'u' : undeclared identifier ..\..\src\01.c(51) : error C2065: 'cp' : undeclared identifier ..\..\src\01.c(51) : error C2065: 'h' : undeclared identifier ..\..\src\01.c(56) : error C2065: 'rho' : undeclared identifier ..\..\src\01.c(57) : error C2065: 'mu' : undeclared identifier ..\..\src\01.c(58) : error C2065: 'muw' : undeclared identifier ..\..\src\01.c(59) : error C2065: 'k' : undeclared identifier ..\..\src\01.c(60) : error C2065: 'cp' : undeclared identifier ..\..\src\01.c(61) : error C2065: 'u' : undeclared identifier ..\..\src\01.c(62) : error C2065: 'd' : undeclared identifier ..\..\src\01.c(64) : error C2065: 'Re' : undeclared identifier ..\..\src\01.c(64) : error C2065: 'rho' : undeclared identifier ..\..\src\01.c(64) : error C2065: 'u' : undeclared identifier ..\..\src\01.c(64) : error C2065: 'd' : undeclared identifier ..\..\src\01.c(64) : error C2065: 'mu' : undeclared identifier ..\..\src\01.c(65) : error C2065: 'Pr' : undeclared identifier ..\..\src\01.c(65) : error C2065: 'cp' : undeclared identifier ..\..\src\01.c(65) : error C2065: 'mu' : undeclared identifier ..\..\src\01.c(65) : error C2065: 'k' : undeclared identifier ..\..\src\01.c(66) : error C2065: 'h' : undeclared identifier ..\..\src\01.c(66) : error C2065: 'Re' : undeclared identifier ..\..\src\01.c(66) : error C2065: 'Pr' : undeclared identifier ..\..\src\01.c(66) : error C2065: 'mu' : undeclared identifier ..\..\src\01.c(66) : error C2065: 'muw' : undeclared identifier ..\..\src\01.c(66) : error C2065: 'k' : undeclared identifier ..\..\src\01.c(66) : error C2065: 'd' : undeclared identifier ..\..\src\01.c(68) : error C2065: 'h' : undeclared identifier Done. Thanks in Advance. |
|
January 4, 2017, 04:55 |
|
#2 |
Senior Member
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 10 |
My first suggestion would be to try putting your real declarions before the ct and c expressions.
|
|
January 6, 2017, 05:19 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I completely agree with Kevin.
My second suggestion: the line Code:
d = 10/1000; Instead, use one of the following: Code:
d = 10./1000; d = 10/1000.; d = 0.01; d = (float)10/1000; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] blockMesh with double grading. | spwater | OpenFOAM Meshing & Mesh Conversion | 92 | January 12, 2019 10:00 |
Pressure outlet boundary condition | rolando | OpenFOAM Running, Solving & CFD | 62 | September 18, 2017 07:45 |
DPM udf error | haghshenasfard | FLUENT | 0 | April 13, 2016 07:35 |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 12:39 |
Compiling problems with hello worldC | fw407 | OpenFOAM Installation | 21 | January 6, 2008 18:38 |