24小时热门版块排行榜    

CyRhmU.jpeg
查看: 5746  |  回复: 12

water217

银虫 (小有名气)

[求助] 如何用Compute_Force_And_Moment函数求流体对运动翼型的俯仰力矩已有1人参与

使用fluent的动网格功能模拟了流体绕俯仰-升沉振荡二维翼型的流场后,想得到作用于翼型俯仰参考轴上的俯仰力矩随时间的变化关系,采用了函数Compute_Force_And_Moment(domain, thread, body_centroid, force, moment, FALSE);来求解,可是算下来的俯仰力矩明显有问题(图片中的俯仰力矩都是正值,可是俯仰振荡以后攻角有正有负,俯仰力矩肯定有负值的情况),更换模型俯仰轴的参考位置后,结果也没有什么变化(一个参考轴取距前缘0.3倍的弦长,一个取0.6倍的弦长,结果峰值差不多,变化规律基本一样),请问Compute_Force_And_Moment默认的力矩参考轴是什么位置?我的程序为什么输出的力矩系数有问题?
这个程序里求得的力矩是相对于,大地坐标系,还是随体坐标系,谢谢
附程序:
#include "udf.h"
#include "mem.h"
#include "dynamesh_tools.h"
#include "math.h"
/************************************************************/
FILE*fp;
real current_time = 0.0000 ;
static real vel[3]={0,0,0};/* 初始速度*/
static real omega[3]={0,0,0};/* 初始角速度*/
static real body_centroid[3]={0,0,0};/* 初始形心位置,需要修改*/
static real Chord=0.1,F_density=998.2,U_flow=2;
static real pi=3.1416,frequency=2.0000,Y_amplitude=0.1,w_amplitude=0.8727;
real NV_VEC( origin ),NV_VEC( force ),NV_VEC( moment );
real C_momentr;
/************************************************************/
DEFINE_CG_MOTION(hydrofoil,dt,vel,omega,time,dtime)
{
        Domain * domain ;
        Thread * thread ;
        face_t  f;
        current_time = CURRENT_TIME ;
        vel[0] = 0.0 ;
        vel[1] =2*pi*frequency*Y_amplitude*cos(2*pi*frequency*current_time+pi/2);
        vel[2] = 0.0 ;
        omega[0] = 0.0 ;
        omega[1] = 0.0 ;
        omega[2] =2*pi*frequency*w_amplitude*cos(2*pi*frequency*current_time);
        thread=DT_THREAD(dt);
        domain = THREAD_DOMAIN (thread);
/************************************************************/
                body_centroid[0]=DT_CG(dt)[0];/* 获取形心坐标*/
                body_centroid[1]=DT_CG(dt)[1];/* 获取形心坐标*/
         Compute_Force_And_Moment(domain, thread, body_centroid, force, moment, FALSE);/* 计算水翼总的受力情况*/
        C_moment=moment[2]/(0.5*F_density*U_flow*U_flow*Chord*Chord);/* 计算俯仰力矩系数*/
fp=fopen("D:\\moment_coefficient.dat", "a+";
        fprintf(fp, "%12f",C_moment);
        fprintf(fp, "\n";
        fclose(fp);
}

未命名.JPG

[ Last edited by water217 on 2013-1-24 at 17:55 ]
回复此楼
率性而为……
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖支持 ( 显示支持度最高的前 50 名 )

dhonghui

银虫 (小有名气)

"This function needs size of 3 for force and moment. It works in parallel and
the common arguments are the of the same type as your arguments.
In addition you have to pass the domain as first arg and a boolean as
last argument. This boolean has to be TRUE if you also call the function
on the host else it has to be FALSE."

Compute_Force_And_Moment (domain, tf, CG, force, moment, FALSE);

domain = THREAD_DOMAIN (DT_THREAD ((Dynamic_Thread *)dt)); - pointer on Domain
tf = Lookup_Thread(domain, ID); - pointer on the Thread in Domain

I don't know if "force" includes viscose and pressure force or only pressure force!!!
************************************************** **************
compute viscose force in UDF

you have to define in mem.h header or in local c-file this macro:

#define F_VISCOSE(f,tf) F_STORAGE_R_N3V(f,tf,SV_WALL_SHEAR)

Thread *tf = DT_THREAD(dt); /*pointer on thread*/
face_t f; /*number of faces*/

begin_f_loop(f, tf)
{
NV_VS(F_VISC, += , F_VISCOSE(f, tf), *, -1.0 * k); /* compute viscose force vector. k is a factor for depth in 2D computation and -1.0 corrects the sign of viscose force*/

}
end_f_loop(f, tf);
from http://www.cfd-online.com/Forums ... rce_and_moment.html
9楼2014-09-17 14:11:33
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

dragonship

铁杆木虫 (正式写手)

膜拜。请问你这些是从哪里学习的,我也想弄,因为船舶受力和机翼有很多相似之处。望指点。
2楼2013-01-30 09:32:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

watcher007

新虫 (正式写手)

★ ★
xiegangmai: 金币+2, 鼓励讨论交流! 2013-02-11 10:09:27
楼主 你Compute_Force_And_Moment(domain, thread, body_centroid, force, moment, FALSE)这个里面的为什么是用FALSE,我一直用的是TRUE,我刚才用一个简单的算例算了一下这个里面的force好像没错
3楼2013-02-02 11:27:56
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xhd1_moon

银虫 (正式写手)

不是很懂,
4楼2013-02-05 22:31:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

water217

银虫 (小有名气)

引用回帖:
3楼: Originally posted by watcher007 at 2013-02-02 11:27:56
楼主 你Compute_Force_And_Moment(domain, thread, body_centroid, force, moment, FALSE)这个里面的为什么是用FALSE,我一直用的是TRUE,我刚才用一个简单的算例算了一下这个里面的force好像没错

我记得我开始用过true    好像是出错了    然后用false就没错了    现在也不知道当时错误到底是不是true or false的问题。
率性而为……
5楼2013-02-20 17:54:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

water217

银虫 (小有名气)

water217: 回帖置顶 2013-03-07 18:13:00
开学了,这个问题还是没有解决,望与大家继续探讨
率性而为……
6楼2013-02-21 09:30:32
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

universewang

金虫 (正式写手)

我也是被动网格卡住的。我做的是潜艇的水动力系数。。。卡死一个月了,,,这毕业论文可怎么整!愁人
无所畏惧
7楼2014-03-06 16:35:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

chongping

新虫 (初入文坛)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
water217: 金币+20, ★★★★★最佳答案, 都给你了 2014-07-03 21:17:17
我用6DOF计算时,用的false是体坐标系上的力和力矩。
据我在网上看到的资料,说true和false是逻辑运算符,true表示执行该语句,false表示不执行。但是,经过尝试,false也执行语句。且两者输出的力和力矩是有差异的
8楼2014-07-03 15:25:06
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

water217

银虫 (小有名气)

引用回帖:
9楼: Originally posted by dhonghui at 2014-09-17 14:11:33
"This function needs size of 3 for force and moment. It works in parallel and
the common arguments are the of the same type as your arguments.
In addition you have to pass the domain as first  ...

谢谢,您的回复太有价值了,将有有人看到本贴必将大有收获
率性而为……
10楼2014-09-20 16:27:00
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 water217 的主题更新
信息提示
请填处理意见