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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2020, 14:24
Default UDF for condensation
  #1
Member
 
rupak504's Avatar
 
Lolita
Join Date: Aug 2016
Posts: 55
Rep Power: 5
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: 1,169
Rep Power: 18
AlexanderZ 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 helped you

How to ask questions:
https://www.cfd-online.com/Forums/si...ml#post6120255
AlexanderZ is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:13.