The size of the design domain, i.e. the porous medium block (Ω b in Fig. ), was 30 × 5 mm 2 and 20 × 20 × 5 mm 3 for the 2D and 3D simulations, respectively, meaning that the thickness of the electrode was considered to be 5mm. The thickness is higher than typical thin electrodes in electrochemical flow cells such as carbon paper and cloth, but it is a representative of carbon felt electrodes which feature 3 -6 mm of thickness. For both 2D and 3D cases, a mesh sensitivity study was performed to make sure that the mesh size does not affect the optimization output, the results of which are presented in the supplementary materials of this paper (Tables and). The chosen computational mesh contained 108,560 and 1,890,016 tetrahedral elements for the 2D and 3D cases, respectively. As a result, in the 2D case, the number of DoFs was 109,930 and 491,943 for the charge and flow problems, respectively. For the 3D case, the charge and flow problems contained 655,494 and 8,121,144, respectively. It is worth noting that the number of DoFs corresponds to the utilized mixed formulation and the second-order finite element used for the velocity components.