Rationalised thermal boundary condition class names and simplified user input

Renamed classes:

    turbulentTemperatureCoupledBaffleMixedFvPatchScalarField ->
        coupledTemperatureFvPatchScalarField

    externalWallHeatFluxTemperatureFvPatchScalarField ->
        externalTemperatureFvPatchScalarField

Radiation heat-flux support in turbulentTemperatureRadCoupledMixed transferred
to coupledTemperatureFvPatchScalarField and turbulentTemperatureRadCoupledMixed removed.

Renamed boundary condition type names in T field files:

    compressible::turbulentTemperatureCoupledBaffleMixed -> coupledTemperature

    compressible::turbulentTemperatureRadCoupledMixed -> coupledTemperature

    compressible::externalWallHeatFluxTemperature -> externalTemperature

Backward-compatibility is provided for all three of the above BC specifications
so existing cases will run as before but we recommend migrating to the new
simpler names.
This commit is contained in:
Henry Weller
2022-10-12 21:17:25 +01:00
parent a4ca75045c
commit 5c01fef155
22 changed files with 285 additions and 176 deletions

View File

@ -74,6 +74,17 @@ namespace Foam
(#baseType, baseType::typeName_(), #lookup, STR(LIB_NAME)) (#baseType, baseType::typeName_(), #lookup, STR(LIB_NAME))
//- Add backward-compatibility duplicate of thisType, replacing oldType,
// to hash-table of functions with 'lookup' as the key
#define addBackwardCompatibleToRunTimeSelectionTable\
(baseType,thisType,argNames,oldType,lookup) \
\
/* Add the thisType constructor function to the table, find by lookup */ \
baseType::add##argNames##ConstructorToTable<thisType> \
add_##oldType##_##thisType##argNames##ConstructorTo##baseType##Table_ \
(lookup);
//- Add to hash-table of functions with typename as the key //- Add to hash-table of functions with typename as the key
#define addRemovableToRunTimeSelectionTable\ #define addRemovableToRunTimeSelectionTable\
(baseType,thisType,argNames) \ (baseType,thisType,argNames) \

View File

@ -1,12 +1,11 @@
thermophysicalTransportModel/thermophysicalTransportModel.C thermophysicalTransportModel/thermophysicalTransportModel.C
BCs = derivedFvPatchFields BCs = derivedFvPatchFields
$(BCs)/externalTemperature/externalTemperatureFvPatchScalarField.C
$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C $(BCs)/temperatureCoupledBase/temperatureCoupledBase.C
$(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C $(BCs)/coupledTemperature/coupledTemperatureFvPatchScalarField.C
$(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C $(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C
$(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C $(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C
$(BCs)/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
$(BCs)/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
$(BCs)/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C $(BCs)/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C
$(BCs)/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C $(BCs)/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C
$(BCs)/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C $(BCs)/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -118,13 +118,13 @@ public:
// Member Functions // Member Functions
//- Access function to incompressible transport model //- Access function to momentum transport model
const momentumTransportModel& momentumTransport() const const momentumTransportModel& momentumTransport() const
{ {
return momentumTransport_; return momentumTransport_;
} }
//- Access function to incompressible transport model //- Access function to the fluid thermophysical properties
virtual const thermoModel& thermo() const virtual const thermoModel& thermo() const
{ {
return thermo_; return thermo_;

View File

@ -23,23 +23,16 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H" #include "coupledTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "mappedPatchBase.H" #include "mappedPatchBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: Foam::coupledTemperatureFvPatchScalarField::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<scalar, volMesh>& iF
@ -48,6 +41,8 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch()), temperatureCoupledBase(patch()),
TnbrName_("undefined-Tnbr"), TnbrName_("undefined-Tnbr"),
qrNbrName_("undefined-qrNbr"),
qrName_("undefined-qr"),
thicknessLayers_(0), thicknessLayers_(0),
kappaLayers_(0), kappaLayers_(0),
qs_(p.size()), qs_(p.size()),
@ -59,8 +54,8 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
} }
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: Foam::coupledTemperatureFvPatchScalarField::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
@ -69,7 +64,9 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict), temperatureCoupledBase(patch(), dict),
TnbrName_(dict.lookup("Tnbr")), TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
qrNbrName_(dict.lookupOrDefault<word>("qrNbr", "none")),
qrName_(dict.lookupOrDefault<word>("qr", "none")),
thicknessLayers_(0), thicknessLayers_(0),
kappaLayers_(0), kappaLayers_(0),
qs_(p.size(), 0), qs_(p.size(), 0),
@ -140,45 +137,49 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
} }
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: Foam::coupledTemperatureFvPatchScalarField::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& ptf, const coupledTemperatureFvPatchScalarField& psf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
) )
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(psf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf), temperatureCoupledBase(patch(), psf),
TnbrName_(ptf.TnbrName_), TnbrName_(psf.TnbrName_),
thicknessLayers_(ptf.thicknessLayers_), qrNbrName_(psf.qrNbrName_),
kappaLayers_(ptf.kappaLayers_), qrName_(psf.qrName_),
qs_(mapper(ptf.qs_)), thicknessLayers_(psf.thicknessLayers_),
contactRes_(ptf.contactRes_) kappaLayers_(psf.kappaLayers_),
qs_(mapper(psf.qs_)),
contactRes_(psf.contactRes_)
{} {}
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: Foam::coupledTemperatureFvPatchScalarField::
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& ptf, const coupledTemperatureFvPatchScalarField& psf,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<scalar, volMesh>& iF
) )
: :
mixedFvPatchScalarField(ptf, iF), mixedFvPatchScalarField(psf, iF),
temperatureCoupledBase(patch(), ptf), temperatureCoupledBase(patch(), psf),
TnbrName_(ptf.TnbrName_), TnbrName_(psf.TnbrName_),
thicknessLayers_(ptf.thicknessLayers_), qrNbrName_(psf.qrNbrName_),
kappaLayers_(ptf.kappaLayers_), qrName_(psf.qrName_),
qs_(ptf.qs_), thicknessLayers_(psf.thicknessLayers_),
contactRes_(ptf.contactRes_) kappaLayers_(psf.kappaLayers_),
qs_(psf.qs_),
contactRes_(psf.contactRes_)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() void Foam::coupledTemperatureFvPatchScalarField::updateCoeffs()
{ {
if (updated()) if (updated())
{ {
@ -193,64 +194,85 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
// Get the coupling information from the mappedPatchBase // Get the coupling information from the mappedPatchBase
const mappedPatchBase& mpp = const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch()); refCast<const mappedPatchBase>(patch().patch());
const polyMesh& nbrMesh = mpp.nbrMesh(); const label patchiNbr = mpp.nbrPolyPatch().index();
const label nbrPatchi = mpp.nbrPolyPatch().index(); const fvPatch& patchNbr =
const fvPatch& nbrPatch = refCast<const fvMesh>(mpp.nbrMesh()).boundary()[patchiNbr];
refCast<const fvMesh>(nbrMesh).boundary()[nbrPatchi];
// Calculate the temperature by harmonic averaging // Calculate the temperature by harmonic averaging
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
typedef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField thisType; typedef coupledTemperatureFvPatchScalarField thisType;
const fvPatchScalarField& nbrTp = const fvPatchScalarField& TpNbr =
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_); patchNbr.lookupPatchField<volScalarField, scalar>(TnbrName_);
if (!isA<thisType>(nbrTp)) if (!isA<thisType>(TpNbr))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Patch field for " << internalField().name() << " on " << "Patch field for " << internalField().name() << " on "
<< patch().name() << " is of type " << thisType::typeName << patch().name() << " is of type " << thisType::typeName
<< endl << "The neighbouring patch field " << TnbrName_ << " on " << endl << "The neighbouring patch field " << TnbrName_ << " on "
<< nbrPatch.name() << " is required to be the same, but is " << patchNbr.name() << " is required to be the same, but is "
<< "currently of type " << nbrTp.type() << exit(FatalError); << "currently of type " << TpNbr.type() << exit(FatalError);
} }
const scalarField myKDelta(kappa(*this)*patch().deltaCoeffs()); const thisType& coupledTemperatureNbr = refCast<const thisType>(TpNbr);
const thisType& nbrField = refCast<const thisType>(nbrTp); const scalarField TcNbr
const scalarField nbrIntFld
( (
contactRes_ == 0 contactRes_ == 0
? mpp.distribute(nbrField.patchInternalField()) ? mpp.distribute(coupledTemperatureNbr.patchInternalField())
: mpp.distribute(nbrField) : mpp.distribute(coupledTemperatureNbr)
); );
const scalarField nbrKDelta
const scalarField KDelta(kappa(*this)*patch().deltaCoeffs());
const scalarField KDeltaNbr
( (
contactRes_ == 0 contactRes_ == 0
? mpp.distribute(nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs()) ? mpp.distribute(coupledTemperatureNbr.kappa(coupledTemperatureNbr)
: tmp<scalarField>(new scalarField(contactRes_, nbrField.size())) *patchNbr.deltaCoeffs())
: tmp<scalarField>(new scalarField(size(), contactRes_))
);
const scalarField qr
(
qrName_ != "none"
? static_cast<const scalarField&>
(
patch().lookupPatchField<volScalarField, scalar>(qrName_)
)
: scalarField(size(), 0)
);
const scalarField qrNbr
(
qrNbrName_ != "none"
? mpp.distribute
(
patchNbr.lookupPatchField<volScalarField, scalar>(qrNbrName_)
)
: tmp<scalarField>(new scalarField(size(), 0))
); );
// Both sides agree on // Both sides agree on
// - temperature : (myKDelta*fld + nbrKDelta*nbrFld)/(myKDelta+nbrKDelta) // - temperature : (KDelta*fld + KDeltaNbr*nbrFld)/(KDelta + KDeltaNbr)
// - gradient : (temperature-fld)*delta // - gradient : (temperature-fld)*delta
// We've got a degree of freedom in how to implement this in a mixed bc. // We've got a degree of freedom in how to implement this in a mixed bc.
// (what gradient, what fixedValue and mixing coefficient) // (what gradient, what fixedValue and mixing coefficient)
// Two reasonable choices: // Two reasonable choices:
// 1. specify above temperature on one side (preferentially the high side) // 1. specify above temperature on one side (preferentially the high side)
// and above gradient on the other. So this will switch between pure // and above gradient on the other. So this will switch between pure
// fixedvalue and pure fixedgradient // fixedValue and pure fixedGradient
// 2. specify gradient and temperature such that the equations are the // 2. specify gradient and temperature such that the equations are the
// same on both sides. This leads to the choice of // same on both sides. This leads to the choice of
// - refGradient = qs_/kappa; // - refGradient = qs_/kappa;
// - refValue = neighbour value // - refValue = neighbour value
// - mixFraction = nbrKDelta / (nbrKDelta + myKDelta) // - mixFraction = KDeltaNbr / (KDeltaNbr + KDelta)
this->refValue() = nbrIntFld; this->valueFraction() = KDeltaNbr/(KDeltaNbr + KDelta);
this->refGrad() = qs_/kappa(*this); this->refValue() = TcNbr;
this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta); this->refGrad() = (qs_ + qr + qrNbr)/kappa(*this);
mixedFvPatchScalarField::updateCoeffs(); mixedFvPatchScalarField::updateCoeffs();
@ -261,8 +283,8 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
Info<< patch().boundaryMesh().mesh().name() << ':' Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':' << patch().name() << ':'
<< this->internalField().name() << " <- " << this->internalField().name() << " <- "
<< nbrMesh.name() << ':' << mpp.nbrMesh().name() << ':'
<< nbrPatch.name() << ':' << patchNbr.name() << ':'
<< this->internalField().name() << " :" << this->internalField().name() << " :"
<< " heat transfer rate:" << Q << " heat transfer rate:" << Q
<< " walltemperature " << " walltemperature "
@ -277,13 +299,15 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
} }
void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write void Foam::coupledTemperatureFvPatchScalarField::write
( (
Ostream& os Ostream& os
) const ) const
{ {
mixedFvPatchScalarField::write(os); mixedFvPatchScalarField::write(os);
writeEntry(os, "Tnbr", TnbrName_); writeEntry(os, "Tnbr", TnbrName_);
writeEntry(os, "qrNbr", qrNbrName_);
writeEntry(os, "qr", qrName_);
writeEntry(os, "thicknessLayers", thicknessLayers_); writeEntry(os, "thicknessLayers", thicknessLayers_);
writeEntry(os, "kappaLayers", kappaLayers_); writeEntry(os, "kappaLayers", kappaLayers_);
@ -293,17 +317,70 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField namespace Foam
( {
fvPatchScalarField, makePatchTypeField
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField (
); fvPatchScalarField,
coupledTemperatureFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
coupledTemperatureFvPatchScalarField,
patch,
turbulentTemperatureCoupledBaffleMixed,
"compressible::turbulentTemperatureCoupledBaffleMixed"
);
} // End namespace compressible addBackwardCompatibleToRunTimeSelectionTable
} // End namespace Foam (
fvPatchScalarField,
coupledTemperatureFvPatchScalarField,
patchMapper,
turbulentTemperatureCoupledBaffleMixed,
"compressible::turbulentTemperatureCoupledBaffleMixed"
);
addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
coupledTemperatureFvPatchScalarField,
dictionary,
turbulentTemperatureCoupledBaffleMixed,
"compressible::turbulentTemperatureCoupledBaffleMixed"
);
addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
coupledTemperatureFvPatchScalarField,
patch,
turbulentTemperatureRadCoupledMixed,
"compressible::turbulentTemperatureRadCoupledMixed"
);
addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
coupledTemperatureFvPatchScalarField,
patchMapper,
turbulentTemperatureRadCoupledMixed,
"compressible::turbulentTemperatureRadCoupledMixed"
);
addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
coupledTemperatureFvPatchScalarField,
dictionary,
turbulentTemperatureRadCoupledMixed,
"compressible::turbulentTemperatureRadCoupledMixed"
);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,8 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::compressible:: Foam::coupledTemperatureFvPatchScalarField
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
Description Description
Mixed boundary condition for temperature, to be used for heat-transfer Mixed boundary condition for temperature, to be used for heat-transfer
@ -34,7 +33,7 @@ Description
on both sides: on both sides:
- refGradient = qs_/kappa - refGradient = qs_/kappa
- refValue = neighbour value - refValue = neighbour value
- mixFraction = nbrKDelta/(nbrKDelta + myKDelta()) - mixFraction = KDeltaNbr/(KDeltaNbr + KDelta())
where KDelta is heat-transfer coefficient K*deltaCoeffs where KDelta is heat-transfer coefficient K*deltaCoeffs
and qs is the optional source heat flux. and qs is the optional source heat flux.
@ -50,13 +49,15 @@ Usage
kappaLayers | list of thermal conductivities per layer [W/m/K] | no | kappaLayers | list of thermal conductivities per layer [W/m/K] | no |
qs | Optional source heat flux [W/m^2] | no | 0 qs | Optional source heat flux [W/m^2] | no | 0
Qs | Optional heat source [W] | no | 0 Qs | Optional heat source [W] | no | 0
qrNbr | name of the radiative flux in the nbr region | no | none
qr | name of the radiative flux in this region | no | none
\endtable \endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
Tnbr T; Tnbr T;
thicknessLayers (0.1 0.2 0.3 0.4); thicknessLayers (0.1 0.2 0.3 0.4);
kappaLayers (1 2 3 4); kappaLayers (1 2 3 4);
@ -74,12 +75,12 @@ See also
Foam::temperatureCoupledBase Foam::temperatureCoupledBase
SourceFiles SourceFiles
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C coupledTemperatureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H #ifndef coupledTemperatureFvPatchScalarField_H
#define turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H #define coupledTemperatureFvPatchScalarField_H
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H" #include "temperatureCoupledBase.H"
@ -89,14 +90,12 @@ SourceFiles
namespace Foam namespace Foam
{ {
namespace compressible
{
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField Declaration Class coupledTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField class coupledTemperatureFvPatchScalarField
: :
public mixedFvPatchScalarField, public mixedFvPatchScalarField,
public temperatureCoupledBase public temperatureCoupledBase
@ -106,6 +105,12 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
//- Name of field on the neighbour region //- Name of field on the neighbour region
const word TnbrName_; const word TnbrName_;
//- Name of the radiative heat flux in the neighbor region
const word qrNbrName_;
//- Name of the radiative heat flux in local region
const word qrName_;
//- Thickness of layers //- Thickness of layers
scalarList thicknessLayers_; scalarList thicknessLayers_;
@ -122,20 +127,20 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
public: public:
//- Runtime type information //- Runtime type information
TypeName("compressible::turbulentTemperatureCoupledBaffleMixed"); TypeName("coupledTemperature");
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
@ -143,20 +148,20 @@ public:
); );
//- Construct by mapping given //- Construct by mapping given
// turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a // coupledTemperatureFvPatchScalarField onto a
// new patch // new patch
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField&, const coupledTemperatureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField coupledTemperatureFvPatchScalarField
( (
const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField&, const coupledTemperatureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
@ -168,7 +173,7 @@ public:
{ {
return tmp<fvPatchScalarField> return tmp<fvPatchScalarField>
( (
new turbulentTemperatureCoupledBaffleMixedFvPatchScalarField new coupledTemperatureFvPatchScalarField
( (
*this, *this,
iF iF
@ -189,7 +194,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "externalWallHeatFluxTemperatureFvPatchScalarField.H" #include "externalTemperatureFvPatchScalarField.H"
#include "volFields.H" #include "volFields.H"
#include "physicoChemicalConstants.H" #include "physicoChemicalConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -33,8 +33,8 @@ using Foam::constant::physicoChemical::sigma;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: Foam::externalTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<scalar, volMesh>& iF
@ -63,8 +63,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField
} }
Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: Foam::externalTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
@ -136,10 +136,10 @@ externalWallHeatFluxTemperatureFvPatchScalarField
} }
Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: Foam::externalTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const externalWallHeatFluxTemperatureFvPatchScalarField& ptf, const externalTemperatureFvPatchScalarField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF, const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
@ -169,10 +169,10 @@ externalWallHeatFluxTemperatureFvPatchScalarField
{} {}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: Foam::externalTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf, const externalTemperatureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<scalar, volMesh>& iF
) )
: :
@ -197,7 +197,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::autoMap void Foam::externalTemperatureFvPatchScalarField::autoMap
( (
const fvPatchFieldMapper& m const fvPatchFieldMapper& m
) )
@ -221,7 +221,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::autoMap
} }
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap void Foam::externalTemperatureFvPatchScalarField::rmap
( (
const fvPatchScalarField& ptf, const fvPatchScalarField& ptf,
const labelList& addr const labelList& addr
@ -229,8 +229,8 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap
{ {
mixedFvPatchScalarField::rmap(ptf, addr); mixedFvPatchScalarField::rmap(ptf, addr);
const externalWallHeatFluxTemperatureFvPatchScalarField& tiptf = const externalTemperatureFvPatchScalarField& tiptf =
refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf); refCast<const externalTemperatureFvPatchScalarField>(ptf);
if (haveq_) if (haveq_)
{ {
@ -249,15 +249,15 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap
} }
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::reset void Foam::externalTemperatureFvPatchScalarField::reset
( (
const fvPatchScalarField& ptf const fvPatchScalarField& ptf
) )
{ {
mixedFvPatchScalarField::reset(ptf); mixedFvPatchScalarField::reset(ptf);
const externalWallHeatFluxTemperatureFvPatchScalarField& tiptf = const externalTemperatureFvPatchScalarField& tiptf =
refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf); refCast<const externalTemperatureFvPatchScalarField>(ptf);
if (haveq_) if (haveq_)
{ {
@ -276,7 +276,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::reset
} }
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() void Foam::externalTemperatureFvPatchScalarField::updateCoeffs()
{ {
if (updated()) if (updated())
{ {
@ -401,7 +401,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
} }
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write void Foam::externalTemperatureFvPatchScalarField::write
( (
Ostream& os Ostream& os
) const ) const
@ -464,8 +464,36 @@ namespace Foam
makePatchTypeField makePatchTypeField
( (
fvPatchScalarField, fvPatchScalarField,
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
);
addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
externalTemperatureFvPatchScalarField,
patch,
externalWallHeatFluxTemperature,
"externalWallHeatFluxTemperature"
);
addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
externalTemperatureFvPatchScalarField,
patchMapper,
externalWallHeatFluxTemperature,
"externalWallHeatFluxTemperature"
);
addBackwardCompatibleToRunTimeSelectionTable
(
fvPatchScalarField,
externalTemperatureFvPatchScalarField,
dictionary,
externalWallHeatFluxTemperature,
"externalWallHeatFluxTemperature"
); );
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::externalWallHeatFluxTemperatureFvPatchScalarField Foam::externalTemperatureFvPatchScalarField
Description Description
This boundary condition applies a heat flux condition to temperature This boundary condition applies a heat flux condition to temperature
@ -71,7 +71,7 @@ Usage
\verbatim \verbatim
<patchName> <patchName>
{ {
type externalWallHeatFluxTemperature; type externalTemperature;
Ta constant 300.0; Ta constant 300.0;
h uniform 10.0; h uniform 10.0;
@ -87,12 +87,12 @@ See also
Foam::mixedFvPatchScalarField Foam::mixedFvPatchScalarField
SourceFiles SourceFiles
externalWallHeatFluxTemperatureFvPatchScalarField.C externalTemperatureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef externalWallHeatFluxTemperatureFvPatchScalarField_H #ifndef externalTemperatureFvPatchScalarField_H
#define externalWallHeatFluxTemperatureFvPatchScalarField_H #define externalTemperatureFvPatchScalarField_H
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H" #include "temperatureCoupledBase.H"
@ -104,10 +104,10 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration Class externalTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class externalWallHeatFluxTemperatureFvPatchScalarField class externalTemperatureFvPatchScalarField
: :
public mixedFvPatchScalarField, public mixedFvPatchScalarField,
public temperatureCoupledBase public temperatureCoupledBase
@ -172,20 +172,20 @@ class externalWallHeatFluxTemperatureFvPatchScalarField
public: public:
//- Runtime type information //- Runtime type information
TypeName("externalWallHeatFluxTemperature"); TypeName("externalTemperature");
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
@ -193,26 +193,26 @@ public:
); );
//- Construct by mapping given //- Construct by mapping given
// externalWallHeatFluxTemperatureFvPatchScalarField // externalTemperatureFvPatchScalarField
// onto a new patch // onto a new patch
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const externalWallHeatFluxTemperatureFvPatchScalarField&, const externalTemperatureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const externalWallHeatFluxTemperatureFvPatchScalarField& const externalTemperatureFvPatchScalarField&
) = delete; ) = delete;
//- Copy constructor setting internal field reference //- Copy constructor setting internal field reference
externalWallHeatFluxTemperatureFvPatchScalarField externalTemperatureFvPatchScalarField
( (
const externalWallHeatFluxTemperatureFvPatchScalarField&, const externalTemperatureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
@ -224,7 +224,7 @@ public:
{ {
return tmp<fvPatchScalarField> return tmp<fvPatchScalarField>
( (
new externalWallHeatFluxTemperatureFvPatchScalarField(*this, iF) new externalTemperatureFvPatchScalarField(*this, iF)
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -50,8 +50,8 @@ Usage
{ {
type compressible::turbulentTemperatureRadCoupledMixed; type compressible::turbulentTemperatureRadCoupledMixed;
Tnbr T; Tnbr T;
qrNbr qr; // or none. Name of qr field on neighbour region qrNbr qr; // Name of qr field on neighbour region
qr qr; // or none. Name of qr field on local region qr qr; // Name of qr field on local region
thicknessLayers (0.1 0.2 0.3 0.4); thicknessLayers (0.1 0.2 0.3 0.4);
kappaLayers (1 2 3 4); kappaLayers (1 2 3 4);
value uniform 300; value uniform 300;
@ -136,7 +136,7 @@ public:
); );
//- Construct by mapping given //- Construct by mapping given
// turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a // coupledTemperatureFvPatchScalarField onto a
// new patch // new patch
turbulentTemperatureRadCoupledMixedFvPatchScalarField turbulentTemperatureRadCoupledMixedFvPatchScalarField
( (

View File

@ -29,9 +29,8 @@ boundaryField
"baffle3D_to_fluid_.*" "baffle3D_to_fluid_.*"
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
kappa kappa; kappa kappa;
Tnbr T;
value $internalField; value $internalField;
} }
} }

View File

@ -29,9 +29,8 @@ boundaryField
"fluid_to_baffle3D_.*" "fluid_to_baffle3D_.*"
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
kappa kappa; kappa kappa;
Tnbr T;
value $internalField; value $internalField;
} }

View File

@ -39,9 +39,8 @@ boundaryField
wall wall
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
kappa kappa; kappa kappa;
Tnbr T;
value $internalField; value $internalField;
} }

View File

@ -21,9 +21,8 @@ boundaryField
{ {
wall wall
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
kappa kappa; kappa kappa;
Tnbr T;
value $internalField; value $internalField;
} }
} }

View File

@ -36,9 +36,8 @@ boundaryField
wall wall
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
kappa kappa; kappa kappa;
Tnbr T;
value uniform $Tinitial; value uniform $Tinitial;
} }

