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] Varying heat flux using groovyBC with chtMultiRegionSimpleFoam (https://www.cfd-online.com/Forums/openfoam-community-contributions/164024-varying-heat-flux-using-groovybc-chtmultiregionsimplefoam.html)

hcl734 December 10, 2015 10:05

Varying heat flux using groovyBC with chtMultiRegionSimpleFoam
 
Hi all,

I want to impose a heat flux varying linear with the y-coordinate.
Basically it's just
q(y)=C1*y+C2

Since I can't see how to do this with boundary conditions like externalWallHeatFluxTemperature
I got the idea oif calculating the temperature gradient with thermal conductivity of the wall and use groovyBC to impose this BC.
dT/dn = C3*y + C4

Code:

type            groovyBC;
gradientExpression "(0.05*pos().y+0.01)";

That doesn't work at all since the wall is actually cooling and I can't see any influence of the y-coordinate.

http://s12.postimg.org/7dwd8bmrh/Scr...0_16_04_47.png


I wonder whether groovyBC really sets the boundary condition for temperature or for energy.
Because when I compared externalWallHeatFluxTemperature, fixedGradient and groovyBC, the latter one deviates heavily from the first ones.

Code:

/*
    type            externalWallHeatFluxTemperature;
        kappa          solidThermo;
        q              uniform 500;
        thicknessLayers ();
        kappaLayers    ();
        value          uniform 400;
        kappaName      none;
        QrName          none;

*/

/*
type    fixedGradient;
gradient    uniform 6.25;
*/

/*
    type            groovyBC;
gradientExpression "6.25";

*/

Could somebody shed some light on this for me?
Every help is appreciated!
My test case:
https://owncloud.tu-berlin.de/public...e61c8c86356a78

Best

hcl734 December 11, 2015 06:59

I solved my problem by modifying the boundary condition to the following


Code:


type            groovyBC;
fractionExpression "0";
variables "C1=0;C2=6.25;";
gradientExpression "(C1*pos().y+C2)";
value uniform 0;


fabian_roesler December 11, 2015 08:21

Right, if you miss the fractionExpression, groovyBC assumes you are using a fraction of 1 which corresponds to fixedValue. So when you want to set a gradient you have to set the fractionExpression to zero.
That's the reason I always set all three expressions in groovyBC.

Cheers

Fabian

hcl734 December 11, 2015 08:40

Yeah exactly I thought I could just omit that one.
But another question for me is whether setting the temperature gradient to apply a varying heat flow is going to work on a curved geometry as well.
Since the gradient has to be normal to the wall. Is this automatically done by OF or do I have to take this into consideration?

hcl734 December 15, 2015 07:20

So I tried to impose the nonuniform heat flux with the groovyBC heat gradient on a curved surface with unstructured mesh and the result doesn't look to good for me.

The heat flux on the surface becomes "patchy" with zones of high flux and zones with low flux also when I applied a constant wallHeatFluxTemperature BC.

Do you know whether OpenFOAM accounts for the normal direction when applying a fixedGradient boundary condition by itself?

http://s8.postimg.org/faw0dy0xx/Scre...5_13_22_06.png

hcl734 December 15, 2015 08:55

To avoid the workaround using fixedGradient to apply a heat flux I'm using

Code:

    type            externalWallHeatFluxTemperature;
        kappa          solidThermo;
        q              nonuniform  List<scalar> 56(
4.5
[...]
145
);
        thicknessLayers ();
        kappaLayers    ();
        value          uniform 400;
        kappaName      none;
        QrName          none;

It works as intended for a simple geometry where I can calculate the values for every cell in Matlab easily.
But it's nearly impossible to do it in this "manual" way for a complex geomety.
Is there a way to use a swak4Foam like expression in combination with externalWallHeatFluxTemperature boundary condition?

I uploaded my simple testcase for you here

https://owncloud.tu-berlin.de/public...da69d0f2649e9e


All times are GMT -4. The time now is 01:18.