|
[Sponsors] |
January 19, 2015, 12:53 |
UDf for condensation
|
#1 |
New Member
anonymous
Join Date: Jan 2015
Posts: 3
Rep Power: 11 |
hi, I recently started using UDF and I have a lot of problems if someone can help me.
I have to create a UDF which will allow me to inject a heat source based on different parameters.the UDF that I create is this, #include "udf.h" DEFINE_heat(inlet_x_heat,thread) { real temp,volume,area,heat,alfv,NV_VEC(A); real rhov = 999.6; real rconst = 0.1; real hfg = 2500; real T_SAT = 18; real x = 0.0132; Thread *t; cell_t c; face_t f; alfv= x/(0.622+x); { begin_c_loop(c,t) { temp = C_T(c,t); if (temp > T_SAT) { heat = 0;} else if(temp < T_SAT) { volume = C_VOLUME(c,t); F_AREA(A,f,t); area = NV_MAG(A); area += NV_MAG(A); heat =(rconst*alfv*rhov*(T_SAT-temp)*hfg*volume)/(area*T_SAT); x=x-((rconst*alfv*rhov*(T_SAT-temp)*area*volume)/T_SAT); }} end_c_loop(c,t)} return heat; } the problem is that the x changes for each cell according to the precedent x but not to the adjacent one. thank you for your help |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
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 | FLUENT | 0 | November 25, 2002 05:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |