Biomass Gasification Solver Based On Ope

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Biomass gasification solver based on OpenFOAM

Kamil Kwiatkowskia,c,1,∗, Pawel Jan Zukb,1 , Konrad Bajera,c,d , Marek Dudyńskib,e,f


a Institute of Geophysics, Faculty of Physics, University of Warsaw, Pasteura 7, 02-093 Warsaw, Poland
b Institute of Theoretical Physics, Faculty of Physics, University of Warsaw, Hoża 69, 00-681 Warsaw, Poland
c Interdisciplinary Centre for Mathematical and Computational Modelling, University of Warsaw, Pawińskiego 5, 02-106 Warsaw
d University Centre for Environmental Studies, University of Warsaw, Żwirki i Wigury 93, 02-089 Warsaw
e Faculty of Mathematics, Informatics and Mechanics, University of Warsaw, Banacha 2, 02-097, Warsaw
f Modern Technologies and Filtration, Przybyszewskiego 73/77 lok. 8, 01-824 Warsaw, Poland

Abstract
We present biomassGasificationFoam solver and libraries, developed in an open-source C++ code OpenFOAM (Open
Field Operation and Manipulation), for the comprehensive simulation of the physical and thermochemical processes
of biomass gasification and pyrolysis.
The code biomassGasificationFoam integrates models of drying, pyrolysis, gasification, combustion, and complex
flow within a porous biomass. The most important newly implemented functionalities are transient flow in porous
media (with changing porosity), a flexible definition of biomass and its properties, heat and mass transfer between
gases and solids (with a submodel for heat transfer in wood biomass and radiation heating), homogeneous and het-
erogeneous reactions (the heat of reaction is defined directly or based on enthalpies of formations), and customisable
kinetic mechanisms of pyrolysis and gasification. The number of subprocesses and possible paths of chemical re-
actions involved in the thermal conversion of biomass make the flexibility of the developed code the key factor for
successful numerical modelling.
Keywords: openFoam, biomass, pyrolysis, gasification, combustion, porous media, fixed bed

PROGRAM SUMMARY
Manuscript Title: Biomass gasification solver based on OpenFOAM
Authors: Kamil Kwiatkowski, Pawel Jan Zuk, Konrad Bajer, Marek Dudyński
Program Title: biomassGasificationModel
Licensing provisions: GNU General Public Licence (Version 3 of GNU GPL)
Programming language: C++
Computer: Any x86, 64 bit
Operating system: Generic Linux (the instructions consider Ubuntu distribution, tested also on Centos)
Keywords: OpenFOAM, Biomass, Pyrolysis, Gasification, Combustion, Porous Media , Fixed bed
Classification: 12
External routines/libraries: OpenFOAM⃝, R version 2.1.1
Nature of problem: The developed software is a set of libraries and a solver for simulating the thermal conversion of biomass,
including drying, pyrolysis, gasification, and combustion of gas and solid phases. Essentially, the model includes the flow of the
reactive gas mixture and the complex transfer of mass and energy between the gas phase and porous solid phase. The code treats
the biomass as a porous medium with a complex, reactive structure that changes during the process. The model is transient and
enables three-dimensional simulations.
Solution method: The standard finite-volume method is used in the code. A set of governing equations is solved for the gas phase
and porous solid phase, including mass conservation of gaseous species and solid components, momentum conservation in the gas
phase, and equations of energy conservation in both phases.
Running time: From hours to days depending on the mesh size and complexity of the kinetics of the thermal processes.

∗ Pasteura7, 02-093 Warsaw, Poland, Tel. +48 22 55 46 889, Fax. + 48 22 55 46 882


Email address: kamil@igf.fuw.edu.pl (Kamil Kwiatkowski)
URL: www.biomassgasification.eu (Kamil Kwiatkowski)
1 These authors contributed equally to this work.

Preprint submitted to Computer Physics Communications (under review) November 30, 2013
1. Introduction

The term biomass gasification refers to all processes taking place in a gasifier fed with biomass. Biomass gasifica-
tion in a fixed bed, apart from complex mass and energy transfer, involves thermal processes in gas and porous solid
phases [1]:

• evaporation of water embedded in biomass;


• pyrolysis - thermal decomposition that transforms biomass into gases, liquids, and charcoal;

• gasification - a set of reactions for the partial oxidation of charcoal, during which H2 and CO are produced;
• combustion of gases and char - when the amount of O2 is sufficient, char produced in pyrolysis or flammable
pyrolytic gases may be burnt;
Biomass gasification is a comprehensive solution to the many problems of the contemporary energy sector [2].
The types of biomass available for gasification, such as organic wastes, biological residues, and biomass cultivated for
energy production, are virtually unlimited (e.g., [3, 4, 5]). The variety of feedstocks combined with the wide spectrum
of biomass gasification products-syngases, bio-oils, liquid hydrocarbons, and bio-coals makes this technology attrac-
tive for industrial applications [2]. However, the complex nature of gasification, the wide range of available feedstocks
together with an extensive process parameter space, and various types of reactors and possible reaction paths impede
the development of a rigorous treatment of the process from a numerical perspective.
We identified the following challenges in creating a numerical description of the process [6]:
• biomass gasification involves several size and time scales, from the smallest scale of the porosity of a single
biomass particle to the largest scale of the entire industrial reactor; most numerical approaches are focused on
one scale.

• simulations depend on the chemical composition of the biomass and its physical properties, which are time and
process dependent; parameters are typically simplified.
• the kinetics of pyrolysis and gasification are a subject of the on-going research for wide range of materials and
process conditions.
• numerical models for biomass gasification are difficult to validate.

• existing numerical models and databases are not standardised, which impedes cross-checking and comparison.
To meet these challenges, it is important to create a comprehensive computational environment that allows the
newest development in gasification science to be implemented easily and enhances the ability to share models and
their results within the community. We develop a fixed-bed biomass gasification solver based on the well-established
open-source CFD software OpenFOAM [7, 8]. The package, based on a C++ class structure, makes it possible to
override the selected existing libraries and replace them with new implementations.
The process of biomass gasification and its subprocesses are well fitted in the fields that may be simulated with
OpenFOAM [7, 9]. The most advanced solver including thermal processes of solid is fireFoam [9]. It is focused on
modelling fire phenomena, and it is not suitable for modelling biomass gasification. Other solvers, eg. coalChem-
istryFoam, are designed to simulate gasification in fluidised bed. Until now, there has been no solver providing a
description of biomass gasification in a fixed bed. In this work, we present the new solver biomassGasificationFoam
and the complementary library biomassGasificationMedia developed to simulate a wide range of processes and appli-
cations related to the fixed bed biomass gasification. Unlike other numerical approaches (e.g. [10, 11]) the developed
solver is open-source.
In this code, we implemented and integrated the following: transient flow within and around porous medium, heat
and mass transfer between gases and solids around and within porous medium, a flexible definition of biomass and
its thermochemical properties, homogeneous and heterogeneous reactions with the heat of reaction defined directly or
derived from enthalpies of formations, and customisable kinetic mechanisms of pyrolysis and gasification.

2
In the present paper, we first introduce the concept of Dynamic Porosity Field for mesh-independent definition
of biomass-filled region. Next, we present a mathematical model of biomass gasification, discuss the stress source
terms related to thermal processes, and clarify all required material parameters. Transitioning from mathematics into
numerics, we first briefly introduce the general structure and features of OpenFOAM. Then, we present the developed
extensions of OpenFOAM, namely, the solver and related library. Finally, the results of simulations are presented and
compared with the thermogravimetric analysis (TGA) of wood pyrolysis.

2. Mathematical modelling

2.1. Dynamic Porosity Field


