CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

DEFINE_PROFILE ---- SIGSEGV error - Multiphase

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 19, 2020, 12:14
Default DEFINE_PROFILE ---- SIGSEGV error - Multiphase
  #1
Member
 
ssa
Join Date: Sep 2018
Posts: 93
Rep Power: 7
ssa_cfd is on a distinguished road
Hi all,

I am new to UDF programming and I am doing a UDF for heat transfer coefficient in multiphase simulation. The code compiles good, but produces a SIGSEGV error on execution.

Code:
#include "udf.h"
DEFINE_PROFILE(heat_gas_wall,t,i)
{
  Message0("TEst 00000000000");
  /*face thread*/
Thread *ti = THREAD_SUB_THREAD(t,0);
Thread *tj = THREAD_SUB_THREAD(t,1);
/*cell thread*/
Thread *tci = THREAD_T0(ti);
Thread *tcj = THREAD_T0(tj);
cell_t c;
face_t f;
Message0("TEst 0");
real v_x=0., v_y=0., v_z=0.;
real vel;
v_x = C_U(c,tcj) - C_U(c,tci);
v_y = C_V(c,tcj) - C_V(c,tci);
v_z = C_W(c,tcj) - C_W(c,tci);
vel = sqrt(v_x*v_x + v_y*v_y + v_z*v_z);
/*NV_DD(v,=,C_U(c,tcj),C_V(c,tcj),C_W(c,tcj),-,C_U(c,tci),C_V(c,tci),C_W(c,tci));
vel = NV_MAG(v);*/
real beta = 90; 
real D=1; 
/*dia of kiln*/
Message0("TEst 0.5");
real De = 0.5*D*(2*M_PI-beta+sin(beta*M_PI/180))/(M_PI-beta/2-sin((beta*M_PI/180)/2));
Message0("TEst 0.6");
real Re = RE_NUMBER(C_R(c,tci),vel,De,C_MU_L(c,tci));
Message0("TEst 0.7");
real kg = 1; 
/*C_K_L(c,tci);*/
real omega=0.1; 
Message0("TEst 1");
/*real xc = 0.01*0.1;*/
/*particle dia * experiment constant*/
/*real kb=C_K_L(c,tcj);*/
/*thermal conductivity of bed*/
Message0("TEst 2");
real pb=1;
/*C_R(c,tcj);*/
/*density of bed*/
Message0("TEst 3");
/*real cp=C_CP(c,tcj);*/
/*heat capacity of bed*/
real Rew = pow(De,2)*omega*pb/C_MU_L(c,tci);
Message0("TEst 4");

FILE *fp, *val;
fp = fopen("htc_gas_wall.txt","a+");
val = fopen("htc_val.txt","a+");

begin_f_loop(f,t)
{
fprintf(val, "%f,%f,%f,%f\n", Re, Rew,kg,De);
fprintf(fp, "%f\n", 1.54*pow(Re,0.575)*pow(Rew,-0.292)*kg/De);

/*F_PROFILE(f,ti,i) = 1.54*pow(Re,0.575)*pow(Rew,-0.292)*kg/De; */
/*F_PROFILE(f,tj,i) = pow(xc/kg+pow(2*sqrt(kb*pb*cp/(M_PI*tc)),-1),-1); */
 }
end_f_loop(f,t)
Message0("TEst 5");
fclose(val);
fclose(fp);
}
And the output from the files are
htc_gas_wall.txt
Quote:
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
31.066258
htc_val.txt
Quote:
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
29261.040588,5488.875738,1.000000,0.971641
The error message from fluent is attached as image. I thought the C_R, C_U, C_K_L such macros are creating this error. But even after setting those values to 1, produces the same error.

How to solve this error.?

Thanks,
Senthil.
Attached Images
File Type: png Screenshot.png (6.0 KB, 6 views)
ssa_cfd is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Node 0: Process 15088: Received signal SIGSEGV. hasib61 FLUENT 7 September 4, 2022 01:25
SIGSEGV Memory Access Exeption when Exporting Files using 'Update' JamesPermain STAR-CCM+ 0 April 22, 2020 10:50
Process 10300: Received signal SIGSEGV metaliat93 FLUENT 2 January 28, 2020 00:53
error: Received signal SIGSEGV ianziti92 Fluent UDF and Scheme Programming 2 December 5, 2018 16:25
define_wall_functions density and dynamic viscosity Ionut G Fluent UDF and Scheme Programming 3 March 15, 2017 10:10


All times are GMT -4. The time now is 19:05.