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 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"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class incompressibleVoFphase Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public VoFphase
60 {
61  // Private Data
62 
63  //- Phase viscosity model
64  autoPtr<viscosityModel> nuModel_;
65 
66  //- Phase density
67  dimensionedScalar rho_;
68 
69 
70 public:
71 
72  // Constructors
73 
74  //- Construct from components
76  (
77  const word& name,
78  const fvMesh& mesh
79  );
80 
81  //- Return clone
82  virtual autoPtr<VoFphase> clone() const;
83 
84  //- Return a pointer to a new incompressibleVoFphase
85  // created on freestore from Istream
86  class iNew
87  :
88  public VoFphase::iNew
89  {
90  public:
91 
92  iNew(const fvMesh& mesh)
93  :
95  {}
96 
97  virtual autoPtr<VoFphase> operator()(Istream& is) const
98  {
99  const word name(is);
100 
101  return autoPtr<VoFphase>
102  (
104  );
105  }
106  };
107 
108 
109  // Member Functions
110 
111  //- Return const-access to incompressibleVoFphase1 viscosityModel
112  const viscosityModel& nuModel() const
113  {
114  return nuModel_();
115  }
116 
117  //- Return the kinematic laminar viscosity
118  tmp<volScalarField> nu() const
119  {
120  return nuModel_->nu();
121  }
122 
123  //- Return the laminar viscosity for patch
124  tmp<scalarField> nu(const label patchi) const
125  {
126  return nuModel_->nu(patchi);
127  }
128 
129  //- Return const-access to incompressibleVoFphase1 density
130  const dimensionedScalar& rho() const
131  {
132  return rho_;
133  }
134 
135  //- Correct the incompressibleVoFphase properties
136  void correct();
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
const Mesh & 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:101
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.
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:62
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