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

What compilers can we use in Ansys Fluent to compile our UDF?

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 2 Post By blackmask
  • 1 Post By pakk
  • 1 Post By gearboy
  • 1 Post By gearboy
  • 1 Post By gearboy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 1, 2018, 14:31
Question What compilers can we use in Ansys Fluent to compile our UDF?
  #1
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Guys,
I think title of the thread is clear that what's my question.

What compilers can we use in Ansys Fluent to compile our UDF?
I read something about compiling UDF e.g.:


https://www.sharcnet.ca/Software/Ans...compilers.html


But for Windows OS they just talk about Microsoft visual studio. I'm using Ansys 19 and my OS is windows. Can I use other compilers? for example GCC?
Roh is offline   Reply With Quote

Old   September 1, 2018, 23:37
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
The answer is YES. However you might need to manually write your own Makefile or build the dynamic library by hand. Believe it or not, it is not worth it. It is much easier to work under *nix, rather than mock the process in win*.
Roh and SphericalCube like this.
blackmask is offline   Reply With Quote

Old   September 3, 2018, 04:38
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by blackmask View Post
The answer is YES.

To be clear: this is the answer to the question "Can I use other compilers?"


And I agree with blackmask. It is possible to use other compilers in Windows, but if you have to ask this question, you will need a lot of help to set everything up so that it really works, and it is much easier to just use the (freely available) Microsoft compiler.
Roh likes this.
pakk is offline   Reply With Quote

Old   September 10, 2018, 01:24
Default
  #4
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by Roh View Post
Guys,
I think title of the thread is clear that what's my question.

What compilers can we use in Ansys Fluent to compile our UDF?
I read something about compiling UDF e.g.:


https://www.sharcnet.ca/Software/Ans...compilers.html


But for Windows OS they just talk about Microsoft visual studio. I'm using Ansys 19 and my OS is windows. Can I use other compilers? for example GCC?
I have developed a tool to convert the default Fluent compiler from VC to GCC. Here the allowed attachment size is too small. Contact me if you need.
Roh likes this.
gearboy is offline   Reply With Quote

Old   September 11, 2018, 13:28
Default
  #5
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Quote:
Originally Posted by gearboy View Post
I have developed a tool to convert the default Fluent compiler from VC to GCC. Here the allowed attachment size is too small. Contact me if you need.
Thank you,
I wanted to use another compiler because VS is huge and take much space of the memory. May I know what compiler do you use? how do you set it up?
Roh is offline   Reply With Quote

Old   September 11, 2018, 15:42
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by Roh View Post
Thank you,
I wanted to use another compiler because VS is huge and take much space of the memory. May I know what compiler do you use?
From the post that you replied to:
Quote:
I have developed a tool to convert the default Fluent compiler from VC to GCC
So on behalf of gearboy I can say: yes, you may know that the new compiler is GCC.
pakk is offline   Reply With Quote

Old   September 11, 2018, 20:59
Default
  #7
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by pakk View Post
From the post that you replied to:
So on behalf of gearboy I can say: yes, you may know that the new compiler is GCC.
Right, we recommend tdm-gcc 4.9.2. After conversion of the compiling environment, you can compile udf same way as VC compiler.

temppgn.png
Roh likes this.
gearboy is offline   Reply With Quote

Old   September 12, 2018, 00:53
Question
  #8
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Quote:
Originally Posted by gearboy View Post
Right, we recommend tdm-gcc 4.9.2. After conversion of the compiling environment, you can compile udf same way as VC compiler.

Attachment 65557

Thank you,
You have a PM from me. I use Ansys 19, Did you chack your tool to know if it has any problem with higher version of Ansys?
Roh is offline   Reply With Quote

Old   September 12, 2018, 01:00
Smile
  #9
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Quote:
Originally Posted by gearboy View Post
Right, we recommend tdm-gcc 4.9.2. After conversion of the compiling environment, you can compile udf same way as VC compiler.

Attachment 65557
Sorry for bouble post but just wanted to ask Did you check the last version of tdm-gcc? Isn't there any problem if I get the last version? currently the last version is 5.1.0.2


http://tdm-gcc.tdragon.net/download
Roh is offline   Reply With Quote

Old   September 13, 2018, 03:59
Default
  #10
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by Roh View Post
Sorry for bouble post but just wanted to ask Did you check the last version of tdm-gcc? Isn't there any problem if I get the last version? currently the last version is 5.1.0.2


http://tdm-gcc.tdragon.net/download
Please give me some time to upgrade it to support fluent19.0. Currently, it only support up to 18.2. For TDM-GCC, we recommend you use 4.9.2 and do not check server for upgrading when installing. Other versions may not work. Anyway, you can try the lastest TDM-GCC version and tell me if it works.
gearboy is offline   Reply With Quote

Old   September 13, 2018, 04:21
Default
  #11
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Quote:
Originally Posted by gearboy View Post
Please give me some time to upgrade it to support fluent19.0. Currently, it only support up to 18.2. For TDM-GCC, we recommend you use 4.9.2 and do not check server for upgrading when installing. Other versions may not work. Anyway, you can try the lastest TDM-GCC version and tell me if it works.
How much it will take time?
waiting to recieve it.
Roh is offline   Reply With Quote

Old   October 7, 2018, 00:50
Default
  #12
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by Roh View Post
How much it will take time?
waiting to recieve it.
We have upgraded UdfMinGW to version 19.2, which support fluent 6.3-19.2. Please read the manual in the zip package first.

https://vcudfstudio.bitbucket.io/dow...fMinGW19.2.zip
Roh likes this.
gearboy is offline   Reply With Quote

Old   October 7, 2018, 02:56
Smile
  #13
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Quote:
Originally Posted by gearboy View Post
We have upgraded UdfMinGW to version 19.2, which support fluent 6.3-19.2. Please read the manual in the zip package first.

https://vcudfstudio.bitbucket.io/dow...fMinGW19.2.zip

Thank you.
I uploaded the file in somewhere eles for other fellas because I had problem to download it(not good server).


http://www.mediafire.com/file/72tljt...W19.2.zip/file


I tried everything that you said and it worked very well. A screenshot





Thank you so much.


I have a question:


If we have a workbench project and there is a fluent project in our workbench, how we have to use this program?
Attached Images
File Type: png sdysuihsuiejhrsjrj.png (36.9 KB, 280 views)
Roh is offline   Reply With Quote

Old   October 8, 2018, 03:04
Default
  #14
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by Roh View Post
Thank you.
I uploaded the file in somewhere eles for other fellas because I had problem to download it(not good server).


http://www.mediafire.com/file/72tljt...W19.2.zip/file


I tried everything that you said and it worked very well. A screenshot





Thank you so much.


I have a question:


If we have a workbench project and there is a fluent project in our workbench, how we have to use this program?
I guess you have to add C:\TDM-GCC-64\bin to PATH environment variable first (say your GCC installing folder is C:\TDM-GCC-64).
gearboy is offline   Reply With Quote

Old   October 15, 2018, 01:54
Question
  #15
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Quote:
Originally Posted by gearboy View Post
I guess you have to add C:\TDM-GCC-64\bin to PATH environment variable first (say your GCC installing folder is C:\TDM-GCC-64).
You guess? Could you please add more details about your approach here? or maybe it could be better to check it at first and inform us because you know what's going on in this tool.


And a suggestion,
I don't know if you want to release your program as an open source project but you can use github.com
Roh is offline   Reply With Quote

Old   January 5, 2019, 04:40
Question
  #16
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
gearboy,
I'm trying to compile a UDF but get this error:




The error:


Quote:
Copied F:\RDE\Rotating Detonation Engines- UDF.c to libudf\src user_nt.udf file is outdated. So, recreating the file for 2ddp ...
(chdir "libudf\win64\2ddp")nmake: Nothing to be done for 'clean'.
nmake: *** No rule to make target '../../src/Rotating', needed by 'Rotating'. Stop.
(system "copy "C:\PROGRA~1\ANSYSI~1\v192\fluent"\fluent19.2.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp")nmake: *** No rule to make target '../../src/Rotating', needed by 'Rotating'. Stop.


