Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF about accessing Solid temperature data

    • eric1234598765
      Subscriber

      Hi,

      I have 2 zones in the same position which contains solid type and fluid type zone simultaneously by using TUI command:

      mesh/modify-zones/copy-move-cell-zone

      Assuming the boundary condition is set well, I'm trying using UDF to access solid zone temperature data mentioned through C_T(c,t) macro. However, I found that I get fluid temperature data while debugging.

      According to UDF MANUAL, UDF can access "Flow variable" by using C_T ,C_R, etc . Therefore , I'm wondering if there's any way to access solid temperature data of each cell?

      Thanks,

      Here's simply UDF code:

      DEFINE_SOURCE (Porous_solid_energy, c, t, dS, eqn)

      {

         real source; // Heat flux between Porous solid and Porous fluid source term

          real TS =C_T(c,t)  ; //Solid temperature

          real TF = 100 ; //Fluid temperature

          source  =  0.0; // Ignore

          dS[eqn] = 0.0; // Ignore

          Message("TS = %g  ",C_T(c,t)); 

          return source;

      }

    • eric1234598765
      Subscriber
      Hi, again
      I found that I hooked the UDF at wrong zone by using THREAD_ID to check the zone ID
      The conclusion is that Ansys Fluent can access solid variables as well as fluid by using macro mentioned in UDF manual.
      Best.
    • Amine Ben Hadj Ali
      Ansys Employee
      Sure. Thanks!
Viewing 2 reply threads
  • The topic ‘UDF about accessing Solid temperature data’ is closed to new replies.