声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2332|回复: 1

[UDF专题] 懸臂樑振動的動網格問題

[复制链接]
发表于 2007-7-24 15:53 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
/**********************************************************
*
* node motion based on simple beam deflection equation
* compiled UDF
*
**********************************************************/
#include "udf.h"
DEFINE_GRID_MOTION(beam, domain, dt, time, dtime)
{
Thread *tf = DT_THREAD (dt);
face_t f;
Node *v;
real NV_VEC (omega), NV_VEC (axis), NV_VEC (dx);
real NV_VEC (origin), NV_VEC (rvec);
real sign;
int n;
/* set deforming flag on adjacent cell zone */
SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));
sign = -5.0 * sin (26.178 * time);
Message ("time = %f, omega = %f\n", time, sign);
NV_S (omega, =, 0.0);
NV_D (axis, =, 0.0, 1.0, 0.0);
NV_D (origin, =, 0.0, 0.0, 0.152);
begin_f_loop (f, tf)
{
f_node_loop (f, tf, n)
{
v = F_NODE (f, tf, n);
/* update node if x position is greater than 0.02
and that the current node has not been previously
visited when looping through previous faces */
if (NODE_X (v) > 0.020 && NODE_POS_NEED_UPDATE (v))
{
/* indicate that node position has been update
so that it's not updated more than once */
NODE_POS_UPDATED (v);
omega[1] = sign * pow (NODE_X (v)/0.230, 0.5);
NV_VV (rvec, =, NODE_COORD (v), -, origin);
NV_CROSS (dx, omega, rvec);
NV_S (dx, *=, dtime);
NV_V (NODE_COORD (v), +=, dx);
}
}
}
end_f_loop (f, tf);
}



這是我從幫助裡下載的懸臂樑UDF,UDF是成功載入了,但是在Dynamic Mesh-->Parameters裡不知道要輸入哪些必要參數,所以就沒有更改按OK。
接下來在Zones中我選擇的運動區域就是懸臂梁的3條邊(為一個整體邊界)類型為Rigid Body,其他沒改,但是卻出現警告(Warning: incorrect cg motion UDF BEAM::libudf on zone 4 (assuming no motion)),這是為什麼呢?PS:我的懸臂樑放在中心點上
1.JPG
2.JPG
3.JPG
4.JPG
回复
分享到:

使用道具 举报

 楼主| 发表于 2007-7-24 15:59 | 显示全部楼层

悬臂梁振动的动网格问题

/**********************************************************
*
* node motion based on simple beam deflection equation
* compiled UDF
*
**********************************************************/
#include "udf.h"
DEFINE_GRID_MOTION(beam, domain, dt, time, dtime)
{
Thread *tf = DT_THREAD (dt);
face_t f;
Node *v;
real NV_VEC (omega), NV_VEC (axis), NV_VEC (dx);
real NV_VEC (origin), NV_VEC (rvec);
real sign;
int n;
/* set deforming flag on adjacent cell zone */
SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));
sign = -5.0 * sin (26.178 * time);
Message ("time = %f, omega = %f\n", time, sign);
NV_S (omega, =, 0.0);
NV_D (axis, =, 0.0, 1.0, 0.0);
NV_D (origin, =, 0.0, 0.0, 0.152);
begin_f_loop (f, tf)
{
f_node_loop (f, tf, n)
{
v = F_NODE (f, tf, n);
/* update node if x position is greater than 0.02
and that the current node has not been previously
visited when looping through previous faces */
if (NODE_X (v) > 0.020 && NODE_POS_NEED_UPDATE (v))
{
/* indicate that node position has been update
so that it's not updated more than once */
NODE_POS_UPDATED (v);
omega[1] = sign * pow (NODE_X (v)/0.230, 0.5);
NV_VV (rvec, =, NODE_COORD (v), -, origin);
NV_CROSS (dx, omega, rvec);
NV_S (dx, *=, dtime);
NV_V (NODE_COORD (v), +=, dx);
}
}
}
end_f_loop (f, tf);
}


这是我从帮助里下载的悬臂梁UDF,UDF是成功载入了,但是在Dynamic Mesh-->Parameters里不知道要输入哪些必要参数,所以就没有更改按OK。

接下来在Zones中我选择的运动区域就是悬臂梁的3条边(为一个整体边界)类型为Rigid Body,其他没改,但是却出现警告(Warning: incorrect cg motion UDF BEAM::libudf on zone 4 (assuming no motion)),这是什么问题呢?
对不起我是新手,所以还不太会,麻烦各位了
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-25 09:37 , Processed in 0.070547 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表