|
[Sponsors] |
UDF problem, Node 0: Process 31532: Received signal SIGSEGV error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 5, 2023, 08:02 |
UDF problem, Node 0: Process 31532: Received signal SIGSEGV error
|
#1 |
New Member
Bartłomiej Filip
Join Date: Jan 2023
Posts: 1
Rep Power: 0 |
Hello,
I have a problem with my UDF. My case is about adsorption model and I want to use my UDF properly. Here is my code: Code:
#include "udf.h" #include "mem.h" DEFINE_ADJUST(ads, domain) /*Henry's linear isotherm function*/ { Thread *t; cell_t c; int i = 0; real H; real fraction = C_YI(c,t,i); H = 0; thread_loop_c(t, domain) { begin_c_loop(c,t) { C_UDSI(c,t,0) = H * fraction; } end_c_loop(c,t) } } DEFINE_ADJUST(q_ads, domain) /*qi of every iteration is calculated and stored by this UDF*/ { Thread *t; cell_t c; real dt; real kmq; kmq = 1000; thread_loop_c(t, domain) { begin_c_loop(c, t) { dt = RP_Get_Real("physical-time-step"); C_UDSI(c,t,1) = C_UDSI_M1(c,t,1) + kmq * dt * (C_UDSI_M1(c,t,0) - C_UDSI_M1(c,t,1)); } end_c_loop(c, t) } } DEFINE_ADJUST(d_ads, domain) /*Mass source term of every iteration is calculated and stored by this UDF*/ { Thread *t; cell_t c; real kmq; kmq = 1000; thread_loop_c(t, domain) { begin_c_loop(c, t) { C_UDSI(c,t,2) = kmq * (C_UDSI(c,t,0) - C_UDSI(c,t,1)); } end_c_loop(c, t) } } DEFINE_SOURCE(m_src, c, t, dS, eqn) /*Function to hook mass source term into Fluent*/ { dS[eqn] = 0.0; return C_UDSI_M1(c,t,2); } Node 0: Process 31532: Received signal SIGSEGV error I'm using Species model, transient, axisymmetric 2D, laminar. I'm new in UDFs, so please be patient. Thanks a lot for any kind of answer. |
|
January 8, 2023, 15:28 |
|
#2 |
New Member
Andrew
Join Date: Dec 2022
Posts: 29
Rep Power: 4 |
I had this problem recently, and in my case the issue was that I was passing the improper thread to the macro functions (such as C_YI, or the UDSI functions). I've also seen some threads where calls to the user defined scalar macros throw SIGSEGVs because their values were not properly allocated in the memory.
I'd recommend trying to isolate your error further to an individual macro function. You mentioned the first DEFINE_ADJUST function is throwing the error, but which line is the source of the error? There may be more than one. Try commenting individual lines out until the error goes away. Also, does it throw a SIGSEGV upon initialization, or only during runtime? In case it helps, here's the thread about my similar problem, with solution described. Can't be sure if this is applicable to your case without more info, but it's a start: Fluent UDFs crash at initialization/run with temperature & species macros If you provide some more info and are able to isolate to a specific macro/line in your UDF, we may be able to help more. |
|
Tags |
fluent, problem, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gmsh reports an OpenCascade exception when opening a .geo file | algc | Main CFD Forum | 2 | October 24, 2022 06:59 |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 01:21 |
Compile calcMassFlowC | aurore | OpenFOAM Programming & Development | 13 | March 23, 2018 08:43 |
error compiling modified applications | yvyan | OpenFOAM Programming & Development | 21 | March 1, 2016 05:53 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |