CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS (https://www.cfd-online.com/Forums/ansys/)
-   -   How to set a location-dependent internal heat generation ? (https://www.cfd-online.com/Forums/ansys/176474-how-set-location-dependent-internal-heat-generation.html)

Eugen Shabagin August 19, 2016 09:27

How to set a location-dependent internal heat generation ?
 
Hello everyone !

I want to implement a location-dependent internal heat generation in a transient thermal analysis. Just consider a cylinder where the heat generation is a function of the radius,angle and height. Does someone know how to do it ?

Thank you.

Best Regards
Eugen

ComputerGuy August 21, 2016 22:09

Try this...
 
Have you tried examining the example from the UDF manual?

To use this appropriately (rather, quickly), you'll just need to change your radius, angle, and height to x,y,z coordinates...

http://www.geom.uiuc.edu/docs/refere...as/node42.html

x coordinate is x[0]
y coordinate is x[1]
z coordinate is x[2]

You'll have to get your source term and its derivative converted to your equation, of course, but hopefully this helps!

ComputerGuy

Code:

/*******************************************************************/
/* UDF for specifying an x-momentum source term in a spatially    */
/* dependent porous media                                          */
/*******************************************************************/

#include "udf.h"

#define C2 100.0

DEFINE_SOURCE(xmom_source,c,t,dS,eqn)
{
  real x[ND_ND];
  real con, source;

  C_CENTROID(x,c,t);
  con = C2*0.5*C_R(c,t)*x[1];

  source = -con*fabs(C_U(c, t))*C_U(c,t);
  dS[eqn] = -2.*con*fabs(C_U(c,t));

  return source;
}



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