chtMultiRegionFoam, heSolidThermo: Moved the solid heat flux model into heSolidThermo

and changed to be an energy implicit correction to a temperature gradient
based heat-flux.  This formulation is both energy conservative and temperature
consistent.

The wallHeatFlux functionObject has been updated to use a consistent heat-flux
from the heSolidThermo.
This commit is contained in:
Henry Weller
2020-09-25 16:09:18 +01:00
parent a972b208ee
commit f15d150ca8
12 changed files with 191 additions and 169 deletions

View File

@ -104,6 +104,52 @@ Foam::functionObjects::wallHeatFlux::calcWallHeatFlux(const volVectorField& q)
}
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::wallHeatFlux::calcWallHeatFlux
(
const surfaceScalarField& q
)
{
tmp<volScalarField> twallHeatFlux
(
volScalarField::New
(
type(),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), 0)
)
);
volScalarField::Boundary& wallHeatFluxBf =
twallHeatFlux.ref().boundaryFieldRef();
const surfaceScalarField::Boundary& qBf = q.boundaryField();
forAllConstIter(labelHashSet, patchSet_, iter)
{
const label patchi = iter.key();
wallHeatFluxBf[patchi] = -qBf[patchi];
}
if (foundObject<volScalarField>("qr"))
{
const volScalarField& qr = lookupObject<volScalarField>("qr");
const volScalarField::Boundary& radHeatFluxBf = qr.boundaryField();
forAllConstIter(labelHashSet, patchSet_, iter)
{
const label patchi = iter.key();
wallHeatFluxBf[patchi] -= radHeatFluxBf[patchi];
}
}
return twallHeatFlux;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::wallHeatFlux::wallHeatFlux
@ -206,22 +252,14 @@ bool Foam::functionObjects::wallHeatFlux::execute()
thermophysicalTransportModel::typeName
);
return store
(
name,
calcWallHeatFlux(ttm.q())
);
return store(name, calcWallHeatFlux(ttm.q()));
}
else if (foundObject<solidThermo>(solidThermo::dictName))
{
const solidThermo& thermo =
lookupObject<solidThermo>(solidThermo::dictName);
return store
(
name,
calcWallHeatFlux(-thermo.alpha()*fvc::grad(thermo.he()))
);
return store(name, calcWallHeatFlux(thermo.q()));
}
else
{

View File

@ -75,6 +75,7 @@ SourceFiles
#include "writeLocalObjects.H"
#include "HashSet.H"
#include "volFieldsFwd.H"
#include "surfaceFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -110,6 +111,9 @@ protected:
//- Calculate the heat-flux
tmp<volScalarField> calcWallHeatFlux(const volVectorField& q);
//- Calculate the heat-flux
tmp<volScalarField> calcWallHeatFlux(const surfaceScalarField& q);
public: