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

UDF for an oscillating 3d body

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 7, 2014, 17:01
Default UDF for an oscillating 3d body
  #1
New Member
 
Join Date: Mar 2014
Posts: 4
Rep Power: 12
Pinto is on a distinguished road
I am trying to oscillate a 3d body in in the heave direction in Fluent and also read the Force-Time graph.
Here is my UDF:

/************3D Body************************/
#include "udf.h"
#include "dynamesh_tools.h"
#include "sg_mem.h"
#include "unsteady.h"
real t;
real n;
real dtm;
real m_glob;
real x_cg;
real f_glob;
FILE *fp;

/*Velocity vector of the center of gravity*/

static real Omega_CG[2];
static int i;


DEFINE_EXECUTE_AT_END(exe_end)
{

real x_cg[n],f_glob[n],m_glob[n];
Domain *domain=Get_Domain(1);
Thread *tf=Lookup_Thread(domain,6);
usrloop(n,ND_ND)
x_cg[n]=f_glob[n]=m_glob[n]=0;

if (!Data_Valid_P())
return;
Compute_Force_And_Moment(domain,tf,x_cg,f_glob,m_g lob,TRUE);

t+=dtm;
fp=fopen("udf.txt","a");
fprintf(fp,"%5f,%.8f\n",t,f_glob[2]);
fclose(fp);
}


DEFINE_CG_MOTION(ssu, dt, cg_vel, cg_omega, time, dtime)
{
real delta_t;
real freq = 2; real amp = 0.1;
real omega;
real vel;
Domain *domain;
Thread *tf;

omega=2.0*3.143*freq;

/* disp=-Asin(omega*t) */ /* vel =-A*omega*cos(omega*t) */

vel=-amp*omega*cos(omega*time);
cg_vel[0]=0;
cg_vel[1]=0;
cg_vel[2]=vel;
NV_S (cg_omega, =, 0.0);
}

I have received a syntax error after loading this UDF.

Can someone please tell me what to do or if you can give a a better one.

Thanks
Pinto is offline   Reply With Quote

Reply

Tags
3d body heave, udf for oscillating


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
water sloshing in oscillating tank (problem using udf Define_ZONE_MOTION) Tamsu Fluent UDF and Scheme Programming 8 November 24, 2021 01:11
Dynamic mesh udf for oscillating wall QBeast Fluent UDF and Scheme Programming 3 December 17, 2020 03:03
error in using a UDF to control the dynamic Mesh of a flexible oscillating Membrane M201170944 Fluent UDF and Scheme Programming 1 March 3, 2014 08:36
6dof udf for flying body Mahmoud Fluent UDF and Scheme Programming 1 January 21, 2014 04:58
fan driven flow, Fan BC validation (getting lost) soonic OpenFOAM Running, Solving & CFD 0 July 7, 2013 20:16


All times are GMT -4. The time now is 17:55.