OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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