Loading...
Searching...
No Matches
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-2025 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.
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 store | Register external field 'pExt' | bool | no | false
58 \endtable
59
60 The inherited entries are elaborated in:
61 - \link faOption.H \endlink
62 - \link faceSetOption.H \endlink
63
64See also
65 - Foam::PatchFunction1Types
66
67SourceFiles
68 externalFileSource.C
69
70\*---------------------------------------------------------------------------*/
71
72#ifndef Foam_fa_externalFileSource_H
73#define Foam_fa_externalFileSource_H
74
75#include "areaFields.H"
76#include "MappedFile.H"
77#include "faceSetOption.H"
78
79// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80
81namespace Foam
82{
83namespace fa
84{
85
86/*---------------------------------------------------------------------------*\
87 Class externalFileSource Declaration
88\*---------------------------------------------------------------------------*/
89
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 DimensionedField<scalar, areaMesh> pExt_;
104
105 //- Current time index (used for updating)
106 label curTimeIndex_;
107
108 //- Mapped data from file
109 PtrList<PatchFunction1Types::MappedFile<scalar>> mapping_;
110
111
112 // Private Member Functions
113
114 //- Update the pExt_ mapping
115 void updateMapping();
116
117
118public:
119
120 //- Runtime type information
121 TypeName("externalFileSource");
122
123
124 // Constructors
125
126 //- Construct from explicit source name and mesh
128 (
129 const word& sourceName,
130 const word& modelType,
131 const dictionary& dict,
132 const fvMesh& mesh,
134 const word& defaultAreaName = word()
135 );
136
137 //- No copy construct
138 externalFileSource(const externalFileSource&) = delete;
139
140 //- No copy assignment
141 void operator=(const externalFileSource&) = delete;
142
143
144 //- Destructor
145 virtual ~externalFileSource() = default;
146
147
148 // Member Functions
149
150 // Evaluation
151
152 //- Add explicit contribution to compressible momentum equation
153 virtual void addSup
154 (
155 const areaScalarField& rho,
156 faMatrix<scalar>& eqn,
157 const label fieldi
158 );
159
161 // IO
162
163 //- Read source dictionary
164 virtual bool read(const dictionary& dict);
165};
166
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170} // End namespace fa
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition faMatrix.H:108
Applies sources on a specified field within a specified region by using an external table file.
externalFileSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
Construct from explicit source name and mesh.
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 fvMesh & mesh() const noexcept
Return const access to the volume mesh.
Definition faOption.H:385
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for finite-area.
Definition limitHeight.C:30
Namespace for OpenFOAM.
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68