CarrierEqn.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::CarrierEqn
26 
27 Description
28  Class to store the coefficients of a term in a carrier equation
29 
30 SourceFiles
31  CarrierEqn.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef CarrierEqn_H
36 #define CarrierEqn_H
37 
38 #include "CarrierCoeff.H"
39 #include "LagrangianEqn.H"
40 #include "fvMatrix.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class CarrierEqn Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
52 class CarrierEqn
53 {
54 public:
55 
56  // Public Data
57 
58  //- Reference to the field
59  const VolField<Type>& psi;
60 
61  //- Explicit coefficient
63 
64  //- Implicit coefficient
66 
67 
68  // Constructors
69 
70  //- Construct from a reference to the field
72 
73 
74  // Member Functions
75 
76  //- Clear the coefficient values
77  void clear();
78 
79 
80  // Member Operators
81 
82  //- Addition assignment
83  void operator+=(const LagrangianEqn<Type>& lEqn);
84 
85  //- Subtraction assignment
86  void operator-=(const LagrangianEqn<Type>& lEqn);
87 };
88 
89 
90 //- Add to a finite-volume equation
91 template<class Type>
92 void operator+=(fvMatrix<Type>& fvEqn, const CarrierEqn<Type>& cEqn);
93 
94 //- Subtract from a finite-volume equation
95 template<class Type>
96 void operator-=(fvMatrix<Type>& fvEqn, const CarrierEqn<Type>& cEqn);
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 } // End namespace Foam
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 #ifdef NoRepository
105  #include "CarrierEqn.C"
106 #endif
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #endif
111 
112 // ************************************************************************* //
Class to store the coefficients of a term in a carrier equation.
Definition: CarrierEqn.H:52
CarrierCoeff< scalar, true > Sp
Implicit coefficient.
Definition: CarrierEqn.H:64
void operator+=(const LagrangianEqn< Type > &lEqn)
Addition assignment.
Definition: CarrierEqn.C:52
void operator-=(const LagrangianEqn< Type > &lEqn)
Subtraction assignment.
Definition: CarrierEqn.C:60
const VolField< Type > & psi
Reference to the field.
Definition: CarrierEqn.H:58
CarrierEqn(const VolField< Type > &psi)
Construct from a reference to the field.
Definition: CarrierEqn.C:31
void clear()
Clear the coefficient values.
Definition: CarrierEqn.C:42
CarrierCoeff< Type, false > Su
Explicit coefficient.
Definition: CarrierEqn.H:61
Generic GeometricField class.
This class stores the coefficients of a Lagrangian equation, and facilitates solving that equation an...
Definition: LagrangianEqn.H:56
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Namespace for OpenFOAM.
void operator+=(fvMatrix< Type > &fvEqn, const CarrierEqn< Type > &cEqn)
Add to a finite-volume equation.
Definition: CarrierEqn.C:71
void operator-=(fvMatrix< Type > &fvEqn, const CarrierEqn< Type > &cEqn)
Subtract from a finite-volume equation.
Definition: CarrierEqn.C:94