CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM

Register Blogs Community New Posts Updated Threads Search

Like Tree33Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2010, 10:52
Default
  #21
Member
 
Join Date: Apr 2010
Posts: 63
Rep Power: 16
saha2122 is on a distinguished road
Send a message via Yahoo to saha2122
i interpret the udf, thats for boundary condition, and so easy!i get this error !!!! can you help me?

cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<udfconfig-host.h>" "D:\saha2\coupled\89.8
11\kaplan-sepBlade.inlet\coarse-meshed\udf-g\design\89-22.5\pen\pressure.outlet.cpp"

error: udf compiler: cannot execute cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<udfco
fig-host.h>" "D:\saha2\coupled\89.8.11\kaplan-sepBlade.inlet\coarse-meshed\udf-g\design\89-22.5\pen\pressure.outlet.cpp"

cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<C:/Users/YAS/AppData/Local/Temp/udfconfig
node0.h>" "C:/Users/YAS/AppData/Local/Temp/pressure.outlet.cpp.0.c"

cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<C:/Users/YAS/AppData/Local/Temp/udfconfig
node1.h>" "C:/Users/YAS/AppData/Local/Temp/pressure.outlet.cpp.1.c"

cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<C:/Users/YAS/AppData/Local/Temp/udfconfig
node2.h>" "C:/Users/YAS/AppData/Local/Temp/pressure.outlet.cpp.2.c"

cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<C:/Users/YAS/AppData/Local/Temp/udfconfig
node3.h>" "C:/Users/YAS/AppData/Local/Temp/pressure.outlet.cpp.3.c"

cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<C:/Users/YAS/AppData/Local/Temp/udfconfig
node4.h>" "C:/Users/YAS/AppData/Local/Temp/pressure.outlet.cpp.4.c"

cpp -I"C:\Fluent6.3.26.Inc\fluent6.3.26/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/client/src" -I"C:\Fluent6.3.26.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<C:/Users/YAS/AppData/Local/Temp/udfconfig
node5.h>" "C:/Users/YAS/AppData/Local/Temp/pressure.outlet.cpp.5.c"
saha2122 is offline   Reply With Quote

Old   February 10, 2011, 16:58
Default Can anyone help with a UDF problem
  #22
New Member
 
Dave Smith
Join Date: Jul 2010
Posts: 27
Rep Power: 16
davesmith_01 is on a distinguished road
When I open a UDF with fluent sometimes it works, I have MS Visual 2008, and open fluent using the command prompt, and using win xp 32bit. And at other times if I copy this UDF to another folder and try and open it again to run another case it crashes and displays this message

'Error: Fluent recieved a fatal signal (segmentation violation).
Error Object: ()'

How can I fix this, I don't understand why it works sometimes only, also most of the time I am recieving this error now.

Dave
davesmith_01 is offline   Reply With Quote

Old   October 17, 2011, 16:06
Default hi
  #23
New Member
 
rohit mukare
Join Date: Aug 2011
Location: rourkela
Posts: 16
Rep Power: 15
rohit.mukare7 is on a distinguished road
i m little bit confused in setting up the environment variable..could you please give me the details of environment variables setting...thanks waiting for ur reply...
rohit.mukare7 is offline   Reply With Quote

Old   January 24, 2012, 10:44
Default UDF Compile Issues
  #24
New Member
 
Khaled
Join Date: Jan 2012
Posts: 3
Rep Power: 14
kmans76 is on a distinguished road
Good morning,

I am trying to compile a UDF library, here are the steps that I take:

Open Visual Studio 2008 x64 Win64 Command Prompt
load VCVARSALLam64
change directory to my directory
launche either fluent 6.3.26 or fluent 12 in command prompt
load batch, properties, sources and tracer files, then load header and build

then when I load i get following error message:

Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified.

Error: open_udf_library: The system cannot find the file specified.
Error Object: #f




