-
-
September 19, 2023 at 1:33 amaliborhanSubscriber
Hello,
I have a multiblock domain with four different zones (two fluid zones and two porous zones). The UDF I'm using includes the macro DEFINE_PROFILE. It appears that calculations are performed twice during each iteration! Furthermore, when I run the simulation in parallel mode with two processors, the information is printed four times on the console. Why is this happening?
I appreciate your guidance in advance!
Â
-
September 20, 2023 at 1:35 pmaliborhanSubscriber
Hello,
I have a multiblock domain with four different zones (two fluid zones and two porous zones). The UDF I'm using includes the macro DEFINE_PROFILE. It appears that calculations are performed twice during each iteration! Furthermore, when I run the simulation in parallel mode with two processors, the information is printed four times on the console. Why is this happening?
I appreciate your guidance in advance!
-
September 20, 2023 at 2:28 pmRobForum Moderator
Please post the code. I'm not going to debug it but may see something when having a quick look.Â
-
September 20, 2023 at 3:10 pmaliborhanSubscriber#include "udf.h"ÂDEFINE_ON_DEMAND(store_resistance){ÂDomain *domain;Thread *t, *tt;cell_t c;int mem_1_id = 9;domain = Get_Domain(1);t = Lookup_Thread(domain,mem_1_id);Â/* Fill the UDM with initial resistance */Âbegin_c_loop (c,t){C_UDMI(c,t,0) = 1.0e12;}end_c_loop (c,t)}//----------------------------------DEFINE_PROFILE(vis_res,t,i)Â {cell_t c;begin_c_loop(c,t){if ( N_TIME <= 1.0 ){F_PROFILE(c,t,i) = C_UDMI(c,t,0);}if ( N_TIME > 1.0 )Â{F_PROFILE(c,t,i) = 1.1*C_UDMI(c,t,0);C_UDMI(c,t,0) = F_PROFILE(c,t,i);}}end_c_loop(c,t)}
This is a test code. I just wanted to make sure that the variable of interest is updated and multiplied by "1.1" during each iteration. But after each iteration, it is multiplied by "1.21=1.1*1.1".
-
September 20, 2023 at 4:09 pmRobForum Moderator
Not sure. What is N_TIME?Â
-
September 20, 2023 at 4:29 pmaliborhanSubscriber
The computational domain is 2D and I hooked the same UDF in two places, specifically for "Viscous Resistance: Direction-1" and "Viscous Resistance: Direction-2," that results in duplicated calculations.
-
September 20, 2023 at 4:31 pmaliborhanSubscriber
N_TIME is an integer number of time steps.
-
September 21, 2023 at 7:30 amRobForum Moderator
So, two zones and two entries, one of those may be why it's updating twice.Â
-
- The topic ‘Repeated calculations in each iteration of the DEFINE_PROFILE macro’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Script error Code: 800a000d
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.