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-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::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
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
92 
93  //- Construct from internal field and dictionary
95  (
96  const regIOobject&,
97  const dictionary& dict
98  );
99 
100  //- Copy constructor setting the internal field reference
102  (
104  const regIOobject&
105  );
106 
107  //- Construct and return a clone setting the internal field reference
109  (
110  const regIOobject& iIo
111  ) const
112  {
114  (
115  new carrierLagrangianFieldSource(*this, iIo)
116  );
117  }
118 
119 
120  //- Destructor
122 
123 
124  // Member Functions
125 
126  //- Return the value for an instantaneous injection
128  (
129  const LagrangianInjection&,
130  const LagrangianSubMesh&
131  ) const;
132 
133  //- Return the value without a model
135  (
136  const LagrangianSubMesh&
137  ) const;
138 
139  //- Write
140  virtual void write(Ostream&) const;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #ifdef NoRepository
152 #endif
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
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.
TypeName("carrier")
Runtime type information.
virtual tmp< LagrangianSubField< Type > > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
carrierLagrangianFieldSource(const regIOobject &)
Construct from internal field.
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:63
Namespace for OpenFOAM.
dictionary dict