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

error while interpreting a udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 3, 2015, 15:35
Default error while interpreting a udf
  #1
New Member
 
atilla savas
Join Date: Oct 2015
Posts: 5
Rep Power: 11
atello28 is on a distinguished road
I wanted to interpret the udf below, which would give heat flux on a surface of a domain, but I encountered the errors at the end of the this note. The heat flux is getting greater when the radius gets bigger.

#include "udf.h"

DEFINE_PROFILE(heat_flux,thread,i)

{

real x[ND_ND];

real radius;

real omega;

real tau;

omega=62.83;

tau=20e6;

face_t f;

begin_f_loop(f,thread)

{

F_CENTROID (x,f,thread);

radius=sqrt(x[0]*x[0]+x[1]*x[1]);

F_PROFILE(f,thread,i) = radius*omega*tau

}

end_f_loop(f,thread);

}




line 19: parse error

line 21: f: undeclared variable
atello28 is offline   Reply With Quote

Old   November 3, 2015, 16:50
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Declare all of your variables at the start of the code block (a requirement of ANSI C which Fluent uses). For example, move "face_t f;" above "omega=62.83;".
`e` is offline   Reply With Quote

Old   November 5, 2015, 07:54
Default
  #3
New Member
 
atilla savas
Join Date: Oct 2015
Posts: 5
Rep Power: 11
atello28 is on a distinguished road
Dear 'e',

I have done what you have said and encountered other errors, can you help me about those as well?

The new UDF and the errors are listed below:

#include "udf.h"

DEFINE_PROFILE(heat_flux,thread,i)

{

real x[ND_ND];

real radius;

real omega;

real tau;

face_t f;

omega=62.83;

tau=20e6;

begin_f_loop(f,thread)

{

F_CENTROID (x,f,thread);

radius=sqrt(x[0]*x[0]+x[1]*x[1]);

F_PROFILE(f,thread,i) = radius*omega*tau

}

end_f_loop(f,thread);

}


line 31 : parse error
line 36: parse error
atello28 is offline   Reply With Quote

Old   November 5, 2015, 08:23
Default
  #4
New Member
 
atilla savas
Join Date: Oct 2015
Posts: 5
Rep Power: 11
atello28 is on a distinguished road
Dear 'e',

I found the error by myself:

A semicolon was missing after the line F_PROFILE(f,thread,i) = radius*omega*tau

After I corected it, the interpretation was done without errors but this time I encountered the error below. What can it be the reason?

Thank you in advance...

Atilla



C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0\win6 4\3ddp\fl1450s.exe received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
atello28 is offline   Reply With Quote

Old   November 5, 2015, 16:12
Default
  #5
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Looks like Fluent is trying to access something that isn't available. Try compiling the UDF instead of interpreting.
`e` is offline   Reply With Quote

Reply

Tags
ansys 14.5, fluent - udf, parse syntax


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
Error during interpreting UDF for VoF vekh Fluent UDF and Scheme Programming 9 March 12, 2018 02:57
parse error while interpreting udf chem engineer Fluent UDF and Scheme Programming 10 September 18, 2015 10:06
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
Problem with interpreting UDF Boris Kloser Fluent UDF and Scheme Programming 1 December 30, 2009 00:48
parse error with interpreting UDF ivanbuz Fluent UDF and Scheme Programming 2 August 13, 2009 19:29


All times are GMT -4. The time now is 10:49.