TCAD simulation of gate-enclosed MOSFET for terahertz detector