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

UDF on Define_source

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Bruno Machado
  • 1 Post By Bruno Machado
  • 1 Post By Bruno Machado

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2016, 02:12
Default UDF on Define_source
  #1
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Good morning,

May I ask, I have a udf code with DEFINE macros as given below:

Define_init
Define_source
Define_adjust
Define_on_demand

I have an experience the divergence of the AMG solver(related to pressure).
I have set to low ratio of mesh to avoid the problem.

Is it the problem is probably come from the specific MACRO Define_source?

Thank you.
cik mimi is offline   Reply With Quote

Old   April 21, 2016, 06:58
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by cik mimi View Post
Good morning,

May I ask, I have a udf code with DEFINE macros as given below:

Define_init
Define_source
Define_adjust
Define_on_demand

I have an experience the divergence of the AMG solver(related to pressure).
I have set to low ratio of mesh to avoid the problem.

Is it the problem is probably come from the specific MACRO Define_source?

Thank you.
it can be many reasons. The DEFINE_ON_DEMAND do not play any role during iterations, so your problem is not there. You can do couple of checks to narrow your problem.

1st) Check if the values of the DEFINE_INIT are correct and fluent is recognizing it (plot the contours and see if the values are what you expect)

2nd) Plot messages with your variable in your source and see if you are getting what it is supposed to be. Change the variables bellow for yours and see what it returns to you. Double check with your hand calculation.

Message ("Variable1 = %f, Varibale2 %f/n", Variable1, Variable2)

3rd) If the 2 previous steps are OK, do the 2nd step on the DEFINE_ADJUST macro

4th) Check the under-relaxation factors;
cik mimi likes this.
Bruno Machado is offline   Reply With Quote

Old   April 21, 2016, 08:03
Default
  #3
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Okey Bruno Machado,

Appreciate for the steps given.

I will give my feedbacks later =)
cik mimi is offline   Reply With Quote

Old   April 22, 2016, 01:48
Default
  #4
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Good day Bruno Machado,

Can I just testing my UDF code with the message of output file without inserting the load model together ?

Thank you.
cik mimi is offline   Reply With Quote

Old   April 22, 2016, 05:30
Default
  #5
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by cik mimi View Post
Good day Bruno Machado,

Can I just testing my UDF code with the message of output file without inserting the load model together ?

Thank you.
I didnt get what you said. But, I would test the UDF using my model, otherwise, how can I know if it is working?
cik mimi likes this.
Bruno Machado is offline   Reply With Quote

Old   April 22, 2016, 08:51
Default
  #6
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Good day Bruno Machado,

I am a new user to Ansyst Fluent.
Currently i have a udf code that need to be solve. The code is already written but it has
AMG divergence error.
I did not have my own Ansyst software and if I want to use it, i need to use someone's computer. So I am not always in front of the Ansyst. Therefore, I do not exactly know how it works to retrieve the output file from the UDF code.

Thank you.

My current step is to locate the message () from DEFINE_source to detect the where the divergence error is came from.
cik mimi is offline   Reply With Quote

Old   April 22, 2016, 09:04
Default
  #7
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by cik mimi View Post
Good day Bruno Machado,

I am a new user to Ansyst Fluent.
Currently i have a udf code that need to be solve. The code is already written but it has
AMG divergence error.
I did not have my own Ansyst software and if I want to use it, i need to use someone's computer. So I am not always in front of the Ansyst. Therefore, I do not exactly know how it works to retrieve the output file from the UDF code.

Thank you.

My current step is to locate the message () from DEFINE_source to detect the where the divergence error is came from.
you will not have any output file adding the Message() in your code. This message will be printed in the GUI.

To test your UDF, there is no other way rather than trying it on Fluent. If you are a student, you might be able to download a free student version on the website. have a look at it.
Bruno Machado is offline   Reply With Quote

Old   April 22, 2016, 09:07
Default
  #8
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Okey. I am a student.

My laptop is 32 bit.

So I can only using Ansyst on computer in office which is already download.
cik mimi is offline   Reply With Quote

Old   April 23, 2016, 12:31
Default
  #9
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Good day,

May I ask, in order to retrieve the UDF data through message (),

is it involved in hooking UDF?

Thank you
cik mimi is offline   Reply With Quote

Old   April 24, 2016, 18:19
Default
  #10
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by cik mimi View Post
Good day,

May I ask, in order to retrieve the UDF data through message (),

is it involved in hooking UDF?

Thank you
You will see the message when you run your case with the udf hooked.
cik mimi likes this.
Bruno Machado is offline   Reply With Quote

Old   April 24, 2016, 22:30
Default
  #11
Member
 
mimi
Join Date: Mar 2016
Posts: 33
Rep Power: 10
cik mimi is on a distinguished road
Thank you. I try to make my UDF code works
cik mimi is offline   Reply With Quote

Reply

Tags
udf and programming


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 Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
Parallelize UDF? Which kind of UDF? Lilly FLUENT 5 March 25, 2014 03:05
Help! Delete the UDM codes in the UDF Messi Fluent UDF and Scheme Programming 2 January 28, 2014 10:01
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 17:28.