compressibleVoFphase.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::compressibleVoFphase
26 
27 Description
28  Single compressible phase derived from the VoFphase.
29 
30  Used in compressibleMultiphaseVoFMixture for multiphase
31  interface-capturing simulations.
32 
33 SourceFiles
34  compressibleVoFphase.C
35 
36 See also
37  Foam::VoFphase
38  Foam::compressibleMultiphaseVoFMixture
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef compressibleVoFphase_H
43 #define compressibleVoFphase_H
44 
45 #include "VoFphase.H"
46 #include "rhoThermo.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class compressibleVoFphase Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public VoFphase
60 {
61  // Private Data
62 
63  //- Phase thermo
64  autoPtr<rhoThermo> thermo_;
65 
66  //- Phase mass-fraction
67  volScalarField Alpha_;
68 
69  //- Phase compressibility contribution
71 
72 
73 public:
74 
75  // Constructors
76 
77  //- Construct from components
79  (
80  const word& name,
81  const fvMesh& mesh,
82  const volScalarField& T
83  );
84 
85  //- Return clone
86  virtual autoPtr<VoFphase> clone() const;
87 
88  //- Return a pointer to a new compressibleVoFphase
89  // created on freestore from Istream
90  class iNew
91  :
92  public VoFphase::iNew
93  {
94  const volScalarField& T_;
95 
96  public:
97 
98  iNew(const fvMesh& mesh, const volScalarField& T)
99  :
100  VoFphase::iNew(mesh),
101  T_(T)
102  {}
103 
104  virtual autoPtr<VoFphase> operator()(Istream& is) const
105  {
106  const word name(is);
107 
108  return autoPtr<VoFphase>
109  (
111  );
112  }
113  };
114 
115 
116  // Member Functions
117 
118  //- Return const-access to phase rhoThermo
119  const rhoThermo& thermo() const
120  {
121  return thermo_();
122  }
123 
124  //- Return access to phase rhoThermo
125  rhoThermo& thermo()
126  {
127  return thermo_();
128  }
129 
130  //- Return const-access to phase mass-fraction
131  const volScalarField& Alpha() const
132  {
133  return Alpha_;
134  }
135 
136  //- Return access to phase mass-fraction
138  {
139  return Alpha_;
140  }
141 
142  //- Return const-access to phase divergence
143  const volScalarField::Internal& dgdt() const
144  {
145  return dgdt_;
146  }
147 
148  //- Return access to phase divergence
150  {
151  return dgdt_;
152  }
153 
154  void correct
155  (
156  const volScalarField& p,
157  const volScalarField& T
158  );
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const
Return mesh.
Generic GeometricField class.
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
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
Single incompressible VoFphase derived from the phase-fraction. Used as part of the multiPhaseMixture...
Definition: VoFphase.H:53
const word & name() const
Definition: VoFphase.H:98
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Return a pointer to a new compressibleVoFphase.
virtual autoPtr< VoFphase > operator()(Istream &is) const
iNew(const fvMesh &mesh, const volScalarField &T)
Single compressible phase derived from the VoFphase.
const volScalarField::Internal & dgdt() const
Return const-access to phase divergence.
compressibleVoFphase(const word &name, const fvMesh &mesh, const volScalarField &T)
Construct from components.
const rhoThermo & thermo() const
Return const-access to phase rhoThermo.
void correct(const volScalarField &p, const volScalarField &T)
virtual autoPtr< VoFphase > clone() const
Return clone.
const volScalarField & Alpha() const
Return const-access to phase mass-fraction.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Base-class for fluid thermodynamic properties based on density.
Definition: rhoThermo.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
volScalarField & p