-
-
August 22, 2019 at 10:24 pm
rachels1001
SubscriberHey guys,
I have a kind of strange problem that has arisen recently. I have a UDF that is supposed to take boundary outlet conditions from one part of my simulation and use those flow and composition values as an inlet boundary profile on another part of my fluid body. There are quite a couple macros within my UDF because this flow distribution happens in multiple spots.
Most of my variables are defined as global variables because they are being defined in DEFINE_ADJUST macros, modified in separated DEFINE_ADJUST macros and then later being used in DEFINE_PROFILE macros.
My simulation results weren't making sense, and so I added "Message" queries throughout the macros of my UDF to monitor any issues with the values. Based on the message outputs I am getting each iteration, some of my macros aren't being called at all, not even an "undefined" variable" being outputted, but some of my macros are being called multiple times within a single iteration (because I see the same message pop up multiple times within a single iterations output). The same 3 or 4 macros are being called multiple times within the iteration as if in a loop and normally they are called 7 times.
I know this is kind of a difficult question to answer, but is there any reason why a DEFINE_ADJUST macro would be executing multiple times within a single iteration? Or why some of my DEFINE_PROFILE macros aren't even being called? I have double checked a couple times, and all of these profile macros are being called within the simulation as boundary conditions. Also if anyone has any additional tips on how to troubleshoot UDFs and macros / typical problems implementing global variables / typical problems using multiple adjust and profile macros within the same UDF, please let me know!
Thanks, and again, sorry for the weird question,
Claire
-
August 23, 2019 at 10:51 am
BeginerModel
SubscriberI'm afraid without delving into your UDF's and how they are implemented I won't be able to provide any help for this particular issue. However, copying outlet conditions and using them as inlet conditions is something I have recently looked into and implemented into one of my models.
I did this through writing a profile at the outlet for whicher variable you are interested in (VOF for me), and then reading that profile as the boundary condition for the inlet. This is much easier to setup through the TUI and journal commands (I believe) than through the GUI but if that could be helpful to you then let me know.
-
March 10, 2021 at 3:23 am
yeoengchow
SubscriberHey, I am experiencing the same issue. I have a DEFINE_CG_MOTION macro used in my UDF to simulate a rotating plate. I have written the UDF such that it writes the angle, velocity, time and acceleration of the plate at every time-step. However, the macro writes about 7-9 sets of data for each time-step, each with different velocity, time and acceleration data. I think this might be causing some issues with my results.nAny help/thoughts would be appreciated. Happy to keep providing more information as well. Thank you!n -
March 10, 2021 at 9:19 am
YasserSelima
SubscriberWelcome!nProbably this is because of parallel processing. Can you post the message the printed message? the 7-9 linesnn -
March 10, 2021 at 9:27 am
DrAmine
Ansys EmployeeAlso try to limit writing the messages either from host or just from node0. if node0 use Message0.nI think if you are using an Adjust, some parallelizing is required especially if you are garthering data over all nodes and trying to reduce or sum.n
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
-
2706
-
2138
-
1355
-
1144
-
462
© 2023 Copyright ANSYS, Inc. All rights reserved.