The solvers embedded in the standard OpenFOAM distributions for modelling pyrolysis (fireFoam [9]) and chem-
ical reactions (reactingFoam) or gasification in fluidised bed (coalChemistryFoam) are not suitable for fixed bed
biomass gasification simulations. Currently available approaches do not consider the mutual influence of the reacting
flow and gasified solid and volumetric reactions within porous material.
In the first solver, fireFoam, the pyrolysing medium is attached to the main computational domain, where the
gas flow is calculated, and interacts with the gas phase only through the domain boundary conditions. Within this
approach, there is no natural representation of the porous material with the gas flowing through. In fireFoam, pyrolysis
is implemented as surface phenomena, not volumetric, which limits its use. The second solver, reactingFoam, allows
for volumetric reactions but only within the gas phase.
To allow for the volumetric implementation of thermal processes, we propose to introduce porous medium inside
the main computational domain as a volumetric porous field, as shown in Fig. 1. Flow modelling in the proposed
approach follows the so-called Fictitious Domain method of [12], which is a rather special version of the Immerse
Boundary Method [13]. However, in the current approach the equations inside and outside the porous medium are the
same and the boundary has no extra dynamics of its own. The boundary of the porous material is the surface where
the physical parameters present in those equations are discontinuous. In the momentum equation, for example, both
the dArcy term and the usual viscous term of a Newtonian fluid, as in the Navier-Stokes equation, are formally present
on both sides, but the associated coefficients have a jump across the interface.
The porous medium representing biomass is defined by two fields: a scalar (porosity) and a tensor (viscous
resistance). Since the boundary of the porous material has no intrinsic dynamics, there is no need to track its precise
shape, as is the case, for example, with elastic boundaries or with surface tension where local curvature is critically
important. The numerical implementation is then much simplified as each grid cell can be assumed to lie entirely
inside or entirely outside the porous domain.
The fields defining porous medium (volumetric fields of non-zero porosity and viscous resistance) are accessible
and easily modifiable, if necessary, during the calculation.
It must be stressed that the typical approach available in CFD codes introduces porous medium as a separate
zones in the computational domain itself, not as a field inside this domain. Such porous field defined once in the
preprocessing stage cannot be easily modified without changing the entire domain.
The new set of libraries that we implemented introduces thermal, chemical, and radiation properties of such
defined porous field and determines their interactions with the gas phase flowing through and around these fields.
Essentially, the libraries handle biomass as a collection of additional scalar and tensor fields within the computational
domain, e.g., the mass fraction of cellulose, the thermal conductivity of the porous medium, and the absolute density.
The introduction of the Dynamic Porosity Field allows thermal processes to be considered as volumetric phenom-
ena that may take place within the entire porous material depending on local conditions. Treating gasification as a
volumetric process makes it possible to simulate such effects as the front of reactions inside the biomass. It makes
it possible to carry out simulations of chemical and thermal processes inside a porous medium, involving mutual
interactions of the gas and solid. We believe that applications of this approach exceed currently simulated pyrolysis,
combustion, and gasification. It may be potentially applied in modelling any processes involving porous reacting
media, such as catalysis or filtration.

3
Table 1: Notation.

A pre-exponential factor in Arrhenius formulae


a radius of pipe in cylindrical heat transfer model
c specific heat capacity
d pore diameter
D effective diffusion of gas mixture
hs sensible enthalpy
hf enthalpy of formation
hr heat of individual reaction
Hr heat source due to thermal conversion of solid
k thermal conductivity
K tensor of viscous resistance in porous medium
N number of pipes in cylindrical heat transfer model
R mass source term due to reaction with a solid
R̃ total reaction rate
T temperature
Y mass fraction
V volume of computational cell
W molar mass
G radiation energy flux
Greek symbols
α heat transfer coefficient per surface area
ρ bulk density
γ void fraction of biomass, opposite of porosity
Γ gas heat up coefficient
µ dynamic viscosity of gas mixture
ν stoichiometric coefficient for gaseous species
Σ surface area of pores per biomass volume
ξ stoichiometric coefficient for solid species
ω reaction rate of gas-phase combustion
Ω reaction rate for particular processes
δ solid surface optical absorption coefficient
ϵ ratio of the solid surface absorption and emission coefficients
σ Boltzmann constant
Subscripts
a gasification agent (O2 , CO2 , or steam)
c critical, limits the reaction from proceeding
i index of gas species i
k index of biomass component k
s index of the gaseous substrate of the reaction
p index of the gaseous product of the reaction
wall physical wall in the computational domain
sur f surface of porous medium
Superscripts
S solid
G gas
evap evaporation
pyro pyrolysis
gasi f gasification
comb combustion
rad radiation
4
2.2. Governing equations
The three-dimensional, time-dependent mathematical model of the thermal conversion of biomass is based on
conservation laws that are determined for both gaseous and solid phases. The solid is an isotropic or anisotropic
porous medium.
In Fig. 1, we present typical considered processes when one or more biomass fragments (dark grey) is pyrolysing
or gasifying surrounded by inert or reactive gases. The gas phase is composed of a mixture of gases with different
origins: gas that initially filled the reactor, gas supplied to the process, water vapour evaporated while the biomass
is drying, and gases produced during thermal conversion of the solid. The potential liquid phase (water and liquid
hydrocarbons) is considered vapour. This assumption is well satisfied for most of the considered processes. The other
assumptions are as follows:

• In current implementation the movement of porous medium is neglected.

• The moisture is embedded within this porous structure. Moisture released from the solid evaporates immedi-
ately.

• Gas flows according to Darcy’s Law inside the porous medium.


• Radiative transfer from domain walls to solid surfaces is available .

• Chemical reaction and thermal processes may lead to thermal non-equilibrium.


V−V S
• The void fraction γ is determined for the entire domain as γ = V : γ = 0 when only the solid phase is present
and as γ = 1 if there is no solid.
• The porous medium loses mass via homogeneous and heterogeneous processes.

The governing equations for the gaseous phase are as follows: momentum conservation (Eq. 1), continuity (Eq.
2), species conservation (Eq. 3), and energy conservation (Eq. 5). The set of species typically involves water vapour,
CO, CO2 , O2 , N2 , and CH4 . YiG is the mass fraction of the individual species. The solid-phase equations involve
conservation of solid components (Eq. 4) and the energy conservation equation 6). YkS denotes the mass fraction of
particular solid components (i.e., cellulose, hemicellulose, lignin, char, ash), and ρSk represents the density of these
solid ingredients.
All equations are solved in the whole computational domain, however where porosity field is equal zero the
parameters of the solid phase, such as density, heat capacity and thermal conductivity, are zero. This approach is
analogous to the Fictitious Domain Approach by [12].

∂γρG u
+ ∇ · (ρG uu) + ∇p − ∇ · (µ∇u) = (1 − γ)Kµu (1)
∂t
∂γρG ∑ ( evap pyro gasi f
)
+ ∇ · (ρG u) = RGi + RGi + RGi (2)
∂t i
∂γρG YiG ( ) evap pyro gasi f
+ ∇(ρG uYiG ) − ∇ · ρG D∇YiG = ωGi + RGi + RGi + RGi (3)
∂t
∂ S S pyro gasi f comb
(Y ρ ) = RSk + RSk + RSk (4)
∂t k
∂γρG CiG T G ∑ rad
+ u · (∇ρG CiG T G ) − ∇ · ((1 − γ)kG ∇T G ) = ωGi h f Gi − αΣ(T G − T S ) − Γ + S G (5)
∂t i
∂ρS CkS T S rad
− ∇ · (γkS ∇T S ) = αΣ(T G − T S ) + Hr + S S (6)
∂t
The equations 1–6 are presented such that all terms on the left-hand side (LHS) are standard for modelling gas
flow or heat transfer in a solid. On the right-hand side (RHS), we collected all source terms regarding the porous
structure of biomass, chemical reactions, and thermal conversions. The thermal processes are included via the source
5
Figure 1: Exemplary computational domain with porous biomass particles.

terms denoted by reaction rates R with corresponding superscripts (G - gas and S - solid; evap - evaporation, pyro -
pyrolysis, gasif - gasification, comb - combustion) and subscripts (i - gaseous species, k - solid components). Hr is
the total heat source due to solid phase reactions. We briefly describe these additional source terms in Section 2.3.

2.3. Thermal processes


