CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Segmentation Violation (https://www.cfd-online.com/Forums/fluent/97568-segmentation-violation.html)

peatmac February 20, 2012 11:56

Segmentation Violation
 
Hello all,

I am currently trying to run a simple simulation on Fluent - a cylinder oscillating in constant velocity field. The udf I am using is -

#include"udf.h"
/* this function defines velocity of center of gravity for pure plunging motion*/
/* Plunging motion equation is z(t)=h*sin(2*pi*f*t) */
DEFINE_CG_MOTION(plung,dt,vel,omega,time,dtime)
{
Thread*t;
face_t*f;
/*reset velocities */
NV_S(vel,=,0.0);
NV_S(omega,=,0.0);
if(!Data_Valid_P())
return;
/* Get the thread pointer for which this motion is defined */
t=DT_THREAD(dt);
/* vel[1] is the vertical plunging velocity */
vel[1] = 0.5*sin(time);
}

The cylinder is of frontal area 1m.
The fluid medium is of density 150kg/m3
Viscosity 1kg/m-s

I have checked mesh, it runs with the cylinder oscillating and produces no errors.

When I run the code, with the cylinder in constant velocity I get the following error -

Updating solution at time level N... done.

Updating mesh at time level N... done.
iter continuity x-velocity y-velocity time/iter

No error handler available

Error: FLUENT received a fatal signal (SEGMENTATION VIOLATION).
Error Object: ()


If anyone can advise of a solution or something for me to try I would be extremely grateful.

Regards,

Peter

peatmac February 21, 2012 10:20

Anyone have any ideas?

Thanks again.

cdf_user March 16, 2012 00:41

there are several problems in this udf. I will address one critical one. You are using a grid motion udf and you have written equation in terms of the nodes of the mesh.


if 2d:
begin_f_loop(f,thread,n)
f_node_loop(f,thread,n);
if(NODE_POS_NEED_UPDATE(v)
NODE_POS_UPDATED(v);
vel[0] = NODE_Y(v)*sin(2*pi*time);

for time you need to get flow time. there is a macro for that.

If your thread were a straight line of nodes, I am moving the nodes in sinusoidal form .

Therr are other problems in udf. I am busy. Hope this helps.


All times are GMT -4. The time now is 03:06.