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

UDF Problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2005, 17:17
Default UDF Problem
  #1
Jan
Guest
 
Posts: n/a
Hello, I try to get the number of faces for a cell via UDF (function C_NFACES). My code looks like that:

#include "udf.h" DEFINE_PROPERTY(cell_density, cell, thread) { real rho; real temp = C_T(cell, thread); int number = C_NFACES(cell, thread);

rho = 101325/(8.314*temp)*28.966/1000;

return rho; }

Most of it is taken from the Fluent UDF manual. Everything works fine if I delete the line "int number ...". If I write the line to get the number of faces for "cell", I get the following message:

non-integer subscript expression: unsigned char

Could anyone help me to find the mistake? I have nearly given up. I would be thankful for any advice.

Regards Jan
  Reply With Quote

Old   June 22, 2005, 01:07
Default Re: UDF Problem
  #2
Joey
Guest
 
Posts: n/a
The "number" seems do nothing in the UDF. And I can not find anything incorrect. I think there could be something wrong with the code you have not paste here.
  Reply With Quote

Old   June 22, 2005, 01:36
Default Re: UDF Problem
  #3
Jan
Guest
 
Posts: n/a
This is all the code I tried at the moment. Okay, here the "number" is still unused, but I wanted to build up my code step by step. But not even this small code is working. I use interpreted UDFs. May that be the problem?
  Reply With Quote

Old   June 22, 2005, 03:02
Default Re: UDF Problem
  #4
Luca
Guest
 
Posts: n/a
Hi Jan. I compiled your UDF and there's no problem! I suggest always compiling UDFs even if they are quite simple...Luca
  Reply With Quote

Old   June 22, 2005, 07:23
Default Re: UDF Problem
  #5
Jan
Guest
 
Posts: n/a
Thanks for your help. Everything works fine in compiled mode.

Regards Jan
  Reply With Quote

Old   June 27, 2005, 04:05
Default Re: UDF Problem
  #6
zubier
Guest
 
Posts: n/a
i want to know how to model electric field distribution inside a heating cell using voltage and current (ohmic heating) i need help thanks in advance
  Reply With Quote

Old   July 9, 2005, 01:00
Default Re: UDF Problem
  #7
linzhaowei
Guest
 
Posts: n/a
Interpreted UDFs are restricted in the use of the C programming language,but compile not. use interpreted UDFs for small, straightforward functions. use compiled UDFs for complex functions that have a significant CPU requirement (e.g., a property UDF that is called on a per-cell basis every iteration). .
  Reply With Quote

Reply


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 00:31
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 09:58


All times are GMT -4. The time now is 09:43.