PoissonPatchDistMethod.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) 2015-2016 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::patchDistMethods::Poisson
26 
27 Description
28  Calculation of approximate distance to nearest patch for all cells and
29  boundary by solving Poisson's equation.
30 
31  References:
32  \verbatim
33  D.B. Spalding,
34  "Calculation of turbulent heat transfer in cluttered spaces",
35  Proc. 10th Int. Heat Transfer Conference, Brighton, UK, (1994).
36 
37  E. Fares and W. Schroder,
38  "Differential Equation for Approximate Wall Distance",
39  Int.J.Numer.Meth., 39:743-762, (2002).
40 
41  P.G. Tucker,
42  "Differential equation based wall distance computation for DES and
43  RANS",
44  J.Comp.Phys., Vol. 190, Issue 1, 1 st September, pp. 229-248 (2003)
45  \endverbatim
46 
47  Example of the wallDist specification in fvSchemes:
48  \verbatim
49  laplacianSchemes
50  {
51  .
52  .
53  laplacian(yPsi) Gauss linear corrected;
54  .
55  .
56  }
57 
58  wallDist
59  {
60  method Poisson;
61 
62  // Optional entry enabling the calculation
63  // of the normal-to-wall field
64  nRequired false;
65  }
66  \endverbatim
67  Also the solver specification for yPsi is required in fvSolution, e.g.
68  for simple cases:
69  \verbatim
70  yPsi
71  {
72  solver PCG;
73  preconditioner DIC;
74  tolerance 1e-5;
75  relTol 0;
76  }
77 
78  or for more complex cases:
79 
80  yPsi
81  {
82  solver GAMG;
83  smoother GaussSeidel;
84  cacheAgglomeration true;
85  nCellsInCoarsestLevel 10;
86  agglomerator faceAreaPair;
87  mergeLevels 1;
88  tolerance 1e-5;
89  relTol 0;
90  }
91  \endverbatim
92 
93 See also
94  Foam::patchDistMethod::meshWave
95  Foam::wallDist
96 
97 SourceFiles
98  PoissonPatchDistMethod.C
99 
100 \*---------------------------------------------------------------------------*/
101 
102 #ifndef PoissonPatchDistMethod_H
103 #define PoissonPatchDistMethod_H
104 
105 #include "patchDistMethod.H"
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 namespace Foam
110 {
111 namespace patchDistMethods
112 {
113 
114 /*---------------------------------------------------------------------------*\
115  Class Poisson Declaration
116 \*---------------------------------------------------------------------------*/
118 class Poisson
119 :
120  public patchDistMethod
121 {
122  // Private Member Data
123 
124  //- Cache yPsi for moving meshes
125  tmp<volScalarField> tyPsi_;
126 
127 
128  // Private Member Functions
129 
130  //- Disallow default bitwise copy construct
131  Poisson(const Poisson&);
132 
133  //- Disallow default bitwise assignment
134  void operator=(const Poisson&);
135 
136 
137 public:
138 
139  //- Runtime type information
140  TypeName("Poisson");
141 
142 
143  // Constructors
144 
145  //- Construct from coefficients dictionary, mesh
146  // and fixed-value patch set
147  Poisson
148  (
149  const dictionary& dict,
150  const fvMesh& mesh,
151  const labelHashSet& patchIDs
152  );
153 
154  //- Construct from mesh and fixed-value patch set
155  Poisson
156  (
157  const fvMesh& mesh,
158  const labelHashSet& patchIDs
159  );
160 
161 
162  // Member Functions
163 
164  //- Correct the given distance-to-patch field
165  virtual bool correct(volScalarField& y);
166 
167  //- Correct the given distance-to-patch and normal-to-patch fields
168  virtual bool correct(volScalarField& y, volVectorField& n);
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace patchDistMethods
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
virtual bool correct(volScalarField &y)
Correct the given distance-to-patch field.
dictionary dict
TypeName("Poisson")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
scalar y
dynamicFvMesh & mesh
Calculation of approximate distance to nearest patch for all cells and boundary by solving Poisson&#39;s ...
const labelHashSet & patchIDs() const
Return the patchIDs.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
label n
A class for managing temporary objects.
Definition: PtrList.H:53
Specialisation of patchDist for wall distance calculation.
Namespace for OpenFOAM.