manualInjection.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::Lagrangian::manualInjection
26 
27 Description
28  Manual injection model. This injects particles instantaneously at a list of
29  positions specified in a separate file.
30 
31 Usage
32  \table
33  Property | Description | Required? | Default
34  positions | Positions at which to inject | if file not specified |
35  file | File containing the positions | if positions not specified |
36  units | Units of the positions in the file | if file specified | [m]
37  time | The time at which to inject | no | 0
38  \endtable
39 
40  Example specification:
41  \verbatim
42  <LagrangianModelName>
43  {
44  type manualInjection;
45  positions ((0 0 0) (1 1 1) (2 2 2)) [m];
46  time 1.23 [s];
47  }
48  \endverbatim
49 
50  Example specification with positions in a file:
51  \verbatim
52  <LagrangianModelName>
53  {
54  type manualInjection;
55  file "manualInjectionPositions";
56  units [mm];
57  }
58  \endverbatim
59 
60 SourceFiles
61  manualInjection.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef manualInjection_H
66 #define manualInjection_H
67 
68 #include "LagrangianInjection.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 namespace Lagrangian
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class manualInjection Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class manualInjection
82 :
83  public LagrangianInjection
84 {
85 private:
86 
87  // Private Data
88 
89  //- Positions at which to inject
90  pointField positions_;
91 
92  //- File containing the positions
93  fileName fileName_;
94 
95  //- Units of the positions in the file
96  unitSet units_;
97 
98  //- The time at which to inject
99  scalar time_;
100 
101 
102  // Private Member Functions
103 
104  //- Non-virtual read
105  void readCoeffs(const dictionary& modelDict);
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("manualInjection");
112 
113 
114  // Constructors
115 
116  //- Construct from components
118  (
119  const word& name,
120  const LagrangianMesh& mesh,
121  const dictionary& modelDict,
122  const dictionary& stateDict
123  );
124 
125 
126  // Member Functions
127 
128  //- Create new elements in the Lagrangian mesh
130  (
132  const LagrangianSubMesh&
133  ) const;
134 
135 
136  // IO
137 
138  //- Read dictionary
139  virtual bool read(const dictionary& modelDict);
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Lagrangian
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Class containing Lagrangian geometry and topology.
const LagrangianMesh & mesh() const
The mesh.
const word & name() const
The source name.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
TypeName("manualInjection")
Runtime type information.
LagrangianSubMesh modify(LagrangianMesh &mesh, const LagrangianSubMesh &) const
Create new elements in the Lagrangian mesh.
virtual bool read(const dictionary &modelDict)
Read dictionary.
manualInjection(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
static dictionary stateDict(const word &name, const objectRegistry &db)
Construct and return the state dictionary for reading.
Definition: stateModel.C:137
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42