Derivation of an Effective Thermal Electrochemical Model for Porous Electrode Batteries using Asymptotic Homogenisation

Thermal electrochemical models for porous electrode batteries (such as lithium ion batteries) are widely used. Due to the multiple scales involved, solving the model accounting for the porous microstructure is computationally expensive, therefore effective models at the macroscale are preferable. However, these effective models are usually postulated ad hoc rather than systematically upscaled from the microscale equations. We present an effective thermal electrochemical model obtained using asymptotic homogenisation, which includes the electrochemical model at the cell level coupled with a thermal model that can be defined either at the cell or the battery level. The main aspects of the model are the consideration of thermal effects, the diffusion effects in the electrode particles, and the anisotropy of the material based on the microstructure, all of them incorporated in a systematic manner. We also compare the homogenised model with the standard electrochemical Doyle, Fuller&Newman model.

particular, most of these applications rely on lithium ion batteries, a type of porous electrode battery, and therefore research on this type of battery has received a lot of attention in the past few years. The first electrochemical model for porous electrode batteries was put forward in the seminal paper of Doyle, Fuller and Newman [1]. In that article, an effective model was presented which described the mass and charge transport in both the electrode and the electrolyte. The porous structure of the electrode was modelled by assuming that at each point of the electrodes there is a representative particle in which lithium intercalates and diffuses. This model is commonly known as the pseudo-two-dimensional (P2D) model, because of the two scales involved (electrode particles and cell scales) or as the Doyle, Fuller & Newman (DFN) model. In this paper we will refer to it as the DFN model. This model has been since the backbone of lithium ion battery modelling and, more generally, of porous electrode batteries. As most of the modelling efforts on porous electrode batteries have been driven by lithium ion batteries, most of the references and notation in this article refer to that particular application, despite that the results presented are more general.
In the models for porous electrode batteries, the equations derived from the thermodynamics are at the microscale. This means that they need to be solved in a very complex geometry in order to capture the porous electrode, which requires a lot of computational power. For this reason effective models, such as the DFN model, have been popular: they are posed at the macroscale, and therefore are computationally cheaper, but still retain most features of the microstructure and the microscale dynamics. One way to obtain effective macroscale equations from the microscale equations is using the volume averaging method, like in [1,2,3]. This method provides good results, but it requires to either define the effective model ad hoc [1] or to neglect some terms in the averaging [3]. In both cases, the parameters of the macroscale model need to be defined as effective parameters and, therefore, fitted from data. This means that the macroscale parameters cannot be directly and systematically derived from the microstructure, and has led to the use of empirical correlations which are still a subject of debate in the field, such as the Bruggeman correlation [4]. For more details on volume averaging we refer the reader to [5].
Another approach to upscale the microscale equations is to use asymptotic homogenisation. The main difference between volume averaging and homogenisation is that the latter allows the effective parameters from the microstructure to be derived in a systematic manner. The key idea of asymptotic homogenisation is to assume that the material is composed of a periodic structure of a size much smaller compared to that of the material. Then, one can exploit the disparity of scales and define space variables at each level that can be treated as independent, so all the differential operators can be split into operators at each scale and a small parameter (ratio of length scales) appears. By performing an asymptotic expansion in this small parameter an equation at the large scale can be determined, which accounts for the effects occurring at the small scale. Homogenisation is a well-known technique: the technical details can be found in the handbooks of the subject [6,7] and a detailed comparison between volume averaging and asymptotic homogenisation is provided in [8].
In our case, we have a problem in which there is transport of mass around the particles (i.e. the microstructure), with a chemical reaction at the surface of the particles and diffusion inside them. This type of problem appears in many different applications, apart from porous electrode batteries, such as filtration [9,10], biology [11], metallurgical furnaces [12] or even coffee roasting [13]. In order to capture the diffusion in the particles that form the microstructure, it is necessary to use high-contrast homogenisation as the diffusion coeffient in the particles is much smaller than the diffusion coefficient in the medium surrounding them [14,15]. High-contrast homogenisation is not as developed as standard homogenisation, and it presents numerous challenges, especially on the analysis side [16,17,18].
Thermal effects can have a notable impact on the behaviour of batteries, and therefore they are an important aspect of our model. The thermal model is coupled to the electrochemical model in the following way: the currents in the battery generate heat in several ways, while the temperature of the battery affects the parameters of the electrochemical model. The coupled thermal electrochemical model can then be upscaled from the microscale equations from a few different ways, similarly to the electrochemical model. The most common approaches in the literature are posing the model ad hoc [19] or using volume averaging [20,3], which present the same advantages and disadvantages discussed for the purely electrochemical model. The goal of this paper is to upscale and derive the coupled thermal-electrochemical model systematically, using asymptotic homogenisation, and including some features that extend the models present in the literature. First, we keep the relation between the microstructure and the effective parameters, and also consider a more general microstructure than the single particle at each point considered in the classic DFN model. We also retain all the features in the electrochemistry of the DFN model, in particular diffusion in the particles, which is important in the behaviour of the batteries, especially during the relaxation period after the current is switched off. Finally, we include the double layer capacitance effects in the kinetics between the electrode and the electrolyte, similarly to the model in [2].
Homogenisation was first used to derive an effective electrochemical model for porous electrode batteries by Ciucci and Lai in [21]. Assuming that the microstructure is formed by packed spheres they derive the DFN model from the microscale equations. They use high-contrast homogenisation so diffusion in the particles is retained.
A similar approach was taken by Richardson et al. in [22]. Here, the authors homogenise the electrochemical microscale equations to obtain effective macroscale equations and use the following assumptions: fast diffusion in the electrode particles, high electronic conductivity in the electrodes and dilute electrolyte. They present a very detailed analysis of the homogenisation and then perform an asymptotic analysis of the effective model to obtain analytical solutions.
In [23,24], Arunachalam et al. perform asymptotic homogenisation of the electrochemical microscale model. The authors consider the diffusivity in the particles to be the same order of magnitude as the diffusivity in the electrolyte. Therefore, the effective model includes lithium diffusion over the whole thickness of the electrode, rather than within the particle. In [24] the authors also provide an analysis of the region in the parameter space in which the DFN model is valid.
Focusing on another aspect within batteries, Hennessy and Moyles [25] used homogenisation to derive the battery heat equation for a double coated electrode from the cell heat equation. The thermal properties of the cell problem are taken to be scalars and the connection to the microscale bulk properties is not considered.  Fig. 1: Sketch of the geometry at the three length scales that are involved in the effective model: battery, cell and particles. We label as well the regions at each scale. At the macroscale, where the macroscale heat equation (5) is defined, the domain is the battery Ω batt , which is composed of several cells. At the mesoscale, where the electrochemical model (2)-(3) and the cell thermal model (4) are defined, the domains are the negative electrode Ω n , the separator Ω sep , and the positive electrode Ω p (apart from the collectors which have not been labelled as we do not consider them in the problem). The cell is defined as the union of the three parts so Ω cell = Ω n ∪ Ω sep ∪ Ω p . At the microscale, where the diffusion in the particles (1) is defined, the domain is the representative microstructure of the porous structure Ω s .
The outline of this paper is as follows. In Section 2 we provide the homogenised dimensionless model for thermal and electrochemical behaviour of porous electrode batteries. The microscale equations which are the starting point of the derivation of the homogenised model are presented in Section 3 and the details of the homogenisation procedure are given in Section 4. In Section 5 we compare our homogenised model with the widely used DFN model. Finally, in Section 6 we discuss the results.

Dimensionless homogenised model
We use asymptotic homogenisation to derive a thermal-electrochemical model for porous electrode batteries both at cell and battery levels, as this method allows us to derive macroscale equations from the microscale ones in a systematic way. In this section the effective model is presented. This model can be seen as a generalised version of the Doyle, Fuller & Newman (DFN) model [1] and the physical laws underpinning it are discussed at the beginning of Section 3. Notice that, even though we use lithium-ion battery terminology in the article, the model presented here can be applied to other types of porous electrode batteries.
The variables of the problem are the concentration of lithium in the electrode c s and ions in the electrolyte c e , the electric potentials Φ s and Φ e , and the temperature T . The subscripts s and e distinguish the quantities in the solid electrode and the electrolyte, respectively. For convenience, the currents i s and i e in the electrode and the electrolyte are defined. These are quantities derived from the concentrations and potentials.
As shown in Figure 1, the effective model accounts for phenomena occurring at three different scales. At the microscale, denoted by z, there are the electrode particles Ω s . The mesoscale, denoted by y, represents a cell, which is composed of the negative electrode Ω n , the separator Ω sep , and the positive electrode Ω p . The boundary of the domain needs to be separated into the part in contact with the current collectors (denoted by ∂Ω collector n and ∂Ω collector p ) and the rest of the boundary, as different conditions apply to each one. At each point of the cell there is the solid electrode and the electrolyte and thus different variables are used to measure them. The cell domain, defined as the union of the three parts, is Ω cell . Finally, there is the macroscale, denoted by x, which is the battery, composed of several cells and represented by Ω batt . In the differential operator ∇ subscripts x, y, and z are used to denote at which scale the operator is applied. Similarly, we use these subscripts in the volume and area integration variables to denote the scale.
Then, the homogenised dimensionless problem is the following. For the concentration of lithium in the electrodes the problem is defined at the microscale domain. It reads where D s is the diffusion coefficient of lithium in the electrode (which may depend on the concentration itself, space variables and temperature), G is the ratio between applied and exchange current, and C is the double layer capacitance. The exchange current g and the overpotential η are defined as where β is the charge-transfer coefficient of the interacalation reaction, c max s is the maximum concentration of the electrode, λ is the ratio between the typical and thermal potentials, γ is the ratio between temperature variation and reference temperature, and U ocp is the open circuit potential as a function of the electrode lithium concentration at the interface. All these parameters are dimensionless quantities, and more details about the non-dimensionalisation are provided in Appendix A. In addition, c s must be periodic in z ∈ R 3 . Even though here we consider the electrode particles to be isotropic, the same model would apply to anisotropic materials just taking the diffusion coefficients D s to be tensors.
At the mesoscale, the conservation of charge equations are posed in each electrode separately with the current i s and the exchange current per unit of volume J defined as In the previous equations, i app is the current density applied to the battery (defined to be positive during discharge), and S is the mesoscale electronic conductivity tensor in the electrode, which may vary in space and depend on temperature. The domain ∂Ω in s is the electrode-electrolyte contact surface as shown in Figure 2. Because in this model we do not consider the current collectors, we assume that the applied current density i app is known. However, in most of the cell configurations, in order to determine i app an additional problem at the macroscale for the specific geometry of the cell. This has been addressed in the literature mostly from a numerical point of view [26,27,28]. The incorporation of the current collectors into this homogenisation analysis is an area of future work.
Notice that two instances of problems (1) and (2) are needed to describe a cell, one for each electrode. The problem in (2) is for the positive electrode, while the problem in the negative electrode is the same but with the boundary condition (2b) having the opposite sign. In each electrode the parameters can take different values, but they are constant in each electrode. Also, the microstructure, defined by Ω s , is different in each electrode and the concentration fields c s may have significantly different behaviours in each electrode.
The electrolyte problem can be posed across the electrodes and the separator, and it is given by i e · n cell = 0, at ∂Ω cell , with the current in the electrolyte i e defined as The parameters D L and D A are the mesoscale diffusivity tensors for lithium ions and anions in the electrolyte respectively (that is, accounting for the microstructure), M L and M A are the mesoscale ion mobilities (which are tensors too), and ϕ e is the volume fraction occupied by the electrolyte. As we show during the homogenisation process, D L and D A must be multiples of each other as any anisotropy arising in the electrolyte can be caused only by the geometry, which is the same for both types of ions, and the same applies to the pair M L and M A . Both diffusivities and mobilities may depend on the ion concentration in the electrolyte and temperature. All these parameters, even if they are constant in each part (electrodes and separator) like the electrolyte volume fraction, have different values in each part. In particular, J is equal to zero in the separator as there is no reaction taking place. Notice as well that the electrolyte equations only consider the concentration of lithium ions because electroneutrality has been assumed in the electrolyte, and therefore the concentration of cations and anions must be the identical.
Because this is a homogenised model, we assume that D s , D L and D A are all of the same order of magnitude. Even though diffusion in the electrode is much slower than in the electrolyte, this effect has already been captured by the fact that diffusion in the electrode occurs at a much smaller length scale. In particular, D s is the same as in the microscale model in Section 3, while D L = D L B and where D L and D A are the microscale diffusivities and B is the tensor accounting for the geometry of the porous material as defined in Section 4.7.
The mesoscale heat equation is given by where θ is the volumetric heat capacity and K is the thermal conductivity tensor. The heat source term Q accounts for four different heat generation mechanisms: Joule heating in the electrode, Joule heating in the electrolyte, irreversible reaction heating and reversible reaction heating. These terms can be written as where Q s and Q e are tensors that account for the microstructure effects in the heat generation, and Π is the Peltier term. The Peltier term is defined as so it is temperature dependent. However, given that in many practical applications the U ocp is provided from experimental data (and so is its derivative with respect to temperature), we treat the Peltier term as a parameter function of the model. Then, the heat generation term is defined as The boundary conditions are not specified at this point as they depend on the problem of interest. To study a single cell, heat exchange conditions at the boundary could be used. If, instead, this equation is to be homogenised to obtain the battery heat equation, then periodic boundary conditions are required.
In a similar way, the heat equation at the battery level can be defined as with suitable boundary conditions, where θ batt is the average volumetric heat capacity of a cell, and K batt is the thermal conductivity tensor of the battery. The heat source term Q batt accounts for the heat generation in each cell and it is defined as An extra term could be added to Q batt to account for the heat generated in the current collectors, but for simplicity of the homogenisation problem we have not considered it. All the tensors that appear in the homogenised model can be calculated from material properties and microstructure, as detailed in Section 4.7.

Dimensionless microscale model
We now consider the dimensionless microscale model, from which we derive the effective model. The electrochemical model accounts for conservation of mass and charge in both the electrodes and the electrolyte, with Butler-Volmer kinetics for the intercalation reaction. The transport of lithium in the electrodes is by diffusion only, while in the electrolyte there is diffusion and migration due to the electric field. We use a dilute electrolyte model, and thus use Nernst-Planck equations, but analogous results can be found for concentrated electrolytes (see [24,21]). We assume as well that charge transport in the electrodes follows Ohm's law. The thermal model imposes conservation of energy in both electrode and electrolyte accounting only by diffusion effects, with a heat source term at the interface between them due to the chemical reaction. For a complete discussion of the microscale equations we refer the reader to the books [29,3].
The variables for the microscale problem are still the concentration of lithium in the electrodes c s and lithium ions in the electrolyte c e , the potentials Φ s and Φ e , and the temperature T . To be rigorous, these variables are not the same as those defined in Section 2, which are the leading order term in the asymptotic expansions of the microscale variables. However, to keep the notation simple, we do not use any symbol to distinguish them because for the rest of the paper we will refer to the microscale variables and their asymptotic expansions. For fluxes, on the other hand, we need to distinguish the homogenised ones from the bulk ones observed at the microscale, therefore we use tilde for the fluxes at the microscale (i.e.Ñ s ,ĩ s andK).
The microscale equations are defined in a domain Ω, which is divided into the electrode particles Ω s and the electrolyte Ω e . In the homogenisation process we consider the electrode and electrolyte separately (except for the thermal model), therefore we need to carefully define the notation in each domain. The thermal problem is defined as a single equation in the joint domain Ω because the thermal problem is the same in both electrode and electrolyte, just with different parameters. A detailed sketch of each of the subdomains and their boundaries is shown in Figure 2. A key assumption for the homogenisation is that the microstructure repeats periodically, therefore a finite domain that is representative of the geometry can be considered. The length scale of Ω is much smaller than the length scale of the porous electrode. Therefore, the ratio between length scales δ, which is a small parameter, arises in the equations and can be used in the homogenisation from microscale to mesoscale. The periodic, at ∂Ω out s , and where the only new parameters are the ratio between length scales at micro and mesoscale δ, and the microscale electronic conductivity σ s . The latter may depend on temperature and the spacial variables in order to account for inhomogeneities in the electrode material. Diffusion of lithium in the solid is much slower than diffusion of ions in the electrolyte, therefore we consider the limit in which the diffusivity in the solid is of O δ 2 . As pointed out in [12], this particular limit allows diffusion to happen only at the microscale, as we expect in a porous electrode battery.
The equations for the electrolyte are periodic, The new parameters here are D L and D A which are the diffusion coefficients of lithium ions and anions in the electrolyte, and µ L and µ A which are the ion mobilities. These are scalars as they are bulk parameters and do not account for the porous structure of the medium. We assume that diffusivities and mobilities of ions are homogeneous in space and do not depend on the concentration of ions or the voltage. However, they may depend on temperature. Notice the δ factor in the fluxes (6c)-(6d) and (7c)-(7d). This scaling arises from the fact that the surface area of the particles is of O δ −1 , and given that the total exchange current over each electrode is of O (1) this implies that the exchange currents (and ion fluxes) must be of O (δ). To pose the electrolyte microscale equations we have assumed electroneutrality, which is true except in a thin layer at the electrode-electrolyte interface. The size of this layer is defined by the Debye length, which is of the order of nanometres. Therefore, even at the microscale (which is of the order of micrometers) the electroneutrality assumption is reasonable. The dimensionless thermal model is periodic, at ∂Ω, and ρ is the density, c p the specific heat capacity, and k the thermal conductivity. All these parameters depend on z as they are different in each material, and they can vary within each material too. We also have thatĩ and Φ correspond toĩ e and Φ e , orĩ s and Φ s depending on whether the point in the domain is in Ω e or Ω s . We useK s to denote the flux on the electrode side of the interface andK e to denote the flux on the electrolyte side. These microscale equations account for the classic conservation of mass, charge and energy laws, so they are physically consistent (see [29,3] for details). However, given the complexity of the porous structure and the multiple scales involved in the problem, solving this model numerically is very challenging. The motivation to derive the homogenised mesoscale equations is to obtain a model of a lower complexity level that still captures most of the microstructure effects.

