diff --git a/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H b/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H index e3073d8dd3..765ff9b7ce 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/addToRunTimeSelectionTable.H @@ -74,6 +74,17 @@ namespace Foam (#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 \ + add_##oldType##_##thisType##argNames##ConstructorTo##baseType##Table_ \ + (lookup); + + //- Add to hash-table of functions with typename as the key #define addRemovableToRunTimeSelectionTable\ (baseType,thisType,argNames) \ diff --git a/src/ThermophysicalTransportModels/Make/files b/src/ThermophysicalTransportModels/Make/files index ee01ac3d24..e1872f25a2 100644 --- a/src/ThermophysicalTransportModels/Make/files +++ b/src/ThermophysicalTransportModels/Make/files @@ -1,12 +1,11 @@ thermophysicalTransportModel/thermophysicalTransportModel.C BCs = derivedFvPatchFields +$(BCs)/externalTemperature/externalTemperatureFvPatchScalarField.C $(BCs)/temperatureCoupledBase/temperatureCoupledBase.C -$(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +$(BCs)/coupledTemperature/coupledTemperatureFvPatchScalarField.C $(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C $(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C -$(BCs)/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C -$(BCs)/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C $(BCs)/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C $(BCs)/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C $(BCs)/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C diff --git a/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H index e10c36c2f7..2c8a0b9152 100644 --- a/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/ThermophysicalTransportModel/ThermophysicalTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,13 +118,13 @@ public: // Member Functions - //- Access function to incompressible transport model + //- Access function to momentum transport model const momentumTransportModel& momentumTransport() const { return momentumTransport_; } - //- Access function to incompressible transport model + //- Access function to the fluid thermophysical properties virtual const thermoModel& thermo() const { return thermo_; diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/ThermophysicalTransportModels/derivedFvPatchFields/coupledTemperature/coupledTemperatureFvPatchScalarField.C similarity index 56% rename from src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C rename to src/ThermophysicalTransportModels/derivedFvPatchFields/coupledTemperature/coupledTemperatureFvPatchScalarField.C index 4c4a84678c..b996063081 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/coupledTemperature/coupledTemperatureFvPatchScalarField.C @@ -23,23 +23,16 @@ License \*---------------------------------------------------------------------------*/ -#include "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H" +#include "coupledTemperatureFvPatchScalarField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "mappedPatchBase.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField +Foam::coupledTemperatureFvPatchScalarField:: +coupledTemperatureFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -48,6 +41,8 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField mixedFvPatchScalarField(p, iF), temperatureCoupledBase(patch()), TnbrName_("undefined-Tnbr"), + qrNbrName_("undefined-qrNbr"), + qrName_("undefined-qr"), thicknessLayers_(0), kappaLayers_(0), qs_(p.size()), @@ -59,8 +54,8 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField } -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField +Foam::coupledTemperatureFvPatchScalarField:: +coupledTemperatureFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -69,7 +64,9 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField : mixedFvPatchScalarField(p, iF), temperatureCoupledBase(patch(), dict), - TnbrName_(dict.lookup("Tnbr")), + TnbrName_(dict.lookupOrDefault("Tnbr", "T")), + qrNbrName_(dict.lookupOrDefault("qrNbr", "none")), + qrName_(dict.lookupOrDefault("qr", "none")), thicknessLayers_(0), kappaLayers_(0), qs_(p.size(), 0), @@ -140,45 +137,49 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField } -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField +Foam::coupledTemperatureFvPatchScalarField:: +coupledTemperatureFvPatchScalarField ( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& ptf, + const coupledTemperatureFvPatchScalarField& psf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : - mixedFvPatchScalarField(ptf, p, iF, mapper), - temperatureCoupledBase(patch(), ptf), - TnbrName_(ptf.TnbrName_), - thicknessLayers_(ptf.thicknessLayers_), - kappaLayers_(ptf.kappaLayers_), - qs_(mapper(ptf.qs_)), - contactRes_(ptf.contactRes_) + mixedFvPatchScalarField(psf, p, iF, mapper), + temperatureCoupledBase(patch(), psf), + TnbrName_(psf.TnbrName_), + qrNbrName_(psf.qrNbrName_), + qrName_(psf.qrName_), + thicknessLayers_(psf.thicknessLayers_), + kappaLayers_(psf.kappaLayers_), + qs_(mapper(psf.qs_)), + contactRes_(psf.contactRes_) {} -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField +Foam::coupledTemperatureFvPatchScalarField:: +coupledTemperatureFvPatchScalarField ( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& ptf, + const coupledTemperatureFvPatchScalarField& psf, const DimensionedField& iF ) : - mixedFvPatchScalarField(ptf, iF), - temperatureCoupledBase(patch(), ptf), - TnbrName_(ptf.TnbrName_), - thicknessLayers_(ptf.thicknessLayers_), - kappaLayers_(ptf.kappaLayers_), - qs_(ptf.qs_), - contactRes_(ptf.contactRes_) + mixedFvPatchScalarField(psf, iF), + temperatureCoupledBase(patch(), psf), + TnbrName_(psf.TnbrName_), + qrNbrName_(psf.qrNbrName_), + qrName_(psf.qrName_), + thicknessLayers_(psf.thicknessLayers_), + kappaLayers_(psf.kappaLayers_), + qs_(psf.qs_), + contactRes_(psf.contactRes_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() +void Foam::coupledTemperatureFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -193,64 +194,85 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() // Get the coupling information from the mappedPatchBase const mappedPatchBase& mpp = refCast(patch().patch()); - const polyMesh& nbrMesh = mpp.nbrMesh(); - const label nbrPatchi = mpp.nbrPolyPatch().index(); - const fvPatch& nbrPatch = - refCast(nbrMesh).boundary()[nbrPatchi]; + const label patchiNbr = mpp.nbrPolyPatch().index(); + const fvPatch& patchNbr = + refCast(mpp.nbrMesh()).boundary()[patchiNbr]; // Calculate the temperature by harmonic averaging // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - typedef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField thisType; + typedef coupledTemperatureFvPatchScalarField thisType; - const fvPatchScalarField& nbrTp = - nbrPatch.lookupPatchField(TnbrName_); + const fvPatchScalarField& TpNbr = + patchNbr.lookupPatchField(TnbrName_); - if (!isA(nbrTp)) + if (!isA(TpNbr)) { FatalErrorInFunction << "Patch field for " << internalField().name() << " on " << patch().name() << " is of type " << thisType::typeName << endl << "The neighbouring patch field " << TnbrName_ << " on " - << nbrPatch.name() << " is required to be the same, but is " - << "currently of type " << nbrTp.type() << exit(FatalError); + << patchNbr.name() << " is required to be the same, but is " + << "currently of type " << TpNbr.type() << exit(FatalError); } - const scalarField myKDelta(kappa(*this)*patch().deltaCoeffs()); + const thisType& coupledTemperatureNbr = refCast(TpNbr); - const thisType& nbrField = refCast(nbrTp); - - const scalarField nbrIntFld + const scalarField TcNbr ( contactRes_ == 0 - ? mpp.distribute(nbrField.patchInternalField()) - : mpp.distribute(nbrField) + ? mpp.distribute(coupledTemperatureNbr.patchInternalField()) + : mpp.distribute(coupledTemperatureNbr) ); - const scalarField nbrKDelta + + const scalarField KDelta(kappa(*this)*patch().deltaCoeffs()); + + const scalarField KDeltaNbr ( contactRes_ == 0 - ? mpp.distribute(nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs()) - : tmp(new scalarField(contactRes_, nbrField.size())) + ? mpp.distribute(coupledTemperatureNbr.kappa(coupledTemperatureNbr) + *patchNbr.deltaCoeffs()) + : tmp(new scalarField(size(), contactRes_)) + ); + + const scalarField qr + ( + qrName_ != "none" + ? static_cast + ( + patch().lookupPatchField(qrName_) + ) + : scalarField(size(), 0) + ); + + const scalarField qrNbr + ( + qrNbrName_ != "none" + ? mpp.distribute + ( + patchNbr.lookupPatchField(qrNbrName_) + ) + : tmp(new scalarField(size(), 0)) ); // Both sides agree on - // - temperature : (myKDelta*fld + nbrKDelta*nbrFld)/(myKDelta+nbrKDelta) + // - temperature : (KDelta*fld + KDeltaNbr*nbrFld)/(KDelta + KDeltaNbr) // - gradient : (temperature-fld)*delta // We've got a degree of freedom in how to implement this in a mixed bc. // (what gradient, what fixedValue and mixing coefficient) // Two reasonable choices: // 1. specify above temperature on one side (preferentially the high side) // 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 // same on both sides. This leads to the choice of // - refGradient = qs_/kappa; // - refValue = neighbour value - // - mixFraction = nbrKDelta / (nbrKDelta + myKDelta) + // - mixFraction = KDeltaNbr / (KDeltaNbr + KDelta) - this->refValue() = nbrIntFld; - this->refGrad() = qs_/kappa(*this); - this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta); + this->valueFraction() = KDeltaNbr/(KDeltaNbr + KDelta); + this->refValue() = TcNbr; + this->refGrad() = (qs_ + qr + qrNbr)/kappa(*this); mixedFvPatchScalarField::updateCoeffs(); @@ -261,8 +283,8 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() Info<< patch().boundaryMesh().mesh().name() << ':' << patch().name() << ':' << this->internalField().name() << " <- " - << nbrMesh.name() << ':' - << nbrPatch.name() << ':' + << mpp.nbrMesh().name() << ':' + << patchNbr.name() << ':' << this->internalField().name() << " :" << " heat transfer rate:" << Q << " walltemperature " @@ -277,13 +299,15 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() } -void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write +void Foam::coupledTemperatureFvPatchScalarField::write ( Ostream& os ) const { mixedFvPatchScalarField::write(os); writeEntry(os, "Tnbr", TnbrName_); + writeEntry(os, "qrNbr", qrNbrName_); + writeEntry(os, "qr", qrName_); writeEntry(os, "thicknessLayers", thicknessLayers_); writeEntry(os, "kappaLayers", kappaLayers_); @@ -293,17 +317,70 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchScalarField, - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField -); +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + coupledTemperatureFvPatchScalarField + ); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + addBackwardCompatibleToRunTimeSelectionTable + ( + fvPatchScalarField, + coupledTemperatureFvPatchScalarField, + patch, + turbulentTemperatureCoupledBaffleMixed, + "compressible::turbulentTemperatureCoupledBaffleMixed" + ); -} // End namespace compressible -} // End namespace Foam + addBackwardCompatibleToRunTimeSelectionTable + ( + 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" + ); +} // ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H b/src/ThermophysicalTransportModels/derivedFvPatchFields/coupledTemperature/coupledTemperatureFvPatchScalarField.H similarity index 79% rename from src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H rename to src/ThermophysicalTransportModels/derivedFvPatchFields/coupledTemperature/coupledTemperatureFvPatchScalarField.H index 7c2ba6af80..b45f51a584 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/coupledTemperature/coupledTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,8 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible:: - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField + Foam::coupledTemperatureFvPatchScalarField Description Mixed boundary condition for temperature, to be used for heat-transfer @@ -34,7 +33,7 @@ Description on both sides: - refGradient = qs_/kappa - refValue = neighbour value - - mixFraction = nbrKDelta/(nbrKDelta + myKDelta()) + - mixFraction = KDeltaNbr/(KDeltaNbr + KDelta()) where KDelta is heat-transfer coefficient K*deltaCoeffs and qs is the optional source heat flux. @@ -50,13 +49,15 @@ Usage kappaLayers | list of thermal conductivities per layer [W/m/K] | no | qs | Optional source heat flux [W/m^2] | 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 Example of the boundary condition specification: \verbatim { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; Tnbr T; thicknessLayers (0.1 0.2 0.3 0.4); kappaLayers (1 2 3 4); @@ -74,12 +75,12 @@ See also Foam::temperatureCoupledBase SourceFiles - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C + coupledTemperatureFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H -#define turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H +#ifndef coupledTemperatureFvPatchScalarField_H +#define coupledTemperatureFvPatchScalarField_H #include "mixedFvPatchFields.H" #include "temperatureCoupledBase.H" @@ -89,14 +90,12 @@ SourceFiles namespace Foam { -namespace compressible -{ /*---------------------------------------------------------------------------*\ - Class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField Declaration + Class coupledTemperatureFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField +class coupledTemperatureFvPatchScalarField : public mixedFvPatchScalarField, public temperatureCoupledBase @@ -106,6 +105,12 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField //- Name of field on the neighbour region 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 scalarList thicknessLayers_; @@ -122,20 +127,20 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField public: //- Runtime type information - TypeName("compressible::turbulentTemperatureCoupledBaffleMixed"); + TypeName("coupledTemperature"); // Constructors //- Construct from patch and internal field - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField + coupledTemperatureFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField + coupledTemperatureFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -143,20 +148,20 @@ public: ); //- Construct by mapping given - // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a + // coupledTemperatureFvPatchScalarField onto a // new patch - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField + coupledTemperatureFvPatchScalarField ( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField&, + const coupledTemperatureFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy setting internal field reference - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField + coupledTemperatureFvPatchScalarField ( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField&, + const coupledTemperatureFvPatchScalarField&, const DimensionedField& ); @@ -168,7 +173,7 @@ public: { return tmp ( - new turbulentTemperatureCoupledBaffleMixedFvPatchScalarField + new coupledTemperatureFvPatchScalarField ( *this, iF @@ -189,7 +194,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace compressible } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/ThermophysicalTransportModels/derivedFvPatchFields/externalTemperature/externalTemperatureFvPatchScalarField.C similarity index 85% rename from src/ThermophysicalTransportModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C rename to src/ThermophysicalTransportModels/derivedFvPatchFields/externalTemperature/externalTemperatureFvPatchScalarField.C index 2cbf6a2338..9e36bc5d64 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/externalTemperature/externalTemperatureFvPatchScalarField.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "externalWallHeatFluxTemperatureFvPatchScalarField.H" +#include "externalTemperatureFvPatchScalarField.H" #include "volFields.H" #include "physicoChemicalConstants.H" #include "addToRunTimeSelectionTable.H" @@ -33,8 +33,8 @@ using Foam::constant::physicoChemical::sigma; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: -externalWallHeatFluxTemperatureFvPatchScalarField +Foam::externalTemperatureFvPatchScalarField:: +externalTemperatureFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -63,8 +63,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField } -Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: -externalWallHeatFluxTemperatureFvPatchScalarField +Foam::externalTemperatureFvPatchScalarField:: +externalTemperatureFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -136,10 +136,10 @@ externalWallHeatFluxTemperatureFvPatchScalarField } -Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: -externalWallHeatFluxTemperatureFvPatchScalarField +Foam::externalTemperatureFvPatchScalarField:: +externalTemperatureFvPatchScalarField ( - const externalWallHeatFluxTemperatureFvPatchScalarField& ptf, + const externalTemperatureFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -169,10 +169,10 @@ externalWallHeatFluxTemperatureFvPatchScalarField {} -Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: -externalWallHeatFluxTemperatureFvPatchScalarField +Foam::externalTemperatureFvPatchScalarField:: +externalTemperatureFvPatchScalarField ( - const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf, + const externalTemperatureFvPatchScalarField& tppsf, const DimensionedField& iF ) : @@ -197,7 +197,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::autoMap +void Foam::externalTemperatureFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) @@ -221,7 +221,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::autoMap } -void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap +void Foam::externalTemperatureFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr @@ -229,8 +229,8 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap { mixedFvPatchScalarField::rmap(ptf, addr); - const externalWallHeatFluxTemperatureFvPatchScalarField& tiptf = - refCast(ptf); + const externalTemperatureFvPatchScalarField& tiptf = + refCast(ptf); if (haveq_) { @@ -249,15 +249,15 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap } -void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::reset +void Foam::externalTemperatureFvPatchScalarField::reset ( const fvPatchScalarField& ptf ) { mixedFvPatchScalarField::reset(ptf); - const externalWallHeatFluxTemperatureFvPatchScalarField& tiptf = - refCast(ptf); + const externalTemperatureFvPatchScalarField& tiptf = + refCast(ptf); if (haveq_) { @@ -276,7 +276,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::reset } -void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() +void Foam::externalTemperatureFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -401,7 +401,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() } -void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write +void Foam::externalTemperatureFvPatchScalarField::write ( Ostream& os ) const @@ -464,8 +464,36 @@ namespace Foam makePatchTypeField ( fvPatchScalarField, - externalWallHeatFluxTemperatureFvPatchScalarField + externalTemperatureFvPatchScalarField + ); + + addBackwardCompatibleToRunTimeSelectionTable + ( + fvPatchScalarField, + externalTemperatureFvPatchScalarField, + patch, + externalWallHeatFluxTemperature, + "externalWallHeatFluxTemperature" + ); + + addBackwardCompatibleToRunTimeSelectionTable + ( + fvPatchScalarField, + externalTemperatureFvPatchScalarField, + patchMapper, + externalWallHeatFluxTemperature, + "externalWallHeatFluxTemperature" + ); + + addBackwardCompatibleToRunTimeSelectionTable + ( + fvPatchScalarField, + externalTemperatureFvPatchScalarField, + dictionary, + externalWallHeatFluxTemperature, + "externalWallHeatFluxTemperature" ); } + // ************************************************************************* // diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H b/src/ThermophysicalTransportModels/derivedFvPatchFields/externalTemperature/externalTemperatureFvPatchScalarField.H similarity index 86% rename from src/ThermophysicalTransportModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H rename to src/ThermophysicalTransportModels/derivedFvPatchFields/externalTemperature/externalTemperatureFvPatchScalarField.H index 2d62f062cb..f50bf46fb3 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/externalTemperature/externalTemperatureFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::externalWallHeatFluxTemperatureFvPatchScalarField + Foam::externalTemperatureFvPatchScalarField Description This boundary condition applies a heat flux condition to temperature @@ -71,7 +71,7 @@ Usage \verbatim { - type externalWallHeatFluxTemperature; + type externalTemperature; Ta constant 300.0; h uniform 10.0; @@ -87,12 +87,12 @@ See also Foam::mixedFvPatchScalarField SourceFiles - externalWallHeatFluxTemperatureFvPatchScalarField.C + externalTemperatureFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef externalWallHeatFluxTemperatureFvPatchScalarField_H -#define externalWallHeatFluxTemperatureFvPatchScalarField_H +#ifndef externalTemperatureFvPatchScalarField_H +#define externalTemperatureFvPatchScalarField_H #include "mixedFvPatchFields.H" #include "temperatureCoupledBase.H" @@ -104,10 +104,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration + Class externalTemperatureFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class externalWallHeatFluxTemperatureFvPatchScalarField +class externalTemperatureFvPatchScalarField : public mixedFvPatchScalarField, public temperatureCoupledBase @@ -172,20 +172,20 @@ class externalWallHeatFluxTemperatureFvPatchScalarField public: //- Runtime type information - TypeName("externalWallHeatFluxTemperature"); + TypeName("externalTemperature"); // Constructors //- Construct from patch and internal field - externalWallHeatFluxTemperatureFvPatchScalarField + externalTemperatureFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - externalWallHeatFluxTemperatureFvPatchScalarField + externalTemperatureFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -193,26 +193,26 @@ public: ); //- Construct by mapping given - // externalWallHeatFluxTemperatureFvPatchScalarField + // externalTemperatureFvPatchScalarField // onto a new patch - externalWallHeatFluxTemperatureFvPatchScalarField + externalTemperatureFvPatchScalarField ( - const externalWallHeatFluxTemperatureFvPatchScalarField&, + const externalTemperatureFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Disallow copy without setting internal field reference - externalWallHeatFluxTemperatureFvPatchScalarField + externalTemperatureFvPatchScalarField ( - const externalWallHeatFluxTemperatureFvPatchScalarField& + const externalTemperatureFvPatchScalarField& ) = delete; //- Copy constructor setting internal field reference - externalWallHeatFluxTemperatureFvPatchScalarField + externalTemperatureFvPatchScalarField ( - const externalWallHeatFluxTemperatureFvPatchScalarField&, + const externalTemperatureFvPatchScalarField&, const DimensionedField& ); @@ -224,7 +224,7 @@ public: { return tmp ( - new externalWallHeatFluxTemperatureFvPatchScalarField(*this, iF) + new externalTemperatureFvPatchScalarField(*this, iF) ); } diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H b/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H index 60538deadb..83a5c0d98b 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,8 +50,8 @@ Usage { type compressible::turbulentTemperatureRadCoupledMixed; Tnbr T; - qrNbr qr; // or none. Name of qr field on neighbour region - qr qr; // or none. Name of qr field on local region + qrNbr qr; // Name of qr field on neighbour region + qr qr; // Name of qr field on local region thicknessLayers (0.1 0.2 0.3 0.4); kappaLayers (1 2 3 4); value uniform 300; @@ -136,7 +136,7 @@ public: ); //- Construct by mapping given - // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a + // coupledTemperatureFvPatchScalarField onto a // new patch turbulentTemperatureRadCoupledMixedFvPatchScalarField ( diff --git a/tutorials/modules/CHT/circuitBoardCooling/0/baffle3D/T b/tutorials/modules/CHT/circuitBoardCooling/0/baffle3D/T index bdea5e519e..9c389cf5af 100644 --- a/tutorials/modules/CHT/circuitBoardCooling/0/baffle3D/T +++ b/tutorials/modules/CHT/circuitBoardCooling/0/baffle3D/T @@ -29,9 +29,8 @@ boundaryField "baffle3D_to_fluid_.*" { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; kappa kappa; - Tnbr T; value $internalField; } } diff --git a/tutorials/modules/CHT/circuitBoardCooling/0/fluid/T.orig b/tutorials/modules/CHT/circuitBoardCooling/0/fluid/T.orig index cbd27a656d..9fd055d5bd 100644 --- a/tutorials/modules/CHT/circuitBoardCooling/0/fluid/T.orig +++ b/tutorials/modules/CHT/circuitBoardCooling/0/fluid/T.orig @@ -29,9 +29,8 @@ boundaryField "fluid_to_baffle3D_.*" { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; kappa kappa; - Tnbr T; value $internalField; } diff --git a/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T b/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T index e22a48e356..705d4536ee 100644 --- a/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T +++ b/tutorials/modules/CHT/coolingCylinder2D/0/fluid/T @@ -39,9 +39,8 @@ boundaryField wall { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; kappa kappa; - Tnbr T; value $internalField; } diff --git a/tutorials/modules/CHT/coolingCylinder2D/0/solid/T b/tutorials/modules/CHT/coolingCylinder2D/0/solid/T index de7e59b041..37fcdd0d2d 100644 --- a/tutorials/modules/CHT/coolingCylinder2D/0/solid/T +++ b/tutorials/modules/CHT/coolingCylinder2D/0/solid/T @@ -21,9 +21,8 @@ boundaryField { wall { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; kappa kappa; - Tnbr T; value $internalField; } } diff --git a/tutorials/modules/CHT/coolingSphere/templates/0/fluid/T b/tutorials/modules/CHT/coolingSphere/templates/0/fluid/T index 60f04e6c85..78305ab32c 100644 --- a/tutorials/modules/CHT/coolingSphere/templates/0/fluid/T +++ b/tutorials/modules/CHT/coolingSphere/templates/0/fluid/T @@ -36,9 +36,8 @@ boundaryField wall { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; kappa kappa; - Tnbr T; value uniform $Tinitial; } diff --git a/tutorials/modules/CHT/coolingSphere/templates/0/solid/T b/tutorials/modules/CHT/coolingSphere/templates/0/solid/T index 8d7a750e22..0906d31956 100644 --- a/tutorials/modules/CHT/coolingSphere/templates/0/solid/T +++ b/tutorials/modules/CHT/coolingSphere/templates/0/solid/T @@ -23,11 +23,11 @@ boundaryField { wall { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; kappa kappa; - Tnbr T; } } + // ************************************************************************* // diff --git a/tutorials/modules/CHT/heatedDuct/0/fluid/T b/tutorials/modules/CHT/heatedDuct/0/fluid/T index 57a8d68077..7838b5050a 100644 --- a/tutorials/modules/CHT/heatedDuct/0/fluid/T +++ b/tutorials/modules/CHT/heatedDuct/0/fluid/T @@ -35,10 +35,10 @@ boundaryField } fluid_to_metal { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } } + // ************************************************************************* // diff --git a/tutorials/modules/CHT/heatedDuct/0/heater/T b/tutorials/modules/CHT/heatedDuct/0/heater/T index 1742921490..f978ae4139 100644 --- a/tutorials/modules/CHT/heatedDuct/0/heater/T +++ b/tutorials/modules/CHT/heatedDuct/0/heater/T @@ -28,10 +28,10 @@ boundaryField } heater_to_metal { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } } + // ************************************************************************* // diff --git a/tutorials/modules/CHT/heatedDuct/0/metal/T b/tutorials/modules/CHT/heatedDuct/0/metal/T index 2a253cf1dc..925be9e0fe 100644 --- a/tutorials/modules/CHT/heatedDuct/0/metal/T +++ b/tutorials/modules/CHT/heatedDuct/0/metal/T @@ -28,16 +28,15 @@ boundaryField } metal_to_fluid { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } metal_to_heater { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } } + // ************************************************************************* // diff --git a/tutorials/modules/CHT/reverseBurner/0/gas/T b/tutorials/modules/CHT/reverseBurner/0/gas/T index 9eafc7a733..851689e7d4 100644 --- a/tutorials/modules/CHT/reverseBurner/0/gas/T +++ b/tutorials/modules/CHT/reverseBurner/0/gas/T @@ -27,18 +27,18 @@ boundaryField type fixedValue; value $internalField; } + outlet { type inletOutlet; value $internalField; inletValue $internalField; } + gas_to_solid { - type compressible::turbulentTemperatureRadCoupledMixed; + type coupledTemperature; value $internalField; - Tnbr T; - qrNbr none; qr qr; } } diff --git a/tutorials/modules/CHT/reverseBurner/0/solid/T b/tutorials/modules/CHT/reverseBurner/0/solid/T index 32104e1dbf..1e53cac949 100644 --- a/tutorials/modules/CHT/reverseBurner/0/solid/T +++ b/tutorials/modules/CHT/reverseBurner/0/solid/T @@ -24,18 +24,17 @@ boundaryField external { - type externalWallHeatFluxTemperature; + type externalTemperature; h uniform 1e3; Ta $internalField; value $internalField; } + solid_to_gas { - type compressible::turbulentTemperatureRadCoupledMixed; + type coupledTemperature; value $internalField; - Tnbr T; qrNbr qr; - qr none; } } diff --git a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/shell/T b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/shell/T index 15b7a32718..a6d9ef617e 100644 --- a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/shell/T +++ b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/shell/T @@ -39,10 +39,10 @@ boundaryField } shell_to_solid { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } } + // ************************************************************************* // diff --git a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T index a960febc8a..87f1c2ee39 100644 --- a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T +++ b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T @@ -28,15 +28,13 @@ boundaryField } solid_to_shell { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } solid_to_tube { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } } diff --git a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/tube/T b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/tube/T index cfdcb2deeb..55535c7665 100644 --- a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/tube/T +++ b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/tube/T @@ -39,9 +39,8 @@ boundaryField } tube_to_solid { - type compressible::turbulentTemperatureCoupledBaffleMixed; + type coupledTemperature; value $internalField; - Tnbr T; } }