Similarity properties of demineralization and degradation of cracked porous materials