-
-
September 18, 2023 at 9:26 pmaliborhanSubscriber
Hello,
 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 pmaliborhanSubscriber
Hello,
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 pmaliborhanSubscriber
Any thoughts on this?
Thanks!
-
September 22, 2023 at 10:16 amLuca B.Forum Moderator
Hi, 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
Â
-
- The topic ‘Transient simulation: How to execute DEFINE_PROFILE macro once per time step?’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Fluent fails with Intel MPI protocol on 2 nodes
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- UDF, Fluent: Access count of iterations for “Steady Statistics”
- RIBBON WINDOW DISAPPEARED
-
1421
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.