1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
34 points // list of points when selectionMode = points
39 volumeMode specific; //absolute
40 fieldData // field data - usage for multiple fields
50 \*---------------------------------------------------------------------------*/
52 #ifndef explicitSource_H
53 #define explicitSource_H
56 #include "volFieldsFwd.H"
57 #include "DimensionedField.H"
58 #include "basicSource.H"
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 /*---------------------------------------------------------------------------*\
66 Class explicitSource Declaration
67 \*---------------------------------------------------------------------------*/
75 //- List of field types
76 HashTable<scalar> scalarFields_;
77 HashTable<vector> vectorFields_;
79 //- Add source to matrix
81 void addSource(fvMatrix<Type>&, const Type&) const;
83 //- Add field names and values to field table for types.
87 HashTable<Type>& fields,
88 const wordList& fieldTypes,
89 const wordList& fieldNames,
90 const dictionary& dict
98 //- Enumeration for volume types
105 //- Word list of volume mode type names
106 static const NamedEnum<volumeModeType, 2> volumeModeTypeNames_;
113 //- Sub dictionary for time activated explicit sources
114 const dictionary& dict_;
117 volumeModeType volumeMode_;
120 // Protected functions
122 //- Set the local field data
123 void setFieldData(const dictionary& dict);
128 //- Runtime type information
129 TypeName("explicitSource");
134 //- Construct from components
138 const word& modelType,
139 const dictionary& dict,
144 autoPtr<explicitSource> clone() const
148 "autoPtr<explicitSource> clone() const"
150 return autoPtr<explicitSource>(NULL);
159 //- Return const access to the volume mode
160 inline const volumeModeType& volumeMode() const;
165 //- Return access to the volume mode
166 inline volumeModeType& volumeMode();
169 inline const List<point>& points() const;
174 //-Source term to fvMatrix<vector>
175 virtual void addSu(fvMatrix<vector>& UEqn);
177 //-Source term to fvMatrix<scalar>
178 virtual void addSu(fvMatrix<scalar>& UEqn);
183 //- Write the source properties
184 virtual void writeData(Ostream&) const;
186 //- Read fieldData in sub-dictionary
187 virtual bool read(const dictionary& dict);
190 friend Ostream& operator<<
193 const explicitSource& source
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 } // End namespace Foam
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 #include "explicitSourceIO.C"
205 #include "explicitSourceI.H"
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 # include "explicitSourceTemplates.C"
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 // ************************************************************************* //