Oil and gas account for 60% of the world's energy consumption. Drilling muds that are used to advance oil and gas wells must be engineered to avoid wellbore integrity problems associated with mud cake formation, to favor cake erosion during cementing, and to prevent partial differential sticking. We developed a robust mud cake growth model for water-based mud based on wide stress-range constitutive equations within a Lagrangian reference system to avoid non-natural moving boundary solutions. The comprehensive mud cake growth model readily accommodates environmental factors (e.g., temperature, pH, and ionic concentration) and defines the yield stress distribution for displacement-erosion analyses. Results show that the mud cake thickness is more sensitive to time than to filtration pressure, therefore, time controls the non-uniform distribution of mudcake thickness during drilling. Long filtration time, high permeability, high salinity, high in-situ temperature and low viscosity exacerbate fluid loss and give rise to thick filter cakes. The analysis of residual cake thickness during cement displacement must take into account the effective stress dependent mudcake formation and the time-dependent mud thixotropy. Thixotropy dominates the mud yield stress at high void ratios, e.g. e > 20. The offsetting force that causes differential pressure sticking increases sub-linearly as a power function of the still-time.