|
[Sponsors] |
May 7, 2009, 07:01 |
How to find the cells adjacent to the wall?
|
#1 |
New Member
Join Date: May 2009
Posts: 3
Rep Power: 17 |
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. |
|
May 7, 2009, 07:31 |
|
#2 |
Member
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 18 |
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) } |
|
May 7, 2009, 09:44 |
|
#3 |
Member
Join Date: Mar 2009
Posts: 49
Rep Power: 17 |
This is exactly what I needed too, works perfect!
|
|
May 15, 2009, 05:15 |
|
#4 |
New Member
Join Date: May 2009
Posts: 3
Rep Power: 17 |
Thanks, It worked perfectly... Should've read the manual more
Regards a. |
|
May 19, 2009, 15:40 |
|
#5 |
Member
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 47
Rep Power: 17 |
Hi
Following may be useful; loop over all cells over domain { loop over all faces of cell} good luck |
|
June 27, 2017, 13:56 |
|
#6 |
New Member
HASAN
Join Date: Oct 2016
Location: canada
Posts: 9
Rep Power: 10 |
||
June 28, 2017, 09:53 |
|
#7 |
Member
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 9 |
He refers to the ANSYS Fluent manual, its build into your copy of the ANSYS software.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Influece of wall velocity in the main flow | marvin | CFX | 0 | March 22, 2008 03:05 |
Need help on mass source at wall boundary! | James | FLUENT | 0 | October 16, 2007 03:40 |
Wall functions | tutlhino | OpenFOAM Pre-Processing | 0 | July 2, 2007 06:04 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |
Wall functions? | Pr | Main CFD Forum | 7 | April 8, 2004 07:15 |