CloudLagrangianFieldSource.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) 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::CloudLagrangianFieldSource
26 
27 Description
28  Templated base class for source conditions that refer to a cloud. Not a
29  source condition in itself. Must be mixed in.
30 
31 SourceFiles
32  CloudLagrangianFieldSource.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef CloudLagrangianFieldSource_H
37 #define CloudLagrangianFieldSource_H
38 
39 #include "LagrangianFieldsFwd.H"
40 #include "LagrangianSubFieldsFwd.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class LagrangianModel;
48 class cloud;
49 
50 /*---------------------------------------------------------------------------*\
51  Class CloudLagrangianFieldSource Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 {
57  // Private Member Data
58 
59  //- Reference to the derived field source
60  const LagrangianFieldSource<Type>& field_;
61 
62  //- Reference to the cloud
63  const Foam::cloud& cloud_;
64 
65 
66 protected:
67 
68  // Protected Member Functions
69 
70  //- Determine whether the cloud is one of the given types
71  template<class Cloud, class ... Clouds>
72  bool isCloud() const;
73 
74  //- Generate an error if the cloud is not one of the given types
75  template<class Cloud, class ... Clouds>
76  void assertCloud
77  (
78  const LagrangianModel& model,
79  const LagrangianSubMesh& subMesh
80  ) const;
81 
82  //- Get a reference to the cloud
83  template<class Cloud = Foam::cloud>
84  const Cloud& cloud
85  (
86  const LagrangianModel& model,
87  const LagrangianSubMesh& subMesh
88  ) const;
89 
90 
91 public:
92 
93  // Constructors
94 
95  //- Construct with reference to the derived field source
96  template<class Derived>
97  CloudLagrangianFieldSource(const Derived&);
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #ifdef NoRepository
109 #endif
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
Templated base class for source conditions that refer to a cloud. Not a source condition in itself....
const Cloud & cloud(const LagrangianModel &model, const LagrangianSubMesh &subMesh) const
Get a reference to the cloud.
bool isCloud() const
Determine whether the cloud is one of the given types.
void assertCloud(const LagrangianModel &model, const LagrangianSubMesh &subMesh) const
Generate an error if the cloud is not one of the given types.
CloudLagrangianFieldSource(const Derived &)
Construct with reference to the derived field source.
Base cloud calls templated on particle type.
Base class for Lagrangian source conditions.
Base class for Lagrangian models.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:63
Namespace for OpenFOAM.