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 refer to adjacent cells in a UDF?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2023, 07:40
Question How to refer to adjacent cells in a UDF?
  #1
New Member
 
Gloria
Join Date: May 2023
Posts: 2
Rep Power: 0
lav1 is on a distinguished road
Hello! I am building a DPM model with a UDF. In that UDF, at some point, I need to use the property of a cell adjacent to the wall. How can I do that? I was thinking of using macros THREAD_T(t) and F_C0(f, t), but I am not sure on how to define the face. Setting it as “face_t f;” seems not enough.

Does anyone have a hint on how to approach it? Any reply will be much appreciated!
lav1 is offline   Reply With Quote

Old   May 8, 2023, 11:25
Default
  #2
Member
 
Odisha
Join Date: Jan 2020
Posts: 59
Rep Power: 6
Siba11 is on a distinguished road
Quote:
Originally Posted by lav1 View Post
Hello! I am building a DPM model with a UDF. In that UDF, at some point, I need to use the property of a cell adjacent to the wall. How can I do that? I was thinking of using macros THREAD_T(t) and F_C0(f, t), but I am not sure on how to define the face. Setting it as “face_t f;” seems not enough.

Does anyone have a hint on how to approach it? Any reply will be much appreciated!
Hi. You can use something like this.

Code:
c_face_loop(cell,t,n)
	{
		f = C_FACE(cell,t,n);
		tf = C_FACE_THREAD(cell,t,n);
	if(!BOUNDARY_FACE_THREAD_P(tf))
		{
		c0 = F_C0(f,tf);
		c1 = F_C1(f,tf);
                }
        }
Siba11 is offline   Reply With Quote

Reply

Tags
dpm, udf


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
Averaging over iterations for steady-state simulation CFD student Fluent UDF and Scheme Programming 8 September 22, 2022 04:39
How to use a UDF to set the volume fraction in the cells next to a wall? DF15 Fluent UDF and Scheme Programming 33 August 20, 2020 14:36
Writing udf regarding adjacent cells vkumar12 Fluent UDF and Scheme Programming 14 August 4, 2019 23:04
cellZone not taking all the cells inside rahulksoni OpenFOAM Running, Solving & CFD 6 January 25, 2019 01:11
UDF about Searching the Adjacent cells: Please help me to find out the error Hotpig1100 Fluent UDF and Scheme Programming 6 July 9, 2018 20:37


All times are GMT -4. The time now is 14:59.