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 condensation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2020, 14:24
Default UDF for condensation
  #1
Senior Member
 
rupak504's Avatar
 
Lolita
Join Date: Aug 2016
Posts: 118
Rep Power: 10
rupak504 is on a distinguished road
hello,

I was trying to add UDF for condensation problem.
............
UDF
.............


#include <udf.h>
#define T_sat 373.15
#define hfg 2256400
#define r 0.1

DEFINE_SOURCE (vapour_source, cell, cell_thread, ds, eqn)
{
Thread **pt;
pt = THREAD_SUB_THREADS(cell_thread);
real source_v;
if (C_T(cell, cell_thread) <= T_sat)
{


source_v = -C_R(cell, cell_thread)*r*C_VOF(cell, pt[1]) *(fabs(C_T(cell, cell_thread) - T_sat) / T_sat);

ds[eqn]= 0;
}
else
{
source_v = 0;

ds[eqn]=0;

}

return source_v;
}

DEFINE_SOURCE (liquid_source, cell, cell_thread, ds, eqn)
{

Thread **pt;
pt = THREAD_SUB_THREADS(cell_thread);
real source_l;

if (C_T(cell, cell_thread) <= T_sat)
{
source_l = C_R(cell, cell_thread)*r*C_VOF(cell, pt[0])*(fabs(C_T(cell,cell_thread)-T_sat)/T_sat);

ds[eqn]=0;

}
else
{

source_l = 0;

ds[eqn]=0;

}

return source_l;
}


DEFINE_SOURCE (energy_source, cell, cell_thread, ds, eqn)

{
Thread **pt;
pt = THREAD_SUB_THREADS(cell_thread);
real source;

if (C_T(cell, cell_thread) <= T_sat)

{
source= C_R(cell, cell_thread)*r*C_VOF(cell, pt[0]) *(fabs(C_T(cell, cell_thread) - T_sat) / T_sat);

ds[eqn]=0;

}

else

{

source=0;

ds[eqn]=0;

}

return hfg*source;

}


............
Errors
............


udf_names.c(7): error C2059: syntax error: '}'
udf_names.c(8): warning C4034: sizeof returns 0


---------------------------------

Any help would be appreciated
regards
rupak504 is offline   Reply With Quote

Old   January 27, 2020, 07:08
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
start with
Code:
#include "udf.h"
compile your code, show latest version of code and problems you have
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 03:18
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 parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 21:12.