incompressibleVoFphase.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-2025 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::incompressibleVoFphase
26 
27 Description
28  Single incompressible phase derived from the VoFphase.
29 
30  Used in incompressibleMultiphaseVoFMixture for multiphase
31  interface-capturing simulations.
32 
33 SourceFiles
34  incompressibleVoFphase.C
35 
36 See also
37  Foam::VoFphase
38  Foam::incompressibleMultiphaseVoFMixture
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef incompressibleVoFphase_H
43 #define incompressibleVoFphase_H
44 
45 #include "VoFphase.H"
46 #include "viscosityModel.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class incompressibleVoFphase Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
60  public VoFphase
61 {
62  // Private Data
63 
64  //- Phase viscosity model
65  autoPtr<viscosityModel> nuModel_;
66 
67  //- Phase density
68  uniformDimensionedScalarField rho_;
69 
70 
71 public:
72 
73  // Constructors
74 
75  //- Construct from components
77  (
78  const word& name,
79  const fvMesh& mesh
80  );
81 
82  //- Return clone
83  virtual autoPtr<VoFphase> clone() const;
84 
85  //- Return a pointer to a new incompressibleVoFphase
86  // created on freestore from Istream
87  class iNew
88  :
89  public VoFphase::iNew
90  {
91  public:
92 
93  iNew(const fvMesh& mesh)
94  :
96  {}
97 
98  virtual autoPtr<VoFphase> operator()(Istream& is) const
99  {
100  const word name(is);
101 
102  return autoPtr<VoFphase>
103  (
105  );
106  }
107  };
108 
109 
110  // Member Functions
111 
112  //- Return const-access to incompressibleVoFphase1 viscosityModel
113  const viscosityModel& nuModel() const
114  {
115  return nuModel_();
116  }
117 
118  //- Return the kinematic laminar viscosity
119  tmp<volScalarField> nu() const
120  {
121  return nuModel_->nu();
122  }
123 
124  //- Return the laminar viscosity for patch
125  tmp<scalarField> nu(const label patchi) const
126  {
127  return nuModel_->nu(patchi);
128  }
129 
130  //- Return const-access to incompressibleVoFphase1 density
131  const dimensionedScalar& rho() const
132  {
133  return rho_;
134  }
135 
136  //- Correct the incompressibleVoFphase properties
137  void correct();
138 
139  //- Read base phaseProperties dictionary
140  bool read();
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
const GeoMesh & mesh() const
Return mesh.
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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
Return a pointer to a new incompressibleVoFphase.
virtual autoPtr< VoFphase > operator()(Istream &is) const
Single incompressible phase derived from the VoFphase.
void correct()
Correct the incompressibleVoFphase properties.
const dimensionedScalar & rho() const
Return const-access to incompressibleVoFphase1 density.
virtual autoPtr< VoFphase > clone() const
Return clone.
incompressibleVoFphase(const word &name, const fvMesh &mesh)
Construct from components.
const viscosityModel & nuModel() const
Return const-access to incompressibleVoFphase1 viscosityModel.
tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
bool read()
Read base phaseProperties dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
An abstract base class for Newtonian viscosity models.
A class for handling words, derived from string.
Definition: word.H:63
label patchi
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Typedefs for UniformDimensionedField.