|
[Sponsors] |
February 5, 2019, 09:39 |
Need help with this UDF
|
#1 |
New Member
Zeeshan Ahmad Khan
Join Date: Sep 2018
Posts: 10
Rep Power: 8 |
Hi guys
I've written this UDF which generate a mass source by searching for a particular phase in a cell. In the mass source one of requirement is the temp on the west side. I need to retrive after the loop finds the respective cell as given in condition. Can anyone help me how I can do this. Here is my UDF # include "udf.h" DEFINE_ADJUST(my_adjust,domain) { cell_t c; int zone_ID=2; Thread*t=Lookup_Thread(domain,zone_ID=2); int phase_domain_index_p=0; int phase_domain_index_s=1; Thread *tp=THREAD_SUB_THREAD(t,phase_domain_index_p=0); Thread *ts=THREAD_SUB_THREAD(t,phase_domain_index_s=1); real xc[ND_ND]; real Fi=0; real Fve=0; real Fvw=0; real Ts; real Tp; real Tw; real Te; real m; begin_c_loop_all(c,t) { if (C_VOF(c,tp)!=0 && C_VOF(c,tp)!=1) { Tp=C_T(c,t); printf("The current temp =%g of cell \n",Tp); mass source= (Tp-Tw)/(hfg*dpi); } } end_c_loop_all(c,t) } |
|
February 11, 2019, 01:39 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
so what is the problem with your UDF? looks like it is only a part
here you have equation Code:
mass source= (Tp-Tw)/(hfg*dpi); hfg dpi are not defined (if you dont see) best regards |
|
|
|
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 |