24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 1643  |  回复: 0

dongbing1986

金虫 (初入文坛)

[求助] UDF=宏函数含义

NV_V(x[2],=,axis)
NV_S(x[0],/=,R)
N3V_CROSS(x[1],x[2],x[0])
这三个函数式什么意思啊

#include "udf.h"

/* Computation of anisotropic diffusivity matrix for
* cylindrical orthotropic diffusivity */

/* axis definition for cylindrical diffusivity */
static const real origin[3] = {0.0, 0.0, 0.0};
static const real axis[3]   = {0.0, 0.0, 1.0};

/* diffusivities in radial, tangential and axial directions */
static const real diff[3] = {1.0, 0.01, 0.01};

DEFINE_ANISOTROPIC_DIFFUSIVITY(cyl_ortho_diff,c,t,i,dmatrix)
{
    real x[3][3]; /* principal direction matrix for cell in
cartesion coords. */
    real xcent[ND_ND];
    real R;

    C_CENTROID(xcent,c,t);

    NV_VV(x[0],=,xcent,-,origin);
#if RP_3D
    NV_V(x[2],=,axis);
#endif
#if RP_3D
    R = NV_DOT(x[0],x[2]);
    NV_VS(x[0],-=,x[2],*,R);
#endif
    R = NV_MAG(x[0]);
    if (R > 0.0)
      NV_S(x[0],/=,R);
#if RP_3D
    N3V_CROSS(x[1],x[2],x[0]);
#else
    x[1][0] = -x[0][1];
    x[1][1] =  x[0][0];
#endif
   
    /* dmatrix is computed as xT*diff*x */
    dmatrix[0][0] = diff[0]*x[0][0]*x[0][0]
      + diff[1]*x[1][0]*x[1][0]
#if RP_3D
      + diff[2]*x[2][0]*x[2][0]
#endif
      ;
    dmatrix[1][1] = diff[0]*x[0][1]*x[0][1]
      + diff[1]*x[1][1]*x[1][1]
#if RP_3D
      + diff[2]*x[2][1]*x[2][1]
#endif
      ;
    dmatrix[1][0] = diff[0]*x[0][1]*x[0][0]
      + diff[1]*x[1][1]*x[1][0]
#if RP_3D
      + diff[2]*x[2][1]*x[2][0]
#endif
      ;
    dmatrix[0][1] = dmatrix[1][0];

#if RP_3D
    dmatrix[2][2] = diff[0]*x[0][2]*x[0][2]
      + diff[1]*x[1][2]*x[1][2]
      + diff[2]*x[2][2]*x[2][2]
      ;
    dmatrix[0][2] = diff[0]*x[0][0]*x[0][2]
      + diff[1]*x[1][0]*x[1][2]
      + diff[2]*x[2][0]*x[2][2]
      ;
    dmatrix[2][0] = dmatrix[0][2];

    dmatrix[1][2] = diff[0]*x[0][1]*x[0][2]
      + diff[1]*x[1][1]*x[1][2]
      + diff[2]*x[2][1]*x[2][2]
      ;
    dmatrix[2][1] = dmatrix[1][2];
#endif
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

找到一些相关的精华帖子,希望有用哦~

科研从小木虫开始,人人为我,我为人人
相关版块跳转 我要订阅楼主 dongbing1986 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料调剂 +10 一样YWY 2026-04-02 12/600 2026-04-04 22:23 by oooqiao
[考研] 282求调剂 +6 aaa车辆 2026-04-02 9/450 2026-04-04 22:15 by arrow8852
[考研] 0703化学调剂325分 +7 15771691647 2026-04-04 7/350 2026-04-04 20:45 by 蓝云思雨
[考研] 322求调剂:一志愿湖南大学 材料与化工(085600),已过六级。 +14 XX小邓 2026-03-29 16/800 2026-04-04 20:17 by 蓝云思雨
[考研] 求生物学调剂 +14 15172915737 2026-04-01 14/700 2026-04-04 20:13 by babysonlkd
[考研] 一志愿安徽某211 0703化学总分339求调剂 +6 晚风不晚 2026-04-04 6/300 2026-04-04 20:11 by dongzh2009
[考研] 081200-11408-276学硕求调剂 +5 崔wj 2026-03-31 5/250 2026-04-04 19:45 by 1753564080
[考研] 295求调剂 +6 xndjjj 2026-04-04 6/300 2026-04-04 16:52 by dongzh2009
[考研] 081700化学工程与技术 一志愿中海洋 323 求调剂学校 +15 披星河 2026-04-03 15/750 2026-04-04 16:25 by dongzh2009
[考研] 电子信息调剂交叉学科有推荐吗 +6 jhtfeybgj 2026-04-01 8/400 2026-04-04 07:52 by 1753564080
[考研] 求调剂 +3 wos666 2026-04-03 3/150 2026-04-04 05:16 by gswylq
[考研] 357求调剂 +13 1050389037 2026-04-03 13/650 2026-04-03 22:27 by 无际的草原
[考研] 材料与化工调剂一志愿大连海事085600,349 +11 吃的不少 2026-03-30 11/550 2026-04-03 18:05 by Jimmyandyou
[考研] 一志愿华中农业071010,总分320求调剂 +7 困困困困坤坤 2026-04-02 7/350 2026-04-03 17:26 by Yuena_Wang
[考研] 289-求调剂 +4 这里是_ 2026-04-03 4/200 2026-04-03 14:23 by 1753564080
[考研] 330求调剂 +3 白神呜呼呼 2026-04-02 3/150 2026-04-03 10:15 by 蓝云思雨
[考研] 274求调剂 +10 薛定谔的虎。 2026-04-01 10/500 2026-04-03 10:13 by tianyyysss
[考研] 考研调剂 +12 Amber00 2026-03-31 12/600 2026-04-02 09:04 by sanrepian
[考研] 302求调剂一志愿北航070300,本科郑大化学 +8 圣日耳曼条 2026-04-01 11/550 2026-04-02 07:40 by chemdavid
[考研] 材料调剂 +12 一样YWY 2026-04-01 12/600 2026-04-02 00:21 by 百秒光年
信息提示
请填处理意见