|
[Sponsors] |
August 31, 2006, 16:34 |
Interepreted Vs. Compiled UDFs
|
#1 |
Guest
Posts: n/a
|
Hi all.
I have created a UDF using a DEFINE_ADJUST routine, and I don't know if it's supposed to be an interpreted or a compiled one. Is there a general rule for how to tell when a UDF is compiled or interpreted? Thanks in advance for your answers! |
|
August 31, 2006, 18:26 |
Re: Interepreted Vs. Compiled UDFs
|
#2 |
Guest
Posts: n/a
|
Interpreting a UDF source file (example.c)
The UDF source file (example.c) must be in the same directory that contains your case (e.g., example.msh). After start FLUENT and read your case file (example.msh): Define â€" User-Defined â€" Functions â€" Interpreted In the Interpreted UDFs panel select the UDF source file (example.c) The next step is to set the Use Contributed CPP and click Interpret. Fluent diplay a message of the interpreted UDF source file. Close the Interpreted UDFs panel when the interpreter has finished The proceder to Interpreted UDF is the same in the Windows and LINUX, but to compile in the Windows system it is necessary the C+ sotfware and service pack 2. In FLUENT user guide chapter 8.2 you can see the steps TO compile UDF source file. In my opinion Interpreted UDF it is easier than Compiled UDF, however the Compiled UDF runs faster. |
|
August 31, 2006, 20:46 |
Re: Interepreted Vs. Compiled UDFs
|
#3 |
Guest
Posts: n/a
|
Thanks for your reply!
I'm a bit confused though, because in the udf manual i read an example for DEFINE_ADJUST that can be used as interpreted OR compiled, and another example again for DEFINE_ADJUST that can be ONLY used as compiled? I was wondering if there is a rule to know this difference |
|
September 1, 2006, 06:19 |
Re: Interepreted Vs. Compiled UDFs
|
#4 |
Guest
Posts: n/a
|
for more advice take a look at
http://www.fluentusers.com/fluent/do...etedVSCompiled I suspect it is not the 'name' or 'type' of the macro that creates the intepret or compile issue but rather the code that is contained 'within' the macro / UDF. Compare the UDF's you are referring to and you will probably find the line(s) that the interprter cannot handle hence the need to compile. Hope this helps |
|
September 1, 2006, 10:28 |
Re: Interepreted Vs. Compiled UDFs
|
#5 |
Guest
Posts: n/a
|
Thanks for your reply.
Unfortunately I don't have acces to the fluent support website as I am a student... Is it possible to give an example? |
|
September 1, 2006, 13:35 |
Re: Interepreted Vs. Compiled UDFs
|
#6 |
Guest
Posts: n/a
|
Which examples were you initially referring to that prompted this question?
|
|
September 1, 2006, 14:11 |
Re: Interepreted Vs. Compiled UDFs
|
#7 |
Guest
Posts: n/a
|
I was going through the UDF manual, and for the DEFINE_ADJUST there are two examples. For the first one it's mentioned that is used as an interpreted, and the second one only as compiled (the second one uses UDS, maybe that's why)
I want to define a von Neumann condition with a DEFINE_ADJUST function. |
|
September 6, 2006, 05:18 |
Re: Interepreted Vs. Compiled UDFs
|
#8 |
Guest
Posts: n/a
|
Differences Between Interpreted and Compiled UDFs
The major difference between interpreted and compiled UDFs is that interpreted UDFs cannot access FLUENT solver data using direct structure references; they can only indirectly access data through the use of Fluent-supplied macros. This can be significant if, for example, you want to introduce new data structures in your UDF. A summary of the differences between interpreted and compiled UDFs is presented below. See Chapters 7 and 8 for details on interpreting and compiling UDFs, respectively, in FLUENT. * Interpreted UDFs o are portable to other platforms. o can all be run as compiled UDFs. o do not require a C compiler. o are slower than compiled UDFs. o are restricted in the use of the C programming language. o cannot be linked to compiled system or user libraries. o can access data stored in a FLUENT structure only using a predefined macro (see Chapters 5 and 6). * Compiled UDFs o execute faster than interpreted UDFs. o are not restricted in the use of the C programming language. o can call functions written in other languages (specifics are system- and compiler-dependent). o cannot necessarily be run as interpreted UDFs if they contain certain elements of the C language that the interpreter cannot handle. In summary, when deciding which type of UDF to use for your FLUENT model * use interpreted UDFs for small, straightforward functions. * use compiled UDFs for complex functions that o have a significant CPU requirement (e.g., a property UDF that is called on a per-cell basis every iteration). o require access to a shared library. |
|
September 6, 2006, 06:50 |
Re: Interepreted Vs. Compiled UDFs
|
#9 |
Guest
Posts: n/a
|
Thanks!
That cleared things a lot! Antonis |
|
October 18, 2012, 01:08 |
von neumann
|
#10 |
New Member
nadesan
Join Date: Oct 2012
Posts: 11
Rep Power: 14 |
Hi antonis, could you please let me know that the von neumann boundary condition i created is correct. The boundary condition is created for a 2D serial fluent code on the top wall.
#include "udf.h" DEFINE_ADJUST(von_neumann,d) { face_t f; cell_t c; Thread *t; begin_f_loop(f,t) { c0=F_C0(f,t); t0=THREAD_T0(t); F_U(f,t)=C_U(c0,t0); } end_f_loop(f,t) } When i am trying to hook the udf to the wall, it is asking for the shear stress, how should i define the boundary in order to hook the udf. Your help is much appreciated. Thank you Rgds nadesan |
|
March 22, 2018, 12:15 |
|
#11 | |
New Member
David
Join Date: Nov 2017
Posts: 14
Rep Power: 9 |
Quote:
I am tryting to define a neumann boundary for y-velocity at a top symmetry boundary with UDF. I am wondering whether you have solved your problem. Any insights would be appreciated. Thanks Dv |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiled UDFs - questions | Antonis | FLUENT | 6 | December 26, 2012 07:12 |
Using compiled UDF:s in different Fluent versions | S H | FLUENT | 1 | September 12, 2007 04:40 |
accessing udf_library for compiled udf's | Asghari | FLUENT | 0 | August 9, 2006 05:41 |
compiled UDFs | Jianli | FLUENT | 5 | December 14, 2004 04:20 |
Compiled UDFs | Devin | FLUENT | 4 | October 28, 2003 21:47 |