I am trying to define a variable in a following class.
You didn't show us a "following class". I assume this is a member function of the EllisLaw class within the Foam and viscosityModels namespaces, but viscosityModels and Foam could be containing classes, or they could all be namespaces and calcNu is not a member function. I don't have enough information to understand what the class is, where you want to declare the variable, etc.
Possiby what you want, rather than a variable AB, is a funtion AB() that retrieves the old_visc and strain_rate() and returns the product. But I can't tell from the details you gave us.