Dynamic BCs Based on Probes/Properties at a Specific Point
Hello,
Context: I am trying to set up a model with dynamic boundary conditions. The model is a carpark with a fire, where I want inlet and outlet fans (BCs) to dynamically turn on/off when a certain measured property is reached in a specific location (Probe/Detector). For example when a temperature of 68*C is reached in a specific location, I want the inlet and outlet fans (BCs) to turn off. I know I could run an initial model to figure out when certain events occur, then reset the model with the BC modified to turn off at the specified time. However, i would rather run the model once to save time and computer recourses. Note this is intended to emulate heat/smoke/CO detectors controlling controlling active systems such as fans/dampers, as they would in real life. My question: Is it possible to dynamically modify a BC based on the properties in a specific location of the model? Additional: I believe it may be possible using the codedFixedValue BC, however I am new to C++ coding and could not find any examples. Because of this I am not sure it is possible using the codedFixedValue BC. If there are any other ways, that are known or could be developed, to dynamically modify a BCs, any information would be greatly appreciated. |
I figures out how to do this using functions in the controlDict to stop the model and an All_run bash script to restart and modify the boundary condition.
control dict functions: Code:
functions Code:
actions # Application name Code:
application=$(getApplication) |
Nice work Alex, and thanks for posting your solution - it's always good to see other's solutions, and to swap ideas. By the way, for getting the name of the latest time folder
Code:
latestFolder=$(ls processor0/ -t | head -1) Code:
time=$(foamListTimes -latestTime) |
All times are GMT -4. The time now is 18:06. |