Energy exists in many forms and their sum is the total energy of the system. Thermodynamics deals with the change of the total energy. The book I am studying from (Thermodynamics: An engineering approach) divides the total energy into two groups: macroscopic or microscopic. The macroscopic forms of energy are those a system possesses as a whole with respect to some outside reference frame. The microscopic forms of energy are those related to the molecular structure of a system and the degree of the molecular activity, and they are independent of outside reference frames.
How are we not accounting for certain forms of energy twice when we consider the system macroscopically and microscopically?
For example, if the phase of the system is a solid or liquid and we fix a reference frame, find its center of mass, and measure the change in its position with respect to a fixed coordinate frame over time. Macroscopically, we can observe (even qualitatively without taking measurements) and tell if the system is at rest or moving, and we can calculate the kinetic energy the system possesses and determine changes in kinetic energy. I am not sure how we calculate the kinetic energy the system possesses if the system is in the gas phase, since most gases are colorless and do not have a definite volume and shape. I understand that changes in velocity will be caused by a force acting on the system, and that if we reduce the system to a point (center of mass) we can analyze the system and determine the external force acting on it.
If we take the same system in the gas phase (I chose gas phase since in the solid phase and liquid phase there are intermolecular forces) and view it on a microscopic scale, given a molecule in space, there are other molecules in space colliding with it and imparting a force on it, causing it to move through space with a constant/changing velocity and thus they posses kinetic energy. If we sum the kinetic energies and divide by the number of molecules, we obtain an average kinetic energy. Is this the same as the kinetic energy calculated above?. How is the system at rest (macroscopically) and moving at the same time (and possesing different kinetic energies with time as a result of the collisions)?