looking at the building of the UDF library:

(chdir "libudf")()
(chdir "win64\3ddp")()
# Generating ud_io1.h
batch.c
properties.c
sources.c
..\..\src\sources.c(308) : error C2275: 'Domain' : illegal use of this type as an expression
c:\program files\ansys inc\v120\fluent\fluent12.0.16\src\mem.h(591) : see declaration of 'Domain'
..\..\src\sources.c(308) : error C2065: 'd' : undeclared identifier
..\..\src\sources.c(309) : error C2275: 'Thread' : illegal use of this type as an expression
c:\program files\ansys inc\v120\fluent\fluent12.0.16\src\mem.h(691) : see declaration of 'Thread'
..\..\src\sources.c(309) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(310) : error C2275: 'cell_t' : illegal use of this type as an expression
c:\program files\ansys inc\v120\fluent\fluent12.0.16\src\mem.h(186) : see declaration of 'cell_t'
..\..\src\sources.c(310) : error C2146: syntax error : missing ';' before identifier 'c'
..\..\src\sources.c(310) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : error C2065: 'd' : undeclared identifier
..\..\src\sources.c(319) : error C2223: left of '->c' must point to struct/union
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : warning C4047: '!=' : 'void *' differs in levels of indirection from 'int'
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : error C2223: left of '->next' must point to struct/union
..\..\src\sources.c(322) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(322) : error C2223: left of '->nelements' must point to struct/union
..\..\src\sources.c(322) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(322) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(322) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(324) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(324) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(324) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(325) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(325) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(325) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(326) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(326) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(326) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(327) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(327) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(327) : error C2065: 'c' : undeclared identifier
tracer.c
Generating Code...



cana anyone help? I have set environmental variables and all that stuff with Fluent and MSVS 2009

thanks!
kmans76 is offline   Reply With Quote

Old   January 24, 2012, 10:46
Default
  #25
New Member
 
Khaled
Join Date: Jan 2012
Posts: 3
Rep Power: 14
kmans76 is on a distinguished road
Sorry I forgot to add :

I am running a 64-bit edition of windows XP with Intel Xeon processor
kmans76 is offline   Reply With Quote

Old   January 24, 2012, 12:40
Default
  #26
Member
 
Theodoros Papadopoulos
Join Date: Mar 2011
Posts: 36
Rep Power: 15
papteo is on a distinguished road
Quote:
Originally Posted by kmans76 View Post
Good morning,

I am trying to compile a UDF library, here are the steps that I take:

Open Visual Studio 2008 x64 Win64 Command Prompt
load VCVARSALLam64
change directory to my directory
launche either fluent 6.3.26 or fluent 12 in command prompt
load batch, properties, sources and tracer files, then load header and build

then when I load i get following error message:

Opening library "libudf"...
Error: open_udf_library: The system cannot find the file specified.

Error: open_udf_library: The system cannot find the file specified.
Error Object: #f




looking at the building of the UDF library:

(chdir "libudf")()
(chdir "win64\3ddp")()
# Generating ud_io1.h
batch.c
properties.c
sources.c
..\..\src\sources.c(308) : error C2275: 'Domain' : illegal use of this type as an expression
c:\program files\ansys inc\v120\fluent\fluent12.0.16\src\mem.h(591) : see declaration of 'Domain'
..\..\src\sources.c(308) : error C2065: 'd' : undeclared identifier
..\..\src\sources.c(309) : error C2275: 'Thread' : illegal use of this type as an expression
c:\program files\ansys inc\v120\fluent\fluent12.0.16\src\mem.h(691) : see declaration of 'Thread'
..\..\src\sources.c(309) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(310) : error C2275: 'cell_t' : illegal use of this type as an expression
c:\program files\ansys inc\v120\fluent\fluent12.0.16\src\mem.h(186) : see declaration of 'cell_t'
..\..\src\sources.c(310) : error C2146: syntax error : missing ';' before identifier 'c'
..\..\src\sources.c(310) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : error C2065: 'd' : undeclared identifier
..\..\src\sources.c(319) : error C2223: left of '->c' must point to struct/union
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : warning C4047: '!=' : 'void *' differs in levels of indirection from 'int'
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(319) : error C2223: left of '->next' must point to struct/union
..\..\src\sources.c(322) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(322) : error C2223: left of '->nelements' must point to struct/union
..\..\src\sources.c(322) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(322) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(322) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(324) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(324) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(324) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(325) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(325) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(325) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(326) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(326) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(326) : error C2065: 'c' : undeclared identifier
..\..\src\sources.c(327) : error C2065: 't' : undeclared identifier
..\..\src\sources.c(327) : error C2223: left of '->storage' must point to struct/union
..\..\src\sources.c(327) : error C2065: 'c' : undeclared identifier
tracer.c
Generating Code...



