1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "pyrolysisModelCollection.H"
27 #include "volFields.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 defineTemplateTypeNameAndDebug
33 Foam::IOPtrList<Foam::regionModels::pyrolysisModels::pyrolysisModel>,
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 namespace regionModels
43 namespace pyrolysisModels
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 pyrolysisModelCollection::pyrolysisModelCollection
53 IOPtrList<pyrolysisModel>
58 mesh.time().constant(),
63 pyrolysisModel::iNew(mesh)
69 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 void pyrolysisModelCollection::preEvolveRegion()
76 this->operator[](i).preEvolveRegion();
81 void pyrolysisModelCollection::evolveRegion()
85 this->operator[](i).evolveRegion();
90 void pyrolysisModelCollection::evolve()
94 pyrolysisModel& pyrolysis = this->operator[](i);
96 if (pyrolysis.active())
98 if (pyrolysis.primaryMesh().changing())
100 FatalErrorIn("pyrolysisModelCollection::evolve()")
101 << "Currently not possible to apply "
102 << pyrolysis.modelName()
103 << " model to moving mesh cases" << nl<< abort(FatalError);
107 pyrolysis.preEvolveRegion();
109 // Increment the region equations up to the new time level
110 pyrolysis.evolveRegion();
112 // Provide some feedback
113 if (pyrolysis.infoOutput())
117 Info<< endl << decrIndent;
124 void pyrolysisModelCollection::info() const
128 this->operator[](i).info();
133 scalar pyrolysisModelCollection::maxDiff() const
135 scalar maxDiff = 0.0;
138 if (maxDiff < this->operator[](i).maxDiff())
140 maxDiff = this->operator[](i).maxDiff();
148 scalar pyrolysisModelCollection::solidRegionDiffNo() const
150 scalar totalDiNum = GREAT;
156 totalDiNum > this->operator[](i).solidRegionDiffNo()
159 totalDiNum = this->operator[](i).solidRegionDiffNo();
167 } // End namespace pyrolysisModels
168 } // End namespace regionModels
169 } // End namespace Foam
171 // ************************************************************************* //