-
-
August 20, 2018 at 6:56 pm
Fuad87
SubscriberHello All,
I have written an UDF for my UDS. Now I need to use the gradient of that UDS to the momentum eqn as source. The problem is that the gradient of the UDS (C_UDSI_G(c,t,i)[j]) is not available when momentum equation is being solved unless I input "yes" to this “Keep temporary solver memory from being freed?”. But keeping memory is not available in parallel, hence I can use my code only in serial. How can I store the gradient of the UDS and use it as source to the momentum in parallel? TIA
-
August 20, 2018 at 8:26 pm
DrAmine
Ansys EmployeeWhich release are you using?
-
August 20, 2018 at 8:29 pm
Fuad87
SubscriberI am using 17.2 academic
-
August 21, 2018 at 5:51 am
DrAmine
Ansys EmployeeHi,
With the documented way to obtain gradients (via Keep temporary solver memory from being freed? yes) I am able to obtain gradient for my UDS in parallel (R19.1).
-
August 21, 2018 at 10:20 pm
Fuad87
SubscriberI couldn't do it in parallel. I don't know why. So tried this, but an error saying "Scalar_Reconstruction" is undefined variable.
DEFINE_ADJUST(my_adjust,d)
{
#if !RP_HOST
int n;
int phase_domain_index = 0; /*primary phase index is 0 */
Domain *domain;
cell_t c;
Thread *t;
Thread *liq;
domain = DOMAIN_SUB_DOMAIN(d,phase_domain_index);
for (n=0; n
{
MD_Alloc_Storage_Vars(domain, SV_UDSI_RG(n), SV_UDSI_G(n), SV_NULL);
Scalar_Reconstruction(domain, SV_UDS_I(n), -1, SV_UDSI_RG(n), NULL);
Scalar_Derivatives(domain, SV_UDS_I(n), -1, SV_UDSI_G(n), SV_UDSI_RG(n), NULL);
}
thread_loop_c (t,d)
{
liq = THREAD_SUB_THREAD(t,phase_domain_index);
begin_c_loop (c,t)
{
C_UDMI(c,t,0) = C_UDSI_G(c,liq,0)[0];
C_UDMI(c,t,1) = C_UDSI_G(c,liq,1)[0];
C_UDMI(c,t,2) = C_UDSI_G(c,liq,1)[1];
C_UDMI(c,t,3) = C_UDSI_G(c,liq,2)[1];
}
end_c_loop (c,t)
}
#endif
}
-
August 22, 2018 at 8:12 am
DrAmine
Ansys EmployeeThe documented approach is working for me in parallel. The approach you are posting is not documented and not supported. Anyway I managed to have gradients based on that approach. Alloc_Storage_Vars is the right function at first. Please help your self by writing debugging messages as they helped me actually to debug the errors.
-
- The topic ‘UDF using “gradient value” not working in parallel’ is closed to new replies.
-
3727
-
1328
-
1163
-
1090
-
1014
© 2025 Copyright ANSYS, Inc. All rights reserved.