|
[Sponsors] |
How many times will fluent execute the macro DEFINE_CG_MOTION |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 21, 2021, 07:58 |
How many times will fluent execute the macro DEFINE_CG_MOTION
|
#1 |
New Member
Join Date: Jun 2021
Posts: 13
Rep Power: 5 |
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 |
|
June 21, 2021, 13:31 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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!
__________________
"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". |
|
June 21, 2021, 21:25 |
|
#3 |
New Member
Join Date: Jun 2021
Posts: 13
Rep Power: 5 |
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?
|
|
|
|
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 |