cana anyone help? I have set environmental variables and all that stuff with Fluent and MSVS 2009

thanks!
My perception is that your udf is wrong! you have all these messages that should be first solved in order to build your UDF. Read carefully at which line is the error and what was expected and is given!
papteo is offline   Reply With Quote

Old   January 24, 2012, 13:09
Default
  #27
New Member
 
Khaled
Join Date: Jan 2012
Posts: 3
Rep Power: 14
kmans76 is on a distinguished road
Papteo, thanks for the reply.

The UDF has worked for the person in my position before me. It compiled for him and he was able to get simulation results. However, he is no longer with us so I have tried to recreate any steps he may have tried. Essentially, we have other UDF's that were able to compile using this method, this just adds a 4th source file.

Additionally, I get different errors if I use a different compiler, for example, vcvarsall or vcvars32. The majority of the errors for this one is the 'undeclared identifier', whereas the other have 'syntax error', and they do not occcur together.

Any thoughts or suggested routes to take?
kmans76 is offline   Reply With Quote

Old   July 4, 2012, 03:41
Default UDF not VISIBLE
  #28
New Member
 
Nazir
Join Date: Jun 2012
Posts: 8
Rep Power: 14
Nazir426 is on a distinguished road
my udf regardin simulation of wave generation in tank,is built and loaded successfully, but is not shown in dynamic mesh control? can u guide me?
Nazir426 is offline   Reply With Quote

Old   October 30, 2012, 16:28
Default
  #29
New Member
 
S.M. Tabirul Hassan
Join Date: Oct 2012
Posts: 1
Rep Power: 0
antikk is on a distinguished road
Dear Rizwan
Hi I am antikk.Here is what I did to compile UDF(ansys fluent 13.0) in my XP86 pc
=> I installed(after installation of fluent) VS2010 like you said
C:\Microsoft Visual Studio 10.0\..
but no prompt was displayed asking for command line compiler..no reboot..
=> In the Environment Variables->system variables->path...I set the value
C:\Microsoft Visual Studio 10.0\Common7\Tools;C:\Microsoft Visual Studio
10.0\VC\bin;C:\Program Files\ANSYS Inc\v130\fluent\ntbin\ntx86

=> In fluent.inc when I build my udf.c it gives this message

> Deleted old libudf\ntx86\2d\libudf.dll
1 file(s) copied.
(system "copy "C:\PROGRA~1\ANSYSI~1\v130\fluent"\fluent13.0.0\sr c\makefile_nt.udf "libudf\ntx86\2d\makefile" ")
1 file(s) copied.
(chdir "libudf")()
(chdir "ntx86\2d")()

Done.

then when I press "load" then it says

Opening library "C:\Documents and Settings\antikk\Desktop\dynamic mesh\libudf"...
Error: The UDF library you are trying to load (libudf) is not compiled for 2d on the curent platform (ntx86).
The system cannot find the file specified.
C:\Documents and Settings\antikk\Desktop\dynamic mesh\libudf\ntx86\2d\libudf.dll
Error Object: #f

