CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   energy source term for phase change (https://www.cfd-online.com/Forums/fluent/116524-energy-source-term-phase-change.html)

mhdmk April 21, 2013 14:18

energy source term for phase change
 
hi everyone
i'm simulating a converging-diverging nozzle saturated water enter and because of pressure drop flow changes to two phase and the temperature decrease.for evaporation & condensation i use evaporation-condensation model in ansys fluent 13 with T_sat varying by pressure and i use a source term to add latent heat to energy equation and i use mixture model but when i run the case the fluent says :
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f

here is my udf's:

#include "udf.h"

DEFINE_PROPERTY(T_sat,c,t)
{
real T,p;

p=(C_P(c,t)*7.501*0.001)+0.057;

T=5132./(20.386-log(p));

return T;
}

DEFINE_SOURCE (phase_change,c,t,dQ,eqn)
{
real a,b,Tsat,T,h,Q,p1,m_net;

Thread *tm=THREAD_SUPER_THREAD(t);

Thread **pt = THREAD_SUB_THREADS(tm);

Thread *tp = pt[0]; /*primary phase*/
Thread *ts = pt[1]; /*secondary phase*/

p1=(C_P(c,t)*7.501*0.001)+0.057;

Tsat=5132./(20.386-log(p1));

T=C_T(c,t);

if(200.<T<272.7) h=2835000.; /* latent heat(j/kg)*/

if(272.7<T<500.) h=(-0.004*pow(T,2.)+0.492*T+2681.)*1000.;

a=0.1;

b=C_VOF(c,ts)*C_R(c,ts)-C_VOF(c,tp)*C_R(c,tp);

m_net=(a*b*(T-Tsat)/Tsat) /*mass transfer(kg/m3s)*/

Q=m_net*h;

if(272.7<T<500.) dQ[eqn]=a*b*(h/Tsat+(-0.008*T+.429)*(T-Tsat)/Tsat);

else dQ[eqn]=a*b*h/Tsat;

return Q;
}

Mahboobe365 May 31, 2013 11:24

Hi can I have your email address? I am working on evaporation condensation problem I have some question.

Thanks

mhdmk June 3, 2013 14:54

what is your question ?

meisam1 November 26, 2013 12:50

Has your problem solved Mr koochaki?


All times are GMT -4. The time now is 10:37.