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

How to find the cells adjacent to the wall?

Register Blogs Community New Posts Updated Threads Search

Like Tree14Likes
  • 1 Post By aam
  • 9 Post By Daniel Tanner
  • 1 Post By aam
  • 3 Post By gemini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 7, 2009, 06:01
Default How to find the cells adjacent to the wall?
  #1
aam
New Member
 
Join Date: May 2009
Posts: 3
Rep Power: 16
aam is on a distinguished road
Hi,

I am beginning with the UDFs. I need to store some data only in the centers of the cells adjacent to the wall. I identified my wall thread using Lookup_Thread. Now if I loop in this thread it shows me the 2d cells of the wall.

My question is, how to get the information on the first layer of the cells inside the domain???

Thanks

a.
mohameditdh likes this.
aam is offline   Reply With Quote

Old   May 7, 2009, 06:31
Default
  #2
Member
 
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 17
Daniel Tanner is on a distinguished road
Try the example below. First I initialise all cells to zero and then give the cells adjacent to the wall a value of 2. You can use the display-contour graphics to display the result. Remember to set 1 udm space and to initialise it and use the execute_on_demand option to execute this routine.

#include "udf.h"
DEFINE_ON_DEMAND(Test)
{
Domain *d; /* Get the domain using Fluent utility */
face_t f;
cell_t c, c0;

Thread *t, *t0, *ct;

int Zone_ID = 5; /* Zone Id can be seen in the Boundary Conditions Panel, for me 5 = Wall */
d = Get_Domain(1);

/* Initialise Cells */
/* this loops over all cells and lets the UDM = 0 */
thread_loop_c(ct, d)
{
begin_c_loop(c,ct)
{
C_UDMI(c,ct,0) = 0.0;
}
end_c_loop(c,ct)
}

/* Loop over all faces on wall */
t = Lookup_Thread(d, Zone_ID);
begin_f_loop(f,t)
{
/* c0 and t0 identify the adjacent cell */
c0 = F_C0(f, t);
t0 = THREAD_T0(t);
/* this loops over all cells adjacent to wall and lets the UDM = 2.0 */
C_UDMI(c0, t0, 0) = 2.0;
}
end_f_loop(f,t)
}
czhao86, hassansalem, wond and 6 others like this.
Daniel Tanner is offline   Reply With Quote

Old   May 7, 2009, 08:44
Default
  #3
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
This is exactly what I needed too, works perfect!
O.D.Y. is offline   Reply With Quote

Old   May 15, 2009, 04:15
Default
  #4
aam
New Member
 
Join Date: May 2009
Posts: 3
Rep Power: 16
aam is on a distinguished road
Thanks, It worked perfectly... Should've read the manual more

Regards

a.
aam is offline   Reply With Quote

Old   May 19, 2009, 14:40
Default
  #5
Member
 
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 47
Rep Power: 17
gemini is on a distinguished road
Hi
Following may be useful;

loop over all cells over domain
{
loop over all faces of cell
{
if (BOUNDARY_FACE_THREAD_P(t))
{
This cell is next to a boundary face
do the stuff here
}
}
}

good luck
gemini is offline   Reply With Quote

Old   June 27, 2017, 12:56
Default
  #6
New Member
 
HASAN
Join Date: Oct 2016
Location: canada
Posts: 9
Rep Power: 9
alburkatyhasan@yahoo.com is on a distinguished road
please can you send me the manual what u read?
alburkatyhasan@yahoo.com
many thanks dear
alburkatyhasan@yahoo.com is offline   Reply With Quote

Old   June 28, 2017, 08:53
Default
  #7
Member
 
MayTheFlowBeWithYou's Avatar
 
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 8
MayTheFlowBeWithYou is on a distinguished road
He refers to the ANSYS Fluent manual, its build into your copy of the ANSYS software.
MayTheFlowBeWithYou 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
Influece of wall velocity in the main flow marvin CFX 0 March 22, 2008 02:05
Need help on mass source at wall boundary! James FLUENT 0 October 16, 2007 02:40
Wall functions tutlhino OpenFOAM Pre-Processing 0 July 2, 2007 05:04
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12
Wall functions? Pr Main CFD Forum 7 April 8, 2004 06:15


All times are GMT -4. The time now is 08:36.