LagrangianInjection.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::LagrangianInjection
26 
27 Description
28  Base class for Lagrangian injections. Minimal wrapper over
29  LagrangianSource. Implements some utility functions, and reports that all
30  fields require a source value to be specified. Also serves as a type that
31  can be identified and cast to.
32 
33 SourceFiles
34  LagrangianInjection.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef LagrangianInjection_H
39 #define LagrangianInjection_H
40 
41 #include "LagrangianModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class timeIOdictionary;
49 
50 /*---------------------------------------------------------------------------*\
51  Class LagrangianInjection Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public LagrangianModel
57 {
58 protected:
59 
60  // Protected Member Functions
61 
62  //- Check the location and error or warn as appropriate
63  void checkLocation
64  (
66  const point&
67  ) const;
68 
69  //- Check the locations and error or warn as appropriate
70  void checkLocation
71  (
73  const List<point>&
74  ) const;
75 
76  //- Filter out injected elements that are on other processes. These
77  // are identified by cell/face/faceTri indices equal to -1.
78  template<class ... OtherFields>
79  static void filter
80  (
82  labelField& celli,
83  labelField& facei,
84  labelField& faceTrii,
85  OtherFields& ... otherFields
86  );
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("LagrangianInjection");
93 
94 
95  // Constructors
96 
97  //- Construct from components
99 
100 
101  //- Destructor
102  virtual ~LagrangianInjection();
103 
104 
105  // Member Functions
106 
107  // Checks
108 
109  //- Return true if the LagrangianModel adds a source term to the
110  // given field's transport equation. Returns false. Injections are
111  // instantaneous. They do not create continuous sources.
112  virtual bool addsSupToField(const word& fieldName) const;
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #ifdef NoRepository
124 #endif
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:83
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
LagrangianInjection(const word &name, const LagrangianMesh &mesh)
Construct from components.
TypeName("LagrangianInjection")
Runtime type information.
void checkLocation(const LagrangianMesh::location, const point &) const
Check the location and error or warn as appropriate.
virtual ~LagrangianInjection()
Destructor.
virtual bool addsSupToField(const word &fieldName) const
Return true if the LagrangianModel adds a source term to the.
static void filter(barycentricField &coordinates, labelField &celli, labelField &facei, labelField &faceTrii, OtherFields &... otherFields)
Filter out injected elements that are on other processes. These.
Class containing Lagrangian geometry and topology.
location
Enumeration for the locations of searched positions.
Base class for Lagrangian models.
const LagrangianMesh & mesh() const
The mesh.
static word fieldName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the field associated with a source term.
const word & name() const
The source name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A class for handling words, derived from string.
Definition: word.H:62
barycentric coordinates(const polyMesh &mesh, const point &position, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the coordinates given the position and tet topology.
Definition: tracking.C:1259
Namespace for OpenFOAM.