1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "porousZones.H"
28 #include "volFields.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 defineTemplateTypeNameAndDebug(IOPtrList<porousZone>, 0);
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 Foam::porousZones::porousZones
49 mesh.time().constant(),
51 IOobject::READ_IF_PRESENT,
54 porousZone::iNew(mesh)
60 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 void Foam::porousZones::addResistance(fvVectorMatrix& UEqn) const
66 operator[](i).addResistance(UEqn);
71 void Foam::porousZones::addResistance
73 const fvVectorMatrix& UEqn,
77 // addResistance for each zone, delaying the correction of the
78 // precessor BCs of AU
81 operator[](i).addResistance(UEqn, AU, false);
84 // Correct the boundary conditions of the tensorial diagonal to ensure
85 // processor bounaries are correctly handled when AU^-1 is interpolated
86 // for the pressure equation.
87 AU.correctBoundaryConditions();
91 bool Foam::porousZones::readData(Istream& is)
95 IOPtrList<porousZone> newLst
100 mesh_.time().constant(),
104 false // Don't re-register new zones with objectRegistry
106 porousZone::iNew(mesh_)
115 bool Foam::porousZones::writeData(Ostream& os, bool subDict) const
117 // Write size of list
120 // Write beginning of contents
121 os << nl << token::BEGIN_LIST;
123 // Write list contents
127 operator[](i).writeDict(os, subDict);
130 // Write end of contents
131 os << token::END_LIST << nl;
133 // Check state of IOstream
138 // ************************************************************************* //