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

Error SIGSEGV for a simulation with UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2019, 04:29
Default Error SIGSEGV for a simulation with UDF
  #1
New Member
 
Francesco Labianca
Join Date: Jun 2019
Posts: 6
Rep Power: 7
francescolab is on a distinguished road
Hi, i wrote an UDF for the control of the adaptive time step, i have the error in the picture from fluent. How can i solve?

Quote:
#include "udf.h"
#include"udf.h"
#include"metric.h"
#include"stdio.h"
#include"math.h"
#include"stdlib.h"
#include"mem.h"

DEFINE_DELTAT(deltat,d)
{
real time_step;
real tx=CURRENT_TIME;
Thread *t,*t0, *t1 =NULL;
cell_t c0, c1 =-1;
face_t f;
real x0[ND_ND];
real x1[ND_ND];
real time_step_x;
real time_step_y;
int n =0;
real dx =0.0, dy =0.0;
real cent[2];
double centr_x, centr_y;
double vel_x, vel_y;
n =0;
Domain *domain;
domain = Get_Domain(1);
time_step=0.01;
if ( tx<=0 ) {
time_step=0.01;
} else {
thread_loop_f(t,domain)
{
begin_f_loop (f,t)
{
c0 = F_C0(f,t);
t0 = F_C0_THREAD(f,t);
if (BOUNDARY_FACE_THREAD_P(t))
{}
else
{
n+=1;
t1 = F_C1_THREAD(f,t);
c1 = F_C1(f,t);
C_CENTROID(x0,c0,t0);
C_CENTROID(x1,c1,t1);
dx = x1[0]-x0[0];
dy = x1[1]-x0[1];

F_CENTROID(cent,f,t);

centr_x = cent[0];
centr_y = cent[1];
vel_x = F_U(f,t);
vel_y = F_U(f,t);
if(time_step<0)
{
time_step_x=abs((dx / vel_x) *0.8);
time_step_y=abs((dy / vel_y) *0.8);
time_step=MIN(time_step_x,time_step_y);
}
else
{
time_step=MIN (time_step, abs(dx / vel_x) *0.8);
time_step=MIN (time_step, abs(dy / vel_y) *0.8);
}
}
end_f_loop(f,t)
}

}
}
return time_step;
}
https://ibb.co/jWnyrgB

francescolab is offline   Reply With Quote

Old   July 10, 2019, 04:50
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
stop copy/paste threads!
use your previous one Udf for adaptive time step, error in loop

best regards
AlexanderZ is offline   Reply With Quote

Reply


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
UDF for Wall Boundary moving Left and right to create wave Simulation in a Flume buerskin Fluent UDF and Scheme Programming 3 September 30, 2024 01:05
Pigging simulation using udf MagFire FLUENT 4 September 10, 2018 09:02
Fluent/icepak UDF for heat pipe simulation debuger Fluent UDF and Scheme Programming 0 July 19, 2017 13:05
Simulation with UDF for species mass fraction and velocity profile virgy Fluent UDF and Scheme Programming 8 February 7, 2012 05:30
UDF to change Rotation Speed in a MRF simulation Mike FLUENT 3 September 27, 2011 07:46


All times are GMT -4. The time now is 15:42.