CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Non linear heat source using UDF (https://www.cfd-online.com/Forums/fluent/187472-non-linear-heat-source-using-udf.html)

mreyes9406 May 7, 2017 10:29

Non linear heat source using UDF
 
1 Attachment(s)
Hi everybody,

I am trying to solve a steady state heat transfer problem in an axisymmetric solid region, but I need to add the source term "sinh(T)" so that the heat conduction equation has the form of that in the image I attached to this post. The source only depends on the local temperature. To add the term I built this UDF using a DEFINE_SOURCE macro, but when running the simulation, I get exactly the same result as if there were no "sinh(T)" term.


************************************************** **
UDF that adds heat source term sinh(temp) and derivative to solid
************************************************** ***

#include "udf.h"
#include "math.h"


DEFINE_SOURCE(sinh_heat_source, cell, thread, dS, eqn)
{
double source;
double temp = C_T(cell, thread);
source = sinh(temp);
dS[eqn] = cosh(temp);
return source;
}

Could you please let me know if you find any mistake in the code?

Thank you


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