1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
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"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace regionModels
47 namespace pyrolysisModels
51 /*---------------------------------------------------------------------------*\
52 Class reactingOneDim Declaration
53 \*---------------------------------------------------------------------------*/
61 // Private member functions
63 //- Disallow default bitwise copy construct
64 reactingOneDim(const reactingOneDim&);
66 //- Disallow default bitwise assignment
67 void operator=(const reactingOneDim&);
74 //- Reference to the solid chemistry model
75 autoPtr<solidChemistryModel> solidChemistry_;
77 //- Reference to solid thermo
78 basicSolidThermo& solidThermo_;
81 // Reference to solid thermo properties
83 //- Absorption coefficient [1/m]
84 const volScalarField& kappa_;
86 //- Thermal conductivity [W/m/K]
87 const volScalarField& K_;
92 //- List of solid components
93 PtrList<volScalarField>& Ys_;
95 // Non-const access to temperature
99 //- Name of the radiative flux in the primary region
100 word primaryRadFluxName_;
103 // Solution parameters
105 //- Number of non-orthogonal correctors
108 //- Maximum diffussivity
111 //- Minimum delta for combustion
112 scalar minimumDelta_;
117 //- Total gas mass flux to the primary region [kg/m2/s]
118 surfaceScalarField phiGas_;
120 //- Sensible enthalpy gas flux [J/m2/s]
121 volScalarField phiHsGas_;
123 //- Heat release [J/s/m3]
124 volScalarField chemistrySh_;
127 // Source term fields
129 //- Coupled region radiative heat flux [W/m2]
130 // Requires user to input mapping info for coupled patches
131 volScalarField QrCoupled_;
133 //- In depth radiative heat flux [W/m2]
139 //- Cumulative lost mass of the condensed phase [kg]
140 dimensionedScalar lostSolidMass_;
142 //- Cumulative mass generation of the gas phase [kg]
143 dimensionedScalar addedGasMass_;
145 //- Total mass gas flux at the pyrolysing walls [kg/s]
146 scalar totalGasMassFlux_;
148 //- Total heat release rate [J/s]
149 dimensionedScalar totalHeatRR_;
152 // Protected member functions
154 //- Read control parameters from dictionary
160 //- Update/move mesh based on change in mass
161 void updateMesh(const scalarField& mass0);
163 //- Update radiative flux in pyrolysis region
166 //- Update enthalpy flux for pyrolysis gases
170 void calculateMassTransfer();
175 //- Solve continuity equation
176 void solveContinuity();
181 //- Solve solid species mass conservation
182 void solveSpeciesMass();
187 //- Runtime type information
188 TypeName("reactingOneDim");
193 //- Construct from type name and mesh
194 reactingOneDim(const word& modelType, const fvMesh& mesh);
198 virtual ~reactingOneDim();
207 //- Return density [kg/m3]
208 virtual const volScalarField& rho() const;
210 //- Return const temperature [K]
211 virtual const volScalarField& T() const;
213 //- Return specific heat capacity [J/kg/K]
214 virtual const tmp<volScalarField> Cp() const;
216 //- Return the region absorptivity [1/m]
217 virtual const volScalarField& kappa() const;
219 //- Return the region thermal conductivity [W/m/k]
220 virtual const volScalarField& K() const;
222 //- Return the total gas mass flux to primary region [kg/m2/s]
223 virtual const surfaceScalarField& phiGas() const;
226 // Solution parameters
228 //- Return the number of non-orthogonal correctors
229 inline label nNonOrthCorr() const;
231 //- Return max diffusivity allowed in the solid
232 virtual scalar maxDiff() const;
237 //- External hook to add mass to the primary region
238 virtual scalar addMassSources
240 const label patchI, // patchI on primary region
241 const label faceI // faceI of patchI
244 //- Mean diffusion number of the solid region
245 virtual scalar solidRegionDiffNo() const;
248 // Source fields (read/write access)
250 //- In depth radiative heat flux
251 inline const volScalarField& Qr() const;
256 //- Pre-evolve region
257 virtual void preEvolveRegion();
259 //- Evolve the pyrolysis equations
260 virtual void evolveRegion();
265 //- Provide some feedback
266 virtual void info() const;
270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
272 } // End namespace pyrolysisModels
273 } // End namespace regionModels
274 } // End namespace Foam
276 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
278 #include "reactingOneDimI.H"
280 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 // ************************************************************************* //