|
[Sponsors] |
June 7, 2016, 13:02 |
fatal signal segmentation fault
|
#1 |
Member
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10 |
Hello,
when I want to run a simulation in transient with some UDFs and 6DOF in Fluent 17. I have this error which appears Error: received a fatal signal (Segmentation fault). Error Object: #f After some research on this error, I have found that this error appears when we are trying to access some internal variables of FLUENT solver in the UDF. I don't know why or where there are some errors because it used in a tutorial and it works well. There are the modified UDFs which I use. Code:
#include "udf.h" #define X_MAX 0.0575 #define X_MIN 0.05732 #define Y_MAX 0.0554 #define Y_MIN 0.05524 #define C2 50000.0 DEFINE_SOURCE(xmom_source_2,c,t,dS,eqn) { real pos[ND_ND]; real con, source, x, y; int i; C_CENTROID(pos,c,t); x = pos[0]; y = pos[1]; i = 0; if (x > X_MIN) i++; if (x < X_MAX) i++; if (y > Y_MIN) i++; if (y < Y_MAX) i++; if (i == 4) {con = C2*0.5*C_R(c,t); source = -con*fabs(C_U(c, t))*C_U(c,t); dS[eqn] = -2.*con*fabs(C_U(c,t));} else source=0; C_UDMI(c,t,0)=source; return source; } DEFINE_SOURCE(ymom_source_2,c,t,dS,eqn) { real pos[ND_ND]; real con, source, x, y; int i; C_CENTROID(pos,c,t); x = pos[0]; y = pos[1]; i = 0; if (x > X_MIN) i++; if (x < X_MAX) i++; if (y > Y_MIN) i++; if (y < Y_MAX) i++; if (i == 4) {con = C2*0.5*C_R(c,t); source = -con*fabs(C_V(c, t))*C_V(c,t); dS[eqn] = -2.*con*fabs(C_V(c,t));} else source=0; C_UDMI(c,t,1)=source; return source; } Code:
#include "udf.h" DEFINE_SDOF_PROPERTIES(Clapet_1, prop, dt, time, dtime) { prop[SDOF_MASS] = 1.067e-7; prop[SDOF_IZZ] = 5,33e-11; prop[SDOF_ZERO_TRANS_X] = TRUE; prop[SDOF_ZERO_TRANS_Y] = TRUE; prop[SDOF_ZERO_TRANS_Z] = TRUE; prop[SDOF_ZERO_ROT_X] = TRUE; prop[SDOF_ZERO_ROT_Y] = TRUE; prop[SDOF_ZERO_ROT_Z] = FALSE; } DEFINE_SDOF_PROPERTIES(Clapet_2, prop, dt, time, dtime) { prop[SDOF_MASS] = 1.067e-7; prop[SDOF_IZZ] = 5,33e-11; prop[SDOF_ZERO_TRANS_X] = TRUE; prop[SDOF_ZERO_TRANS_Y] = TRUE; prop[SDOF_ZERO_TRANS_Z] = TRUE; prop[SDOF_ZERO_ROT_X] = TRUE; prop[SDOF_ZERO_ROT_Y] = TRUE; prop[SDOF_ZERO_ROT_Z] = FALSE; } Thank you in advance for your help. |
|
June 7, 2016, 13:17 |
|
#2 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
other suggestion is to add couple of printing messages in your code so then you can see up to which part it works and locate the error easily. try to use add this to different parts of your code. Message("1"); Message("2"); Message("3"); Message("..."); |
||
June 7, 2016, 19:09 |
|
#3 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Use decimal places instead of commas in numbers:
Code:
prop[SDOF_IZZ] = 5,33e-11; |
|
June 8, 2016, 10:30 |
|
#4 | |
Member
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10 |
Quote:
I changed the decimal places instead of commas and added some messages in the UDFs as you said. When I run without the momentum source terms, it doesn't work too. But it is writen "6DOF angular has not converged" after the message for the update of properties. |
||
June 8, 2016, 11:44 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Did you add a user defined memory?
|
|
June 8, 2016, 12:38 |
|
#6 |
Member
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10 |
||
June 8, 2016, 14:51 |
|
#7 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Code:
C_UDMI(c,t,0)=source; |
||
June 9, 2016, 05:25 |
|
#8 |
Member
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10 |
I add the user defined location necessary but i have the same error of convergence.
|
|
June 9, 2016, 05:28 |
|
#9 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The change I suggested does not affect convergence issues, only segmentation faults. Your original question was about segmentation faults.
|
|
June 9, 2016, 05:31 |
|
#10 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
||
June 9, 2016, 05:45 |
|
#11 | ||
Member
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 10 |
Quote:
Quote:
|
|||
June 9, 2016, 06:01 |
|
#12 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
segmentation fault is related to he request of some information that is not available.
convergence is due to something wrong in the code that returns an unrealistic value. try to plot the values after initializing and see if they are what you expect. |
|
October 20, 2017, 09:48 |
|
#13 | ||
New Member
Hooman
Join Date: Jan 2016
Posts: 19
Rep Power: 10 |
Quote:
I have written this code for momentum source term for a two-phase VOF model but I faced this error: Error: received a fatal signal (Segmentation fault). what wrong is with it? do you have any idea which parameter is undefined? thank you. Quote:
|
|||
October 23, 2017, 05:40 |
|
#14 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
C_U(c,t) or C_MU_L(c,t) (velocity or viscosity)
You try to define a source that needs information on velocity and viscosity. But apparently Fluent calculates this source before it calculates velocity and/or viscosity. Solution: initialize your simulation without this UDF, and load the UDF afterwards. |
|
October 23, 2017, 10:39 |
received a fatal signal (Segmentation fault).
|
#15 | |
New Member
Hooman
Join Date: Jan 2016
Posts: 19
Rep Power: 10 |
Quote:
thank you for the reply. i did it as you said and also i run the simulation for a second without the UDF that fluent calculate that parameters but, the error appeared again. |
||
October 24, 2017, 05:40 |
|
#16 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Then find out what it by making a minimal example.
In the example below, I replaced C_U and C_MU_L by constants. Does it work now? Then the problem is in one of these two. Does it still not work? Then your problem is somewhere else. Code:
#include "udf.h" #define porosity 0.183 /*soil property porosity*/ #define sat_0_w 0.3 /*soil property residual water saturation*/ #define sat_0_g 0.1 // *************************shahab gerami page 134(table)**************************************** ****** #define k_abs 0.9671e-13 /* k: (intrinsic) permeability [L2] K: hydraulic conductivity [l/T ]=k rho gravity/nu */ DEFINE_SOURCE(source,c,t,dS,eqn) { Thread *mix_th, *water_th; real k_avrg, rel_k_m, source, sat_w, relsat_w, rel_k_w; mix_th = THREAD_SUPER_THREAD(t); water_th = THREAD_SUB_THREAD(mix_th, 0); sat_w = C_VOF(c,water_th); relsat_w = (sat_w-sat_0_w)/(1-sat_0_g-sat_0_w); rel_k_w = pow(relsat_w,4); rel_k_m = (1-pow(relsat_w,2))*pow((1-relsat_w),(2)); k_avrg = rel_k_w*sat_w+rel_k_m*(1-sat_w); source = -1e-6/(k_abs*k_avrg); dS[eqn] = -1e-6*/(k_abs*k_avrg); return source; } |
|
October 26, 2017, 19:28 |
|
#17 | |
New Member
Hooman
Join Date: Jan 2016
Posts: 19
Rep Power: 10 |
Quote:
i dont know what to do with that. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fluentError: received a fatal signal (Segmentation fault). | thomaszhangjing | Fluent UDF and Scheme Programming | 11 | January 13, 2021 10:37 |
a fatal signal (segmentation fault) | Turbo_hrf | Fluent UDF and Scheme Programming | 4 | September 14, 2017 10:35 |
Fluent udf Error: received a fatal signal (Segmentation fault) | syble | FLUENT | 3 | December 9, 2016 17:28 |
receive fluent received a fatal signal (Segmentation fault). | chenkaiqe | FLUENT | 2 | March 10, 2015 09:21 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |