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  //- Provides stencil and map
87  zoneDistribute& exchangeFields_;
88 
89  //- SurfaceIterator finds the plane centre for specified VOF value
90  surfaceIteratorPLIC sIterPLIC_;
91 
92 
93  // Private Member Functions
94 
95  //- Compute gradient at the surfaces
96  void gradSurf(const volScalarField& phi);
97 
98  //- No copy construct
99  gradAlpha(const gradAlpha&) = delete;
100 
101  //- No copy assignment
102  void operator=(const gradAlpha&) = delete;
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("gradAlpha");
109 
110  //- Construct from components
111  gradAlpha
112  (
114  const surfaceScalarField& phi,
115  const volVectorField& U,
116  const dictionary& dict
117  );
118 
119  //- Destructor
120  virtual ~gradAlpha() = default;
121 
122 
123  // Member Functions
124 
125  //- Reconstruct interface
126  virtual void reconstruct(bool forceUpdate = true);
127 
128  //- map VoF Field in case of refinement
129  virtual void mapAlphaField() const;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace reconstruction
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
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:51
Foam::reconstruction::gradAlpha::mapAlphaField
virtual void mapAlphaField() const
map VoF Field in case of refinement
Definition: gradAlpha.C:194
Foam::reconstruction::gradAlpha::reconstruct
virtual void reconstruct(bool forceUpdate=true)
Reconstruct interface.
Definition: gradAlpha.C:123
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: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::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