initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / cfdTools / general / porousMedia / porousZones.H
blob0d9dd2bd9906eb62f7f6e582bad92eba08dea910
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::porousZones
28 Description
29     A centralized porousZone collection.
31     Container class for a set of porousZones with the porousZone member
32     functions implemented to loop over the functions for each porousZone.
34     The input file @c constant/porousZone is implemented as
35     IOPtrList\<porousZone\> and contains the following type of data:
37     @verbatim
38     1
39     (
40     cat1
41     {
42         coordinateSystem    system_10;
43         porosity    0.781;
44         Darcy
45         {
46             d   d [0 -2 0 0 0]  (-1000 -1000 0.50753e+08);
47             f   f [0 -1 0 0 0]  (-1000 -1000 12.83);
48         }
49     }
50     )
51     @endverbatim
53 SourceFiles
54     porousZones.C
56 \*---------------------------------------------------------------------------*/
58 #ifndef porousZones_H
59 #define porousZones_H
61 #include "porousZone.H"
62 #include "IOPtrList.H"
64 #include "volFieldsFwd.H"
65 #include "fvMatrix.H"
66 #include "oneField.H"
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 namespace Foam
74 /*---------------------------------------------------------------------------*\
75                            Class porousZones Declaration
76 \*---------------------------------------------------------------------------*/
78 class porousZones
80     public IOPtrList<porousZone>
82     // Private data
84         //- Reference to the finite volume mesh this zone is part of
85         const fvMesh& mesh_;
87     // Private Member Functions
89         //- Disallow default bitwise copy construct
90         porousZones(const porousZones&);
92         //- Disallow default bitwise assignment
93         void operator=(const porousZones&);
96         //- modify time derivative elements
97         template<class Type>
98         void modifyDdt(fvMatrix<Type>&) const;
100 public:
102     // Constructors
104         //- Construct from fvMesh
105         //  with automatically constructed coordinate systems list
106         porousZones(const fvMesh&);
109     // Member Functions
111         //- mirror fvm::ddt with porosity
112         template<class Type>
113         tmp<fvMatrix<Type> > ddt
114         (
115             GeometricField<Type, fvPatchField, volMesh>&
116         );
118         //- mirror fvm::ddt with porosity
119         template<class Type>
120         tmp<fvMatrix<Type> > ddt
121         (
122             const oneField&,
123             GeometricField<Type, fvPatchField, volMesh>&
124         );
126         //- mirror fvm::ddt with porosity
127         template<class Type>
128         tmp<fvMatrix<Type> > ddt
129         (
130             const dimensionedScalar&,
131             GeometricField<Type, fvPatchField, volMesh>&
132         );
134         //- mirror fvm::ddt with porosity
135         template<class Type>
136         tmp<fvMatrix<Type> > ddt
137         (
138             const volScalarField&,
139             GeometricField<Type, fvPatchField, volMesh>&
140         );
142         //- Add the viscous and inertial resistance force contribution
143         //  to the momentum equation
144         void addResistance(fvVectorMatrix& UEqn) const;
146         //- Add the viscous and inertial resistance force contribution
147         //  to the tensorial diagonal
148         void addResistance
149         (
150             const fvVectorMatrix& UEqn,
151             volTensorField& AU
152         ) const;
154         //- read modified data
155         virtual bool readData(Istream&);
157         //- write data
158         bool writeData(Ostream&, bool subDict = true) const;
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 #ifdef NoRepository
169 #   include "porousZonesTemplates.C"
170 #endif
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #endif
176 // ************************************************************************* //