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

Heat Flow across patches using chtmultiregionfoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 25, 2012, 23:43
Default Heat Flow across patches using chtmultiregionfoam
  #1
New Member
 
Chaz
Join Date: Mar 2012
Posts: 10
Rep Power: 5
chaz is on a distinguished road
Hello,
I am having great difficulty finding out how to evaluate heat flow across patches between solid regions, and across patches that are between a solid and fluid region. This is for chtMultiRegionFoam or ..SimpleFoam.

I have installed and looked into swak4foam, but this functionality does not look to be there.

In swak4foam, I can average T across a patch between fluid and solid, but not across patches between solids.

Any guidance?
Thanks
chaz is offline   Reply With Quote

Old   March 26, 2012, 04:17
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by chaz View Post
Hello,
I am having great difficulty finding out how to evaluate heat flow across patches between solid regions, and across patches that are between a solid and fluid region. This is for chtMultiRegionFoam or ..SimpleFoam.

I have installed and looked into swak4foam, but this functionality does not look to be there.

In swak4foam, I can average T across a patch between fluid and solid, but not across patches between solids.

Any guidance?
Thanks
I don't quite understand why this shouldn't work with swak4Foam. A patch is a patch. It doesn't make a difference whether it is between a solid or a fluid or two solids. The only thing that is a bit more complicated with multi-region-cases is selecting another region http://openfoamwiki.net/index.php/Co...al_expressions
gschaider is offline   Reply With Quote

Old   March 26, 2012, 11:31
Default
  #3
New Member
 
Chaz
Join Date: Mar 2012
Posts: 10
Rep Power: 5
chaz is on a distinguished road
Hello,
Thank you for your reply and link. I am putting the function code into the controldict in order to test access to the average temperature of a patch. In my simple test model, there are three regions, with different thermal conductivities. The following code reports the correct average temperature for the external patches, but reports -1e300 for average temperature of any internal patch. The regions are met1, elem, and met2. Basically two metals on each end of a material called elem. The patches cold and hot are external, and cold_int/hot_int are internal patches between regions.

Code:
functions
(
    met1
    {
    type patchAverage;
    functionObjectLibs ("libsimpleFunctionObjects.so");
    fields ( T );
    patches ( cold cold_int );
        region met1;
    verbose true;
    factor 1;
    }
        elem
    {
    type patchAverage;
    functionObjectLibs ("libsimpleFunctionObjects.so");
    fields ( T );
    patches ( cold_int hot_int);
        region elem;
    verbose true;
    factor 1;
    }
        met2
    {
    type patchAverage;
    functionObjectLibs ("libsimpleFunctionObjects.so");
    fields ( T );
    patches ( hot_int hot);
        region met2;
    verbose true;
    factor 1;
    }
);
This is only to test the function to find average temperature. I still do not know how to find heat flux, which would be the area integral of -K*dT/dn, where n is the patch normal, and K is the thermal conductivity. wallHeatFlux certainly does not work, based on my tests and from looking at other postings. It appears to work on wall patches, but not patches between regions such as in chtmultiregionfoam.
Any guidance would be greatly appreciated.
chaz is offline   Reply With Quote

Old   March 26, 2012, 16:38
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by chaz View Post
Hello,
Thank you for your reply and link. I am putting the function code into the controldict in order to test access to the average temperature of a patch. In my simple test model, there are three regions, with different thermal conductivities. The following code reports the correct average temperature for the external patches, but reports -1e300 for average temperature of any internal patch. The regions are met1, elem, and met2. Basically two metals on each end of a material called elem. The patches cold and hot are external, and cold_int/hot_int are internal patches between regions.

Code:
functions
(
    met1
    {
    type patchAverage;
    functionObjectLibs ("libsimpleFunctionObjects.so");
    fields ( T );
    patches ( cold cold_int );
        region met1;
    verbose true;
    factor 1;
    }
        elem
    {
    type patchAverage;
    functionObjectLibs ("libsimpleFunctionObjects.so");
    fields ( T );
    patches ( cold_int hot_int);
        region elem;
    verbose true;
    factor 1;
    }
        met2
    {
    type patchAverage;
    functionObjectLibs ("libsimpleFunctionObjects.so");
    fields ( T );
    patches ( hot_int hot);
        region met2;
    verbose true;
    factor 1;
    }
);
The -1e300 means that the patch wasn't found (you'll probably find a warning at the beginning of the log about that). The patches have to exist exactly under the specified name in the mentioned regions in order to be found (for instance the cold_int and hot_int in region elem). Please check that (in the polyMesh/boundary-files of these regions for instance)

Quote:
Originally Posted by chaz View Post
This is only to test the function to find average temperature. I still do not know how to find heat flux, which would be the area integral of -K*dT/dn, where n is the patch normal, and K is the thermal conductivity. wallHeatFlux certainly does not work, based on my tests and from looking at other postings. It appears to work on wall patches, but not patches between regions such as in chtmultiregionfoam.
Any guidance would be greatly appreciated.
The simpleFunctionObjects have "big brothers" in the simpleSwakFunctionObjects. In your case the patchExpression-functionObject with an expression like "-K*snGrad(T)" might be what you're looking for (or if you want to integrate it "-K*area()*snGrad(T)" with an accumulation "sum" I think). Have a look at the examples that come with swak, it's Wiki-page and the groovyBC-Wikipage (all functions described there work for patchExpression)
gschaider is offline   Reply With Quote

Old   March 26, 2012, 16:45
Default
  #5
New Member
 
Chaz
Join Date: Mar 2012
Posts: 10
Rep Power: 5
chaz is on a distinguished road
Thank you, I will look into the items you pointed out.
chaz is offline   Reply With Quote

Old   June 7, 2012, 06:16
Default
  #6
New Member
 
Tuxeedo's Avatar
 
Hauke
Join Date: Jun 2012
Posts: 5
Rep Power: 5
Tuxeedo is on a distinguished road
Hey Chaz,
Did you find a convinient Way to Solve your Problem?
Tuxeedo is offline   Reply With Quote

Old   June 10, 2012, 20:31
Default
  #7
New Member
 
Chaz
Join Date: Mar 2012
Posts: 10
Rep Power: 5
chaz is on a distinguished road
Hello,
Yes, I did make progress getting heat flow data from patches in chtmultiregionfoam.

As Bernhard suggested, swak4foam can be used to get the heat flow between two regions that are solid. I added code similar to the following to then trigger swak4foam to calculate the heat flow and to output it for every iteration into a file.

qHot
{
type swakExpression;
valueType patch;
patchName hot;
verbose true;
expression "-K*area()*snGrad(T)";
accumulations (sum);
region Solid_2;
}

I also had to load the libraries needed first in the controldict file:
libs (
"libOpenFOAM.so"
"libgroovyBC.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libswakTopoSources.so"
) ;
Not sure if all of these are needed, this was just copied and pasted from somewhere else.


I ran this on a simple model with two regions with different thermal conductivity and compared it to theory, and confirmed that it works.
chaz is offline   Reply With Quote

Reply

Tags
heat flux

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
heat conduction in solid and convection in flow kunal FLUENT 3 February 29, 2012 05:42
Convective / Conductive Heat Transfer in Hypersonic flows enigma Main CFD Forum 2 November 1, 2009 23:53
Two-Phase Buoyant Flow Issue Miguel Baritto CFX 4 August 31, 2006 12:02
Flow and Heat transfer in a Thawing chamber B.Prabhu FLUENT 0 May 12, 2002 15:13
time averaged heat transfer in oscillating flow Matthieu Ubas Main CFD Forum 2 November 5, 1999 15:20


All times are GMT -4. The time now is 16:12.