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

Assigning values for outlet boundary from its adjacent cell

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By blackmask
  • 2 Post By shikamaru

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 11, 2013, 13:08
Red face Assigning values for outlet boundary from its adjacent cell
  #1
New Member
 
Ali nabavi
Join Date: Jul 2012
Posts: 10
Rep Power: 14
Ali.nabavi is on a distinguished road
Hello,

I am very new to the world of UDF ( Mostly 3 days!). I want to write a UDF for my outlet boundary condition (pressure outlet) to get its value from its neighbor (adjacent cell).

Actually I am struggling to how can I get the info from the adjacent cell and then assign it to the boundary cell.

I know it is very was but I am struggling for a couple of days and still no result.
Ali.nabavi is offline   Reply With Quote

Old   July 11, 2013, 22:54
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
Technically it is not hard to do this. But physically are you seeking for the far field or outflow b.c.?
Ali.nabavi likes this.
blackmask is offline   Reply With Quote

Old   July 11, 2013, 23:05
Default
  #3
New Member
 
Nara Shikamaru
Join Date: Apr 2012
Posts: 22
Rep Power: 14
shikamaru is on a distinguished road
I was looking a way to fix velocities in adjacent cells of a boundary (which is not the right thing to do by the way). Take a look at this macros, you might be able to do what you want to do with these.

1. Use Lookup_Thread to find the face thread pointer to the boundary.
2. Use begin_f_loop to loop over the faces of the face thread
3. Use F_C0 and F_C1 to find the cell threads of the adjacent cells of the face
4. F_C0_THREAD and F_C1_THREAD will give you the thread pointer to the adjacent cells
5. use the cell the thread pointer to copy the values from those cells

---do what ever you want after that with those.

Hope it helps.
Ali.nabavi and sajjad taghavi like this.
shikamaru is offline   Reply With Quote

Old   July 11, 2013, 23:05
Default
  #4
New Member
 
Ali nabavi
Join Date: Jul 2012
Posts: 10
Rep Power: 14
Ali.nabavi is on a distinguished road
Thank you for your fast reply...

Actually i want to use it for pressure outlet B.C.
Ali.nabavi is offline   Reply With Quote

Old   July 11, 2013, 23:19
Default
  #5
New Member
 
Ali nabavi
Join Date: Jul 2012
Posts: 10
Rep Power: 14
Ali.nabavi is on a distinguished road
Quote:
Originally Posted by shikamaru View Post
I was looking a way to fix velocities in adjacent cells of a boundary (which is not the right thing to do by the way). Take a look at this macros, you might be able to do what you want to do with these.

1. Use Lookup_Thread to find the face thread pointer to the boundary.
2. Use begin_f_loop to loop over the faces of the face thread
3. Use F_C0 and F_C1 to find the cell threads of the adjacent cells of the face
4. F_C0_THREAD and F_C1_THREAD will give you the thread pointer to the cells
5. use the cell the thread pointer to copy the values from those cells

---do what ever you want after that with those.

Hope it helps.
Thank you so much for response!. To clarify your answer:

You mean in fluent find the zone ID and using Lookup_thread to find t of boundary faces. So until here I will have the t of boundary faces.
Then using begin_f_loop start my loop.
Next with F_c0 and F_c1 what will I get? Imagine I have a horizontal pipe which the fluid is flowing from the left to the right. If I use those F_c0 and F_c1 what will I get as the face is on outlet boundary so there is no C1 then?
Ali.nabavi is offline   Reply With Quote

Old   July 12, 2013, 02:06
Default
  #6
New Member
 
Nara Shikamaru
Join Date: Apr 2012
Posts: 22
Rep Power: 14
shikamaru is on a distinguished road
Read the UDF Manual: Chapter 3: Additional Macros for Writing UDFs and look for this macros

in V13, page 220 will clarify what you want to know.

Out of Curiosity, why do you want to look at the pressure of the adjacent cells of the outlet?
shikamaru is offline   Reply With Quote

Old   July 12, 2013, 06:09
Default
  #7
New Member
 
Ali nabavi
Join Date: Jul 2012
Posts: 10
Rep Power: 14
Ali.nabavi is on a distinguished road
Quote:
Originally Posted by shikamaru View Post
Read the UDF Manual: Chapter 3: Additional Macros for Writing UDFs and look for this macros

in V13, page 220 will clarify what you want to know.

Out of Curiosity, why do you want to look at the pressure of the adjacent cells of the outlet?
Thank you very much. I will take a look and will let you know about the result. I am modelling multiphase flow at the outlet boundary when all three phases are exiting the domain because our consider pressure outlet with a constant pressure as a default, there will be some disorders in my flow and it does not allow my phases to exist as easily as they were passing through the micro channel I tried outflow boundary but got worst result in this way to adjust on minimised the difference of outlet pressure with those three phases I want to condier the adjacent cell pressure for outlet and make my mesh super fine.

Hope you have some alternative remedy...
Ali.nabavi is offline   Reply With Quote

Old   July 12, 2013, 16:11
Default
  #8
New Member
 
Nara Shikamaru
Join Date: Apr 2012
Posts: 22
Rep Power: 14
shikamaru is on a distinguished road
I am doing something similar for multiphase flow. I am using VOF, check msg.
shikamaru is offline   Reply With Quote

Reply

Tags
adjacent cell, outlet boundary condition, udf and programming


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
FvMatrix coefficients shrina OpenFOAM Running, Solving & CFD 10 October 3, 2013 15:38
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
Immersed Boundary Ghost Cell Method thehexman Main CFD Forum 1 February 5, 2010 07:10
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
Retrieving boundary patch values adjacent to a given cell brooksmoses OpenFOAM Post-Processing 2 December 8, 2008 11:00


All times are GMT -4. The time now is 23:46.