## 2 Model Development
\[E_{OCV}=\frac{\Delta G}{zF} \tag{3}\]4  
Both active compounds can provide current and the resulting two current densities can be summed up for each segment [14]. \[E_{OCV}=\frac{\Delta G}{zF} \tag{3}\]5  
Based on the two terms on the right side of Equation (10), the model calculates the change in concentration of each species and therefore the respective volume fraction for the next time step. In addition to the impact of charge transfer, the charge transport also needs to be considered. Here, both the current flow in the electrolyte and in the solid metal matrix phase are described by [PERSON]'s law [13; 14]. However, the effective conductivity is influenced by the porosity (\(\epsilon_{n,j}\)) of the cathodic area. Any change in the depth of discharge (DoD) directly influences the cathode porosity, \(\epsilon_{n,j}\), due to a decrease or increase in solid material (\(NaCl\), \(M\) and \(MCl_{2}\)). A direct relationship between the porosity and the electrolyte conductivity (\(\kappa_{n,j}\)) can be found by using the Bruggeman equation [11; 14; 15]:  
\[E_{OCV}=\frac{\Delta G}{zF} \tag{3}\]6  
The impact of the metal matrix porosity on the electron conductivity (\(\sigma_{e,n}\)) is described analogously [14]:  
\[E_{OCV}=\frac{\Delta G}{zF} \tag{3}\]7  
where the tortuosity factor is represented by \(\tau\) and the volume fraction of each metal by \(\epsilon_{M}\). Deducing the electrical resistance, \(R_{\sigma}\), and the ionic conduction resistance, \(R_{\kappa}\), for each segment \(n\) with the length \(l_{n}\) and exchange area \(A_{n}\):  
\[E_{OCV}=\frac{\Delta G}{zF} \tag{3}\]8 \[E_{OCV}=\frac{\Delta G}{zF} \tag{3}\]9  
Equations (13) and (14) serve as direct input parameters for the respective resistor element in the EC segment \(n\) in \[F:\text{Faraday constant}\]0  
Furthermore, the charge transfer reaction in the anode leads to a drop in cell voltage (\(\eta_{A}\)). The anode overpotential is expected to be low due to the high sodium conductivity. Therefore, it is reasonable to use the linearized Butler-Volmer Equation (Equation (15)) [11; 25]. \[F:\text{Faraday constant}\]1  
The simulation itself was set up in MATLAB R2021b and the mathematical model was implemented and expanded as follows:  
* Cylindrical cell geometry with the cathode space divided into 100 segments;
* \(FeCl_{2}\) as an additional active compound besides \(NiCl_{2}\);
* Electron transfer in the metal matrix of the cathode;
* A constant current charging and discharging cycle;
* Heat generation. The general structure of the code is shown in Figure 3 and will be briefly described in the following. The procedure was initialized by setting the amount of each species homogeneously distributed over the cathode space (see note at the end of this section). Within the first step, a value for \(\eta_{c}\) is estimated and set in the EC Model as \(\eta_{1}\) in the Butler-Volmer equation of segment 1 located at the separator. Running the model will return the respective current transfer values and charge transport losses of all segments. The estimated \(\eta_{c}\) value is valid in cases where the first break condition is reached. Otherwise, a loop process starts to approximate \(\eta_{c}\) until the condition is fulfilled (see Figure 3). This first break condition is derived from [PERSON]'s current law, which states that the sum of the currents flowing in a node is equal to the sum flowing out of the same node. Applied on the described network, the ionic current flowing into the network (\(i_{\kappa,\beta}\)) must be equal to electronic current flowing out of the network (\(i_{\sigma,N}\)) (see Equation (16)). Inaccuracies due to rounding errors are taken into account including a tolerance (\(tol\)) into Equation (16). \[F:\text{Faraday constant}\]2  
The \(\eta_{c}\) value is optimized in the next step by using the fmincon function provided in MATLAB. Therefore, a second condition is implemented. The second condition states that \(\eta_{c}\) must have a negative or a positive sign for discharging or charging, respectively.