CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF for water evaporation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2018, 09:17
Default UDF for water evaporation
  #1
New Member
 
Alice
Join Date: Jun 2017
Posts: 26
Rep Power: 9
yangzhuan is on a distinguished road
hello, I refer to the water wvaporation UDF on the internet, but the initialization is wrong. I don't know what is wrong. Please help me!
Code:
  #include "udf.h"
  #include "sg_mphase.h''
  #define T_SAT 373
  #define LAT_HT 1000
  DEFINE_SOURCE(liq_src,cell,pri_th,dS,eqn)
  {
  Thread*mix_th,*sec_th;
  real m_dot_l;
  mix_th=THREAD_SUPER_THREAD(pri_th);
  sec_th=THREAD_SUB_THREAD(mix_th,1);
  if(C_T(cell,mix_th)>=T_SAT)
  {
  m_dot_l=-0.1*C_VOF(cell,pri_th)*C_R(cell,pri_th)*fabs(C_T(cell,mix_th)-T_SAT)/T_SAT;
  dS[eqn]=-0.1*C_R(cell,pri_th)*fabs(C_T(cell,mix_th)-T_SAT)/T_SAT;
  }
  else
  {
  m_dot_l=0.1*C_VOF(cell,sec_th)*C_R(cell,sec_th)*fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
  dS[eqn]=0;
  }
  return m_dot_l;
  }
  DEFINE_SOURCE(vap_src,cell,sec_th,dS,eqn)
  {
  Thread*mix_th,*pri_th;
  real m_dot_v;
  mix_th=THREAD_SUPER_THREAD(sec_th);  pri_th=THREAD_SUB_THREAD(mix_th,0);
  if(C_T(cell,mix_th)>=T_SAT)
  {
  m_dot_v=0.1*C_VOF(cell,pri_th)*C_R(cell,pri_th)*fabs(C_T(cell,mix_th)-T_SAT)/T_SAT;
  dS[eqn]=0;
  }
  else
  {
  m_dot_v=-0.1*C_VOF(cell,sec_th)*C_R(cell,sec_th)*fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
  dS[eqn]=-0.1*C_R(cell,sec_th)*fabs(C_T(cell,mix_th)-T_SAT)/T_SAT;
  }
  return m_dot_v;
  }
  DEFINE_SOURCE(enrg_src,cell,mix_th,dS,eqn)
  {
  Thread*pri_th,*sec_th;
  real m_dot;
  pri_th=THREAD_SUB_THREAD(mix_th,0);
  sec_th=THREAD_SUB_THREAD(mix_th,1);
  if(C_T(cell,mix_th)>=T_SAT)
  {
  m_dot=-0.1*C_VOF(cell,pri_th)*C_R(cell,pri_th)*fabs(C_T(cell,mix_th)-T_SAT)/T_SAT;
  dS[eqn]=-0.1*C_VOF(cell,pri_th)*C_R(cell,pri_th)/T_SAT;
  }
  else
  {
  m_dot=0.1*C_VOF(cell,sec_th)*C_R(cell,sec_th)*fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
  dS[eqn]=0.1*C_VOF(cell,sec_th)*C_R(cell,sec_th)/T_SAT;
  }
  return LAT_HT*m_dot;
  }
I run this UDF in the Fluent14.5, when initialization, then,
Code:
Error: 
D:\ansys14.5\ANSYSI~1\v145\fluent\fluent14.5.0\win64\3d\fl1450s.exe 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
yangzhuan is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 13:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
UDF for Oscillating Membrane/Diaphragm of a Synthetic Jet cuan1029 Fluent UDF and Scheme Programming 0 December 8, 2014 09:20
UDF programming fullmonty FLUENT 5 June 30, 2011 03:40
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 12:29


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