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

Obtaining a spices value in a boundary outlet

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

Like Tree1Likes
  • 1 Post By Yasser

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2021, 17:22
Default Obtaining a spices value in a boundary outlet
  #1
Senior Member
 
AH
Join Date: Apr 2014
Posts: 282
Rep Power: 12
visitor is on a distinguished road
If the macro from fluent reads the pollutant species mass fraction is
C_POLLUT(c,t,i) and i in this case say it is 4 (soot), how do I get this to read a boundary wall?

Example below is the macro, but how do I get this to read a boundary wall outlet with an ID5? The ID5 is shown in Fluent boundary IDs.

C_POLLUT(c,t,4);
visitor is offline   Reply With Quote

Old   March 31, 2021, 23:09
Default
  #2
Member
 
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 52
Rep Power: 19
Yasser is on a distinguished road
Quote:
Originally Posted by visitor View Post
If the macro from fluent reads the pollutant species mass fraction is
C_POLLUT(c,t,i) and i in this case say it is 4 (soot), how do I get this to read a boundary wall?

Example below is the macro, but how do I get this to read a boundary wall outlet with an ID5? The ID5 is shown in Fluent boundary IDs.

C_POLLUT(c,t,4);
First, I am not sure if a similar macro exist for face thread or not ... Many cell macros have similar macros for the face, just by replacing C with F .. and they are not documented in the UDF manual. So, I will assume that F_POLLUT(f,t,i) is the same macro for face.

The wall is a face thread .. so, try this

Quote:
Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, ID);
face_t f;
begin_f_loop(f, thread)
{
F_POLLUT(f,t,i);
}
end_f_loop(f,thread)
pakk likes this.
Yasser is offline   Reply With Quote

Old   April 1, 2021, 04:35
Default
  #3
Senior Member
 
AH
Join Date: Apr 2014
Posts: 282
Rep Power: 12
visitor is on a distinguished road
Thanks Yasser

I will try your suggestion as soon as possible.

This is good, all i have to do is enter boundary wall ID.

I can also use this in an "if" condition statement e.g.
{
If((F_POLLUT(f,t,i))>0.001)
.....
/*i for soot is 4*/
/* F_POLLUT(f,t,i) reads a mass fraction*/
}

Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, ID);
face_t f;
begin_f_loop(f, thread)
{
F_POLLUT(f,t,i);
}
end_f_loop(f,thread)
visitor is offline   Reply With Quote

Old   April 1, 2021, 11:52
Default
  #4
Member
 
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 52
Rep Power: 19
Yasser is on a distinguished road
also change the word "thread" to "t"
Yasser is offline   Reply With Quote

Old   April 1, 2021, 14:03
Default
  #5
Senior Member
 
AH
Join Date: Apr 2014
Posts: 282
Rep Power: 12
visitor is on a distinguished road
Yes, thanks. It has to be the same.

I will be adding a define_profile to open/close an air inlet. Once i get back to computing.

Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, ID);
face_t f;
begin_f_loop(f, t)
{
If((F_POLLUT(f,t,4))>0.001)
DEFINE_PROFILE(inlet,th,i)
{
face_t f;
begin_f_loop(f,th)
{
For(f=1;f<=5;(f+=0 5)) /*increment air in steps of 0.5 and up to 5. Untill pollution drops*/
F_PROFILE(f,th,i)=f;
}
end_f_loop(f,th);
}
end_f_loop(f,t)
}
visitor is offline   Reply With Quote

Old   April 1, 2021, 14:10
Default
  #6
Member
 
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 52
Rep Power: 19
Yasser is on a distinguished road
I don't think this is going to work ... Lookup_Thread and other macros should be inside a function.

Also you can not add define macro inside a function ... any macro that starts with DEFINE should be a macro by itself ... You can recall the function from any other function by its name .. for example,

inlet();
Yasser is offline   Reply With Quote

Old   April 1, 2021, 14:51
Default
  #7
Senior Member
 
AH
Join Date: Apr 2014
Posts: 282
Rep Power: 12
visitor is on a distinguished road
Changed it to a loop within a loop. I have added more info for clarifications.

DEFINE_PROFILE(inlet,th,i); /*defining for the air inlet*/
Domain d = Get_Domain(1);
Thread *t = Lookup_Thread(d, 4); /*the 4 is for soot*/
face_t f;
begin_f_loop(f, t) /*this is for the outlet with soot monitored*/
{
If((F_POLLUT(f,t,4))>0.001)

begin_f_loop(f,th) /*this is the air inlet*/
{
For(f=1;f<=5;(f+=0 5))
/*increment air in steps of 0.5 and up to 5. Until pollution drops*/
F_PROFILE(f,th,i)=f;
}
end_f_loop(f,th);

}
end_f_loop(f,t)
}
visitor 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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 02:44
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05


All times are GMT -4. The time now is 04:49.