If I copy any libudf.dll ansys fluent directory(C:\Program Files\ANSYS Inc\v130\fluent\fluent13.0.0\addons\adjoint\ntx86\ 2d) and try to load then it says..

Opening library "C:\Documents and Settings\Anik\Desktop\try12\dynamic mesh\udf compile test\libudf"...
Library "C:\Documents and Settings\antikk\Desktop\dynamic mesh\libudf\ntx86\2d\libudf.dll" opened
dasSolutionReset
dasInitialize
dasIsStale
dasAdvance
dasUpdateShape
dasCheckShapeStatus
dasGradient
dasModify
dasCostValue
dasReport
dasGetResidualHistory
residualHistoryWriter
residualHistoryReader
resetting
updating
locations
adjustAll
reset
morphExpectedChange
getControlBB
printVersion
countMemoryLocations
naming
meshQuality
meshAdvance
meshReport
runTest
Done.

What should I do now?
Can you HELP? PLEASE...
........my apology for this lengthy post
antikk is offline   Reply With Quote

Old   January 29, 2013, 02:55
Default
  #30
New Member
 
mohamed
Join Date: Jul 2012
Location: Pune
Posts: 1
Rep Power: 0
mohamed s is on a distinguished road
plz check your mesh and geometry
mohamed s is offline   Reply With Quote

Old   March 21, 2014, 06:34
Smile WINDOWS SDk
  #31
Member
 
Nazim
Join Date: Oct 2013
Posts: 93
Rep Power: 13
shahid nadeem is on a distinguished road
Quote:
Originally Posted by coalgas View Post
Hello everyone,
I saw some of our friends are looking for complete Visual Studio. I am using Visual C++ 2008 Express Edition, which is available for free and works perfect to compile UDF's.

regards
Chetan
whether windows SDK is not required
shahid nadeem is offline   Reply With Quote

Old   May 8, 2015, 06:29
Default What About SDK
  #32
Member
 
Nazim
Join Date: Oct 2013
Posts: 93
Rep Power: 13
shahid nadeem is on a distinguished road
Dear Rizwan bhai,
What about the Windows SDK in one of the post i saw that Windows SDK has to be installed and Fluent has to be opened through Windows SDK. SO as per your advice no need to open fluent through SDK we can open it directly?
shahid nadeem is offline   Reply With Quote

Old   May 8, 2015, 07:05
Default
  #33
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
I tried that part but did not work for me. Install SDK your fluent will run smoothly.
cheers

shiv
shivakumar is offline   Reply With Quote

Old   February 16, 2017, 03:40
Default
  #34
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 12
SJSW is on a distinguished road
I found some information from a file "ANSYS FLUENT GUIDE Advanced FLUENT User-Defined Functions(2011)".

21.2 How to Set Environment Variables
21.2.1 On Windows 32 Bit
• If you are using Windows 32 bit, it’s better to install Visual Studio 2005 (Just install Visual C++, deselect other components)
• Then, Go to this address: “C:\Program Files\Microsoft Visual Studio\VC98\bin\”
• Double click “VCVARS32.BAT”
• Then go the FLUENT install address: “C:\fluent.inc\ntbin\ntx86\”
• And double click “setenv.exe”
21.2.2 On Windows 64 Bit
• If you are using Window 64 Bit, it’s better to install Visual Studio 2008 (Just install Visual C++, deselect other components)
• Then, Go to this address: “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\” ------> This may be wrong. It could be "...\amd64".
• Double click “vcvars32.BAT” ------> This may be wrong. It could be "vcvars64.BAT".
• Go to the FLUENT install add: “C:\Program Files\ANSYS Inc\v121\fluent\ntbin\win64\”
• And double click “setenv.exe”
SJSW is offline   Reply With Quote

Old   March 2, 2017, 05:03
Default
  #35
