-
-
September 18, 2023 at 9:26 pm
aliborhan
SubscriberHello,
I am writing a UDF that includes a DEFINE_PROFILE macro for a transient simulation. My goal is to update the variable viscous resistance of a porous media during each time step. Since DEFINE_PROFILE macros are executed during every iteration within every time step, what can I do to ensure that the macro executes only once per time step? I tried using "first_iteration," but it didn't work within the DEFINE_PROFILE macro. Also, If I enter a large value for the UDF Profile Update Interval in the Run Calculation panel, I cannot be certain whether this value is greater than or less than the maximum number of iterations required for convergence.
Thank you in advance for your guidance!
-
September 20, 2023 at 1:33 pm
aliborhan
SubscriberHello,
I am writing a UDF that includes a DEFINE_PROFILE macro for a transient simulation. My goal is to update the variable viscous resistance of a porous media during each time step. Since DEFINE_PROFILE macros are executed during every iteration within every time step, what can I do to ensure that the macro executes only once per time step? I tried using "first_iteration," but it didn't work within the DEFINE_PROFILE macro. Also, If I enter a large value for the UDF Profile Update Interval in the Run Calculation panel, I cannot be certain whether this value is greater than or less than the maximum number of iterations required for convergence.
Thank you in advance for your guidance!
-
September 21, 2023 at 2:45 pm
aliborhan
SubscriberAny thoughts on this?
Thanks!
-
September 22, 2023 at 10:16 am
Luca B.
Ansys EmployeeHi, DEFINE_PROFILE is executed at any iteration because you need to provide a boundary values to porosity. So it need to compute the corresponding value anytime.
How to do modify the viscous resistance? is it time dependent?
Some ideas
- can you modify it only with Expression without an UDF. So you can calculate it without running the UDF?
- Another possibility, you can try. You can use a DEFINE_EXECUTE_AT_END that is run only at the end of all time step. You can compute it the new viscous value, save it into a global variable and so make it accessible to the DEFINE_PROFILE macro.
Let me know if this suggestion are useful
Luca
-
- 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.
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Suppress Fluent to open with GUI while performing in journal file
- Mesh Interfaces in ANSYS FLUENT
- Time Step Size and Courant Number
- error: Received signal SIGSEGV
-
7680
-
4476
-
2957
-
1433
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.