# Entropy Changes in Electrolytic/Galvanic Cell?

Dario56
Summary
Why is entropy change in electrolytic/galvanic cell connected with heat exchanged with surroundings?
One of the most fundamental equations in chemical thermodynamics states: $$\Delta_rH_m^⦵ = \Delta_rG_m^⦵ + T \Delta_rS_m^⦵$$

If we look at this equation in context of net chemical reaction in electrolytic or galvanic cell, it is usually interpreted as follows: Enthalpy of reaction denotes total amount of energy at constant temperature and pressure which needs to be supplied (electrolytic cell) or which is released (galvanic cell) during a reaction, standard Gibbs energy of reaction denotes what amount needs to be supplied or which is released in form of electrical energy (electric potential difference between electrodes), the last term including standard entropy of reaction denotes what amount of heat is exchanged with surroundings during a process.

In electrolytic cell, as entropy of reaction is mostly positive, last term is usually interpreted as heat which comes from surroundings and as such it increases entropy of the system. As heat comes to the system, it helps us during electrolysis since we don't need to put in the whole enthalpy of reaction in form of electrical energy, but only Gibbs energy. In galvanic cell it is the other way around.

What I don't understand is the interpretation of that last term ,which includes entropy of reaction, which I found on hyperphysics page. According to hyperphysics, this term denotes heat exchanged with surroundings and they say that entropy change in the system is due that heat exchanged.

I would say that entropy change is not due to heat exchanged, but due to the fact that during chemical reactions entropy changes because products and reactants have different entropies since they are different compounds with different structure and aggregate state. Entropy of reaction denotes such entropic changes and not entropy changes due to heat exchanged. What are your thoughts?

## Answers and Replies

Mentor
Thank you for your last paragraph, which explains your thoughts on this more clearly. The standard entropy changes as a result of reaction will be reflected in any reversible process which goes from the initial state of reactants to the final state of products, and. this will be equal to the heat added divided by the standard temperature. For example, in the case of ideal gas reactions, the standard entropy change is the change in entropy in going from pure reactants in stoichiometric proportions at 1 bar and 298 K to pure products in corresponding stoichiometric proportions at 1 bar and 298 K, and this is exactly equal to the amount of heat you will have to add divided in any reversible path divided by 298 K to get from the initial state to the final state (provided that the only heat exchange is from a constant temperature reservoir at 298 K).

