-
-
September 19, 2023 at 1:33 am
aliborhan
SubscriberHello,
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 pm
aliborhan
SubscriberHello,
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 pm
Rob
Forum ModeratorPlease 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 pm
aliborhan
Subscriber#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 pm
Rob
Forum ModeratorNot sure. What is N_TIME?Â
-
September 20, 2023 at 4:29 pm
aliborhan
SubscriberThe 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 pm
aliborhan
SubscriberN_TIME is an integer number of time steps.
-
September 21, 2023 at 7:30 am
Rob
Forum ModeratorSo, 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.
-
3367
-
1050
-
1047
-
886
-
837
© 2025 Copyright ANSYS, Inc. All rights reserved.