surfaceIteratorPLIC.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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::surfaceIteratorPLIC
28
29Description
30 Finds the cutValue that matches the volume fraction
31
32 Reference:
33 \verbatim
34 Henning Scheufler, Johan Roenby,
35 Accurate and efficient surface reconstruction from volume
36 fraction data on general meshes,
37 Journal of Computational Physics, 2019,
38 doi 10.1016/j.jcp.2019.01.009
39 \endverbatim
40
41Author
42 Johan Roenby, DHI, all rights reserved.
43 Modified Henning Scheufler, DLR
44
45SourceFiles
46 surfaceIteratorPLIC.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef surfaceIteratorPLIC_H
51#define surfaceIteratorPLIC_H
52
53#include "fvMesh.H"
54#include "volFields.H"
55#include "surfaceFields.H"
56#include "cutCellPLIC.H"
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace Foam
61{
62
63/*---------------------------------------------------------------------------*\
64 Class surfaceIteratorPLIC Declaration
65\*---------------------------------------------------------------------------*/
68{
69 // Private Data
70
71 //- Mesh whose cells and faces to cut at their intersection with an
72 //- isosurface.
73 const fvMesh& mesh_;
74
75 //- Cuts the cell and returns volume centre and normal
76 cutCellPLIC cutCell_;
77
78 //- Tolerance for marking of surface cells:
79 // Those with surfCellTol_ < alpha1 < 1 - surfCellTol_
80 scalar surfCellTol_;
81
82
83public:
84
85 // Constructors
86
87 //- Construct from fvMesh and a scalarField
88 // Length of scalarField should equal number of mesh points
89 surfaceIteratorPLIC(const fvMesh& mesh, const scalar tol);
90
91
92 // Member Functions
93
94 //- Determine if a cell is a surface cell
95 bool isASurfaceCell(const scalar alpha1) const
96 {
97 return
98 (
99 surfCellTol_ < alpha1
100 && alpha1 < 1 - surfCellTol_
101 );
102 }
103
104 //- Finds matching cutValue for the given value fraction
105 // \return the cellStatus
106 label vofCutCell
107 (
108 const label celli,
109 const scalar alpha1,
110 const scalar tol,
111 const label maxIter,
112 vector normal
113 );
114
115 //- The centre point of cutted volume
116 const point& subCellCentre() const
117 {
118 return cutCell_.subCellCentre();
119 }
120
121 //- The volume of cutted volume
122 scalar subCellVolume() const
123 {
124 return cutCell_.subCellVolume();
125 }
126
127 //- The centre of cutting isosurface
128 const point& surfaceCentre() const
129 {
130 return cutCell_.faceCentre();
131 }
132
133 //- The area vector of cutting isosurface
134 const vector& surfaceArea() const
135 {
136 return cutCell_.faceArea();
137 }
138
139 //- Volume of Fluid for cellI (subCellVolume_/mesh_.V()[cellI])
140 scalar VolumeOfFluid() const
141 {
142 return cutCell_.VolumeOfFluid();
143 }
144
145 //- The cutValue
146 scalar cutValue() const
147 {
148 return cutCell_.cutValue();
149 }
150
151 //- The cellStatus
152 label cellStatus()
153 {
154 return cutCell_.cellStatus();
155 }
156
157 //- The points of the cutting isosurface in sorted order
159 {
160 return cutCell_.facePoints();
161 }
162};
163
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167} // End namespace Foam
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171#endif
172
173// ************************************************************************* //
const volScalarField & alpha1
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Class for cutting a cell, cellI, of an fvMesh, mesh_, at its intersection with an surface defined by ...
Definition: cutCellPLIC.H:74
const point & faceCentre() const noexcept
Returns the centre of the cutting PLICface.
Definition: cutCellPLIC.H:164
const vector & faceArea() const noexcept
Returns the area normal vector of the cutting PLICface.
Definition: cutCellPLIC.H:170
scalar cutValue() const noexcept
Returns cutValue.
Definition: cutCellPLIC.H:188
const DynamicList< point > & facePoints()
Returns the points of the cutting PLICface.
Definition: cutCellPLIC.C:175
scalar VolumeOfFluid() const noexcept
Returns volume of fluid value.
Definition: cutCellPLIC.H:182
label cellStatus() const noexcept
Returns cellStatus.
Definition: cutCellPLIC.H:176
scalar subCellVolume() const noexcept
Returns subCellVolume.
Definition: cutCellPLIC.H:155
const point & subCellCentre() const noexcept
Returns subCellCentre.
Definition: cutCellPLIC.H:149
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Finds the cutValue that matches the volume fraction.
const point & surfaceCentre() const
The centre of cutting isosurface.
scalar cutValue() const
The cutValue.
label cellStatus()
The cellStatus.
bool isASurfaceCell(const scalar alpha1) const
Determine if a cell is a surface cell.
const point & subCellCentre() const
The centre point of cutted volume.
const DynamicList< point > & facePoints()
The points of the cutting isosurface in sorted order.
scalar subCellVolume() const
The volume of cutted volume.
label vofCutCell(const label celli, const scalar alpha1, const scalar tol, const label maxIter, vector normal)
Finds matching cutValue for the given value fraction.
scalar VolumeOfFluid() const
Volume of Fluid for cellI (subCellVolume_/mesh_.V()[cellI])
const vector & surfaceArea() const
The area vector of cutting isosurface.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Foam::surfaceFields.