# Need help with this UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 5, 2019, 08:39 Need help with this UDF #1 New Member   Zeeshan Ahmad Khan Join Date: Sep 2018 Posts: 10 Rep Power: 5 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, 00:39 #2 Senior Member   Alexander Join Date: Apr 2013 Posts: 2,061 Rep Power: 31 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);` Tw hfg dpi are not defined (if you dont see) best regards