Next Article in Journal
Uncertainty Evaluation in Multistage Assembly Process Based on Enhanced OOPN
Next Article in Special Issue
Non-Conventional Thermodynamics and Models of Gradient Elasticity
Previous Article in Journal
Notes on Computational Uncertainties in Probabilistic Risk/Safety Assessment
Previous Article in Special Issue
A Chemo-Mechanical Model of Diffusion in Reactive Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Variational Formulation of Nonequilibrium Thermodynamics for Discrete Open Systems with Mass and Heat Transfer

by
François Gay-Balmaz
1 and
Hiroaki Yoshimura
2,*
1
Centre National de la Recherche Scientifique (CNRS), Le Laboratoire de Météorologie Dynamique (LMD), Ecole Normale Supérieure, 75005 Paris, France
2
School of Science and Engineering, Waseda University, Tokyo 169-8555, Japan
*
Author to whom correspondence should be addressed.
Entropy 2018, 20(3), 163; https://doi.org/10.3390/e20030163
Submission received: 31 December 2017 / Revised: 25 February 2018 / Accepted: 27 February 2018 / Published: 4 March 2018
(This article belongs to the Special Issue Phenomenological Thermodynamics of Irreversible Processes)

Abstract

:
We propose a variational formulation for the nonequilibrium thermodynamics of discrete open systems, i.e., discrete systems which can exchange mass and heat with the exterior. Our approach is based on a general variational formulation for systems with time-dependent nonlinear nonholonomic constraints and time-dependent Lagrangian. For discrete open systems, the time-dependent nonlinear constraint is associated with the rate of internal entropy production of the system. We show that this constraint on the solution curve systematically yields a constraint on the variations to be used in the action functional. The proposed variational formulation is intrinsic and provides the same structure for a wide class of discrete open systems. We illustrate our theory by presenting examples of open systems experiencing mechanical interactions, as well as internal diffusion, internal heat transfer, and their cross-effects. Our approach yields a systematic way to derive the complete evolution equations for the open systems, including the expression of the internal entropy production of the system, independently on its complexity. It might be especially useful for the study of the nonequilibrium thermodynamics of biophysical systems.

1. Introduction

The goal of this paper is to present a variational formulation for the nonequilibrium thermodynamics of open discrete (finite dimensional) systems, i.e., systems which may exchange heat as well as matter with their surrounding. Such systems, out of equilibrium, appear naturally in engineering, physics, biology, chemistry, social science, the archetypal example being the case of the living cell. A first step in the study of the nonequilibrium thermodynamics of a given system is the determination of the complete set of evolution equations, written as a system of ordinary differential equations (ODEs) for discrete systems, which allows to determine the values of all the variables of the system, at all times. Such a step is nontrivial, even for closed systems, especially in the case when several irreversible processes of various nature interact with each other. A celebrated example being the case of the adiabatic piston, whose final configuration can only be determined by solving the ODEs of evolution, see [1].
In our previous works [2,3], we developed a Lagrangian variational formulation for the nonequilibrium thermodynamics of closed discrete systems by following Stueckelberg’s phenomenological approach, in which we extended the Lagrange-d’Alembert principle for nonlinear nonholonomic mechanics to encode the internal entropy production due to irreversible processes into a class of nonlinear constraints of thermodynamic type. Such a variational approach is based on two types of constraints, a phenomenological constraint imposed on the solution curve and a variational constraint imposed on the variations to be considered. As shown in [2,3], these two constraints are related to each other in a very systematic way. In addition, our approach gives a form of the entropy production equation that is extremely well-suited for the choice of the phenomenological relation between the thermodynamic fluxes and the thermodynamic forces, in accordance with the second law of thermodynamics. To obtain such a systematic variational framework, the notion of thermodynamical displacements is introduced, which enables us to systematically obtain the variational constraint from the phenomenological constraint. As shown in [2,3], the stationarity condition for a certain action functional involving the total Lagrangian of the system yields the complete evolution equations for all the variables of the system. The variational formulation in [2,3] is illustrated with several examples of discrete systems such as mechanical systems with friction, electric circuits with resistor, chemical reactions, diffusions across membranes, etc.
In this paper, we extend this variational formulation of nonequilibrium thermodynamics to the case of discrete open systems. Passing from closed to open systems introduces an important change in the constraints to be used, namely, the constraints generically become explicitly time-dependent, due to the power transfer associated to matter and heat exchange with the exterior through the ports. More precisely, we have to extend our phenomenological constraint to a kinematic constraint by taking into account of the time-dependent boundary conditions associated to exchanges with the exterior for the derivation of the entropy production. To reach this goal, we first propose a novel theory of Lagrangian variational formulation for systems with time-dependent nonlinear nonholonomic constraints, in which the kinematic and variational constraints are related in a very specific way. When applying this variational formulation to open thermodynamic system, the constraint is given by the equation for the rate of entropy production of the system. Our approach can handle systems with several ports, experiencing mechanical interactions, internal diffusion, internal heat transfer, and their cross-effects.
The variational approach presented in this paper enables an effective derivation of the complete evolution equations for all the variables of the open system. It thus represents an essential modeling tool for the dynamics of open systems, in the same way as the Hamilton principle in Lagrangian mechanics (see, e.g., [4], for a recent use of the Hamilton variational principle as a modeling tool for fluid-structure interaction) and its Lagrange-d’Alembert version for nonholonomic mechanical systems. A preliminary illustration of this variational feature is considered in Section 3.3, where we propose a model for an open system which takes into account of the exchange of mechanical momentum in the dynamics and in the entropy production equation. We project to extensively exploit our formulation as a modeling tool for the nonequilibrium thermodynamics of open systems in the future. Besides its modeling purpose, our approach is also useful for the derivation of structure preserving numerical schemes for nonequilibrium thermodynamics, based on discrete versions of the variational formulation, in a similar way with the case of variational integrators in classical mechanics [5]. We made initial steps in this direction in [6]. The description of the nonequilibrium thermodynamics used in this paper assumes the local thermodynamic equilibrium condition.
Our paper is organized as follows. In Section 2, we review the fundamental ingredients for the nonequilibrium thermodynamic of discrete open systems by following Stueckelberg’s formulation of the two laws. In Section 3, we first introduce an abstract variational formulation for systems with nonlinear time-dependent nonholonomic constraints. Then, we present the simplest case of an open system with a single chemical component in a single compartment with matter transfer through one entry port. Further, we explore the case of a discrete open system with a single chemical component experiencing internal diffusion through several compartments, as well as matter transfer through multi-entry ports, without heat transfer. We illustrate our theory with some examples such as an open system of flowing fluid carrying kinetic energy into a piston device, an open system with a single chemical component experiencing diffusion between two compartments and transfer into or out of the system through two ports, as well as open systems with diffusion of a single chemical species through a composite membrane made of both serial and parallel arrays of several elements. In Section 4, we investigate the more general class of discrete open systems, having several entropy variables, and hence several temperatures. For instance, we consider a single chemical component in several compartments, experiencing internal diffusion, heat transfer, the associated cross-effects, as well as matter exchange through multi-entry ports, and external heating. We illustrate our variational formulation with several examples such as an open system experiencing diffusion and heat conduction between two compartments, and an open system with heat conduction and diffusion of a single chemical species through a composite membrane made of a parallel array of several elements. In Section 5, some concluding remarks are given as well as future directions.

2. Simple Discrete Open Systems

In this paper, we shall follow the phenomenological approach to nonequilibrium thermodynamics developed by Stueckelberg [7], which provides a macroscopic dynamic theory for accounting for irreversible processes. Such an approach enables the treatment of nonequilibrium thermodynamics as a natural extension of classical mechanics. Before going into details, we make a brief review on the fundamental notions that we employ by following Stueckelberg’s approach (see, for instance, [1,8,9]), where two state functions, the energy and the entropy, are used to obey the two fundamental laws of thermodynamics, which are formulated as first order differential equations.
Let us denote by Σ a physical system and by Σ ext its exterior. The state of the system is defined by a set of mechanical variables and a set of thermal variables. State functions are functions of these variables. Stueckelberg’s formulation of the two laws is given as follows.
First law: For every system Σ , there exists an extensive scalar state function E, called energy, which satisfies
d d t E ( t ) = P W ext ( t ) + P H ext ( t ) + P M ext ( t ) ,
where t denotes time, P W ext is the power associated to the work done on the system, P H ext is the power associated to the transfer of heat into the system, and P M ext is the power associated to the transfer of matter into the system (As we will recall below, to matter transfer is associated a transfer of work and heat. By convention, P W ext and P H ext denote uniquely the power associated to work and heat that is not associated to a transfer of matter.).
Given a thermodynamic system, the following terminology is generally adopted:
  • A system is said to be closed if there is no exchange of matter, i.e., P M ext ( t ) = 0 . When P M ext ( t ) 0 the system is said to be open.
  • A system is said to be adiabatically closed if it is closed and there is no heat exchanges, i.e., P M ext ( t ) = P H ext ( t ) = 0 .
  • A system is said to be isolated if it is adiabatically closed and there is no mechanical power exchange, i.e., P M ext ( t ) = P H ext ( t ) = P W ext ( t ) = 0 .
From the first law, it follows that the energy of an isolated system is constant.
Second law: For every system Σ , there exists an extensive scalar state function S, called entropy, which obeys the following two conditions (see [7], p. 23).
(a)
Evolution part:
If the system is adiabatically closed, the entropy S is a non-decreasing function with respect to time, i.e.,
d d t S ( t ) = I ( t ) 0 ,
where I ( t ) is the entropy production rate of the system accounting for the irreversibility of internal processes.
(b)
Equilibrium part:
If the system is isolated, as time tends to infinity the entropy tends towards a finite local maximum of the function S over all the thermodynamic states ρ compatible with the system, i.e.,
lim t + S ( t ) = max ρ compatible S [ ρ ] .
By definition, the evolution of an isolated system is said to be reversible if I ( t ) = 0 , namely, the entropy is constant. In general, the evolution of a system Σ is said to be reversible, if the evolution of the total isolated system with which Σ interacts is reversible.
Expression of the first law for open systems. Consider an open system with several ports, a = 1 , , A , through which matter can flow into or out of the system. We suppose, for simplicity, that the system involves only one chemical species and denote by N the number of moles of this species. The mole balance equation is
d d t N = a = 1 A J a ,
where J a is the molar flow rate into the system through the a-th port, so that J a > 0 for flow into the system and J a < 0 for flow out of the system.
As matter enters or leaves the system, it carries its internal, potential, and kinetic energy. This energy flow rate at the a-th port is the product E a J a of the energy per mole (or molar energy) E a and the molar flow rate J a at the a-th port. In addition, as matter enters or leaves the system it also exerts work on the system that is associated with pushing the species into or out of the system. The associated energy flow rate is given at the a-th port by p a V a J a , where p a and V a are the pressure and the molar volume of the substance flowing through the a-th port.
From this we can write the first law of thermodynamics as
d d t E = P W ext + P H ext + P M ext , with P M ext = a = 1 A J a ( E a + p a V a ) .
We refer, for instance, to [10,11] for the detailed explanations of the first law for open systems. We recall below the definition of simple systems, which plays a main role in our variational formulation.
Discrete simple systems. A discrete system Σ is a collection Σ = A = 1 N Σ A of a finite number of interacting simple systems Σ A . By definition, following [7], a simple system Σ is a macroscopic system for which one (scalar) thermal variable and a finite set of mechanical variables are sufficient to describe entirely the state of the system. From the second law of thermodynamics, we can always choose the thermal variable as the entropy S.

3. Variational Formulation of Discrete Open Simple Systems

In this section, we develop a variational formulation for discrete open thermodynamic systems that are assumed to be simple. As recalled above, such systems are described by a single entropy variable and, therefore, a uniform temperature can be attributed to the system. The case of non-simple systems will be treated in Section 4.
We start in Section 3.1 by introducing a general variational approach for the treatment of time-dependent nonholonomic systems with nonlinear constraints. This abstract variational formulation extends to the time dependent case the one developed in [2] for closed thermodynamic systems and provides the general framework for the variational formulation for open systems. In Section 3.2 we develop the variational formulation for open simple systems in a particular setting, before extending it to include mechanical interactions in Section 3.3 and internal diffusion in Section 3.4. Several examples are treated in Section 3.6, while Section 3.5 tightens the link between the variational formulation for open systems and the abstract formulation presented in Section 3.1.

3.1. A Variational Formulation for Time-Dependent Nonlinear Nonholonomic Systems

In this section, we present an abstract variational framework for the treatment of open thermodynamic systems later. The variational formulation consists in computing the critical curve of an action functional by imposing two kinds of constraints: a variational constraint which imposes constraints on the variations of the curve, and a kinematic constraint which imposes constraints on the critical curves. These two constraints are related in a very specific way. This setting extends the variational formulation proposed in [2,3,12] for closed thermodynamic systems. In the particular case of linear constraints, the variational formulation recovers the Lagrange-d’Alembert principle for nonholonomic mechanics, see, e.g., [13]. A general variational setting for mechanics with nonlinear constraints is described in [14,15]. For the variational formulation of time-dependent nonholonomic mechanics with affine constraints, see [16].
Let Q be a configuration manifold with local coordinates q = ( q 1 , , q n ) and let R × Q be the extended configuration manifold which includes the time variable t R . We consider the vector bundle R × T Q over R × Q with local coordinates ( t , q , v ) and the vector bundle ( R × T Q ) × R × Q ( R × T Q ) over R × Q with local coordinates ( t , q , v , δ q ) .
Consider a time-dependent constraint C V ( R × T Q ) × R × Q ( R × T Q ) of the form
C V = ( t , q , v , δ q ) ( R × T Q ) × R × Q ( R × T Q ) A i r ( t , q , v ) δ q i + B r ( t , q , v ) = 0 , r = 1 , , m < n .
Such a constraint defines for each ( t , q , v ) R × T Q an affine subspace C V ( t , q , v ) T q Q . By considering, for each ( t , q , v ) , the linear subspace C ^ V ( t , q , v ) associated to C V ( t , q , v ) , we get the time-dependent variational constraint
C ^ V = ( t , q , v , δ q ) ( R × T Q ) × R × Q ( R × T Q ) A i r ( t , q , v ) δ q i = 0 , r = 1 , , m < n .
Given C V , we define the associated nonlinear nonholonomic kinematic constraint C K R × T Q by
C K = ( t , q , v ) R × T Q v C V ( t , q , v ) = ( t , q , v ) R × T Q A i r ( t , q , v ) v i + B r ( t , q , v ) = 0 , r = 1 , , m < n .
We note that the function A i r and B r may depend explicitly on the time t.
Let L be a time-dependent Lagrangian defined on R × T Q and let F ext : R × T Q T * Q be an external force field assumed to be fiber preserving, i.e., F ext ( t , q , v ) T q * Q . We consider the following Lagrange-d’Alembert principle with time-dependent nonlinear constraints and external force field:
δ t 1 t 2 L ( t , q , q ˙ ) d t + t 1 t 2 F ext ( t , q , q ˙ ) , δ q d t = 0 , VARIATIONAL CONDITION
with respect to variations δ q ( t ) C ^ V ( t , q , q ˙ ) , i.e.,
A i r ( t , q , q ˙ ) δ q i = 0 , VARIATIONAL CONSTRAINT
with δ q ( t 1 ) = δ q ( t 2 ) = 0 , and where the curve q ( t ) satisfies the the nonlinear constraint C K , i.e,
A i r ( t , q , q ˙ ) q ˙ i + B r ( t , q , q ˙ ) = 0 . KINEMATIC CONSTRAINT
By a direct computation, using Lagrange multipliers λ r , r = 1 , , m , we get that a curve q ( t ) is critical for the variational formulations (2)–(4) if and only if it is a solution of the time-dependent nonlinear nonholonomic Lagrange-d’Alembert equations with external forces:
d d t L q ˙ i ( t , q , q ˙ ) L q i ( t , q , q ˙ ) = λ r A i r ( t , q , q ˙ ) + F i ext ( t , q , q ˙ ) , A i r ( t , q , q ˙ ) q ˙ i + B r ( t , q , q ˙ ) = 0 .
Associated to the Lagrangian L ( t , q , q ˙ ) , we define the energy E ( t , q , q ˙ ) on R × T Q as
E ( t , q , q ˙ ) = L q ˙ i q ˙ i L ( t , q , q ˙ ) .
Along a solution of the evolution Equation (5), we get the energy balance equation
d d t E ( t , q , q ˙ ) = F i ext ( t , q , q ˙ ) q ˙ i λ r B r L t .
As we shall show later, the variational formulation for discrete open thermodynamic systems falls into the abstract variational setting (2)–(4). In this case, the system (5) yields the complete evolution equations for the thermodynamic system, in which the nonlinear constraint gives the entropy equation, in agreement with the second law of thermodynamics. The energy balance Equation (6) yields the first law of thermodynamics.

3.2. Foundations of the Variational Formulation for Discrete Open Thermodynamic Systems

