CarrierCoeff.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::CarrierCoeff
26 
27 Description
28  Class to store a coefficient of a carrier equation
29 
30 SourceFiles
31  CarrierCoeff.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef CarrierCoeff_H
36 #define CarrierCoeff_H
37 
38 #include "DimensionedField.H"
39 #include "volMesh.H"
40 #include "LagrangianCoeff.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class CarrierCoeff Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type, bool Implicit>
52 class CarrierCoeff
53 {
54  // Private Data
55 
56  //- Reference to the mesh
57  const fvMesh& mesh_;
58 
59  //- Coefficient
61 
62 
63  // Private Member Functions
64 
65  //- Construct the coefficient field for a given Lagrangian field
66  void initialise(const LagrangianSubField<Type>& lField);
67 
68 
69 public:
70 
71  // Constructors
72 
73  //- Construct from a reference to the field
74  template<class PsiType>
76 
77  //- Construct as copy
79 
80  //- Construct as copy or reuse as specified
81  CarrierCoeff(CarrierCoeff<Type, Implicit>& coeff, const bool reuse);
82 
83  //- Move construct
85 
86 
87  // Member Functions
88 
89  //- Determine whether this coefficient has values or not
90  bool valid() const;
91 
92  //- Clear the coefficient values
93  void clear();
94 
95  //- Access the field
96  const DimensionedField<Type, volMesh>& S() const;
97 
98  //- In-place negation
99  void negate();
100 
101 
102  // Member Operators
103 
104  //- Addition assignment
105  void operator+=(const LagrangianCoeff<Type, Implicit>& lCoeff);
106 
107  //- Subtraction assignment
108  void operator-=(const LagrangianCoeff<Type, Implicit>& lCoeff);
109 };
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #ifdef NoRepository
118  #include "CarrierCoeff.C"
119 #endif
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
Class to store a coefficient of a carrier equation.
Definition: CarrierCoeff.H:52
void operator+=(const LagrangianCoeff< Type, Implicit > &lCoeff)
Addition assignment.
Definition: CarrierCoeff.C:137
bool valid() const
Determine whether this coefficient has values or not.
Definition: CarrierCoeff.C:105
CarrierCoeff(const VolField< PsiType > &psi)
Construct from a reference to the field.
Definition: CarrierCoeff.C:62
void negate()
In-place negation.
Definition: CarrierCoeff.C:127
void clear()
Clear the coefficient values.
Definition: CarrierCoeff.C:112
void operator-=(const LagrangianCoeff< Type, Implicit > &lCoeff)
Subtraction assignment.
Definition: CarrierCoeff.C:151
const DimensionedField< Type, volMesh > & S() const
Access the field.
Definition: CarrierCoeff.C:120
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
Class to store a coefficient of a Lagrangian equation.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
const volScalarField & psi
Namespace for OpenFOAM.