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