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

UDF for changing boundary condition based on max T

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2018, 11:20
Default UDF for changing boundary condition based on max T
  #1
Member
 
Reza khodadadi
Join Date: Apr 2011
Location: https://t.me/pump_upp
Posts: 32
Rep Power: 15
reza_65 is on a distinguished road
Send a message via ICQ to reza_65 Send a message via AIM to reza_65 Send a message via Yahoo to reza_65
Hi Formers,

I would like to change my boundary condition from wall to velocity inlet if the maximum temperature of the whole domain reaches 500.
Can you please help me with it?

Best Regards,
Reza
reza_65 is offline   Reply With Quote

Old   February 24, 2018, 06:18
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
This can not be done with a UDF (as far as I know), but you can write a scheme-script for this. It is possible, but it would take me too much time to find out how.
pakk is offline   Reply With Quote

Old   February 26, 2018, 05:43
Default
  #3
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 12
obscureed is on a distinguished road
Hi Reza,

Yes, Scheme is the way to do this, but documentation is sparse. Here is an attempt:
Code:
(define (change-wall trigger-temp)
  if (> (pick-a-real "/rep/vol/max (*) temperature n") trigger-temp)
    (begin
      (ti-menu-load-string "/def/b-c/zone-type (wall1) velocity-inlet")
      ;;; other commands here if required
    )
    (display "Change not needed\n")))
Paste the code above into the Fluent command window -- or, much better, put it into a file change001.scm, and then type the command (load "change001.scm"). Then, run the command
Code:
(change-wall 500)
at whatever frequency suits you (for example, as specified in Calculation Activities).

This does have the inelegance that it runs those commands all the time when max temperature exceeds 500K. (We are operating in kelvin here -- you do not specify what units you are using, which is a bad habit.) Also, it does not change the inlet back again if temperature goes back down. The inlet is not set up with boundary conditions -- either set it up in advance and change it back to wall, or add extra commands where I've put a comment. Replace ... with a TUI command here:
Code:
(ti-menu-load-string "...")


Good luck!
Ed

obscureed 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
UDF setting wall boundary condition with a DEFINE_PROFILE NLao FLUENT 3 September 2, 2019 01:33
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14


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