I have a box filled with a gas ( a real gas , cannot be approximated to a ideal gas) in which the molecules are jiggling. This box is in a gravitational field and an electric field and has a piston over it. The piston is not diathermal and the gas is somehow doing work on the piston. Together with this , the box is moving in the gravitational field as well as the electric field and there is an external force on the box which is continuously accelerating it. Moreover outside the box there is some medium which is applying a non conservative force on the box as it moves ( friction ).
What would be the 1st law in this case for the entire box piston system. I am not asking for a solution ( it might not be possible ). I am asking what the general equation of the 1st law would become ( just the terms that would be added ) due to gravitational , electric and non conservative force effect. What shall be the energy Conservation equation in the above