fvmSup.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 InNamespace
28  Foam::fvm
29 
30 Description
31  Calculate the finiteVolume matrix for implicit and explicit sources.
32 
33 SourceFiles
34  fvmSup.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_fvmSup_H
39 #define Foam_fvmSup_H
40 
41 #include "volFieldsFwd.H"
42 #include "fvMatrix.H"
43 #include "zeroField.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Namespace fvm Functions
52 \*---------------------------------------------------------------------------*/
53 
54 namespace fvm
55 {
56  // Explicit source
57 
58  //- A no-op source
59  template<class Type>
61  (
62  const Foam::zero,
63  const GeometricField<Type, fvPatchField, volMesh>&
64  );
65 
66  //- A uniform source (no-op for small values)
67  template<class Type>
68  tmp<fvMatrix<Type>> Su
69  (
70  const dimensioned<Type>& su,
71  const GeometricField<Type, fvPatchField, volMesh>&
72  );
73 
74  template<class Type>
75  tmp<fvMatrix<Type>> Su
76  (
77  const DimensionedField<Type, volMesh>& su,
78  const GeometricField<Type, fvPatchField, volMesh>&
79  );
80 
81  template<class Type>
82  tmp<fvMatrix<Type>> Su
83  (
84  const tmp<DimensionedField<Type, volMesh>>&,
85  const GeometricField<Type, fvPatchField, volMesh>&
86  );
87 
88  template<class Type>
89  tmp<fvMatrix<Type>> Su
90  (
91  const tmp<GeometricField<Type, fvPatchField, volMesh>>&,
92  const GeometricField<Type, fvPatchField, volMesh>&
93  );
94 
95 
96  // Implicit source
97 
98  //- A no-op source
99  template<class Type>
100  zeroField Sp
101  (
102  const Foam::zero,
103  const GeometricField<Type, fvPatchField, volMesh>&
104  );
105 
106  //- A uniform source (no-op for small values)
107  template<class Type>
108  tmp<fvMatrix<Type>> Sp
109  (
110  const dimensionedScalar& sp,
111  const GeometricField<Type, fvPatchField, volMesh>&
112  );
113 
114  template<class Type>
115  tmp<fvMatrix<Type>> Sp
116  (
117  const DimensionedField<scalar, volMesh>& sp,
118  const GeometricField<Type, fvPatchField, volMesh>&
119  );
120 
121  template<class Type>
122  tmp<fvMatrix<Type>> Sp
123  (
124  const tmp<DimensionedField<scalar, volMesh>>&,
125  const GeometricField<Type, fvPatchField, volMesh>&
126  );
127 
128  template<class Type>
129  tmp<fvMatrix<Type>> Sp
130  (
131  const tmp<volScalarField>&,
132  const GeometricField<Type, fvPatchField, volMesh>&
133  );
134 
135 
136  // Implicit/Explicit source depending on sign of coefficient
137 
138  //- A no-op source
139  template<class Type>
141  (
142  const Foam::zero,
143  const GeometricField<Type, fvPatchField, volMesh>&
144  );
145 
146  //- A uniform source (no-op for small values)
147  template<class Type>
148  tmp<fvMatrix<Type>> SuSp
149  (
150  const dimensionedScalar& susp,
151  const GeometricField<Type, fvPatchField, volMesh>&
152  );
153 
154  template<class Type>
155  tmp<fvMatrix<Type>> SuSp
156  (
157  const DimensionedField<scalar, volMesh>& susp,
158  const GeometricField<Type, fvPatchField, volMesh>&
159  );
160 
161  template<class Type>
162  tmp<fvMatrix<Type>> SuSp
163  (
164  const tmp<DimensionedField<scalar, volMesh>>&,
165  const GeometricField<Type, fvPatchField, volMesh>&
166  );
167 
168  template<class Type>
169  tmp<fvMatrix<Type>> SuSp
170  (
171  const tmp<volScalarField>&,
172  const GeometricField<Type, fvPatchField, volMesh>&
173  );
174 }
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #ifdef NoRepository
184  #include "fvmSup.C"
185 #endif
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
Forwards and collection of common volume field types.
vtkSmartPointer< vtkFloatArray > zeroField(const word &name, const label size)
Create named field initialized to zero.
zeroField Su(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:57
Namespace for OpenFOAM.