|
[Sponsors] |
Windows Environment variables- to solve problems in compiling UDF in Fluent |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 26, 2014, 21:42 |
|
#21 |
New Member
Nguyen Duc Thuyen
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
@adi.ptb
Thank you for reply, it worked. Computer --> Properties --> Avandced system setting --> Evironment Variables --> User variables for... --> New... 1. INCLUDE: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include;C:\Program Files\Microsoft SDKs\Windows\v7.1\Include 2. LIB: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64 3. Path: C:\Windows\System32;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files\ANSYS Inc\v150\fluent\ntbin\win64 Regards |
|
December 15, 2014, 20:54 |
|
#22 | |
New Member
Renato Venturatto Junior
Join Date: May 2014
Posts: 18
Rep Power: 12 |
Quote:
These are my Environmental variables: INCLUDE= C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include;C:\Program Files (x86)\Windows Kits\8.1\Include LIB=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64;C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64 Path=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;C:\Program Files\ANSYS Inc\v150\fluent\ntbin\win64 Still not working for me. Error: LINK : fatal error LNK1104: cannot open file 'kernel32.lib' PLEASE guys, help me! |
||
December 15, 2014, 21:10 |
|
#23 |
New Member
Renato Venturatto Junior
Join Date: May 2014
Posts: 18
Rep Power: 12 |
Also tried to add C:\Windows\System32; to the path variable. Not working yet...
|
|
December 16, 2014, 04:25 |
|
#24 | |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Quote:
I have tried windows-8 and installed Ansys-15 without any problem. I dont remember the exact steps now. I used windows-8 for a very short time (only couple of days) and then switched to windows-7 again. |
||
December 16, 2014, 06:47 |
|
#25 |
New Member
Renato Venturatto Junior
Join Date: May 2014
Posts: 18
Rep Power: 12 |
vasava,
The directories do exist. I searched for the adresses in the windows explorer and just copied them to the environmental variables.But it is not working! Did you run Fluent from GUI or from the Windows SDK prompt? |
|
December 16, 2014, 08:35 |
|
#26 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Well I had a case with UDF (with velocity profile and viscosity model) that I could run without any problem. But I dont remember if I used SDK to start fluent.
Anyways here are steps that I followed (both installation on win-7 and 8) along with links where I downloaded files. Hope they help. Step-1: Install visual studio 2008 from DVD. Step-2: Install .NET 4 from Microsoft website. Step-3: Install SDK. Download from following link. http://download.microsoft.com/downlo...DKX_EN_DVD.iso http://www.mydigitallife.info/window...download-link/ If your operating system language is not English then SDK may behave strangely. Last edited by vasava; December 16, 2014 at 08:36. Reason: Wrong link |
|
December 18, 2014, 03:13 |
|
#27 |
New Member
Nguyen Duc Thuyen
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
Hi everybody!
I haven't been work Windows 8 so that I don't know Environmental variables in Windows 8. Now, I don't work UDF in Fluent, i have Fortran in CFX. Please! |
|
December 18, 2014, 03:44 |
|
#28 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Here is a link to some other post which might help.
http://www.cfd-online.com/Forums/flu...tml#post524392 |
|
December 19, 2014, 09:50 |
|
#29 |
New Member
Renato Venturatto Junior
Join Date: May 2014
Posts: 18
Rep Power: 12 |
Thank you for the answers!
Finally I did it! Please see below the variables I used in Windows 8.1. The path to adjust the variables: Control Panel/System and Security/System;Advanced System Settings/Environment Variables;System Variables The Variables: INCLUDE=C:\Program Files (x86)\Windows Kits\8.1\Include;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include LIB=C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\lib;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\arm LIBPATH=C:\Windows\Microsoft.NET\Framework64\v4.0. 30319;C:\Windows\Microsoft.NET\Framework64\v2.0.50 727;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\lib;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\arm Path=C:\ProgramData\Oracle\Java\javapath;C:\Progra m Files\ANSYS Inc\v150\fluent\ntbin\win64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64;C:\Windows\Microsoft.NET\Framewo rk64\v4.0.30319;C:\Windows\Microsoft.NET\Framework 64\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcpackages;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\bin;C:\Windows\System32 Hope it helps! Renato. |
|
March 10, 2015, 04:11 |
|
#30 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
I have set the environment variables but getting the error like this.. What is the problem?. I would be thankful to you..
Deleted old libudf\win64\2ddp\libudf.dll 1 file(s) copied. Copied G:\shivakumar\shiva\RAE2822 ow_on/G:\shivakumar\shiva\RAE2822 ow_on\shock_sensor.c to libudf\src (system "copy "C:\PROGRA~1\ANSYSI~1\v140\fluent"\fluent14.0.0\sr c\makefile_nt.udf "libudf\win64\2ddp\makefile" ") 1 file(s) copied. (chdir "libudf")() (chdir "win64\2ddp")() # Generating ud_io1.h shock_sensor.c ..\..\src\shock_sensor.c(11) : error C2143: syntax error : missing ';' before 'type' ..\..\src\shock_sensor.c(12) : error C2143: syntax error : missing ';' before 'type' ..\..\src\shock_sensor.c(18) : error C2065: 'velocity' : undeclared identifier ..\..\src\shock_sensor.c(19) : error C2065: 'f_shock' : undeclared identifier ..\..\src\shock_sensor.c(19) : error C2065: 'velocity' : undeclared identifier ..\..\src\shock_sensor.c(19) : error C2297: '*' : illegal, right operand has type 'real [2]' ..\..\src\shock_sensor.c(19) : warning C4047: 'function' : 'int' differs in levels of indirection from 'real [2]' ..\..\src\shock_sensor.c(19) : warning C4024: 'abs' : different types for formal and actual parameter 1 ..\..\src\shock_sensor.c(21) : error C2065: 'f_shock' : undeclared identifier ..\..\src\shock_sensor.c(23) : error C2440: '=' : cannot convert from 'void (*)(void)' to 'real' Done. Thanks in advance.. |
|
March 10, 2015, 05:41 |
|
#31 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
I think these errors are due to problems with your UDF and has nothing to do with compilation.
|
|
March 10, 2015, 06:56 |
|
#32 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Thanks for the reply. I tried to code the shock sensor algorithm which is attached below but getting errors like that..
Here is the code. #include "udf.h" #define A 340.26 DEFINE_ON_DEMAND(shock_sensor) { Domain *d; Thread *t; cell_t c; d=Get_Domain(1); real f_shock, velocity; thread_loop_c(t,d) { begin_c_loop(c,t) { velocity=(C_U(c,t)+C_V(c,t)); f_shock = (velocity*C_P_G(c,t))/(A*abs(C_P_G(c,t))); if(f_shock>=1) { C_UDMI(c,t,0)=f_shock; } } end_c_loop(c,t) } } Any help would be appreciated Thanks in advance |
|
March 10, 2015, 07:07 |
|
#33 |
New Member
Renato Venturatto Junior
Join Date: May 2014
Posts: 18
Rep Power: 12 |
I agree with vasava,The errors you are getting have nothing to do with compilation or environment variables.Some easy ones to solve are The missing ; (just add it to the end of the command in the line showed between parêntesis).Another one are the variables like 'velocity' that are being used without previous declaration.
Try to look up for threads for each error and go to the line to solve it. Good luck! |
|
March 10, 2015, 13:14 |
|
#34 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Thanks for your reply.. you are right, little problem in UDF not in the compilation.
|
|
March 21, 2015, 08:44 |
|
#35 |
New Member
reza erfani
Join Date: Dec 2014
Posts: 3
Rep Power: 12 |
hi friends
I want to compile a udf and followed above steps but when I want to load it it gives this error: %1 is not a valid win32 application please help me. what is wrong? thanks |
|
March 23, 2015, 01:53 |
|
#36 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Post your UDF and we can have a look at it.
|
|
March 25, 2015, 18:54 |
|
#37 |
Member
Join Date: Mar 2015
Posts: 30
Rep Power: 11 |
i've just solved the problem, make sure you type all the path in the right position. If yes, go to "C:\Program Files\ANSYS Inc\v145\fluent\ntbin\win64" find a file named "udf", open it with note pad. In row 10, change the path "set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 11.0" to your current activated VS version. and i think that'll do. If no, please contact me.
|
|
March 30, 2015, 06:25 |
|
#38 |
New Member
reza erfani
Join Date: Dec 2014
Posts: 3
Rep Power: 12 |
||
April 13, 2016, 09:43 |
|
#39 |
New Member
Join Date: Apr 2016
Posts: 1
Rep Power: 0 |
@tandeem
Did you ever find a solution that worked for you on this issue? (never mind, I now see the response thread) Last edited by mbaldwin8; April 13, 2016 at 09:50. Reason: new to forums- just saw all responses |
|
May 18, 2016, 11:33 |
|
#40 |
New Member
Apiano Morais
Join Date: Apr 2016
Posts: 10
Rep Power: 10 |
It worked well, since I added the xcopy.exe path too.
|
|
Tags |
compiling, udf |
|
|
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 |
UDF to record FLUENT Solver variables... | mariachi | Fluent UDF and Scheme Programming | 11 | September 24, 2019 01:07 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
64bit error compiling UDF : divergence detected | UtoS_99 | FLUENT | 7 | March 29, 2011 04:19 |
UDF to record FLUENT solver variables... | mariachi | FLUENT | 1 | February 3, 2010 23:18 |