1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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/>.
25 Foam::turbulentInletFvPatchField
28 Generate a fluctuating inlet condition by adding a random component
29 to a reference (mean) field.
34 RMS fluctuation, provided as the fraction of the mean field.
36 temporal correlation factor;
37 the fraction of the new random component added to the previous
38 time-step (defaults to 0.1).
41 turbulentInletFvPatchField.C
43 \*---------------------------------------------------------------------------*/
45 #ifndef turbulentInletFvPatchField_H
46 #define turbulentInletFvPatchField_H
49 #include "fixedValueFvPatchFields.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 /*---------------------------------------------------------------------------*\
57 Class turbulentInletFvPatch Declaration
58 \*---------------------------------------------------------------------------*/
61 class turbulentInletFvPatchField
63 public fixedValueFvPatchField<Type>
68 Type fluctuationScale_;
69 Field<Type> referenceField_;
76 //- Runtime type information
77 TypeName("turbulentInlet");
82 //- Construct from patch and internal field
83 turbulentInletFvPatchField
86 const DimensionedField<Type, volMesh>&
89 //- Construct from patch, internal field and dictionary
90 turbulentInletFvPatchField
93 const DimensionedField<Type, volMesh>&,
97 //- Construct by mapping given turbulentInletFvPatchField
99 turbulentInletFvPatchField
101 const turbulentInletFvPatchField<Type>&,
103 const DimensionedField<Type, volMesh>&,
104 const fvPatchFieldMapper&
107 //- Construct as copy
108 turbulentInletFvPatchField
110 const turbulentInletFvPatchField<Type>&
113 //- Construct and return a clone
114 virtual tmp<fvPatchField<Type> > clone() const
116 return tmp<fvPatchField<Type> >
118 new turbulentInletFvPatchField<Type>(*this)
122 //- Construct as copy setting internal field reference
123 turbulentInletFvPatchField
125 const turbulentInletFvPatchField<Type>&,
126 const DimensionedField<Type, volMesh>&
129 //- Construct and return a clone setting internal field reference
130 virtual tmp<fvPatchField<Type> > clone
132 const DimensionedField<Type, volMesh>& iF
135 return tmp<fvPatchField<Type> >
137 new turbulentInletFvPatchField<Type>(*this, iF)
146 //- Return the fluctuation scale
147 const Type& fluctuationScale() const
149 return fluctuationScale_;
152 //- Return reference to the fluctuation scale to allow adjustment
153 Type& fluctuationScale()
155 return fluctuationScale_;
158 //- Return the reference field
159 const Field<Type>& referenceField() const
161 return referenceField_;
164 //- Return reference to the reference field to allow adjustment
165 Field<Type>& referenceField()
167 return referenceField_;
173 //- Map (and resize as needed) from self given a mapping object
176 const fvPatchFieldMapper&
179 //- Reverse map the given fvPatchField onto this fvPatchField
182 const fvPatchField<Type>&,
187 // Evaluation functions
189 //- Update the coefficients associated with the patch field
190 virtual void updateCoeffs();
194 virtual void write(Ostream&) const;
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 } // End namespace Foam
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 # include "turbulentInletFvPatchField.C"
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // ************************************************************************* //