|
[Sponsors] |
Segmentation fault when calling F_T using c_face_loop |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 19, 2018, 10:41 |
Segmentation fault when calling F_T using c_face_loop
|
#1 |
New Member
Ben
Join Date: Mar 2013
Posts: 15
Rep Power: 13 |
Hello,
I've been trying to write a FLUENT UDF which cycles through all the cells in my FLUENT case. For each cell I want to loop over all the faces and calculate something using the face temperature. However, when the code reaches 'temp=F_T(f,tf)' I get a segmentation fault. I'm fairly new to the UDF stuff so I'm struggling to find the error. I am trying to make this work on FLUENT 17.2 and the case models the transonic, viscous 2D flow over the NACA0012 aerofoil. Here is a minimal code example which throws the segmentation fault: Code:
#include "udf.h" #include "mem.h" #include "sg.h" #include "math.h" DEFINE_ON_DEMAND(shock_viscous3) { Domain *d; cell_t c; Thread *tf; face_t f; Thread *t; int n; real A[ND_ND]; real f_visc, temp; d=Get_Domain(1); Message("Entering loop\n"); thread_loop_c(t,d) { // looping over cells begin_c_loop(c,t) { f_visc= (C_MU_L(c,t)+C_MU_T(c,t))/C_MU_L(c,t); if (f_visc > 15.0) { c_face_loop(c, t, n) /* loops over all faces of a cell */ { f = C_FACE(c,t,n); tf = C_FACE_THREAD(c,t,n); Message("Temp\n"); temp=F_T(f,tf); Message("After Temp\n"); } } } end_c_loop(c,t) } } |
|
July 19, 2018, 15:53 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,754
Rep Power: 66 |
Did you declare temp in the UDM beforehand?
|
|
Tags |
fluent, fluent - udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel | francesco | OpenFOAM Bugs | 4 | May 2, 2017 22:59 |
Segmentation fault in SU2 V5.0 | ygd | SU2 | 2 | March 1, 2017 05:38 |
Segmentation fault when running in parallel | Pj. | OpenFOAM Running, Solving & CFD | 3 | April 8, 2015 09:12 |
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example | sudo | OpenFOAM Running, Solving & CFD | 3 | April 2, 2013 18:27 |
segmentation fault when installing OF-2.1.1 on a cluster | Rebecca513 | OpenFOAM Installation | 9 | July 31, 2012 16:06 |