调节阀动网格分析
cfd吧
全部回复
仅看楼主
level 3
技术邻作者:steve_zheng
阀芯受水力载荷的作用作用晃动。
流体属性:航空液压油
节流阀初始压力:11MPa
阀芯弹簧初始行程:11mm
弹簧弹性模量:1.35N/mm
1、几何模型如下:
2、抽取流体域及网格划分,采用1/4模型进行计算,加入周期性边界条件
2016年09月29日 08点09分 1
level 3
3、采用DEFINE_CG_MOTION的形式定义阀芯运动,具体UDF如下:
# include "udf.h"
# include "dynamesh_tools.h"
# define DEBUG 1
# define NO_OF_VALVES 9
# define NO_OF_ZONES 15
/*************************** User Input Starts *****************************/
# define INITIAL_LIFT -28e-3
static int valveid[NO_OF_VALVES][NO_OF_ZONES]={{190,129,135,141,175,168,162,176,149, -1}};
static real lift_min[NO_OF_VALVES]={0.0272};
static real lift_max[NO_OF_VALVES]={0.034};
static real mass[NO_OF_VALVES]={0.025};
static real stiffness[NO_OF_VALVES]={1500};
static real stretch_at_closed[NO_OF_VALVES]={0};
static real rest_conts[NO_OF_VALVES]={0};
static real current_vel_mag[NO_OF_VALVES]={0};
/*************************** User Input Ends *******************************/
static real axis[NO_OF_VALVES][ND_ND]={{0, 0, 1}}; /* normalized */
static real r_rp_closed[NO_OF_VALVES][ND_ND]={{0,0,0}};
static real cur_r_rp[NO_OF_VALVES][ND_ND]={{0, 0,INITIAL_LIFT}};
static real previous_time[NO_OF_VALVES]={0};
static void f_valve(int valveNo, void *dt, real *cg_vel, real *cg_omega, real time, real dtime)
{
#if !RP_HOST
real tmp[ND_ND], dv, current_vel[ND_ND], CG[ND_ND], force[3], moment[3], stretch;
real aero_force[ND_ND], aero_force_axis, spring_force, net_force,
r_rp_new[NO_OF_VALVES][ND_ND];
int i;
Thread * tf;
Domain * domain;
/******************************************************************/
static real cg_vel_saved[NO_OF_VALVES][ND_ND];
/******************************************************************/
/* Do the calculation if the new time step */
if(fabs(previous_time[valveNo]-time)>0.2*dtime)
{
/* reset velocities */
NV_S (cg_vel, =, 0.0);
/* Check to see if there is data */
if (!Data_Valid_P ())
{
Message0("\n\nNo data->No mesh motion!!!\n\n");
return;
}
2016年09月29日 08点09分 2
level 3
/*Calculate force*/
domain = THREAD_DOMAIN (DT_THREAD ((Dynamic_Thread *)dt));
i=0;
NV_S(aero_force,=,0);
while(valveid[valveNo][i]>=0)
{
tf=Lookup_Thread(domain, valveid[valveNo][i]);
NV_S (CG, =, 0.0);
Compute_Force_And_Moment (domain, tf, CG, force, moment, FALSE);
NV_V(aero_force,+=,force);
i++;
}
aero_force_axis=NV_DOT(aero_force, axis[valveNo]);
NV_VV(tmp,=,r_rp_closed[valveNo],+,cur_r_rp[valveNo]);
stretch = (stretch_at_closed[valveNo]+NV_DOT(tmp,axis[valveNo]));
spring_force=stiffness[valveNo]*stretch;
net_force=-spring_force+aero_force_axis;
dv=net_force/mass[valveNo]*dtime;
/* Calculate the C.G location and velocity if it does not hit the boundary */
NV_VS(current_vel,=,axis[valveNo],*,current_vel_mag[valveNo]);
NV_VS(tmp,=,current_vel,*,dtime);
NV_VV(r_rp_new[valveNo],=,cur_r_rp[valveNo],+,tmp);
/* Update velocity */
current_vel_mag[valveNo]+=dv;
/* debug info */
#if DEBUG
Message0("\n\n*********************** VALVE INFO ***************************\n");
Message0("\nCurrent valve lift =%10.3e\n", -NV_DOT(cur_r_rp[valveNo], axis[valveNo]));
Message0("\nCurrent valve velocity =%10.3e\n", current_vel_mag[valveNo]-dv);
Message0("\naero force =%10.3e\n", aero_force[2]);
Message0("\n(stretching at closed, stretching, force)=(%10.3e, %10.3e, %10.3e)\n",
stretch_at_closed[valveNo], stretch, spring_force);
Message0("\n(net_force, spring force, aero force)=(%10.3e, %10.3e, %10.3e)\n",
net_force, spring_force, aero_force_axis);
#endif
/* if it hits the lift_min boundary then it stays at lift_min*/
NV_VV(tmp,=,r_rp_closed[valveNo],-,r_rp_new[valveNo]);
if(NV_DOT(tmp,axis[valveNo])<1.0000001*(lift_min[valveNo]))
{
NV_V_VS(r_rp_new[valveNo],=,r_rp_closed[valveNo],-,axis[valveNo],*,lift_min[valveNo]);
current_vel_mag[valveNo]=-rest_conts[valveNo]*fabs(current_vel_mag[valveNo]);
#if DEBUG
Message0("\n Valve hits the min valve lift\n");
#endif
}
/* if it hits the lift_max boundary then it stays at lift_max*/
NV_VV(tmp,=,r_rp_closed[valveNo],-,r_rp_new[valveNo]);
if(NV_DOT(tmp,axis[valveNo])>0.99999999*(lift_max[valveNo]))
{
NV_V_VS(r_rp_new[valveNo],=,r_rp_closed[valveNo],-,axis[valveNo],*,lift_max[valveNo]);
current_vel_mag[valveNo]=rest_conts[valveNo]*fabs(current_vel_mag[valveNo]);
#if DEBUG
Message0("\n Valve hits the max valve lift\n");
#endif
}
/* set valve velocity */
NV_VV(tmp,=,r_rp_new[valveNo],-,cur_r_rp[valveNo]);
NV_VS(cg_vel,=,tmp,/,dtime);
/* Update location and velocity */
NV_V(cur_r_rp[valveNo],=,r_rp_new[valveNo]);
NV_V(cg_vel_saved[valveNo],=,cg_vel);
previous_time[valveNo]=time;
/* debug info */
#if DEBUG
Message0("\nNext valve velocity =%11.3e\n", current_vel_mag[valveNo]);
Message0("\nNext valve lift =%10.3e\n", -NV_DOT(r_rp_new[valveNo], axis[valveNo]));
Message0("\n*********************** VALVE INFO ***************************\n\n");
#endif
}
else
{
NV_V(cg_vel,=,cg_vel_saved[valveNo]);
}
#endif
node_to_host_real(current_vel_mag, NO_OF_VALVES);
node_to_host_real(cur_r_rp[0], NO_OF_VALVES*ND_ND);
node_to_host_real(previous_time, NO_OF_VALVES);
}
DEFINE_CG_MOTION(valve, dt, cg_vel, cg_omega, time, dtime)
{
f_valve(0, dt, cg_vel, cg_omega, time, dtime);
node_to_host_real(cg_vel,ND_ND);
node_to_host_real(cg_omega,ND_ND);
}
2016年09月29日 08点09分 3
你好,调节阀动网格分析 这篇帖子的UDF 很不错,我想学习,看了好久有些地方还是不明白,你能发一个解释的帖子吗,UDF中有些名字也不知道对应的是模型的那个部分,谢谢
2017年05月20日 12点05分
1