Sie sind auf Seite 1von 1

Optimizing Timestep Size for Coupled Dynamic Mesh Problems (Solution 1018)

#include "udf.h" /* Compute velocity and timestep size */


#include "sg_mem.h" Vn = V_ball;
#include "dynamesh_tools.h“ Fm = f_glob[0]/b_mass;
dtm = ( -fabs(Vn) +
#define zoneID 28 /* zone ID for the ball */
sqrt( Vn*Vn + 4.0*fabs(Fm)*hmove ) )/
#define b_mass 1.0 /* mass of the ball */
( 2.0*fabs(Fm) );
#define dtm_mx 0.005 /* maximum delt */
if ( dtm > dtm_mx ) dtm = dtm_mx;
#define hmove 0.001 /* maximum distance */
Velx = Vn + Fm*dtm;
real V_ball = 0.0;
/* Update velocities, delt, and ball c.g. location */
real b_ctr = 0.0; /* center location of the ball */
tmsize = dtm;
DEFINE_EXECUTE_AT_END(exec_end) V_ball = Velx;
{ b_ctr += V_ball*tmsize;
real dtm, Velx, Vn, Fm;
RP_Set_Real("physical-time-step",tmsize);
real x_cg[3], f_glob[3], m_glob[3];
}
Domain *domain = Get_Domain(1);
Thread *tf = Lookup_Thread(domain,zoneID); DEFINE_CG_MOTION(valve_motion, dt, cg_vel,
cg_omega, time, dtime)
/* Get the previous c.g. for the ball zone */
{
x_cg[0] = b_ctr; NV_S(cg_vel, =, 0.0);
/* Compute the forces on the ball */ NV_S(cg_omega, =, 0.0);
Compute_Force_And_Moment(domain,tf, cg_vel[0] = V_ball;
x_cg,f_glob,m_glob,TRUE);
}

42 / 75

Das könnte Ihnen auch gefallen