声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 4084|回复: 9

[UDF专题] 求助:动量源项dS[eqn]怎么写?body force

[复制链接]
发表于 2008-9-24 09:54 | 显示全部楼层 |阅读模式

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

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

x
当source=(C_U(cell, thread)*C_V_G(cell, thread)[0]+C_V(cell, thread)*C_V_G(cell, thread)[1])
dS[eqn]怎么对C_V(cell, thread)求导?
是否可以只给source 不给dS[eqn]
body force 相可以作为动量源项添加吗?是否有专门的body force命令?

请不吝赐教
回复
分享到:

使用道具 举报

发表于 2008-9-24 14:28 | 显示全部楼层
一个例子,自己照着改吧

39619141.gif

  1. /*******************************************************************/
  2. /* UDF for specifying an x-momentum source term in a spatially     */
  3. /* dependent porous media                                          */
  4. /*******************************************************************/

  5. #i nclude "udf.h"

  6. #define C2 100.0

  7. DEFINE_SOURCE(xmom_source, c, t, dS, eqn)
  8. {
  9.   real x[ND_ND];
  10.   real con, source;

  11.   C_CENTROID(x, c, t);
  12.   con = C2*0.5*C_R(c, t)*x[1];

  13.   source = -con*fabs(C_U(c, t))*C_U(c, t);
  14.   dS[eqn] = -2.*con*fabs(C_U(c, t));

  15.   return source;
  16. }
复制代码
 楼主| 发表于 2008-9-24 15:24 | 显示全部楼层
谢谢回复

这个例子的source可以直接对x方向的速度求导得到dS【eqn】
(C_U(cell, thread)*C_U_G(cell, thread)[0]+C_V(cell, thread)*C_U_G(cell, thread)[1])项中含有速度对x的求导和速度对y的求导,要得到dS【eqn】如何对这个求导进行x方向的速度的求导呢?
发表于 2008-9-25 10:58 | 显示全部楼层
可以只给source 不给dS[eqn]
 楼主| 发表于 2008-9-25 11:41 | 显示全部楼层
对于连续性方程的源项,也可以只给source,不给dS[eqn]吗?不影响计算结果?
发表于 2008-9-27 10:53 | 显示全部楼层
我没试过。
你可以试试,应该就是收敛慢点吧。
发表于 2008-9-28 07:25 | 显示全部楼层
 楼主| 发表于 2008-9-28 09:14 | 显示全部楼层
谢谢谢谢~
发表于 2008-11-29 08:59 | 显示全部楼层
也影响结果吧好像
发表于 2011-3-23 15:34 | 显示全部楼层
现在遇到同样的问题,也是动量源项不能对速度求导。。。请问有人做过吗?
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-6 18:47 , Processed in 0.131041 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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