|
|
|
activeBaffleVelocityFvPatchVectorField.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) 1991-2009 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 Foam::activeBaffleVelocityFvPatchVectorField 00027 00028 Description 00029 Boundary condition that modifies mesh areas based on velocity. 00030 00031 SourceFiles 00032 activeBaffleVelocityFvPatchVectorField.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef activeBaffleVelocityFvPatchVectorField_H 00037 #define activeBaffleVelocityFvPatchVectorField_H 00038 00039 #include "fvPatchFields.H" 00040 #include "fixedValueFvPatchFields.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class activeBaffleVelocityFvPatch Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class activeBaffleVelocityFvPatchVectorField 00052 : 00053 public fixedValueFvPatchVectorField 00054 { 00055 // Private data 00056 00057 //- Name of the pressure field used to calculate the force 00058 // on the active baffle 00059 word pName_; 00060 00061 //- Name of the cyclic patch used when the active baffle is open 00062 word cyclicPatchName_; 00063 00064 //- Index of the cyclic patch used when the active baffle is open 00065 label cyclicPatchLabel_; 00066 00067 //- Orientation (1 or -1) of the active baffle patch. 00068 // Used to change the direction of opening without the need for 00069 // reordering the patch faces 00070 label orientation_; 00071 00072 //- Initial wall patch areas 00073 vectorField initWallSf_; 00074 00075 //- Initial cyclic patch areas 00076 vectorField initCyclicSf_; 00077 00078 //- Current fraction of the active baffle which is open 00079 scalar openFraction_; 00080 00081 //- Time taken for the active baffle to open 00082 scalar openingTime_; 00083 00084 //- Maximum fractional change to the active baffle openness 00085 // per time-step 00086 scalar maxOpenFractionDelta_; 00087 00088 label curTimeIndex_; 00089 00090 00091 public: 00092 00093 //- Runtime type information 00094 TypeName("activeBaffleVelocity"); 00095 00096 00097 // Constructors 00098 00099 //- Construct from patch and internal field 00100 activeBaffleVelocityFvPatchVectorField 00101 ( 00102 const fvPatch&, 00103 const DimensionedField<vector, volMesh>& 00104 ); 00105 00106 //- Construct from patch, internal field and dictionary 00107 activeBaffleVelocityFvPatchVectorField 00108 ( 00109 const fvPatch&, 00110 const DimensionedField<vector, volMesh>&, 00111 const dictionary& 00112 ); 00113 00114 //- Construct by mapping given activeBaffleVelocityFvPatchVectorField 00115 // onto a new patch 00116 activeBaffleVelocityFvPatchVectorField 00117 ( 00118 const activeBaffleVelocityFvPatchVectorField&, 00119 const fvPatch&, 00120 const DimensionedField<vector, volMesh>&, 00121 const fvPatchFieldMapper& 00122 ); 00123 00124 //- Construct as copy 00125 activeBaffleVelocityFvPatchVectorField 00126 ( 00127 const activeBaffleVelocityFvPatchVectorField& 00128 ); 00129 00130 //- Construct and return a clone 00131 virtual tmp<fvPatchVectorField> clone() const 00132 { 00133 return tmp<fvPatchVectorField> 00134 ( 00135 new activeBaffleVelocityFvPatchVectorField(*this) 00136 ); 00137 } 00138 00139 //- Construct as copy setting internal field reference 00140 activeBaffleVelocityFvPatchVectorField 00141 ( 00142 const activeBaffleVelocityFvPatchVectorField&, 00143 const DimensionedField<vector, volMesh>& 00144 ); 00145 00146 //- Construct and return a clone setting internal field reference 00147 virtual tmp<fvPatchVectorField> clone 00148 ( 00149 const DimensionedField<vector, volMesh>& iF 00150 ) const 00151 { 00152 return tmp<fvPatchVectorField> 00153 ( 00154 new activeBaffleVelocityFvPatchVectorField(*this, iF) 00155 ); 00156 } 00157 00158 00159 // Member functions 00160 00161 // Mapping functions 00162 00163 //- Map (and resize as needed) from self given a mapping object 00164 virtual void autoMap 00165 ( 00166 const fvPatchFieldMapper& 00167 ); 00168 00169 //- Reverse map the given fvPatchField onto this fvPatchField 00170 virtual void rmap 00171 ( 00172 const fvPatchVectorField&, 00173 const labelList& 00174 ); 00175 00176 00177 //- Update the coefficients associated with the patch field 00178 virtual void updateCoeffs(); 00179 00180 //- Write 00181 virtual void write(Ostream&) const; 00182 }; 00183 00184 00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00186 00187 } // End namespace Foam 00188 00189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00190 00191 #endif 00192 00193 // ************************************************************************* // |