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

offset: undeclared variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2020, 18:28
Default offset: undeclared variable
  #1
New Member
 
Join Date: Feb 2020
Posts: 1
Rep Power: 0
dakun is on a distinguished road
hi everybody,
I have some problem with compiling my udf.
when I want to load the udf, this error apears:

"Error: C:/Users/wswwd/AppData/Local/Temp/udf code.c.4708.0.c: line 83: offset: undeclared variable"
I don't know how to fix it
please help me,
thank you very much.

Last edited by dakun; March 13, 2020 at 22:29.
dakun is offline   Reply With Quote

Old   February 21, 2020, 00:40
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
if this is full code, than remove line 83
Code:
offset=Reserve_User_Scalar_Vars(3);
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   February 21, 2020, 15:13
Default Declaration
  #3
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
As suggested, it can simply be removed if this is the only library using the UDMs. However, if you wish to use it, may be in the future, the variable offset needs to be declared and initialized. This is not a Fluent defined variable. It is another C variable defined by the user and can have any name within the constraints specified by the language and Fluent. To declare and initialize, use the following command

static int offset = UDM_UNRESERVED;

Do note that this needs to be defined as a global variable, therefore, has to be outside DEFINE_ functions. If it is not global, other library or function will not be able to read it and that renders its objective futile.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
compile, udf, undeclared variable


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
Compilation Error vizvaz Fluent UDF and Scheme Programming 2 January 6, 2017 04:19
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 07:11
Errors in UDF shashank312 Fluent UDF and Scheme Programming 6 May 30, 2013 20:30
emag beta feature: charge density charlotte CFX 4 March 22, 2011 09:14
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 20:09


All times are GMT -4. The time now is 16:48.