CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Profile for mass - UDF error

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 18, 2012, 01:48
Default Profile for mass - UDF error
  #1
Senior Member
 
Join Date: Mar 2009
Location: Indiana, US
Posts: 185
Rep Power: 8
delaneyluke is on a distinguished road
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
delaneyluke is offline   Reply With Quote

Old   May 18, 2012, 03:12
Default
  #2
Senior Member
 
Join Date: Mar 2009
Location: Indiana, US
Posts: 185
Rep Power: 8
delaneyluke is on a distinguished road
The error was using the operator ^ as in y^2
So switched to y*y and it works !!

Regards
Luke
delaneyluke is offline   Reply With Quote

Old   May 18, 2012, 03:12
Default
  #3
Senior Member
 
Bionico's Avatar
 
Flavio
Join Date: Sep 2011
Location: Brescia, Italy
Posts: 181
Rep Power: 5
Bionico is on a distinguished road
Hi,
try y^2. (with dot) instead of y^2
even the command pow(y,2.) should be fine

Best regards
Bionico is offline   Reply With Quote

Reply

Tags
define_profile

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 18:43
groovyBC sega OpenFOAM Running, Solving & CFD 12 February 17, 2010 10:30
Version 15 on Mac OS X gschaider OpenFOAM Installation 120 December 2, 2009 11:23
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08


All times are GMT -4. The time now is 08:17.