|
[Sponsors] |
March 7, 2011, 15:43 |
Error in compiling UDF
|
#1 |
New Member
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16 |
Hello.
Im using some functions in my udf that can only be compiled and not interpreted. But i cannot compile my udf.. Im working on Win7 (32bit), Fluent 6.3.26. I have already installed Microsoft Visual Studio on my machine. I have the source file (.c file) in the same directory as the the case and data files. First, in the 'Compiled UDFs' panel, do i need to add 'udf.h' under 'Header files' tab ?? On hitting the 'Build' button, i am getting the following message on the console window: Deleted old libudf\ntx86\2d\libudf.dll The system cannot find the file specified. (system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\2d\makefile") 1 file(s) copied. (chdir "libudf")() (chdir "ntx86\2d")() Done. Can anyone pls help me and tell me what i need to do to compile a UDF.. Thanks. |
|
March 7, 2011, 16:13 |
|
#3 |
New Member
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16 |
||
March 7, 2011, 17:10 |
|
#4 |
Senior Member
|
first you should include FLUENT to your environment by using this:
"~\Program Files\Fluent\ntbin\ntx86\setenv.exe" for some versions of VC, libraries of VC were included to your environment while installing for these cases the above step is enough. if your problem didn't resolved, you should also include VC libraries to your path and for this purpose you have 2 choices: 1) launch FLUENT from VC command prompt 2) refer to my blog in this forum to manually include VC libraries. Regards, Amir |
|
March 8, 2011, 04:34 |
|
#5 |
New Member
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16 |
thanks Amir..
that problem was dealt with. now there is a new one : LINK : fatal error LNK1104: cannot open file 'kernel32.lib' i see a lot of people hav this problem, but none of the solutions worked for me.. kindly help me out again. thanks |
|
April 19, 2011, 05:56 |
Define_adjust
|
#7 |
New Member
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16 |
hey amir.. thanks for resolving my previous problem. i am afraid m facing a new one.
as i understand define_adjust can be "used to adjust or modify FLUENT variables that are not passed as arguments". in my 3phase eularian simulation i am required to modify the volume fractions of the two secondary phases, keeping the volume of primary phase same. i have done the calculation as required in define_execute_at_end, to compute how much do the volume fractions change and hence correctly computed the value of global variables 'vf1' and 'vfpr'. my adjust macro: Code:
DEFINE_ADJUST(mt,d) { Thread *t; cell_t c; real volf1, volf2, volf3; real xc[ND_ND]; if (counter == 1) { thread_loop_c(t,d) { begin_c_loop(c,t) { Thread *fr = THREAD_SUB_THREAD(t,1); //1st secondary phase Thread *to = THREAD_SUB_THREAD(t,2); //2nd secondary phase volf1 = C_VOF(c,fr); volf2 = C_VOF(c,to); volf3 = 1-(volf1+volf2); //primary phase volume frac. if(volf1 > 0.01) { C_VOF(c,fr) = volf1 * vf1/vfpr; //modifying the vol.fr. of 1st sec. phase volf1 = C_VOF(c,fr); C_VOF(c,to) = 1-(volf1+volf3); //adjusting the vol. fr. of 2nd sec. phase, keeping the sum of volume fractions unity. volf1 = C_VOF(c,fr); volf2 = C_VOF(c,to); C_CENTROID(xc,c,t); Message("%g\t%g",xc[0],xc[1]); Message("\t%g %g\n",volf1,volf2); } } end_c_loop(c,t) } } } When the variables are printed from the udf, they do seem to get modified as required by the problem. But returning to solver at the end of iteration/timestep, the variables show no change when viewed as contours or even when accessed by define_execute_at_end macro. What might be the problem in modifying the variables ?? Is there anything wrong in what i am trying to do? Please suggest an alternative. Can you please help me.. Regards. |
|
April 19, 2011, 09:20 |
|
#8 |
Senior Member
|
Hi,
if you want to do your desired modifications once, at the end of your calculation, I propose you to use another macro, DEFINE_ON_DEMAND, that may help you to implement your modifications when ever you want by executing this macro. |
|
Tags |
fluent compile udf error |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
About UDF compiling issues: 'nmake' | Haoyin Shan | Fluent UDF and Scheme Programming | 15 | November 4, 2019 19:05 |
compiling udf at window Nt(64BIT) | noa | FLUENT | 3 | July 30, 2014 00:01 |
UDF compiling problem in Flient 6.3 | jeevan kumar | FLUENT | 2 | February 25, 2009 01:43 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 08:14 |
On Compiling a UDF | David Chabot | FLUENT | 5 | May 20, 2005 10:13 |