interRegionHeatTransferModelTemplates.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 template<class Type>
31 (
32  const interRegionHeatTransferModel& nbrModel,
33  const Field<Type>& field
34 ) const
35 {
36  if (master_)
37  {
38  return meshInterp().mapTgtToSrc(field);
39  }
40  else
41  {
42  return (nbrModel.meshInterp().mapSrcToTgt(field));
43  }
44 }
45 
46 
47 template<class Type>
50 (
51  const Field<Type>& field
52 ) const
53 {
54  return interpolate(nbrModel(), field);
55 }
56 
57 
58 template<class Type>
60 (
61  const interRegionHeatTransferModel& nbrModel,
62  const Field<Type>& field,
63  Field<Type>& result
64 ) const
65 {
66  if (master_)
67  {
68  meshInterp().mapTgtToSrc(field, plusEqOp<scalar>(), result);
69  }
70  else
71  {
72  nbrModel.meshInterp().mapSrcToTgt(field, plusEqOp<scalar>(), result);
73  }
74 }
75 
76 
77 template<class Type>
79 (
80  const Field<Type>& field,
81  Field<Type>& result
82 ) const
83 {
84  return interpolate(nbrModel(), field, result);
85 }
86 
87 
88 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::interRegionHeatTransferModel
Intermediate class for handling inter-region heat exchanges.
Definition: interRegionHeatTransferModel.H:142
Foam::meshToMesh::mapSrcToTgt
void mapSrcToTgt(const UList< Type > &srcFld, const CombineOp &cop, List< Type > &result) const
Map field from src to tgt mesh with defined operation.
Definition: meshToMeshTemplates.C:54
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::fv::interRegionHeatTransferModel::interpolate
tmp< Field< Type > > interpolate(const interRegionHeatTransferModel &nbrModel, const Field< Type > &field) const
Interpolate field with nbrModel specified.
field
rDeltaTY field()
Foam::fv::interRegionHeatTransferModel::meshInterp
const meshToMesh & meshInterp() const
Return const access to the mapToMap pointer.
Definition: interRegionHeatTransferModelI.H:39
Foam::plusEqOp
Definition: ops.H:72
Foam::fac::interpolate
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.