plicRDF.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) 2019-2020 DLR
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::reconstruction::plicRDF
28 
29 Description
30  Reconstructs an interface (centre and normal vector) consisting of planes
31  to match the internal fluid distribution in cells. The interface normals
32  are estimated by least square gradient scheme on the RDF function (height).
33  Uses the normal from the previous times step as intial guess.
34 
35  Reference:
36  \verbatim
37  Henning Scheufler, Johan Roenby,
38  Accurate and efficient surface reconstruction from volume
39  fraction data on general meshes,
40  Journal of Computational Physics, 2019,
41  doi 10.1016/j.jcp.2019.01.009
42 
43  \endverbatim
44 
45  Original code supplied by Henning Scheufler, DLR (2019)
46 
47 SourceFiles
48  plicRDF.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef plicRDF_H
53 #define plicRDF_H
54 
55 #include "typeInfo.H"
56 #include "reconstructionSchemes.H"
57 #include "volFields.H"
58 #include "dimensionedScalar.H"
59 #include "autoPtr.H"
60 #include "surfaceIteratorPLIC.H"
62 #include "zoneDistribute.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace reconstruction
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class plicRDF Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class plicRDF
76 :
78 {
79  // Private Data
80 
81  //- Reference to mesh
82  const fvMesh& mesh_;
83 
84  //- Interpolation object from cell centres to points
85  DynamicField<vector> interfaceNormal_;
86 
87 
88  // Switches and tolerances. Tolerances need to go into toleranceSwitches
89 
90  //- Tolerance for search of isoFace giving specified VOF value
91  scalar isoFaceTol_;
92 
93  //- Tolerance for marking of surface cells:
94  // Those with surfCellTol_ < alpha1 < 1 - surfCellTol_
95  scalar surfCellTol_;
96 
97  //- Tolerance
98  scalar tol_;
99 
100  //- Relative tolerance
101  scalar relTol_;
102 
103  //- Number of times that the interface is reconstructed
104  //- has to be bigger than 2
105  label iteration_;
106 
107  //- Interpolated normal from previous time step
108  bool interpolateNormal_;
109 
110  //- Calculates the RDF function
112 
113  //- Provides stencil and map
114  zoneDistribute& exchangeFields_;
115 
116  //- surfaceIterator finds the plane centre for specified VOF value
117  surfaceIteratorPLIC sIterPLIC_;
118 
119 
120  // Private Member Functions
121 
122  //- Set initial normals by interpolation from the previous
123  //- timestep or with the Young method
124  void setInitNormals(bool interpolate);
125 
126  //- compute gradient at the surfaces
127  void gradSurf(const volScalarField& phi);
128 
129  //- compute the normal residuals
130  void calcResidual
131  (
132  Map<scalar>& normalResidual,
133  Map<scalar>& avgAngle
134  );
135 
136  //- interpolation of the normals from the previous time step
137  void interpolateNormal();
138 
139  //- No copy construct
140  plicRDF(const plicRDF&) = delete;
141 
142  //- No copy assignment
143  void operator=(const plicRDF&) = delete;
144 
145 
146 public:
147 
148  //- Runtime type information
149  TypeName("plicRDF");
150 
151 
152  //- Construct from components
153  plicRDF
154  (
156  const surfaceScalarField& phi,
157  const volVectorField& U,
158  const dictionary& dict
159  );
160 
161 
162  //- Destructor
163  virtual ~plicRDF() = default;
164 
165 
166  // Member Functions
167 
168  //- Reconstruct interface
169  virtual void reconstruct(bool forceUpdate = true);
170 
171  //- Map VoF Field in case of refinement
172  virtual void mapAlphaField() const;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace reconstruction
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
volFields.H
typeInfo.H
reconstructionSchemes.H
zoneDistribute.H
surfaceIteratorPLIC.H
Foam::reconstruction::plicRDF::reconstruct
virtual void reconstruct(bool forceUpdate=true)
Reconstruct interface.
Definition: plicRDF.C:374
Foam::Map< scalar >
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
Foam::DynamicField
Dynamically sized Field.
Definition: DynamicField.H:51
reconstructedDistanceFunction.H
Foam::interpolate
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Definition: curveTools.C:75
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::reconstruction::plicRDF::mapAlphaField
virtual void mapAlphaField() const
Map VoF Field in case of refinement.
Definition: plicRDF.C:541
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
dimensionedScalar.H
U
U
Definition: pEqn.H:72
Foam::zoneDistribute
Class for parallel communication in a narrow band. It either provides a Map with the neighbouring val...
Definition: zoneDistribute.H:64
Foam::reconstructedDistanceFunction
Calculates a reconstructed distance function.
Definition: reconstructedDistanceFunction.H:58
Foam::reconstruction::plicRDF::TypeName
TypeName("plicRDF")
Runtime type information.
Foam::reconstructionSchemes
Original code supplied by Henning Scheufler, DLR (2019)
Definition: reconstructionSchemes.H:58
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::reconstruction::plicRDF::~plicRDF
virtual ~plicRDF()=default
Destructor.
Foam::reconstruction::plicRDF
Reconstructs an interface (centre and normal vector) consisting of planes to match the internal fluid...
Definition: plicRDF.H:74
Foam::surfaceIteratorPLIC
Finds the cutValue that matches the volume fraction.
Definition: surfaceIteratorPLIC.H:66
autoPtr.H