upwindEdgeInterpolation.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::upwindEdgeInterpolation
28 
29 Description
30  Upwind differencing scheme class.
31 
32 SourceFiles
33  upwindEdgeInterpolation.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef upwindEdgeInterpolation_H
38 #define upwindEdgeInterpolation_H
39 
41 #include "areaFields.H"
42 #include "edgeFields.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class upwind Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
55 :
56  virtual public edgeInterpolationScheme<Type>
57 {
58  // Private data
59 
60  const edgeScalarField& faceFlux_;
61 
62 
63  // Private Member Functions
64 
65  //- No copy assignment
66  void operator=(const upwindEdgeInterpolation&) = delete;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("upwind");
73 
74 
75  // Constructors
76 
77  //- Construct from faceFlux
79  (
80  const faMesh& mesh,
81  const edgeScalarField& faceFlux
82  )
83  :
85  faceFlux_(faceFlux)
86  {}
87 
88  //- Construct from Istream.
89  // The name of the flux field is read from the Istream and looked-up
90  // from the database
92  (
93  const faMesh& mesh,
94  Istream& is
95  )
96  :
98  faceFlux_
99  (
100  mesh().objectRegistry::lookupObject<edgeScalarField>
101  (
102  word(is)
103  )
104  )
105  {}
106 
107  //- Construct from faceFlux and Istream
109  (
110  const faMesh& mesh,
111  const edgeScalarField& faceFlux,
112  Istream&
113  )
114  :
116  faceFlux_(faceFlux)
117  {}
118 
119 
120  // Member Functions
121 
122  //- Return the interpolation weighting factors
124  (
126  ) const
127  {
128  return pos(faceFlux_);
129  }
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
edgeInterpolationScheme.H
Foam::edgeInterpolationScheme
Abstract base class for edge interpolation schemes.
Definition: edgeInterpolationScheme.H:57
Foam::upwindEdgeInterpolation::weights
virtual tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the interpolation weighting factors.
Definition: upwindEdgeInterpolation.H:123
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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::upwindEdgeInterpolation::TypeName
TypeName("upwind")
Runtime type information.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
edgeFields.H
areaFields.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:77
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::upwindEdgeInterpolation::upwindEdgeInterpolation
upwindEdgeInterpolation(const faMesh &mesh, const edgeScalarField &faceFlux)
Construct from faceFlux.
Definition: upwindEdgeInterpolation.H:78
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177