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!