|
[Sponsors] | |||||
Fluent udf Error: received a fatal signal (Segmentation fault) |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Join Date: Jun 2015
Posts: 10
Rep Power: 12 ![]() |
Hello,
I am trying to write a udf that would access some boundary face values and store them in a UMD_I memory and am encountering the Error: received a fatal signal (Segmentation fault). This is my udf: #include "udf.h" #include "sg.h" #include "flow.h" #include "unsteady.h" /* constants for calc_AlvPPs*/ #define MO2 15.999 /* oxygen molar mass g/mol*/ #define MCO2 44.01 /* carbon dioxide molar mass g/mol*/ #define InWalZoneID 8.0 /* ID of wall on cylinder where values will be accessed */ DEFINE_EXECUTE_AT_END(calc_AlvPPs) /* calc_AlvPPs - function name */ { Domain *d; Thread *t; cell_t c; face_t f; real MFaO2; real MFaCO2; real PaO2; real PaCO2; real Pa = 0; real MeanMolarMass; d = Get_Domain(InWalZoneID); thread_loop_f (t,d) { begin_f_loop (f,t) { Pa += F_P(f,t); MFaCO2 = F_YI(f,t,0); MFaO2 = F_YI(f,t,1); MeanMolarMass = 1/(MFaCO2/MCO2 + MFaO2/MO2); PaCO2 = Pa*MFaCO2*MeanMolarMass; PaO2 = Pa*MFaO2*MeanMolarMass; F_UDMI(f,t,0) = PaCO2; F_UDMI(f,t,1) = PaO2; } end_f_loop (f,t) } } Even when I comment out the inside of the threat_loop_f out I still get this error. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0 ![]() |
Maybe a stupid remark, but did you initialize the UDMIs you are calling? A segmentation fault typically tells FLUENT tries to access a non-allocated memory location.
|
|
|
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Jun 2015
Posts: 10
Rep Power: 12 ![]() |
Hi CeesH thanks for the message, I believe I had by clicking define-> user defined -> memory. There is currently two user-defined memory locations in the Fluent setup.
As I mentioned I get this error even if I comment out everything in the thread_loop_f loop. |
|
|
|
|
|
|
|
|
#4 | |
|
Senior Member
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 19 ![]() |
Syble,
Did you solve this? I am having similar issue and I printed some messages at different parts of the code to see where the error is being generated and saw that when I use "thread_loop_c (t,domain)" I get the error. not sure why? any idea? Quote:
|
||
|
|
|
||
![]() |
| Tags |
| fluent, segmentaion fault, thread_loop_f, udf |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| fluentError: received a fatal signal (Segmentation fault). | thomaszhangjing | Fluent UDF and Scheme Programming | 12 | December 5, 2025 02:14 |
| Fluent15: received a fatal signal (Segmentation fault) | lcg44 | FLUENT | 4 | August 29, 2016 13:19 |
| FLUENT received fatal signal (ACCESS_VIOLATION) | shashikant | FLUENT | 3 | November 29, 2014 13:03 |
| fluent 13.0.0 received a fatal signal (SEGMENTATION VIOLATION)) | alinik | FLUENT | 1 | January 9, 2014 11:21 |
| A fatal signal (segmentation violation) | sutthinan | Fluent UDF and Scheme Programming | 6 | March 16, 2011 19:35 |