CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Needed guidance to write my own UDF (https://www.cfd-online.com/Forums/fluent-udf/216703-needed-guidance-write-my-own-udf.html)

kailash007 April 16, 2019 17:29

Needed guidance to write my own UDF
 
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

gearboy April 16, 2019 21:23

Quote:

Originally Posted by kailash007 (Post 730996)
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.

kailash007 April 18, 2019 23:29

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.

pakk April 20, 2019 09:02

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.

kailash007 April 21, 2019 10:19

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.

pakk April 21, 2019 17:14

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.

kailash007 April 23, 2019 22:04

Thanks a lot Pakk. I don't know why I really didn't think about this. Got the latest one to use.

gearboy April 24, 2019 04:05

Quote:

Originally Posted by kailash007 (Post 731257)
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,....

kailash007 April 24, 2019 15:36

Quote:

Originally Posted by gearboy (Post 731686)
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.

Spicy October 24, 2022 06:26

udf code in visual studio
 
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?


All times are GMT -4. The time now is 15:30.