The thermal processes of moisture evaporation, biomass pyrolysis, char gasification, and combustion take place
in the solid phase (RHS of Eqs. 4 and 6). Mass and energy are transferred from the solid to gas phase (RHS of Eqs.
2–5) or vice versa.
The sequence of processes involved in the thermal conversion of biomass, using wood as an example, is presented
in Fig. 2. First, embedded moisture evaporates from the biomass (Fig. 2 (a)); then, volatiles are released from the solid
in the process of pyrolysis (Fig. 2 (b)). In both processes, the material must be heated up and products are formed
without any additional reactants. The porous carbon skeleton remaining from pyrolysis has higher void fractions than
the original biomass char. The char is gasified in the presence of a gasification agent-CO or water vapour (Fig. 2
(d))-or burnt in the presence of an oxidiser (Fig. 2 (d)). The only residual is a small amount of ash composed of
minerals. The general characteristic of all these processes are summarised in Table 2.
In the current implementation of the solver reaction (thermal process), the rate coefficient κ is modelled using
Arrhenius formula [14, 15] as follows:
{ ( )
A exp − TTa , T > T c
κ= (7)
0, T ≤ T c

6
(a) evaporation,

(b) pyrolysis, the simplest scheme,

(c) char gasification with CO,

(d) char combustion.


Figure 2: Sequence of processes included in the thermal conversion of wood.

where A, T a , and T c are the pre-exponential factor, activation temperature, and cut-off temperature, respectively.
For the simplified schemes presented in Fig. 2, the mass source terms (mass changes per volume) due to thermal
processes are as follows:
evap
RGwater vapour = ρS Ymoisture
S
κevap (8)
pyro
RGgas = ρS S
Ydry wood κ
pyro
(9)
gasi f
RSchar = −ρS Ychar
S G
YCO 2
κ pyro (10)
comb
RSchar = −ρS Ychar
S
YOG2 κcomb (11)

It must be stressed that the pyrolysis scheme presented in Fig. 2 (b) is the simplest possible. In general, energy
supplied to the material causes the large hydrocarbon molecules that form the material to crack into smaller molecules.
This mechanism may be formulated in different ways, typically including several intermediate states coupled together
(e.i. [16, 17, 18, 19, 20]. Two examples of more complex schemes are presented in Fig. 3. More details on the kinetics
of pyrolysis and gasification are available in the textbook by Basu [1] and several reviewed papers by di Blasi [17],
Pereira [2], and others. For simplicity, the determination of source terms for complex kinetics is presented separately
in Appendix A. From a modelling perspective, easy introduction of increasingly complex schemes is one of the most
important features of the developed code.

(a) pyrolysis, simple scheme including multiple components,

(b) pyrolysis, complex scheme with intermediate tar and temporary char included.
Figure 3: Examples of two more complex mechanisms of pyrolysis.

2.4. Heat transfer


Kaviany [24] reports that thermal equilibrium between a gas and solid vanishes when chemical reactions or thermal
conversions take place. Our first analysis confirmed that during the thermal conversion of a single thermally thick

7
Table 2: General properties of the thermal processes available in biomassGasificationFoam.
Evaporation Pyrolysis Gasification Gas combustion Solid combustion
Characteristic homogeneous homogeneous heterogeneous homogeneous heterogeneous
endothermic endothermic1 endothermic exothermic exothermic
Gaseous substrates - - CO2 , H2 O CO, H2 , CH4 O2
Solid substrates moisture2 biomass char - char
Gaseous products H2 O complex3 CO, H2 CO2 , H2 O CO2
Solid products - char ash - ash
Intermediate steps no possible no possible no
evap pyro G gasi f G comb
Reaction rate (gases) RGH2 O RGi Ri ωGi RCO2
pyro gasi f comb
Reaction rate (solid) RSk RSk RSk
Type Arrhenius Arrhenius Arrhenius Arrhenius Arrhenius
Details [21, 15] Appendix A.1 Appendix A.3 [22, 23] Appendix A.2
1
Pyrolysis is globally endothermic, but the process is partially exothermic.
2
Moisture embedded within the porous structure of the biomass is treated as solid components.
3
Pyrolytic products are set of gases, CO, CO2 , H2 , CH4 , higher hydrocarbons gases, and liquid hydrocarbons
(tar) that have been vaporised.

wood particle, the gases (both outside and inside the particle) are not in equilibrium with the solid [25] and separate
energy equations for the gas (Eq. 5) and solid (Eq. 6) are required.
The early analysis performed by [14] and repeated recently by [19] suggested that within the microscopic pores
of single wood particles, the gases and solid are in thermal equilibrium. Investigations into the miniaturisation of
heat exchangers independently led to the same conclusion: the assumption of thermal equilibrium is reasonable for
micrometre-sized pores. In such case, the temperatures of the gas (in the pores) and solid phases are always equal
and only one energy equation has to be solved within the computational domain. This assumption is common in the
numerical modelling of pyrolysis and gasification [17, 26]. However, the above-mentioned analysis did not consider
energy fluxes due to chemical reactions.
The validity of the assumption of thermal equilibrium within a single biomass particle is arguable, but there is
agreement that this assumption is not general. A typical situation in which the temperatures of the gases and solids
differ substantially is when entire fixed-bed reactor is modelled. For example, hot pyrolytic gases heat up the fresh,
relatively cold feedstock in an updraft fixed-bed gasifier. Similarly, the temperature of the gas and solid are typically
different in a large-scale heat exchanger. The flexibility of the developed solver requires that a more general non-
equilibrium state be assumed.
The withdrawal of the assumption of thermal equilibrium requires that energy transfer between the gas and solid
is considered within the entire porous medium according to the source term.

αΣ(T G − T S ) (12)

where: α - heat transfer coefficient (per surface), Σ - total surface area of pores per solid state volume. The implemen-
tation of this term will be discussed in Section 5.2.3.
In the current approach, we assume that during thermal conversion, solid substrates take on the temperature of the
porous medium, whereas gaseous products take on the temperature of the surrounding gases inside porous material.
Thus, for the reactions taking place in the solid, the energy Γ is required for heating (or cooling) products to the
temperature of the gas. The source term Γ in Eq. 5 is defined as follows:

Γ = (T G CGp (T G ) − T S CGp (T S )) RGi (13)
i

This effect is independent from the previously mentioned effect of energy exchanging between the phases.

8
2.5. Material properties
The mathematical model (Eqs. 1-6) must be completed with the appropriate definition of the material properties
of gases and biomass. Although extensive research on gas combustion has allowed the thermophysical properties of
the gas phase to be well defined, the properties of solids have not been thoroughly quantified.
First, the initial porosity of the biomass must be defined. To include inhomogeneity of the biomass, it is possible
to define a non-uniform porosity distribution within the modelled material. Together with porosity, the distribution of
the viscous resistance tensor is defined. The custom design numerical tool setPorosity is implemented to define the
complex initial porosity field (see Section 5.1). In this manner, isotropy and different anisotropies may be introduced.
The ability to change the anisotropies during pyrolysis or gasification is prepared for future implementation.
The next primary parameter of the biomass is the absolute density ρ̃S (density of material with no void frac-
tion). The final absolute density is averaged over the absolute densities defined for the solid components: embedded
moisture, lignin, cellulose and hemicellulose, char, and ash:
 
∑ YkS −1
ρ̃ = 
S  
S 
(14)
k
ρ̃k

Based on the absolute density ρ̃S and void fraction γ, the bulk density ρS used in the mathematical modelling is
determined as follows:
ρSk = γρ̃Sk (15)
The thermal properties of the material are the thermal conductivities kS and heat capacities C Sp . These intrinsic param-
eters are also defined for individual solid components. During thermal conversion, the mass fractions of lignocellulose
material decrease, whereas the mass fraction of char increases. As a result, changes in the material parameters accom-
panying thermal conversion are intrinsically included into the model as discussed in Section 5.2.4.
The collection of gas and solid parameters is summarised in Table 3.

Table 3: Summary of thermochemical properties of gases (with an averaged value for the gas mixture) and solid components (with an averaged
value).
Average value Temperature dependence
constant linear power( )
n
(x(T ) = x0 + x1 T ) (x(T ) = x2 TT0 )
Gas phase

Density ρG = i ρGi defined separately

Heat capacity1 cG = i YiG cGi + + +

Thermal conductivity kG = i YiG kG + + +
∑ i
Viscosity µG = i µGi defined separately

Diffusion coefficient DG = i µiD defined separately
Solid phase
∑ S S
(c∑ = kS Y) k c(k∑ + + +
S
Heat capacity )
Y YkS
Thermal conductivity kS = k kkS ρkS / k ρSk
+ + +
k

3. Structure of OpenFOAM

The OpenFOAM (Open Field Operation and Manipulation) Toolbox [7, 8] is a free, open-source C++ package for
solving partial differential equations with the finite-volume method.
This code is widely used in various fields of fluid mechanics and provides comprehensive, standardised libraries
and tools for solving partial differential equations. Due to the flexibility and versatility of the code, it is applied to
model and simulate a broad range of problems, including transport and mixing [27], diffusion [28], reacting flows
[29], porous media [30], shear stresses [31], combustion [32], heat transfer [33], viscoelastic flows [34], multiphase
flows [35, 36], boiling flows [37], free-surface flows [38], biological flows [39], and others [40].
9
Figure 4: Structure of the developed code: the solver and collection of libraries.

OpenFOAM as an object-oriented package is a structured collection of C++ libraries and solvers. The libraries
can be divided into two major categories:
• numerics - provides a vast choice of schemes for equation discretisation, solving, and parallelisation;
• physics - implements mathematical models of simulated physical and chemical phenomena.
The important inheritance of the C++ class structure is the ability to override and replace the existing libraries.
The separate part of the package are solvers, which are executable programs containing algorithms that integrate
selected functionalities of libraries and schedule the calculations in each time step. Each solver is prepared for a
separate class of problems, e.g., reactingFoam solves flows of chemically reacting fluid.
Splitting the package into libraries and the solvers provides additional flexibility by supporting runtime selection.
This design idea makes it possible to switch during the solver runtime between libraries (physical models) and change
the simulation parameters. No breaking of the calculation or recompilation is necessary.
All of the above considerations make OpenFOAM an exceptionally flexible and transparent programming environ-
ment for designing new solvers. In this paper, such a new solver biomassGasificationFoam and library biomassGasi-
ficationMedia for modelling biomass gasification are introduced. In Figure 4, we present the scheme of the developed
code: the solver and the library. The main new idea, which we implemented to extend OpenFOAM applications
for modelling and simulating gas-solid interactions, is the Dynamic Porosity Field approach, which is described in
Section 2.1. In the following sections, the biomassGasificationFoam solver and biomassGasificationMedia library are
described in detail.

4. Solver - biomassGasificationFoam
The biomassGasificationFoam solver is based on the algorithm used in the unsteady solver reactingFoam for
reacting laminar or turbulent flows with turbulence models available in the OpenFOAM standard distribution [32].
The reactingFoam solves only gas-phase equations (Eqs. 1–5). The RHS of Eqs. 1 and 2 are equal to zero, whereas
the RHS of Eqs. 3 and 5 are limited to gas-phase reaction source terms (ωGi ).
In the following list, we summarise the novel modifications implemented in biomassGasificationFoam:
• a reacting porous medium is introduced,
• equations for the solid phase are introduced: conservation of solid components (Eq. 4) and energy conservation
(Eq. 6),
10
Figure 5: Scheme of the main loop of the biomassGasificationFoam solver based on the PIMPLE algorithm. New development in the solver is in
bold.

• the continuity equation for the gas phase (Eq. 2) and the species transport (Eq. 3) contain source terms due to
the gas originating from the biomass gasification (see the RHS of these equations),
• the gas energy conservation (Eq. 5) has additional source terms due to heat exchange between the gas and solid
phases.
• radiation absorption by biomass surface is possible.
A schematic illustration of the main loop of the biomassGasificationFoam solver is provided in Fig. 5. The
PIMPLE (PISO-SIMPLE) algorithm is used in biomassGasificationFoam, as in reactingFoam. The main loop contains
two inner corrections for solving the pressure-momentum coupling influenced by energy and species distributions.
The mass conservation equation is solved and the source terms calculated once per each main loop term.

5. Library - biomassGasificationMedia
The model of the thermal conversion of biomass, as presented in Fig. 4, is constructed from three main elements:
11
• the definition of a porous medium and its mechanical properties - porousReactingMedia library, with the set-
Porosity utility;

• definitions of thermal, chemical, and radiation properties of solids - thermophysicalModels libraries;

• class linking the above libraries to the biomass gasification model - pyrolysisModels.
Each part of the biomassGasificationMedia library is described in the following chapters.

5.1. porousReactingMedia and setPorosity


The porosity model based on Darcy’s law is implemented in the porousReactingMedia library. The porous medium
is introduced by two volumetric fields in the main computational domain: volScalarField porosityF - denoting the
one minus void fraction (1 − γ) and volTensorField D f - representing the viscous resistance tensor K (see Eq. 1).
The initial shape and mechanical properties of the porous medium are set using the setPorosity utility, which
creates a field of porosity (porosityF) and a tensor field of porous resistance (D f ) of the desired shape and properties
independent of the lattice. These fields are created using coordinate constraints on the centres of each computational
cell in the already meshed domain. We found that the most beneficial and time-efficient way to design one’s own
porous medium is to modify the ‘medium.H’ file of setPorosity and to recompile it using the standard OpenFOAM
compilation mechanism. The computational cells are recognised as solid-state cells based on the γ field, and the Darcy
tensor defined in cells with γ = 0 is of no importance.
Porous media described in this way can be easily modified during program execution, which is particularly ben-
eficial if one wants to simulate porous medium dynamics in the model. The porousReactingMedia library with the
setPorosity utility can be used as the standalone model of the complex-shaped porous medium inside the computa-
tional domain. Currently, the library includes the Darcy Law for a porous medium only but can be extended to other
nonlinear formulas (e.g., Forchheimer).

5.2. thermophysicalModels
5.2.1. ODEHeterogeneousSolidChemistryModel - reaction rates and stoichiometry
The ODEHeterogeneousSolidChemistryModel derived from the ODESolidChemistryModel library is the imple-
mentation of the customisable kinetics of chemical reactions. The implemented kinetics is suitable for both homoge-
neous reactions (only gas or only solid substrates are involved) and heterogeneous reactions (both gas- and solid-phase
substrates are involved, gaseous substrates included gases inside porous material and outside gases close to the solid
surface). The reactions taking place in the gas phase only and the way of defining these reactions are inherited from
the standard OpenFOAM solver reactingFoam. To introduce reactions (thermal processes) with the solid state, we
must declare a new entry in the reaction subdictionary of the chemistryProperties dictionary.
As a first example, we take the complex reaction of hemicellulose pyrolysis introduced as follows:
irreversibleSolidArrheniusHeterogeneousReaction
hem = 1.57 CH4 + 8.75 H2 + 5.73 CO + 9.72 CO2 + 0.4 char
(1.495e9 1.488e4 400 1 1)

The first line determines the choice of the reaction rate model. The second line describes a reaction involving the
pyrolytic conversion of 1 kg of hemicellulose into 0.4 kg of char. The remaining hemicellulose volatiles are left as
pyrolytic gases, namely, CH4 , H2 , CO, and CO2 , with the stoichiometry obtained experimentally [5]. Thus, there is
only one substrate, and the reaction is automatically recognised as homogeneous. The third line contains numerical
parameters of the reaction in the following order: the pre-exponential factor A, temperature of activation T a , critical
temperature T c below which the reaction stops, reaction order nr , and, optionally, heat of reaction hr . The heat of
reaction is defined per unit mass of volatiles (i.e., per unit mass of solid-phase mass loss). The last term (heat of
reaction) is used only when the reaction energetic effect is introduced directly from experiment and not determined
from the enthalpies of formation of the substrates and products (see Section 5.2.2).
The second example, the heterogeneous reaction of char gasification with CO2 as a gasification agent, is introduced
into the chemistryProperties dictionary as follows:

12
irreversibleSolidArrheniusHeterogeneousReaction
char + CO2 = 2CO + 0.1 ash
(1.7e7 324 800 2 1)

This reaction is automatically interpreted as a heterogeneous reaction in which 1 kg of char reacts with gaseous CO2 ,
producing 0.1 kg of ash and two moles of CO per mole of CO2 consumed as a substrate. The net mass release to
the gas phase is equal to the solid-phase mass loss, which makes it possible to calculate source terms for all gaseous
species involved in the reaction.
In the current version of the library, there are two possible models of the reaction rate κ:
[ ]
• irreversibleSolidArrheniusHeterogeneousReaction - Arrhenius reaction: κ = A exp − TTa T > Tc;
[ ]
• irreversibleSolidEvaporationHeterogeneousReaction - water evaporation: κ = A|T − T c |2/3 exp − TTa T > Tc.

The reaction rate Ωr for the reaction r involving the solid-state substrate s is calculated as follows:
{ S S n G δG
ρ (Y s ) r (Y ) κr , T > T c
Ωr = (16)
0, T ≤ T c

where δG equals one when there is a gaseous substrate and zero otherwise.
Typically, the irreversibleSolidArrheniusHeterogeneousReaction is used for biomass pyrolysis, char gasification,
and char combustion. For the evaporation of water contained within biomass, both kinetics (irreversibleSolidEvap-
orationHeterogeneousReaction and irreversibleSolidArrheniusHeterogeneousReaction) may be used. Other possible
forms of reaction rates, such as a more realistic model of the evaporation of water embedded within porous structures,
can be implemented.

5.2.2. ODEHeterogeneousSolidChemistryModel - heat of reaction


There are two different ways of introducing the heats of reaction for the processes involving the solid phase. These
two approaches are implemented in ODEHeterogeneousSolidChemistryModel:
• “formationEnthalpy” - the heat of reaction is determined based on the enthalpy of formation of substrates and
products;
• “heatOfReaction” - the heat of reaction is provided independently by the user for each reaction.

In both cases, the net energetic effect of solid reactions is calculated differently.
The first approach, already implemented in reactingFoam, is typical for gas-phase reactions. In this approach, the
heat of reaction is determined based on the formation enthalpies of substrates and products. For each substrate s and
each product p, the enthalpies of formation h f s and h f p must be defined. Thus, for the reaction

char + CO2 → 2CO + 0.1ash (17)

we must define h f char , h f CO2 , h f CO , and h f ash .


The set of ordinary differential equations describing the law of mass action must be solved to determine the mass
change ∆m of each component k in the computational cell for each time step:
dmk ∑
= Ωk,r (18)
dt r

Finally, the calculated mass changes for every substrate ∆m s and every product ∆m p are multiplied by their en-
thalpy of formation and summed to obtain the final energetic effect:
∑ ∑
Hr = ∆m s h f s + ∆m p h f p (19)
s p

13
Unfortunately, the enthalpies of formation of solid components, such as lignin, are difficult to determine. In this
case, the heats of individual reactions must be introduced directly based on experimental results. Considering the
reaction 17, with defined hr reaction energy and reaction rate Ωr , we can calculate the total energetic effect in time
step ∆t as ∑
Hr = ∆t hr Ωr (20)
r

5.2.3. heatTransferModel
In modelling the thermal conversion processes, we use an energy equation based on temperature rather than
enthalpy. We do not assume that the gas and solid are constantly in thermal equilibrium, and thus, the temperatures of
the gas phase T G and solid phase T S are permanently distinguished.
We assume that the heat transfer between both phases is proportional to the difference between the solid- and
gas-phase temperatures.
αΣ(T G − T S ) (21)
where α denotes the heat transfer coefficient and Σ denotes a surface area of pores per solid state volume.
However, heat transfer inside the bulk of the sample is qualitatively different from heat transfer through the bor-
der of the solid phase. To differentiate between those two situations, we introduce a new parameter borderHTC in
addition to HTC. HTC denotes α for computational cells inside the solid-phase bulk, and borderHTC defines α for
computational cells on the border of biomass fragment.
To determine the surface area of pores Σ, we propose two approaches:
• constHTC - assumes a constant total area of pore surface per volume unit, Σ = const,
• cylinderHTC - porosity is modelled as a collection of parallel pipes.
The cylinderHTC model assumes that the porous medium with initial void fraction γ0 has a regular lattice of
parallel pipes with an initial radius a0 . Based on this assumption, one can determine the number of parallel cylinders
N per unit volume.
γ0 V
N = 2 1/3 . (22)
πa0 V
We assume that N is constant; thus, the pores are enlarged due only to the increasing cylinder radius a. From the
evolution of the void fraction accompanying the solid-state depletion, we can deduce the evolution of the surface per
volume in the porous medium.
( )1/2
N2πaV 1/3 2 γ0
Σ= = (23)
V a0 γ
It must be stressed that there is a significant difference between the heat capacity of the solid and gas phases, which
may lead to instability of the numerical solution due to energy transfer between phases. To avoid these fluctuations,
we introduce a control parameter limiting time step (maxdT) in the controlDict dictionary. This parameter controls
the maximum ratio of change in the gas- and solid-phase temperatures over all cells.

5.2.4. thermoType
The thermoType library determines three main thermodynamic properties of the solid components: density, heat
capacity, and thermal conductivity.
Currently, as presented in Section 2.5, there are three models prepared for the runtime selection that can be selected
in the solidThermophysicalProperties dictionary:
• solidMixtureThermo<constHeterogeneous> - constant density, constant heat capacity, and a constant heat trans-
port coefficient;
• solidMixtureThermo<expoHeterogeneous> - constant density, exponential heat capacity, and an exponential
heat transport coefficient (see Section 2.5);
• solidMixtureThermo<linearHeterogenic> - constant density, constant heat capacity, and a linear heat transport
coefficient;
14
5.2.5. heterogeneousRadiationModel
At the current stage, the influence of radiation on the solid is modelled in a simplified manner. We assumed that
radiation is only absorbed by the biomass surface, not emitted. This assumption is reasonable in a wide class of
applications, particularly for biomass particles in a heated environment, such as in a TGA experiment.
Three heterogeneousRadiationModels are implemented and can be chosen in the radiationProperties dictionary:
• none;
• heterogeneousMeanTemp;
• heterogeneousP1.
In the first set, no radiation is considered in the simulation. In the second set, we assume that the optical thickness
of the gases inside the reactor is small and that the gases do not interfere with the radiation. In this case, the energy
is transferred directly from the heated walls to the surface of the biomass particle. To determine the surface of the
2
porous medium, we assume that on average, every cell is cubic; thus, its surface is given by V 3 , where V is the cell
volume. An additional assumption is that on average approximately one sixth of its surface is exposed to the outside.
This assumption gives the amount of surface exposed to radiation per computational cell on the border of the biomass
given the volume of the biomass:
1 2
S = V3. (24)
6
Then, the net energetic income per unit volume is calculated according to Eq. 25:
1 V 2/3
S rad = max(0, δσ(T wall
4
− ϵ(T sur
S 4
f ace ) )) (25)
6 V
where T wall is the average temperature of the walls, T sur f is the temperature of the particle surface, σ is the Boltzmann
constant, δ is the solid-state surface optical absorption coefficient, and ϵ is the absorption-to-emission ratio. The
last two parameters that describe the optical properties of the biomass surface are assumed to be constant in this
implementation.
In the third approach, the radiation within the computational domain is determined with the P1 radiation model
available in OpenFOAM, as there is no biomass inside. Then, the biomass surface absorbs part of the available
radiation energy. In the current implementation, the emission from biomass is not included, which means that the
solid mass has no influence on the radiation density. The calculated radiation density in the gas phase is absorbed on
the boundaries of the solid state. The net energetic income per unit volume is calculated as
1 V 2/3
S rad = max(0, δ(G − ϵσ(T S )4 )) (26)
6 V
where G is the radiation energy flux.

5.3. heterogeneousPyrolysisModel
The heterogeneousPyrolysisModel class is an implementation of a base class for different pyrolysis models. This
class creates all necessary fields of solid properties (e.g., mass fields of solid components) and integrates physical
submodels for the solid state (e.g., radiation, kinetics, conduction). For each cell containing the solid phase (where
γ < 1), the source terms for the gas- and solid-phase equations are calculated, as presented in Table 4. Necessary
updates of the solid fields are performed once in each main loop turn.
The library solves the equations for solid components (Eq. 4), energy conservation (Eq. 6), and porosity change:
dγ ∑ ∑
= ρk Ωk,r (27)
dt k r

The porosity evolves with the vanishing solid phase as the increasing void fraction, e.g., for the reaction (17). In
any computational cell, when γ is sufficiently close to one, i.e., (1 − γ) < 10−5 , it is fixed to one. Such a computational
cell is considered to contain only a gas phase and does not participate in further solid-phase evolution.
The specific model can be chosen in the pyrolysisProperties dictionary and also set as active or inactive there.
Currently, only the volPyrolysis model is implemented for volumetric processes. When inactive, no calculations are
performed for the solid-state fields.
15
Table 4: Source terms calculated for the solid and gas phases in the volPyrolysis model.

Source Definition and explanation Solid phase Gas phase


Heat transfer Section 2.4 and 5.2.3, Eq. 12 Eq. 6 Eq. 5
Reaction mass sources Section 2.3, 5.2.1 and Appendix A Eq. 4 Eq. 2 and Eq.3
Reaction heat sources Section 2.3 and 5.2.2, Eqs 19,20 Eq. 6 -
Radiative heat source Section 5.2.5, Eqs. 25-26 Eq. 6 Eq. 5
Porosity Section 2.5, Eq. 13 Eqs. 4-6 Eqs. 1-5

6. Validation and results

TGA, through a detailed measurement of mass loss, quantifies the thermal decomposition of wood under well-
controlled conditions. The experiment was performed using the Q500 (TA Instrument, New Castle, Delaware, US)
thermogravimeter with an initial temperature of 300 K and a constant heating rate of 10 K/min. The experiment was
carried out until the temperature reached 1,300 K. Because we provided a nitrogen environment, only the processes
of drying and pyrolysis took place. The heating protocol and process environment were introduced through the initial
and boundary conditions, which are summarised in Table 5.

Table 5: Initial and boundary conditions used in the simulations.


Initial Boundary condition
condition inlet walls outlet
Inert species nitrogen nitrogen - -
Temperature 300 K 300 K + 10 · t K min−1 300 K + 10 · t K min−1 zero gradient
Velocity 0 m s−1 0.3 m s−1 0 m s−1 zero gradient
Pressure 101300 Pa 101300 Pa - zero gradient

The solver was validated with the case of pyrolysis of a pre-processed isotropic wood sample (Rubinia preudoac-
cacia) with the initial mass of 24 mg [6]. The test calculations were performed with simplified geometry for the TGA
reactor and sample, both of which are modelled as cubes (see Fig. 6). The edge of the reactor is 8 mm. The entire
computational domain was composed of 20 x 20 x 20 cells. The porous medium was distributed over 8 x 8 x 8 cells.
The complete calculations corresponding to the TGA experiment took approximately 12 h with eight processors.
In this paper, we use the mechanism of wood biomass pyrolysis, where cellulose, hemicellulose, and lignin de-
compose into a set of gases: H2 , CO, CO2 , and CH4 [6]. The heat of pyrolysis was determined from enthalpies of
formation of substrates and products.
The set of material properties and parameters of kinetics are presented in Table 6. The experimentally determined
material properties of wood are typically ’effective’, combining the effects of gas and solid phases. Such properties
depend strongly on the origin of the wood, the structure of the porosity, and the selected experimental procedures. In
the solver presented here, we have introduced separate equations for the solid state that requires parameters for a ’pure
solid’. A good example of such a material property is thermal conductivity. Measured effective values vary from 0.1
to 1 W m−1 K−1 , but the thermal conductivity of a solid skeleton is an order of magnitude higher, approximately 10
W m−1 K−1 .
The comparison of mass loss during evaporation and pyrolysis in the TGA experiment and the corresponding
simulation is presented in Fig. 7. The results are in qualitative agreement, but discrepancies are visible. The main
reasons for these discrepancies are the imperfect and oversimplified kinetics of pyrolysis and the variability of wood
composition, that cannot be exactly determined.
The subsequent peaks of the inverse of the mass loss rate presented in Fig. 8 correspond to the processes of
evaporation and pyrolysis of hemicellulose, cellulose, and lignin, respectively. All processes stop at approximately
800 K, when only char remains. In reality, as we see in Fig. 7, a small amount of char is still volatilising at higher
temperatures. This effect is not included in the chosen pyrolysis kinetics. The mass loss rates shown in Fig. 8 are
almost indistinguishable at different locations within the wood sample.

16
Figure 6: A simplified TGA reactor with cubic geometry and a hexagonal wood sample placed in the centre. In a diagonal plane cross-section of
the sample, five points are marked (centre (C), top (T), bottom (B), top-corner (TC), and bottom-corner (BC)) in order to probe results.

Figure 9 illustrates how the densities (mass) of solid components, embedded moisture, hemicellulose, cellulose,
and lignin are decreasing while the density (mass) of char is increasing. Reproducing this well-known sequence of de-
composition is possible with separate kinetics constants for the individual solid components, which is straightforward
in the presented solver.
Figure 10 shows spatial distribution of the total density of the solid material during evaporation (at time 500 s
when wall temperature equals 383 K) and during pyrolysis (at time 2000 s when wall temperature is equal 633 K).
The density at the centre of the particle is highest. The gradients of density are small, which is expected for a small,
thermally thin particle.
Figure 11 illustrates the increase in the temperature of the gas phase at five selected points inside the wood: the
centre, the bottom, the top, the bottom-corner, and the top-corner. The differences between points are small. This
result corroborates the expectation that temperature gradients should be negligible in such a small sample [45]. The
thermal thickness of this particle is confirmed by relatively uniform field of solid temperature presented in Fig. 12.
The included thermal processes are endothermic and, as can be seen in Fig. 11, the rate of the gas temperature increase
drops slightly when these processes occur. As expected, this decrease is most pronounced in the centre of the sample.
In Fig. 13 (a), we present the evolution of the difference between the gas- and solid-phase temperatures, at each
point. Figure 13 (b) illustrates the spatial distribution of this difference during pyrolysis at time 2000 s. As expected,
this difference is negligible when no reaction takes place but increases when thermal processes are present. The
sequence of peaks visible in Fig. 13 (a) is due to the evaporation and pyrolysis of different solid components. The gas
phase is hotter than the solid.
Figure 14 presents the composition of the produced gases. Because the process takes place in a reactor filled with
nitrogen, the presented values are relative. The solver with the selected kinetics adequately reproduces the relative
mass fractions (the ratios of the mass fractions of the different gaseous components) and the peaks of the processes.
The velocity field around and inside the porous medium is presented in Fig. 15. As expected, the gas flows

17
Table 6: Physical properties and kinetic constants of the pyrolysis lignocellulose material used in the simulation.
Embedded Wood components
Unit moisture Cel. Hem. Lig. Char Ash Reference
Kinetic parameters of the pyrolysis of cellulose, hemicellulose, and lignin according to Fig. 3 (a)
Initial mass fraction — 0.07 0.3588 0.276 0.2852 0 0.01 [6]
Pre-exponential factor s−1 1.4 · 1014 2.1 · 107 5.8 · 1013 1.06 · 103 — —
Activation energy J mol−1 1.35 · 104 1.34 · 104 1.94 · 104 8.95 · 103 — —
Minimum temperature K 300 450 400 500 — —
H2 O yield kg kg−1 1 0 0 0 — —
H2 yield kg kg−1 0 0.02 0.02 0.05 — —
CO yield kg kg−1 0 0.37 0.21 0.28 — —
CH4 yield kg kg−1 0 0.04 0.04 0.08 — —
CO2 yield kg kg−1 0 0.38 0.55 0.40 — —
Char yield kg kg−1 0 0.19 0.19 0.19 — —
Enthalpy of formation J kg−1 −15.9 · 106 −1.0 · 106 −8.5 · 105 −9.2 · 105 −4.1 · 104 −12.4 · 106 [41, 42]
Material properties for solid components
Absolute density kg m−3 1000 1480 1957 2500 [43]
Initial void fraction — — 0.55 0.91 - [3]
Initial pore diameter m — 1 · 106 1 · 104 - [44]
Permeability m2 — 1 · 10−14 1 · 10−11 - [19]
a −1 −1 a
Thermal conductivity Wm K 0.58 0.20 0.1a 0.17 [43]
−1 −1
Heat capacity J kg K 4200 1380 1100 840 [43]
a
Effective. Thermal conductivity through porous matrix kS , which leads to the presented effective conductivity is 10 W m−1 K−1 .

symmetrically around the porous particle (see Fig. 15 (a)-(b)). Velocity magnitude inside the porous medium is, due
to porous resistance, more than an order of magnitude smaller than outside. As we show in Figure 15 (c) the velocity
vectors inside the particle are directed upwards and outwards. Upward components are due to the outer flow but
outward components are caused by the gases being produced inside the porous medium.

7. Practical Issues

7.1. Installation instructions


7.1.1. OpenFOAM main package installation guide
The easiest way to install the OpenFOAM main package is to use packs prepared for main Linux distributions available
on the OpenFOAM website [7]. Here, a brief example for Ubuntu 12.04 LTS is provided. It is sufficient to copy, paste,
and execute the following commands in the terminal window: (superuser privileges are required)

VERS=$(lsb_release -cs)
Obtains the installed version of Ubuntu release name

sudo sh -c "echo deb http://www.openfoam.org/download/ubuntu


$VERS main > /etc/apt/sources.list.d/openfoam.list"

Adds the OpenFOAM pack address to repositories. The above command must be written on one line.
sudo apt-get update

Updates package list

sudo apt-get install openfoam211


sudo apt-get install paraviewopenfoam3120

18
Figure 7: Comparison of the mass loss during the TGA experiment and the corresponding simulation.

Installs OpenFOAM (211 refers to version 2.1.1) and Paraview [46] (3120 refers to version 3.12.0) for the visualisation
of results. Both OpenFOAM and Paraview are now installed in the /opt directory. From now on, no superuser
privileges will be required. To configure the OpenFOAM package, it is necessary to add OpenFOAM to the system
path by editing the .bashrc file in the user’s home directory.

gedit ~/.bashrc
and adding the following line to the bottom

source /opt/openfoam211/etc/bashrc
To check the installation type,

icoFoam -help
If “usage” information appears, the installation has completed correctly. Finally, create a user project directory in the
$HOME/OpenFOAM directory named <USER>-2.1.1 by typing
mkdir -p $WM_PROJECT_USER_DIR

Now, we can proceed to the installation of biomassGasificationFoam.

7.1.2. biomassGasificationFoam library


First, create a folder for the installation

mkdir -p $WM_PROJECT_USER_DIR/biomassGasificationMedia
Then, download the biomassGasificationFoam library and extract it into a temporary folder

tar -zxvf biomassGasificationFoam_installPack_1.0.tar.gz


Enter the extracted folder

cd biomassGasificationFoam_installPack_1.0

19
0.5
centre (C)
0.45 bottom (B)
top (T)
0.4 bottom−corner (BC)
top−corner (TC)
rate of mass loss [kg/s]
0.35

0.3

0.25

0.2

0.15

0.1

0.05

0
300 400 500 600 700 800 900 1000
Temperature [K]

Figure 8: Simulation: rate of mass loss at the five locations within the sample. Except at the very early stage they are almost indistinguishable.

Install the library and solver in the default folder (/̃OpenFOAM/<USER>-2.1.1/biomassGasificationMedia/) by typing
source biomassGasificationMediaDirectiories
./install
To test the installation, open a new terminal window and again set the environmental paths by typing
source /opt/openfoam211/etc/bashrc
source biomassGasificationMediaDirectories
then run the solver by typing
biomassGasificationFoam
The message starting with the OpenFOAM header should appear. If so, the installation has been completed
successfully, even if the computation cannot start due to ’FOAM FATAL IO ERROR’. To start the computations
proceed to the pre-set test (tutorial) cases.

7.2. Test cases


7.2.1. Validation test
The validation test case presented in Section 6 is included in the biomassGasificationMedia package with the
solver and adequate libraries. The case reproduces results of the TGA experiment presented in Section 6.
In Fig. 16, we summarised the structure of the directories and files included in the test case and required to start
the new solver. All necessary data and parameters are set initially:
• the initial and boundary conditions are set up in folder ’./0’ according to Table 5, initial solid composition is set
according to the first row of Table 3.
• the material parameters from Table 3 and mechanisms of thermal processes are defined in ’./constant’ and
’./chemkin’.
• the case control parameters and details of the numerics are set up in ’./system’.
The solver is started in the case folder by typing
biomassGasificationFoam
Running in parallel is possible with the standard OpenFOAM setup. An exemplary dictionary file for the decom-
posePar tool is available in ’./system’.
20
250 cellulose
moisture
cellulose

density of solid components [kg/m ]


3
hemicellulose
200 lignin lignin
char
hemicellulose ash
150
char

100

moisture
50

ash
0
300 400 500 600 700 800 900 1000
Temperature [K]

Figure 9: Simulation: changing the densities of the solid components.

7.2.2. One-cell case


Additional test case included into the package is prepared for analysing and testing kinetics of the processes. The
geometry is reduced to a single computational cell, thus the solver provides rapid results of qualitative nature. In this
case we focus on the chemical reactions and mechanisms of thermal processes rather than on heat transfer, so the
source terms incorporating the effects of radiation and conductional heat transfer in the porous medium are neglected.
The kinetics preset in the one-cell test run is the same as in the validation test described in Section 7.2.1.

7.2.3. Visualisation of results


The results can be visualised in three ways.
• The method of choice is to use Paraview [46] visualisation for graphical presentation.
• The second is to use the probeLocations tool provided with OpenFOAM. This tool probes selected variables
over time at different locations according to the dictionary file probesDict located in ./system. The results are
produced in ./probes dictionary.

• The third method, totalMass distributed with the package, is the fastest but provides information only on tem-
poral change of the total mass of porous medium and saves it in totalMass.txt file. To run this tool type

totalMass

8. Conclusions

We presented a new solver biomassGasificationFoam and a complementary library biomassGasificationMedia


that extended the functionalities of the well-supported open-source CFD code OpenFOAM. The main goal of this de-
velopment was to provide a comprehensive and flexible computational environment for a wide range of applications
involving reacting gases and solids. The biomassGasificationFoam is an integrated solver capable of modelling ther-
mal conversion , including evaporation, pyrolysis, gasification, and combustion, of various solid materials. This type
of integrated approach allowed for numerical modelling of the complex cross-scale process of biomass pyrolysis and
gasification, particularly directed toward the optimisation of fixed-bed reactors. The solver and library can potentially
be applied in modelling of the processes involving porous reacting media and gases, not only in biomass gasification,
but also for catalysis or filtration.
21
(a) Density of solid at time 500 s (b) Density of solid at time 2000 s
Figure 10: Biomass particle: the comparison of biomass density at 500 s (evaporation) and 2000 s (pyrolysis).

9. Acknowledgements

Part of this work has been supported by the strategic program of scientific research and experimental development
of the National (Polish) Centre for Research and Development: “Advanced Technologies for Energy Generation”;
Task 4. “Developing integrated technologies for fuel and energy production from biomass, agricultural wastes, and
other resources”.
Numerical computations were performed in the Interdisciplinary Centre for Computational and Mathematical
Modelling (ICM), University of Warsaw, grant number G34-8.
We thank Marek Kochańczyk for helpful comments on C++.
We thank prof. Marzena Półka from The Main School of Fire Service in Warsaw for performing the thermo-
gravimetry analysis.

Appendix A. Source term calculation

Appendix A.1. Pyrolysis


The process of pyrolysis is presented in the following convenient form of Eq. A.3. In this formula, the solid
component k (cellulose, hemicellulose, or lignin) produces a set of gaseous products pG (where the index p denotes
H2 , CO, CO2 , CH4 ). As a result of pyrolysis, the solid component is transformed into char [6].


cellulose → ν p pG + char (A.1)

hemicellulose → ν p pG + char (A.2)

lignin → ν p pG + char (A.3)

The reaction rate coefficient modelled by Arrhenius formulae leads to the following mass rate Ωk,r for reaction (pro-
cess) r for solid component k: ( )
T
Ωk,r = Ar ρ (Yk ) exp
S S nr
, T > Tc (A.4)
T 0r
In general, several different paths of decomposition of the same solid component k are possible. The index r counts
these separate paths of reactions; in the present example, A.3 r = 1. Each reaction r of substrate k is appended to the
total reaction rate
pyro

RSk =− Ωk,r (A.5)
r

22
800

750

700
BC
650
C
T (gas phase) [K]

hemicellulose
600 pyrolysis
cellulose pyrolysis
BC
550
C
500

450
evaporation centre (C)
400 bottom (B)
BC top (T)
350 C bottom−corner (BC)
top−corner (TC)
300
300 400 500 600 700 800
Temperature [K]

(a) Gas temperature as a function of time for selected points inside the biomass particle.

(b) Gas temperature field at time 2000 s. (wall temperature 633 K)


Figure 11: Temperature of the gas phase: (a) temporal change at selected points, (b) temperature field at time 2000 s.

Figure 12: Temperature of the solid at time 2000 s when wall temperature is equal 633 K.

23
60 evaporation
centre
BC hemicellulose cellulose bottom
pyrolysis pyrolysis

T (gas phase) − T (solid phase) [K]


50 top
BC bottom−corner
top−corner
40 TC

B B lignin pyrolysis
30
BC T
T
20

C
10 C

0
300 400 500 600 700 800 900 1000
Temperature [K]

(a) Difference between T and T s for selected points inside the biomass particle.

(b) Spatial distribution of T − T s


Figure 13: Difference between the temperature of the gas (T) and solid (T s ): (a) as a function of time at selected points, (b) spatial distribution of
(T − T s ) at time 2000 s when the wall temperature is equal 633 K.

The reaction rates for products of reaction Eq. A.3 take the form
pyro
∑∑
RSchar = ξr Ωk,r (A.6)
k r

pyro
∑ ∑ W pG
RGp = ∑ G (1 − ξr ) Ωk,r (A.7)
k r i Wp

where ξr is the mass ratio of solid products to solid substrates.

Appendix A.2. Char combustion


It is assumed that char combustion is the most competitive heterogeneous reaction. Other heterogeneous reac-
tions, such as gasification, are slower and typically take place when O2 is completely consumed for heterogeneous

24
0.01 hemicellulose
pyrolysis H O
2
0.009 H2
cellulose pyrolysis
mass fraction of gaseus products [−] 0.008 CO
CO2
0.007 evaporation CO2 CH
4
0.006
H2O
0.005 lignin pyrolysis
0.004 CO
0.003

0.002
CH4
0.001

0
300 400 500 600 700 800 900 1000
Temperature [K]

Figure 14: Mass fraction of the gases.

or homogeneous combustion. The combustion of the solid phase occurs only if O2 is present and the temperature is
sufficiently high.
In the present paper, we assume that only the carbon contained in char is available for combustion and gasification.
The reaction of char combustion is presented in Eq. A.8.

char + O2 → CO2 + 0.1ash (A.8)


With the reaction rate coefficient modelled by Arrhenius, mass rates for reactants and products are presented in a set
of equations A.10.
( )
S comb T
Rchar = Ac ρ (Ychar ) YO2 exp
S S nc G
, T > Tc (A.9)
T 0c
comb ρSash S comb
RSash = R (A.10)
ρSchar char
comb
G
WCO ρSash comb
RG
CO2 = 2
(1 − )RSchar (A.11)
G
WCO 2
− WOG2 ρSchar
comb WOG2 ρSash comb
RGO2 = − (1 − )RSchar (A.12)
G
WCO 2
− WOG2 ρSchar

Appendix A.3. Char gasification


The heterogeneous reactions involved in gasification are written in Eqs. A.15 [1]. Carbon, C, typically presented
on the LHS of gasification reactions, is completely incorporated into the structure of the char, which is why the
gasification reactions are modelled as the reactions of char and the gasification agent. We present these reactions in
the convenient formula A.15, where Ga is the gasification agent (index a denotes O2 , CO2 , or steam) and G p represents
the gaseous products (index p denotes H2 , CO, CO2 , and CH4 ).

char + CO2 → 2CO + ash (A.13)


char + H2 O → CO + H2 + ash (A.14)
char + O2 → CO + ash (A.15)
25
(a) Velocity magnitude.

(b) Vectors of gas velocity outside the porous medium.

(c) velocity vectors inside porous medium.


Figure 15: Velocity field at time 2000 s when wall temperature is equal 633 K: (a) field of velocity magnitude, (b) velocity vectors around the
biomass particle, (c) velocity vectors inside porous medium .

The mass rate is modelled by formula A.16.


( )
T
Ωr = Ar ρS (Ychar
S
)ng YaG exp (A.16)
T 0r

Each reaction is appended to the total reaction rate for the species included in the following manner from mass

26
Figure 16: Structure of the dictionaries and files of the test case. Inside the black frame are files modified (dashed lines) or introduced (solid lines)
for biomassGasificationFoam.

conservation:
gasi f

RSchar = − Ωr (A.17)
r
gasi f

RSash = (1 − ξr )Ωr (A.18)
r

gasi f
∑ p ν p W pG
RGp = ∑ (1 − ξr )Ωr (A.19)
r ν p W pG − νa WaG
gasi f
∑ νa WaG
RGa = ∑ (1 − ξr )Ωr (A.20)
r ν p W pG − νa WaG

27
[1] P. Basu, Biomass gasification and pyrolysis, Elsevier, 2010.
[2] E. G. Pereira, J. N. da Silva, J. L. de Oliveira, C. S. Machado, Sustainable energy: A review of gasification technologies, Renew Sust Energ
Rev 16 (7) (2012) 4753.
[3] O. Senneca, Kinetics of pyrolysis, combustion and gasification of three biomass fuels, Fuel P 88 (2007) 87.
[4] M. Dudyński, K. Kwiatkowski, K. Bajer, From feathers to syngas - technologies and devices, Waste Manage 32 (4) (2012) 685.
[5] H. Yang, R. Yan, H. Chen, D. Lee, C. Zheng, Characteristic of hemicellulose, cellulose and lignin pyrolysis, Fuel 86 (2007) 1781.
[6] K. Kwiatkowski, B. Grecki, W. Gryglas, J. Korotko, M. Dudyński, K. Bajer, Numerical modelling of biomass pyrolysis heat and mass
transport models, Numer Heat Tr A Appl 64 (3) (2013) 216.
[7] OpenFOAM Foundation, Openfoam (2013).
URL http://www.openfoam.com
[8] H. Weller, G. Tabor, H. Jasak, C. Fureby, A tensorial approach to computational continuum mechanics using object-oriented techniques,
Computers in physics 12 (6) (1998) 620.
[9] FM Global, Firefoam (2013).
URL http://code.google.com/p/firefoam-dev/
[10] E. Simsek, B. Brosch, S. Wirtz, V. Scherer, F. Krll, Numerical simulation of grate firing systems using a coupled cfd/discrete element method
(dem), Powder Technology 193 (3) (2009) 266.
[11] B. Peters, H. Raupenstrauch, Modelling moving and fixed bed combustion, in: Combustion Handbook, Wiley & Sons, 2010, Ch. Modelling
Moving and Fixed Bed Combustion.
[12] K. Khadra, P. Angot, S. Parneix, J.-P. Caltagirone, Fictitious domain approach for numerical modelling of navierstokes equations, Int. J.
Numer. Meth. Fluids 34 (2000) 651.
[13] R. Mittal, G. Iaccarino, Immersed boundary methods, Annu. Rev. Fluid Mech. 37 (2005) 239.
[14] W.-C. R. Chan, M. Kelbon, B. B. Krieger, Modelling and experimental verification of physical and chemical processes during pyrolysis of a
large biomass particle, Fuel 64 (11) (1985) 1505.
[15] C. Di Blasi, C. Branca, S. Sparano, B. La Mantia, Drying characteristics of wood cylinders for conditions pertinent to fixed-bed countercurrent
gasification, Biomass Bioenergy 25 (2003) 45.
[16] C. D. Blasi, Dynamic behaviour of stratified downdraft gasifiers, Chem. Eng. Sci. 55 (15) (2000) 2931.
[17] C. Di Blasi, Modeling chemical and physical processes of wood and biomass pyrolysis, Prog Energy Combust Sci 34 (1) (2008) 47.
[18] J. Blondeau, H. Jeanmart, Biomass pyrolysis at high temperatures: Prediction of gaseous species yields from an anisotropic particle, Biomass
Bioenergy 41 (2012) 107.
[19] A. Dufour, B. Ouartassi, R. Bounaceur, A. Zoulalian, Modelling intra-particle phenomena of biomass pyrolysis, Chem Eng Res Des 89 (10)
(2011) 2136.
[20] E. Ranzi, A. Cuoci, T. Faravelli, A. Frassoldati, G. Migliavacca, S. Pierucci, S. Sommariva, Chemical kinetics of biomass pyrolysis, Energy
and Fuels 22 (2008) 4292.
[21] B. Peters, C. Bruch, Drying and pyrolysis of wood particles: experiments and simulation, J Anal Appl Pyrolysis 70 (2) (2003) 233.
[22] T. Poinsot, D. Veynante, Theoretical and Numerical Combustion, 2012.
URL http://elearning.cerfacs.fr/combustion/onlinePoinsotBook/onlinethirdedition/index.php
[23] K. Kwiatkowski, M. Dudyński, K. Bajer, Combustion of low-calorific waste biomass syngas, Flow Turbul. Combust. 91 (2013) 749.
[24] M. Kaviany, Principles of Heat Transfer in Porous Media, Mechanical Engineering Series, Springer, 2012.
[25] K. Kwiatkowski, J. Korotko, W. Gryglas, M. Dudyński, K. Bajer, Differences in numerical modelling of pyrolysis of thin and thick biomass
particle, in: 19th International Symposium on Analytical and Applied Pyrolysis, Book of Abstracts, 2012.
[26] B. V. Babu, A. S. Chaurasia, Parametric study of thermal and thermodynamic properties on pyrolysis of biomass in thermally thick regime,
Energy Convers Manage 45 (1) (2004) 53.
[27] K. Kwiatkowski, K. Bajer, Mixing in the vicinity of the vortex, GAKUTO International Series Mathematical Sciences and Applications 32
(2010) 419.
[28] V. Novaresio, M. Garcı́a-Camprubı́, S. Izquierdo, P. Asinari, N. Fueyo, An open-source library for the numerical modeling of mass-transfer
in solid oxide fuel cells, Comput Phys Commun 183 (1) (2012) 125.
[29] K. Wȩdołowski, K. Bajer, K. Kwiatkowski, Analysis and modelling of the effective reaction rate in a developing mixing layer, J Phys: Conf
Ser 318 (9) (2011) 092026.
[30] J. Klostermann, R. Schwarze, C. Brcker, Meshing of porous foam structures on the micro-scale, Engineering with Computers 29 (2013) 95.
[31] M. Matyka, Z. Koza, L. Miroslaw, Wall orientation and shear stress in the lattice boltzmann model, Computers & Fluids 73 (2013) 115.
[32] O. Marzouk, D. Huckaby, A comparative study of eight finite-rate chemistry kinetics for co/h2 combustion, Eng Appl Comp Fluid 4 (2010)
331.
[33] M. Garcia-Camprubi, H. Jasak, N. Fueyo, Cfd analysis of cooling effects in h2-fed solid oxide fuel cells, J Power Sources 196 (17) (2011)
7290.
[34] J. Favero, A. Secchi, N. Cardozo, H. Jasak, Viscoelastic flow analysis using the software openfoam and differential constitutive equations, J
Non-Newtonian Fluid Mech 165 (23-24) (2010) 1625.
[35] F. Habla, H. Marschall, O. Hinrichsen, L. Dietsche, H. Jasak, J. L. Favero, Numerical simulation of viscoelastic two-phase flows using
openfoam, Chem Eng Sci 66 (22) (2011) 5487.
[36] N. Herzog, M. Schreiber, C. Egbers, H. J. Krautz, A comparative study of different cfd-codes for numerical simulation of gas-solid fluidized
bed hydrodynamics, Comput Chem Eng 39 (2012) 41.
[37] D. Schmidt, S. Gopalakrishnan, H. Jasak, Multi-dimensional simulation of thermal non-equilibrium channel flow, Int J Multiphase Flow
36 (4) (2010) 284.
[38] H. Marschall, K. Hinterberger, C. Schler, F. Habla, O. Hinrichsen, Numerical simulation of species transfer across fluid interfaces in free-
surface flows using openfoam, Chem Eng Sci 78 (0) (2012) 111.
[39] Z. Malecha, Ł. Mirosław, T. Tomczak, Z. Koza, M. Matyka, W. Tarnawski, D. Szczerba, Gpu-based simulation of 3d blood flow in abdominal

28
aorta using openfoam, Archives of Mechanics 63 (2) (2011) 137.
[40] R. Bannari, A. Bannari, P. Vermette, P. Proulx, A model for cellulase production from trichoderma reesei in an airlift reactor, Biotechnol
Bioeng 109 (8) (2012) 2025.
[41] I. Milosavljevic, V. Oja, E. M. Suuberg, Thermal effects in cellulose pyrolysis: Relationship to char formation processes, Ind Eng Chem Res
35 (3) (1996) 653.
[42] M. van de Weerdhof, Modeling the pyrolysis process of biomass particles, Master’s thesis, Eindhoven University of Technology, Department
of mechanical engineering (2007).
[43] J. Porteiro, E. Granada, J. Collazo, D. Patino, J. Moran, A model for the combustion of large particles of densified wood, Energ Fuel 21
(2007) 3151.
[44] M. Bellais, K. O. Davidsson, T. Liliedahl, K. Sjöström, J. B. C. Pettersson, Pyrolysis of large wood particles: a study of shrinkage importance
in simulations, Fuel 82 (12) (2003) 1541.
[45] C. Di Blasi, Kinetic and heat transfer control in the slow and flash pyrolysis of solids, Ind Eng Chem Res 35 (1) (1996) 37.
[46] Kitware Inc., Paraview (2013).

29

You might also like