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  const scalar blendingFactor_;
62 
63 
64  // Private Member Functions
65 
66  //- No copy construct
68 
69  //- No copy assignment
70  void operator=(const blendedEdgeInterpolation&) = delete;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("blended");
77 
78 
79  // Constructors
80 
81  //- Construct from mesh, faceFlux and blendingFactor
83  (
84  const faMesh& mesh,
85  const edgeScalarField& faceFlux,
86  const scalar blendingFactor
87  )
88  :
91  upwindEdgeInterpolation<Type>(mesh, faceFlux),
92  blendingFactor_(blendingFactor)
93  {}
94 
95  //- Construct from mesh and Istream.
96  // The name of the flux field is read from the Istream and looked-up
97  // from the database
99  (
100  const faMesh& mesh,
101  Istream& is
102  )
103  :
107  (
108  mesh,
109  mesh().objectRegistry::lookupObject<edgeScalarField>
110  (
111  word(is)
112  )
113  ),
114  blendingFactor_(readScalar(is))
115  {}
116 
117  //- Construct from mesh, faceFlux and Istream
119  (
120  const faMesh& mesh,
121  const edgeScalarField& faceFlux,
122  Istream& is
123  )
124  :
127  upwindEdgeInterpolation<Type>(mesh, faceFlux),
128  blendingFactor_(readScalar(is))
129  {}
130 
131 
132  // Member Functions
133 
134  //- Return the interpolation weighting factors
136  (
138  ) const
139  {
140  return
141  blendingFactor_*
143  + (1 - blendingFactor_)*
145  }
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Foam::edgeInterpolationScheme
Abstract base class for edge interpolation schemes.
Definition: edgeInterpolationScheme.H:57
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::blendedEdgeInterpolation
linear/upwind blended differencing scheme.
Definition: blendedEdgeInterpolation.H:53
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::edgeInterpolationScheme::mesh
const faMesh & mesh() const
Return mesh reference.
Definition: edgeInterpolationScheme.H:138
Foam::upwindEdgeInterpolation
Upwind differencing scheme class.
Definition: upwindEdgeInterpolation.H:53
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::linearEdgeInterpolation::weights
tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the interpolation weighting factors.
Definition: linearEdgeInterpolation.H:97
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
areaFields.H
Foam::blendedEdgeInterpolation::weights
virtual tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &vf) const
Return the interpolation weighting factors.
Definition: blendedEdgeInterpolation.H:135
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
linearEdgeInterpolation.H
Foam::blendedEdgeInterpolation::TypeName
TypeName("blended")
Runtime type information.
Foam::linearEdgeInterpolation
Central-differencing interpolation scheme class.
Definition: linearEdgeInterpolation.H:52
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::GeometricField< scalar, faePatchField, edgeMesh >
upwindEdgeInterpolation.H