In order to introduce our variational formulation, we shall first consider a particular case of simple discrete system, namely, the case of a system with a single chemical component N in a single compartment with constant volume V. Recall that, since the system is assumed to be simple, there is a single entropy S attributed to the whole system. Non-simple systems will be considered in Section 4. We assume that there is no heat and work exchanges, except the ones associated to the transfer of matter. We also ignore all the mechanical effects, which will be included later in Section 3.3. In this particular situation, the energy of the system is given by the internal energy written as U = U ( S , N ) , since V = V 0 is constant. The balance of mole and the balance energy, i.e., the first law, are respectively given by
d d t N = a = 1 A J a , d d t U = a = 1 A J a ( U a + p a V a ) = a = 1 A J a H a ,
see (1), where H a = U a + p a V a is the molar enthalpy at the a-th port and where U a , p a , and V a are respectively the molar internal energy, the pressure and the molar volume at the a-th port. From these equations and the second law, one obtains the equations for the rate of change of the entropy of the system as
d d t S = I + a = 1 A S a J a ,
where S a is the molar entropy at the a-th port and I is the rate of internal entropy production of the system given by
I = 1 T a = 1 A J a H a T S a μ ,
with T = U S the temperature and μ = U N the chemical potential. For our variational treatment, it is useful to rewrite the rate of internal entropy production as
I = 1 T a = 1 A J S a ( T a T ) + J a ( μ a μ ) ,
where we defined the entropy flow rate J S a : = S a J a and also used the relation H a = U a + p a V a = μ a + T a S a . The thermodynamic quantities known at the ports are usually the pressure and the temperature p a , T a , from which the other thermodynamic quantities, such as μ a = μ a ( p a , T a ) or S a = S a ( p a , T a ) are deduced from the state equations of the gas.
Remark 1.
There are several representations for the rate of internal entropy production given in (8), namely, we can rewrite I as
I = 1 T a = 1 A J a T ( S S a ) ( U U a ) ( p V p a V a )
as well as
I = 1 T a = 1 A J a ( H a H ) T ( S a S ) .
Variational formulation. Let W, Γ , and Σ be the molar and thermal displacements and the internal entropy of the system respectively, each of whose interpretation will be explained later. Given the molar flow rates J a , the entropy flow rates J S a , the temperatures T a , and the chemical potentials μ a at the ports a = 1 , , A , we consider the following variational formulation:
δ t 1 t 2 U ( S , N ) + W ˙ N + ( S Σ ) Γ ˙ d t = 0 , VARIATIONAL CONDITION
where the curves satisfy the nonlinear nonholonomic constraint
U S Σ ˙ = a = 1 A J a W ˙ μ a + J S a Γ ˙ T a , KINEMATIC CONSTRAINT
and with respect to variations subject to the constraint
U S δ Σ = a = 1 A J a δ W + J S a δ Γ , VARIATIONAL CONSTRAINT
with δ W ( t 1 ) = δ W ( t 2 ) = 0 .
Remark 2.
We call the internal entropy production (10) the kinematic constraint, where the internal entropy production, in general, is described not only by the phenomenological relations obtained experimentally but also by the pressures, temperatures and the molar flow rates at the external ports. This equation is generally a nonlinear nonholonomic constraint imposed on the curve of the state variables in the variational formulation, see (4). We will later explain in details how the variational formulations (9)–(11) arises as a special instance of the abstract variational formulations (2)–(4).
Remark 3.
In the variational formulations given in (9)–(11), we employed the new variables, Γ and W, such that Γ ˙ = T and W ˙ = μ , where we interpreted the variable Γ as the thermal displacement and the variable W as the molar displacement. These are examples of thermodynamic displacements, as introduced in [2,3], whose rate of change coincide with the affinity of the irreversible process. In particular, note that Γ is a monotonically increasing real function of time t since the temperature T takes positive real values. Note also that the notion of thermal displacement was first used by [17] and in the continuum setting by [18]. Refer to the Appendix of [19] for an historical account. The variables Γ and W are conjugate variables with S (or Σ) and N, respectively. Moreover, we used another new variable Σ, which is not the same object as the entropy of the system S but it denotes the internal entropy of the system. In fact, Σ ˙ indicates the internal entropy production, with Σ ˙ 0 , sometimes denoted as d i S / d t in the standard literature (see, for instance, Equation (8) on page 21 in [20]), while the total rate of entropy production of the system, S ˙ , does not need to be positive if the system is not adiabatically closed.
Comments and structure of the variational formulation. Before applying the variational formulation to derive the equations, we first comment on the variables and functions involved as well as on the structure of this formulation. The variational formulations (9)–(11) gives conditions on the curve c ( t ) = Γ ( t ) , W ( t ) , N ( t ) , S ( t ) , Σ ( t ) that ultimately gives a system of ODEs for this curve. This curve involves the thermodynamic quantities associated to the system, namely, the number of moles N ( t ) , the total entropy S ( t ) and the internal entropy Σ ( t ) of the system, as well as the thermodynamic displacements Γ ( t ) , W ( t ) whose interpretation will be explained below. Recall that the knowledge of a fundamental state equation of the system, such as U = U ( S , V , N ) , allows one to deduce all the other thermodynamic relations.
The thermodynamic quantities associated to the ports a = 1 , , A , are denoted with an exponent a, such as T a and μ a . They satisfy the same relations as the corresponding quantities of the system, because they represent the same species, i.e., are obtained from the same state equation. Given a port a, if matter is flowing into the system through that port from the exterior, then we will assume that the thermodynamic quantities are known from the experimenter, i.e., they are prescribed functions of time such as T a = T a ( t ) and μ a = μ a ( t ) , which characterise the thermodynamic properties of the matter flowing into the system. On the other hand, if matter is flowing out of the system through that port, then the associated thermodynamic quantities coincide with the thermodynamic quantities of the system, such as, T a = T , μ a = μ . In this case, these quantities are not assumed to be known, they are computed via the evolution equations. If matter is flowing in, we shall assume that the molar flow rate J a > 0 is a prescribed function of time, i.e., J a = J a ( t ) . If matter is flowing out of the system then J a < 0 is usually computed from the other variables and the physical properties of the system. In the system considered here, since there is no additional heating from the exterior, the entropy flow rate J S a is given in terms of the molar flow rate J a as J S a = S a J a , where S a is the molar entropy at the a-th port.
We note that the variational constraint (11) follows from the phenomenological constraint (10) by formally replacing the rates by the corresponding virtual displacements, i.e., x ˙ δ x , and by removing all the terms that depend uniquely on the ports a = 1 , , A , i.e., the terms μ a J a and T a J S a . Such a systematic correspondence between the phenomenological and variational constraints, was already verified for the variational formulation of closed systems, see [2,3]. It is extended here to the case of open systems. Note that the action functional in (9) has the same form as that in the case of closed systems, see [2]. As will be shown later, this systematic relation between the two constraints still holds in the more general cases of discrete open systems considered below.
Application of the variational formulation. By taking the variation of the integral in (9) and using the variational constraint (11), we get the following evolution equations:
δ S : Γ ˙ = U S , δ W : N ˙ = a = 1 A J a , δ N : W ˙ = U N , δ Γ : S ˙ = Σ ˙ + a = 1 A J S a .
From the first and third equations in (12), temperature is obtained as the rate of the thermal displacement Γ while the chemical potential as the rate of the molar displacement W, since the temperature and the chemical potential of the system are defined by T : = U S and μ : = U N .
By inserting the conditions (12) into the phenomenological constraint (10), we get the desired entropy equation in terms of T and μ , namely
T S ˙ = a = 1 A J a ( μ a μ ) + J S a ( T a T ) + T a = 1 A J S a = a = 1 A J a ( H a T S a μ ) + T a = 1 A S a J a ,
in accordance with (7) and (8). From the entropy equation and the last relation in (12), we have the rate of internal entropy production of the system as
I : = Σ ˙ = S ˙ a = 1 A S a J a = 1 T a = 1 A J a H a T S a μ .
To summarize, from the variational formulations (9)–(11), we have obtained the following evolution equations for the open system with A ports:
N ˙ = a = 1 A J a , T S ˙ = a = 1 A J a ( H a T S a μ ) + T a = 1 A S a J a .
From this system, the first law is computed as
d d t U = a = 1 A J a ( μ a + S a T a ) = a = 1 A J a H a .
Equations (14) yield a system of two ODEs for the two variables S ( t ) and N ( t ) , for given molar flow rates J a ( t ) . The evolution of the other variables, such as p ( t ) , T ( t ) , μ ( t ) , can be computed from S ( t ) and N ( t ) by using the state equation. In some situations, the molar flow rates are chosen in order the system to respect some properties, such as, for example a constant pressure p ( t ) = p 0 .
Example 1 (Filling an Insulated Tank with Pressurized Gas).
In order to illustrate our formalism, we consider an insulated tank containing an amount of N moles of ideal gas at temperature T and pressure p. We assume that gas with temperature T 1 ( t ) and pressure p 1 ( t ) , which are given prescribed functions of time t, is entering the tank at a single port with the molar flow rate J 1 ( t ) , ([21], Section 8).
From the fundamental state equation of the ideal gas U = U ( S , V , N ) , all the thermodynamic relations can be obtained. For instance, we have
p V = R T , U = c V ( T T ref ) + U ref , S = R ln p p ref + c p ln T T ref + S ref , H = c p ( T T ref ) + H ref , μ = c p ( T T ref ) + R ln p p ref T c p ln T T ref ( T T ref ) S ref + μ ref ,
where R is the universal gas constant, c V , c p are the heat capacity coefficients at constant volume and constant pressure of the ideal gas, and the index ( ) ref indicates reference values. The constants R, c V , and c p are expressed in units J K · m o l e . Note that U , V , S denote the molar quantities associated to U, V, S.
The above variational formulation yields the equations of motion
N ˙ = J 1 , S ˙ = I + S 1 J 1 ,
where, for an ideal gas, I is computed as
I = 1 T J 1 H 1 T S 1 μ = J 1 c p T ( T 1 T ) R ln p p 1 + c p ln T T 1 .
This expression recovers the entropy production for this system, see, e.g., ([21] Equation (8.74)). It is associated to the irreversible process of mixing ideal gas at different temperature and pressure.
By rewriting the entropy production as
I = J 1 c p T T 1 T 1 ln T 1 T R T ln p p 1 ,
we see that I 0 for all T, T 1 , and for p 1 p . The second law thus consistently requires that p 1 p .

