CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   externalWallHeatFluxTemperature BC with h as a function of Twall (https://www.cfd-online.com/Forums/openfoam-solving/145946-externalwallheatfluxtemperature-bc-h-function-twall.html)

zfaraday December 15, 2014 17:00

externalWallHeatFluxTemperature BC with h as a function of Twall
 
Hi foamers,

I'm trying to simulating a heat transfer case with chtMultiRegionFoam where one of the boundaries transfers heat with the environment by convection. This is a simple problem where the boundary is defined as "externalWallHeatFluxTemperature" defining both values of "Ta" and "h". So far it is a basic case. However, I would like to define the heat transfer in the boundary wall using a variable value of "h" where its value depends on the value of T at the boundary.

The first thing I thought about was to use swak4foam but I'm not sure how to tackle it.

----------------------1st Question----------------------
Would it be possible to use the same boundary type (externalWallHeatFluxTemperature), but adding some lines with the expressions needed to calculate h? I don't think so but I ask for it just in case...
-------------------------------------------------------------


I haven't much experince using swak4foam, actually I only used it like one year ago to create a BC for convective heat transfer before I found out that externalWallHeatFluxTemperature existed. This was the definition I used:
Code:

    sup_convection
    {
        type              groovyBC;
        variables          ("h=50.0;"
                            "Ta=20.0;"
                            "k=0.5;");
        valueExpression    "Ta";
        fractionExpression "1.0/(1.0 + k/(mag(delta())*h))";
        value              uniform 200;
    }

I guess that one possible approach would be to start with this BC and use the necessary expressions to make "h" change each time step depending on the value of T at the boundary. However, I have some doubts about this procedure.

----------------------2nd Question----------------------
a)How can I access the value of T at the boundary to use it in the calculations?
b)Imagine I have a set of expressions to be used in the calculations depending on the value of T at the boundary that need to satisfy a condition such as:
Code:

if T<a ---> expr.1
else if a<T<b ---> expr.2
else if T>c ---> expr.3

Can I do something like that with the groovyBC BC?

-------------------------------------------------------------


I have been reading the documentation of swak4foam and trying some tutorials and, although I think this is what I need, I still don't know how to do it.

If you can give me any hint about the most proper aproach to solve my problem, don't hesitate to do it! I will appreaciate any word you can give me! Remember, you can give me a really nice (and free) Christmas present! :D

Many thanks in advance!

Alex


Note: I am using OF 2.3.x and I noticed that some swak's tutorial cases are outdated since I couldn't solve the chtMultiRegion case because of a wrong boundary definition for the pressure.

mick223 September 15, 2015 10:45

Hi Alex,

Sorry for reviving your old thread, but this seems like one of the only relevant ones to what I'm trying to find out.

I'm new to using groovyBC, and trying to find out whether the heat flux is calculated on a patch (presumably as an average or similar) or on each individual cell? I have a case with heat loss through several patches, and am wondering how it is calculated.

Thanks,

Mick.

Nicole November 18, 2015 05:52

Hi Mick,

Good question! I always just assumed groovyBC was calculating it for each individual cell, but perhaps you could use the wallHeatFlux post-processing utility to visualise the heat flux on the patches as a test?

(If you have an incomprssible case you can use wallHeatFluxIncompressible which can be downloaded here: http://www.cfd-online.com/Forums/ope...ance-flow.html)

zfaraday November 18, 2015 07:02

Hi guys!

I'm not totally sure about the first question. Does groovyBC compute heat flux with any option or utility? I need more info about it... The way I used to use in order to compute heat fluxes across patches was either by using, as Nicole points out, wallHeatFux utility or by using a custom function object defined by using swak4foam. Both methods compute first the heat flux per cell and then integrate it over the whole patch. The formula would be something like

\frac{\sum heatFlux_{i} * area_{i}}{\sum area_{i}}

I hope that my answer may solve this question.

Best ragards,

Alex

mick223 November 18, 2015 22:50

Hi Alex and Nicole,

Thanks for the responses,
I have since worked it out, and it does in fact calculate the heat loss on a cell-by-cell basis, when applied properly. The issue that I was having was that the way I was specifiying the temperature applied,
Code:

Toutlet{backwall}=oldTime(T)
was having the effect of requesting data as if it were a remote patch, and so it was averaging the cell temperature to perform the heat loss calculation. To remedy this, simply remove the {backwall} term and it will default to using the local temperature, for each individual cell.

To my understanding, groovyBC is able to compute a variable heat flux, although because it does not perform an energy balance, it instead must apply a temperature gradient. To do this, input the usual heat loss equation for the boundary, but divide it by the thermal conductivity of the material losing heat. I learned this here:
http://www.cfd-online.com/Forums/ope...hase-flow.html

Thanks for the link to the wallHeatFlux utility, I'll use it down the track to validate that my heat loss is correct.


All times are GMT -4. The time now is 03:38.