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-2026 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  tolerance 1e-5;
85  relTol 0;
86  }
87  \endverbatim
88 
89 See also
90  Foam::patchDistMethod::meshWave
91  Foam::wallDist
92 
93 SourceFiles
94  PoissonPatchDistMethod.C
95 
96 \*---------------------------------------------------------------------------*/
97 
98 #ifndef PoissonPatchDistMethod_H
99 #define PoissonPatchDistMethod_H
100 
101 #include "patchDistMethod.H"
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 namespace Foam
106 {
107 namespace patchDistMethods
108 {
109 
110 /*---------------------------------------------------------------------------*\
111  Class Poisson Declaration
112 \*---------------------------------------------------------------------------*/
113 
114 class Poisson
115 :
116  public patchDistMethod
117 {
118  // Private Data
119 
120  //- Cache yPsi for moving meshes
121  tmp<volScalarField> tyPsi_;
122 
123 
124 public:
125 
126  //- Runtime type information
127  TypeName("Poisson");
128 
129 
130  // Constructors
131 
132  //- Construct from coefficients dictionary, mesh
133  // and fixed-value patch set
134  Poisson
135  (
136  const dictionary& dict,
137  const fvMesh& mesh,
138  const labelHashSet& patchIDs
139  );
140 
141  //- Construct from mesh and fixed-value patch set
142  Poisson
143  (
144  const fvMesh& mesh,
145  const labelHashSet& patchIDs
146  );
147 
148  //- Disallow default bitwise copy construction
149  Poisson(const Poisson&) = delete;
150 
151 
152  // Member Functions
153 
154  //- Correct the given distance-to-patch field
155  virtual bool correct(volScalarField& y);
156 
157  //- Correct the given distance-to-patch and normal-to-patch fields
158  virtual bool correct(volScalarField& y, volVectorField& n);
159 
160 
161  // Member Operators
162 
163  //- Disallow default bitwise assignment
164  void operator=(const Poisson&) = delete;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace patchDistMethods
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
scalar y
label n
Generic GeometricField class.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
Specialisation of patchDist for wall distance calculation.
Calculation of approximate distance to nearest patch for all cells and boundary by solving Poisson's ...
void operator=(const Poisson &)=delete
Disallow default bitwise assignment.
virtual bool correct(volScalarField &y)
Correct the given distance-to-patch field.
TypeName("Poisson")
Runtime type information.
Poisson(const dictionary &dict, const fvMesh &mesh, const labelHashSet &patchIDs)
Construct from coefficients dictionary, mesh.
A class for managing temporary objects.
Definition: tmp.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
dictionary dict