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