CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] adjust inlet temperature depending on values of monitor points (groovyBC) (https://www.cfd-online.com/Forums/openfoam-community-contributions/88939-adjust-inlet-temperature-depending-values-monitor-points-groovybc.html)

braennstroem May 31, 2011 03:30

adjust inlet temperature depending on values of monitor points (groovyBC)
 
Hello,
I would like to use an time-varying inlet temperature, where the temperature gets adjusted/controlled by the mean value of temperature probes and the mean value of a certain cellSet/faceSet (slice through the domain).

The adjustment should happen around every 500 iterations in small steps. If the mean values are above a certain limit, the inlet temperature should become smaller and vice versa.

Right now, I would say that the best approach would be to use groovyBC, where I could use as a variable:
Tmean{faceZone'sliceToMonitor}=average(T)
(Tmean>300.0) ? ((Tinlet=T{inlet}-0.5) : Tinlet=T{inlet}+0.5)

I think this could work...
Do you have an idea how to further include probes and how the time iterations of 500 could be achieved? Maybe it would be enough to slightly adjust the temperature after an initial convergence time with smaller steps continously.

Thanks!
Fabian

gschaider May 31, 2011 04:50

Quote:

Originally Posted by braennstroem (Post 309869)
Hello,
I would like to use an time-varying inlet temperature, where the temperature gets adjusted/controlled by the mean value of temperature probes and the mean value of a certain cellSet/faceSet (slice through the domain).

The adjustment should happen around every 500 iterations in small steps. If the mean values are above a certain limit, the inlet temperature should become smaller and vice versa.

Right now, I would say that the best approach would be to use groovyBC, where I could use as a variable:
Tmean{faceZone'sliceToMonitor}=average(T)
(Tmean>300.0) ? ((Tinlet=T{inlet}-0.5) : Tinlet=T{inlet}+0.5)

I think this could work...
Do you have an idea how to further include probes and how the time iterations of 500 could be achieved? Maybe it would be enough to slightly adjust the temperature after an initial convergence time with smaller steps continously.

Thanks!
Fabian

Hi Fabian!

The latest incarnation of swak4Foam (definitly in Mercurial, not sure about SVN) has something called "stored variables" which are variables that keep their value and which you can abuse to store states (of course you'll have to do some ?:-switching as all the variables are evaluated, but you'll figure that out). There is an example fillingTheDam-there. I'll give a more detailed explanation at my talk at the workshop, so if you're not already registered, its not to late ....

Bernhard

braennstroem May 31, 2011 13:45

Thanks... as always quite interesting!
The workshop is a bit too far away :-(

Fabian


All times are GMT -4. The time now is 12:56.