|
|
|
massFlowRateInletVelocityFvPatchVectorField.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 2006-07 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 massFlowRateInletVelocityFvPatchVectorField 00027 00028 Description 00029 Describes an massflow normal vector boundary condition by its magnitude 00030 as an integral over its area. 00031 The current density is used to correct the velocity. 00032 Note: The value is positive inwards 00033 00034 Example of the BC specification: 00035 00036 inlet 00037 { 00038 type massFlowRateInletVelocity; 00039 massFlowRate 0.2; // Mass flow rate [kg/s] 00040 } 00041 00042 NOTE! 00043 * may not work correctly for transonic inlets! 00044 * strange behaviour with potentialFoam since the U equation is not solved 00045 00046 SourceFiles 00047 massFlowRateInletVelocityFvPatchVectorField.C 00048 00049 \*---------------------------------------------------------------------------*/ 00050 00051 #ifndef massFlowRateInletVelocityFvPatchVectorField_H 00052 #define massFlowRateInletVelocityFvPatchVectorField_H 00053 00054 #include "fixedValueFvPatchFields.H" 00055 00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00057 00058 namespace Foam 00059 { 00060 /*---------------------------------------------------------------------------*\ 00061 Class massFlowRateInletVelocityFvPatch Declaration 00062 \*---------------------------------------------------------------------------*/ 00063 00064 class massFlowRateInletVelocityFvPatchVectorField 00065 : 00066 public fixedValueFvPatchVectorField 00067 { 00068 // Private data 00069 00070 //- Inlet integral mass flow rate 00071 scalar massFlowRate_; 00072 00073 //- Name of the flux transporting the field 00074 word phiName_; 00075 00076 //- Name of the density field used to normalize the mass flux 00077 word rhoName_; 00078 00079 00080 public: 00081 00082 //- Runtime type information 00083 TypeName("massFlowRateInletVelocity"); 00084 00085 00086 // Constructors 00087 00088 //- Construct from patch and internal field 00089 massFlowRateInletVelocityFvPatchVectorField 00090 ( 00091 const fvPatch&, 00092 const DimensionedField<vector, volMesh>& 00093 ); 00094 00095 //- Construct from patch, internal field and dictionary 00096 massFlowRateInletVelocityFvPatchVectorField 00097 ( 00098 const fvPatch&, 00099 const DimensionedField<vector, volMesh>&, 00100 const dictionary& 00101 ); 00102 00103 //- Construct by mapping given 00104 // massFlowRateInletVelocityFvPatchVectorField 00105 // onto a new patch 00106 massFlowRateInletVelocityFvPatchVectorField 00107 ( 00108 const massFlowRateInletVelocityFvPatchVectorField&, 00109 const fvPatch&, 00110 const DimensionedField<vector, volMesh>&, 00111 const fvPatchFieldMapper& 00112 ); 00113 00114 //- Construct as copy 00115 massFlowRateInletVelocityFvPatchVectorField 00116 ( 00117 const massFlowRateInletVelocityFvPatchVectorField& 00118 ); 00119 00120 //- Construct and return a clone 00121 virtual tmp<fvPatchVectorField> clone() const 00122 { 00123 return tmp<fvPatchVectorField> 00124 ( 00125 new massFlowRateInletVelocityFvPatchVectorField(*this) 00126 ); 00127 } 00128 00129 //- Construct as copy setting internal field reference 00130 massFlowRateInletVelocityFvPatchVectorField 00131 ( 00132 const massFlowRateInletVelocityFvPatchVectorField&, 00133 const DimensionedField<vector, volMesh>& 00134 ); 00135 00136 //- Construct and return a clone setting internal field reference 00137 virtual tmp<fvPatchVectorField> clone 00138 ( 00139 const DimensionedField<vector, volMesh>& iF 00140 ) const 00141 { 00142 return tmp<fvPatchVectorField> 00143 ( 00144 new massFlowRateInletVelocityFvPatchVectorField(*this, iF) 00145 ); 00146 } 00147 00148 00149 // Member functions 00150 00151 // Access 00152 00153 //- Return the mass flux 00154 scalar massFlowRate() const 00155 { 00156 return massFlowRate_; 00157 } 00158 00159 //- Return reference to the mass flux to allow adjustment 00160 scalar& massFlowRate() 00161 { 00162 return massFlowRate_; 00163 } 00164 00165 00166 //- Update the coefficients associated with the patch field 00167 virtual void updateCoeffs(); 00168 00169 //- Write 00170 virtual void write(Ostream&) const; 00171 00172 }; 00173 00174 00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00176 00177 } // End namespace Foam 00178 00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00180 00181 #endif 00182 00183 // ************************************************************************* // |