3.3. Variational Formulation of Open Simple Systems with Mechanical Interactions

We shall now extend the previous variational formulation to the case of an open system including exchange of mechanical momenta. Such a system is described by two kind of mechanical variables. Mechanical variables q = ( q 1 , , q n ) describe the motion of the mechanical devices involved in the system, while x = ( x 1 , , x m ) are mechanical variables which indicate the motion of the species of the system. Through each of the A ports, we have the flow rates J a , J x a , and J S a , a = 1 , , A , corresponding to exchange of matter, mechanical momentum, and entropy. We assume that the species flows through the a-th port at velocity v a = ( v a , 1 , , v a , m ) . We also assume that the mechanical components are subject to friction and external forces, respectively, denoted by F x fr , F q fr and F x ext , F q ext .
Variational formulation. We consider the following variational formulation:
δ t 1 t 2 L ( q , q ˙ , x , x ˙ , S , N ) + W ˙ N + ( S Σ ) Γ ˙ d t + t 1 t 2 F q ext , δ q + F x ext , δ x d t = 0 , VARIATIONAL CONDITION
where the curves satisfy the nonlinear nonholonomic constraint
L S Σ ˙ = F q fr , q ˙ + F x fr , x ˙ + a = 1 A J x a , x ˙ v a + J a W ˙ μ a + J S a Γ ˙ T a , KINEMATIC CONSTRAINT
and with respect to variations subject to the constraint
L S δ Σ = F q fr , δ q + F x fr , δ x + a = 1 A J x a , δ x + J a δ W + J S a δ Γ , VARIATIONAL CONSTRAINT
with δ x ( t 1 ) = δ x ( t 2 ) = 0 , δ q ( t 1 ) = δ q ( t 2 ) = 0 , δ W ( t 1 ) = δ W ( t 2 ) = 0 .
Application of the variational formulation. By taking the variation of the integral in (16) and using the variational constraint (18), we get the following conditions:
δ q : d d t L q ˙ i L q i = ( F q fr ) i + ( F q ext ) i , i = 1 , , n , δ x : d d t L x ˙ r L x r = ( F x fr ) r + a = 1 A ( J x a ) r + ( F x ext ) r , r = 1 , , m , δ S : Γ ˙ = L S , δ W : N ˙ = a = 1 A J a , δ N : W ˙ = L N , δ Γ : S ˙ = Σ ˙ + a = 1 A J S a .
Extending the earlier definitions, we define the temperature and the chemical potential of the system in tersm of the Lagrangian as T : = L S and μ : = L N . By inserting the conditions (19) into the phenomenological constraint (17), we get the following entropy equation
T S ˙ = F q fr , q ˙ F x fr , x ˙ + a = 1 A J x a , v a v + J a ( μ a μ ) + J S a ( T a T ) + T a = 1 A J S a .
To summarize, from the variational formulations (16)–(18), we have obtained the following evolution equations for the open system with mechanical interaction and A ports:
d d t L q ˙ i L q i = ( F q fr ) i + ( F q ext ) i , i = 1 , , n , d d t L x ˙ r L x r = ( F x fr ) r + a = 1 A ( J x a ) r + ( F x ext ) r , r = 1 , , m , N ˙ = a = 1 A J a , T S ˙ = F q fr , q ˙ F x fr , x ˙ + a = 1 A J x a , v a v + J a ( μ a μ ) + J S a ( T a T ) + T a = 1 A J S a .
This system of ODEs completely determines the time evolution of all the variables. In absence of thermodynamic effects, it reduces to the Euler-Lagrange equations of classical mechanics.
Defining the total energy of the system as
E ( x , x ˙ , q , q ˙ , S , N ) : = L q ˙ , q ˙ + L x ˙ , x ˙ L ,
we have the energy balance
d d t E = F q ext , q ˙ + F x ext , x ˙ = P W ext + a = 1 A J x a , v a + J a μ a + J S a T a = P M ext .
Example 2 (Flowing Fluid Carrying Kinetic Energy into a Piston Device).
We consider a piston with mass M moving in a cylinder containing a species with internal energy U = U ( S , V , N ) . We assume that the cylinder has A ports through which species is injected into or flows out of the cylinder with molar flow rates J a and velocities v a . The momentum and entropy flow rates accompanying these exchanges of species are given by
J x a = M 0 J a v a and J S a = S a J a ,
where M 0 is the molecular weight of the species.
We assume that the species flows through the a-th port and in the cylinder in a one dimensional direction, i.e., v a is parallel to v = x ˙ , for each a = 1 , , A , as illustrated in Figure 1. The variable q characterizes the one-dimensional motion of the piston, such that the volume occupied by the species is V = A q , with A the sectional area of the cylinder. The Lagrangian of the system is the sum of the kinetic energy of the piston and the species, to which is subtracted the internal energy of the species
L ( q , q ˙ , x , x ˙ , S , N ) = 1 2 M q ˙ 2 + 1 2 M 0 N x ˙ 2 U ( S , A q , N ) .
By a direct application of the variational formulation, the evolution equations are obtained as
N ˙ = a = 1 A J a , M q ¨ p A = F q fr + F q ext , d d t M 0 N x ˙ = F x fr + a = 1 A J x a + F x ext ,
where p = U V is the pressure, together with the entropy Equation (20) which yields
T S ˙ = F q fr q ˙ F x fr x ˙ + a = 1 A M 0 v a ( v a v ) + ( μ a μ ) + S a ( T a T ) J a + T a = 1 A S a J a = F q fr q ˙ F x fr x ˙ + a = 1 A 1 2 M 0 ( v a ) 2 + 1 2 M 0 v 2 M 0 v a v + μ U a + S a T a μ U S a T J a + T a = 1 A S a J a = F q fr q ˙ F x fr x ˙ + a = 1 A 1 2 M 0 ( v a v ) 2 + H a T S a μ U J a + T a = 1 A S a J a ,
where we used the expression of the temperature T : = L S = U S and the expression of the chemical potential
μ : = L N = 1 2 M 0 x ˙ 2 + μ U , μ U : = U N .
By translational invariance, the frictions forces verify F q fr = F x fr , thus from this equation and the last equation in (19), we get the rate of entropy production within the system as
I : = Σ ˙ = 1 T F q fr ( q ˙ x ˙ ) + 1 T a = 1 A J a 1 2 M 0 ( v a v ) 2 + 1 T a = 1 A J a H a T S a μ U ,
where the first term represents the entropy production associated to the friction experiencing by the moving piston and the moving species, the second term is the entropy production associated to the mixing of gas at different velocities, and the last term is the entropy production associated to the mixing of gas at different pressure, and temperature. The second law requires that each of these terms is positive. Concerning the first term, the friction force must be dissipative and can be chosen as F q fr = λ ( q ˙ x ˙ ) , where the phenomenological coefficient λ ( q , x , S ) is determined experimentally, see [1]. The second term is positive as long as J a > 0 and it is zero if J a < 0 since in this case v a = v . Finally, the last term has been already analyzed in the previous example in the case of the ideal gas, see (15).
The energy balance is deduced from (22) as
d d t E = F q ext q ˙ + F x ext x ˙ + a = 1 A J a 1 2 M 0 ( v a ) 2 + H a = P W ext + a = 1 A J a E a + p a V a = P M ext ,
where E a = 1 2 M 0 ( v a ) 2 + U a denotes the total (kinetic plus internal) molar energy of the species flowing at the a-th port. This balance of energy is consistent with the general expression of the first law in (1). Potential energies can be easily included in this example. External heating will be considered in Section 4.

3.4. Variational Formulation of an Open Simple System with Internal Matter Diffusion

