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 change boundary types at a certain pressure during transient calculation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2024, 01:04
Default How to change boundary types at a certain pressure during transient calculation
  #1
New Member
 
Join Date: Jun 2024
Posts: 2
Rep Power: 0
Asphodel is on a distinguished road
Hello everyone.

I'm using FLUENT 2024 to do a transient simulation about a diaphragm inside a tube which ruptures at 8 MPa.

At beginning, the boundary type of the diaphragm is set as wall through GUI, and I'd like to change it into interior when the vertex max pressure of the diaphragm reaches 8 MPa.

I did some research and wrote a scheme code in the “Calculation Activities - Execute Commands” module, but it did not seem to work. The code is given below.

It's my first time using scheme programming in FLUENT.

Thank you very much in advance.

Regards.

Asphodel

Code:
(rp-var-define' pres1 0.101325' real #f)
(define (change_bc_1)
(let ()
(rpsetvar 'pres1 (pick-a-real "/report/surface-integrals/vertex-max diaphragm1 () pressure no"))

(if (>= (rpgetvar 'pres1) 8)
(begin
(ti-menu-load-string "/define/boundary-conditions/zone-type diaphragm1 interior")
)
)
)
)
Asphodel is offline   Reply With Quote

Old   July 13, 2024, 10:19
Default
  #2
New Member
 
Join Date: Jun 2024
Posts: 2
Rep Power: 0
Asphodel is on a distinguished road
I figured it out. I set the monitor and named expression through GUI and used simplified scheme code to get it done.

Code:
(if(>(string->number (pick-robust"/define/named-expressions/compute expr1" 0.1)) 8)(ti-menu-load-string "/define/boundary-conditions/zone-type diaphragm1 interior"))
Asphodel 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
UDF/SCHEME to Change Individual Cell Boundary Conditions Based on Pressure JaySmall1 Fluent UDF and Scheme Programming 2 March 31, 2022 23:13
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 01:44
Domain Imbalance HMR CFX 5 October 10, 2016 05:57
Radiation interface hinca CFX 15 January 26, 2014 17:11
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


All times are GMT -4. The time now is 20:19.