Fluids

Fluids

Ansys fluent problem at boundaries in gradient of user defined scalar C_UDSI_G(c,t,i)

    • ahmedhafez
      Subscriber

      Hello,

      During writing a udf ,I need to compute gradient, so I put the variable in UDS then compute gradient using C_UDSI_G(c,t,i), However the value I get is not logical at boundaries. So as to make sure that everything is going well. I put a variable that have predefined gradient in the uds (say C_UDSI(c,t,0)=C_K(c,t)) and compare its predefined gradient (C_K_G(c,t) [0]) with uds gradient (C_UDSI_G(c,t,0)[0]). I found significant difference at 1st two cells adjacent to all boundaries, then perfect agreement after those 2 cells.
      Do anyone know where is the problem. Below is extracted part from my udf regarding this issue



      #include "udf.h"
      #include "mem.h"

      DEFINE_ADJUST(adjust_udf, domain)
      {
      Thread *t;
      cell_t c;
      thread_loop_c(t,domain)
      {
      begin_c_loop(c,t)
      {
      C_UDSI(c,t,0) = C_K(c,t);
      C_UDMI(c,t,0) = C_UDSI_G(c,t,0)[0];
      C_UDMI(c,t,1) = C_K_G(c,t)[0];
      }
      end_c_loop(c,t)
      }
      }

Viewing 0 reply threads
  • You must be logged in to reply to this topic.