CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] Varying heat flux using groovyBC with chtMultiRegionSimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 10, 2015, 10:05
Default Varying heat flux using groovyBC with chtMultiRegionSimpleFoam
  #1
Member
 
Join Date: May 2015
Posts: 68
Rep Power: 10
hcl734 is on a distinguished road
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.




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 is offline   Reply With Quote

Old   December 11, 2015, 06:59
Default
  #2
Member
 
Join Date: May 2015
Posts: 68
Rep Power: 10
hcl734 is on a distinguished road
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;
hcl734 is offline   Reply With Quote

Old   December 11, 2015, 08:21
Default
  #3
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
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
fabian_roesler is offline   Reply With Quote

Old   December 11, 2015, 08:40
Default
  #4
Member
 
Join Date: May 2015
Posts: 68
Rep Power: 10
hcl734 is on a distinguished road
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 is offline   Reply With Quote

Old   December 15, 2015, 07:20
Default
  #5
Member
 
Join Date: May 2015
Posts: 68
Rep Power: 10
hcl734 is on a distinguished road
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?

hcl734 is offline   Reply With Quote

Old   December 15, 2015, 08:55
Default
  #6
Member
 
Join Date: May 2015
Posts: 68
Rep Power: 10
hcl734 is on a distinguished road
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
hcl734 is offline   Reply With Quote

Reply

Tags
expression, externallwallheat, gradient, groovybc, heat transfer


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for a time varying heat flux boundary condition B.Hamada Fluent UDF and Scheme Programming 9 August 8, 2018 12:51
[swak4Foam] Fixed Wall Heat Flux with groovyBC flowpow OpenFOAM Community Contributions 0 September 7, 2016 09:48
[swak4Foam] Heat Flux boundary conditions with groovyBC for chtMultiRegionFoam with solids only Kumudu OpenFOAM Community Contributions 7 August 23, 2014 14:33
Heat Flux at wall in a conjugate heat transfer problem Chander CFX 2 July 9, 2011 22:22
Linearly varying heat flux Ankit Tayal FLUENT 1 April 16, 2006 10:12


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