|
[Sponsors] |
November 3, 2015, 15:35 |
error while interpreting a udf
|
#1 |
New Member
atilla savas
Join Date: Oct 2015
Posts: 5
Rep Power: 11 |
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 |
|
November 3, 2015, 16:50 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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;".
|
|
November 5, 2015, 07:54 |
|
#3 |
New Member
atilla savas
Join Date: Oct 2015
Posts: 5
Rep Power: 11 |
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 |
|
November 5, 2015, 08:23 |
|
#4 |
New Member
atilla savas
Join Date: Oct 2015
Posts: 5
Rep Power: 11 |
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. |
|
November 5, 2015, 16:12 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Looks like Fluent is trying to access something that isn't available. Try compiling the UDF instead of interpreting.
|
|
Tags |
ansys 14.5, fluent - udf, parse syntax |
|
|
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 |