|
[Sponsors] |
June 18, 2020, 12:49 |
how to evaluate where UDM is failing
|
#1 |
Member
Tyler Richardson
Join Date: Jun 2017
Posts: 30
Rep Power: 9 |
Hi,
i have a UDM that loops on all cell threads, checks if that particular thread is a boundary face thread, and if so, does some calculations to store in udm_0 I seem to be having an issue partway through. i added Message ("Cell Thread %d \n", t); (within thread_loop_f(t,d)) as sort of a debug and i was surprised to find that i loop through about 26 threads, and then on the 27th i get an issue. Is there any way to identify which thread is associated to those IDs below? Also, are there particular surfaces that would have difficulty storing UDM information to? This particular model has 2 static fluid volumes, and 1 rotating fluid volume with 2 interfaces in between. /define/user-defined/execute-on-demand "on_demand_calc::HsgUDF"Initialized Variables Cell Thread 92327504 Cell Thread 92166480 Cell Thread 92005456 Cell Thread 91844432 Cell Thread 91683408 Cell Thread 91522384 Cell Thread 91361360 Cell Thread 91200336 Cell Thread 91039312 Cell Thread 90878288 Cell Thread 86871328 Cell Thread 87032352 Cell Thread 87193376 Cell Thread 87354400 Cell Thread 88159520 Cell Thread 88320544 Cell Thread 88481568 Cell Thread 88642592 Cell Thread 88803616 Cell Thread 89286688 Cell Thread 89447712 Cell Thread 87515424 Cell Thread 87676448 Cell Thread 87837472 Cell Thread 87998496 Cell Thread 88964640 Cell Thread 89125664 ================================================== ============================ Node 0: Process 93236: Received signal SIGSEGV. ================================================== ============================ |
|
June 18, 2020, 13:27 |
Udf
|
#2 |
Senior Member
|
It would be difficult to say without looking at the UDF. The error you are getting is related to UDF trying to access some undefined address or inaccessible one.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 18, 2020, 13:37 |
|
#3 | |
Member
Tyler Richardson
Join Date: Jun 2017
Posts: 30
Rep Power: 9 |
Quote:
#include "udf.h" #include "sg.h" DEFINE_ON_DEMAND(on_demand_calc) { /* Initialize Properties*/ real ro,mu,cp,kt,vm; /* Initialize Dittus Boelter Parameter*/ real lscal,prd,re; /* Initialize heat Transfer Coefficient*/ real hconv; real xc[ND_ND], xf[ND_ND]; real yp,kp,ys; Domain *d; Thread *t, *t0; cell_t c0; face_t f; Message ("Initialized Variables\n"); d = Get_Domain(1); /* Loop over all cell threads in the domain */ thread_loop_f(t,d) { Message ("Cell Thread %d \n", t); /* function that returns TRUE if Thread *t is a boundary face thread */ if (BOUNDARY_FACE_THREAD_P(t)) { /* Loop over all faces */ begin_f_loop(f,t) { /* c0 and t0 identify the adjacent cell */ c0 = F_C0(f, t); Message ("Cell ID %d \n", c0); t0 = THREAD_T0(t); Message ("Cell Thread %d \n", t0); /* Properties */ ro = C_R(c0,t0); mu = C_MU_L(c0,t0); cp = C_CP(c0,t0); kt = C_K_L(c0,t0); /* Evaluate Length Scale */ lscal = RP_Get_Real("ref/diameter")*.0254; /* Calculate Yp - Distance from wall to centroid of first cell */ F_CENTROID(xf,f,t); C_CENTROID(xc,c0,t0); yp = pow(pow(xf[1]-xc[1],2)+pow(xf[2]-xc[2],2)+pow(xf[3]-xc[3],2),0.5); /* Retreive Turbulent Kinetic Energy */ kp = C_K(c0,t0); ys = ro*pow(0.001,0.001)*pow(kp,0.001)*yp/mu; vm = 0.001*pow(ys/yp,0.001)*(mu/ro)*pow(lscal,0.001); re = (ro*vm*lscal)/mu; prd = (cp*mu)/kt; hconv = kt/lscal*(0.001*pow(re,0.001)*pow(prd,0.001)); C_UDMI(c0,t0,0) = hconv; F_UDMI(f,t,0) = hconv; } end_f_loop(f,t) } } } basically calculating HTC for each face |
||
June 18, 2020, 13:56 |
Code
|
#4 |
Senior Member
|
thread_loop_f loops over boundary zones and not cell zones (The code is correct but you comments are not). You can use BOUNDARY_FACE_GEOMETRY macro to fetch required details, such as, distance between face and cell center. The most likely reason for the failure is that you have interfaces and those are also boundary threads, but those are not walls. So, instead of using BOUNDARY_FACE_THREAD_P use WALL_THREAD_P.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 18, 2020, 14:45 |
|
#5 | |
Member
Tyler Richardson
Join Date: Jun 2017
Posts: 30
Rep Power: 9 |
Quote:
|
||
Tags |
error, sigsev, thread, udm |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD-Post Power Syntax: referencing Location in 'evaluate' by $variable_name | clmssun | CFX | 1 | June 29, 2017 11:30 |
Segmentation violation | louiza | FLUENT | 16 | June 27, 2017 16:41 |
Cleaning UDM | CeesH | Fluent UDF and Scheme Programming | 8 | August 7, 2014 08:17 |
Help! Delete the UDM codes in the UDF | Messi | Fluent UDF and Scheme Programming | 2 | January 28, 2014 10:01 |
Udm | nasser | FLUENT | 0 | April 7, 2013 10:19 |