Simulating a binary system that experiences the grazing envelope evolution