CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Variable T_inf for convection problem in a pipe using groovyBC (https://www.cfd-online.com/Forums/openfoam-solving/123115-variable-t_inf-convection-problem-pipe-using-groovybc.html)

 Mojtaba.a September 4, 2013 13:50

Variable T_inf for convection problem in a pipe using groovyBC

1 Attachment(s)
Hi all,
I am trying to simulate a simple pipe with constant heat flux walls, which are cooled by fluid flow going through the pipe.

Here is an image for better illustration:

http://www.cfd-online.com/Forums/att...1&d=1378316658

Here is what I am gonna do. For wall BC I want to use:

Code:

`dT/dn= (q-h*(T-T_inf))/(k_f)`
In which T_inf is the average bulk temperature of the fluid, which varies across the pipe.

To calculate bulk temperature I want to use the average value of T as a variable of x (Length from the inlet).

How can I calculate this average in each x and use it as T_inf?

Is it possible to do this using groovyBC?

 gschaider September 4, 2013 15:08

Quote:
 Originally Posted by Mojtaba.a (Post 449901) Hi all, I am trying to simulate a simple pipe with constant heat flux walls, which are cooled by fluid flow going through the pipe. Here is an image for better illustration: http://www.cfd-online.com/Forums/att...1&d=1378316658 Here is what I am gonna do. For wall BC I want to use: Code: `dT/dn= (q-h*(T-T_inf))/(k_f)` In which T_inf is the average bulk temperature of the fluid, which varies across the pipe. To calculate bulk temperature I want to use the average value of T as a variable of x (Length from the inlet). How can I calculate this average in each x and use it as T_inf? Is it possible to do this using groovyBC?
Not the way you'd want to.

The first thing is that T_avg(s) is not really well defined after the pipe bend (BTW: convention is that x is a component of cartesian coordinates. The string length which you mean is s. At least the way I learned it). So the first thing would be to specify/calculate it for the whole geometry. Then you can calculate your T_avg(s) (for this there is actually a functionObject swakExpressionAverageDistribution in the development verson. But currently there is no way to feed that data back to your BC)

 Mojtaba.a September 4, 2013 15:50

Quote:
 Originally Posted by gschaider (Post 449915) Not the way you'd want to. The first thing is that T_avg(s) is not really well defined after the pipe bend (BTW: convention is that x is a component of cartesian coordinates. The string length which you mean is s. At least the way I learned it). So the first thing would be to specify/calculate it for the whole geometry. Then you can calculate your T_avg(s) (for this there is actually a functionObject swakExpressionAverageDistribution in the development verson. But currently there is no way to feed that data back to your BC)
Thank you Bernhard.

 jherb September 4, 2013 18:21

Why don't you use the turbulentHeatFluxTemperature boundary condition?