In this subsection, we extend the previous variational formulation to the case of open discrete systems experiencing internal diffusion processes. Diffusion is particularly important in biology where many processes depend on the transport of chemical species through bodies.
As illustrated in Figure 2, we consider a thermodynamic system made of K compartments that can exchange matter by diffusion across their common boundaries. Some compartments may have external ports, through which species can flow into or out of the compartment. We denote by A k the number of ports of compartment k, and by J a , k , the molar flow rate flowing into or out of compartment k through the a-th port. We assume that the system has a single species and denote by N k the number of moles of the species in the k-th compartment, k = 1 , , K . We assume that the thermodynamic system is simple; i.e., a uniform entropy S, the entropy of the system, can be attributed to all the compartments. As earlier, the thermodynamic quantities known at the ports are usually the pressure and the temperature p a , k , T a , k , from which the other thermodynamic quantities, such as μ a , k or S a , k , are deduced from the state equations of the gas.
The setting that we develop is well appropriate for the description of diffusion across composite membranes, e.g., composed of different elements arranged in a series or parallel array, which occur frequently in living systems and have remarkable physical properties, see [22,23,24,25].
For each compartment k = 1 , , K , the mole balance equation is
d d t N k = l = 1 K J l k + a = 1 A k J a , k ,
where J l k = J k l is the molar flow rate from compartment l to compartment k due to diffusion of the species, and J a , k is the molar flow rate flowing into or out of compartment k through the a-th port.
Lagrangian variational formulation. By extending the variational formulation developed in Section 3.2, we consider an open simple system with Lagrangian
L ( q , q ˙ , S , N 1 , , N K ) ,
where q = ( q 1 , , q n ) are the mechanical variables of the system, S the single entropy, and N k the number of moles in the k-th compartment, k = 1 , , K . The additional mechanical interactions described in Section 3.3, via the motion x of the species, can be easily included in the present setting, too.
Given the external and friction forces F ext , F fr , the molar flow rates J l k , J a , k , and the entropy flow rates J S l k , J S a , k , the variational formulation is expressed as
δ t 1 t 2 L ( q , q ˙ , S , N 1 , , N K ) + k = 1 K W ˙ k N k + ( S Σ ) Γ ˙ d t + t 1 t 2 F ext , δ q d t = 0 , VARIATIONAL CONDITION
where the curves satisfy the nonlinear nonholonomic constraint
L S Σ ˙ = F fr , q ˙ + k , l = 1 K J l k W ˙ k + k = 1 K a = 1 A k J a , k ( W ˙ k μ a , k ) + J S a , k ( Γ ˙ T a , k ) , KINEMATIC CONSTRAINT
and with respect to variations subject to the constraint
L S δ Σ = F fr , δ q + k , l = 1 K J l k δ W k + k = 1 K a = 1 A k J a , k δ W k + J S a , k δ Γ , VARIATIONAL CONDITION
with δ q ( t 1 ) = δ q ( t 2 ) = 0 and δ W k ( t 1 ) = δ W k ( t 2 ) = 0 .
By taking the variation of the integral in (26) and using the variational constraint (28), we get the following conditions:
δ q i : d d t L q ˙ i L q i = ( F fr ) i + ( F ext ) i , i = 1 , , n , δ S : Γ ˙ = L S , δ N k : W ˙ k = L N k , k = 1 , , K δ W k : d d t N k = l = 1 K J l k + a = 1 A k J a , k , k = 1 , , K , δ Γ : S ˙ = Σ ˙ + k = 1 K a = 1 A k J S a , k .
As before, we define the temperature and the chemical potential potentials of each compartment as T : = L S and μ k : = L N k . By inserting the conditions (29) into the phenomenological constraint (27) and using
k , l = 1 K J l k μ k = k < l J l k ( μ k μ l ) ,
we get the following entropy equation
T S ˙ = F fr , q ˙ + k < l J k l ( μ k μ l ) + k = 1 K a = 1 A k J a , k ( μ a , k μ k ) + J S a , k ( T a , k T ) + T k = 1 K a = 1 A k J S a , k .
The rate of entropy production within the system is given by
I : = Σ ˙ = 1 T F fr , q ˙ + 1 T k < l J k l ( μ k μ l ) + 1 T k = 1 K a = 1 A k J a , k ( μ a , k μ k ) + J S a , k ( T a , k T ) ,
where the three terms correspond to the entropy production associated to mechanical friction, diffusion, and mixing of gas flowing into the system through the ports.
By the second law, the entropy production must be always positive and hence suggests the phenomenological relations
F i fr = λ i j q ˙ j and J k l = G k l ( μ k μ l ) ,
where λ i j , i , j = 1 , , n and G k l , k , l = 1 , , K are functions of the state variables, with λ i j positive semi-definite and G k l 0 , for all k , l . The third term has been already discussed earlier.
The total energy associated to the Lagrangian L ( q , q ˙ , S , N 1 , , N K ) is defined as
E ( q , q ˙ , S , N 1 , , N K ) : = L q ˙ , q ˙ L ,
and satisfies the energy balance
d d t E = F ext , q ˙ + k = 1 K a = 1 A k J a , k μ a , k + J S a , k T a , k = P W ext + P M ext .

3.5. Relation with the Abstract Variational Formulation

We shall here quickly mention how the variational formulations (9)–(11), as well as its more general versions (16)–(18) and (26)–(28), fit into the abstract variational formulation developed in (2)–(4).
Recall that the abstract variational formulation consists of two kind of constraints, the variational constraint C ^ V in (3) and the kinematic constraints C K in (4), which are related with each other in a very specific way. Concerning the variational formulations (16)–(18), for instance, the curve q ( t ) of the abstract setting is given by the collection of curves ( q ( t ) , x ( t ) , S ( t ) , N ( t ) , Γ ( t ) , W ( t ) , Σ ( t ) ) , and the Lagrangian L ( t , q , q ˙ ) of the abstract setting is time independent and given by the function L ( q , q ˙ , x , x ˙ , S , N ) + W ˙ N + ( S Σ ) Γ ˙ . The linear function δ q i A i ( t , q , q ˙ ) r δ q i is given by the linear map
( δ q , δ x , δ S , δ N , δ Γ , δ W , δ Σ ) L S δ Σ + F q fr , δ q + F x fr , δ x + a = 1 A J x a , δ x + J a δ W + J S a δ Γ ,
where one notes that the explicit time dependence may come from the time dependence of the functions J x a , J a , J p a . On the other hand, the functions B r ( t , q , q ˙ ) in (4) correspond to
a = 1 A J x a , v a + J a μ a + J S a T a .
Then, one notices that with these choices, the variational constraint C ^ V in (3) yields (18), and the kinematic constraint C K in (4) yields (17). Similarly, the variational formulations in (26)–(28) can be also seen as a special instance of the abstract formulations (9)–(11).

3.6. Examples of Open Simple Systems with Matter Transfer

Here we consider three examples of open simple systems with matter diffusion of a single chemical species. The first example is a simple system with matter diffusion between two compartments. The other two examples are diffusion processes appearing in composite membranes, consisting of serial or parallel interconnections of membranes ([22,23,24]; [25], Section 4.7).
Example 3 (Diffusion between Two Compartments).
Consider an open system with matter diffusion of a single species between two compartments and transfer of matter into or out of the compartments via two external ports with molar flow rate J a k , temperature T a k and pressure p a k , k = 1 , 2 as shown in Figure 3. In this case, the Lagrangian is just given by the internal energy of the system, L ( q , q ˙ , S , N 1 , N 2 ) = U ( S , N 1 , N 2 ) . From the above developments it follows the evolution equations as
N ˙ 1 = J 2 1 + J a 1 , N ˙ 2 = J 1 2 + J a 2 , T S ˙ = J 1 2 ( μ 1 μ 2 ) + k = 1 2 J a k ( H a k T S a k μ k ) + T k = 1 2 S a k J a k ,
with T = U S and μ k = U N k , k = 1 , 2 , together with the relations
T = Γ ˙ , μ k = W ˙ k , k = 1 , 2 ,
where we introduced the molar enthalpy at the ports a k , k = 1 , 2 , as
H a k = U a k + p a k V a k = μ a k + T a k S a k , k = 1 , 2 .
In (30), the first two equations are the mole balance in each compartment, where J 1 2 is the molar flow rate due to diffusion between the compartments. The last equation is the entropy equation, where we note that the rate of entropy production within the system reads
I : = Σ ˙ = 1 T J 1 2 ( μ 1 μ 2 ) + k = 1 2 J a k ( H a k T S a k μ k ) .
From the second law, the internal entropy production must be always positive. In particular, for the process of diffusion, this suggests the phenomenological relation
J 1 2 = G 12 ( μ 1 μ 2 ) ,
where G 12 0 is a function of the state variables.
One verifies that along a solution curve ( S ( t ) , N 1 ( t ) , N 2 ( t ) ) of (30), we have the balance of energy
d d t U = U S S ˙ + k = 1 2 U N k N ˙ k = k = 1 2 H a k J a k = P M ext .
Example 4 (Diffusion through a Series Array of Membranes).
To illustrate our variational formulation, we consider the open system represented on Figure 4, in which diffusion occurs through a composite membrane made of different elements arranged in a series-array. In this example, matter also transfers into or out of the compartments via two external ports with molar flow rate J a k , temperature T a k and pressure p a k , k = 1 , 2 . In this case, the variational formulation yields the evolution equations
N ˙ 1 = J m 1 1 + J a 1 , N ˙ 2 = J m K 2 + J a 2 , N ˙ m i = J m i 1 m i + J m i + 1 m i , i = 1 , , N , T S ˙ = J 1 m 1 ( μ 1 μ m 1 ) + i = 1 N J m i m i + 1 ( μ m i μ m i + 1 ) + J 2 m K ( μ 2 μ m K ) + k = 1 2 J a k ( H a k T S a k μ k ) + T k = 1 2 S a k J a k ,
together with the relations
T = Γ ˙ , μ k = W ˙ k , μ m i = W ˙ m i ,
where H a k is the molar enthalpy at the port a k . From the second law, the entropy production must be always positive and hence dictates the choice of the phenomenological equations
J 1 m 1 = G 1 , m 1 ( μ 1 μ m 1 ) , J m i m i + 1 = G m i , m i + 1 ( μ m i μ m i + 1 ) , J 2 m K = G 2 , m K ( μ 2 μ m K ) ,
for positive state functions G 1 , m 1 , G m i , m i + 1 , G 2 , m K . The energy balance equation holds as
d d t U = k = 1 2 H a k J a k .
Example 5 (Diffusion through a Parallel Array of Membranes).
We now consider diffusion through a composite membrane made of different elements arranged in a parallel-array, as illustrated in Figure 5. As before, matter also transfers into or out of the compartments via two external ports. In this case, the variational formulation directly yields the evolution equations
N ˙ 1 = i = 1 N J m i 1 + J a 1 , N ˙ 2 = i = 1 N J m i 2 + J a 2 , N ˙ m i = J 1 m i + J 2 m i , i = 1 , , N , T S ˙ = i = 1 N J 1 m i ( μ 1 μ m i ) + J 2 m i ( μ 2 μ m i ) + k = 1 2 J a k ( H a k T S a k μ k ) + T k = 1 2 S a k J a k ,
together with the relations
T = Γ ˙ , μ k = W ˙ k , μ m i = W ˙ m i .
As earlier, the second law suggests the phenomenological equations
J 1 m i = G 1 , m i ( μ 1 μ m i ) , J 2 m i = G 2 , m i ( μ 2 μ m i )
for positive state functions G 1 , m i , G 2 , m i . The energy balance equation is the same as in (33).

4. Open Discrete Systems with Heat and Matter Transfer

In this section, we extend the variational formulation developed above to the case of non-simple open thermodynamic systems. Such systems are composed of several subsystems, each of them being simple and open, and exchanges heat and matter with other subsystems.

4.1. Variational Formulation for Discrete Open Systems

Consider an open system with a single species experiencing internal diffusion and heat transfer between several compartments, and transfer into or out of the system through several ports. The walls between compartments can be adiabatic, impermeable, or permeable. An example of such a system is illustrated in Figure 6. For simplicity, we do not consider the mechanical interactions. They can be included as in Section 3.3.
We denote by S k and N k the entropies and the number of moles N k of the k-th compartment, k = 1 , , K . We assume that the system also involves mechanical variables q = ( q 1 , , q n ) . We denote by P k l the total power exchange due to the heat and matter transfer between the k-th and l-th compartments and by J k l the molar flow rate of the chemical species between the k-th and l-th compartments. When the power exchange is only associated to heat transfer, it is denoted by P H k l .
We assume that the Lagrangian of the system is of the form
L ( q , q ˙ , S 1 , , S K , N 1 , , N K ) ,
i.e., it depends on the mechanical variables q, as well as the number of moles and the entropies of each compartment. As earlier, we denote by F ext and F fr the external and friction forces. We also introduce the fluxes J l k , k l such that J k l = J l k . The relation between the fluxes J k l and the total power exchanges P k l will be given later. For the purpose of the variational formulation, it is convenient to define the flux J k l for k = l as
J k k : = l k J k l ,
so that we have
k = 1 K J k l = 0 .
As earlier, the k-th compartment may have A k ports, through which species can flow out or into the system. In addition, we also assume that the k-th compartment may have B k heat sources of temperature T H b , k .
Given the Lagrangian L, the external and friction forces F ext , F k fr , the fluxes J k l , the molar flow rates J l k , J a , k , and the entropy flow rates J S l k , J S a , k , the variational formulation is expressed as
δ t 1 t 2 L ( q , q ˙ , S 1 , , S K , N 1 , , N K ) + k = 1 K W ˙ k N k + k = 1 K Γ ˙ k ( S k Σ k ) d t + t 1 t 2 F ext , δ q d t = 0 , VARIATIONAL CONDITION
where the curves satisfy the nonlinear nonholonomic constraint
L S k Σ ˙ k = F k fr , q ˙ + l = 1 K J k l Γ ˙ l + l = 1 K J l k W ˙ k + a = 1 A k J a , k ( W ˙ k μ a , k ) + J S a , k ( Γ ˙ k T a , k ) + b = 1 B k J S b , k ( Γ ˙ k T H b , k ) , k = 1 , , K , KINEMATIC CONSTRAINT
and with respect to variations subject to the constraint
L S k δ Σ k = F k fr , δ q + l = 1 K J k l δ Γ l + l = 1 K J l k δ W k + a = 1 A k J a , k δ W k + J S a , k δ Γ k + b = 1 B k J S b , k δ Γ k , k = 1 , , K , VARIATIONAL CONSTRAINT
with δ q ( t 1 ) = δ q ( t 2 ) = 0 and δ W k ( t 1 ) = δ W k ( t 2 ) = 0 .
Taking the variations, we get
t 1 t 2 L q i d d t L q ˙ i δ q i + k = 1 K L S k δ S k + k = 1 K L N k δ N k k = 1 K δ Γ k ( S ˙ k Σ ˙ k ) + k = 1 K Γ ˙ k ( δ S k δ Σ k ) k = 1 K δ W k N ˙ k + k = 1 K W ˙ k δ N k + F ext , δ q d t = 0 .
With the help of the variational constraint we replace δ Σ k and we get
δ q i : L q i d d t L q ˙ i k = 1 K Γ ˙ k L S k F k fr i + ( F ext ) i = 0 , i = 1 , , n , δ S k : L S k + Γ ˙ k = 0 , k = 1 , , K , δ N k : L N k + W ˙ k = 0 , k = 1 , , K , δ W k : N ˙ k Γ ˙ k L S k l = 1 K J l k Γ ˙ k L S k a = 1 A k J a , k , k = 1 , , K , δ Γ k : S ˙ k + Σ ˙ k l = 1 K Γ ˙ l L S l J l k Γ ˙ k L S k a = 1 A k J S a , k Γ ˙ k L S k b = 1 B k J S b , k = 0 , k = 1 , , K .
From these conditions, together with (35), we get the evolution equations for the open system with internal diffusion and heat transfer as
d d t L q ˙ i L q i = k = 1 K ( F k fr ) i + ( F ext ) i , i = 1 , , n , N ˙ k = l = 1 K J l k + a = 1 A k J a , k , k = 1 , , K , T k S ˙ k = F k fr , q ˙ l = 1 K J k l ( T l T k ) l = 1 K J l k μ k a = 1 A k J a , k ( μ k μ a , k ) + J S a , k ( T k T a , k ) b = 1 B k J S b , k ( T k T H b , k ) + T k a = 1 A k J S a , k + T k b = 1 B k J S b , k , k = 1 , , K ,
together with the conditions
Γ ˙ k = L S k = : T k , W ˙ k = L N k = : μ k , Σ ˙ k = S ˙ k a = 1 A k J a , k , k = 1 , , K ,
where we defined the temperature T k and the chemical Potential μ k of the k-th compartment.
From (36), it follows that the internal entropy production Σ ˙ = k = 1 K Σ ˙ k of the system is given by
I : = Σ ˙ = k = 1 K 1 T k F k fr , q ˙ + k < l K J S k l ( T l T k ) 1 T l 1 T k + k < l K J k l μ k T k μ l T l k = 1 K 1 T k a = 1 A k J a , k ( μ k μ a , k ) + J S a , k ( T k T a , k ) k = 1 K 1 T k b = 1 B k J S b , k ( T k T H b , k ) .
With this expression of Σ ˙ , the balance of total entropy S = k = 1 K S k is
S ˙ = Σ ˙ + k = 1 K a = 1 A k J S a , k + k = 1 K b = 1 B k J S b , k .
The total energy associated to the Lagrangian L ( q , q ˙ , S 1 , , S K , N 1 , , N K ) is defined as before as
E ( q , q ˙ , S 1 , , S K , N 1 , , N K ) : = L q ˙ , q ˙ L ,
and satisfies the energy balance
d d t E = F ext , q ˙ + k = 1 K b = 1 B k J S b , k T H b , k + k = 1 K a = 1 A k J a , k μ a , k + J S a , k T a , k = P W ext + P H ext + P M ext ,
where P W ext = F ext , q ˙ is the power exchange due to mechanical work, P H ext = k = 1 K b = 1 B k J S b , k T H b , k is the power exchange due to the heat sources, and P M ext = a = 1 A k J a , k μ a , k + J S a , k T a , k is the power exchange due to matter flowing inside or out of the system through the ports. The energy balance (38) is the first law of thermodynamics of this system.
From the second law of thermodynamics, the internal entropy production Σ ˙ in (37) must be positive and hence suggests, in the linear regime, the phenomenological relations
( F k fr ) i = ( λ k ) i j q ˙ j , J k l ( T l T k ) J k l = L k l 1 T l 1 T k μ k T k μ l T l ,
where the symmetric part of the n × n matrices λ k and of the 2 × 2 matrices L k l are positive. The entries of these matrices are phenomenological coefficients determined experimentally, which may in general depend on the state variables. From Onsager’s relation, the 2 × 2 matrix
L k l = L H H k l L H M k l L M H k l L M M k l
is symmetric, for all k , l . The matrix elements L H H k l and L M M k l are related to the processes of heat conduction and diffusion between the k-th and l-th compartments. The coefficient L M H k l and L H M k l describe the cross-effects, and hence are associated to discrete versions of the process of thermal diffusion and the Dufour effect. Thermal diffusion is the process of matter diffusion due to the temperature difference between the compartments. The Dufour effect is the process of heat transfer due to difference of chemical potentials between the compartments.

4.2. Examples of Non-Simple Systems with Heat and Matter Transfer

Here we consider two examples of open non-simple systems experiencing heat conduction, diffusion, and their cross-effects. While the first example concerns the simple case of two compartment, the second describes the case of a composite membrane.
Example 6 (Heat Conduction and Diffusion between Two Compartments).
We consider the open system consisting of two compartments as illustrated in Figure 7. The compartments are separated by a permeable wall through which heat conduction and diffusion is possible. They also have ports a 1 , a 2 through which matter can flow into or out of the system. The fluxes, temperatures, and pressures at the ports are J a k , T a k , p a k , k = 1 , 2 . Finally, there are heat sources b 1 , b 2 , with entropy flow J S b 1 , J S b 2 and temperatures T H b 1 , T H b 2 .
The Lagrangian of this system is
L ( S 1 , S 2 , N 1 , N 2 ) = U ( S 1 , N 1 ) U ( S 2 , N 2 ) ,
where U ( S , N ) is the internal energy of the chemical species. In this case, the system (36) specifies to
N ˙ 1 = J 2 1 + J a 1 , N ˙ 2 = J 1 2 + J a 2 , T 1 S ˙ 1 = J 12 ( T 2 T 1 ) J 2 1 μ 1 + J a 1 ( H a 1 T 1 S a 1 μ 1 ) + T 1 S a 1 J a 1 + T H b 1 J S b 1 , T 2 S ˙ 2 = J 12 ( T 1 T 2 ) J 1 2 μ 2 + J a 2 ( H a 2 T 2 S a 2 μ 2 ) + T 2 S a 2 J a 2 + T H b 2 J S b 2 ,
where
T k = U S k , μ k = U N k , k = 1 , 2 ,
are the temperatures and chemical potentials of the k-th compartments.
In (40), the first and second equations are the mole balances in each compartment, while the third and fourth equations are the entropy equations in each compartment. Thus it follows that the equation for the total entropy S = S 1 + S 2 of the system is
S ˙ = J 12 ( T 1 T 2 ) 1 T 1 1 T 2 + J 1 2 μ 1 T 1 μ 2 T 2 + k = 1 2 1 T k J a k ( H a k T k S a k μ k ) + S a k J a k + T H b k T k J S b k .
The internal entropy production is found from (37) as
I : = Σ ˙ = J 12 ( T 1 T 2 ) 1 T 1 1 T 2 + J 1 2 μ 1 T 1 μ 2 T 2 + k = 1 2 1 T k J a k ( H a k T k S a k μ k ) + k = 1 2 1 T k J S b k ( T H b k T k ) 0 ,
from which, in the linear regime, the phenomenological relations are obtained as in (39).
The energy balances for each compartment are
d d t U 1 = J 12 ( T 2 T 1 ) + J a 1 H a 1 + T H b 1 J S b 1 = P 2 1 + P M a 1 + P H b 1 , d d t U 2 = J 12 ( T 1 T 2 ) + J a 2 H a 2 + T H b 2 J S b 2 = P 1 2 + P M a 2 + P H b 2 ,
where P 1 2 = J 12 ( T 2 T 1 ) is the power exchanged between the two compartments, P M a k = J a k H a k is the power exchanged between the k-th compartment and the exterior through the a k -th port, and P H b k = T H b k J S b k is the power exchanged between the k-th compartment and the heat source b k . Note that from the definition of P H b k , we can rewrite the last term of the entropy production Equation (41) as
k = 1 2 P H b k 1 T k 1 T H b k .
Note that the relation P 1 2 = J 12 ( T 2 T 1 ) related the flux J 12 used in the variational formulation, to the total power exchange P 1 2 between the compartments, due to heat condition, diffusion, and their cross-effects.
The total energy balance reads
d d t U = P M ext + P H ext , P M ext = k = 1 2 P M a k , P H ext = k = 1 2 P H b k .
Example 7 (Heat Conduction and Diffusion through a Composite Membrane).
We consider the open system illustrated in Figure 8, which describes the heat conduction and diffusion of a single species through a composite membrane made from a parallel array of N elements. We also assume that each compartment as a port. For simplicity, we do not consider external heating. It can be included in a similar way with the previous example.
In this case, the system (36) specifies to
N ˙ 1 = i = 1 N J m i 1 + J a 1 , N ˙ 2 = i = 1 N J m i 2 + J a 2 , N ˙ m i = J 1 m i + J 2 m i , i = 1 , , N , T 1 S ˙ 1 = i = 1 N J 1 m i ( T m i T 1 ) i = 1 N J m i 1 μ 1 + J a 1 ( H a 1 T 1 S a 1 μ 1 ) + T 1 S a 1 J a 1 , T 2 S ˙ 2 = i = 1 N J 2 m i ( T m i T 2 ) i = 1 N J m i 2 μ 2 + J a 2 ( H a 2 T 2 S a 2 μ 2 ) + T 2 S a 2 J a 2 , T m i S ˙ m i = J 1 m i ( T 1 T m i ) J 2 m i ( T 2 T m i ) J 1 m i μ m i J 2 m i μ m i , i = 1 , , N .
The internal entropy production is found from (37) as
I : = Σ ˙ = k = 1 2 i = 1 N J m i k ( T m i T k ) 1 T m i 1 T k + k = 1 2 i = 1 N J k m i μ k T k μ m i T m i + k = 1 2 1 T k J a k ( H a k T k S a k μ k ) ,
from which the entropy equation follows as
S ˙ = Σ ˙ + k = 1 2 S a k J a k .

5. Conclusions

In this paper, we have developed a Lagrangian variational formulation of nonequilibrium thermodynamics for discrete open systems. We have introduced an abstract variational formulation for systems with time-dependent nonlinear nonholonomic constraints, based on a variational constraint and a kinematic constraint, related in a specific way. We have first shown how the proposed variational formulation applies to simple open systems, i.e., system well described by a single entropy variable. We have considered simple systems experiencing mechanical interactions, internal diffusion process between several compartments, as well as matter transfer with the exterior through several ports. We have illustrated the proposed framework with several examples such as diffusion through serial and parallel composite membranes. Then, we have extended our variational formulation to the case of non-simple open systems, experiencing mechanical interactions, internal diffusion, internal heat transfer, and their cross-effects, which are the discrete versions of thermal diffusion and of the Dufour effect. In each case, our approach yields a systematic and efficient way to derive the complete evolution equations for the open discrete system, independently on its complexity. Such an approach may be especially useful for the treatment of nonequilibrium thermodynamic of biophysical systems.
The approach presented in this paper provides the foundational step for further developments on the nonequilibrium thermodynamics of open systems. As our future works, we project to consider (i) the associated Dirac dynamical system formulation for discrete open systems, see [12] for closed systems; (ii) the variational numerical discretization for discrete open systems, see [6] for closed system; (iii) the treatment of continuum open systems.

