Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    fluent udf中体积分数宏 C_VOF 的取值问题

    Fluent
    4
    4
    673
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Pajack last edited by 李东岳

      使用vof模型求解两相,希望在最后使用DEFINE_ON_DEMAND来做一个体积分数与温度的简单运算从而得到单相 的温度,udf如下,但一直报Error: received a fatal signal (Segmentation fault). C_VOF的提取问题不知道在哪里,求赐教~

      DEFINE_ON_DEMAND(demand)
      {
      
      	cell_t c;
      	Thread *t, *Pri_th, *Mix_th;
      	Mix_th = THREAD_SUPER_THREAD(t);
      	Pri_th = THREAD_SUB_THREAD(Mix_th, 0);
      	Domain *d;
      	d = Get_Domain(1);
      
      	thread_loop_c(Mix_th, d)
      	{
      		begin_c_loop(c, Mix_th)
      		{
      			C_UDMI(c, Mix_th, 0) = C_T(c, Mix_th)*C_VOF(c, Pri_th);
      		}
      		end_c_loop(c, Mix_th)
      	}
      }```
      B Forest Wang 2 Replies Last reply Reply Quote
      • bestucan
        bestucan 版主 副教授 last edited by

        C_T(c, Mix_th)*C_VOF(c, Pri_th)
        把这两个变量换成1*1。看看还崩不,不崩就是这两个东西有问题。

        把这两个变量打印出来,或者写到文件里,看看是不是相乘后会溢出

        如果换成1*1还崩,就是整个结构有问题。

        滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

        异步沟通方式(《posting style》from wiki)(下载后打开):
        https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
        提问的智慧(github在gitee的镜像):
        https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md

        1 Reply Last reply Reply Quote
        • B
          being curious @Pajack last edited by

          @pajack 吧Domain *d的定义移到上面试下,定义变量好像不能在赋值语句的下方,反正我16版本是有这个问题。

          1 Reply Last reply Reply Quote
          • Forest Wang
            Forest Wang @Pajack last edited by Forest Wang

            @pajack 首先你定义了一个Thread *t,此时它只是一个空指针,然后你就用t去找mixture_thread,它都不知道t在哪,怎么找?thread_loop_c(t,d)只会遍历d下面的t,而相体积率和温度分属不同的domain,建议你用mp_thread_loop_c

            1 Reply Last reply Reply Quote
            • First post
              Last post

            CFD中文网 | 东岳流体 | 京ICP备15017992号-2
            论坛登录问题反馈可联系 li.dy@dyfluid.com