Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    自定义标量 C_UDSI(c,t) 算乘方的时候 计算发散

    Fluent
    2
    3
    1515
    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.
    • 两月三年
      两月三年 last edited by

      我在调用 uds 计算air_cp多项式时,如果计算 pow(C_UDSI(c,t),2) 平方以上就出错,uds 0 就发散了,一次方就没有问题,请问要怎么解决?

      目前加载的话就可以算,如果方程后面全部加上的话究发散。

      real Gas_Solid_HTC(cell_t c, Thread *t) 
      {
              real Pr,Re,Us,h,Bi,he,Nu,VH,beta,air_cp,A;
              real T_air = C_UDSI(c,t,0);
              air_cp = 1161.482-2.369*T_air;
              /*-0.0149*pow(T_air,2.0)-5.035*pow(T_air,3.0)+9.93*pow(T_air,4.0)-1.111*pow(T_air,5.0);*/
              /*注释里面的方程如果加上的话计算就发散了*/
              Us = sqrt( pow(C_U(c,t),2.0) + pow(C_V(c,t),2.0) +
              pow(C_W(c,t),2.0) );        
              Pr = C_MU_L(c,t)*air_cp/C_K_L(c,t);
              Re = func_porosity(t)*d_b*Us*C_R(c,t)/C_MU_L(c,t);      
              Nu = 2.0 + 0.6*pow(Pr,1.0/3.0)*pow(Re,0.5);
              h=Nu*C_K_L(c,t)/d_b;                                                                                                                                                                                                  
              Bi = h*d_b/(2*ks);
              return h/(1.0+Bi/5.0);
      }
      

      那都是很好很好的,可是我偏不喜欢。

      Astremon 1 Reply Last reply Reply Quote
      • Astremon
        Astremon @两月三年 last edited by

        @两月三年 开方里出现了负数。加一个强制限制abs、if-else等。

        1 Reply Last reply Reply Quote
        • 两月三年
          两月三年 last edited by

          嗯嗯,是我的公式有问题,已经解决了,谢谢

          那都是很好很好的,可是我偏不喜欢。

          1 Reply Last reply Reply Quote
          • First post
            Last post

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