不知火舞的被虐|伊人天伊人天天综合网|博洛尼亚天气|任你懆这里只有精品4|久久美日韩精品久久|掌中之物漫画免费阅读观看|0丨d老妇

fluent UDF好像沒有抓取到最大溫度,請幫忙指正? 50

瀏覽:1661 回答:6

程序是想抓取一個域內體網格的最大溫度tmax,然后用tmax和設定的溫度313.15比較大小,然后來判定執行哪個加熱功率,但是程序一直執行define profile語句中else的功率,雖然tmax已經大于我設定的313.15。實在看不出哪里有錯,還請各位大神幫忙指點一下,感謝!感謝!

程序如下:

#include "udf.h"
real tmax;
real thermosensor_temperature;
real heat_change_temperature = 313.15; /*40 du*/
real heater_change           = 26400000; /*100W*/
real heater_unchange         = 79600000;/*300W*/

DEFINE_EXECUTE_AT_END(tsensor)
{
 cell_t c;
 Domain *d;
 Thread *t;
 d = Get_Domain(1);
 t = Lookup_Thread(d,6);
 tmax=253.15; /*-20du*/
  begin_c_loop(c,t)
 { 
     thermosensor_temperature = C_T(c,t); /* get thermocouple temperature */
     if(thermosensor_temperature > tmax)
      {
        tmax = thermosensor_temperature;
      }  
      else
      {
        tmax=253.15;/*-20du*/
      }  
 }
 end_c_loop(c,t)
}

DEFINE_PROFILE(heat_bc,t,i)
{ 
 face_t f;
 if (tmax >= heat_change_temperature)
 {
  begin_f_loop(f,t)
  {
   F_PROFILE(f,t,i) = heater_change;
   /*Message("The heater_change is '%f'\n", heater_change);*/
  }
  end_f_loop(f,t)
 }
 else
 {
  begin_f_loop(f,t)
  {
   F_PROFILE(f,t,i) = heater_unchange;
   /*Message("The heater_unchange is '%f'\n", heater_unchange);*/
  }
  end_f_loop(f,t)
 }
}


 


邀請回答 我來回答

全部回答

(2)
默認 最新
NANK
把at-end宏里面的tmax存儲到udm里,profile宏里面調用這個udm,來實現兩個宏的tmax數據傳遞
2018年6月13日
評論 1 點贊 1
NANK
這個都發現不了錯誤?兩個宏都使用tmax,數據傳遞都沒有,當然起不了作用。
2018年6月13日
評論 3 點贊 1

沒解決?試試專家一對一服務

換一批
    App下載
    技術鄰APP
    工程師必備
    • 項目客服
    • 培訓客服
    • 平臺客服

    TOP