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

Compilation error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2013, 03:37
Default Compilation error
  #1
New Member
 
uday
Join Date: Jul 2013
Posts: 9
Rep Power: 13
uday sarkar is on a distinguished road
Hi im trying to model unsteady heat transfer from wall with the following udf:

#include "udf.h"
DEFINE_PROFILE(unsteady_heat, thread, position)
{
face_t f;
begin_f_loop(f, thread)
{
real t = RP_Get_Real("flow-time");
F_PROFILE(f, thread, position) = 0.01072*(300.0+(1527.84*doubleexp(double(0.0854*t) )));
}
end_f_loop(f, thread)
}

However I am getting syntax error while compiling.
Can anybody help me out?
thanks in advance.
uday sarkar is offline   Reply With Quote

Old   July 29, 2013, 03:53
Default
  #2
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23
vasava will become famous soon enough
You have not declared 'doubleexp'. Also use of type double within the code may not be valid.
vasava is offline   Reply With Quote

Old   July 29, 2013, 04:34
Default
  #3
New Member
 
uday
Join Date: Jul 2013
Posts: 9
Rep Power: 13
uday sarkar is on a distinguished road
hi thanks for the reply.
However "double exp (double x)" stands for the mathematical function exp(x) as defined under mathematical functions in udf help section.
does the error lie somewhere else?
please help.
uday sarkar is offline   Reply With Quote

Old   July 29, 2013, 06:15
Default
  #4
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23
vasava will become famous soon enough
When I try to compile it says that there is a ')' is missing. I strongly suspect that it is because of the type declaration with in the statement.

I dont have fluent license for couple of hours. I will check again and get back to you.
vasava is offline   Reply With Quote

Old   July 29, 2013, 09:46
Default
  #5
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23
vasava will become famous soon enough
As I said earlier the error is in the declaration. Yes "double exp (double x)" stands for the mathematical function exp(x) but that doen not mean that you can use it as it is inside a statement.

Try this one, it works:

#include "udf.h"
DEFINE_PROFILE(unsteady_heat, thread, position)
{
face_t f;
double t1, t2;
real t = CURRENT_TIME;

begin_f_loop(f, thread)
{
real t = RP_Get_Real("flow-time");
t1 = 0.0854*t;
t2 = exp(t1);
F_PROFILE(f, thread, position) = 0.01072*(300.0+(1527.84*t2));
}
end_f_loop(f, thread)
}
vasava is offline   Reply With Quote

Old   July 30, 2013, 04:31
Default
  #6
New Member
 
uday
Join Date: Jul 2013
Posts: 9
Rep Power: 13
uday sarkar is on a distinguished road
Thanks Vasava....
It works fine now...
uday sarkar is offline   Reply With Quote

Reply

Tags
syntax error, unsteady heat transfer


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
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 62 September 18, 2017 07:45
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 12:39
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 18:38
user defined function cfduser CFX 0 April 29, 2006 11:58


All times are GMT -4. The time now is 00:46.