Derivation of the effective equations
We now proceed to homogenise the microscale equations defined in Section 3 in order to derive the effective equations presented in Section 2. To do so, we need to homogenise the equations at the microscale (i.e. porous material structure) to obtain the mesoscale equations (i.e. cell level). Then, we can assemble the mesoscale equations for a cell and homogenise them to obtain the macroscale equations (i.e. battery level).
In our problem, we have a particle microstructure of length scale composing a porous material of length scale L which makes a cell. A large number of these cells are put together to make a battery of length scale N L, where N is number of cells in the battery. Then, we define the following dimensionless numbers and we have that both δ, 1. These are the small numbers that we exploit for the homogenisation. In particular, for lithium ion batteries, using as typical values those in [14,15] and that the radius of a typical cylindrical cells is around 1 cm [30], we estimate values of δ and of the order of 10 −2 .
Taking the limit of small δ and , we can apply the chain rule to split the differential operators into the multiple scales. Recall, that the variable at the macroscale is x, at the mesoscale is y, and at the microscale is z. Then, when deriving the mesoscale equations, the operator acts on both the meso and microscales, so for a general function f we have When we assemble the cell model and upscale it to the battery level, the macro and mesoscales are involved, so we have where the subscripts in ∇ denote with respect to which variable the operator is applied. The homogenisation analysis presented here assumes that all the parameters except for δ or are of O (1). In practise, for the typical lithium-ion chemistries, some of these parameter are big or small but this does not affect the homogenisation analysis. Having defined the different scales and the operators, we can now proceed to homogenise the equations.

