|
[Sponsors] |
May 18, 2012, 02:48 |
Profile for mass - UDF error
|
#1 |
Senior Member
Join Date: Mar 2009
Location: Indiana, US
Posts: 186
Rep Power: 17 |
Get the error
invalid type for integral binary expression: double ^ int when I try to interpret the following UDF #include "udf.h" DEFINE_PROFILE(mass_flow,thread,index) { real x[ND_ND]; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[2]; F_PROFILE(f,thread,index)=35-((-0.75*(34.44-32.78)*y^2)+(1.75*(34.44-32.78)*y)+32.78); } end_f_loop(f,thread) } What could be the reason regards Luke |
|
May 18, 2012, 04:12 |
|
#2 |
Senior Member
Join Date: Mar 2009
Location: Indiana, US
Posts: 186
Rep Power: 17 |
The error was using the operator ^ as in y^2
So switched to y*y and it works !! Regards Luke |
|
May 18, 2012, 04:12 |
|
#3 |
Senior Member
Flavio
Join Date: Sep 2011
Location: Brescia, Italy
Posts: 181
Rep Power: 16 |
Hi,
try y^2. (with dot) instead of y^2 even the command pow(y,2.) should be fine Best regards |
|
Tags |
define_profile |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 10:31 |
c++ libraries and solver compiling | vaina74 | OpenFOAM Installation | 13 | February 3, 2012 18:43 |
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." | sega | OpenFOAM Community Contributions | 12 | February 17, 2010 10:30 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |