functionObjects::wallHeatFlux: Added support for solid regions

Patch contributed by Stephan Goeke
This commit is contained in:
Henry Weller
2017-05-12 11:05:45 +01:00
parent 29615cdd29
commit 56283c39e5
2 changed files with 24 additions and 11 deletions

View File

@ -24,6 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "wallHeatFlux.H"
#include "turbulentFluidThermoModel.H"
#include "solidThermo.H"
#include "surfaceInterpolate.H"
#include "fvcSnGrad.H"
#include "wallPolyPatch.H"
@ -58,13 +60,14 @@ void Foam::functionObjects::wallHeatFlux::writeFileHeader(const label i)
void Foam::functionObjects::wallHeatFlux::calcHeatFlux
(
const compressible::turbulenceModel& model,
const volScalarField& alpha,
const volScalarField& he,
volScalarField& wallHeatFlux
)
{
surfaceScalarField heatFlux
(
fvc::interpolate(model.alphaEff())*fvc::snGrad(model.transport().he())
fvc::interpolate(alpha)*fvc::snGrad(he)
);
volScalarField::Boundary& wallHeatFluxBf =
@ -198,10 +201,7 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
bool Foam::functionObjects::wallHeatFlux::execute()
{
volScalarField& wallHeatFlux = const_cast<volScalarField&>
(
lookupObject<volScalarField>(type())
);
volScalarField& wallHeatFlux = lookupObjectRef<volScalarField>(type());
if
(
@ -217,7 +217,19 @@ bool Foam::functionObjects::wallHeatFlux::execute()
turbulenceModel::propertiesName
);
calcHeatFlux(turbModel, wallHeatFlux);
calcHeatFlux
(
turbModel.alphaEff(),
turbModel.transport().he(),
wallHeatFlux
);
}
else if (foundObject<solidThermo>(solidThermo::dictName))
{
const solidThermo& thermo =
lookupObject<solidThermo>(solidThermo::dictName);
calcHeatFlux(thermo.alpha(), thermo.he(), wallHeatFlux);
}
else
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,6 +41,7 @@ Description
type wallHeatFlux;
libs ("libfieldFunctionObjects.so");
...
region fluid;
patches (".*Wall");
}
\endverbatim
@ -50,6 +51,7 @@ Usage
Property | Description | Required | Default value
type | type name: wallHeatFlux | yes |
patches | list of patches to process | no | all wall patches
region | region to be evaluated | no | default region
\endtable
Note
@ -76,9 +78,7 @@ SourceFiles
#include "logFiles.H"
#include "writeLocalObjects.H"
#include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H"
#include "HashSet.H"
#include "turbulentFluidThermoModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -114,7 +114,8 @@ protected:
//- Calculate the heat-flux
void calcHeatFlux
(
const compressible::turbulenceModel& turbModel,
const volScalarField& alpha,
const volScalarField& he,
volScalarField& wallHeatFlux
);