New Member
 
Join Date: Dec 2015
Location: Japan
Posts: 25
Rep Power: 10
kywong5 is on a distinguished road
Hi all, I face this error while compiling the UDF.

Error:
The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The operation completed successfully.
C:\Users\0wner\Desktop ry ken\libudf\win64\3d_host\libudf.dll


Could I know how to solve it? Thank you.
kywong5 is offline   Reply With Quote

Old   March 2, 2017, 05:10
Default
  #36
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 12
SJSW is on a distinguished road
RPHOST?

Please refer to: ANSYS Help→ Fluent→Customization Manual→ I. Creating and Using User Defined Functions→Parallel Considerations
SJSW is offline   Reply With Quote

Old   March 2, 2017, 08:12
Default
  #37
New Member
 
Join Date: Dec 2015
Location: Japan
Posts: 25
Rep Power: 10
kywong5 is on a distinguished road
Dear SJSW,
Thank you for your respond. But when I run it with serial, the same problem was encountered. The error as below:

The UDF library you are trying to load (libudf) is not compiled for 3d on the curent platform (win64).
The system cannot find the file specified.

c:\users\0wner\desktop ry ken\libudf\win64\3d\libudf.dll

At the moment, I think Im facing compiling issue with Window 10. Same approach goes well with Window 7. But not working on Window 10. I have installed Visual Studio 15 and NetFramework 4.5.1.

Looking forward for the kind advise.
kywong5 is offline   Reply With Quote

Old   March 2, 2017, 09:58
Default
  #38
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 12
SJSW is on a distinguished road
I installed VS2015(including c compiler) after ANSYS17 in Win10.
I didn't set up anything after installation.
They worked well.
In this way, I don't know what is wrong about your installation. @@
kywong5 likes this.
SJSW is offline   Reply With Quote

Old   June 2, 2017, 05:23
Default Ansys udf-silidification problem
  #39
New Member
 
Ibrahim Isah
Join Date: May 2017
Posts: 2
Rep Power: 0
isah is on a distinguished road
I am working on a solidification project, I want 2 stir the molten metal for 5mins then stop the rotating region from rotating, then open d gate (i.e after 5mins of stir) so that the molten metal can flow out. I want 2 also control d mass flow rate of the solid metal at inlet such that I will introduce it within first 2 mins of impeller rotation i.e first 2 mins of stir.

Pls, I need help in writing d script for
1) d impeller or stirrer motion
2)d gate ctrl
3)mass flow ctrl
The total mass of metal is 10kg
Attached Images
File Type: jpg IMG_20170528_142428.jpg (60.5 KB, 17 views)
isah is offline   Reply With Quote

Old   October 18, 2017, 08:17
Default
  #40
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 9
anuarun is on a distinguished road
Quote:
Originally Posted by Rizwan
;140250
Step 1. if fluent is already intalled, the default folder is C:\FLUENT.INC if you dint change it when u install it on your computer. there is nothing to disturb fluent. leave it as it is.

