CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Gradient of velocity (http://www.cfd-online.com/Forums/fluent-udf/81355-gradient-velocity.html)

SeanJo October 25, 2010 04:21

Gradient of velocity
 
1 Attachment(s)
Hi, guys.
I'm trying to get value of gradient of velocity.
But I can't get gradient values at the face.

I mean, first and last nodes value are strange.

I attached graph of 1st, 2nd order gradient of velocity.


How can I get right values?

It's my code.

Code:

DEFINE_ADJUST(my_adjust, d)
{
 Thread *t,;
 cell_t c, ;
 face_t f;
 
 if(N_ITER > 1)
 {
  thread_loop_c(t, d)
  {
  begin_c_loop (c, t)
  {
    C_UDSI(c,t,0) = C_U(c,t);
  }
  end_c_loop (c, t)
  }
  thread_loop_c(t, d)
  {
  begin_c_loop (c, t)
  {
    C_UDSI(c,t,1) = C_UDSI_G(c,t,0)[1];
  }
  end_c_loop (c, t)
  }
  thread_loop_c(t, d)
  {
  begin_c_loop (c, t)
  {
    C_UDSI(c,t,2) = C_UDSI_G(c,t,1)[1];
  }
  end_c_loop (c, t)
  }
 }
}

Thanks. ^^


All times are GMT -4. The time now is 14:30.