The energy preserving average vector field (AVF) integrator is applied to evolutionary partial differential equations (PDEs) in bi-Hamiltonian form with nonconstant Poisson structures. Numerical results for the Korteweg de Vries (KdV) equation and for the Ito type coupled KdV equation confirm the long term preservation of the Hamiltonians and Casimir integrals, which is essential in simulating waves and solitons. Dispersive properties of the AVF integrator are investigated for the linearized equations to examine the nonlinear dynamics after discretization.