1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | 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 engineMassFlowRateInletVelocityFvPatchVectorField
28 Describes an massflow normal vector boundary condition by its magnitude
29 as an integral over its area.
30 The current density is used to correct the velocity.
31 Note: The value is positive inwards
33 Example of the BC specification:
37 type massFlowRateInletVelocity;
38 massFlowRate 0.2; // Mass flow rate [kg/s]
42 * may not work correctly for transonic inlets!
43 * strange behaviour with potentialFoam since the U equation is not solved
46 engineMassFlowRateInletVelocityFvPatchVectorField.C
48 \*---------------------------------------------------------------------------*/
50 #ifndef engineMassFlowRateInletVelocityFvPatchVectorField_H
51 #define engineMassFlowRateInletVelocityFvPatchVectorField_H
53 #include "fixedValueFvPatchFields.H"
54 #include "engineTime.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 /*---------------------------------------------------------------------------*\
61 Class massFlowRateInletVelocityFvPatchField Declaration
62 \*---------------------------------------------------------------------------*/
65 class engineMassFlowRateInletVelocityFvPatchVectorField
67 public fixedValueFvPatchVectorField
71 //- Name of the flux transporting the field
74 //- Name of the density field used to normalize the mass flux
77 fileName timeDataFileName_;
78 autoPtr<graph> timeDataPtr_;
80 const engineTime& engineDB_;
87 //- Runtime type information
88 TypeName("engineMassFlowRateInletVelocity");
93 //- Construct from patch and internal field
94 engineMassFlowRateInletVelocityFvPatchVectorField
97 const DimensionedField<vector, volMesh>&
100 //- Construct from patch, internal field and dictionary
101 engineMassFlowRateInletVelocityFvPatchVectorField
104 const DimensionedField<vector, volMesh>&,
108 //- Construct by mapping given
109 // engineMassFlowRateInletVelocityFvPatchVectorField
111 engineMassFlowRateInletVelocityFvPatchVectorField
113 const engineMassFlowRateInletVelocityFvPatchVectorField&,
115 const DimensionedField<vector, volMesh>&,
116 const fvPatchFieldMapper&
119 //- Construct as copy
120 engineMassFlowRateInletVelocityFvPatchVectorField
122 const engineMassFlowRateInletVelocityFvPatchVectorField&
125 //- Construct and return a clone
126 virtual tmp<fvPatchVectorField> clone() const
128 return tmp<fvPatchVectorField>
130 new engineMassFlowRateInletVelocityFvPatchVectorField(*this)
134 //- Construct as copy setting internal field reference
135 engineMassFlowRateInletVelocityFvPatchVectorField
137 const engineMassFlowRateInletVelocityFvPatchVectorField&,
138 const DimensionedField<vector, volMesh>&
141 //- Construct and return a clone setting internal field reference
142 virtual tmp<fvPatchVectorField> clone
144 const DimensionedField<vector, volMesh>& iF
147 return tmp<fvPatchVectorField>
149 new engineMassFlowRateInletVelocityFvPatchVectorField(*this, iF)
158 //- Return the fluctuation scale
159 const graph& timeData() const
165 //- Return reference to the fluctuation scale to allow adjustment
171 const engineTime& engineDB() const
177 //- Update the coefficients associated with the patch field
178 virtual void updateCoeffs();
181 virtual void write(Ostream&) const;
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 } // End namespace Foam
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 // ************************************************************************* //