Last edited:
Dario56
Thank you for your last paragraph, which explains your thoughts on this more clearly. The standard entropy changes as a result of reaction will be reflected in any reversible process which goes from the initial state of reactants to the final state of products, and. this will be equal to the heat added divided by the standard temperature. For example, in the case of ideal gas reactions, the standard entropy change is the change in entropy in going from pure reactants in stoichiometric proportions at 1 bar and 298 K to pure products in corresponding stoichiometric proportions at 1 bar and 298 K, and this is exactly equal to the amount of heat you will have to add divided in any reversible path divided by 298 K to get from the initial state to the final state (provided that the only heat exchange is from a constant temperature reservoir at 298 K).
Hmm, problem here is that if standard reaction entropy is equal to quotient of standard reaction enthalpy and temperature than standard reaction Gibbs energy would be zero (from equation I've written in main question) for all reactions which isn't true.

Mentor
That is correct. It isn't true. Before I direct you to a Physics Forums thread that addresses this very paradox, I would like you to do something for me please. Please, if you can, devise a reversible process that transitions the system of pure reactants in the initial state as I described in Post #2 to pure products in the final state I described in Post #2. If you have trouble doing this, I will understand and help. This is not a simple question.

Mentor
If you are having trouble, I can help. Here is a hint: check out the "van't Hoff Equilibrium Box."

Dario56
If you are having trouble, I can help. Here is a hint: check out the "van't Hoff Equilibrium Box."
I am actually busy right now, so unfortunately I am not able to give this problem some time. Thank you.

Dario56
Well, whenever you have time, see this

I don't see the connection between my question and this thread. This thread discusses different setup and problematic than what I asked in my question regarding electrolytic/galvanic cell. It discusses system already at chemical equilibrium which isn't the case with electrolytic nor galvanic cell when operating. It also discusses entropy changes due to mixing which has nothing to with what I asked. Question is what does entropy of reaction in electrolytic cell have to do with heat exchanged between electrolytic cell and surroundings since entropy change of reaction has to do with change in structure and aggregate state of reaction species and not heat exchanged?

Mentor
I don't see the connection between my question and this thread. This thread discusses different setup and problematic than what I asked in my question regarding electrolytic/galvanic cell. It discusses system already at chemical equilibrium which isn't the case with electrolytic nor galvanic cell when operating. It also discusses entropy changes due to mixing which has nothing to with what I asked. Question is what does entropy of reaction in electrolytic cell have to do with heat exchanged between electrolytic cell and surroundings since entropy change of reaction has to do with change in structure and aggregate state of reaction species and not heat exchanged?
Before you can understand why ##\Delta H## is not equal to ##T\Delta S## for an electrolytic reaction, it is first important to understand why it is not equal for the much simpler case of an ideal gas reaction.

Dario56
Before you can understand why ##\Delta H## is not equal to ##T\Delta S## for an electrolytic reaction, it is first important to understand why it is not equal for the much simpler case of an ideal gas reaction.
I don't claim they are equal.

Mentor
what does entropy of reaction in electrolytic cell have to do with heat exchanged between electrolytic cell and surroundings since entropy change of reaction has to do with change in structure and aggregate state of reaction species and not heat exchanged?
We are really talking about 2 aspects of the same effect. When a chemical reaction occurs, there are energetics associated with breaking old chemical bonds and making new bonds. If the chemical species participating in the reaction are close to equilibrium, the entropy change is a measure of these energetics. if the net enthalpy change resulting from these energetics were not removed from or added to the reaction system in the form of heat transfer to or from the surroundings, the temperature of the system would change. In order to hold the temperature constant, the enthalpy of reaction must be offset. The net heat transfer from the surroundings to the system divided by the constant temperature (for a reaction system close to equilibrium) equals the entropy change of the reaction.

Mentor
See Denbigh, Principles of Chemical Equilibrium; Section 2.4 and 2.5 b

Mentor
I don't see the connection between my question and this thread. This thread discusses different setup and problematic than what I asked in my question regarding electrolytic/galvanic cell. It discusses system already at chemical equilibrium which isn't the case with electrolytic nor galvanic cell when operating. It also discusses entropy changes due to mixing which has nothing to with what I asked. Question is what does entropy of reaction in electrolytic cell have to do with heat exchanged between electrolytic cell and surroundings since entropy change of reaction has to do with change in structure and aggregate state of reaction species and not heat exchanged?
In my judgment, you have completely misunderstood the functioning of the van't Hoff equilibrium box and much too cavalierly discounted and dismissed it. Please articulate for me your understanding of the process that the van't Hoff equilibrium box performs and how it accomplishes this. Please understand that there is no mixing changes in entropy occurring in a van't Hoff equilibrium box.

Dario56
In my judgment, you have completely misunderstood the functioning of the van't Hoff equilibrium box and much too cavalierly discounted and dismissed it. Please articulate for me your understanding of the process that the van't Hoff equilibrium box performs and how it accomplishes this. Please understand that there is no mixing changes in entropy occurring in a van't Hoff equilibrium box.
Well, I didn't get into it in detail at least for now. But, in the first answer to the thread/questions you posted, someone did mention entropy of mixing at the end of his answer and connected it to equilibrium constant. Even though I didn't get into it in detail, problematic which this thread discusses isn't really what I am asking or what isn't clear to me.

Mentor
The van't Hoff equilibrium box is extremely closely related to what you are interested in, although you don't realize it yet. Please take the time to learn about it, and as a check, please articulate for me your. understanding about what it does and how it operates. You will have to take my word for it; you won't be disappointed. It is an extremely powerful concept for understanding the thermodynamics of chemical reactions.

Dario56
The van't Hoff equilibrium box is extremely closely related to what you are interested in, although you don't realize it yet. Please take the time to learn about it, and as a check, please articulate for me your. understanding about what it does and how it operates. You will have to take my word for it; you won't be disappointed. It is an extremely powerful concept for understanding the thermodynamics of chemical reactions.
Okay, if you say so. On the internet there isn't much recognition of the term Van't Hoff equilibrium box.

Mentor The Van't Hoff equilibrium box is a device for carrying out a chemical reaction between ideal gas species reversibly. That is, it carries out a process in an open system for converting pure reactants to pure products at quasi static (negligible) rate of reaction.

The Van't Hoff equilibrium box is a chamber containing a mixture of reactants and products at equilibrium. It is connected to an array of cylinders, each containing one of the pure reactants or products. The chamber itself is operated at constant total pressure and temperature. The cylinders are each connected to the equilibrium box through a semipermeable membrane that only passes that species into the chamber. Pure species are introduced in stoichiometric proportions to the chamber through these membranes at pressures that are the same as their partial pressures in the reaction mixture, and pure products are removed in stoichiometric proportions at pressures. that are the same as their partial pressures in the reaction mixture. So the operation of the equilibrium box is reversible, and the delta G in going from pure reactants in to pure products out is zero.

For more details, see Introduction to Chemical Engineering Thermodynamics by Smith and Van Ness, Chapter 15, pages 505-507.

• Dario56
Dario56
View attachment 282832

The Van't Hoff equilibrium box is a device for carrying out a chemical reaction between ideal gas species reversibly. That is, it carries out a process in an open system for converting pure reactants to pure products at quasi static (negligible) rate of reaction.

The Van't Hoff equilibrium box is a chamber containing a mixture of reactants and products at equilibrium. It is connected to an array of cylinders, each containing one of the pure reactants or products. The chamber itself is operated at constant total pressure and temperature. The cylinders are each connected to the equilibrium box through a semipermeable membrane that only passes that species into the chamber. Pure species are introduced in stoichiometric proportions to the chamber through these membranes at pressures that are the same as their partial pressures in the reaction mixture, and pure products are removed in stoichiometric proportions at pressures. that are the same as their partial pressures in the reaction mixture. So the operation of the equilibrium box is reversible, and the delta G in going from pure reactants in to pure products out is zero.

For more details, see Introduction to Chemical Engineering Thermodynamics by Smith and Van Ness, Chapter 15, pages 505-507.
Thank you, you are really putting in a lof of work to help others with their questions. Well, deltaG is equal to zero since system is at chemical equilibrium. Standard deltaG has some other value.

Mentor
Thank you, you are really putting in a lof of work to help others with their questions. Well, deltaG is equal to zero since system is at chemical equilibrium. Standard deltaG has some other value.
Yes, there are two additional steps (outside the box) to go from the initial standard state to the final standard state.

Dario56
We are really talking about 2 aspects of the same effect. When a chemical reaction occurs, there are energetics associated with breaking old chemical bonds and making new bonds. If the chemical species participating in the reaction are close to equilibrium, the entropy change is a measure of these energetics. if the net enthalpy change resulting from these energetics were not removed from or added to the reaction system in the form of heat transfer to or from the surroundings, the temperature of the system would change. In order to hold the temperature constant, the enthalpy of reaction must be offset. The net heat transfer from the surroundings to the system divided by the constant temperature (for a reaction system close to equilibrium) equals the entropy change of the reaction.

Yes, there are two additional steps (outside the box) to go from the initial standard state to the final standard state.
Yes, this was discussed in your thread. Reactants and products change their state between standard state to state at chemical equilibrium in the chamber (standard pressure to partial pressure)

• Chestermiller
Mentor
So in the equilibrium box, there is no entropy change of mixing. The only entropy change is due to chemical reaction. And the entropy change pre mole of conversion in the equilibrium box is equal to the heat of reaction divided by the absolute temperature.

In the isothermal expansions of the reactants in the step upstream of the equilibrium box, the changes in enthalpy of the ideal gas reactants are zero, but the changes in entropy are equal to the expansion work done by the gas divided by the absolute temperature. And, in the isothermal compression step of the products downstream of the equilibrium box, the changes in enthalpy of the ideal gas products are zero, but the changes in entropy are equal to minus the work done by the surroundings to compress the products divided by the absolute temperature.

So in the steps upstream and downstream of the equilibrium box, there are changes in entropy but no changes in enthalpy, and, in the equilibrium box, the change in entropy is the heat of reaction divided by the temperature.

Dario56
We are really talking about 2 aspects of the same effect. When a chemical reaction occurs, there are energetics associated with breaking old chemical bonds and making new bonds. If the chemical species participating in the reaction are close to equilibrium, the entropy change is a measure of these energetics. if the net enthalpy change resulting from these energetics were not removed from or added to the reaction system in the form of heat transfer to or from the surroundings, the temperature of the system would change. In order to hold the temperature constant, the enthalpy of reaction must be offset. The net heat transfer from the surroundings to the system divided by the constant temperature (for a reaction system close to equilibrium) equals the entropy change
So in the equilibrium box, there is no entropy change of mixing. The only entropy change is due to chemical reaction. And the entropy change pre mole of conversion in the equilibrium box is equal to the heat of reaction divided by the absolute temperature.

In the isothermal expansions of the reactants in the step upstream of the equilibrium box, the changes in enthalpy of the ideal gas reactants are zero, but the changes in entropy are equal to the expansion work done by the gas divided by the absolute temperature. And, in the isothermal compression step of the products downstream of the equilibrium box, the changes in enthalpy of the ideal gas products are zero, but the changes in entropy are equal to minus the work done by the surroundings to compress the products divided by the absolute temperature.

So in the steps upstream and downstream of the equilibrium box, there are changes in entropy but no changes in enthalpy, and, in the equilibrium box, the change in entropy is the heat of reaction divided by the temperature.

So in the equilibrium box, there is no entropy change of mixing. The only entropy change is due to chemical reaction. And the entropy change pre mole of conversion in the equilibrium box is equal to the heat of reaction divided by the absolute temperature.

In the isothermal expansions of the reactants in the step upstream of the equilibrium box, the changes in enthalpy of the ideal gas reactants are zero, but the changes in entropy are equal to the expansion work done by the gas divided by the absolute temperature. And, in the isothermal compression step of the products downstream of the equilibrium box, the changes in enthalpy of the ideal gas products are zero, but the changes in entropy are equal to minus the work done by the surroundings to compress the products divided by the absolute temperature.

So in the steps upstream and downstream of the equilibrium box, there are changes in entropy but no changes in enthalpy, and, in the equilibrium box, the change in entropy is the heat of reaction divided by the temperature.
Yes, thank you. What I am not sure about is if standard entropy of reaction is standard enthalpy of reaction divided by T than, standard Gibbs Energy should be zero. In the case of equilibrium box since there are no effects of mixing we are talking about standard enthalpy and entropy since for gases standard state is PURE component at 1 bar. So, heat of reaction is standard enthalpy of reaction and entropy change of reaction is also standard entropy of reaction. If you say that standard entropy is standard enthalpy divided by T than standard deltaG is zero for all reactions. This is not clear to me.

Last edited:
Mentor
Yes, thank you. What I am not sure about is if standard entropy of reaction is standard enthalpy of reaction divided by T than, standard Gibbs Energy should be zero. In the case of equilibrium box since there are no effects of mixing we are talking about standard enthalpy and entropy since for gases standard state is PURE component at 1 bar. So, heat of reaction is standard enthalpy of reaction and entropy change of reaction is also standard entropy of reaction. If you say that standard entropy is standard enthalpy divided by T than standard deltaG is zero for all reactions. This is not clear to me.
As I said in the post's you quote, bringing about the change from the initial standard state of pure reactants at 1 bar and 298 K to pure products at 1 bar and 298 K involves a 3-step process:

1. Expanding the reactants isothermally from 1 bar to their partial pressures in the equilibrium box

2. Continuously (quasi statically) injecting reactants through semi-permeable membranes into the equilibrium box at their equilibrium partial pressures, allowing them to react to form products, and continuously (quasi statically) removing products through semi-permeable membranes at their equilibrium partial pressures.

3. Compressing the products isothermally from their partial pressures in the equilibrium box to 1 bar

So, $$\Delta H^0=\Delta H_1+\Delta H_2+\Delta H_3$$$$\Delta S^0=\Delta S_1+\Delta S_2+\Delta S_3$$$$\Delta G^0=\Delta G_1+\Delta G_2+\Delta G_3$$But, for ideal gases, ##\Delta H_1=\Delta H_3=0##, so $$\Delta H_2=\Delta H^0$$And, in the equilibrium box, since ##\Delta G_2=0##, $$\Delta S_2=\frac{\Delta H_2}{T}==\frac{\Delta H^0}{T}$$For a reaction of ideal gas species, such as ##aA+bB=cC+dD## for example, the entropy changes for steps 1 and 3 are: $$\Delta S_1=-aR\ln{p_A}-bR\ln{p_B}$$and$$\Delta S_3=cR\ln{p_C}+dR\ln{p_D}$$So, for the standard entropy change for this reaction, we have:
$$\Delta S^0=-aR\ln{p_A}-bR\ln{p_B}+\frac{\Delta H^0}{T}+cR\ln{p_C}+dR\ln{p_D}=\frac{\Delta H^0}{T}+R\ln{K}$$where K is the equilibrium constant. So, $$\Delta H^0=T\Delta S^0-RT\ln{K}$$

Dario56
As I said in the post's you quote, bringing about the change from the initial standard state of pure reactants at 1 bar and 298 K to pure products at 1 bar and 298 K involves a 3-step process:

1. Expanding the reactants isothermally from 1 bar to their partial pressures in the equilibrium box

2. Continuously (quasi statically) injecting reactants through semi-permeable membranes into the equilibrium box at their equilibrium partial pressures, allowing them to react to form products, and continuously (quasi statically) removing products through semi-permeable membranes at their equilibrium partial pressures.

3. Compressing the products isothermally from their partial pressures in the equilibrium box to 1 bar

So, $$\Delta H^0=\Delta H_1+\Delta H_2+\Delta H_3$$$$\Delta S^0=\Delta S_1+\Delta S_2+\Delta S_3$$$$\Delta G^0=\Delta G_1+\Delta G_2+\Delta G_3$$But, for ideal gases, ##\Delta H_1=\Delta H_3=0##, so $$\Delta H_2=\Delta H^0$$And, in the equilibrium box, since ##\Delta G_2=0##, $$\Delta S_2=\frac{\Delta H_2}{T}==\frac{\Delta H^0}{T}$$For a reaction of ideal gas species, such as ##aA+bB=cC+dD## for example, the entropy changes for steps 1 and 3 are: $$\Delta S_1=-aR\ln{p_A}-bR\ln{p_B}$$and$$\Delta S_3=cR\ln{p_C}+dR\ln{p_D}$$So, for the standard entropy change for this reaction, we have:
$$\Delta S^0=-aR\ln{p_A}-bR\ln{p_B}+\frac{\Delta H^0}{T}+cR\ln{p_C}+dR\ln{p_D}=\frac{\Delta H^0}{T}+R\ln{K}$$where K is the equilibrium constant. So, $$\Delta H^0=T\Delta S^0-RT\ln{K}$$
Here is a quote from your post in which working principle of Van't Hoff equilibrium box is explained: "The Van't Hoff equilibrium box is a chamber containing a mixture of reactants and products at equilibrium." How is it possible that there are no mixing effects in the chamber since you said that in Van't Hoff equilibrium box there is a chamber in which there is reaction mixture at equilibrium? Reaction mixture in itself has a key word MIXTURE, which means components of chemical reaction are mixed. Without mixing, Gibbs energy couldn't reach minimum with respect to reaction extent (Specific U shaped curve of G couldn't happen without mixing). For, how can system be at chemical equilibrium without mixing?

Mentor
How does the entropy per mole of a pure ideal gas species at pressure p compare with the partial molar entropy of the same gas species at partial pressure p in an ideal gas mixture?

Last edited:
Dario56
How does the entropy per mole of a pure ideal gas species at pressure p compare with the partial molar entropy of a gas in an ideal gas mixture at partial pressure p?
For ideal gas mixture mixing can be thought of as isothermal state change where gas changes its pressure from some starting pressure (in our case its standard pressure of 1 bar) to partial pressure in a mixture. Quantitative relationship can be yielded from Maxwell equations of thermodynamics: $$- \left( \frac {\partial S} {\partial p} \right)_T = \left( \frac {\partial V} {\partial T} \right)_p$$

For ideal gas we know how to evaluate right side of equation: $$\left( \frac {\partial V} {\partial T} \right)_p = \frac R p$$

Gas changes its state from standard pressure of 1 bar where its partial molar entropy is one of pure component to partial pressure in a mixture where it has some value of partial molar entropy. Difference between the partial molar entropy of component in a mixture and one of pure component is: $$-Rln(x_i)$$

We conclude that for ideal gases partial molar entropy of every component in a mixture is bigger than of pure component which is consistent with the fact that mixing of ideal gases increases entropy of the system.

Mentor
But I'm not talking about about going directly from 1 bar to the partial pressures in the mixture. We've already accounted for that entropy change in the expansion or compression steps.

The partial molar entropy of a species in an ideal gas mixture is the same as that of the pure species at the same pressure as its partial pressure in the mixture. So the entropy change in injecting a small parcel of pure ideal gas through a semipermeable membrane into a mixture of ideal gases containing that species at the same partial pressure as the total pressure of the pure gas is zero. That follows directly from Gibbs Theorem: the partial molar U, H, S, A, and G of a species in an ideal gas mixture is the same as that of the pure component at the same pressure as its partial pressure in the mixture.

Dario56
But I'm not talking about about going directly from 1 bar to the partial pressures in the mixture. We've already accounted for that entropy change in the expansion or compression steps.

The partial molar entropy of a species in an ideal gas mixture is the same as that of the pure species at the same pressure as its partial pressure in the mixture. So the entropy change in injecting a small parcel of pure ideal gas through a semipermeable membrane into a mixture of ideal gases containing that species at the same partial pressure as the total pressure of the pure gas is zero. That follows directly from Gibbs Theorem: the partial molar U, H, S, A, and G of a species in an ideal gas mixture is the same as that of the pure component at the same pressure as its partial pressure in the mixture.
Yes, I agree. Only how could components diffuse through membrane without pressure difference?

Mentor
Yes, I agree. Only how could components diffuse through membrane without pressure difference?
It's like any other reversible process. There is a slight pressure difference imposed across the membrane.

Dario56
It's like any other reversible process. There is a slight pressure difference imposed across the membrane.
Yes, differential one.

Dario56
It's like any other reversible process. There is a slight pressure difference imposed across the membrane.
Although we did discuss the concept of equilibrium box, it didn't really answer my question. How can we connect what we learned to my question?

Last edited:
Mentor
Although we did discuss the concept of equilibrium box, it didn't really answer my question.
In Section 2.4 of Denbigh's book The Principles of Chemical Equilibrium, he discusses processes in closed systems operated such that (a) the only heat transferred to the system is from a reservoir which remains at the constant temperature T of the system (equal to the initial temperature of the system) and (b) the system is in contact with a constant pressure surroundings p (equal to the initial pressure of the system). This includes closed system in which chemical reactions are occurring within the system, including electrolytic reactions.

For such a closed system, the first law of thermodynamics tells us that $$\Delta U=q-w$$and the 2nd law of thermodynamics tells us that $$q=T\Delta S-\sigma T$$where q is the heat transferred from the surroundings to the system at temperature T, w is the work done by the system on the surroundings, and ##\sigma## is the entropy generated within the system due to irreversibility. If we combine these two equations, we obtain: $$\Delta U=T\Delta S-w-\sigma T$$or, equivalently, $$\Delta G=\Delta H-T\Delta S=-(w-p\Delta V)-\sigma T$$

OK so far?

Dario56
In Section 2.4 of Denbigh's book The Principles of Chemical Equilibrium, he discusses processes in closed systems operated such that (a) the only heat transferred to the system is from a reservoir which remains at the constant temperature T of the system (equal to the initial temperature of the system) and (b) the system is in contact with a constant pressure surroundings p (equal to the initial pressure of the system). This includes closed system in which chemical reactions are occurring within the system, including electrolytic reactions.

For such a closed system, the first law of thermodynamics tells us that $$\Delta U=q-w$$and the 2nd law of thermodynamics tells us that $$q=T\Delta S-\sigma T$$where q is the heat transferred from the surroundings to the system at temperature T, w is the work done by the system on the surroundings, and ##\sigma## is the entropy generated within the system due to irreversibility. If we combine these two equations, we obtain: $$\Delta U=T\Delta S-w-\sigma T$$or, equivalently, $$\Delta G=\Delta H-T\Delta S=-(w-p\Delta V)-\sigma T$$

OK so far?
I have this book, so I can check this chapter and we can discuss later.

• Chestermiller
Dario56
In Section 2.4 of Denbigh's book The Principles of Chemical Equilibrium, he discusses processes in closed systems operated such that (a) the only heat transferred to the system is from a reservoir which remains at the constant temperature T of the system (equal to the initial temperature of the system) and (b) the system is in contact with a constant pressure surroundings p (equal to the initial pressure of the system). This includes closed system in which chemical reactions are occurring within the system, including electrolytic reactions.

For such a closed system, the first law of thermodynamics tells us that $$\Delta U=q-w$$and the 2nd law of thermodynamics tells us that $$q=T\Delta S-\sigma T$$where q is the heat transferred from the surroundings to the system at temperature T, w is the work done by the system on the surroundings, and ##\sigma## is the entropy generated within the system due to irreversibility. If we combine these two equations, we obtain: $$\Delta U=T\Delta S-w-\sigma T$$or, equivalently, $$\Delta G=\Delta H-T\Delta S=-(w-p\Delta V)-\sigma T$$

OK so far?
Yes. I do understand what is being said.