CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Changing Frozenflowfield in chtMultiRegionFoam Solver during simulation (https://www.cfd-online.com/Forums/openfoam-programming-development/202815-changing-frozenflowfield-chtmultiregionfoam-solver-during-simulation.html)

meshingpumpkins June 8, 2018 09:08

Changing Frozenflowfield in chtMultiRegionFoam Solver during simulation
 
Case: Heatsink which is cooled by a fan.

In fact i have many different flow states (different operation point of the fan)
I am interessted in the transient behaviour of the heatsink.
Therefore i use the chtMultiRegionFoam solver (openfoam v5)

To increase the simulation time i want to do the following:(instead of using the standard transient chtMultiRegionFoam)

1) calculate the different flowfields for the operating points of the fan (steady solution)

2) i use the chtMultiRegionFoam solver in the frozenflow mode

3) i have a temperature critiria. at some specific point the heat sink has a certain temperature. at this temperature i want to increase the power of the fan (changing the presimulated steady state flow field)

my question is: does anyone have an idea of how i should implement my solver? is it possible to have a pointer for the Fluid field variables?somehow like this

if temperature condition 1 is true: U-->U1 (p-->p1...etc)
if condition 2: U-->U2
if condition 3: U-->U3

or is there a better idea to implement my solver?

thx!

Bloerb June 8, 2018 09:48

From my perspective the easiest way to achieve this is something along these lines:

use a functionobject (min/max/average etc) to output the relevant temperatures and also use the abort function object.

Write a small batch script which monitors your functionobject values and calculates your temperature condition. If the condition is met make it terminate the simulation via the abort file. Copy the files for the new flow field into the folder. Restart the simulation.

meshingpumpkins June 11, 2018 09:16

thx for your quick answer.

i tried a similar approche with octave. octave was reading the outputfile of the functionobject which createt a txt file of the average temperatures. but somehow this doesn`t work because octave didn`read the file in realtime.

i will try this approche now with ah bash file. (should i use tail -f filename?for this?)

i have never used the abort function. how does the function work. how do i have to implement this function.


thx.

meshingpumpkins June 11, 2018 09:30

the other thing is, that the surfaceFieldValue.dat file which will be created by the averaging fieldfunction isn`t updated in real time

julieng February 18, 2019 18:43

Hello meshingpumpkins,


Did you succeed to use the frozen flow with ChtMultiRegionFoam?


My problem is more simple than yours. I want only compute a stationary flow (not energy) around a solid. If I use air at 500 K for the fluid I will use air properties at this reference temperature.



After, I want to use this "frozen" stationary flow in a transient simulation with ChtMultiRegionFoam. I did it in the same way in Comsol some years ago and if I remember well, heating or cooling times of the solid are not really different from the full 2 ways coupled cases (depending on what we want to observe).


My question is how to do that?
- Can I compute a stationary flow with an arbitrary solver (maybe I the same turbulent model as the one used in ChtMultiRegionFoam)?
- Use it as initial condition for U, p_rgh and p (also turbulence parameters are needed)? Don't know yet how to do that..

- Put right initial temperatures in the 0/ folder for fluid and solid

- Modify the fvSolution with "frozenFlow = true" in the SIMPLE loop?
- Something else to do?


Best regards



Best regards


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