Conservation of mass in the electrode
We start by homogenising the conservation of mass in the electrode, which written accounting for the multiple scales, is given by periodic, at ∂Ω out s , We expand the concentration and the flux as so now we can substitute these expansions into (11) and linearise the problem. At leading order we find periodic, at ∂Ω out s , where g 0 , Φ s,0 and Φ e,0 are the leading order terms in the expansion for small δ of g, Φ s and Φ e respectively. Then, we conclude that the governing equation for the conservation of mass in the electrodes is periodic, at ∂Ω out s , which is the problem stated in (1). Notice that this problem is still at the microscale because the diffusion coefficient is of O δ 2 and, therefore, diffusion is so slow that can only be observed at the microscale. Because the homogenisation process does not change the diffusion coefficients for lithium in the electrode particles, the same result holds for anisotropic materials, just replacing the diffusion coefficient by a tensor.

Conservation of charge in the electrode
Next we consider the conservation of charge in the electrode, which is given by periodic, at ∂Ω out s , We expand the potential and the current as Notice that the expansion for current starts at δ −1 because of the definition (15d). Substituting these expansions into (15), multiplying by a power of δ so the leading order term is O (1), and expanding for small δ we find the following problems.

O(1) problem
At leading order we have the problem periodic, at ∂Ω out s , The first step in the homogenisation process is to show that Φ s,0 is independent of z. Multiplying (17a) by Φ s,0 and integrating it over the Ω s , we have that and applying the divergence theorem to the left hand side we find The boundary integral over ∂Ω s vanishes because of the conditions (17b) and (17c), and given that σ s is positive, |∇ z Φ s,0 | 2 = 0 over the entire domain Ω s which implies that Φ s,0 is independent of z. This also means thatĩ s,−1 = 0 and, therefore, the expansion of the current starts at O (1) as one would expect.

O(δ) problem
Now we consider the problem at O (δ), which, using the results from the O (1) problem, is given by periodic, at ∂Ω out s , Following the usual procedure for homogenisation (see [7] for details), we now write Φ s,1 = W s · ∇ y Φ s,0 , where W s depends only on z. Substitution into (20) gives the cell problem periodic, at ∂Ω out s , which determines W s .

O(δ 2 ) problem
We finally address the O δ 2 problem which is given by periodic, at ∂Ω out s , We now average (22a) over the domain Ω to determine the homogenised equations. Averaging the first term we find where is the homogenised current, and is the electric conductivity tensor. We can apply the divergence theorem to the second term of (22a) jointly with the conditions (22b) and (22c) to obtain Therefore, we conclude ∇ y · i s,0 = −J, where

Conservation of mass and charge in the electrolyte
We now focus on the equations in the electrolyte presented in (7). Splitting the differential operators into the two different scales we find with Now, we expand the following variables and fluxes as c e = c e,0 + δc e,1 + δ 2 c e,2 + O δ 3 , i e =ĩ e,0 + δĩ e,1 + O δ 2 .
Even though the fluxes should have a term of O δ −1 , following a similar analysis as in Section 4.2.1 we find that these components vanish. Then, the linearised problem yields the following equations.

O(1) problem
At leading order we have If the diffusion coefficients and mobilities are independent of c e,0 , Φ e,0 , and z, using a similar method as we did for Φ s,0 we can show that c e,0 and Φ e,0 do not depend on z.
We now write c e,1 = W e · ∇ y c e,0 and Φ e,1 = V e · ∇ y Φ e,0 so, using the fact that diffusivities and mobilities do not depend on z, (31) can be rearranged into the cell problems for each one. We find that both problems are identical, so we conclude that W e ≡ V e . In terms of notation we use W e , which is determined by the cell problem periodic, at ∂Ω out e ,

Conservation of heat at the mesoscale
The temperature equation, splitting the microscale from larger scales, is given by Now we expand the following quantities as where again it can be shown that the O δ −1 contributions in the fluxes vanish.

O(1) problem
At leading order the problem reads Therefore, following a similar argument to the one for Φ s,0 we conclude that T 0 is independent of z.

O(δ) problem
We now consider the O (δ) problem, and using that neither T 0 nor Φ 0 depend on z, we have periodic, at ∂Ω, whereK Defining T 1 = W T · ∇ y T 0 we obtain the cell problem for the thermal problem periodic, at ∂Ω, (39b) and notice that we do not need to account for the condition at the internal boundary as (39a) takes care of it.

O(δ 2 ) problem
We finally consider the O δ 2 problem We can now average (40a) over Ω to obtain the homogenised equation, doing the same type of manipulations as detailed in Section 4.2, The integral can be split up into one integral over Ω s and one over Ω e , so it can be written as The homogenised equation reads where Q e = −λi e,0 · (Q e ∇ y Φ e,0 ) , (42c) and

Conservation of heat at the macroscale
We finally homogenise the heat equation at the mesoscale (cell level) to obtain the heat equation at the macroscale (battery level). The mesoscale equation comes from assembling three instances of (42) to account for the electrodes and the separator, or even consider a more complicated structure to account for double coated electrodes as done in [25]. However, given that temperature and heat flux must be continuous across the interface between parts we can write it as a single problem with space varying parameters. Then, we can split the scales as in (10b) and write the mesoscale equation for temperature as where and Q is the heat generation term defined as Notice that the gradients appearing in Q are at the mesoscale only, so when we expand Q in powers of no term of O −1 arises. We now expand the variables as substitute them into (43) and linearise.

O(1) problem
At leading order we have therefore, by the same argument as in Section 4.4, we conclude that T 0 does not depend on y.

O( ) problem
Using the results found at leading order, the O ( ) problem reads periodic, where To obtain the cell problem, we make the substitution Finally, we consider the O 2 problem given by where Averaging over Ω cell we obtain the homogenised equation where

Discussion of the effective equations
We observe a few key differences between the microscale model presented in Section 3 and the homogenised one derived in this section. The first one is that, even though the microscale equations assumed isotropic materials and therefore all the transport properties were defined as scalars, in the homogenised equations the same transport properties become tensors and thus allow for anisotropy. This anisotropy arises from the porous structure. In some cases, such as with the electronic conductivity S, the anisotropy is caused by both geometric effects and the inhomogeneities in the material properties. However, in the electrolyte properties, the anisotropy arises purely from the geometry, which allows us to define the tensor B which accounts for the anisotropy of all electrolyte properties. Therefore, all the electrolyte transport tensors at the mesoscale must be multiples of each other. Another difference is the appearance of source terms in the electrochemical equations. These source terms capture the chemical reaction that, at the microscale, occurs at the boundary between electrode and electrolyte. However, due to the homogenisation process, this boundary is lost at the mesoscale but the reactions are captured by the source term. The same happens with the reaction contribution to the heat source terms Q irr and Q rev .
In the thermal equations, both at mesoscale and macroscale, we observe that what was the ρc p term in the microscale equation became the averaged volumetric heat capacities θ and θ batt , which can no longer be split into the averaged density and the averaged specific heat capacity. We also notice that the heat generation terms at the mesoscale have a similar structure to those at the microscale, but with the introduction of two tensors Q s and Q e that account for microstructure effects in Joule heating.
The macroscale thermal equation holds for any periodic cell structure, however notice that normally we encounter layered materials. In that case, as it is well known from the literature [7], we find that the tensor K batt is a diagonal tensor, and the diagonal values are the arithmetic average of the conductivities of each layer in the directions parallel to the layers, and the harmonic average of the conductivities in the direction perpendicular to the layers. Therefore, asymptotic homogenisation provides a rigorous proof to a result that is commonly used in the literature (e.g. [19]).
For the sake of clarity, when performing the homogenisation we have not explicitly accounted for the temperature dependence on the parameters, even though the parameters are allowed to depend on temperature. Given that we have determined that, at leading order, temperature does not depend on z, the analysis for temperature dependent parameters follows exactly the same way with some extra parameters arising from the derivatives of the parameters with respect to temperature.

Properties of the tensors
In the previous sections we have derived tensors that account for the material properties in the homogenised problem. These tensors have certain properties that show the type of behaviour to expect from the homogenised equations.

Symmetry
We start showing that the tensors are symmetric, which can be used to simplify some of the expressions. We show it for S because it has the most complicated definition in our model, and any other tensor that we have defined can be thought to be, from a mathematical point of view, a particular case of S. The method used here follows closely the one used in [22]. For simplicity in the notation, we define W (i) s to be the i-th component of the vector W s and e i is the basis vector in the i-th direction. Then, we define the integral which we can show to be zero using the divergence theorem and the boundary conditions in (21). Expanding the divergence in the integral, and using (21a) to eliminate some of the terms, we find and therefore we have from which we deduce that S is symmetric. Using similar procedures we can show that the other tensors we defined (B, K, K batt , M s and M e ) are symmetric as well.

Reduction of the transport properties
We now want to show that the presence of the microstructure reduces the transport properties. Mathematically, this is equivalent to showing that the diagonal elements of the tensor of a given transport phenomenon are smaller than the average of the microscale value over the cell for that same property. By considering the integral and manipulating it in a similar way it can be shown that the diagonal entries of the tensor satisfy

Analytical representation of the tensors
Exploiting the symmetry of the tensors we can simplify the way we defined some of them. Thus, we present the simpler expressions here under the same section for convenience of the reader. The electric conductivity tensor in the electrode is given by where the cell variable W s solves (21). The geometry of the electrolyte is captured by the tensor B which can then be used to define the transport properties in the electrolyte. The tensor is defined by where the cell variable W e solves (32). Using B we can define the tensors for diffusivities and mobilities used in (2) as The thermal conductivity of the cell is given by where the cell variable W T solves (39), and the Joule heating tensors in the electrode and the electrolyte are defined as Finally, the thermal conductivity of the battery is given by where the cell variable W cell solves (47).

