|
[Sponsors] |
June 21, 2005, 17:17 |
UDF Problem
|
#1 |
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 |
|
June 22, 2005, 01:07 |
Re: UDF Problem
|
#2 |
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.
|
|
June 22, 2005, 01:36 |
Re: UDF Problem
|
#3 |
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?
|
|
June 22, 2005, 03:02 |
Re: UDF Problem
|
#4 |
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
|
|
June 22, 2005, 07:23 |
Re: UDF Problem
|
#5 |
Guest
Posts: n/a
|
Thanks for your help. Everything works fine in compiled mode.
Regards Jan |
|
June 27, 2005, 04:05 |
Re: UDF Problem
|
#6 |
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
|
|
July 9, 2005, 01:00 |
Re: UDF Problem
|
#7 |
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). .
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |