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

How to create UDF file generally?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By GenD

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2018, 16:54
Default How to create UDF file generally?
  #1
New Member
 
GenD
Join Date: Nov 2017
Posts: 23
Rep Power: 9
GenD is on a distinguished road
Hi,
I've been learning ANSYS Fluent and Mesh for some time and now I've reached the point, where I want to define my own UDF file, but I don't know how to do this at all.
First case is that C++ is a familiar language to me and I want to use it in coding UDF. Is it possible? The second case is far more complex. I don't know how to start writing code, in which programme, how to connect c++ file and ANSYS and is there any clue/scheme that I can follow to write code correctly for ANSYS? So basically I need step-by-step explanation.

Is there anybody that can help me in this manner? Or have some materials, which I can learn it from? Anything. I appreciate every help.

Thanks in advance.
Sidique likes this.
GenD is offline   Reply With Quote

Old   October 13, 2018, 07:47
Default
  #2
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
Hi see http://users.ugent.be/~mvbelleg/fludf-12-0.pdf

you will find good help
moh_zain is offline   Reply With Quote

Old   October 13, 2018, 08:12
Default
  #3
New Member
 
GenD
Join Date: Nov 2017
Posts: 23
Rep Power: 9
GenD is on a distinguished road
I don't know, if I understand correctly, so correct me. The only way to define UDF is by using C language?
GenD is offline   Reply With Quote

Old   October 13, 2018, 19:31
Default
  #4
New Member
 
GenD
Join Date: Nov 2017
Posts: 23
Rep Power: 9
GenD is on a distinguished road
I've found the answer to my question. UDF can be written in C++. After searching whole the internet, I've found everything in most obvious place, ANSYS Help. I put here the link for the ones that will look for it in future. It's like the instruction given here by moh_zain, but for the latest version 19.2.

https://ansyshelp.ansys.com/account/...f/flu_udf.html
GenD is offline   Reply With Quote

Old   October 14, 2018, 02:40
Default
  #5
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 9
Roh is on a distinguished road
UDF should be written in C or C++ standard?
Roh is offline   Reply With Quote

Old   October 14, 2018, 21:48
Default
  #6
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by GenD View Post
Hi,
I've been learning ANSYS Fluent and Mesh for some time and now I've reached the point, where I want to define my own UDF file, but I don't know how to do this at all.
First case is that C++ is a familiar language to me and I want to use it in coding UDF. Is it possible? The second case is far more complex. I don't know how to start writing code, in which programme, how to connect c++ file and ANSYS and is there any clue/scheme that I can follow to write code correctly for ANSYS? So basically I need step-by-step explanation.

Is there anybody that can help me in this manner? Or have some materials, which I can learn it from? Anything. I appreciate every help.

Thanks in advance.
Here is a tool that use C++ language to code UDF, compatible with Win32 API.
Please see https://vcUdfStudio.bitbucket.io
gearboy is offline   Reply With Quote

Old   October 15, 2018, 02:47
Smile
  #7
Roh
Senior Member
 
Join Date: Sep 2017
Posts: 130
Rep Power: 9
Roh is on a distinguished road
Or maybe he wants to see this topic:


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


Thanks to gearboy for useful tool.
Roh is offline   Reply With Quote

Old   October 15, 2018, 08:16
Default
  #8
New Member
 
GenD
Join Date: Nov 2017
Posts: 23
Rep Power: 9
GenD is on a distinguished road
Thanks for all your help.

I've started to read the Manual for the purpose of creating UDF file, but... I got a problem. As you can see on the image I attached, source code don't read the udf.h. I have even put this file in local folder of my_adjust.c. Still nothing. Any thoughts?
Attached Images
File Type: png Przechwytywanie.PNG (29.0 KB, 14 views)
GenD is offline   Reply With Quote

Old   October 16, 2018, 02:35
Default
  #9
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
read chapter 4 and 5 depending on which udf you use
moh_zain is offline   Reply With Quote

Reply

Tags
coding, fluent, udf


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
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Community Contributions 9 June 12, 2015 18:18
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 13:41
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18


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