waveVelocity_DimensionedFieldFunction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::DimensionedFieldFunctions::waveVelocity
26 
27 Description
28  Initialises the velocity to that specified by a superposition of wave
29  models. All the wave modelling parameters are obtained from a centrally
30  registered waveSuperposition class.
31 
32 Usage
33  Example of the boundary condition specification:
34  \verbatim
35  internalField
36  {
37  type waveVelocity;
38  libs ("libwaves.so");
39  }
40  \endverbatim
41 
42 See also
43  Foam::waveVelocityFvPatchScalarField
44  Foam::waveSuperposition
45 
46 SourceFiles
47  waveVelocity_DimensionedFieldFunction.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef waveVelocity_DimensionedFieldFunction_H
52 #define waveVelocity_DimensionedFieldFunction_H
53 
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 class fvMesh;
62 
63 namespace DimensionedFieldFunctions
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class waveVelocity Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 class waveVelocity
71 :
72  public DimensionedFieldFunction<DimensionedField<vector, fvMesh>>
73 {
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("waveVelocity");
79 
80 
81  // Constructors
82 
83  //- Construct with dictionary to initialise given field
85  (
86  const dictionary& dict,
88  );
89 
90  //- Construct a copy for the given field
92  (
93  const waveVelocity& dff,
95  );
96 
97  //- Construct and return a clone for the specified field
98  virtual autoPtr
99  <
101  > clone(DimensionedField<vector, fvMesh>& field) const;
102 
103 
104  //- Destructor
105  virtual ~waveVelocity()
106  {}
107 
108 
109  // Member Functions
110 
111  //- Evaluate the function and set the field
112  virtual void evaluate();
113 
114  //- Write data to dictionary stream
115  virtual void write(Ostream& os) const;
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace DimensionedFieldFunctions
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
Base class for run-time selectable internal and patch field initialisation evaluation and update with...
virtual autoPtr< DimensionedFieldFunction< DimensionedField< vector, fvMesh > > > clone() const
Construct and return a clone for the specified field.
Initialises the velocity to that specified by a superposition of wave models. All the wave modelling ...
virtual void evaluate()
Evaluate the function and set the field.
virtual void write(Ostream &os) const
Write data to dictionary stream.
TypeName("waveVelocity")
Runtime type information.
waveVelocity(const dictionary &dict, DimensionedField< vector, fvMesh > &field)
Construct with dictionary to initialise given field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Namespace for OpenFOAM.
dictionary dict