carrierLagrangianFieldSource.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::carrierLagrangianFieldSource
26 
27 Description
28  This source condition creates a Lagrangian value interpolated from a given
29  carrier field. By default the field chosen is that with the same name as
30  the Lagrangian field, but this can be overridden with the \c fieldc
31  control.
32 
33 Usage
34  \table
35  Property | Description | Required? | Default
36  fieldc | The carrier field name | no | The Lagrangian field name
37  \endtable
38 
39  Example specification:
40  \verbatim
41  <LagrangianModelName>
42  {
43  type carrier;
44  fieldc U.air;
45  }
46  \endverbatim
47 
48 SourceFiles
49  carrierLagrangianFieldSource.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef carrierLagrangianFieldSource_H
54 #define carrierLagrangianFieldSource_H
55 
56 #include "LagrangianFieldSource.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class carrierLagrangianFieldSource Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class Type>
69 class carrierLagrangianFieldSource
70 :
71  public LagrangianFieldSource<Type>,
72  private CloudLagrangianFieldSource<Type>
73 {
74 private:
75 
76  // Private Data
77 
78  //- The carrier field name
79  const word fieldcName_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("carrier");
86 
87 
88  // Constructors
89 
90  //- Construct from internal field and dictionary
92  (
93  const regIOobject&,
95  );
96 
97  //- Copy constructor setting the internal field reference
99  (
101  const regIOobject&
102  );
103 
104  //- Construct and return a clone setting the internal field reference
106  (
107  const regIOobject& iIo
108  ) const
109  {
111  (
112  new carrierLagrangianFieldSource(*this, iIo)
113  );
114  }
115 
116 
117  //- Destructor
119 
120 
121  // Member Functions
122 
123  //- Return the value for an instantaneous injection
125  (
126  const LagrangianInjection&,
127  const LagrangianSubMesh&
128  ) const;
129 
130  //- Write
131  virtual void write(Ostream&) const;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #ifdef NoRepository
143 #endif
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
autoPtr< LagrangianFieldSource< Type > > clone() const
Disallow clone without setting the internal field reference.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
This source condition creates a Lagrangian value interpolated from a given carrier field....
virtual void write(Ostream &) const
Write.
carrierLagrangianFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
TypeName("carrier")
Runtime type information.
virtual tmp< LagrangianSubField< Type > > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict