Polarity reversals in geodynamo models with core evolution