From e26ce06560f1e8c7c0acc52aad7650de24ab7dab Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Tue, 27 Sep 2011 14:52:01 +0100 Subject: [PATCH] ENH: Tidied surface film mapping functionality --- .../mappedField/mappedFieldFvPatchField.C | 1 - .../SurfaceFilmModel/SurfaceFilmModel.C | 55 +++++++------ .../SurfaceFilmModel/SurfaceFilmModel.H | 1 - .../ThermoSurfaceFilm/ThermoSurfaceFilm.C | 6 +- .../ThermoSurfaceFilm/ThermoSurfaceFilm.H | 1 - ...ysisTemperatureCoupledFvPatchScalarField.C | 10 +-- ...rolysisVelocityCoupledFvPatchVectorField.C | 10 +-- .../regionModel/regionModel/regionModel.C | 24 +----- .../regionModel/regionModel/regionModel.H | 31 +++++-- .../regionModel/regionModel/regionModelI.H | 7 -- .../regionModel/regionModelTemplates.C | 80 +++++++++++++++++++ ...alphatFilmWallFunctionFvPatchScalarField.C | 4 +- .../mutkFilmWallFunctionFvPatchScalarField.C | 4 +- .../thermoSingleLayer/thermoSingleLayer.C | 9 +-- 14 files changed, 150 insertions(+), 93 deletions(-) create mode 100644 src/regionModels/regionModel/regionModel/regionModelTemplates.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C index 19aeaa4a5a1..ae597b4bfcc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C @@ -227,7 +227,6 @@ void mappedFieldFvPatchField<Type>::updateCoeffs() const fieldType& nbrField = sampleField(); - const mapDistribute& distMap = mappedPatchBase::map(); newValues = nbrField.boundaryField()[nbrPatchID]; this->distribute(newValues); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index 36dca28f6a4..d080a624a2f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -114,8 +114,8 @@ bool Foam::SurfaceFilmModel<CloudType>::transferParcel "bool Foam::SurfaceFilmModel<CloudType>::transferParcel" "(" "parcelType&, " - "const label, " - "const bool&" + "const polyPatch&, " + "bool&" ")" ); @@ -156,11 +156,9 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td) const label filmPatchI = filmPatches[i]; const label primaryPatchI = primaryPatches[i]; - const mappedPatchBase& mapPatch = filmModel.mappedPatches()[filmPatchI]; - const labelList& injectorCellsPatch = pbm[primaryPatchI].faceCells(); - cacheFilmFields(filmPatchI, primaryPatchI, mapPatch, filmModel); + cacheFilmFields(filmPatchI, primaryPatchI, filmModel); const vectorField& Cf = mesh.C().boundaryField()[primaryPatchI]; const vectorField& Sf = mesh.Sf().boundaryField()[primaryPatchI]; @@ -172,13 +170,11 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td) { const label cellI = injectorCellsPatch[j]; - // The position is at the cell centre, which could be - // in any tet of the decomposed cell, so arbitrarily - // choose the first face of the cell as the tetFace - // and the first point on the face after the base - // point as the tetPt. The tracking will - // pick the cell consistent with the motion in the - // first tracking step. + // The position could bein any tet of the decomposed cell, + // so arbitrarily choose the first face of the cell as the + // tetFace and the first point on the face after the base + // point as the tetPt. The tracking will pick the cell + // consistent with the motion in the first tracking step. const label tetFaceI = this->owner().mesh().cells()[cellI][0]; const label tetPtI = 1; @@ -208,14 +204,22 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td) setParcelProperties(*pPtr, j); - // Check new parcel properties -// td.cloud().checkParcelProperties(*pPtr, 0.0, true); - td.cloud().checkParcelProperties(*pPtr, 0.0, false); - - // Add the new parcel to the cloud - td.cloud().addParticle(pPtr); - - nParcelsInjected_++; + if (pPtr->nParticle() > 0.001) + { + // Check new parcel properties + // td.cloud().checkParcelProperties(*pPtr, 0.0, true); + td.cloud().checkParcelProperties(*pPtr, 0.0, false); + + // Add the new parcel to the cloud + td.cloud().addParticle(pPtr); + + nParcelsInjected_++; + } + else + { + // TODO: cache mass and re-distribute? + delete pPtr; + } } } } @@ -227,26 +231,25 @@ void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields ( const label filmPatchI, const label primaryPatchI, - const mappedPatchBase& mapPatch, const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel ) { massParcelPatch_ = filmModel.cloudMassTrans().boundaryField()[filmPatchI]; - mapPatch.distribute(massParcelPatch_); + filmModel.toPrimary(filmPatchI, massParcelPatch_); diameterParcelPatch_ = filmModel.cloudDiameterTrans().boundaryField()[filmPatchI]; - mapPatch.distribute(diameterParcelPatch_); + filmModel.toPrimary(filmPatchI, diameterParcelPatch_); UFilmPatch_ = filmModel.Us().boundaryField()[filmPatchI]; - mapPatch.distribute(UFilmPatch_); + filmModel.toPrimary(filmPatchI, UFilmPatch_); rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchI]; - mapPatch.distribute(rhoFilmPatch_); + filmModel.toPrimary(filmPatchI, rhoFilmPatch_); deltaFilmPatch_[primaryPatchI] = filmModel.delta().boundaryField()[filmPatchI]; - mapPatch.distribute(deltaFilmPatch_[primaryPatchI]); + filmModel.toPrimary(filmPatchI, deltaFilmPatch_[primaryPatchI]); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H index ae35db7ec57..967e748f56c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H @@ -116,7 +116,6 @@ protected: ( const label filmPatchI, const label primaryPatchI, - const mappedPatchBase& mapPatch, const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel ); diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index c6f4b4054a8..6a6c60db398 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -643,7 +643,6 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields ( const label filmPatchI, const label primaryPatchI, - const mappedPatchBase& mapPatch, const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel ) { @@ -651,15 +650,14 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields ( filmPatchI, primaryPatchI, - mapPatch, filmModel ); TFilmPatch_ = filmModel.Ts().boundaryField()[filmPatchI]; - mapPatch.distribute(TFilmPatch_); + filmModel.toPrimary(filmPatchI, TFilmPatch_); CpFilmPatch_ = filmModel.Cp().boundaryField()[filmPatchI]; - mapPatch.distribute(CpFilmPatch_); + filmModel.toPrimary(filmPatchI, CpFilmPatch_); } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H index 66bd1395682..bddbfcc66e9 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H @@ -227,7 +227,6 @@ protected: ( const label filmPatchI, const label primaryPatchI, - const mappedPatchBase& distMap, const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel ); diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C index 8351d49d2da..b0f8d1629a9 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C @@ -151,13 +151,11 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs() const label filmPatchI = filmModel.regionPatchID(patchI); - const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI]; - scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI]; - filmMap.distribute(deltaFilm); + filmModel.toPrimary(filmPatchI, deltaFilm); scalarField TFilm = filmModel.Ts().boundaryField()[filmPatchI]; - filmMap.distribute(TFilm); + filmModel.toPrimary(filmPatchI, TFilm); // Retrieve pyrolysis model @@ -166,10 +164,8 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs() const label pyrPatchI = pyrModel.regionPatchID(patchI); - const mappedPatchBase& pyrMap = pyrModel.mappedPatches()[pyrPatchI]; - scalarField TPyr = pyrModel.T().boundaryField()[pyrPatchI]; - pyrMap.distribute(TPyr); + pyrModel.toPrimary(pyrPatchI, TPyr); forAll(deltaFilm, i) diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C index a516534fa81..29b3e345868 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C @@ -154,13 +154,11 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs() const label filmPatchI = filmModel.regionPatchID(patchI); - const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI]; - scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI]; - filmMap.distribute(deltaFilm); + filmModel.toPrimary(filmPatchI, deltaFilm); vectorField UFilm = filmModel.Us().boundaryField()[filmPatchI]; - filmMap.distribute(UFilm); + filmModel.toPrimary(filmPatchI, UFilm); // Retrieve pyrolysis model @@ -172,10 +170,8 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs() const label pyrPatchI = pyrModel.regionPatchID(patchI); - const mappedPatchBase& pyrMap = pyrModel.mappedPatches()[pyrPatchI]; - scalarField phiPyr = pyrModel.phiGas().boundaryField()[pyrPatchI]; - pyrMap.distribute(phiPyr); + pyrModel.toPrimary(pyrPatchI, phiPyr); const surfaceScalarField& phi = diff --git a/src/regionModels/regionModel/regionModel/regionModel.C b/src/regionModels/regionModel/regionModel/regionModel.C index 1d74a9c6465..f7f630147eb 100644 --- a/src/regionModels/regionModel/regionModel/regionModel.C +++ b/src/regionModels/regionModel/regionModel/regionModel.C @@ -93,8 +93,6 @@ void Foam::regionModels::regionModel::initialise() DynamicList<label> primaryPatchIDs; DynamicList<label> intCoupledPatchIDs; const polyBoundaryMesh& rbm = regionMesh().boundaryMesh(); - const polyBoundaryMesh& pbm = primaryMesh().boundaryMesh(); - mappedPatches_.setSize(rbm.size()); forAll(rbm, patchI) { @@ -116,19 +114,6 @@ void Foam::regionModels::regionModel::initialise() const label primaryPatchI = mapPatch.samplePolyPatch().index(); primaryPatchIDs.append(primaryPatchI); - - mappedPatches_.set - ( - patchI, - new mappedPatchBase - ( - pbm[primaryPatchI], - regionMesh().name(), - mapPatch.mode(), - regionPatch.name(), - vector::zero - ) - ); } } @@ -212,8 +197,7 @@ Foam::regionModels::regionModel::regionModel(const fvMesh& mesh) regionMeshPtr_(NULL), coeffs_(dictionary::null), primaryPatchIDs_(), - intCoupledPatchIDs_(), - mappedPatches_() + intCoupledPatchIDs_() {} @@ -244,8 +228,7 @@ Foam::regionModels::regionModel::regionModel regionMeshPtr_(NULL), coeffs_(subOrEmptyDict(modelName + "Coeffs")), primaryPatchIDs_(), - intCoupledPatchIDs_(), - mappedPatches_() + intCoupledPatchIDs_() { if (active_) { @@ -290,8 +273,7 @@ Foam::regionModels::regionModel::regionModel regionMeshPtr_(NULL), coeffs_(dict.subOrEmptyDict(modelName + "Coeffs")), primaryPatchIDs_(), - intCoupledPatchIDs_(), - mappedPatches_() + intCoupledPatchIDs_() { if (active_) { diff --git a/src/regionModels/regionModel/regionModel/regionModel.H b/src/regionModels/regionModel/regionModel/regionModel.H index bc9fb54a335..2af98421d10 100644 --- a/src/regionModels/regionModel/regionModel/regionModel.H +++ b/src/regionModels/regionModel/regionModel/regionModel.H @@ -117,9 +117,6 @@ protected: //- List of patch IDs internally coupled with the primary region labelList intCoupledPatchIDs_; - //- List of patch map info - PtrList<mappedPatchBase> mappedPatches_; - // Protected member functions @@ -212,13 +209,29 @@ public: // primary region inline const labelList& intCoupledPatchIDs() const; - //- Return the list of patch map info - inline const PtrList<mappedPatchBase>& mappedPatches() const; - //- Return region ID corresponding to primaryPatchID inline label regionPatchID(const label primaryPatchID) const; + // Helper + + //- Convert a local region field to the primary region + template<class Type> + void toPrimary + ( + const label regionPatchI, + List<Type>& regionField + ) const; + + //- Convert a primary region field to the local region + template<class Type> + void toRegion + ( + const label regionPatchI, + List<Type>& primaryFieldField + ) const; + + // Evolution //- Pre-evolve region @@ -249,6 +262,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "regionModelTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/regionModels/regionModel/regionModel/regionModelI.H b/src/regionModels/regionModel/regionModel/regionModelI.H index 197e663d503..a0e43403f70 100644 --- a/src/regionModels/regionModel/regionModel/regionModelI.H +++ b/src/regionModels/regionModel/regionModel/regionModelI.H @@ -132,13 +132,6 @@ Foam::regionModels::regionModel::intCoupledPatchIDs() const } -inline const Foam::PtrList<Foam::mappedPatchBase>& -Foam::regionModels::regionModel::mappedPatches() const -{ - return mappedPatches_; -} - - inline Foam::label Foam::regionModels::regionModel::regionPatchID ( const label primaryPatchID diff --git a/src/regionModels/regionModel/regionModel/regionModelTemplates.C b/src/regionModels/regionModel/regionModel/regionModelTemplates.C new file mode 100644 index 00000000000..977da7dd816 --- /dev/null +++ b/src/regionModels/regionModel/regionModel/regionModelTemplates.C @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +template<class Type> +void Foam::regionModels::regionModel::toPrimary +( + const label regionPatchI, + List<Type>& regionField +) const +{ + forAll(intCoupledPatchIDs_, i) + { + if (intCoupledPatchIDs_[i] == regionPatchI) + { + const mappedPatchBase& mpb = + refCast<const mappedPatchBase> + ( + regionMesh().boundaryMesh()[regionPatchI] + ); + mpb.reverseDistribute(regionField); + return; + } + } + + FatalErrorIn("const void toPrimary(const label, List<Type>&) const") + << "Region patch ID " << regionPatchI << " not found in region mesh" + << abort(FatalError); +} + + +template<class Type> +void Foam::regionModels::regionModel::toRegion +( + const label regionPatchI, + List<Type>& primaryField +) const +{ + forAll(intCoupledPatchIDs_, i) + { + if (intCoupledPatchIDs_[i] == regionPatchI) + { + const mappedPatchBase& mpb = + refCast<const mappedPatchBase> + ( + regionMesh().boundaryMesh()[regionPatchI] + ); + mpb.distribute(primaryField); + return; + } + } + + FatalErrorIn("const void toRegion(const label, List<Type>&) const") + << "Region patch ID " << regionPatchI << " not found in region mesh" + << abort(FatalError); +} + + +// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C index 8b8ef3be1fb..fd3be5ac385 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C @@ -158,11 +158,9 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() const label filmPatchI = filmModel.regionPatchID(patchI); - const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI]; - tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans()); scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI]; - filmMap.distribute(mDotFilmp); + filmModel.toPrimary(filmPatchI, mDotFilmp); // Retrieve RAS turbulence model const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutkFilmWallFunction/mutkFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutkFilmWallFunction/mutkFilmWallFunctionFvPatchScalarField.C index 8cd0aaf5aa4..7374f80e034 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutkFilmWallFunction/mutkFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutkFilmWallFunction/mutkFilmWallFunctionFvPatchScalarField.C @@ -70,11 +70,9 @@ tmp<scalarField> mutkFilmWallFunctionFvPatchScalarField::calcUTau const label filmPatchI = filmModel.regionPatchID(patchI); - const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI]; - tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans()); scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI]; - filmMap.distribute(mDotFilmp); + filmModel.toPrimary(filmPatchI, mDotFilmp); // Retrieve RAS turbulence model diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index c6c373500f5..c405d98fa9f 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -705,12 +705,11 @@ tmp<DimensionedField<scalar, volMesh> > thermoSingleLayer::Srho() const forAll(intCoupledPatchIDs(), i) { const label filmPatchI = intCoupledPatchIDs()[i]; - const mappedPatchBase& filmMap = mappedPatches_[filmPatchI]; scalarField patchMass = primaryMassPCTrans_.boundaryField()[filmPatchI]; - filmMap.distribute(patchMass); + toPrimary(filmPatchI, patchMass); const label primaryPatchI = primaryPatchIDs()[i]; const unallocLabelList& cells = @@ -761,12 +760,11 @@ tmp<DimensionedField<scalar, volMesh> > thermoSingleLayer::Srho forAll(intCoupledPatchIDs_, i) { const label filmPatchI = intCoupledPatchIDs_[i]; - const mappedPatchBase& filmMap = mappedPatches_[filmPatchI]; scalarField patchMass = primaryMassPCTrans_.boundaryField()[filmPatchI]; - filmMap.distribute(patchMass); + toPrimary(filmPatchI, patchMass); const label primaryPatchI = primaryPatchIDs()[i]; const unallocLabelList& cells = @@ -812,12 +810,11 @@ tmp<DimensionedField<scalar, volMesh> > thermoSingleLayer::Sh() const forAll(intCoupledPatchIDs_, i) { const label filmPatchI = intCoupledPatchIDs_[i]; - const mappedPatchBase& filmMap = mappedPatches_[filmPatchI]; scalarField patchEnergy = primaryEnergyPCTrans_.boundaryField()[filmPatchI]; - filmMap.distribute(patchEnergy); + toPrimary(filmPatchI, patchEnergy); const label primaryPatchI = primaryPatchIDs()[i]; const unallocLabelList& cells = -- GitLab