VoFClouds.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) 2021-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::fv::VoFClouds
26 
27 Description
28  Lagrangian clouds model for VoF simulations.
29 
30 Usage
31  Example usage:
32  \verbatim
33  VoFClouds
34  {
35  type VoFClouds;
36  phase water;
37  }
38  \endverbatim
39 
40 SourceFiles
41  VoFClouds.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef VoFClouds_H
46 #define VoFClouds_H
47 
48 #include "fvModel.H"
49 #include "fluidThermo.H"
50 #include "parcelCloudList.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace fv
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class VoFClouds Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class VoFClouds
64 :
65  public fvModel
66 {
67  // Private Data
68 
69  //- The name of the Lagrangian phase
70  word phaseName_;
71 
72  //- The name of the Lagrangian carrier phase
73  word carrierPhaseName_;
74 
75  //- Reference to the Lagrangian thermo
76  const fluidThermo& thermo_;
77 
78  //- Reference to the carrier phase thermo
79  const fluidThermo& carrierThermo_;
80 
81  //- The Lagrangian cloud list
82  mutable parcelCloudList clouds_;
83 
84  //- Current time index (used for updating)
85  mutable label curTimeIndex_;
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("VoFClouds");
92 
93 
94  // Constructors
95 
96  //- Construct from explicit source name and mesh
97  VoFClouds
98  (
99  const word& sourceName,
100  const word& modelType,
101  const fvMesh& mesh,
102  const dictionary& dict
103  );
104 
105  //- Disallow default bitwise copy construction
106  VoFClouds
107  (
108  const VoFClouds&
109  ) = delete;
110 
111 
112  // Member Functions
113 
114  // Checks
115 
116  //- Return the list of fields for which the option adds source term
117  // to the transport equation
118  virtual wordList addSupFields() const;
119 
120 
121  // Correct
122 
123  //- Solve the Lagrangian clouds and update the sources
124  virtual void correct();
125 
126 
127  // Add explicit and implicit contributions to compressible equation
128 
129  //- Add explicit contribution to phase continuity
130  virtual void addSup
131  (
132  const volScalarField& alpha,
133  fvMatrix<scalar>& eqn,
134  const word& fieldName
135  ) const;
136 
137  //- Add explicit contribution to phase energy equation
138  virtual void addSup
139  (
140  const volScalarField& alpha,
141  const volScalarField& rho,
142  fvMatrix<scalar>& eqn,
143  const word& fieldName
144  ) const;
145 
146  //- Add implicit contribution to mixture momentum equation
147  virtual void addSup
148  (
149  const volScalarField& rho,
150  fvMatrix<vector>& eqn,
151  const word& fieldName
152  ) const;
153 
154 
155  // Mesh changes
156 
157  //- Prepare for mesh_.update
158  virtual void preUpdateMesh();
159 
160  //- Update topology using the given map
161  virtual void topoChange(const polyTopoChangeMap&);
162 
163  //- Update from another mesh using the given map
164  virtual void mapMesh(const polyMeshMap&);
165 
166  //- Redistribute or update using the given distribution map
167  virtual void distribute(const polyDistributionMap&);
168 
169  //- Update for mesh motion
170  virtual bool movePoints();
171 
172 
173  // Member Operators
174 
175  //- Disallow default bitwise assignment
176  void operator=(const VoFClouds&) = delete;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace fv
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
Lagrangian clouds model for VoF simulations.
Definition: VoFClouds.H:65
virtual bool movePoints()
Update for mesh motion.
Definition: VoFClouds.C:201
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
Definition: VoFClouds.C:90
virtual void correct()
Solve the Lagrangian clouds and update the sources.
Definition: VoFClouds.C:96
virtual void addSup(const volScalarField &alpha, fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit contribution to phase continuity.
Definition: VoFClouds.C:110
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
Definition: VoFClouds.C:183
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
Definition: VoFClouds.C:195
VoFClouds(const word &sourceName, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Definition: VoFClouds.C:53
virtual void preUpdateMesh()
Prepare for mesh_.update.
Definition: VoFClouds.C:176
TypeName("VoFClouds")
Runtime type information.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: VoFClouds.C:189
void operator=(const VoFClouds &)=delete
Disallow default bitwise assignment.
List of parcel clouds, with the same interface as an individual parcel cloud. This is the object that...
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
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
labelList fv(nPoints)
dictionary dict