OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

cyclicFvPatchField.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-2007 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     cyclicFvPatchField
00027 
00028 Description
00029 
00030 SourceFiles
00031     cyclicFvPatchField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef cyclicFvPatchField_H
00036 #define cyclicFvPatchField_H
00037 
00038 #include "coupledFvPatchField.H"
00039 #include "cyclicLduInterfaceField.H"
00040 #include "cyclicFvPatch.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class cyclicFvPatch Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class Type>
00052 class cyclicFvPatchField
00053 :
00054     public cyclicLduInterfaceField,
00055     public coupledFvPatchField<Type>
00056 {
00057     // Private data
00058 
00059         //- Local reference cast into the cyclic patch
00060         const cyclicFvPatch& cyclicPatch_;
00061 
00062 
00063     // Private member functions
00064 
00065         //- Return neighbour side field given internal fields
00066         template<class Type2>
00067         tmp<Field<Type2> > neighbourSideField
00068         (
00069             const Field<Type2>&
00070         ) const;
00071 
00072 
00073 public:
00074 
00075     //- Runtime type information
00076     TypeName(cyclicFvPatch::typeName_());
00077 
00078 
00079     // Constructors
00080 
00081         //- Construct from patch and internal field
00082         cyclicFvPatchField
00083         (
00084             const fvPatch&,
00085             const DimensionedField<Type, volMesh>&
00086         );
00087 
00088         //- Construct from patch, internal field and dictionary
00089         cyclicFvPatchField
00090         (
00091             const fvPatch&,
00092             const DimensionedField<Type, volMesh>&,
00093             const dictionary&
00094         );
00095 
00096         //- Construct by mapping given cyclicFvPatchField onto a new patch
00097         cyclicFvPatchField
00098         (
00099             const cyclicFvPatchField<Type>&,
00100             const fvPatch&,
00101             const DimensionedField<Type, volMesh>&,
00102             const fvPatchFieldMapper&
00103         );
00104 
00105         //- Construct as copy
00106         cyclicFvPatchField
00107         (
00108             const cyclicFvPatchField<Type>&
00109         );
00110 
00111         //- Construct and return a clone
00112         virtual tmp<fvPatchField<Type> > clone() const
00113         {
00114             return tmp<fvPatchField<Type> >
00115             (
00116                 new cyclicFvPatchField<Type>(*this)
00117             );
00118         }
00119 
00120         //- Construct as copy setting internal field reference
00121         cyclicFvPatchField
00122         (
00123             const cyclicFvPatchField<Type>&,
00124             const DimensionedField<Type, volMesh>&
00125         );
00126 
00127         //- Construct and return a clone setting internal field reference
00128         virtual tmp<fvPatchField<Type> > clone
00129         (
00130             const DimensionedField<Type, volMesh>& iF
00131         ) const
00132         {
00133             return tmp<fvPatchField<Type> >
00134             (
00135                 new cyclicFvPatchField<Type>(*this, iF)
00136             );
00137         }
00138 
00139 
00140     // Member functions
00141 
00142         // Evaluation functions
00143 
00144             //- Return neighbour coupled given internal cell data
00145             tmp<Field<Type> > patchNeighbourField() const;
00146 
00147             //- Update result field based on interface functionality
00148             virtual void updateInterfaceMatrix
00149             (
00150                 const scalarField& psiInternal,
00151                 scalarField& result,
00152                 const lduMatrix&,
00153                 const scalarField& coeffs,
00154                 const direction cmpt
00155             ) const;
00156 
00157 
00158         //- Cyclic coupled interface functions
00159 
00160             //- Does the patch field perform the transfromation
00161             virtual bool doTransform() const
00162             {
00163                 return !(cyclicPatch_.parallel() || pTraits<Type>::rank == 0);
00164             }
00165 
00166             //- Return face transformation tensor
00167             virtual const tensorField& forwardT() const
00168             {
00169                 return cyclicPatch_.forwardT();
00170             }
00171 
00172             //- Return neighbour-cell transformation tensor
00173             virtual const tensorField& reverseT() const
00174             {
00175                 return cyclicPatch_.reverseT();
00176             }
00177 
00178             //- Return rank of component for transform
00179             virtual int rank() const
00180             {
00181                 return pTraits<Type>::rank;
00182             }
00183 };
00184 
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 } // End namespace Foam
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 #ifdef NoRepository
00193 #   include "cyclicFvPatchField.C"
00194 #endif
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 #endif
00199 
00200 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd