Modeling terrestrial gamma ray flashes produced by relativistic feedback discharges