TAGGED: crash, multiphase, udf, volume
-
-
March 12, 2022 at 10:25 am
prebenjs
SubscriberHi,
I'm trying to get the volume of the each cell adjacent / on a face. A section of the UDF is shown below. The code crashes when i introduce C_VOLUME. I suspect that it might be caused by the wrong input here but I'm struggling to see what the reason actually is. Can anybody advice me on this ?
DEFINE_PROFILE(name,th,i)
face_t f
cell_t c;Â
mixture_domain = Get_Domain(1);
Thread* t;
Thread* t_prim; /*= THREAD_SUB_THREAD(mixture_domain, prim_phase_domain_index);
Thread* t_sec; /* = THREAD_SUB_THREAD(mixture_domain, sec_phase_domain_index);
t = Lookup_Thread(mixture_domain, 11);
begin_f_loop(f, th)
  {
    if PRINCIPAL_FACE_P(f, th)   {
      c = F_C0(f, t);Â
      volume_fraction_ = C_VOF(c, t_sec);
volume =C_VOLUME(c,t); }
March 14, 2022 at 10:06 amDrAmine
Ansys EmployeeWrong / Bad UDF syntax: You can retrive for t = Lookup_Thread(mixture_domain, 11) the phase level associated face threads. You use then these threads to access whatever you want.
The DEFINE_PROFILE you are hooking at certain boundary and from there you get the thread pointer "th" (I assume phase level thread for that reason . From that "th" you can check/ or enforce mixture level thread (THREAD_SUPER_THREAD). From that Super_THREAD you can go lower level to have the phase level threads.
So the problem is now: what is "t": it is declared and defined by you are not looping on it. Moreover is it a cell thread or face thread.
I recommend attending some training!
Viewing 1 reply thread- The topic ‘Crashing UDF wrong input?’ is closed to new replies.
Innovation SpaceTrending discussionsTop Contributors-
6535
-
1906
-
1463
-
1311
-
1022
Top Rated Tags© 2026 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-