externalFileSource.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) 2019-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::fa::externalFileSource
28
29Group
30 grpFaOptionsSources
31
32Description
33 Applies sources on a specified field within a specified region
34 by using an external table file for compressible flows.
35
36Usage
37 Minimal example by using \c constant/faOptions:
38 \verbatim
39 externalFileSource1
40 {
41 // Mandatory entries (unmodifiable)
42 type externalFileSource;
43 fieldName <fieldName>;
44 tableName <tableFileName.dat>;
45
46 // Mandatory/Optional (inherited) entries
47 ...
48 }
49 \endverbatim
50
51 where the entries mean:
52 \table
53 Property | Description | Type | Reqd | Dflt
54 type | Type name: externalFileSource | word | yes | -
55 fieldName | Name of operand field | word | yes | -
56 tableName | Name of operand table file | word | yes | -
57 \endtable
58
59 The inherited entries are elaborated in:
60 - \link faOption.H \endlink
61 - \link faceSetOption.H \endlink
62
63See also
64 - Foam::PatchFunction1Types
65
66SourceFiles
67 externalFileSource.C
68
69\*---------------------------------------------------------------------------*/
70
71#ifndef fa_externalFileSource_H
72#define fa_externalFileSource_H
73
74#include "faOption.H"
75#include "areaFields.H"
76#include "faceSetOption.H"
77#include "MappedFile.H"
78
79// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80
81namespace Foam
82{
83namespace fa
84{
85
86/*---------------------------------------------------------------------------*\
87 Class externalFileSource Declaration
88\*---------------------------------------------------------------------------*/
89
90class externalFileSource
91:
92 public fa::faceSetOption
93{
94 // Private Data
95
96 //- Name of the field to apply this source
97 word fieldName_;
98
99 //- Name of the table
100 word tableName_;
101
102 //- External pressure field
103 areaScalarField pExt_;
104
105 //- Mapped data from file
106 autoPtr<PatchFunction1Types::MappedFile<scalar>> value_;
107
108 //- Current time index (used for updating)
109 label curTimeIndex_;
110
111
112public:
114 //- Runtime type information
115 TypeName("externalFileSource");
116
117
118 // Constructors
119
120 //- Construct from explicit source name and mesh
122 (
123 const word& sourceName,
124 const word& modelType,
125 const dictionary& dict,
126 const fvPatch& patch
127 );
128
129 //- No copy construct
130 externalFileSource(const externalFileSource&) = delete;
131
132 //- No copy assignment
133 void operator=(const externalFileSource&) = delete;
134
135
136 //- Destructor
137 virtual ~externalFileSource() = default;
139
140 // Member Functions
141
142 // Evaluation
143
144 //- Add explicit contribution to compressible momentum equation
145 virtual void addSup
146 (
147 const areaScalarField& rho,
148 faMatrix<scalar>& eqn,
149 const label fieldi
150 );
151
152
153 // IO
154
155 //- Read source dictionary
156 virtual bool read(const dictionary& dict);
157};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace fa
163} // End namespace Foam
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167#endif
168
169// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition: faMatrix.H:76
Applies sources on a specified field within a specified region by using an external table file for co...
virtual ~externalFileSource()=default
Destructor.
TypeName("externalFileSource")
Runtime type information.
externalFileSource(const externalFileSource &)=delete
No copy construct.
virtual bool read(const dictionary &dict)
Read source dictionary.
void operator=(const externalFileSource &)=delete
No copy assignment.
virtual void addSup(const areaScalarField &rho, faMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible momentum equation.
Intermediate abstract class for handling face-set options for the derived faOptions.
const fvPatch & patch() const noexcept
Return const access to fvPatch.
Definition: faOptionI.H:42
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
Definition: areaFieldsFwd.H:78
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73