phaseStabilised.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) 2022 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::phaseStabilised
26 
27 Description
28  Phase-stabilised interpolation scheme
29 
30  which applies upwind to the faces at which the upwind phase-fraction is less
31  than 1e-3.
32 
33 SourceFiles
34  phaseStabilised.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef phaseStabilised_H
39 #define phaseStabilised_H
40 
41 #include "upwind.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class phaseStabilised Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type>
53 class phaseStabilised
54 :
55  public surfaceInterpolationScheme<Type>
56 {
57  // Private member data
58 
59  const surfaceScalarField& faceFlux_;
61 
62  upwind<scalar> upwind_;
63 
64  const volScalarField& alpha_;
65 
66 
67  // Private member functions
68 
69  const volScalarField& lookupAlpha
70  (
71  const surfaceScalarField& faceFlux
72  ) const;
73 
74  tmp<surfaceScalarField> lambdaf() const;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("phaseStabilised");
81 
82 
83  // Constructors
84 
85  //- Construct from mesh and Istream
86  phaseStabilised(const fvMesh& mesh, Istream& is);
87 
88 
89  //- Construct from mesh, faceFlux and Istream
91  (
92  const fvMesh& mesh,
93  const surfaceScalarField& faceFlux,
94  Istream& is
95  );
96 
97  //- Disallow default bitwise copy construction
98  phaseStabilised(const phaseStabilised&) = delete;
99 
100 
101  // Member Functions
102 
103  //- Return the interpolation weighting factors
105  (
106  const VolField<Type>& vf
107  ) const;
108 
109  //- Return true if this scheme uses an explicit correction
110  virtual bool corrected() const
111  {
112  return tScheme_().corrected();
113  }
114 
115  //- Return the explicit correction to the face-interpolate
116  // set to zero on the near-boundary faces where upwind is applied
117  virtual tmp<SurfaceField<Type>>
118  correction
119  (
120  const VolField<Type>& vf
121  ) const;
122 
123 
124  // Member Operators
125 
126  //- Disallow default bitwise assignment
127  void operator=(const phaseStabilised&) = delete;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #ifdef NoRepository
138  #include "phaseStabilisedTemplates.C"
139 #endif
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Phase-stabilised interpolation scheme.
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
phaseStabilised(const fvMesh &mesh, Istream &is)
Construct from mesh and Istream.
tmp< surfaceScalarField > weights(const VolField< Type > &vf) const
Return the interpolation weighting factors.
virtual tmp< SurfaceField< Type > > correction(const VolField< Type > &vf) const
Return the explicit correction to the face-interpolate.
TypeName("phaseStabilised")
Runtime type information.
void operator=(const phaseStabilised &)=delete
Disallow default bitwise assignment.
Abstract base class for surface interpolation schemes.
const fvMesh & mesh() const
Return mesh reference.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.