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

How to solve "invalid type for binary expression: double* function returning double"?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 15, 2014, 15:54
Unhappy How to solve "invalid type for binary expression: double* function returning double"?
  #1
Member
 
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 46
Rep Power: 15
B.Hamada is on a distinguished road
hi friends

I write this UDF to represent unsteady heat flux, but an error appear, I can not understand how to solve it in the 13th line.

Error: line 13: invalid type for binary expression: double * function returning double.
Code:
#include "udf.h"
DEFINE_PROFILE(unsteady_flux, thread, position)
{
face_t f;
real t = CURRENT_TIME;
real Trise = 0;
real Tset = 48600;
real Tmax = 21900;
real Gs = 500;  
begin_f_loop(f, thread)
{ 
if((temp>=Trise) && (temp<Tmax)) 
F_PROFILE(f, thread, position) = Gs*sin*(90*(t-Trise)/(Tmax-Trise)); 
else if((temp>=Tmax) && (temp<Tset)) 
F_PROFILE(f, thread, position) = Gs*sin*(90*(t-Tmax)/(Tset-Tmax)); 
} 
end_f_loop(f, thread)
}
B.Hamada is offline   Reply With Quote

Old   August 22, 2014, 11:45
Default
  #2
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 12
upeksa is on a distinguished road
You used the sine function wrong, so your code should be:

#include "udf.h"
DEFINE_PROFILE(unsteady_flux, thread, position)
{
face_t f;
real t = CURRENT_TIME;
real Trise = 0.0;
real Tset = 48600.0;
real Tmax = 21900.0;
real Gs = 500.0;
begin_f_loop(f, thread)
{
if((temp>=Trise) && (temp<Tmax))
F_PROFILE(f, thread, position) = Gs*sin(90.0*(t-Trise)/(Tmax-Trise));
else if((temp>=Tmax) && (temp<Tset))
F_PROFILE(f, thread, position) = Gs*sin(90.0*(t-Tmax)/(Tset-Tmax));
}
end_f_loop(f, thread)
}

By the way, I am almost sure that the unit of an angle is radian, not degree. Check it.
upeksa is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


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
Continuing User Defined Real Gas Model issues aeroman FLUENT 6 April 8, 2016 04:34
LES supersonic free jet martyn88 OpenFOAM 22 April 17, 2015 07:00
[swak4Foam] Air Conditioned room groovyBC Sebaj OpenFOAM Community Contributions 7 October 31, 2012 15:16
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23


All times are GMT -4. The time now is 15:21.