Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

ERROR WHILE USING SOURCE UDF

    • Nitin_Bansal
      Subscriber

      hello

      i am trying to compile my udf for continuity source term. my udf and error dialog of fluent both attached below. please tell me that problem is in my udf or anything else.

      thanks

    • YasserSelima
      Subscriber
      add semicolon ;nreal m_lv;nand nreal sat_t=30.3;nn
    • YasserSelima
      Subscriber
      the two lines start with m_lv and the return line as welln
    • Nitin_Bansal
      Subscriber

      the two lines start with m_lv and the return line as well/forum/discussion/comment/107562#Comment_107562

      i didn't get it, what do you want to say.n
    • YasserSelima
      Subscriber
      your UDF wasn't compiled wether for serial or parallel.nYou have errors in the function ... you should find the error messages after you press build.nnThe errors I can see in your function are missing semicolons at the end of 4 lines ... nso, add semicolon at the end of the lines starting with nm_lv = ...nand nreturn ... n
    • Nitin_Bansal
      Subscriber
      nthanks for notify menactually i want to know that T_l and T_v defined by me is right or wrong. I read in udf manual that in multiphase we have to use subdomain to define values for individual liquid or vapor phase, i use c0 and pt0 for vapor phase which is my primary phase and c2 and pt2 for liquid phase which is my secondary phase. is this correct ?n
    • YasserSelima
      Subscriber
      wrong ... what model you are using?n
    • Rob
      Forum Moderator
      Can you post the code? Note, staff are not permitted to open attachments. I'm not going to debug the code but if there is something obvious I'll point it out. The first being there isn't a continuity source, we can add mass, energy, momentum etc. n
    • YasserSelima
      Subscriber
      n
    • Rob
      Forum Moderator
      Compare the DEFINE_SOURCE line with the example given here. nWhich model are you using as temperature may or may not be on the mixture rather than the phase. n
    • Nitin_Bansal
      Subscriber
      Array nthanksnI am using the VOF model and for simulation using ANSYS2020 R1. In the references followed by me, According to them we have to write a UDF for interfacial mass and energy transfer. All the references uses older version of ANSYS. i want to know in 2020 also I have to write UDF or not needed. If needed then my udf (shown below)is correct or not.n#Includeudf.hn#includeextfile.hn#define cr=0.1nDEFINE_SOURCE(mass_source,c,t,rhoL,rhoV,vofL,vofV)n{nreal m_lvnreal sat_t=20.3nreal T_v=C_T(c=0,pt0[vap_phase]);nreal T_l=C_T(c=2,pt2[liq_phase]);nif(T_l>=sat_t)n{nm_lv=cr*vofL*rhoL*((T_l-sat_t)/sat_t)n}nelse if(T_v
    • Amine Ben Hadj Ali
      Ansys Employee
      That model is already in Fluent and you do not require and UDF. That is the default Lee Model.n
Viewing 11 reply threads
  • The topic ‘ERROR WHILE USING SOURCE UDF’ is closed to new replies.