Concur with djack...you need to account for any mass and/or heat flow across the boundaries and work done by or on the control volume, including "flow work." Absent more specifics about your situation, I would start by consulting a good Thermo book on how to set this up.
Good luck