We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Source item udf

    • æ´‹ 于
      Subscriber

      I am doing research on foaming simulation. The udfs of the water component conversion rate Xw and hydroxyl component conversion rate Xoh source terms are as follows. Why does the rate of change become very small as the calculation proceeds and can almost be ignored? Yes, please give me some advice

      DEFINE_SOURCE(uds_source_W, cell, sec_th, dS, eqn)
      {
      real P = C_P(cell, sec_th)+101325;
      real T = C_T(cell, sec_th);
      real Xw = C_UDSI(cell, sec_th, 0);
      real Xoh = C_UDSI(cell, sec_th, 1);
      real P_bar = P / 100000.0;
       
      real source_W;
      Thread*mix_th;
      Thread*pri_th;
      mix_th = THREAD_SUPER_THREAD(sec_th);
      pri_th = THREAD_SUB_THREAD(mix_th, 0);
      sec_th = THREAD_SUB_THREAD(mix_th,1);
      source_W =K_X*C_R(cell, sec_th) * C_VOF(cell, sec_th) * Aw * exp(-Ew / (R * T )) * (1 - Xw);
      dS[eqn] =K_X*C_R(cell, sec_th) * C_VOF(cell, sec_th) * Aw * exp(-Ew / (R * T ));
      return source_W;
      }
       
      DEFINE_SOURCE(uds_source_OH, cell, sec_th, dS, eqn)
      {
      real P = C_P(cell,sec_th)+101325;
      real T = C_T(cell, sec_th);
      real Xw = C_UDSI(cell, sec_th, 0);
      real Xoh = C_UDSI(cell, sec_th, 1);
      real P_bar = P / 100000.0;
      real source_OH;
      Thread*mix_th;
      Thread* pri_th;
          mix_th = THREAD_SUPER_THREAD(sec_th);
      pri_th = THREAD_SUB_THREAD(mix_th, 0);
      sec_th = THREAD_SUB_THREAD(mix_th,1);
      source_OH = K_X * C_R(cell, sec_th) * C_VOF(cell, sec_th) * Aoh * exp(-Eoh / (R * T )) * coh0 * (1 - Xoh) * (cnco0 / coh0 - 2 * (cw0 / coh0) * Xw - Xoh);
      dS[eqn] = K_X * C_R(cell, sec_th) * C_VOF(cell, sec_th) * Aoh * exp(-Eoh / (R * T )) * coh0 * ((-2 * cw0 / coh0) * (1 - Xw) * cnco0 / coh0 - 2 * Xw * cw0 / coh0 - Xoh);
      return source_OH;
      }
       
      DEFINE_SOURCE(uds_source_Qe, cell, thread, dS, eqn)
      {
      real P = C_P(cell, thread)+101325 ;
      real T = C_T(cell, thread);
      real Xw = C_UDSI(cell, thread, 0);
      real Xoh = C_UDSI(cell, thread, 1);
      real P_bar = P / 100000.0;
      real Hoh = 7.705e4;
      real Hw = 8.6e4;
      real dXoh_dt = Aoh * exp(-Eoh / (R * T)) * coh0 * (1 - Xoh) * (cnco0 / coh0 - 2 * (cw0 / coh0) * Xw - Xoh) ;
      real dXw_dt = Aw * exp(-Ew / (R * T )) * (1 - Xw) ;
      real source_Qe;
      Thread* pri_th;
      Thread* sec_th;
      pri_th = THREAD_SUB_THREAD(thread, 0);
      sec_th = THREAD_SUB_THREAD(thread,1);
      source_Qe = K_X * C_R(cell,  sec_th) * C_VOF(cell, sec_th) * (Hoh * coh0 * dXoh_dt + Hw * cw0 * dXw_dt) / Rpu;
      dS[eqn] = 0;
      return source_Qe;
      }

       

    • Rob
      Forum Moderator

      Check all the variables are defined. Then look at the values you're using and see what's going on in the model. Note, from the source names are these the values of the source, or a UDS?

Viewing 1 reply thread
  • The topic ‘Source item udf’ is closed to new replies.