wrote some functions required for high-order viscosity