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

Problems to loop one phase in multiphase using UDF(Solid+fluid zones, three phases)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2014, 12:31
Default Problems to loop one phase in multiphase using UDF(Solid+fluid zones, three phases)
  #1
New Member
 
Sean
Join Date: Mar 2009
Posts: 15
Rep Power: 17
songpen1985 is on a distinguished road
Hello,

I have a compuational domain with two zones (fluid and solid). In the fluid zone, I have three phases (A, B and C). I want to adjust the properties of the cells in phase B. The udf can be interpreted and run.

However, if I check the UDMI, all the cells instead of phase B in the compuational domain (including solid and fluid) are controlled by the udf. I just want to control the cells in phase B. It seems that "sub_domain_loop" loops all the cells in all zones instead of the cells in phase B. Can you help to see the problem? Thank you!
----------------------------------------------------------------------------
DEFINE_ADJUST(name,mixture_domain)
{
...
int phase_domain_index=1; /*get the phase B*/
...
sub_domain_loop(subdomain, mixture_domain, phase_domain_index)
{
thread_loop_c(t,subdomain)
{
begin_c_loop_all(c,t)
...
UDMI(c,t,0)=...
...

--------------------------------------------------------------------------
songpen1985 is offline   Reply With Quote

Old   March 14, 2015, 20:42
Default UDF for multiphase flow identifier
  #2
New Member
 
Azharuddin
Join Date: Jan 2010
Posts: 4
Rep Power: 16
azharuddin0613 is on a distinguished road
Hello,

I am trying to model a membrane for separation of gas from mixture of gas and solid. I have tried to write a udf for gas separation from a mixture of gases. What macros do I need to incorporate in my udf.



DEFINE_INIT(init_function,d)
{

Thread *tc1, *tc2;
Thread *tf1, *tf2;
cell_t c1, c2;
face_t f1, f2;
real f_c1[2], f_c2[2];


thread_loop_c(tc1,d)
{
begin_c_loop(c1,tc1)
{
C_UDMI(c1,tc1,UDM_NEIGHBOUR_C) = 0.0;
C_UDMI(c1,tc1,UDM_NEIGHBOUR_TC) = 0.0;
C_UDMI(c1,tc1,UDM_MASS_SOURCE) = 0.0;
}
end_c_loop(c1,tc1)
}



tf1 = Lookup_Thread(d,WALLSIDE1);
tf2 = Lookup_Thread(d,WALLSIDE2);


begin_f_loop(f1,tf1)
{

F_CENTROID(f_c1,f1,tf1);
c1 = F_C0(f1,tf1);
tc1 = THREAD_T0(tf1);


begin_f_loop(f2,tf2)
{

F_CENTROID(f_c2,f2,tf2);

if (fabs(f_c1[0]-f_c2[0]) <= TOLERANCE &&
fabs(f_c1[1]-f_c2[1]) <= TOLERANCE )

{

c2 = F_C0(f2,tf2);
tc2 = THREAD_T0(tf2);

C_UDMI(c1,tc1,UDM_NEIGHBOUR_C) = c2 + 0.1;
C_UDMI(c2,tc2,UDM_NEIGHBOUR_C) = c1 + 0.1;
C_UDMI(c1,tc1,UDM_NEIGHBOUR_TC) = THREAD_ID(tc2) + 0.1;
C_UDMI(c2,tc2,UDM_NEIGHBOUR_TC) = THREAD_ID(tc1) + 0.1;
}
}
end_f_loop(f2,tf2)
}
end_f_loop(f1,tf1)

Message("\n Membrane initialisation completed.\n");
}
azharuddin0613 is offline   Reply With Quote

Reply


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
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 06:21
fluid domain extraction for CHT problems bhanu1810 STAR-CCM+ 3 May 22, 2011 08:26
Phase Change Problems Jade M ANSYS 1 October 21, 2010 17:56
Problems with multiphase modeling magnounibo FLUENT 0 April 30, 2009 04:59
Non-newtonial Fluid Henry CFX 1 October 23, 2002 14:08


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