|
[Sponsors] |
UDF for changing boundary condition based on max T |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
|
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 |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 ![]() |
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.
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 ![]() |
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"))) Code:
(change-wall 500) 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 |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
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 |