Applying a heat source inside a fluid domain

hamham Member Posts: 5

Hello,

I am essentially trying to make a simple model of a hot wire inside a fluid domain, I'm starting with very simple geometry (pic below). I'm only interested in the heating from the wire, so my first thought was to use a UDF to define an energy source in a region in the fluid zone. However, this doesn't seem to work. I am new to UDF's so most likely my code is wrong (attached below).

Is there a better way to go about the problem?

#include "udf.h"

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


C_CENTROID(x,c,t);

if(x[0]>=5 && x[0]<=10 && x[1]>=0 && x[1]<=12)
{
source=50000;
}
else
{
source=0;
}
return source;
}


Answers

Sign In or Register to comment.