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

Needed guidance to write my own UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2019, 18:29
Post Needed guidance to write my own UDF
  #1
New Member
 
kailash
Join Date: Jun 2018
Posts: 19
Rep Power: 8
kailash007 is on a distinguished road
Hi Everyone!

I am new to UDF in fluent and I desire to learn and be proficient in writing UDF codes. I have basic knowledge in C. Can anyone suggest me a good place to start learning UDF coding? I started with the UDF manual published by ANSYS which has some examples with UDF codes but it seems like I am not making much progress or at the pace I wish to understand.

Thanks and Regards,
Kailash kuppuraju
kailash007 is offline   Reply With Quote

Old   April 16, 2019, 22:23
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by kailash007 View Post
Hi Everyone!

I am new to UDF in fluent and I desire to learn and be proficient in writing UDF codes. I have basic knowledge in C. Can anyone suggest me a good place to start learning UDF coding? I started with the UDF manual published by ANSYS which has some examples with UDF codes but it seems like I am not making much progress or at the pace I wish to understand.

Thanks and Regards,
Kailash kuppuraju
Just read the manual several times(should know basic macros and where to find them) and do some practice. If having questions, go back to manual examples. And some ANSYS udf seminar ppt also helps. No other ways.
gearboy is offline   Reply With Quote

Old   April 19, 2019, 00:29
Default
  #3
New Member
 
kailash
Join Date: Jun 2018
Posts: 19
Rep Power: 8
kailash007 is on a distinguished road
Thanks "gearboy". I am doing the same. It is apparently taking a lot of time. I am using this link to learn: https://www.sharcnet.ca/Software/Ans...f/flu_udf.html . I hope this helps someone who wants to learn the UDF's. But its quite a lot of MACRO's which makes me think if I will be ever be using all those.
kailash007 is offline   Reply With Quote

Old   April 20, 2019, 10:02
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Start with a concrete problem. Something that you can solve with a UDF. Then, solve it.

You learn the most by just doing it. You will undoubtedly make mistakes, and learn from them. Reading the manual a few times is useless if you never try it yourself.
pakk is offline   Reply With Quote

Old   April 21, 2019, 11:19
Default
  #5
New Member
 
kailash
Join Date: Jun 2018
Posts: 19
Rep Power: 8
kailash007 is on a distinguished road
Thanks Pakk. Yes, I am doing that. I got stuck up in compiling the UDF. I am trying to figure that out. I searched online for a solution to my problem. Apparently, a correct version of Visual Studio is needed to compile the UDF codes it seems. I am using ANSYS Fluent 19.2.0 and Visual Studio 19 doesn't seem to work for me.
kailash007 is offline   Reply With Quote

Old   April 21, 2019, 18:14
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
You linked to an online Fluent manual for version 15.0.7.
You are working with Fluent version 19.2.0.

Why would you use an outdated manual?

Just open the Fluent manual that comes with your installation of Fluent, and look there how to configure everything.
pakk is offline   Reply With Quote

Old   April 23, 2019, 23:04
Default
  #7
New Member
 
kailash
Join Date: Jun 2018
Posts: 19
Rep Power: 8
kailash007 is on a distinguished road
Thanks a lot Pakk. I don't know why I really didn't think about this. Got the latest one to use.
kailash007 is offline   Reply With Quote

Old   April 24, 2019, 05:05
Default
  #8
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by kailash007 View Post
Thanks "gearboy". I am doing the same. It is apparently taking a lot of time. I am using this link to learn: https://www.sharcnet.ca/Software/Ans...f/flu_udf.html . I hope this helps someone who wants to learn the UDF's. But its quite a lot of MACRO's which makes me think if I will be ever be using all those.
Just generic Macros you need to know, such as DEFINE_PROFILE, DEFINE_INIT, DEFINE_AT_ADJUST, etc.

And basic macros that access Fluent data, such as C_T, C_P, C_CENTROID
And basic marcos loop over cells, faces. thread_loop_c,....
gearboy is offline   Reply With Quote

Old   April 24, 2019, 16:36
Default
  #9
New Member
 
kailash
Join Date: Jun 2018
Posts: 19
Rep Power: 8
kailash007 is on a distinguished road
Quote:
Originally Posted by gearboy View Post
Just generic Macros you need to know, such as DEFINE_PROFILE, DEFINE_INIT, DEFINE_AT_ADJUST, etc.

And basic macros that access Fluent data, such as C_T, C_P, C_CENTROID
And basic marcos loop over cells, faces. thread_loop_c,....
Thanks again gearboy. I am learning all, plus its also kinda fun to learn and have it working.
kailash007 is offline   Reply With Quote

Old   October 24, 2022, 07:26
Default udf code in visual studio
  #10
New Member
 
Prasidh shetty
Join Date: Oct 2022
Posts: 10
Rep Power: 4
Spicy is on a distinguished road
Does anyone have any idea how to write UDF code in visual studio? I am not good at coding but, I have code available, I just need to write it in the visual studio. I am using Ansys 2022 and visual studio 2022(I am not able to download the older versions).
Can anyone help me with this?
Spicy is offline   Reply With Quote

Reply

Tags
udf code


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
How to write a UDF for a transient temperature deathstar Fluent UDF and Scheme Programming 1 March 10, 2019 22:23
How to write a UDF for gas flow rate? Oula Fluent UDF and Scheme Programming 0 October 4, 2018 06:23
how to write udf for property that are depend on temperature ali.lajevardi Fluent UDF and Scheme Programming 0 June 22, 2015 11:11
How to write UDF to achieve phase chang dunga82 Fluent UDF and Scheme Programming 2 May 8, 2013 23:16
how to write a 3D linear temperature of UDF venus FLUENT 1 October 28, 2008 03:46


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