CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   help me (https://www.cfd-online.com/Forums/fluent-udf/109869-help-me.html)

lopital03000 November 28, 2012 11:11

help me
 
hello, I want to simulate the heat transfer by convection in a cavity, the cavity subjected to a heat flux in terms of (y), q = 1-(y/0.04)*(y/0.04),
i want the udf of heat flux.
thanks....

ghost82 November 28, 2012 11:30

Quote:

Originally Posted by lopital03000 (Post 394691)
hello, I want to simulate the heat transfer by convection in a cavity, the cavity subjected to a heat flux in terms of (y), q = 1-(y/0.04)*(y/0.04),
i want the udf of heat flux.
thanks....

Try this:

Code:

#include "udf.h"
   
/* profile for heat flux*/
DEFINE_PROFILE(heatflux_profile, t, i)
{

  real x[ND_ND];  /* this will hold the position vector */
  face_t f;
   
  begin_f_loop(f, t)
  {
    F_CENTROID(x, f,t);
    F_PROFILE(f, t, i) =1.-(x[1]/0.04)*(x[1]/0.04);
  }
  end_f_loop(f, t)
}



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