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

Accesing multiple booundaries on a UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2020, 13:48
Default Accesing multiple booundaries on a UDF
  #1
New Member
 
Francisco Rojas
Join Date: Apr 2020
Posts: 2
Rep Power: 0
f_rojas is on a distinguished road
Hello everyone. I´ve a question regarding implementation of BC on a transient heat flow model. In my problem I´ve got a cubic shaped object in which their top and bottom faces are exposed to a heat flow by convection with heat transfer coefficients of 5[W/m2K] and 10[W/m2K], respectively. Now if the temperature of the bottom face drops below 275[K], then its new heat coefficient needs to do change to 10[W/m2K] and the coefficient of the bottom face to 5[W/m2K]. My problem is that when I implement this BC on the top face using a UDF, then I need to program it so that it can access the temperature field on the bottom face and monitor when it drops below 275[K], but I dont know how to program the UDF so it can have access to the temperature field in multiple boundaries.

If any of you have know how to help me i´d very much appreciate it.
f_rojas is offline   Reply With Quote

Old   April 6, 2020, 06:39
Default Accessing other boundary
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
There are at least two ways to do this. You can use (pick...) command in Fluent to access average temperature of a boundary and store it in a scheme variable. This scheme variable can be access in a C based UDF and then used to define boundary condition on the other boundary. For (pick...), type (pick-docu) in Fluent's user interface. It will give you an example of determining the value. To access the value in C based UDF, use RP_Get_Real(name of rp variable that stores the output of pick... command).

Other option is to provide the ID of other boundary within DEFINE_PROFILE. So, you will need to two face loops within DEFINE_PROFILE. First one to calculate average temperature of the other boundary. Second one to apply boundary condition on current boundary. For first loop, you have to use following commands

Thread *ts = Lookup_Thread(Get_Domain(1), 4);

You need to replace 4 with the ID of the other boundary from boundary conditions panel. Then, within first loop, use ts instead of the second argument of DEFINE_PROFILE.
HHK likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
boundary condition, heat transfer boundary, 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
Error code: 126 when loading parallel UDF Coop Fluent UDF and Scheme Programming 0 July 13, 2018 09:33
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 07:12
problem in UDF for Accesing previous Time Amir FLUENT 0 April 16, 2008 03:00
How to set multiple zones profile in UDF? jis3 FLUENT 2 April 25, 2004 16:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 18:06.