Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

  1. CFD中文网
  2. Fluent
  3. 求助冷凝udf

求助冷凝udf

已定时 已固定 已锁定 已移动 Fluent
2 帖子 2 发布者 3.1k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 星 离线
    星 离线
    星坠如雨
    写于 最后由 编辑
    #1

    要模拟管内液膜冷凝,不会冷凝udf编写,求助冷凝的udf。

    1 条回复 最后回复
  • I 离线
    I 离线
    ibelief
    写于 最后由 编辑
    #2

    #include "udf.h"
    /Constants used in psat_h2o to calculate saturation pressure/
    #define PSAT_A 0.01
    #define PSAT_TP 338.15
    #define C_LOOP 8
    #define H2O_PC 22.089E6
    #define H2O_TC 647.286
    /user inputs/
    #define MAX_SPE_EQNS_PRIM 2 /total number of species in primary phase/
    #define index_evap_primary 0 /evaporating species index in primary phase/
    #define prim_index 0 /index of primary phase/
    #define P_OPER 101325 /operating pressure equal to GUI value/
    /end of user inputs/
    //
    /
    UDF for specifying an interfacial area density /
    /
    /
    double psat_h2o(double tsat)
    /* /
    /
    Computes saturation pressure of water vapor /
    /
    as function of temperature /
    /
    Equation is taken from THERMODYNAMIC PROPERTIES IN SI, /
    /
    by Reynolds, 1979 /
    /
    Returns pressure in PASCALS, given temperature in KELVIN /
    {
    int i;
    double var1,sum1,ans1,psat;
    double constants[8]={-7.4192420, 2.97221E-1, -1.155286E-1,
    8.68563E-3, 1.094098E-3, -4.39993E-3, 2.520658E-3, -5.218684E-4};
    /
    var1 is an expression that is used in the summation loop /
    var1 = PSAT_A
    (tsat-PSAT_TP);
    /* Compute summation loop /
    i = 0;
    sum1 = 0.0;
    while (i < C_LOOP){
    sum1+=constants[i]pow(var1,i);
    ++i;
    }
    ans1 == sum1
    (H2O_TC/tsat-1.0);
    /
    compute exponential to determine result /
    /
    psat has units of Pascals /
    psat = H2O_PC
    exp(ans1);
    return psat;
    }
    DEFINE_HET_RXN_RATE(user_evap_condens_react, c, t, hr, mw, yi, rr, rr_t)
    {
    Thread **pt = THREAD_SUB_THREADS(t);
    Thread *tp = pt[0];
    Thread *ts = pt[1];
    int i;
    real concentration_evap_primary, accum = 0., mole_frac_evap_prim,
    concentration_sat ;
    real T_prim = C_T(c,tp); /primary phase (gas) temperature/
    real T_sec = C_T(c,ts); /secondary phase (droplet) temperature/
    real diam = C_PHASE_DIAMETER(c,ts); /secondary phase diameter/
    real D_evap_prim = C_DIFF_EFF(c,tp,index_evap_primary)

    • 0.7C_MU_T(c,tp)/C_R(c,tp);
      /primary phase species turbulent diffusivity/
      real Re, Sc, Nu, urel, urelx,urely,urelz=0., mass_coeff, area_density,
      flux_evap ;
      if(Data_Valid_P())
      {
      urelx = C_U(c,tp) - C_U(c,ts);
      urely = C_V(c,tp) - C_V(c,ts);
      #if RP_3D
      urelz = C_W(c,tp) - C_W(c,ts);
      #endif
      urel = sqrt(urelx
      urelx + urelyurely + urelzurelz);
      /relative velocity/
      Re = urel * diam * C_R(c,tp) / C_MU_L(c,tp);
      Sc = C_MU_L(c,tp) / C_R(c,tp) / D_evap_prim ;
      Nu = 2. + 0.6 * pow(Re, 0.5)* pow(Sc, 0.333);
      mass_coeff = Nu * D_evap_prim / diam ;
      for (i=0; i < MAX_SPE_EQNS_PRIM ; i++)
      {
      accum = accum + C_YI(c,tp,i)/mw[i][prim_index];
      }
      mole_frac_evap_prim = C_YI(c,tp,index_evap_primary)
      / mw[index_evap_primary][prim_index] / accum;
      concentration_evap_primary = mole_frac_evap_prim * P_OPER
      / UNIVERSAL_GAS_CONSTANT / T_prim ;
      concentration_sat = psat_h2o(T_sec)/UNIVERSAL_GAS_CONSTANT/T_sec ;
      area_density = 6. * C_VOF(c,ts) / diam ;
      flux_evap = mass_coeff *
      (concentration_sat - concentration_evap_primary) ;
      *rr = area_density * flux_evap ;
      }
      }

    努力收敛

    1 条回复 最后回复

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]