Comparison with the DFN model
The model presented here can be regarded as a generalised version of the wellknown DFN model [1]. In this section we compare both models and point out the main differences. The DFN model does not include the battery level nor the thermal model, so the comparison will be only at the micro and mesoscale and at constant temperature. Another difference betwen the model presented here and the DFN model is that the first considers a capacitance term in the exchange current between the electrode and the electrolyte, thus we can reduce to the DFN model by setting C = 0.

Comparison at the microscale
One of the key assumptions of the DFN model is that the electrode particles are spherical and that there is a single representative particle at each point of the mesoscale electrode (i.e. one particle in each homogenisation cell). With these assumptions, our model (1) reduces to which is the same as in the DFN model. Here, r is the microscale space variable and takes the role of z in our model.

Comparison at the mesoscale
Note that the parameters in the DFN model are all scalar, whereas in the model presented in this paper some parameters are tensors, which can take into account anisotropy. However, it can be reduced to the isotropic case (as in the DFN model) by taking the tensors to be multiples of the identity tensor, as then they can be replaced by a scalar. Another main difference is the difference in dilute and concentrated theory which will necessarily lead to different expressions. However, the analysis presented here can be applied to the concentrated electrolyte equations (see [24,21] for details) to obtain analogous results.

Conservation of charge in the electrode
The conservation of charge for the solid in our model (2) reads Due to the spherical symmetry of the particles assumed in the DFN model, we can write the exchange current as where a is the surface area of the particles per unit of volume. To reduce to the DFN model, we need to neglect the capacitance of the double layer and the anistropy of the material. Notice that, even though we reduced our model to the DFN model, in fact, if we take the microstructure from the latter (a single particle surrounded by electrolyte) we will find that the conductivity is zero as the particles are not in contact with each other. In the DFN model, this is circumvented by taking an effective value for the conductivity instead of calculating it from the microscale problem.

Conservation of mass and charge in the electrolyte
Finally, we consider the equations in the electrolyte. Here is where the main difference arises: the DFN model uses concentrated electrolyte theory while we use dilute electrolyte theory (see [29] for details on both). Therefore, we cannot directly reduce the model presented here to the DFN model, but we can show that they have similar forms. This is useful as it points out that the concentrated electrolyte equations could be homogenised following a very similar method to the one presented here.
We start assuming isotropy, so we can take the coefficients to be scalars. We define D L = D L B, D A = D A B, M L = µ L B, and M A = µ A B, and due to isotropy we have B = BI where B is a scalar that captures the microstructure effect on the transport properties. For example, if we used the Bruggeman correlation, then B = ϕ 1.5 e (see [4] for details). The transference number of the lithium ions is defined as and given that for dilute electrolyte theory the mobilities and diffusivities are proportional to each other, we can replace the mobilities in the definition above for diffusivities. Multiplying (3b) by t + and substracting it from (3a) we find This is the same form as the DFN model by setting the effective ion diffusion coefficient to As explained earlier, B captures the microstructure effects. The 2(1 − t + ) factor captures the migration effects in the effective diffusion, but for the concentrated electrolyte this term should be (1 − 2t + ). This discrepancy has been deeply discussed and resolved in [31].
For the conservation of charge equation we can define so (3b), together with (3e), can be rearranged into which is the same form presented in [3]. However, this presents the same inconsistencies between dilute and concentrated electrolyte theories discussed in [31]. Therefore, in order to obtain the effective equations for a concentrated electrolyte one can use the same homogenisation method used in this article with the concentrated electrolyte equations.

Discussion
We derived an effective model for the thermal-electrochemical behaviour of porous electrode batteries (with a particular interest in lithium ion batteries) using the method of asymptotic homogenisation. We started from the governing equations at the microscale, which impose mass and charge conservation both in the electrode and the electrolyte, with an ion intercalation reaction at the electrode-electrolyte interface modelled by the Butler-Volmer equation. We assumed that transport of lithium in the electrode is governed by diffusion only and that Ohm's law holds for the charge. In the electrolyte, we used Nernst-Planck equations to describe the transport phenomena, assuming thus a dilute electrolyte. For the thermal model we assumed heat is only driven by diffusion, and it is generated in the bulk of the material due to Joule heating and at the electrode-electrolyte interface due to the chemical reaction (we included both reversible and irreversible effects). We exploited the disparity of length scales of the problem and took the limit of infinitely small electrode particles compared to electrode thickness. In this limit, we can derive the homogenised problem at the cell level (mesoscale). A particularity of the analysis is that we took the diffusion coefficient of lithium in the electrode to be small, in order to retrieve the diffusion of lithium only at the microscale, as observed in lithium ion batteries [14,15]. After deriving the mesoscale model for an electrode, we assembled the cell model (the model at the separator is a particular case of electrode model) and homogenised it to obtain the battery model, exploiting the limit of an infinitely thin cell compared to the battery.
The homogenised model presented here is a generalised version of the DFN model [1], so widely used in the modelling literature. The main differences between our model and the DFN model are that our model includes thermal and capacitance effects, and can account for an arbitrary microstructure. Even though we have not explicitly introduced the temperature dependence of the parameters, as it would clutter the notation, the analysis presented here easily extends for that case and the same homogenised equations are obtained but with temperature dependent tensors. With respect to the microstructure, in our model we can determine the effective mesoscale parameters directly from the microscopic properties, instead of using theoretical or empirical correlations, such as the Bruggeman correlation [4], which are a subject of debate within the battery modelling field. The model presented here also extends the literature on derivation of multiscale models for batteries using asymptotic homogenisation [23,24,21,22] because it includes thermal effects. In addition, it also captures the diffusion of lithium at the microscale.
The model presented here can be used to simulate electrodes with more realistic geometries, given that it can deal with microstructures more complex than the spherical particles used in the DFN model. For example, one could use SEM images of real electrodes to define the geometry of the cell problems and then solve them numerically. The method used here can also be used in a very similar way to homogenise a concentrated electrolyte model. Another area of future work is to include the current collectors into the model. Also, our model can be used as a stepping stone towards including more complex physical effects that occur in batteries which depend both on electrochemistry and temperature, such as degradation. Several degradation mechanisms that occur in batteries have been considered in the literature [32], but in many cases the degradation models have been coupled to the DFN model in a rather ad hoc way. The framework presented here could be extended to derive degradation models from the microscale models in a systematic and physically consistent way.

