TAGGED: sigsegv-error, udf
-
-
July 30, 2024 at 9:46 pmALEXANDRE COSTABbp_participant
Hello,
I am getting a segmentation fault error in fluent. After trying to use
the following udf :
#include "udf.h"
#define tau_s 250.0
#define alpha 3.63e-7
#define beta 2.416
#define cc 0.785
DEFINE_SOURCE(hsource, c, t, dS, eqn)
{
real source;
real tau_xx, tau_yy, tau_zz, h_tau, tau_vm, h_l;
h_l = C_UDSI(c,t,0);
tau_xx = -2.*C_MU_L(c,t)*C_DUDX(c,t);
tau_yy = -2.*C_MU_L(c,t)*C_DVDY(c,t);
tau_zz = -2.*C_MU_L(c,t)*C_DWDZ(c,t);
h_tau = 0.5*( pow(tau_xx + tau_yy + tau_zz,2) - (pow(tau_xx,2) + pow(tau_yy,2) + pow(tau_zz,2)));
tau_vm = sqrt(-1*h_tau);
if (tau_vm <= tau_s)
{
source = 0;
dS[eqn] = 0;
}
else
{
source = pow(cc,1./beta)* pow(tau_vm, alpha/beta)*(1 - h_l) ;
dS[eqn] = -pow(cc,1./beta)* pow(tau_vm, alpha/beta);
}
return source;
}
Below is the reported error.log :
Node 1 Fatal signal raised sig = Segmentation fault
25179dd0 CX_Primitive_Error
66640cc0 seh_filter_exe
251eb630 logical_right_shift
5631f6a0 _C_specific_handler
68a11fb0 _chkstk
689c1020 RtlRaiseException
68a10bd0 KiUserExceptionDispatcher
610e0000 Ordinal0
241b4e30 user_sources
2445d560 UDS_Derivatives
2445d560 UDS_Derivatives
22f81570 Models_Send_update_solve
23648590 solver_update
23644a30 Flow_Iterate
22e58ae0 Set_panfs_optimum_file_layout
251d5e60 eval
22f5c7b0 PRF_Command_Start
22f5eed0 PRF_Node_repl
22f6a910 Delay_Error
251eb630 logical_right_shift
67d37020 BaseThreadInitThunk
689c2630 RtlUserThreadStart
Error [node 1] [time 7/26/24 16:32:6] Abnormal Exit!
Node 1 Fatal signal raised sig = Segmentation fault
19559dd0 CX_Primitive_Error
bd930cc0 seh_filter_exe
195cb630 logical_right_shift
ac30f6a0 _C_specific_handler
bfa11fb0 _chkstk
bf9c1020 RtlRaiseException
bfa10bd0 KiUserExceptionDispatcher
433c0000 Ordinal0
18594e30 user_sources
1883d560 UDS_Derivatives
1883d560 UDS_Derivatives
17361570 Models_Send_update_solve
17a28590 solver_update
17a24a30 Flow_Iterate
17238ae0 Set_panfs_optimum_file_layout
195b5e60 eval
1733c7b0 PRF_Command_Start
1733eed0 PRF_Node_repl
1734a910 Delay_Error
195cb630 logical_right_shift
be3c7020 BaseThreadInitThunk
bf9c2630 RtlUserThreadStart
Error [node 1] [time 7/30/24 18:27:45] Abnormal Exit!
Anyone has a clue what is happening? It is compiling and loading fine.
Thanks. -
July 31, 2024 at 9:25 amRobForum Moderator
You may need to include mem.h  https://ansyshelp.ansys.com/public/account/secured?returnurl=/Views/Secured/corp/v242/en/flu_udf/flu_udf_DataAccessMacros.html?q=C_DUDX Also check the scalars are set and have a value.Â
-
August 1, 2024 at 7:34 pmALEXANDRE COSTABbp_participant
Hi Rob,
It is still crashing with include "mem.h".Â
Should I allocate UDMs for C_MU_L(c,t), C_DUDX(c,t), C_DVDY(c,t), C_DWDZ ?
Thanks. -
August 2, 2024 at 8:32 amRobForum Moderator
You shouldn't need UDMs, but double check those macros are available - you may need to tell Fluent to retain data as some of the gradients are not held in RAM by default. There's a TUI command in the manual regarding that.Â
-
August 2, 2024 at 1:47 pmALEXANDRE COSTABbp_participant
Tried : /solve/set/expert
Keep temporary solver memory for being freed? [no] yesNo success.
-
August 5, 2024 at 12:56 pmRobForum Moderator
Is h_tau always less than zero? Would using absolute(h_tau) be safer than SQRT(-1.x.h_tau)?
You need to check though the code and make sure everything has a sensible value.Â
-
- You must be logged in to reply to this topic.
-
421
-
192
-
178
-
162
-
141
© 2024 Copyright ANSYS, Inc. All rights reserved.