24小时热门版块排行榜    

查看: 436  |  回复: 0

希特勒伟大

新虫 (初入文坛)

[求助] 跪求解答

一个正方形区域 充满空气  中间圆形区域充满水    模拟气液传质 请问udf怎么编写  气相和液相用define source  以下是气相的udf
#include "udf.h"
#include "sg.h"
#include "sg_mphase.h"
#include "flow.h"
#include "mem.h"
#include "metric.h"


DEFINE_SOURCE(mass_liquid_source, cell, thread_liquid, dS, eqn)        /* liquid相组分的传质源项 */
{
   real source, m0_gas, m0_liquid, m1_gas, m1_liquid;
   cell_t cell_gas;

   Thread *mixture_thread ,*thread_gas;

   mixture_thread = THREAD_SUPER_THREAD(thread_liquid);       
   thread_gas = THREAD_SUB_THREAD(mixture_thread, 0);       


   begin_c_loop(cell,mixture_thread)
   {
      if (C_VOF(cell,thread_gas)>0 && C_VOF(cell,thread_liquid) <1)    /*相界面*/
          
          source = -C_R(cell,thread_liquid)*C_VOF(cell,thread_liquid)/CURRENT_TIMESTEP ;;        /* 传质源项,单位 kg/m3-s */
          
     else        /* 非相界面 */
          
              source = 0.0;        /* 传质源项为0 */
      
    }
  end_c_loop(cell,mixture_thread)
  dS[eqn] = 0.0;
  return source;
}
回复此楼
assemble the army
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 学员8Rrtvm 的主题更新
信息提示
请填处理意见