A Non-dimensionalisation of the model
In this section we introduce the dimensional model and the scalings that lead to the dimensionless microscale model presented in Section 3. The details of the derivation of the microscale equations can be found in the handbooks of the field (see [29,3]). In the electrode we have mass transport driven by diffusion and charge transport follows Ohm's law, with the reaction at the electrode-electrolyte interface modelled by Butler-Volmer equation. We model the electrolyte as a dilute electrolyte, and therefore we use Nernst-Planck equation to describe the transport of both positive and negative electrodes (see [29] for details). We also assume that the fluid is static. We can rearrange the equations to obtain an equation for the lithium ion and one equation for the current in the electrolyte. Finally, we model the temperature at the microscale using the heat equation. The model holds over both electrode and electrolyte domains and it has a source term in the bulk (Joule heating) and a source term at the electrode-electrolyte interface (reversible and irreversible reaction heating).
The variables of the problem are the concentration of lithium in the electrodes cs, the concentration of lithium ions in the electrolyte ce, the potentials in the electrode and electrolyte Φs and Φe, respectively, and the temperature T . For convenience in the notation, we define the fluxes, which are derived from the variables. We have the molar fluxes N s and N e, the currents is and ie, and the heat fluxes Ks and Ke, defined in the electrode and the electrolyte respectively. For convenience in the notation, in this appendix we do not use tildes for the fluxes at the microscale as those are the only ones that appear.
The dimensional equations in the electrode are ∂tcs + ∇ · N s = 0, in Ωs, (70a) F N s · ns = g + C Γ ∂t (Φs − Φe) , at ∂Ω in s , is · ns = g + C Γ ∂t (Φs − Φe) , at ∂Ω in s , periodic, at ∂Ω out s , with N s = −Ds∇cs, (70f) where F is the Faraday constant, C Γ is the double layer capacitance, Ds is the diffusion coefficient of lithium in the electrode, and σs is the electronic conductivity of the electrode. We also have the exchange current at the electrode-electrolyte interface g, in which K is the reaction rate, c max s is the maximum concentration in the electrode, R is the gas constant, β is the transfer coefficient of the reaction, and Uocp is the open circuit potential, which depends on the electrode concentration cs evaluated at the interface with the electrolyte.
The dimensional equations for the electrolyte read ∂tce + ∇ · N e = 0, in Ωe, (71a) F N e · ne = − (g + C Γ ∂t (Φs − Φe)) , at ∂Ω in e , ie · ne = − (g + C Γ ∂t (Φs − Φe)) , at ∂Ω in e , periodic, at ∂Ω out e , with N e = − (D L ∇ce + F µ L ce∇Φe) , (71f) where D L is the diffusivity of lithium ions, D A is the diffusivity of negative ions, µ L is the mobility of lithium ions, and µ A is the mobility of negative ions. The governing equations for the thermal model are ρcp∂tT + ∇ · K = −i · ∇Φ, in Ω, periodic, at ∂Ω, where where ρ is the density, cp is the specific heat capacity, k is the thermal conductivity, and Π is the Peltier term, accounting for reversible heat generation. Given that the heat equation is defined both in the electrode and the electrolyte, we dropped the subscripts of K, i and Φ in (72a) to simplify notation.
We now scale the variables and derived quantities as and the parameters of the model are scaled as Here N is the number of cells that compose a battery, L is the thickness of a cell, is the typical length scale of the microstructure, c 0 is characteristic concentration, Φ 0 is the characteristic potential, i 0 the characteristic current, T 0 is the reference temperature, ρ 0 is the characteristic density, and c p0 is the characteristic heat capacity. We scale the differential operator ∇ with the length scale L.
With these scalings, the following dimensionless numbers arise Using these scalings we can nondimensionalise the model (70)-(72). Dropping hats in order to simplify the notation, we obtain the model (6)- (8).