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 "pyrolysisModel.H"
28 #include "directMappedFieldFvPatchField.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 namespace regionModels
36 namespace pyrolysisModels
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 defineTypeNameAndDebug(pyrolysisModel, 0);
42 defineRunTimeSelectionTable(pyrolysisModel, mesh);
44 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
46 void pyrolysisModel::constructMeshObjects()
48 // construct filmDelta field if coupled to film model
67 const volScalarField& filmDelta = filmDeltaPtr_();
69 bool foundCoupledPatch = false;
70 forAll(filmDelta.boundaryField(), patchI)
72 const fvPatchField<scalar>& fvp = filmDelta.boundaryField()[patchI];
73 if (isA<directMappedFieldFvPatchField<scalar> >(fvp))
75 foundCoupledPatch = true;
80 if (!foundCoupledPatch)
82 WarningIn("void pyrolysisModels::constructMeshObjects()")
83 << "filmCoupled flag set to true, but no "
84 << directMappedFieldFvPatchField<scalar>::typeName
85 << " patches found on " << filmDelta.name() << " field"
92 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
94 bool pyrolysisModel::read()
96 if (regionModel1D::read())
98 filmCoupled_ = readBool(coeffs_.lookup("filmCoupled"));
100 coeffs_.lookupOrDefault<scalar>("reactionDeltaMin", 0.0);
111 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
113 pyrolysisModel::pyrolysisModel(const fvMesh& mesh)
118 reactionDeltaMin_(0.0)
122 pyrolysisModel::pyrolysisModel(const word& modelType, const fvMesh& mesh)
124 regionModel1D(mesh, "pyrolysis", modelType),
127 reactionDeltaMin_(0.0)
132 constructMeshObjects();
137 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
139 pyrolysisModel::~pyrolysisModel()
143 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
145 scalar pyrolysisModel::addMassSources
155 void pyrolysisModel::preEvolveRegion()
159 filmDeltaPtr_->correctBoundaryConditions();
164 scalar pyrolysisModel::solidRegionDiffNo() const
170 scalar pyrolysisModel::maxDiff() const
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 } // End namespace surfaceFilmModels
179 } // End namespace regionModels
180 } // End namespace Foam
182 // ************************************************************************* //