downwind.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) 2011 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 Class
27  Foam::downwind
28 
29 Group
30  grpFvSurfaceInterpolationSchemes
31 
32 Description
33  Downwind differencing scheme class.
34 
35 SourceFiles
36  downwind.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef downwind_H
41 #define downwind_H
42 
44 #include "volFields.H"
45 #include "surfaceFields.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class downwind Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class Type>
57 class downwind
58 :
59  public surfaceInterpolationScheme<Type>
60 {
61  // Private data
62 
63  const surfaceScalarField& faceFlux_;
64 
65 
66  // Private Member Functions
67 
68  //- No copy assignment
69  void operator=(const downwind&) = delete;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("downwind");
76 
77 
78  // Constructors
79 
80  //- Construct from faceFlux
82  (
83  const fvMesh& mesh,
84  const surfaceScalarField& faceFlux
85  )
86  :
88  faceFlux_(faceFlux)
89  {}
90 
91  //- Construct from Istream.
92  // The name of the flux field is read from the Istream and looked-up
93  // from the mesh objectRegistry
95  (
96  const fvMesh& mesh,
97  Istream& is
98  )
99  :
101  faceFlux_
102  (
103  mesh.lookupObject<surfaceScalarField>
104  (
105  word(is)
106  )
107  )
108  {}
109 
110  //- Construct from faceFlux and Istream
112  (
113  const fvMesh& mesh,
114  const surfaceScalarField& faceFlux,
115  Istream&
116  )
117  :
119  faceFlux_(faceFlux)
120  {}
121 
122 
123  // Member Functions
124 
125  //- Return the interpolation weighting factors
127  (
129  ) const
130  {
131  return neg(faceFlux_);
132  }
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
volFields.H
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
surfaceFields.H
Foam::surfaceFields.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::objectRegistry::lookupObject
const Type & lookupObject(const word &name, const bool recursive=false) const
Definition: objectRegistryTemplates.C:434
Foam::downwind
Downwind differencing scheme class.
Definition: downwind.H:56
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::downwind::weights
virtual tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: downwind.H:126
Foam::surfaceInterpolationScheme
Abstract base class for surface interpolation schemes.
Definition: surfaceInterpolationScheme.H:57
Foam::downwind::TypeName
TypeName("downwind")
Runtime type information.
Foam::surfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::downwind::downwind
downwind(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from faceFlux.
Definition: downwind.H:81
Foam::neg
dimensionedScalar neg(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:199
surfaceInterpolationScheme.H