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/>.
28 Reacting, 1-D pyrolysis model
33 \*---------------------------------------------------------------------------*/
35 #ifndef reactingOneDim_H
36 #define reactingOneDim_H
38 #include "pyrolysisModel.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace regionModels
46 namespace pyrolysisModels
50 /*---------------------------------------------------------------------------*\
51 Class reactingOneDim Declaration
52 \*---------------------------------------------------------------------------*/
60 // Private member functions
62 //- Disallow default bitwise copy construct
63 reactingOneDim(const reactingOneDim&);
65 //- Disallow default bitwise assignment
66 void operator=(const reactingOneDim&);
68 //- Read model controls
69 void readReactingOneDimControls();
76 //- Reference to the solid chemistry model
77 autoPtr<solidChemistryModel> solidChemistry_;
79 //- Reference to solid thermo
80 basicSolidThermo& solidThermo_;
83 // Reference to solid thermo properties
85 //- Absorption coefficient [1/m]
86 const volScalarField& kappa_;
88 //- Thermal conductivity [W/m/K]
89 const volScalarField& K_;
94 //- List of solid components
95 PtrList<volScalarField>& Ys_;
97 // Non-const access to temperature
101 //- Name of the radiative flux in the primary region
102 word primaryRadFluxName_;
105 // Solution parameters
107 //- Number of non-orthogonal correctors
110 //- Maximum diffussivity
113 //- Minimum delta for combustion
114 scalar minimumDelta_;
119 //- Total gas mass flux to the primary region [kg/m2/s]
120 surfaceScalarField phiGas_;
122 //- Sensible enthalpy gas flux [J/m2/s]
123 volScalarField phiHsGas_;
125 //- Heat release [J/s/m3]
126 volScalarField chemistrySh_;
129 // Source term fields
131 //- Coupled region radiative heat flux [W/m2]
132 // Requires user to input mapping info for coupled patches
133 volScalarField QrCoupled_;
135 //- In depth radiative heat flux [W/m2]
141 //- Cumulative lost mass of the condensed phase [kg]
142 dimensionedScalar lostSolidMass_;
144 //- Cumulative mass generation of the gas phase [kg]
145 dimensionedScalar addedGasMass_;
147 //- Total mass gas flux at the pyrolysing walls [kg/s]
148 scalar totalGasMassFlux_;
150 //- Total heat release rate [J/s]
151 dimensionedScalar totalHeatRR_;
154 // Protected member functions
156 //- Read control parameters
159 //- Read control parameters from dict
160 bool read(const dictionary& dict);
165 //- Update/move mesh based on change in mass
166 void updateMesh(const scalarField& mass0);
168 //- Update radiative flux in pyrolysis region
171 //- Update enthalpy flux for pyrolysis gases
175 void calculateMassTransfer();
180 //- Solve continuity equation
181 void solveContinuity();
186 //- Solve solid species mass conservation
187 void solveSpeciesMass();
192 //- Runtime type information
193 TypeName("reactingOneDim");
198 //- Construct from type name and mesh
199 reactingOneDim(const word& modelType, const fvMesh& mesh);
201 //- Construct from type name, mesh and dictionary
204 const word& modelType,
206 const dictionary& dict
211 virtual ~reactingOneDim();
220 //- Return density [kg/m3]
221 virtual const volScalarField& rho() const;
223 //- Return const temperature [K]
224 virtual const volScalarField& T() const;
226 //- Return specific heat capacity [J/kg/K]
227 virtual const tmp<volScalarField> Cp() const;
229 //- Return the region absorptivity [1/m]
230 virtual const volScalarField& kappa() const;
232 //- Return the region thermal conductivity [W/m/k]
233 virtual const volScalarField& K() const;
235 //- Return the total gas mass flux to primary region [kg/m2/s]
236 virtual const surfaceScalarField& phiGas() const;
239 // Solution parameters
241 //- Return the number of non-orthogonal correctors
242 inline label nNonOrthCorr() const;
244 //- Return max diffusivity allowed in the solid
245 virtual scalar maxDiff() const;
250 //- External hook to add mass to the primary region
251 virtual scalar addMassSources
253 const label patchI, // patchI on primary region
254 const label faceI // faceI of patchI
257 //- Mean diffusion number of the solid region
258 virtual scalar solidRegionDiffNo() const;
261 // Source fields (read/write access)
263 //- In depth radiative heat flux
264 inline const volScalarField& Qr() const;
269 //- Pre-evolve region
270 virtual void preEvolveRegion();
272 //- Evolve the pyrolysis equations
273 virtual void evolveRegion();
278 //- Provide some feedback
279 virtual void info() const;
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285 } // End namespace pyrolysisModels
286 } // End namespace regionModels
287 } // End namespace Foam
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 #include "reactingOneDimI.H"
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297 // ************************************************************************* //