In industry, viscosity is widely used to assess the level of internal friction in a fluid in order to evaluate lubricant oil performance. Various sensing equipment has been developed to measure viscosity, either offline or online. However, most offline methods weaken the rheological behaviour of the fluid, resulting in inaccurate measurements. Online monitoring can overcome this limitation but viscosity measurements at real-time temperatures still cannot be directly converted to viscosities at the standard temperatures in ISO 3448. Consideration of the effect of temperature in transferring real-time viscosity measurement into the ISO standard presents a challenge. To bridge this research gap, this paper proposes a novel flow structure for online viscosity measurement by considering the effect of temperature. In order to eliminate the friction-heat effect and turbulent flow of the fluid, the structure parameters (such as flow diameter and heat transfer area) of the new viscosity sensing device are optimised by computational fluid dynamics (CFD) analysis using ANSYS/fluent simulations. The optimisation results demonstrate a linear relationship between the outlet, the inlet and the environmental temperatures of the designed flow structure under laminar flow. As a result, the outlet temperature can be controlled to obtain the viscosity-temperature characteristics of the lubricant oil using an online approach. In this way, the real-time viscosity measurement can be converted into the ISO standard to achieve effective online viscosity monitoring.