CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to read data into my UDF??? (https://www.cfd-online.com/Forums/fluent/41384-how-read-data-into-my-udf.html)

Harshit Gupta June 14, 2006 08:41

How to read data into my UDF???
 
Hi,

Is there any way we can read data from console into our UDF(execute on demand udf, for example)???

like for example, the way we do by using scanf (and printf) in simple C programming??

i tried using scanf in my UDF to try and read from console, but it just hangs in runtime everytime i try to do so...

but if i try to print onto the console(using prinf()), it is working fine...

or is there any other way in FLUENT to read data into our UDF in runtime???

Thanks in advance.

Aidan June 14, 2006 10:32

Re: How to read data into my UDF???
 
you can use User-Defined Scheme Variables. section 6.8 in the udf manual. i have found them to be very slow though if u are calling them a lot in the udf.

Harshit Gupta June 14, 2006 12:06

Re: How to read data into my UDF???
 
thanx a lot...it worked for me....:)

but is this the best possible way??? isn't there any other method which is more 'user-friendly'...where the user(different from the programmer) just have to type in the values asked, instead of remembering the command everytime he needs to change the value of the variable.

Thanx...

rom June 15, 2006 03:34

Re: How to read data into my UDF???
 
Yes its the only possible way (i am not saying that its good) because the cortex (TUI/GUI written in scheme) and the fluent solver (written in C) are not directly coupled. Benefits are that you can use different front ends (classic Fluent TUI/GUI, Flowizard, Fluent for Catia...) for the same solver, the problem is the complicated coupling between solver and front end.

RoM


All times are GMT -4. The time now is 04:47.