patchCellsSource.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) 2022 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::patchCellsSource
28 
29 Group
30  grpFvOptionsSources
31 
32 Description
33  Source defined by a boundary condition applied to cells next to patches.
34  This fvOption needs to be used with a \c boundarySourcePatch type of
35  boundary condition (e.g. \c speciesSorption and \c enthalpySorption.)
36 
37 Usage
38  Minimal example by using \c constant/fvOptions:
39  \verbatim
40  <fvOptionName>
41  {
42  // Mandatory entries
43  type patchCellsSource;
44 
45  // Optional entries (one only!)
46  U <word>;
47  he <word>;
48  species <word>;
49 
50  // Inherited entries
51  ...
52  }
53  \endverbatim
54 
55  where the entries mean:
56  \table
57  Property | Description | Type | Reqd | Deflt
58  type | Type name: patchCellsSource | word | yes | -
59  U | Name of operand velocity field | word | choice | -
60  he | Name of operand energy field | word | choice | -
61  species | Name of operand species field | word | choice | -
62  \endtable
63 
64  The inherited entries are elaborated in:
65  - \link fvOption.H \endlink
66 
67 SourceFiles
68  patchCellsSource.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef Foam_fv_patchCellsSource_H
73 #define Foam_fv_patchCellsSource_H
74 
75 #include "fvMesh.H"
76 #include "volFields.H"
77 #include "cellSetOption.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 namespace fv
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class patchCellsSource Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class patchCellsSource
91 :
92  public fv::option
93 {
94  // Private Data
95 
96  //- Current time index (used for updating)
97  label curTimeIndex_;
98 
99  //- Special handling energy field
100  bool isEnergySource_;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("patchCellsSource");
107 
108 
109  // Constructors
110 
111  //- Construct from explicit source name and mesh
113  (
114  const word& sourceName,
115  const word& modelType,
116  const dictionary& dict,
117  const fvMesh& mesh
118  );
119 
120  //- No copy construct
121  patchCellsSource(const patchCellsSource&) = delete;
122 
123  //- No copy assignment
124  void operator=(const patchCellsSource&) = delete;
125 
126 
127  //- Destructor
128  virtual ~patchCellsSource() = default;
129 
130 
131  // Member Functions
132 
133  //- Add explicit contribution to compressible
134  //- (momentum, enthalpy, species) equation
135  virtual void addSup
136  (
137  const volScalarField& rho,
138  fvMatrix<scalar>& eqn,
139  const label fieldi
140  );
141 
142  //- Read source dictionary
143  virtual bool read(const dictionary& dict);
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace fv
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 
155 #endif
156 
157 // ************************************************************************* //
patchCellsSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
dictionary dict
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:30
virtual bool read(const dictionary &dict)
Read source dictionary.
void operator=(const patchCellsSource &)=delete
No copy assignment.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
TypeName("patchCellsSource")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition: word.H:63
labelList fv(nPoints)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:64
virtual ~patchCellsSource()=default
Destructor.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:79
Source defined by a boundary condition applied to cells next to patches. This fvOption needs to be us...
virtual void addSup(const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible (momentum, enthalpy, species) equation. ...
Namespace for OpenFOAM.