FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

mixedFixedValueSlipFvPatchField.H

Go 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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::mixedFixedValueSlipFvPatchField
00026 
00027 Description
00028     A mixed boundary type that blends between fixedValue and slip, as opposed
00029     to the standard mixed condition that blends between fixedValue and
00030     fixedGradient; required to implement maxwellSlipU condition.
00031 
00032 SourceFiles
00033     mixedFixedValueSlipFvPatchField.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef mixedFixedValueSlipFvPatchField_H
00038 #define mixedFixedValueSlipFvPatchField_H
00039 
00040 #include <finiteVolume/transformFvPatchField.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                       Class mixedFixedValueSlipFvPatch Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class mixedFixedValueSlipFvPatchField
00053 :
00054     public transformFvPatchField<Type>
00055 {
00056     // Private data
00057 
00058         //- Value field used for boundary condition
00059         Field<Type> refValue_;
00060 
00061         //- Fraction (0-1) of value used for boundary condition
00062         scalarField valueFraction_;
00063 
00064 public:
00065 
00066     //- Runtime type information
00067     TypeName("mixedFixedValueSlip");
00068 
00069 
00070     // Constructors
00071 
00072         //- Construct from patch and internal field
00073         mixedFixedValueSlipFvPatchField
00074         (
00075             const fvPatch&,
00076             const DimensionedField<Type, volMesh>&
00077         );
00078 
00079         //- Construct from patch, internal field and dictionary
00080         mixedFixedValueSlipFvPatchField
00081         (
00082             const fvPatch&,
00083             const DimensionedField<Type, volMesh>&,
00084             const dictionary&
00085         );
00086 
00087         //- Construct by mapping given mixedFixedValueSlipFvPatchField
00088         //- onto a new patch
00089         mixedFixedValueSlipFvPatchField
00090         (
00091             const mixedFixedValueSlipFvPatchField<Type>&,
00092             const fvPatch&,
00093             const DimensionedField<Type, volMesh>&,
00094             const fvPatchFieldMapper&
00095         );
00096 
00097         //- Construct as copy
00098         mixedFixedValueSlipFvPatchField
00099         (
00100             const mixedFixedValueSlipFvPatchField<Type>&
00101         );
00102 
00103         //- Construct and return a clone
00104         virtual tmp<fvPatchField<Type> > clone() const
00105         {
00106             return tmp<fvPatchField<Type> >
00107             (
00108                 new mixedFixedValueSlipFvPatchField<Type>(*this)
00109             );
00110         }
00111 
00112         //- Construct as copy setting internal field reference
00113         mixedFixedValueSlipFvPatchField
00114         (
00115             const mixedFixedValueSlipFvPatchField<Type>&,
00116             const DimensionedField<Type, volMesh>&
00117         );
00118 
00119         //- Construct and return a clone setting internal field reference
00120         virtual tmp<fvPatchField<Type> > clone
00121         (
00122             const DimensionedField<Type, volMesh>& iF
00123         ) const
00124         {
00125             return tmp<fvPatchField<Type> >
00126             (
00127                 new mixedFixedValueSlipFvPatchField<Type>(*this, iF)
00128             );
00129         }
00130 
00131     // Member functions
00132 
00133         // Mapping functions
00134 
00135             //- Map (and resize as needed) from self given a mapping object
00136             virtual void autoMap
00137             (
00138                 const fvPatchFieldMapper&
00139             );
00140 
00141             //- Reverse map the given fvPatchField onto this fvPatchField
00142             virtual void rmap
00143             (
00144                 const fvPatchField<Type>&,
00145                 const labelList&
00146             );
00147 
00148         // Return defining fields
00149 
00150             virtual Field<Type>& refValue()
00151             {
00152                 return refValue_;
00153             }
00154 
00155             virtual const Field<Type>& refValue() const
00156             {
00157                 return refValue_;
00158             }
00159 
00160             virtual scalarField& valueFraction()
00161             {
00162                 return valueFraction_;
00163             }
00164 
00165             virtual const scalarField& valueFraction() const
00166             {
00167                 return valueFraction_;
00168             }
00169 
00170         // Evaluation functions
00171 
00172             //- Return gradient at boundary
00173             virtual tmp<Field<Type> > snGrad() const;
00174 
00175             //- Evaluate the patch field
00176             virtual void evaluate
00177             (
00178                 const Pstream::commsTypes commsType=Pstream::blocking
00179             );
00180 
00181             //- Return face-gradient transform diagonal
00182             virtual tmp<Field<Type> > snGradTransformDiag() const;
00183 
00184 
00185         //- Write
00186         virtual void write(Ostream&) const;
00187 
00188 
00189     // Member operators
00190 
00191         virtual void operator=(const UList<Type>&) {}
00192 
00193         virtual void operator=(const fvPatchField<Type>&) {}
00194         virtual void operator+=(const fvPatchField<Type>&) {}
00195         virtual void operator-=(const fvPatchField<Type>&) {}
00196         virtual void operator*=(const fvPatchField<scalar>&) {}
00197         virtual void operator/=(const fvPatchField<scalar>&) {}
00198 
00199         virtual void operator+=(const Field<Type>&) {}
00200         virtual void operator-=(const Field<Type>&) {}
00201 
00202         virtual void operator*=(const Field<scalar>&) {}
00203         virtual void operator/=(const Field<scalar>&) {}
00204 
00205         virtual void operator=(const Type&) {}
00206         virtual void operator+=(const Type&) {}
00207         virtual void operator-=(const Type&) {}
00208         virtual void operator*=(const scalar) {}
00209         virtual void operator/=(const scalar) {}
00210 };
00211 
00212 
00213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00214 
00215 } // End namespace Foam
00216 
00217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00218 
00219 #ifdef NoRepository
00220 #   include <rhoCentralBCs/mixedFixedValueSlipFvPatchField.C>
00221 #endif
00222 
00223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00224 
00225 #endif
00226 
00227 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines