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

How many times will fluent execute the macro DEFINE_CG_MOTION

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2021, 07:58
Default How many times will fluent execute the macro DEFINE_CG_MOTION
  #1
New Member
 
Join Date: Jun 2021
Posts: 13
Rep Power: 5
David070 is on a distinguished road
Hi everyone,

I am doing a simulation about a moving body. I use DEFINE_CG_MOTION to update the position of the body. However, I found that the macro seems to be executed by every node of the computer. That is to say, if I use 6 processors to do simulation, the macro seems to be executed 6 times (since I insert Message("niter = %f, ntime = %f\n", niter, time) in the macro and the message appeared 6 times in the window). I want to know how to make the macro be executed only once every time step. I tried to add "#if !RP_NODE" to cover all the contents in the macro. However, by doing that, the function do not return the updated velocity so the body did not move at all. So, does anyone know how to figure out this problem? Any suggestion will be appreciated! Thank you!

David
David070 is offline   Reply With Quote

Old   June 21, 2021, 13:31
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
If you have six nodes, and your macro is executed six times... Everything works as intended, not?

Each node should know about the updated positions, so each node has to execute the macro!
David070 likes this.
__________________
"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   June 21, 2021, 21:25
Default
  #3
New Member
 
Join Date: Jun 2021
Posts: 13
Rep Power: 5
David070 is on a distinguished road
Thank you! So it seems that I only need to let the output files such as the fprintf files be executed only once! By the way, If I do a free-motion simulation and when I calculate the total fluid force on the body, should I first use the "#if !RP_HOST" to let the nodes calculate the force and use the "#if RP_NODE" then "force = PRF_GRSUM1(force)" to get the sum of the forces from every node? I see some examples from other users using this form, but the example from the Fluent UDF manual (* 1-degree of freedom equation of motion (x-direction)) did not use any of these "#if !RP_HOST" or "#if RP_NODE" compiler directives. Is there any difference between using these two forms?
David070 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
Fluent Execute Commands: Syntax for return pisykl FLUENT 0 June 16, 2016 21:45
ANSYS Fluent 14.5 x64 Crash many times brksnn FLUENT 5 January 5, 2014 07:48
Mesh and Solve Times for CFX, Fluent, CD-adapco Jade M Main CFD Forum 4 August 28, 2012 03:54
HELP! Fluent macro definition hamish888 FLUENT 1 November 1, 2010 07:12
few quesions on ANSYS ICEMCFD and FLUENT Prakash.Paudel ANSYS 0 August 12, 2010 13:07


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