gradAlpha.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::gradAlpha
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 VoF Field (alpha).
33  Also known as Young method
34 
35  Original code supplied by Henning Scheufler, DLR (2019)
36 
37 SourceFiles
38  gradAlpha.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef gradAlpha_H
43 #define gradAlpha_H
44 
45 #include "typeInfo.H"
46 #include "reconstructionSchemes.H"
47 #include "volFields.H"
48 #include "dimensionedScalar.H"
49 #include "autoPtr.H"
50 #include "surfaceIteratorPLIC.H"
51 #include "zoneDistribute.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace reconstruction
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class gradAlpha Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class gradAlpha
65 :
67 {
68  // Private Data
69 
70  //- Reference to mesh
71  const fvMesh& mesh_;
72 
73  //- Interpolation object from cell centres to points
74  DynamicField<vector> interfaceNormal_;
75 
76 
77  // Switches and tolerances. Tolerances need to go into toleranceSwitches
78 
79  //- Tolerance for search of isoFace giving specified VOF value
80  scalar isoFaceTol_;
81 
82  //- Tolerance for marking of surface cells:
83  // Those with surfCellTol_ < alpha1 < 1 - surfCellTol_
84  scalar surfCellTol_;
85 
86  //- SurfaceIterator finds the plane centre for specified VOF value
87  surfaceIteratorPLIC sIterPLIC_;
88 
89  // Private Member Functions
90 
91  //- Compute gradient at the surfaces
92  void gradSurf(const volScalarField& phi);
93 
94  //- No copy construct
95  gradAlpha(const gradAlpha&) = delete;
96 
97  //- No copy assignment
98  void operator=(const gradAlpha&) = delete;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("gradAlpha");
105 
106  //- Construct from components
107  gradAlpha
108  (
110  const surfaceScalarField& phi,
111  const volVectorField& U,
112  const dictionary& dict
113  );
114 
115  //- Destructor
116  virtual ~gradAlpha() = default;
117 
118 
119  // Member Functions
120 
121  //- Reconstruct interface
122  virtual void reconstruct(bool forceUpdate = true);
123 
124  //- map VoF Field in case of refinement
125  virtual void mapAlphaField() const;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace reconstruction
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
volFields.H
typeInfo.H
reconstructionSchemes.H
zoneDistribute.H
surfaceIteratorPLIC.H
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
Foam::reconstruction::gradAlpha::TypeName
TypeName("gradAlpha")
Runtime type information.
Foam::reconstruction::gradAlpha::~gradAlpha
virtual ~gradAlpha()=default
Destructor.
Foam::DynamicField
Dynamically sized Field.
Definition: DynamicField.H:49
Foam::reconstruction::gradAlpha::mapAlphaField
virtual void mapAlphaField() const
map VoF Field in case of refinement
Definition: gradAlpha.C:197
Foam::reconstruction::gradAlpha::reconstruct
virtual void reconstruct(bool forceUpdate=true)
Reconstruct interface.
Definition: gradAlpha.C:125
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
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:123
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
dimensionedScalar.H
U
U
Definition: pEqn.H:72
Foam::reconstructionSchemes
Original code supplied by Henning Scheufler, DLR (2019)
Definition: reconstructionSchemes.H:58
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::reconstruction::gradAlpha
Reconstructs an interface (centre and normal vector) consisting of planes to match the internal fluid...
Definition: gradAlpha.H:63
Foam::surfaceIteratorPLIC
Finds the cutValue that matches the volume fraction.
Definition: surfaceIteratorPLIC.H:66
autoPtr.H