HOW TO WRITE UDF FOR DENSITY OF WATER

  • 188 Views
  • Last Post 31 August 2018
  • Topic Is Solved
Devank12 posted this 31 August 2018

I want to define Density of  water that varies with temperature  I have  written a UDF based on the following polynomial equation. I donot know it is right . If anycorrection plz inform me. Thanks

#include "udf.h"

DEFINE_PROPERTY(cell_density,cell,thread)

{

real rho;

real T = C_T(c,t);

rho = 765.33+1.8142*T – 0.0035*pow(T,2.)

C_UDMI(c,t,0) = rho;

return rho;

}

 

abenhadj posted this 31 August 2018

Help your self by using debugging messages. You have started with writing into UDMI's that if fine. You need to use the cell pointer and cell thread pointer passed by Fluent. Actually you don't need an UDF as you can use the polynomial option there.

Best regards,

Amine

Close