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 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::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  file | Name of the file containing the positions | yes |
35  units | Units of the positions in the file | no | [m]
36  time | The time at which to inject | no | 0
37  \endtable
38 
39  Example specification:
40  \verbatim
41  <LagrangianModelName>
42  {
43  type manualInjection;
44  file "manualInjectionPositions";
45  units [mm];
46  }
47  \endverbatim
48 
49 SourceFiles
50  manualInjection.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef manualInjection_H
55 #define manualInjection_H
56 
57 #include "LagrangianInjection.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace Lagrangian
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class manualInjection Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 class manualInjection
71 :
72  public LagrangianInjection
73 {
74 private:
75 
76  // Private Data
77 
78  //- File containing positions
79  fileName fileName_;
80 
81  //- Optional unit conversion for the positions
82  unitConversion units_;
83 
84  //- The time at which to inject
85  scalar time_;
86 
87 
88  // Private Member Functions
89 
90  //- Non-virtual read
91  void readCoeffs(const dictionary& modelDict);
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("manualInjection");
98 
99 
100  // Constructors
101 
102  //- Construct from components
104  (
105  const word& name,
106  const LagrangianMesh& mesh,
107  const dictionary& modelDict,
108  const dictionary& stateDict
109  );
110 
111 
112  // Member Functions
113 
114  //- Create new elements in the Lagrangian mesh
116  (
118  const LagrangianSubMesh&
119  ) const;
120 
121 
122  // IO
123 
124  //- Read dictionary
125  virtual bool read(const dictionary& modelDict);
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Lagrangian
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
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
Manual injection model. This injects particles instantaneously at a list of positions specified in a ...
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:62
Namespace for OpenFOAM.