blendedEdgeInterpolation.H
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) 2016-2017 Wikki Ltd
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 Class
27  Foam::blendedEdgeInterpolation
28 
29 Description
30  linear/upwind blended differencing scheme.
31 
32 SourceFiles
33  blendedEdgeInterpolationMake.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef blendedEdgeInterpolation_H
38 #define blendedEdgeInterpolation_H
39 
42 #include "areaFields.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class blendedEdgeInterpolation Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
55 :
56  public linearEdgeInterpolation<Type>,
57  public upwindEdgeInterpolation<Type>
58 {
59  // Private Data
60 
61  //- Blending factor
62  const scalar blendingFactor_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("blended");
69 
70 
71  // Generated Methods
72 
73  //- No copy construct
75 
76  //- No copy assignment
77  void operator=(const blendedEdgeInterpolation&) = delete;
78 
79 
80  // Constructors
81 
82  //- Construct from mesh, faceFlux and blendingFactor
84  (
85  const faMesh& mesh,
86  const edgeScalarField& faceFlux,
87  const scalar blendingFactor
88  )
89  :
92  upwindEdgeInterpolation<Type>(mesh, faceFlux),
93  blendingFactor_(blendingFactor)
94  {}
95 
96  //- Construct from mesh and Istream.
97  // The name of the flux field is read from the Istream and looked-up
98  // from the database
100  (
101  const faMesh& mesh,
102  Istream& is
103  )
104  :
108  (
109  mesh,
110  mesh.thisDb().lookupObject<edgeScalarField>
111  (
112  word(is)
113  )
114  ),
115  blendingFactor_(readScalar(is))
116  {}
117 
118  //- Construct from mesh, faceFlux and Istream
120  (
121  const faMesh& mesh,
122  const edgeScalarField& faceFlux,
123  Istream& is
124  )
125  :
128  upwindEdgeInterpolation<Type>(mesh, faceFlux),
129  blendingFactor_(readScalar(is))
130  {}
131 
132 
133  // Member Functions
134 
135  //- Return the interpolation weighting factors
137  (
139  ) const
140  {
141  return
142  blendingFactor_*
144  + (1 - blendingFactor_)*
146  }
147 };
148 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:133
TypeName("blended")
Runtime type information.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Abstract base class for edge interpolation schemes.
virtual tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &vf) const
Return the interpolation weighting factors.
blendedEdgeInterpolation(const blendedEdgeInterpolation &)=delete
No copy construct.
A class for handling words, derived from Foam::string.
Definition: word.H:63
void operator=(const blendedEdgeInterpolation &)=delete
No copy assignment.
linear/upwind blended differencing scheme.
Upwind differencing scheme class.
Central-differencing interpolation scheme class.
const faMesh & mesh() const
Return mesh reference.
tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the interpolation weighting factors.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.