multivariateUpwind.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 | Copyright (C) 2011-2017 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::multivariateUpwind
26 
27 Description
28  Upwind-difference form of the multivariate surfaceInterpolationScheme.
29 
30 SourceFiles
31  multivariateUpwindmake.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef multivariateUpwind_H
36 #define multivariateUpwind_H
37 
39 #include "surfaceFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class multivariateUpwind Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class Type>
52 :
54 {
55  // Private data
56 
57  const surfaceScalarField& faceFlux_;
58 
59 
60  // Private Member Functions
61 
62  //- Disallow default bitwise copy construct
64 
65  //- Disallow default bitwise assignment
66  void operator=(const multivariateUpwind&);
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("upwind");
73 
74 
75  // Constructors
76 
77  //- Construct for field, faceFlux and Istream
79  (
80  const fvMesh& mesh,
83  const surfaceScalarField& faceFlux,
84  Istream& schemeData
85  )
86  :
88  (
89  mesh,
90  fields,
91  faceFlux,
92  schemeData
93  ),
94  faceFlux_(faceFlux)
95  {}
96 
97 
98  // Member Operators
99 
100  //- surfaceInterpolationScheme sub-class returned by operator(field)
101  // which is used as the interpolation scheme for the field
102  class fieldScheme
103  :
105  {
106  // Private data
107 
108  const surfaceScalarField& faceFlux_;
109 
110  public:
111 
112  // Constructors
113 
115  (
117  const surfaceScalarField& faceFlux
118  )
119  :
121  fieldScheme(field),
122  faceFlux_(faceFlux)
123  {}
124 
125 
126  // Member Functions
127 
128  //- Return the interpolation weighting factors
130  (
132  ) const
133  {
134  return pos0(faceFlux_);
135  }
136  };
137 
139  (
141  ) const
142  {
144  (
145  new fieldScheme(field, faceFlux_)
146  );
147  }
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Foam::surfaceFields.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
fieldScheme(const GeometricField< Type, fvPatchField, volMesh > &field, const surfaceScalarField &faceFlux)
const fieldTable & fields() const
Return fields to be interpolated.
surfaceInterpolationScheme sub-class returned by operator(field)
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
TypeName("upwind")
Runtime type information.
Upwind-difference form of the multivariate surfaceInterpolationScheme.
dimensionedScalar pos0(const dimensionedScalar &ds)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Abstract base class for multi-variate surface interpolation schemes.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.