View File

@ -23,11 +23,11 @@ boundaryField
{ {
wall wall
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
kappa kappa; kappa kappa;
Tnbr T;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -35,10 +35,10 @@ boundaryField
} }
fluid_to_metal fluid_to_metal
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,10 +28,10 @@ boundaryField
} }
heater_to_metal heater_to_metal
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,16 +28,15 @@ boundaryField
} }
metal_to_fluid metal_to_fluid
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
metal_to_heater metal_to_heater
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -27,18 +27,18 @@ boundaryField
type fixedValue; type fixedValue;
value $internalField; value $internalField;
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
value $internalField; value $internalField;
inletValue $internalField; inletValue $internalField;
} }
gas_to_solid gas_to_solid
{ {
type compressible::turbulentTemperatureRadCoupledMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
qrNbr none;
qr qr; qr qr;
} }
} }

View File

@ -24,18 +24,17 @@ boundaryField
external external
{ {
type externalWallHeatFluxTemperature; type externalTemperature;
h uniform 1e3; h uniform 1e3;
Ta $internalField; Ta $internalField;
value $internalField; value $internalField;
} }
solid_to_gas solid_to_gas
{ {
type compressible::turbulentTemperatureRadCoupledMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
qrNbr qr; qrNbr qr;
qr none;
} }
} }

View File

@ -39,10 +39,10 @@ boundaryField
} }
shell_to_solid shell_to_solid
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,15 +28,13 @@ boundaryField
} }
solid_to_shell solid_to_shell
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
solid_to_tube solid_to_tube
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
} }

View File

@ -39,9 +39,8 @@ boundaryField
} }
tube_to_solid tube_to_solid
{ {
type compressible::turbulentTemperatureCoupledBaffleMixed; type coupledTemperature;
value $internalField; value $internalField;
Tnbr T;
} }
} }