A theoretical study of swelling and shrinking of hydrated Wyoming montmorillonite