Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / finiteVolume / fields / fvPatchFields / derived / turbulentIntensityKineticEnergyInlet / turbulentIntensityKineticEnergyInletFvPatchScalarField.H
blobd94e00fa047befbb100240ebd9385086ca805c5f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField
27 Description
28     Calculate turbulent kinetic energy from the intensity provided as a
29     fraction of the mean velocity
31     Example of the boundary condition specification:
32     \verbatim
33         inlet
34         {
35             type        turbulentIntensityKineticEnergyInlet;
36             U           U;              // name of velocity field
37             intensity   0.05;           // 5% turbulence
38             value       uniform 1;      // placeholder
39         }
40     \endverbatim
42 SourceFiles
43     turbulentIntensityKineticEnergyInletFvPatchScalarField.C
45 \*---------------------------------------------------------------------------*/
47 #ifndef turbulentIntensityKineticEnergyInletFvPatchScalarField_H
48 #define turbulentIntensityKineticEnergyInletFvPatchScalarField_H
50 #include "inletOutletFvPatchFields.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 namespace Foam
57 /*---------------------------------------------------------------------------*\
58           Class turbulentIntensityKineticEnergyInletFvPatch Declaration
59 \*---------------------------------------------------------------------------*/
61 class turbulentIntensityKineticEnergyInletFvPatchScalarField
63     public inletOutletFvPatchScalarField
65     // Private data
67         //- Turbulent intensity as fraction of mean velocity
68         scalar intensity_;
70         //- Name of the velocity field
71         word UName_;
73         //- Name of the flux field
74         word phiName_;
77 public:
79     //- Runtime type information
80     TypeName("turbulentIntensityKineticEnergyInlet");
83     // Constructors
85         //- Construct from patch and internal field
86         turbulentIntensityKineticEnergyInletFvPatchScalarField
87         (
88             const fvPatch&,
89             const DimensionedField<scalar, volMesh>&
90         );
92         //- Construct from patch, internal field and dictionary
93         turbulentIntensityKineticEnergyInletFvPatchScalarField
94         (
95             const fvPatch&,
96             const DimensionedField<scalar, volMesh>&,
97             const dictionary&
98         );
100         //- Construct by mapping given
101         //  turbulentIntensityKineticEnergyInletFvPatchScalarField
102         //  onto a new patch
103         turbulentIntensityKineticEnergyInletFvPatchScalarField
104         (
105             const turbulentIntensityKineticEnergyInletFvPatchScalarField&,
106             const fvPatch&,
107             const DimensionedField<scalar, volMesh>&,
108             const fvPatchFieldMapper&
109         );
111         //- Construct as copy
112         turbulentIntensityKineticEnergyInletFvPatchScalarField
113         (
114             const turbulentIntensityKineticEnergyInletFvPatchScalarField&
115         );
117         //- Construct and return a clone
118         virtual tmp<fvPatchScalarField> clone() const
119         {
120             return tmp<fvPatchScalarField>
121             (
122                 new turbulentIntensityKineticEnergyInletFvPatchScalarField
123                 (
124                     *this
125                 )
126             );
127         }
129         //- Construct as copy setting internal field reference
130         turbulentIntensityKineticEnergyInletFvPatchScalarField
131         (
132             const turbulentIntensityKineticEnergyInletFvPatchScalarField&,
133             const DimensionedField<scalar, volMesh>&
134         );
136         //- Construct and return a clone setting internal field reference
137         virtual tmp<fvPatchScalarField> clone
138         (
139             const DimensionedField<scalar, volMesh>& iF
140         ) const
141         {
142             return tmp<fvPatchScalarField>
143             (
144                 new turbulentIntensityKineticEnergyInletFvPatchScalarField
145                 (
146                     *this,
147                     iF
148                 )
149             );
150         }
153     // Member functions
155         //- Update the coefficients associated with the patch field
156         virtual void updateCoeffs();
158         //- Write
159         virtual void write(Ostream&) const;
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #endif
171 // ************************************************************************* //