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 ball motion inside a valve.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2015, 15:17
Default UDF for ball motion inside a valve.
  #1
New Member
 
Ahmed Jalal
Join Date: Mar 2015
Posts: 22
Rep Power: 11
A.Jalal is on a distinguished road
Hello All,

I am trying to simulate motion of a ball in a valve. The model I created is a simple 2D half model of the cross-section of a hypothetical valve. There is an attachment of the model.

I have created a UDF file to define motion of the ball due to velocity using the 6DOF solver. The symmetry line should also be deforming. I have a few questions.

1) Do I need to run a case without any Dynamic Mesh before compiling the code?

2) I keep getting an error that says: Unable to read motion history file

3) Can you please let me know if there are any suggestions to make to the UDF.

Here is the UDF for the motion:

#include "udf.h"

DEFINE_SDOF_PROPERTIES(Lightweight_ball, prop, dt, time,dtime)

{

prop[SDOF_ZERO_TRANS_X]= TRUE;
prop[SDOF_ZERO_TRANS_Z]= TRUE;

prop[SDOF_ZERO_ROT_X]= TRUE;
prop[SDOF_ZERO_ROT_Y]= TRUE;
prop[SDOF_ZERO_ROT_Z]= TRUE;


prop[SDOF_MASS] = 1e-3;


prop[SDOF_IXX] = 1.92e-8;
prop[SDOF_IYY] = 1.92e-8;
prop[SDOF_IZZ] = 1.92e-8;

}


And someone suggested I do a changing time step UDF as well:

#include "udf.h"
#include "dx.h"
#include "grid.h"
#include "var.h"
#include "mem.h"
#include "dynamesh_tools.h"


DEFINE_DELTAT(mydeltat,d)
{
int z_ID =5;
real urf = 0.5;
real mydx=1e-5;
real maxT= 1e-3;
real minT= 1e-10;

real time_step;
real my_vel;
real TS1;

Dynamic_Thread *ndt = NULL;

Thread *ball_ft = Lookup_Thread(d,z_ID);
ndt = THREAD_DT(ball_ft);

my_vel = DT_VEL_CG(ndt)[1];

TS1 = ABS(urf*mydx/(my_vel+0.00000001));
//Message("\n My TS1 %f",TS1);

time_step = MIN(TS1,maxT);
//Message("\n My Time Step1 %f",time_step);

time_step = MAX( time_step, minT);
Message("\n My Time Step %f",time_step);

return time_step;
}
Attached Images
File Type: png Valve Snippet.PNG (12.0 KB, 10 views)
A.Jalal is offline   Reply With Quote

Reply

Tags
6dof, dynamic meshing, mesh motion, remeshing


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
Display Zone motion of a dynamic mesh????Checking my UDF motion Irenedea FLUENT 0 March 20, 2014 03:17
Help me with the grid motion of udf yuanyeyzygo Fluent UDF and Scheme Programming 0 May 13, 2012 14:49
Fluent UDF Discontinuous Motion lequi7 Fluent UDF and Scheme Programming 2 November 4, 2011 00:18
How can i simulate a valve motion ???????? popi CFX 6 September 19, 2006 11:54
meshing F1 front wing Steve FLUENT 0 April 17, 2003 13:37


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