CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   gaussian profiled heat flux (https://www.cfd-online.com/Forums/fluent/229759-gaussian-profiled-heat-flux.html)

vek123 August 23, 2020 00:53

gaussian profiled heat flux
 
i am trying to solve a heat transfer problem with a Gaussian like heat flux at the top of the boundary of a rectangle. the length of the rectangle is 0.08m and i did the shape in Matlab to visualize it and the equation i used looks good. but when i solve the problem in fluent using the same formula for the Gaussian distribution, i get a different results. i suspect that the problem may be related to the fact that in Matlab i base my calculation on the unit of length in which the maximum is 0.08. but in fluent it is based on the number of grid elements. is that true for fluent DEFINE_PROFILE Macro?
Here is my UDF.
Code:


/***********************************************************************
  UDF for specifying steady-state parabolic pressure profile boundary
  profile for a turbine vane                                         
************************************************************************/

#include "udf.h"

DEFINE_PROFILE(pressure_profile,t,i)
{
  real x[ND_ND];                /* this will hold the position vector */
  real y;
  face_t f;

  begin_f_loop(f,t)
    {
      //F_CENTROID(x,f,t);
      y = x[i];
      F_PROFILE(f,t,i) = 1e8*exp(-10000*y*y);
    }
  end_f_loop(f,t)
}


AlexanderZ August 24, 2020 01:59

to be
Code:

F_CENTROID(x,f,t);
y = x[1];

was
Code:

//F_CENTROID(x,f,t);
y = x[i];

you've defined x as a vector real x[ND_ND];
using ND_ND macro vector size could be 2 or 3 depends on 2D or 3D case you are solving

x[0] - x- axis
x[1] - y - axis
x[2] - z - axis

// is a sing that everything on the right is comment, it is not executed

Fluent uses SI units as default, for length it is meters


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