Simulation of a concept for a compact ultrafast X-ray pulse source based on RF and THz technologies