Simulation of lamellar phase transitions in block copolymers