|
[Sponsors] |
January 26, 2020, 14:24 |
UDF for condensation
|
#1 |
Senior Member
Lolita
Join Date: Aug 2016
Posts: 118
Rep Power: 10 |
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 |
|
January 27, 2020, 07:08 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
start with
Code:
#include "udf.h"
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
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 |