Optimal gas-power flow (OGPF) is one of the most fundamental problems for the operation of integrated electric-gas systems (IEGSs), where the gas flow dynamics partial differential equations (PDEs) are computational challenging. This paper aims to propose a lightweight and accurate model for gas flow dynamics for the OGPF problem. Firstly, the second-order hyperbolic PDEs are equivalently derived based on the original PDEs. Then, the second-order hyperbolic PDEs are discretized using the tri-layer explicit difference scheme. Given some mild boundary and initial conditions, the time-domain two-port model for gas flow dynamics is established, where the state variables of the in-between segments of the pipeline are eliminated. Finally, the iterative parameter updating procedure is devised to improve the modeling accuracy. The lightweight feature of the proposed gas flow dynamics model is verified by the simulation results of several test systems.