I think we are missing clarity in question. Do you mean energy stored in the battery or the energy consumed?
Energy consumed in the battery ( dissipated as heat) is due to the internal resistance of the bank, terminal contact resistance etc. It depends on the charging/ discharging current and the charging/discharging time. It doesn't matter whether it is an EV or Stationary battery.
You should relate the SOC(t) at time t with the total charge capacity C_T(t) and the voltage U(t) of the battery bank to calculate the energy E(t) at time t. When you subtract the initial energy E(0) stored in the battery banks from E(t) it leads to the consumed energy you want.