CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Need help with this UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2019, 08:39
Default Need help with this UDF
  #1
New Member
 
Zeeshan Ahmad Khan
Join Date: Sep 2018
Posts: 10
Rep Power: 5
zakmt293 is on a distinguished road
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)
}
zakmt293 is offline   Reply With Quote

Old   February 11, 2019, 00:39
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,061
Rep Power: 31
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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
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 02:18
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 12:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 17:20.