 What we're now going to do is we're going to take a look at an equation that enables us to calculate the entropy balance of a system and within this there will be a term for quantifying the amount of entropy being generated within the system and we'll be looking at this for both a closed system as well as for an open system. Now the equation that we come up with it will enable us to compute the increase of entropy within a system and we'll call that entropy generation so capital S and subscript GEN for generation and this would be during a process. In the previous lecture we did take a look at an example problem with the entropy generation equation and so we've already seen a form of that but now we'll formally present it. So the equation that we're working with is entropy in minus entropy out plus entropy generation is equal to the change in entropy within the system and the units of this equation are in kilojoules per Kelvin. So let's take a look at the mechanisms by which entropy can be coming into or leaving our system. The main mechanism by which entropy, well there are two main mechanisms, one is heat transfer and the other is mass transfer coming into or leaving our system. So to begin with heat transfer we write S and then small heat quantifying it it is the heat transfer divided by the temperature at which that heat transfer is taking place and so the units of that term are kilojoules per Kelvin. Work, work does not contribute to any kind of entropy generation and consequently what we can write is entropy from work is equal to zero and finally mass flow when we have mass crossing our system boundary the mass itself can bring in entropy and it can leave with entropy and consequently we quantify that by S mass equals to the mass times the entropy per unit mass. So the units of that particular term that we looked at there would be kilograms for the mass multiplied by kilojoules per kilogram Kelvin which is our standard units for entropy. So the form of heat transfer coming in that remember entropy is a quantification of the random motions molecular motions within our system and heat transfer is a mechanism as we saw when we looked at conduction whereby energy is transferring into the system in a disorganized state. Work transfer is not disorganized work itself is organized and therefore when it crosses our boundary it does not contribute to the entropy generation. Mass coming in has thermal energy it has random motions of the molecules that is where it brings entropy into our system and when mass leaves it does the same thing it takes it away. So that is the equation what we're going to do now is take a look at the equation for entropy generation both for a closed system as well as for an open system. So let's look at a closed system and this is also referred to as being a fixed mass system. So the equation for this will be the sum of the heat transfer that is taking place across our boundary plus any kind of generation and then that is equal to the change of the system. So that would be quantified by entropy at state 2 minus entropy at state 1 if we were going through a process. The units of this are kilojoules per Kelvin and looking at an open system so the control volume approach where you would have mass crossing the boundary and I'm going to express this in rate form and so that means that we will have mass flow rates and heat transfer rates so that will be in kilojoules per second and mass flow rates are kilograms per second. But the form of the entropy generation equation or the entropy balance I should say and be careful with these expressions because the temperature in the first term with heat transfer needs to be in Kelvin and so it has to be in Kelvin not in degrees Celsius. Now we have the mass crossing the boundary so we could have mass coming into our control surface and then we sum all mass exiting because we could have multiple inputs and multiple outputs depending upon the system plus generation within our control volume and then that would be equal to the change in entropy for the control volume and the units of this given it's in rate form will be kilowatts per Kelvin. So those are two equations that we will be using to determine the entropy balance quite often we use it to determine entropy generation within a particular system that we may be studying.