|
[Sponsors] |
June 17, 2023, 12:49 |
[FLUENT UDF] Received signal SIGSEGV
|
#1 |
New Member
Join Date: Mar 2021
Posts: 25
Rep Power: 5 |
Hi all,
Recently I was trying to run a simulation with UDF. The UDF contains 4 functions as below: Code:
#include "udf.h" DEFINE_MASS_TRANSFER(ammonia_con, cell, thread, from_index, from_species_index, to_index, to_species_index) { real rate; Thread *gas = THREAD_SUB_THREAD(thread, from_index); Thread *liquid = THREAD_SUB_THREAD(thread, to_index); real temp = C_T(cell, gas); rate = 0.; if (temp >= -20.0 && temp <= 20.0) { rate = -0.2056*temp*temp - 0.5981*temp + 9.9534; } if ((rate == 0. ) && (temp > 20.0)) { rate = 0; } return (rate); } DEFINE_MASS_TRANSFER(ammonia_eva, cell, thread, from_index, from_species_index, to_index, to_species_index) { real rate; Thread *liq = THREAD_SUB_THREAD(thread, from_index); Thread *gas = THREAD_SUB_THREAD(thread, to_index); real temp = C_T(cell, liq); rate = 0.; if (temp >= 25.0 && temp <= 140.0) { rate = 0.0173*temp*temp + 1.931*temp + 3.5726; } if ((rate == 0. ) && (temp < 25.0)) { rate = 0; } return (rate); } DEFINE_MASS_TRANSFER(water_con, cell, thread, from_index, from_species_index, to_index, to_species_index) { real rate; Thread *gas = THREAD_SUB_THREAD(thread, from_index); Thread *liq = THREAD_SUB_THREAD(thread, to_index); real temp = C_T(cell, gas); rate = 0.; if (temp >= -20.0 && temp <= 20.0) { rate = 0.3435*temp*temp + 6.9549*temp + 78.262; } if ((rate == 0. ) && (temp > 20.0)) { rate = 0; } return (rate); } DEFINE_MASS_TRANSFER(water_eva, cell, thread, from_index, from_species_index, to_index, to_species_index) { real rate; Thread *liq = THREAD_SUB_THREAD(thread, from_index); Thread *gas = THREAD_SUB_THREAD(thread, to_index); real temp = C_T(cell, liq); rate = 0.; if (temp >= 25.0 && temp <= 140.0) { rate = 0.0195*temp*temp + 0.5216*temp; } if ((rate == 0. ) && (temp < 25.0)) { rate = 0; } return (rate); } Code:
Node 0 Fatal signal raised sig = Segmentation fault aa053010 CX_Primitive_Error 9c08b8f0 log2f aa0f5a20 logical_right_shift 98f6ec30 _C_specific_handler 9ecb3bd0 _chkstk 9ec2d9c0 RtlFindCharInUnicodeString 9ecb2cc0 KiUserExceptionDispatcher a8c061b0 init_cell_vector aa0f5a20 logical_right_shift a7d48550 Calculate_Mass_Transfer a79fea10 Init_Face_Flux a7a10c00 Init_Flow a72b5fc0 Delay_Error aa0e0250 eval a72a7e50 PRF_Command_Start a72aa570 PRF_Node_repl a72b5fc0 Delay_Error aa0f5a20 logical_right_shift 9d3b2690 BaseThreadInitThunk 9ec6a9d0 RtlUserThreadStart Node 0 Fatal signal raised sig = Segmentation fault 2e673010 CX_Primitive_Error 6473b8f0 log2f 2e715a20 logical_right_shift 4782ec30 _C_specific_handler 670d3bd0 _chkstk 6704d9c0 RtlFindCharInUnicodeString 670d2cc0 KiUserExceptionDispatcher 2d2261b0 init_cell_vector 2e715a20 logical_right_shift 2c368550 Calculate_Mass_Transfer 2c01ea10 Init_Face_Flux 2c030c00 Init_Flow 2b8d5fc0 Delay_Error 2e700250 eval 2b8c7e50 PRF_Command_Start 2b8ca570 PRF_Node_repl 2b8d5fc0 Delay_Error 2e715a20 logical_right_shift 65f82690 BaseThreadInitThunk 6708a9d0 RtlUserThreadStart Error [node 0] [time 6/17/23 23:38:49] Abnormal Exit! Thanks in advance. |
|
July 3, 2023, 01:42 |
|
#2 |
Member
Join Date: Jul 2020
Location: India
Posts: 66
Rep Power: 6 |
I think you have missing pre-processor directives. Check for what other pre-processor directives you need based on the models you are using.
|
|
July 3, 2023, 01:44 |
|
#3 |
Member
Join Date: Jul 2020
Location: India
Posts: 66
Rep Power: 6 |
Note one thing. Segmentation fault is due to something you are trying to retrieve from your UDF which is not available from your UDF.
|
|
July 21, 2023, 06:56 |
|
#4 | |
New Member
Join Date: Mar 2021
Posts: 25
Rep Power: 5 |
Quote:
Are there any other pre-processor directives? I only found #udf.h. Do I need to prepare a separate file and include it in the UDF? Thanks a bunch. |
||
July 22, 2023, 15:12 |
Seg fault
|
#5 |
Member
Thamilmani M
Join Date: Sep 2017
Location: IIT Bombay, Mumbai
Posts: 52
Rep Power: 9 |
Just like @Cooper24 said, you are getting Segmentation fault due to retrieving blank or arbitrary address. Try to initialize and run your simulation for some iterations and then hook your UDF and see if the segmentation error still continues.
I don't think any other preprocessor directives are needed for your code.
__________________
Always Thedal |
|
Tags |
fluent - udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Node xx: Process: xx received signal SIGSEGV | kds | Fluent UDF and Scheme Programming | 1 | February 4, 2023 11:40 |
Received signal SIGSEGV and BAD TERMINATION | ali.ashouri | Fluent UDF and Scheme Programming | 1 | September 21, 2022 01:31 |
Process 10300: Received signal SIGSEGV | metaliat93 | FLUENT | 2 | January 28, 2020 01:53 |
error: Received signal SIGSEGV | ianziti92 | Fluent UDF and Scheme Programming | 2 | December 5, 2018 17:25 |
define_wall_functions density and dynamic viscosity | Ionut G | Fluent UDF and Scheme Programming | 3 | March 15, 2017 11:10 |