Done.


What's the matter with it?
Attached Images
File Type: png dfdtdtutyutyu.png (35.6 KB, 260 views)
Roh is offline   Reply With Quote

Old   January 5, 2019, 13:32
Question
  #17
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 8
Roh is on a distinguished road
Solved the problem and got a new error and have fallen in a new problem. Here is the new error:

Quote:
Error: received a fatal signal (Segmentation fault).

Error: received a fatal signal (Segmentation fault).
Error Object: #f


I managed to compile and load the UDF. Here is the report that I got after compilation:


Quote:
Creating user_nt.udf file for 2ddp ... (system "copy "C:\PROGRA~1\ANSYSI~1\v192\fluent"\fluent19.2.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp")# Generating ud_io1.h
../../src/NewUDF.c: In function 'vel':
../../src/NewUDF.c:42:13: warning: variable 'To_in' set but not used [-Wunused-but-set-variable]
real T_in, To_in;
^
../../src/NewUDF.c:41:13: warning: variable 'po_in' set but not used [-Wunused-but-set-variable]
real p_in, po_in;
^
# Generating udf_names.c because of makefile NewUDF.o
# Linking libudf.dll because of makefile user_nt.udf udf_names.o NewUDF.o
################################################## ####################
#########UDF source has been compiled with UdfMinGW(ver 19.2)#########
###Please visit https://vcUdfStudio.bitbucket.io for latest version###
################################################## ####################
################################################## ####################


Done.

The UDF is compiled and loaded successfully but when I want to initialize the project I got that error.
Roh is offline   Reply With Quote

Old   November 11, 2021, 16:03
Default
  #18
New Member
 
Juan Antonio Blanco
Join Date: Nov 2021
Location: San Carlos de Bariloche, Argentina
Posts: 2
Rep Power: 0
EngJuanAntonioBlanco is on a distinguished road
Quote:
Originally Posted by gearboy View Post
I have developed a tool to convert the default Fluent compiler from VC to GCC. Here the allowed attachment size is too small. Contact me if you need.
Hi friend, I have fluent 6.3.26 on Windows 10, I prove a lot of times compiled my udf, but I think that is impossible ... I prove with VS 19, VS 17, VS Express 12... What is the correct? If you can give me another option I´ve really been enjoying that.

Thanks in advance,

Eng. Juan Antonio Blanco
EngJuanAntonioBlanco is offline   Reply With Quote

Old   November 11, 2021, 20:01
Default
  #19
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Out of curiosity: why Fluent 6? That is like ten years old... You are missing out on a lot of updates! Compiler support has improved a lot since that version!
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   November 11, 2021, 21:09
Default
  #20
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by EngJuanAntonioBlanco View Post
Hi friend, I have fluent 6.3.26 on Windows 10, I prove a lot of times compiled my udf, but I think that is impossible ... I prove with VS 19, VS 17, VS Express 12... What is the correct? If you can give me another option I´ve really been enjoying that.

Thanks in advance,

Eng. Juan Antonio Blanco
VS Express 10
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
UDF velocity inlet. Different values (compile - Fluent) asking FLUENT 0 July 13, 2018 17:02
UDF Defining in ANSYS FLUENT 16.2 in Win 10 Sadegh.A Fluent UDF and Scheme Programming 11 February 15, 2017 14:45
Problem in compiling UDF with ANSYS Fluent 17.1 and Visual Studio 14.0 Spiker54321 Fluent UDF and Scheme Programming 2 October 27, 2016 09:09
Fluent 6.3.26 on Linux does not compile an UDF Entwistle Fluent UDF and Scheme Programming 1 March 4, 2014 14:49
The fluent stopped and errors with "Emergency: received SIGHUP signal" yuyuxuan FLUENT 0 December 3, 2013 22:56


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