Step 2a. Install Microsoft Visual Studio (written MSVS from now on) (with all components including MSDN and .net, .bat and not just VC++ I repeat not JUST VC++. the express edition of MSVC++ has only debugger and not compiler and will not serve the purpose of compiling fluent udf's). MSVS will take around 500 to 700 mb space of ur hard disk but its worth.

Step 2b. But the default folder will be C:\Program files\Microsoft Visual studio (x.x edition)\...., change this to C:\Microsoft Visual studio (x.x edition)\.....

Step 3. While u r installing, a promt is displayed asking to chek an option if you want to have command line comiler etc..., chek the box (MOST IMPORTANT chek the box). Doing this enables command line compiler and Fluent needs and searches only for this. It has to find this command line compiler to compile udfs.

Step 4. If the system asks for rebooting/restarting the system for the setup to take effect, do it.

Step 5. Now after the system reboots, right click my computer ---> properties ----> advanced tab. on the bottom part u have environment variables and system variables.

Step 5a. In the environment vairable add the variable for MSVS along wiht the fluent, and add path (same as that set in step 2b) also along with fluent path separtated by a semicolon.

Step 5b. To carry out this step, u need to have administrative rights for the computer u r using. In the system variables panel add the same path (generally on installing this is added for MSVC, chek to make sure that this is added). In the system varaibles path also follwo step 5a.

Step 6: Reset environment variables for fluent once again. (Start Menu ---- > Program Files----> Fluent.Inc----->Set environment)

That's it and u r done with this..
Hi friends,
Since this is a very old post, I would like to add few more points for the new users. I was stuck with compilation error for almost two weeks.
Initially I had an nmake error(most common error) which got solved by setting the system variables correctly. Then compiler showed that my header files are missing. Here is my solution to the problem. (Depending on the platform, windows edition and MSVS edition, this solution may slightly change here and there.)
For reducing post length, I am not repeating the steps Rizwan already told.

Step1: no change

Step2a edit: the latest versions of MSVS (for eg, VS community edition 2017) will take more than 10GB space. Since I did not know which files are required/not required, I downloaded all components (including optional files)which took 34GB space. If you are a programming expert, you may optimize the size on disc.

Step2b edit: not required to change default path.

step3 edit:No popups/prompts asking to check command line compiler in new versions of MSVS(i do not know about versions older than 2017).

Step4,5,6 : no change

Step7: Go to windows desktop and search for MSVS command prompt. Open VS2015x64 native tools command prompt(This will depend on your installed MSVS version,OS platform and the processor)

Step8: check whether command prompt opens normally. In my case, it showed some error in script usage as

"Error in script usage.The correct usage is C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat[option]"
This is an issue with the latest MSVS edition. This error may also also come while upgrading from older to newer versions of MSVS. If latest installed/ upgraded MSVS version is 2017 on a 64-bit OS x64 processor, then run this.

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat

This will set all environment variables correctly. If not 64-bit OS x64 processor, then try running batch files(.bat) similar to "vcvars64.bat" available in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC.
(MSVS 2017 edition got installed in MSVS 14.0 folder and the command prompt will be shown as VS2015. Some mysterious way in which microsoft works. I am not a programming expert to tell you why )

step9: You will now be in the folder

C:\Program Files (x86)\Microsoft Visual Studio 14.0
come out of all sub folders and go to the fluent folder and launch fluent as

C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64>fluent.exe

Step10: Fluent launcher will pop up.

Change the working directory to your directory. Go to environment tab and make sure that you have the following as your path
C:\Program Files\ANSYS Inc\v150<your version>\fluent\ntbin\win64\udf.bat

Check the box>>set up compilation environment for UDF

Launch fluent.

Step:11 Compile your UDF as usual.
Add udf file. Make sure that you delete your "libudf "folder from previous attempts from working directory before building.

While building, if it shows that some "*.h"(eg, stdio.h is not a programmable file) files are missing, then you need to add one more path to the system variables.
C:\Program Files (x86)\Windows Kits\10\Include
Because, in latest MSVS editions, the header files are separately put in this folder.
Now, repeat steps 7-11.

Library will be successfully build.
After build, load it.

Thats it. Now you can run your case file. It does not matter whether you read case/data file before/ after compilation.
Hope it helps someone.
Oula likes this.

Last edited by anuarun; October 18, 2017 at 09:10. Reason: General solution
anuarun is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Compiled UDF problem 4 Wave tank tutorial Shane FLUENT 1 September 3, 2010 03:32
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 07:56
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 14:24
UDF compile problem ak6g08 Fluent UDF and Scheme Programming 2 June 25, 2009 07:56
dynamic mesh and udf problem boboroo FLUENT 1 January 20, 2008 22:26


All times are GMT -4. The time now is 21:10.