Advertisement
Guest User

turbulentVFVel .H file

a guest
Jan 30th, 2015
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.33 KB | None | 0 0
  1. /*---------------------------------------------------------------------------*\
  2.   =========                 |
  3.   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
  4.    \\    /   O peration     |
  5.     \\  /    A nd           | Copyright held by original author
  6.      \\/     M anipulation  |
  7. -------------------------------------------------------------------------------
  8. License
  9.     This file is part of OpenFOAM.
  10.  
  11.     OpenFOAM 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 2 of the License, or (at your
  14.     option) any later version.
  15.  
  16.     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
  17.     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  18.     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  19.     for more details.
  20.  
  21.     You should have received a copy of the GNU General Public License
  22.     along with OpenFOAM; if not, write to the Free Software Foundation,
  23.     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  24.  
  25. Class
  26.     turbulentVolumeFlowVelocityFvPatchVectorField
  27.  
  28. Description
  29.     Boundary condition specifies a turbulentVolumeFlow velocity inlet profile
  30.     (fixed value), given maximum velocity value (peak of the parabola),
  31.     flow direction n and direction of the turbulentVolumeFlow coordinate y
  32.  
  33. SourceFiles
  34.     turbulentVolumeFlowVelocityFvPatchVectorField.C
  35.  
  36. \*---------------------------------------------------------------------------*/
  37.  
  38. #ifndef turbulentVolumeFlowVelocityFvPatchVectorField_H
  39. #define turbulentVolumeFlowVelocityFvPatchVectorField_H
  40.  
  41. #include "fvPatchFields.H"
  42. #include "fixedValueFvPatchFields.H"
  43.  
  44. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  45.  
  46. namespace Foam
  47. {
  48.  
  49. /*---------------------------------------------------------------------------*\
  50.               Class turbulentVolumeFlowVelocityFvPatchField Declaration
  51. \*---------------------------------------------------------------------------*/
  52.  
  53. class turbulentVolumeFlowVelocityFvPatchVectorField
  54. :
  55.     public fixedValueFvPatchVectorField
  56. {
  57.     // Private data
  58.  
  59.         //- Measured integral volumetric flow rate
  60.         scalar volumeFlowRate_;
  61.  
  62.         //- Power law coefficient
  63.         scalar nPower_;
  64.  
  65.         //- Flow direction
  66.         vector n_;
  67.  
  68.         //- Direction of the y-coordinate
  69.         vector y_;
  70.  
  71.  
  72. public:
  73.  
  74.     //- Runtime type information
  75.     TypeName("turbulentVolumeFlowVelocity");
  76.  
  77.  
  78.     // Constructors
  79.  
  80.         //- Construct from patch and internal field
  81.         turbulentVolumeFlowVelocityFvPatchVectorField
  82.         (
  83.             const fvPatch&,
  84.             const DimensionedField<vector, volMesh>&
  85.         );
  86.  
  87.         //- Construct from patch, internal field and dictionary
  88.         turbulentVolumeFlowVelocityFvPatchVectorField
  89.         (
  90.             const fvPatch&,
  91.             const DimensionedField<vector, volMesh>&,
  92.             const dictionary&
  93.         );
  94.  
  95.         //- Construct by mapping given turbulentVolumeFlowVelocityFvPatchVectorField
  96.         //  onto a new patch
  97.         turbulentVolumeFlowVelocityFvPatchVectorField
  98.         (
  99.             const turbulentVolumeFlowVelocityFvPatchVectorField&,
  100.             const fvPatch&,
  101.             const DimensionedField<vector, volMesh>&,
  102.             const fvPatchFieldMapper&
  103.         );
  104.  
  105.         //- Construct as copy
  106.         turbulentVolumeFlowVelocityFvPatchVectorField
  107.         (
  108.             const turbulentVolumeFlowVelocityFvPatchVectorField&
  109.         );
  110.  
  111.         //- Construct and return a clone
  112.         virtual tmp<fvPatchVectorField> clone() const
  113.         {
  114.             return tmp<fvPatchVectorField>
  115.             (
  116.                 new turbulentVolumeFlowVelocityFvPatchVectorField(*this)
  117.             );
  118.         }
  119.  
  120.         //- Construct as copy setting internal field reference
  121.         turbulentVolumeFlowVelocityFvPatchVectorField
  122.         (
  123.             const turbulentVolumeFlowVelocityFvPatchVectorField&,
  124.             const DimensionedField<vector, volMesh>&
  125.         );
  126.  
  127.         //- Construct and return a clone setting internal field reference
  128.         virtual tmp<fvPatchVectorField> clone
  129.         (
  130.             const DimensionedField<vector, volMesh>& iF
  131.         ) const
  132.         {
  133.             return tmp<fvPatchVectorField>
  134.             (
  135.                 new turbulentVolumeFlowVelocityFvPatchVectorField(*this, iF)
  136.             );
  137.         }
  138.  
  139.  
  140.     // Member functions
  141.  
  142.         //- Return max value
  143.         scalar& volumeFlowRate()
  144.         {
  145.             return volumeFlowRate_;
  146.         }
  147.         //- Return power law coefficient
  148.         scalar& nPower()
  149.         {
  150.             return nPower_;
  151.         }
  152.  
  153.         //- Return flow direction
  154.         vector& n()
  155.         {
  156.             return n_;
  157.         }
  158.         //- Return y direction
  159.         vector& y()
  160.         {
  161.             return y_;
  162.         }
  163.  
  164.         //- Update coefficients
  165.         virtual void updateCoeffs();
  166.  
  167.         //- Write
  168.         virtual void write(Ostream&) const;
  169. };
  170.  
  171.  
  172. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  173.  
  174. } // End namespace Foam
  175.  
  176. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  177.  
  178. #endif
  179.  
  180. // ************************************************************************* //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement