CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Can I define density in terms of liquid fraction in UDF? (https://www.cfd-online.com/Forums/fluent-udf/219838-can-i-define-density-terms-liquid-fraction-udf.html)

mariam.sara August 23, 2019 09:58

1 Attachment(s)
Sorry here is the correct expression.

mariam

AlexanderZ August 25, 2019 23:56

Ts and TL should be defined by you
Code:

#include "udf.h"

#define cps 1800.0
#define cpl 2400.0
#define lat 160000.0

DEFINE_SPECIFIC_HEAT(cell_cp, T, Tref, h, yi)
{
real cpm,dt,coef;
real Tl, Ts; // to be defined
Tref = 308;
if T<Ts
        coef = 0;
else if T< Tl
        coef  = (T-Ts)/(Tl-Ts);
else
        coef = 1;
dt=exp(-T*(T-Tref)*(T-Tref)/4.0)/sqrt(4.0*3.14);
cpm =cps+(cpl-cps)*coef+lat*dt;
*h = cpm*(T-Tref);
return cpm;
}

best regards


All times are GMT -4. The time now is 19:50.