Acknowledgments

François Gay-Balmaz is partially supported by the ANR project GEOMFLUID, ANR-14-CE23-0002-01; Hiroaki Yoshimura is partially supported by JSPS Grant-in-Aid for Scientific Research (26400408, 16KT0024, 17H01097), the MEXT “Top Global University Project” and Waseda University (SR 2017K-167).

Author Contributions

François Gay-Balmaz and Hiroaki Yoshimura both contribute to this paper.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Gruber, C. Thermodynamics of systems with internal adiabatic constraints: Time evolution of the adiabatic piston. Eur. J. Phys. 1999, 20, 259–266. [Google Scholar] [CrossRef]
  2. Gay-Balmaz, F.; Yoshimura, H. A Lagrangian variational formulation for nonequilibrium thermodynamics. Part I: Discrete systems. J. Geom. Phys. 2017, 111, 169–193. [Google Scholar] [CrossRef]
  3. Gay-Balmaz, F.; Yoshimura, H. A Lagrangian variational formulation for nonequilibrium thermodynamics. Part II: Continuum systems. J. Geom. Phys. 2017, 111, 194–212. [Google Scholar] [CrossRef]
  4. Gay-Balmaz, F.; Putkaradze, V. On flexible tubes conducting fluid: Geometric nonlinear theory, stability and dynamics. J. Nonlin. Sci. 2015, 25, 889–936. [Google Scholar] [CrossRef]
  5. Marsden, J.E.; West, M. Discrete mechanics and variational integrators. Acta Numer. 2001, 10, 357–514. [Google Scholar] [CrossRef]
  6. Gay-Balmaz, F.; Yoshimura, H. Variational discretization for the nonequilibrium thermodynamics of simple systems. Nonlinearity 2018, in press. [Google Scholar]
  7. Stueckelberg, E.C.G.; Scheurer, P.B. Thermocinétique Phénoménologique Galiléenne; Birkhauser: Basel, Switzerland, 1975. (In French) [Google Scholar]
  8. Ferrari, C.; Gruber, C. Friction force: From mechanics to thermodynamics. Eur. J. Phys. 2010, 31, 1159–1175. [Google Scholar] [CrossRef]
  9. Gruber, C.; Brechet, S.D. Lagrange equation coupled to a thermal equation: Mechanics as a consequence of thermodynamics. Entropy 2011, 13, 367–378. [Google Scholar] [CrossRef]
  10. Klein, S.; Nellis, G. Thermodynamics; Cambridge University Press: Cambridge, UK, 2011. [Google Scholar]
  11. Sandler, S.I. Chemical, Biochemical, and Engineering Thermodynamics; John Wiley & Sons: New York, NY, USA, 2006. [Google Scholar]
  12. Gay-Balmaz, F.; Yoshimura, H. Dirac structures in nonequilibrium thermodynamics. J. Math. Phys. 2018, 59, 012701. [Google Scholar] [CrossRef]
  13. Bloch, A.M. Nonholonomic Mechanics and Control; Krishnaprasad, P.S., Murray, R.M., Eds.; Interdisciplinary Applied Mathematics; Springer: New York, NY, USA, 2003. [Google Scholar]
  14. Cendra, H.; Ibort, A.; de León, M.; de Diego, M. A generalization of Chetaev’s principle for a class of higher order nonholonomic constraints. J. Math. Phys. 2004, 45, 2785. [Google Scholar] [CrossRef]
  15. Marle, C.-M. Various approaches to conservative and nonconservative non-holonomic systems. Rep. Math. Phys. 1998, 42, 211–229. [Google Scholar] [CrossRef]
  16. Vankerschaver, J.; Yoshimura, H.; Leok, M. The Hamilton-Pontryagin principle and multi-Dirac structures for classical field theories. J. Math. Phys. 2012, 53, 072903. [Google Scholar] [CrossRef] [Green Version]
  17. Von Helmholtz, H. Studien Zur Statik Monocyklischer Systeme; Sitzungsberichte der Königlich Preussischen Akademie der Wissenschaften zu Berlin: Berlin, Germany, 1884; pp. 159–177. (In German) [Google Scholar]
  18. Green, A.E.; Naghdi, P.M. A re-examination of the basic postulates of thermomechanics. Proc. R. Soc. Lond. Ser. A 1991, 432, 171–194. [Google Scholar] [CrossRef]
  19. Podio-Guidugli, P. A virtual power format for thermomechanics. Contin. Mech. Thermodyn. 2009, 8, 479–487. [Google Scholar] [CrossRef]
  20. De Groot, S.R.; Mazur, P. Nonequilibrium Thermodynamics; North-Holland: New York, NY, USA, 1969. [Google Scholar]
  21. Fuchs, H.U. The Dynamics of Heat: A Unified Approach to Thermodynamics and Heat Transfer; Graduate Texts in Physics; Springer Science + Buisness Media: New York, NY, USA, 2010. [Google Scholar]
  22. Kedem, O.; Katchalsky, A. Permeability of composite membranes. Part 1. Electric current, volume flow and flow of solute through membranes. Trans. Faraday Soc. 1963, 59, 1918–1930. [Google Scholar] [CrossRef]
  23. Kedem, O.; Katchalsky, A. Permeability of composite membranes. Part 2. Parallel elements. Trans. Faraday Soc. 1963, 59, 1931–1940. [Google Scholar] [CrossRef]
  24. Kedem, O.; Katchalsky, A. Permeability of composite membranes. Part 3. Series array of elements. Trans. Faraday Soc. 1963, 59, 1941–1953. [Google Scholar] [CrossRef]
  25. Oster, G.F.; Perelson, A.S.; Katchalsky, A. Network thermodynamics: Dynamic modelling of biophysical systems. Q. Rev. Biophys. 1973, 6, 1–134. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Simple open system given by a flowing fluid carrying kinetic energy into a piston device.
Figure 1. Simple open system given by a flowing fluid carrying kinetic energy into a piston device.
Entropy 20 00163 g001
Figure 2. Simple open system with a single species experiencing internal diffusion between several compartments, and transfer into or out of the system through several ports.
Figure 2. Simple open system with a single species experiencing internal diffusion between several compartments, and transfer into or out of the system through several ports.
Entropy 20 00163 g002
Figure 3. Simple open system with a single chemical component experiencing diffusion between two compartments, and transfer into or out of the system through two ports.
Figure 3. Simple open system with a single chemical component experiencing diffusion between two compartments, and transfer into or out of the system through two ports.
Entropy 20 00163 g003
Figure 4. Simple open system with diffusion of a single chemical species through a composite membrane made of a serial array of N elements.
Figure 4. Simple open system with diffusion of a single chemical species through a composite membrane made of a serial array of N elements.
Entropy 20 00163 g004
Figure 5. Simple open system with diffusion of a single chemical species through a composite membrane made of a parallel array of N elements.
Figure 5. Simple open system with diffusion of a single chemical species through a composite membrane made of a parallel array of N elements.
Entropy 20 00163 g005
Figure 6. Open system with a single species experiencing internal diffusion an heat transfer between several compartments, and transfer into or out of the system through several ports.
Figure 6. Open system with a single species experiencing internal diffusion an heat transfer between several compartments, and transfer into or out of the system through several ports.
Entropy 20 00163 g006
Figure 7. Non-simple open system with a single chemical component, experiencing diffusion and heat conduction between two compartments, and transfer into or out of the system through two ports.
Figure 7. Non-simple open system with a single chemical component, experiencing diffusion and heat conduction between two compartments, and transfer into or out of the system through two ports.
Entropy 20 00163 g007
Figure 8. Non-simple open system with heat conduction and diffusion of a single chemical species through a composite membrane made of a parallel array of N elements.
Figure 8. Non-simple open system with heat conduction and diffusion of a single chemical species through a composite membrane made of a parallel array of N elements.
Entropy 20 00163 g008

Share and Cite

MDPI and ACS Style

Gay-Balmaz, F.; Yoshimura, H. A Variational Formulation of Nonequilibrium Thermodynamics for Discrete Open Systems with Mass and Heat Transfer. Entropy 2018, 20, 163. https://doi.org/10.3390/e20030163

AMA Style

Gay-Balmaz F, Yoshimura H. A Variational Formulation of Nonequilibrium Thermodynamics for Discrete Open Systems with Mass and Heat Transfer. Entropy. 2018; 20(3):163. https://doi.org/10.3390/e20030163

Chicago/Turabian Style

Gay-Balmaz, François, and Hiroaki Yoshimura. 2018. "A Variational Formulation of Nonequilibrium Thermodynamics for Discrete Open Systems with Mass and Heat Transfer" Entropy 20, no. 3: 163. https://doi.org/10.3390/e20030163

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop