Fluids

Fluids

Modelling multiphase heat transfer coefficient in UDF with DEFINE_PROFILE

    • senthilathiban
      Subscriber
      Hi, nI am doing a multiphase simulation ( Euler-Euler )with gas and solid. nI have two heat transfer coefficients. h(wall-gas) and h(wall-solid). nThe simplified equations arenh(gas-wall) = 1.54*Re_g*k_g/Dnandnh(solid-wall) = D/k_s + [2 * sqrt(k_s * rho_s * cp_s / pi)]^(-1)nFirst, I tried to code only the h(gas-wall) as follows.n#include udf.hnDEFINE_PROFILE(heat_test,t,i)n{n face_t f;nThread *ti = THREAD_SUB_THREAD(t,0);nreal D = 1;nreal beta = 90;nreal v_x=0., v_y=0., v_z=0.;nreal vel;nreal De = 0.5*D*(2*M_PI-beta+sin(beta*M_PI/180))/(M_PI-beta/2-sin((beta*M_PI/180)/2));nnbegin_f_loop(f,t)n{nv_x = F_U(f,ti);nv_y = F_V(f,ti);nv_z = F_W(f,ti);nvel = sqrt(v_x*v_x + v_y*v_y + v_z*v_z);nreal Re = vel;nF_PROFILE(f,t,i) = 1.54*Re/De;nnend_f_loop(f,t)nnnThe above code works when I use v_x = F_U(f,t) and produces a SIGSEGV error when I use F_U(f,ti).nIs this the correct way to code this type of UDF?.Looking forward to your response.Thanks,nSenthiln
    • DrAmine
      Ansys Employee
      Because the wall has only one temperature and that is the mixture level.n
    • senthilathiban
      Subscriber
      I am not using temperature field. I am using only velocity field.n
    • DrAmine
      Ansys Employee
      What is the thread ti in your UDF? Where are you hooking the UDF?n
    • senthilathiban
      Subscriber
      Thread ti is the phase thread of primary phase in the multiphase simulation. I am hooking the UDF in the boundary conditions for wall as convection heat transfer coefficient.n
    • DrAmine
      Ansys Employee
      Okay that will explain the issue: There is no phase velocity associated with wall boundary. You can however access the near wall cell velocity values of each phase.n
    • senthilathiban
      Subscriber
      I also tried with the adjacent cell thread and it produced the same error.nnDEFINE_PROFILE(heat_gas_wall,t,i)n{n face_t f;n Message0(TEst 00000000000);n /*face thread*/nThread *ti = THREAD_SUB_THREAD(t,0);nThread *tj = THREAD_SUB_THREAD(t,1);n/*cell thread*/nThread *tci = THREAD_T0(ti);nThread *tcj = THREAD_T0(tj);ncell_t c = F_C0(f,ti);nnMessage0(TEst 0);nreal v_x=0., v_y=0., v_z=0.;nreal vel;nv_x = C_U(c,tcj) - C_U(c,tci);nv_y = C_V(c,tcj) - C_V(c,tci);nv_z = C_W(c,tcj) - C_W(c,tci);nvel = sqrt(v_x*v_x + v_y*v_y + v_z*v_z);n..n....n....n}n
    • DrAmine
      Ansys Employee
      Yes because it is wrong: you are no doing any loops. Check the documentation to know how things are working.n
    • senthilathiban
      Subscriber
      The loops are below. I didn't post the full code. The full code is lengthy. I kept three dots in the bottom..!!n
    • DrAmine
      Ansys Employee
      I cannot forecast what you are telling with your 3 dots.n
    • YasserSelima
      Subscriber
      If you are still facing the same error, trynbegin_f_loop(f,ti)n
Viewing 10 reply threads
  • You must be logged in to reply to this topic.