LagrangianModelTemplates.C
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 \*---------------------------------------------------------------------------*/
25 
26 #include "LagrangianModel.H"
27 
28 // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
29 
30 template<class AlphaRhoFieldType, class ... AlphaRhoFieldTypes>
32 (
33  const AlphaRhoFieldType& alphaRhoField,
34  const AlphaRhoFieldTypes& ... alphaRhoFields
35 )
36 {
37  return fieldName(alphaRhoFields ...);
38 }
39 
40 
41 template
42 <
43  class Type,
44  class GeoMesh,
45  template<class> class PrimitiveField
46 >
48 (
50 )
51 {
52  return field.name();
53 }
54 
55 
56 template
57 <
58  class Type,
59  class GeoMesh,
60  template<class> class PrimitiveField
61 >
63 (
65 )
66 {
67  return field.name();
68 }
69 
70 
71 template
72 <
73  class Type,
74  template<class> class PrimitiveField
75 >
77 (
79 )
80 {
81  return field.mesh().complete(field.name());
82 }
83 
84 
85 template<class AlphaRhoFieldType, class ... AlphaRhoFieldTypes>
87 (
88  const AlphaRhoFieldType& alphaRhoField,
89  const AlphaRhoFieldTypes& ... alphaRhoFields
90 )
91 {
92  return fieldName(alphaRhoField) + '*' + fieldsName(alphaRhoFields ...);
93 }
94 
95 
96 template<class AlphaRhoFieldType>
98 (
99  const AlphaRhoFieldType& alphaRhoField
100 )
101 {
102  return fieldName(alphaRhoField);
103 }
104 
105 
106 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
107 
108 template
109 <
110  class Type,
111  template<class> class PrimitiveField,
112  template<class> class PrimitiveEqnField
113 >
115 (
118 ) const
119 {
120  return addsSupToField(fieldName(field.name()), fieldName(eqnField.name()));
121 }
122 
123 
124 // ************************************************************************* //
125 
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const GeoMesh & mesh() const
Return mesh.
Generic GeometricField class.
const word & name() const
Return name.
Definition: IOobject.H:307
virtual bool addsSupToField(const word &fieldName, const word &eqnFieldName) const =0
Return true if the LagrangianModel adds a source term to the.
static word fieldsName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the product of the fields associated with a.
static word fieldName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the field associated with a source term.
A class for handling words, derived from string.
Definition: word.H:63