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

changeable boundary condition?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2019, 09:42
Post changeable boundary condition?
  #1
New Member
 
amirbhr
Join Date: Jul 2019
Posts: 4
Rep Power: 7
amirbhr is on a distinguished road
Hi everyone

I have a cfd problem with changeable boundary condition at outlet of the box. Would anyone please help me to solve the problem with the details below?

The outlet would be as wall until the maximum temperature of the domain reaches 350 (K). Then, the outlet changes to Mass flow outlet until the domain maximum temperature decreases to 330 (K) and once again the outlet converts to wall.

How can I set this boundary condition in Fluent using UDF?
amirbhr is offline   Reply With Quote

Old   July 18, 2019, 01:19
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
if you want to change boundary condition type -> you should use scheme language and TUI commands

1. Make *.scm file, here you will define variable (RPVAR) to check your criteria. exhample
Code:
(define (make-new-rpvar name default type)(if (not (rp-var-object name))(rp-var-define name default type #f)))
(make-new-rpvar 'my_switch_boundary #f 'boolean)
2. Make UDF to find maximum temperature, use DEFINE_EXECUTE_AT_END
3. Inside UDF compare Tmax with 350k, if Tmax>350 than change flag
4. Get variable from scheme. exhample
Code:
cxboolean udf_switch_boundary = False;

if (Tmax>350)
	udf_switch_boundary =True;
else
udf_switch_boundary =False;
5. Send your criteria state to scheme. exhample
Code:
if (RP_Variable_Exists_P("my_switch_boundary"))
	{RP_Set_Boolean("my_switch_boundary",udf_switch_boundary);
	Message0("switch was sent to scheme\n");}
	else { Message0("failed to send data to scheme\n");}
6. In Fluent GUI go to Calculation activities -> execute commands
activate command, when -> each timestep
If the wall, you wanna change has name wall-1, than inside command put following:
Code:
(if  (%rpgetvar 'my_switch_boundary)
	(begin
		(ti-info "**************SWITCH IS TRUE****************")
		(ti-menu-load-string (format #f "define boundary-conditions modify-zones zone-type wall-1 pressure-outlet"))
	)
	(ti-info "**************SWITCH IS FALSE | NO CHANGE****************")
)
use it as a basis

best regards
AlexanderZ 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
Radiation interface hinca CFX 15 January 26, 2014 18:11
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44


All times are GMT -4. The time now is 16:05.