VoFphase.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) 2023 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::VoFphase
26 
27 Description
28  Single incompressible VoFphase derived from the phase-fraction.
29  Used as part of the multiPhaseMixture for interface-capturing multi-VoFphase
30  simulations.
31 
32 SourceFiles
33  VoFphase.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef VoFphase_H
38 #define VoFphase_H
39 
40 #include "volFields.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class VoFphase Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class VoFphase
52 :
53  public volScalarField
54 {
55  // Private Data
56 
57  word name_;
58 
59 
60 public:
61 
62  // Constructors
63 
64  //- Construct from components
65  VoFphase
66  (
67  const word& name,
68  const fvMesh& mesh
69  );
70 
71  //- Return clone
72  virtual autoPtr<VoFphase> clone() const;
73 
74  //- Return a pointer to a new VoFphase
75  // created on freestore
76  // from Istream
77  class iNew
78  {
79  protected:
80 
81  const fvMesh& mesh_;
82 
83  public:
84 
85  iNew(const fvMesh& mesh)
86  :
87  mesh_(mesh)
88  {}
89 
90  virtual ~iNew()
91  {}
92 
93  virtual autoPtr<VoFphase> operator()(Istream& is) const = 0;
94  };
95 
96 
97  // Member Functions
98 
99  const word& name() const
100  {
101  return name_;
102  }
103 
104  const word& keyword() const
105  {
106  return name();
107  }
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
const Mesh & mesh() const
Return mesh.
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Return a pointer to a new VoFphase.
Definition: VoFphase.H:77
const fvMesh & mesh_
Definition: VoFphase.H:80
iNew(const fvMesh &mesh)
Definition: VoFphase.H:84
virtual autoPtr< VoFphase > operator()(Istream &is) const =0
virtual ~iNew()
Definition: VoFphase.H:89
Single incompressible VoFphase derived from the phase-fraction. Used as part of the multiPhaseMixture...
Definition: VoFphase.H:53
virtual autoPtr< VoFphase > clone() const
Return clone.
Definition: VoFphase.C:50
const word & keyword() const
Definition: VoFphase.H:103
const word & name() const
Definition: VoFphase.H:98
VoFphase(const word &name, const fvMesh &mesh)
Construct from components.
Definition: VoFphase.C:30
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.