Initial commit of NavalHydro package from Wikki to the ShipHydroSIG
[ShipHydroSIG.git] / src / vofDynamicMesh / fvPatchFields / linearWave / linearWaveFvPatchField.H
blob889876059b4ce71977d1da25c91869d5dc62c5c7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     linearWaveFvPatchField
28 Description
30 SourceFiles
31     linearWaveFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef linearWaveFvPatchField_H
36 #define linearWaveFvPatchField_H
38 #include "mixedFvPatchFields.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                       Class linearWaveFvPatchField Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class linearWaveFvPatchField
52     public mixedFvPatchField<Type>
54     // Private data
56         //- Value above threshold
57         Type valueAbove_;
59         //- Value below threshold
60         Type valueBelow_;
62         //- Amplitude
63         scalar amplitude_;
65         //- Period
66         scalar period_;
68         //- Surface normal axis
69         word axis_;
71         //- Current time index
72         label curTimeIndex_;
74         //- Name of flux field
75         word phiName_;
78 public:
80     //- Runtime type information
81     TypeName("linearWave");
84     // Constructors
86         //- Construct from patch and internal field
87         linearWaveFvPatchField
88         (
89             const fvPatch&,
90             const DimensionedField<Type, volMesh>&
91         );
93         //- Construct from patch, internal field and dictionary
94         linearWaveFvPatchField
95         (
96             const fvPatch&,
97             const DimensionedField<Type, volMesh>&,
98             const dictionary&
99         );
101         //- Construct by mapping given linearWaveFvPatchField
102         //  onto a new patch
103         linearWaveFvPatchField
104         (
105             const linearWaveFvPatchField<Type>&,
106             const fvPatch&,
107             const DimensionedField<Type, volMesh>&,
108             const fvPatchFieldMapper&
109         );
111         //- Construct and return a clone
112         virtual tmp<fvPatchField<Type> > clone() const
113         {
114             return tmp<fvPatchField<Type> >
115             (
116                 new linearWaveFvPatchField<Type>(*this)
117             );
118         }
120         //- Construct as copy setting internal field reference
121         linearWaveFvPatchField
122         (
123             const linearWaveFvPatchField<Type>&,
124             const DimensionedField<Type, volMesh>&
125         );
127         //- Construct and return a clone setting internal field reference
128         virtual tmp<fvPatchField<Type> > clone
129         (
130             const DimensionedField<Type, volMesh>& iF
131         ) const
132         {
133             return tmp<fvPatchField<Type> >
134             (
135                 new linearWaveFvPatchField<Type>(*this, iF)
136             );
137         }
140     // Member functions
142         // Evaluation functions
144             //- Update the coefficients associated with the patch field
145             virtual void updateCoeffs();
148         //- Write
149         virtual void write(Ostream&) const;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 #ifdef NoRepository
160 #   include "linearWaveFvPatchField.C"
161 #endif
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 #endif
167 // ************************************************************************* //