找回密码
 注册
查看: 4480|回复: 6

假如我要取计算区域中坐标(1,1,1)的温度值T0,用UDF如何写这个语句

[复制链接]
发表于 2010-4-7 14:03:52 | 显示全部楼层 |阅读模式

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

您需要 登录 才可以下载或查看,没有账号?注册

x
假如我要取计算区域中坐标(1,1,1)的温度值T0,用UDF如何写这个语句
发表于 2010-4-8 11:08:02 | 显示全部楼层


cell_t c;
Thread *t;
CX_Cell_Id cx_cell;
real NV_VEC(pt);
real c_centroid[ND_ND];

NV_D(pt, =, 1,1,1);  //coordinate of your specified location,it must be in the domain coordinate range
CX_Start_ND_Point_Search();
cx_cell=*CX_Find_Cell_With_Point(pt);
CX_End_ND_Point_Search();
c=RP_CELL(&cx_cell);  //the right cell number
t = RP_THREAD(&cx_cell);  //  the thread

C_CENTROID(c_centroid,c,t);
Message0("coordinate of the specified point: x=%g,y=%g,z=%g\n",pt[0],pt[1],pt[2]);
Message0("coordinate of the cell found: x=%g,y=%g,z=%g,T=%g\n",c_centroid[0],c_centroid[1],c_centroid[2],C_T(c,t));
 楼主| 发表于 2010-4-8 15:52:14 | 显示全部楼层

回复 2# gearboy78 的帖子

谢谢这位达人,先研究一下
发表于 2010-4-14 23:09:38 | 显示全部楼层

如何将热流边界设为随温度变化的函数?

假如要将物体壁面的热流设为随壁面温度变化的函数,即Q=F(T),请问应该如何写UDF语句?
发表于 2010-4-20 17:51:16 | 显示全部楼层
我也正在做这样的工作 搜了老半天不知道怎么弄 通过UDF读某一点的温度值
发表于 2010-4-26 10:51:19 | 显示全部楼层
佩服gearboy!

我有个简单的办法:
在surface下建point,从manage里面获得其ID,然后就不用说了吧。
我没测试过。不过应该可行,供探讨。
谢谢!


原帖由 gearboy78 于 2010-4-8 03:08 发表


cell_t c;
Thread *t;
CX_Cell_Id cx_cell;
real NV_VEC(pt);
real c_centroid[ND_ND];

NV_D(pt, =, 1,1,1);  //coordinate of your specified location,it must be in the domain coordinate range
CX_ ...
发表于 2012-5-9 17:07:13 | 显示全部楼层
这个看不懂,udf帮助里面也查不到相关命令,请问gearboy78你是在哪里得到的这些命令,能否稍作备注呢,谢谢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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