PoissonPatchDistMethod.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2019 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 public:
129 
130  //- Runtime type information
131  TypeName("Poisson");
132 
133 
134  // Constructors
135 
136  //- Construct from coefficients dictionary, mesh
137  // and fixed-value patch set
138  Poisson
139  (
140  const dictionary& dict,
141  const fvMesh& mesh,
142  const labelHashSet& patchIDs
143  );
144 
145  //- Construct from mesh and fixed-value patch set
146  Poisson
147  (
148  const fvMesh& mesh,
149  const labelHashSet& patchIDs
150  );
151 
152  //- Disallow default bitwise copy construction
153  Poisson(const Poisson&) = delete;
154 
155 
156  // Member Functions
157 
158  //- Correct the given distance-to-patch field
159  virtual bool correct(volScalarField& y);
160 
161  //- Correct the given distance-to-patch and normal-to-patch fields
162  virtual bool correct(volScalarField& y, volVectorField& n);
163 
164 
165  // Member Operators
166 
167  //- Disallow default bitwise assignment
168  void operator=(const Poisson&) = delete;
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:158
Poisson(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs)
Construct from coefficients dictionary, mesh.
scalar y
dynamicFvMesh & mesh
void operator=(const Poisson &)=delete
Disallow default bitwise assignment.
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.