Towards understanding magnetic field generation in relativistic shocks with GRB afterglow observations and the GRB radiation mechanism with photospheric simulations and the X-ray flare radiation mechanism