One innovative approach for producing functionally graded tungsten/copper composites involves infiltrating a porous tungsten structure with molten copper. The porous structure is created by sintering tungsten powder to create an initial porous preform and then connecting the preform to the anode of an electrochemical cell. The porosity increases with time as the tungsten oxidizes in the alkaline electrolyte. The rate of porosity increase depends on the local value of electric-potential difference between the electrode and electrolyte, while the local electrical properties are a function of the porosity. Therefore, the porosity distribution, which determines the material-property gradient of the resulting material, can be modeled by a system of coupled equations describing porosity and electric potential. The present work develops a numerical tool capable of predicting the evolution of porosity in the rectangular-slab geometry (the extension to cylindrical-shell and elliptical-shell geometries is straightforward). Analysis of the results suggests that the shape of the gradient can be varied by adjusting parameters such as initial porosity and current density.