Generalised to support static pressure as well as "pd".
[OpenFOAM-1.5.x.git] / src / finiteVolume / fields / fvPatchFields / derived / fixedFluxPressure / fixedFluxPressureFvPatchScalarField.H
blob54f8fcdcb13e2a9f21483d937363389d6ca3a4aa
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::fixedFluxPressureFvPatchScalarField
28 Description
29     Foam::fixedFluxPressureFvPatchScalarField
31 SourceFiles
32     fixedFluxPressureFvPatchScalarField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef fixedFluxPressureFvPatchScalarFields_H
37 #define fixedFluxPressureFvPatchScalarFields_H
39 #include "fvPatchFields.H"
40 #include "fixedGradientFvPatchFields.H"
41 #include "Switch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class fixedFluxPressureFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 class fixedFluxPressureFvPatchScalarField
54     public fixedGradientFvPatchScalarField
56     // Private data
58         //- Name of the velocity field
59         word UName_;
61         //- Name of the flux transporting the field
62         word phiName_;
64         //- Name of the density field used to normalise the mass flux
65         //  if neccessary
66         word rhoName_;
68         //- Is the pressure adjoint, i.e. has the opposite sign
69         Switch adjoint_;
72 public:
74     //- Runtime type information
75     TypeName("fixedFluxPressure");
78     // Constructors
80         //- Construct from patch and internal field
81         fixedFluxPressureFvPatchScalarField
82         (
83             const fvPatch&,
84             const DimensionedField<scalar, volMesh>&
85         );
87         //- Construct from patch, internal field and dictionary
88         fixedFluxPressureFvPatchScalarField
89         (
90             const fvPatch&,
91             const DimensionedField<scalar, volMesh>&,
92             const dictionary&
93         );
95         //- Construct by mapping given fixedFluxPressureFvPatchScalarField onto
96         //  a new patch
97         fixedFluxPressureFvPatchScalarField
98         (
99             const fixedFluxPressureFvPatchScalarField&,
100             const fvPatch&,
101             const DimensionedField<scalar, volMesh>&,
102             const fvPatchFieldMapper&
103         );
105         //- Construct as copy
106         fixedFluxPressureFvPatchScalarField
107         (
108             const fixedFluxPressureFvPatchScalarField&
109         );
111         //- Construct and return a clone
112         virtual tmp<fvPatchScalarField> clone() const
113         {
114             return tmp<fvPatchScalarField>
115             (
116                 new fixedFluxPressureFvPatchScalarField(*this)
117             );
118         }
120         //- Construct as copy setting internal field reference
121         fixedFluxPressureFvPatchScalarField
122         (
123             const fixedFluxPressureFvPatchScalarField&,
124             const DimensionedField<scalar, volMesh>&
125         );
127         //- Construct and return a clone setting internal field reference
128         virtual tmp<fvPatchScalarField> clone
129         (
130             const DimensionedField<scalar, volMesh>& iF
131         ) const
132         {
133             return tmp<fvPatchScalarField>
134             (
135                 new fixedFluxPressureFvPatchScalarField(*this, iF)
136             );
137         }
140     // Member functions
142         //- Update the coefficients associated with the patch field
143         virtual void updateCoeffs();
145         //- Write
146         virtual void write(Ostream&) const;
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 #endif
158 // ************************************************************************* //