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

multiphase udf

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 7, 2012, 00:15
Post multiphase udf
  #1
New Member
 
Join Date: Dec 2009
Posts: 10
Rep Power: 7
ak2009 is on a distinguished road
Hi....

I am writing udf for multiphase flow to access the phase level data (primary phase).

I tried two ways to define the problem. Giving below both the udfs


I'st udf

#include "udf.h"
DEFINE_EXECUTE_AT_END (calculate_water_flow_rate)
{
int phase_domain_index = 0;
Domain *subdomain;
real total_flow_rate=0;
face_t f;
subdomain = Get_Domain(2);
int ID = 6;
Thread *thread = Lookup_Thread(subdomain,ID);

thread_loop_f(thread,subdomain)
{
begin_f_loop_all(f,thread)
{
total_flow_rate += F_FLUX(f,thread);
}
end_f_loop_all(f,thread)
}
printf("flow rate of water at outlet: %g/n", total_flow_rate);
}

In here, I have to access the phase level info (for primary phase, water) at outlet (ID - 6). So used the lookup_thread utility to find the approrpiate phase level thread.

Then I intend to estimate total flow rate of water going out from outlet faces. So looped over all the faces in the outlet thread.

The udf compiles . It gives some value which does not match with that calculated by fluent in the outlet boundary.

Is there any method by which I can read the outlet flowrate directly.


2nd UDF is....

#include "udf.h"


DEFINE_EXECUTE_AT_END (calculate_water_flow_rate)

{
int phase_domain_index = 0;
Domain *mixture_domain;
Domain *subdomain;
real total_flow_rate=0;
face_t f;
mixture_domain = Get_Domain(1);
subdomain = Get_Domain(2);
int ID = 6;
Thread *mixture_thread = Lookup_Thread(mixture_domain,ID);
Thread *subthread =

THREAD_SUB_THREAD(mixture_thread,phase_domain_inde x);

thread_loop_f(subthread,subdomain)

{

begin_f_loop_all(f,subthread)

{

total_flow_rate += F_FLUX(f,subthread);

}

end_f_loop_all(f,subthread)

}

printf("flow rate of water at outlet: %g/n", total_flow_rate);

}


In here, tried to dig the same info using THREAD_SUB_THREAD loop. First used the lookup thread utility to find out the mixture thread at outlet (ID - 6). Then using thread sub thread loop, accessed the phase level thread for primary pahse.

In both cases, I get some value of otlet water flow. I am not sure if either of the approaches is adequate for the case.


Need inputs about udfs....


Thanks
ak2009 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for coal combustion in multiphase flow niisha24 Fluent UDF and Scheme Programming 10 March 9, 2015 02:56
Multiphase udf ak2009 Main CFD Forum 0 June 5, 2012 15:52
Multiphase Mass transfer UDF issue therandomestname FLUENT 0 April 21, 2011 14:51
How to access only one phase in multiphase model by UDF wersoe Fluent UDF and Scheme Programming 0 September 23, 2009 07:57
UDF for multiphase flow ROOZBEH FLUENT 3 April 7, 2004 17:54


All times are GMT -4. The time now is 15:00.