From 37207f3279cbf78845041d7290bd5d6dae23c7b6 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 31 Aug 2018 16:04:43 +0100 Subject: [PATCH] greyDiffusiveRadiationMixedFvPatchScalarField, wideBandDiffusiveRadiationMixedFvPatchScalarField: Added mapping functions Patch contributed by Timo Niemi, VTT. Resolves patch request https://bugs.openfoam.org/view.php?id=3062 --- ...iffusiveRadiationMixedFvPatchScalarField.C | 24 +++++++++++++- ...iffusiveRadiationMixedFvPatchScalarField.H | 15 +++++++++ ...veViewFactorFixedValueFvPatchScalarField.C | 31 +++++++++++++++++-- ...veViewFactorFixedValueFvPatchScalarField.H | 14 +++++++++ ...iffusiveRadiationMixedFvPatchScalarField.C | 24 +++++++++++++- ...iffusiveRadiationMixedFvPatchScalarField.H | 14 +++++++++ 6 files changed, 118 insertions(+), 4 deletions(-) diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index 3cdce0edc..6e89bbc28 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -67,7 +67,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField ( p, ptf.emissivityMethod(), - ptf.emissivity_ + ptf.emissivity_, + mapper ), TName_(ptf.TName_) {} @@ -143,6 +144,27 @@ greyDiffusiveRadiationMixedFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + mixedFvPatchScalarField::autoMap(m); + radiationCoupledBase::autoMap(m); +} + + +void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + mixedFvPatchScalarField::rmap(ptf, addr); + radiationCoupledBase::rmap(ptf, addr); +} + + void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField:: updateCoeffs() { diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index 81e786245..04d971708 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H @@ -171,6 +171,21 @@ public: return TName_; } + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + // Evaluation functions diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C index 1642507fd..7058e96d2 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C @@ -58,9 +58,10 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField ( patch(), ptf.emissivityMethod(), - ptf.emissivity_ + ptf.emissivity_, + mapper ), - qro_(ptf.qro_) + qro_(ptf.qro_, mapper) {} @@ -128,6 +129,32 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::radiation::greyDiffusiveViewFactorFixedValueFvPatchScalarField:: +autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedValueFvPatchScalarField::autoMap(m); + radiationCoupledBase::autoMap(m); + qro_.autoMap(m); +} + + +void Foam::radiation::greyDiffusiveViewFactorFixedValueFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchScalarField::rmap(ptf, addr); + radiationCoupledBase::rmap(ptf, addr); + const greyDiffusiveViewFactorFixedValueFvPatchScalarField& mrptf = + refCast(ptf); + + qro_.rmap(mrptf.qro_, addr); +} + void Foam::radiation::greyDiffusiveViewFactorFixedValueFvPatchScalarField:: updateCoeffs() { diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H index 69bad7b95..ec6076a99 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.H @@ -168,6 +168,20 @@ public: } + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index 52bb9e684..92f295096 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -68,7 +68,8 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField ( p, ptf.emissivityMethod(), - ptf.emissivity_ + ptf.emissivity_, + mapper ), TName_(ptf.TName_) {} @@ -147,6 +148,27 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: +autoMap +( + const fvPatchFieldMapper& m +) +{ + mixedFvPatchScalarField::autoMap(m); + radiationCoupledBase::autoMap(m); +} + + +void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + mixedFvPatchScalarField::rmap(ptf, addr); + radiationCoupledBase::rmap(ptf, addr); +} + void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField:: updateCoeffs() { diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index 987bc7d1d..b9ea5afef 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -165,6 +165,20 @@ public: } + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + // Evaluation functions //- Update the coefficients associated with the patch field