initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / compressible / rhoCentralFoam / BCs / mixedFixedValueSlip / mixedFixedValueSlipFvPatchField.H
blob4bd99fb9f1bdf74b8273efdb8bc7a9fb438c885d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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
25 Class
26     Foam::mixedFixedValueSlipFvPatchField
28 Description
29     A mixed boundary type that blends between fixedValue and slip, as opposed
30     to the standard mixed condition that blends between fixedValue and
31     fixedGradient; required to implement maxwellSlipU condition.
33 SourceFiles
34     mixedFixedValueSlipFvPatchField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef mixedFixedValueSlipFvPatchField_H
39 #define mixedFixedValueSlipFvPatchField_H
41 #include "transformFvPatchField.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                       Class mixedFixedValueSlipFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class Type>
53 class mixedFixedValueSlipFvPatchField
55     public transformFvPatchField<Type>
57     // Private data
59         //- Value field used for boundary condition
60         Field<Type> refValue_;
62         //- Fraction (0-1) of value used for boundary condition
63         scalarField valueFraction_;
65 public:
67     //- Runtime type information
68     TypeName("mixedFixedValueSlip");
71     // Constructors
73         //- Construct from patch and internal field
74         mixedFixedValueSlipFvPatchField
75         (
76             const fvPatch&,
77             const DimensionedField<Type, volMesh>&
78         );
80         //- Construct from patch, internal field and dictionary
81         mixedFixedValueSlipFvPatchField
82         (
83             const fvPatch&,
84             const DimensionedField<Type, volMesh>&,
85             const dictionary&
86         );
88         //- Construct by mapping given mixedFixedValueSlipFvPatchField
89         //- onto a new patch
90         mixedFixedValueSlipFvPatchField
91         (
92             const mixedFixedValueSlipFvPatchField<Type>&,
93             const fvPatch&,
94             const DimensionedField<Type, volMesh>&,
95             const fvPatchFieldMapper&
96         );
98         //- Construct as copy
99         mixedFixedValueSlipFvPatchField
100         (
101             const mixedFixedValueSlipFvPatchField<Type>&
102         );
104         //- Construct and return a clone
105         virtual tmp<fvPatchField<Type> > clone() const
106         {
107             return tmp<fvPatchField<Type> >
108             (
109                 new mixedFixedValueSlipFvPatchField<Type>(*this)
110             );
111         }
113         //- Construct as copy setting internal field reference
114         mixedFixedValueSlipFvPatchField
115         (
116             const mixedFixedValueSlipFvPatchField<Type>&,
117             const DimensionedField<Type, volMesh>&
118         );
120         //- Construct and return a clone setting internal field reference
121         virtual tmp<fvPatchField<Type> > clone
122         (
123             const DimensionedField<Type, volMesh>& iF
124         ) const
125         {
126             return tmp<fvPatchField<Type> >
127             (
128                 new mixedFixedValueSlipFvPatchField<Type>(*this, iF)
129             );
130         }
132     // Member functions
134         // Mapping functions
136             //- Map (and resize as needed) from self given a mapping object
137             virtual void autoMap
138             (
139                 const fvPatchFieldMapper&
140             );
142             //- Reverse map the given fvPatchField onto this fvPatchField
143             virtual void rmap
144             (
145                 const fvPatchField<Type>&,
146                 const labelList&
147             );
149         // Return defining fields
151             virtual Field<Type>& refValue()
152             {
153                 return refValue_;
154             }
156             virtual const Field<Type>& refValue() const
157             {
158                 return refValue_;
159             }
161             virtual scalarField& valueFraction()
162             {
163                 return valueFraction_;
164             }
166             virtual const scalarField& valueFraction() const
167             {
168                 return valueFraction_;
169             }
171         // Evaluation functions
173             //- Return gradient at boundary
174             virtual tmp<Field<Type> > snGrad() const;
176             //- Evaluate the patch field
177             virtual void evaluate
178             (
179                 const Pstream::commsTypes commsType=Pstream::blocking
180             );
182             //- Return face-gradient transform diagonal
183             virtual tmp<Field<Type> > snGradTransformDiag() const;
186         //- Write
187         virtual void write(Ostream&) const;
190     // Member operators
192         virtual void operator=(const UList<Type>&) {}
194         virtual void operator=(const fvPatchField<Type>&) {}
195         virtual void operator+=(const fvPatchField<Type>&) {}
196         virtual void operator-=(const fvPatchField<Type>&) {}
197         virtual void operator*=(const fvPatchField<scalar>&) {}
198         virtual void operator/=(const fvPatchField<scalar>&) {}
200         virtual void operator+=(const Field<Type>&) {}
201         virtual void operator-=(const Field<Type>&) {}
203         virtual void operator*=(const Field<scalar>&) {}
204         virtual void operator/=(const Field<scalar>&) {}
206         virtual void operator=(const Type&) {}
207         virtual void operator+=(const Type&) {}
208         virtual void operator-=(const Type&) {}
209         virtual void operator*=(const scalar) {}
210         virtual void operator/=(const scalar) {}
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 #ifdef NoRepository
221 #   include "mixedFixedValueSlipFvPatchField.C"
222 #endif
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 #endif
228 // ************************************************************************* //