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

wrong calculation of wallHeatFlux utility in solid patches

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By zfaraday

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2015, 09:12
Default wrong calculation of wallHeatFlux utility in solid patches
  #1
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 17
zfaraday will become famous soon enough
Dear foamers,

I'm currently working on a multi region case with chtMultiRegionFoam solver. In this case I only work with solids and my purpose is to calculate the heat balance in one of the solids in every time step. To do so, I implemented the following function objects in the controlDict file:
Code:
    energyVariationFasana
    {
        type swakExpression;
        region fasana;
        outputControlMode timeStep;
        outputInterval 1;
        aliases {
            rho thermo:rho;
        }
        expression "rho*vol()*(h-oldTime(h))/deltaT()";
        accumulations ( sum );
        valueType internalField;
        verbose true;
    }
    energyAbsorbedFasana
    {
        type patchExpression;
        outputControlMode timeStep;
        outputInterval 1;
        accumulations (
            sum
        );
        patches (".*");
        region fasana;
        variables ("k=0.5;"
                   );
	expression "k*(snGrad(T))*area()";
        verbose true;
    }
The first one computes the thermal power gained by the solid in the current time step while the second one computes the heat flux in all patches of the same solids (the same that wallHeatFlux utility does).

So far, one may think that only one of the methods to compute heat flux at patches should be used because it's a waste of time to use both. Well, I have used both and I found something surprising. Both methods give exactly the same result in regular patches (as it was expected), but very different one in patches of type mappedWall (those named solid1_to_solid2 that connect two solids). Here you can see an example of such difference:
Code:
wallHeatFlux           function object             wHF/fo   
-0.0382378		-0.01433923		2,6666564383
-0.044291812		-0.014763784		3,0000311573
0.013526612		0.0099961003		1,3531889031
-0.034700336		-0.013012907		2,6666090828
-0.044298687		-0.014766133		3,0000195041
I cannot figure out the reason of this big difference, but taking into account the physics of the problem I guess that the correct result is the one given by the function object since the equation used is the heat conduction equation (Fourier's Law).

My guess is that the wrong values have something to do with the contact area between solids because the bigger values of the third column belong to the patches that have bigger area that transfers heat from one solid to another.

Maybe there's some bug in the wallHeatFlux utility or maybe I am doing something wrong. Can anybody give me a hint on what is the correct value? In my case it's not a big deal because the contact surfaces between solids are not much big ant the heat transmitted between them is practically 0, but it may cause a big confussion in other cases where heat flux between different solids is an important point.

Note: Another point I don't understand is why I have to define the Fourire's Law in the function object as "k*(snGrad(T))*area()" instead of "-k*(snGrad(T))*area()" which is the correct formulation... If I use the correct one I get the opposite fluxes!

Thanks in advance.

Regards,

Alex
arvindpj and hcl734 like this.
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!

Last edited by zfaraday; January 23, 2015 at 09:15. Reason: Note added
zfaraday is offline   Reply With Quote

Old   January 30, 2015, 11:38
Default
  #2
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 17
zfaraday will become famous soon enough
Isn't there anyone who can shed some light on it? It seems that something doesn't work as expected with wallHeatFlux utility... Does no one really faced this problem before?
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   March 17, 2015, 05:17
Exclamation
  #3
New Member
 
Join Date: Mar 2015
Location: Earth yet
Posts: 25
Rep Power: 6
coccone is on a distinguished road
I am a newbie with OF, so I won't be of any help yet, but I am very interested in this topic as I need to calculate the heat transfer between solids in a chtMultiRegion case.

I agree with you there should be a minus in front of K*snGrad(T)*area() since heat flows in the opposite direction of temperature gradient vector indeed (positive direction pointing from cold to hot), though it can be a matter of sign convention. It seems to me that OF works with a coherent sign system (also when fixed gradients need to be imposed I use the opposite of what I would naturally use) so sign is not really a big deal for me, I am more concerned with magnitude.

One thing I would like to know is how to read out energyAbsorbed and energyVariation after calculation stopped and why does wallHeatFlux work only on walls (or how do I get heat fluxes from other kind of boundaries)...

Thanks for your effort!
coccone is offline   Reply With Quote

Old   March 19, 2015, 05:26
Default
  #4
New Member
 
Join Date: Mar 2015
Location: Earth yet
Posts: 25
Rep Power: 6
coccone is on a distinguished road
Quote:
Originally Posted by coccone View Post
One thing I would like to know is how to read out energyAbsorbed and energyVariation after calculation stopped
Ok, that I figured out. Had to compile swak4Foam for OF 2.3.1, and seems to work fine on all patches...

One thing is puzzling me is that energy variation is always null even though the region is heating up!
coccone is offline   Reply With Quote

Old   April 3, 2015, 05:25
Default
  #5
New Member
 
Join Date: Mar 2015
Location: Earth yet
Posts: 25
Rep Power: 6
coccone is on a distinguished road
Quote:
Originally Posted by zfaraday View Post

Code:
wallHeatFlux           function object             wHF/fo   
-0.0382378        -0.01433923        2,6666564383
-0.044291812        -0.014763784        3,0000311573
0.013526612        0.0099961003        1,3531889031
-0.034700336        -0.013012907        2,6666090828
-0.044298687        -0.014766133        3,0000195041
My guess is that the wrong values have something to do with the contact area between solids because the bigger values of the third column belong to the patches that have bigger area that transfers heat from one solid to another.
As I dug more into it, I understood wallHF computes a sum of conductive and turbulent diffusion. Since wHF/fo is greater than one I suspect it is somehow computing some turbulent contribuition on a solid region, which should even be related to area...

Could it be?

Quote:
Originally Posted by zfaraday View Post
In my case it's not a big deal because the contact surfaces between solids are not much big ant the heat transmitted between them is practically 0, but it may cause a big confussion in other cases where heat flux between different solids is an important point.
that's exactly my case

Anyway I'd go on (or, better, I do go on) with function obj since I have a grasp on what they actually do.

Last edited by coccone; April 3, 2015 at 06:52. Reason: forgot smthg
coccone is offline   Reply With Quote

Old   January 12, 2016, 08:41
Default
  #6
Member
 
Join Date: May 2015
Posts: 68
Rep Power: 6
hcl734 is on a distinguished road
Did you made any progress here?
hcl734 is offline   Reply With Quote

Old   January 12, 2016, 17:39
Default
  #7
New Member
 
Join Date: Mar 2015
Location: Earth yet
Posts: 25
Rep Power: 6
coccone is on a distinguished road
Quote:
Originally Posted by hcl734 View Post
Did you made any progress here?
I completely ditched wallHF, so far I've been using only function objects to calculate it. The formulation here above works fine for solid regions so I sticked to it, you just get slightly different values at opposite sides of a coupled patch that eventually tend to converge.

If you have the same issues with wallHF, my advice is to just switch to function objects and if you need to calculate heat flux at a solid-fluid coupled interface just use them on the solid side!

Enjoy!
coccone is offline   Reply With Quote

Reply

Tags
cht coupling, chtmultiregion, function object, wallheatflux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 error srihari FLUENT 1 October 31, 2016 15:18
[mesh manipulation] Sharp edge problem on concave patches using polyDualMesh without error keepfit OpenFOAM Meshing & Mesh Conversion 1 November 25, 2014 15:28
Wrong calculation of nut in the kOmegaSST turbulence model FelixL OpenFOAM Bugs 27 March 27, 2012 10:02
Wrong calculation of yPlus for low-Re models bastil OpenFOAM Bugs 4 February 9, 2010 08:39
calculation of pressure difference wrong? Ralf Schmidt FLUENT 0 January 5, 2006 11:06


All times are GMT -4. The time now is 05:25.