Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

1.1 The Bond Graph Formalism

Since the invention of the Bond Graph (BG) formalism by Henry Paynter in 1959, this technique has become a powerful tool for modeling and simulating dynamic systems. Used in the beginning in the fields of Electrical and Mechanical Engineering, applications in different areas such as Thermodynamics and Electrodynamics have been successful [1316, 18, 22, 29, 32, 39, 43].

Once the BG representation of a system has been obtained, there is a systematic procedure for: (a) determining a set of state variables; (b) defining the input variables by means of generalized effort and flow sources; (c) assigning causality, which assures the mathematical well-posedness of the state equations; and (d) obtaining the state equations and output variables.

In this way, the BG formalism can be regarded as a filter through which mathematical inconsistencies can be detected in the modeling process from the beginning.

1.2 Numerical Methods for Computational Fluid Dynamics

An important fraction of the problems in Fluid Mechanics falls within what is called Computational Fluid Dynamics (CFD) . This branch of the human knowledge has nurtured the development of various numerical approaches, being the most popular ones the Finite Element Method (FEM) [23, 34, 47], the Finite Volume Method (FVM) [35], and the Finite Difference Method (FDM) [42].

Although a separate comprehensive introduction to these numerical approaches is not attempted, it can be said that all these methods try to solve the problem by discretizing the continua, that is, by replacing the continuous variables by a combination of a finite set of nodal values and interpolating functions. The result is a (generally nonlinear) algebraic problem, instead of the original differential or integro-differential one. No matter what kind of numerical method is selected, they all end up with an algebraic system of a large number of unknowns.

The members of this family of methods, called CFD solvers, have all advantages and disadvantages with respect to each other. Some of them are easy to understand and usually also easy to implement, but may lack of generality, like the FDM. On the other hand, some methods may lead to more general solvers but are in turn theoretically more involved, like the FEM or the FVM.

1.3 Motivation

In the field of Fluid Dynamics, the potential benefits of BG have not been yet fully exploited. The applications to fluid dynamic systems were not oriented to a systematic spatial discretization of flow fields, typical of CFD problems. Fluid Dynamics is a challenging area for bondgraphers, because these systems are rigorously described by nonlinear partial differential equations (PDEs) with important spatial effects and exhibit couplings between different energy domains.

In [16] the concept of convection bond was introduced, as a way of dealing with the coupling between mechanical and thermal energy domains in a compressible flow . A convection bond has two independent variables to describe the effort (pressure and stagnation enthalpy) and a flow variable (mass flow). The true effort variable is the stagnation enthalpy, being pressure an auxiliary variable. Full upwind (upstream value) is used for the evaluation of the stagnation enthalpy.

A pioneer contribution linking BG to CFD appeared in [26], although the formulation was restricted to prescribed shape functions and nodalization. Besides, heat conduction (which leads to advection-diffusion problems) was not modeled. A systematic procedure, within the frame of the BG theory, for integrating in volume the power conservation equations in order to get the state equations would be desirable, in order to bridge the gap between the continuous (distributed parameter) formulation of the conservation equations and a discretized (lumped parameter) numerical scheme.

It is well known that the BG representation depicts in a very elegant way conservation of energy in the various forms in which it may appear in a given dynamic, lumped-parameter system. The definition of suitable generalized effort and flow variables, based on the system total energy, allows to obtain the state equations in an orderly fashion.

Another characteristic of the BG approach is the natural representation of dynamic systems with mixed energy domains. This feature is interesting when dealing with CFD problems because in a multidimensional, viscous, compressible flow with heat transfer, the right understanding of the transformation of mechanical energy into thermal energy, as well as the generation of irreversibility, is essential to assure mathematical well-posedness and realistic results.

CFD solvers share many well-known nodalization-related difficulties [35]. Advection dominated flows may give rise to numerical instabilities that require upwinding or other stabilization techniques. Checkerboard pressure fields are also a common problem, requiring the use of staggered grids or equal-order methods. It would be interesting to find out whether a BG approach suffers from these difficulties (as well as many others) and if it is so, how they are handled and what tools are rendered to solve them.

The methodology presented in this chapter has the following characteristics, briefly described as follows:

  1. 1.

    The methodology is based on the representation of the total energy per unit volume as a function of a set of independent variables. The time derivative of the total energy per unit volume is represented at the continuum level by a summation of products of generalized potentials (constitutive relations) and time derivatives of the independent variables. This representation satisfies the Maxwell relations [17].

  2. 2.

    The balance equations, corresponding to each one of the terms appearing in the time derivative of the total energy rate per unit volume, are derived based on the PDEs representing the conservation laws; in this way, all physical effects can naturally be taken into account. The balance equations represent the power structure of the system at the continuum level, showing three type of terms: (a) Divergence terms, related to the boundary conditions; (b) Source terms, and (c) Coupling terms, related to the power transfer between the different energy domains, appearing as terms with opposite signs in pairs of balance equations.

  3. 3.

    The discretization is made in terms of time-dependent nodal values of the independent variables and position-dependent interpolation functions, characteristic of the FEM. Nodal state variables and associated nodal potentials are defined in a straightforward manner. In this way, all the properties are kept for the energy representation at the discretized level, resulting generalized effort and flow variables characteristic of true BG .

  4. 4.

    The state equations are obtained by establishing weak formulations of the continuous problem, as done in the FEM. The chosen test functions are the shape functions for the momentum conservation equation and weight functions for the mass and/or entropy conservation equations, resulting respectively a Galerkin and a Petrov–Galerkin method. The weight functions are suitable for introducing upwind or other numerical schemes, depending on the mathematical nature of the problem.

Consequently, the formulation links two areas, namely the BG methodology and CFD. It is interesting to see that, although temperature and entropy rate are the natural BG variables in thermal problems, bondgraphers resort to pseudo-BG or other non-BG elements when modeling thermofluid flow problems [32, 43], as if there were some intrinsic difficulty in incorporating naturally all the relevant physical effects.

As the BG approach allows the easy interconnection of systems of different energy domains, it is foreseeable that the findings of this contribution could be used for problems such as fluid-structure interaction, Magnetohydrodynamics, etc.

1.4 Organization

The organization of this contribution is outlined as follows. In Sect. 9.2 the methodology is applied to a single-phase, single-component, multidimensional compressible flow with viscosity and thermal effects. In Sect. 9.3 the methodology is applied to a flow in which the incompressibility constraint is set, showing the differences with the general case. In Sect. 9.4 numerical applications obtained with the methodology outlined above are shown, as well as the extension of the BG methodology to other flow problems. Finally, Sect. 9.5 shows the main conclusions and perspectives that can be drawn from the work done so far.

1.5 Notation

In the following, bold letters will be used to define vectors (\(\boldsymbol{V }\), \(\boldsymbol{p}_{v}\), etc.). With regard to matrix notation, column vectors associated with nodal values will be denoted by single underscored plain or bold type (m, S, \(\underline{\boldsymbol{V }}\), φ ρ , etc.) while multidimensional matrices will be identified by double underscored type (M, Ω ρ , etc.). Second order tensors will be denoted by double underscored type (τ, I, etc.). In some cases, it will be convenient to express an entity either as a column vector or as a matrix (for instance, Θ and Θ). The superscript T will be used to denote the transpose. Einstein convention of summation over repeated indices is not used. All the variables will be defined as they appear in the contribution.

2 Compressible Flows

Compressible flow is a branch of Fluid Mechanics that studies flows in which there are significant changes in the fluid density. When the fluid velocity is comparable to the speed of sound, compressibility effects become important [40].

An important parameter in compressible flows is the Mach number Ma, which is the ratio of the particle speed to the local speed of sound; as a rule of thumb, compressibility effects must be taken into account when Ma > 0. 3. Mass, momentum, and energy conservation equations are coupled and an equation of state is needed to close the problem. As this condition is frequently encountered in gas systems (usually the fluid is considered as an ideal gas), the object of study is known as gas dynamics.

Basic studies of compressible pipe flows assume that viscous and heat transfer effects are negligible, leading to isentropic flows; performance of converging and converging-diverging nozzles are typical examples studied with this approximation. More sophisticated studies take into account wall shear stresses (Fanno flows) and heating/cooling (Rayleigh flows). Distinctive effects in compressible flows are the limitation of the mass flow rate when the local velocity equals the sound of speed (choking) and existence of very thin discontinuities in the flow properties, associated with irreversibilities (shock waves). The study of compressible flow is relevant to high-speed aircraft, jet engines, rocket motors, gas pipelines, and many other fields.

In this section a single-phase, single-component, multidimensional compressible flow with viscosity and thermal effects is considered for the application of the BG methodology [9, 10].

2.1 Continuum Formulation

In this section the representation of the power structure and physical model is presented at the continuum level, that is, for a control volume of differential size. The dynamic equations are presented in a form that is suitable to be framed, after integration in the system volume, within the BG theory.

2.1.1 Energy and Power Representation

The total energy per unit volume e v (\(e_{v} =\rho \,\hat{ e}\), where ρ is the density and \(\hat{e}\) is the total energy per unit mass) is defined as the sum of the internal energy per unit volume u v (\(u_{v} =\rho \,\hat{ u}\), where \(\hat{u}\) is the internal energy per unit mass) and the kinetic coenergy per unit volume t v :

$$\displaystyle{ e_{v} = u_{v}\left (\rho,\,s_{v}\right ) + t_{v}^{{\ast}} }$$
(9.1)

It is assumed that the internal energy per unit volume is a function of density and entropy per unit volume s v (\(s_{v} =\rho \,\hat{ s}\), where \(\hat{s}\) is the entropy per unit mass). The kinetic coenergy per unit volume is defined as:

$$\displaystyle{ t_{v}^{{\ast}} = \frac{1} {2}\,\rho \,\boldsymbol{V }^{2} }$$
(9.2)

where \(\boldsymbol{V }\) is the velocity. The following potentials are defined [17]:

$$\displaystyle{ \boldsymbol{p}_{v} = \left (\frac{\partial t_{v}^{{\ast}}} {\partial \boldsymbol{V }} \right )_{\rho } =\rho \,\boldsymbol{ V } }$$
(9.3)
$$\displaystyle{ \kappa = \left (\frac{\partial t_{v}^{{\ast}}} {\partial \rho } \right )_{\boldsymbol{V }} = \frac{1} {2}\,\boldsymbol{V }^{2} }$$
(9.4)
$$\displaystyle{ \theta = \left (\frac{\partial u_{v}} {\partial s_{v}} \right )_{\rho } }$$
(9.5)
$$\displaystyle{ \psi = \left (\frac{\partial u_{v}} {\partial \rho } \right )_{s_{v}} = \frac{1} {\rho } \left (u_{v} + P -\theta \, s_{v}\right ) }$$
(9.6)

where \(\boldsymbol{p}_{v}\), κ, θ, ψ, and P are respectively the linear momentum per unit volume, the kinetic coenergy per unit mass, the absolute temperature, the Gibbs free energy per unit mass, and the absolute pressure. The time derivative of the total energy per unit volume can be written as:

$$\displaystyle{ \frac{\partial e_{v}} {\partial t} = \left (\psi +\kappa \right )\, \frac{\partial \rho } {\partial t} +\boldsymbol{ p}_{v} \cdot \frac{\partial \boldsymbol{V }} {\partial t} +\theta \, \frac{\partial s_{v}} {\partial t} }$$
(9.7)

Notice that the energy and power representation is made independently of the approximations and fluid constitutive laws chosen for the conservation equations; the same representation could be used, for instance, for a newtonian or non-newtonian fluid. Besides, the right-hand side of Eq. (9.7) determines the power terms that must be defined from the physical flow model.

An alternative formulation can be derived by taking \(\boldsymbol{p}_{v}\) instead of \(\boldsymbol{V }\) as independent variable. In this case, the formulation would be symmetric, in a sense that the volume integrals of the independent variables would result in the system mass, linear momentum, and entropy. Nevertheless, velocity is chosen because it is more popular as discretized variable and because the resulting expressions are easier to calculate.

A comment should be made concerning the existence of the potentials for incompressible flows. For this particular case, as density is a constant, the internal energy per unit volume is a function of the entropy per unit volume only, being the pressure an external function which must adjust to satisfy the incompressibility condition. Thus, pressure is no longer a thermophysical property and Eq. (9.6) is no longer valid. Incompressible flows deserve a special treatment, presented in Sect. 9.3.

2.1.2 Constitutive and Maxwell Relations

The resulting constitutive relations come from the first derivatives of the total energy per unit volume:

$$\displaystyle{ \psi +\kappa =\psi \left (\rho,\,s_{v}\right ) +\kappa \left (\boldsymbol{V }\right ) }$$
(9.8)
$$\displaystyle{ \boldsymbol{p}_{v} =\boldsymbol{ p}_{v}\left (\rho,\,\boldsymbol{V }\right ) =\rho \,\boldsymbol{ V } }$$
(9.9)
$$\displaystyle{ \theta =\theta \left (\rho,\,s_{v}\right ) }$$
(9.10)

For the total energy be a single-valued function of the independent variables ρ, \(\boldsymbol{V }\) and s v , the constitutive relations must satisfy the Maxwell relations, which arise from the equality of the mixed partial derivatives. These derivatives can be written as a function of the independent variables, through the constitutive relations and three independent derivatives [17], which can be chosen as:

$$\displaystyle{ \alpha = -\frac{1} {\rho } \left (\frac{\partial \rho } {\partial \theta }\right )_{P} }$$
(9.11)
$$\displaystyle{ c_{v} = \frac{\theta } {\rho }\left (\frac{\partial s_{v}} {\partial \theta } \right )_{\rho } }$$
(9.12)
$$\displaystyle{ \kappa _{\theta } = \frac{1} {\rho } \left ( \frac{\partial \rho } {\partial P}\right )_{\theta } }$$
(9.13)

where α, c v and κ θ are respectively the coefficient of thermal expansion, the constant volume specific heat, and the coefficient of isothermal compressibility. In this way, the Maxwell relations can be written as:

$$\displaystyle\begin{array}{rcl} \left (\frac{\partial \theta } {\partial \rho }\right )_{s_{v}} = \left [ \frac{\partial } {\partial s_{v}}\left (\psi +\kappa \right )\right ]_{\rho } = \left ( \frac{\partial \psi } {\partial s_{v}}\right )_{\rho } = \frac{\theta } {\rho \,c_{v}}\left (\frac{\alpha } {\rho \,\kappa _{\theta }} -\frac{s_{v}} {\rho } \right )& &{}\end{array}$$
(9.14)
$$\displaystyle\begin{array}{rcl} \left ( \frac{\partial \theta } {\partial \boldsymbol{V }}\right )_{s_{v}} = \left (\frac{\partial \boldsymbol{p}_{v}} {\partial s_{v}}\right )_{\boldsymbol{V }} = \mathbf{0}& &{}\end{array}$$
(9.15)
$$\displaystyle\begin{array}{rcl} \left [ \frac{\partial } {\partial \boldsymbol{V }}\left (\psi +\kappa \right )\right ]_{\rho } = \left ( \frac{\partial \kappa } {\partial \boldsymbol{V }}\right )_{\rho } = \left (\frac{\partial \boldsymbol{p}_{v}} {\partial \rho } \right )_{\boldsymbol{V }} =\boldsymbol{ V }& &{}\end{array}$$
(9.16)

For the particular case of an ideal gas, the internal energy per unit volume and thermodynamic potentials result:

$$\displaystyle{ u_{v} =\rho \, c_{v}\,\theta }$$
(9.17)
$$\displaystyle{ P =\rho \, c_{v}\,\left (\gamma -1\right )\theta }$$
(9.18)
$$\displaystyle{ \psi = \left (\gamma \,c_{v} -\frac{s_{v}} {\rho } \right )\theta }$$
(9.19)
$$\displaystyle{ \theta =\theta _{R}\,\left ( \frac{\rho } {\rho _{R}}\right )^{\gamma -1}\exp \left (\frac{s_{v}} {\rho \,c_{v}}\right ) }$$
(9.20)

where γ is the heat capacity ratio and ρ R and θ R are respectively a reference density and temperature for which the entropy per unit volume is zero.

2.1.3 Conservation Equations

The mass, linear momentum, and thermal energy conservation equations for a single-phase, single-component fluid are [44]:

$$\displaystyle{ \frac{\partial \rho } {\partial t} + \nabla \cdot \left (\rho \,\boldsymbol{V }\right ) = 0 }$$
(9.21)
$$\displaystyle{ \rho \,\frac{\partial \boldsymbol{V }} {\partial t} = -\rho \,\nabla \kappa +\rho \,\boldsymbol{ V } \times \left (\nabla \times \boldsymbol{ V }\right ) -\nabla P +\rho \,\boldsymbol{ G} + \nabla \cdot \underline{\underline{\tau }} }$$
(9.22)
$$\displaystyle{ \frac{\partial u_{v}} {\partial t} = -\nabla \cdot \left (u_{v}\,\boldsymbol{V }\right ) -\nabla \cdot \boldsymbol{ q} - P\,\nabla \cdot \boldsymbol{ V } + \nabla \boldsymbol{V }:\underline{\underline{\tau }} +\rho \,\varPhi }$$
(9.23)

where t is the time, \(\boldsymbol{G}\) is the force per unit mass, τ is the viscous stress tensor, \(\boldsymbol{q}\) is the heat flux, and Φ is the heat source per unit mass. If the reference coordinate system used to describe the flow is not inertial, the force per unit mass must include the non-inertial forces. Notice that all physical effects (compressibility, heat transfer, viscous dissipation) are included in the analysis.

2.1.4 Balance Equations

The conservation equations have different units and are normally the starting equations to be discretized in the numerical methods. The balance equations, which can be derived starting from the conservation equations and the constitutive relations, are power equations (per unit volume) corresponding to each one of the terms that contributes to the time derivative of the total energy per unit volume, namely Eq. (9.7). Multiplying Eq. (9.21) by ψ +κ it results:

$$\displaystyle{ \left (\psi +\kappa \right ) \frac{\partial \rho } {\partial t} = -\nabla \cdot \left [\rho \left (\psi +\kappa \right )\boldsymbol{V }\right ] +\rho \,\boldsymbol{ V } \cdot \nabla \psi +\rho \,\boldsymbol{ V } \cdot \nabla \kappa }$$
(9.24)

Making the dot product of Eq. (9.22) and the velocity and taking into account the following identities:

$$\displaystyle\begin{array}{rcl} \left [\boldsymbol{V } \times \left (\nabla \times \boldsymbol{ V }\right )\right ] \cdot \boldsymbol{ V } = 0& &{}\end{array}$$
(9.25)
$$\displaystyle\begin{array}{rcl} \left (\nabla \cdot \underline{\underline{\tau }}\right ) \cdot \boldsymbol{ V } = \nabla \cdot \left (\underline{\underline{\tau }}\cdot \boldsymbol{V }\right ) -\nabla \boldsymbol{V }:\underline{\underline{\tau }} & &{}\end{array}$$
(9.26)

it can be obtained:

$$\displaystyle{ \boldsymbol{p}_{v} \cdot \,\frac{\partial \boldsymbol{V }} {\partial t} = \nabla \cdot \left (\,\underline{\underline{\tau }}\cdot \boldsymbol{V }\right ) +\rho \,\boldsymbol{ G} \cdot \boldsymbol{ V } -\boldsymbol{ V } \cdot \nabla P -\nabla \boldsymbol{V }:\underline{\underline{\tau }} -\rho \,\boldsymbol{V } \cdot \nabla \kappa }$$
(9.27)

Finally, from Eqs. (9.5), (9.6), (9.21), and (9.23) it results:

$$\displaystyle{ \theta \,\frac{\partial s_{v}} {\partial t} = -\nabla \cdot \boldsymbol{ q} -\nabla \cdot \left (\theta \,s_{v}\,\boldsymbol{V }\right ) +\rho \,\varPhi -\rho \,\boldsymbol{V } \cdot \nabla \psi +\boldsymbol{ V } \cdot \nabla P + \nabla \boldsymbol{V }:\underline{\underline{\tau }} }$$
(9.28)

As stated before, one of the key issues in modeling fluid dynamic systems with viscous, compressible, and thermal effects is the right understanding of the transformation of mechanical to thermal energy, and the generation of irreversibility. The balance equations show one of the advantages of this methodology, that is, the representation of the power structure of the system. In the balance equations there can be identified three type of terms: divergence, source, and coupling terms. The divergence terms take into account the power introduced in the system through the boundary conditions. The source terms constitute the different power sources, external to the system. Finally, the coupling terms represent power transfer between the velocity, mass, and entropy balance equations; these coupling terms appear, with opposite signs, in pairs of balance equations.

The power transfer between the velocity and entropy balance equations is represented by the irreversible term \(\nabla \boldsymbol{V }:\underline{\underline{\tau }}\geq 0\) (also known as viscous dissipation function) and the reversible term \(\boldsymbol{V } \cdot \nabla \ P\). The power transfer between the velocity and mass balance equations is represented by the term \(\rho \,\boldsymbol{V } \cdot \nabla \kappa\), while the power transfer between the mass and entropy balance equations is represented by the term \(\rho \,\boldsymbol{V } \cdot \nabla \psi\).

Taking into account Eq. (9.7), it can be verified that coupling terms cancel out when the balance equations are added, resulting the conservation of total energy:

$$\displaystyle{ \frac{\partial e_{v}} {\partial t} + \nabla \cdot \left (e_{v}\,\boldsymbol{V }\right ) = \nabla \cdot \left [\left (-P\,\underline{\underline{I}}+\underline{\underline{\tau }}\right ) \cdot \boldsymbol{ V }\right ] -\nabla \cdot \boldsymbol{ q} +\rho \,\boldsymbol{ G} \cdot \boldsymbol{ V }+\rho \,\varPhi }$$
(9.29)

The cancelation of the coupling terms means that they influence the power distribution among the different energy domains but not the total power in the system.

The pressure and Gibbs free energy gradients can be written as a function of the independent variables as:

$$\displaystyle\begin{array}{rcl} \nabla P& =& \left ( \frac{\partial P} {\partial s_{v}}\right )_{\rho }\nabla s_{v} + \left (\frac{\partial P} {\partial \rho } \right )_{s_{v}}\nabla \rho \\ & =& \frac{\theta } {\rho \,c_{v}}\,\frac{\alpha } {\kappa _{\theta }}\left [\nabla s_{v} + \left (\frac{c_{v}} {\alpha \,\theta } + \frac{\alpha } {\rho \,\kappa _{\theta }} -\frac{s_{v}} {\rho } \right )\nabla \rho \right ]{}\end{array}$$
(9.30)
$$\displaystyle\begin{array}{rcl} \nabla \psi & =& \left ( \frac{\partial \psi } {\partial s_{v}}\right )_{\rho }\nabla s_{v} + \left (\frac{\partial \psi } {\partial \rho }\right )_{s_{v}}\nabla \rho \\ & =& \frac{\theta } {\rho \,c_{v}}\left (\frac{\alpha } {\rho \,\kappa _{\theta }} -\frac{s_{v}} {\rho } \right )\nabla s_{v} + \left [\frac{1} {\rho ^{2}\,\kappa _{\theta }} + \frac{\theta } {\rho \,c_{v}}\left (\frac{\alpha } {\rho \,\kappa _{\theta }} -\frac{s_{v}} {\rho } \right )^{2}\right ]\nabla \rho {}\end{array}$$
(9.31)

For the rest of the unknown variables in the balance equations, a definition of additional fluid constitutive relations is needed. If the fluid obeys Fourier’s law, the heat flux can be calculated as:

$$\displaystyle\begin{array}{rcl} \boldsymbol{q}& =& -\lambda \,\nabla \theta = -\lambda \left [\left ( \frac{\partial \theta } {\partial s_{v}}\right )_{\rho }\nabla s_{v} + \left (\frac{\partial \theta } {\partial \rho }\right )_{s_{v}}\nabla \rho \right ] \\ & =& - \frac{\lambda \,\theta } {\rho \,c_{v}}\left [\nabla s_{v} + \left (\frac{\alpha } {\rho \,\kappa _{\theta }} -\frac{s_{v}} {\rho } \right )\nabla \rho \right ] {}\end{array}$$
(9.32)

where λ is the thermal conductivity.

Finally, the viscous stress tensor τ can be expressed for a newtonian fluid, considering Stoke’s hypothesis, as:

$$\displaystyle{ \underline{\underline{\tau }}=\mu \left (\nabla \boldsymbol{V } + \nabla \boldsymbol{V }^{T}\right ) -\frac{2} {3}\,\mu \left (\nabla \cdot \boldsymbol{ V }\right )\,\underline{\underline{I}} }$$
(9.33)

where μ is the fluid viscosity and \(\nabla \boldsymbol{V }\) and I are respectively the velocity gradient tensor and the identity tensor.

2.2 Discrete Formulation

2.2.1 Description of the Flow Fields

In order to formulate the discrete model of the fluid continuum in the domain Ω, as shown in Fig. 9.1, it is necessary to specify the description of the flow fields corresponding to the independent variables. As it is done in the FEM [47], this description is made in terms of a finite set of nodal values and interpolation functions:

$$\displaystyle{ \rho \left (\boldsymbol{r},\,t\right ) =\sum _{ k=1}^{n_{\rho }}\rho _{ k}\left (t\right )\,\varphi _{\rho \,k}\left (\boldsymbol{r}\right ) =\underline{\rho } ^{T} \cdot \underline{\varphi _{\rho }} }$$
(9.34)
$$\displaystyle{ \boldsymbol{V }\left (\boldsymbol{r},\,t\right ) =\sum _{ m=1}^{n_{V } }\boldsymbol{V }_{m}\left (t\right )\,\varphi _{V \,m}\left (\boldsymbol{r}\right ) =\underline{\boldsymbol{ V }}^{T} \cdot \underline{\varphi _{ V }} }$$
(9.35)
$$\displaystyle{ s_{v}\left (\boldsymbol{r},\,t\right ) =\sum _{ l=1}^{n_{S} }s_{v\,l}\left (t\right )\,\varphi _{S\,l}\left (\boldsymbol{r}\right ) =\underline{ s_{v}}^{T} \cdot \underline{\varphi _{ S}} }$$
(9.36)

where ρ (size n ρ ), \(\underline{\boldsymbol{V }}\) (size n V ) and s v (size n S ) are time-dependent nodal vectors, while φ ρ , φ V and φ S are the corresponding position-dependent nodal interpolation or shape functions. The interpolation functions have the following properties:

$$\displaystyle{ \sum _{k=1}^{n_{\rho }}\,\varphi _{ \rho \,k}\left (\boldsymbol{r}\right ) = 1\forall \,\boldsymbol{r} \in \varOmega }$$
(9.37)
$$\displaystyle{ \sum _{m=1}^{n_{V } }\varphi _{V \,m}\left (\boldsymbol{r}\right ) = 1\forall \,\boldsymbol{r} \in \varOmega }$$
(9.38)
$$\displaystyle{ \sum _{l=1}^{n_{S} }\varphi _{S\,l}\left (\boldsymbol{r}\right ) = 1\forall \,\boldsymbol{r} \in \varOmega }$$
(9.39)
Fig. 9.1
figure 1

Domain Ω with boundary Γ and unit outer normal \(\boldsymbol{\check{n}}\)

For simplicity in the treatment of the boundary conditions, it is also required for the interpolation functions to be equal to one at the reference node, and to be equal to zero at the rest of the nodes, that is:

$$\displaystyle{ \varphi _{\rho \,k}\left (\boldsymbol{r}_{n}\right ) =\delta _{k\,n}\mbox{, for a density node located at position }\boldsymbol{r}_{n} }$$
(9.40)
$$\displaystyle{ \varphi _{V \,m}\left (\boldsymbol{r}_{n}\right ) =\delta _{m\,n}\mbox{, for a velocity node located at position }\boldsymbol{r}_{n} }$$
(9.41)
$$\displaystyle{ \varphi _{S\,l}\left (\boldsymbol{r}_{n}\right ) =\delta _{l\,n}\mbox{, for an entropy node located at position }\boldsymbol{r}_{n} }$$
(9.42)

In Eqs. (9.40)–(9.42), δ kn is the Kronecker’s delta (δ kn  = 1 if k = n, δ kn  = 0 otherwise).

The representation of the flow fields in terms of nodal values and interpolation functions allows to define the corresponding values at any position within Ω, so it is possible to calculate univocally all the integrals corresponding to the state equations; this is not evident for other methodologies like FDM or FVM, where only nodal values are defined and additional considerations must be made in order to integrate the differential equations. Besides, the chosen representation can make use of the considerable amount of computational tools already available for the popular FEM.

2.2.2 Integrated Variables

Nodal vectors of integrated values are defined, related to the discretized ones as:

$$\displaystyle{ \underline{m} =\underline{\underline{\varOmega _{\rho }}}\cdot \underline{\rho } }$$
(9.43)
$$\displaystyle{ \underline{S} =\underline{\underline{\varOmega _{S}}} \cdot \underline{ s_{v}} }$$
(9.44)

The diagonal volume matrices Ω ρ and Ω S , respectively associated with the density and entropy per unit volume, are defined as:

$$\displaystyle{ \left \{\varOmega _{\rho }\right \}_{k\,n} =\varOmega _{\rho \,k}\,\delta _{k\,n} }$$
(9.45)
$$\displaystyle{ \left \{\varOmega _{S}\right \}_{l\,n} =\varOmega _{S\,l}\,\delta _{l\,n} }$$
(9.46)

where:

$$\displaystyle{ \varOmega _{\rho \,k} =\int _{\varOmega }\varphi _{\rho \,k}\,d\varOmega }$$
(9.47)
$$\displaystyle{ \varOmega _{S\,l} =\int _{\varOmega }\varphi _{S\,l}\,d\varOmega }$$
(9.48)

The system mass m and entropy S are related to the integrated variables as follows:

$$\displaystyle{ m =\int _{\varOmega }\rho \,d\varOmega =\sum _{ k=1}^{n_{\rho }}m_{ k} }$$
(9.49)
$$\displaystyle{ S =\int _{\varOmega }s_{v}\,d\varOmega =\sum _{ l=1}^{n_{S} }S_{l} }$$
(9.50)

2.2.3 System Total Energy

The system total energy E is defined as the sum of the system internal energy U and the system kinetic coenergy T :

$$\displaystyle{ E = U\left (\underline{m},\,\underline{S}\right ) + T^{{\ast}}\left (\underline{m},\,\underline{\boldsymbol{V }}\right ) }$$
(9.51)

where:

$$\displaystyle{ E =\int _{\varOmega }e_{v}\,d\varOmega }$$
(9.52)
$$\displaystyle{ U =\int _{\varOmega }u_{v}\,d\varOmega }$$
(9.53)
$$\displaystyle{ T^{{\ast}} =\int _{\varOmega }t_{ v}^{{\ast}}\,d\varOmega }$$
(9.54)

From Eqs. (9.35) and (9.54), it can be easily shown that the system kinetic coenergy can be expressed as the following bilinear form:

$$\displaystyle{ T^{{\ast}} = \frac{1} {2}\,\underline{\boldsymbol{V }}^{T} \cdot \underline{\underline{ M}} \cdot \underline{\boldsymbol{ V }} }$$
(9.55)

where M is the system inertia matrix (size n V , symmetric and regular):

$$\displaystyle{ \left \{M\right \}_{m\,n} =\int _{\varOmega }\rho \,\varphi _{V \,m}\,\varphi _{V \,n}\,d\varOmega }$$
(9.56)

The following potentials are defined:

$$\displaystyle\begin{array}{rcl} \underline{\boldsymbol{p}}\left (\underline{m},\,\underline{\boldsymbol{V }}\right )& =& \left (\frac{\partial T^{{\ast}}} {\partial \underline{\boldsymbol{V }}} \right )_{\underline{m}} =\underline{\underline{ M}} \cdot \underline{\boldsymbol{ V }} =\int _{\varOmega }\boldsymbol{p}_{v}\,\underline{\varphi _{V }}\,d\varOmega {}\end{array}$$
(9.57)
$$\displaystyle\begin{array}{rcl} \underline{K}\left (\underline{\boldsymbol{V }}\right )& =& \left (\frac{\partial T^{{\ast}}} {\partial \underline{m}} \right )_{\underline{\boldsymbol{V }}} =\underline{\underline{\varOmega _{\rho }}}^{-1} \cdot \left (\int _{\varOmega }\kappa \,\underline{\varphi _{\rho }}\,d\varOmega \right ){}\end{array}$$
(9.58)
$$\displaystyle\begin{array}{rcl} \underline{\varTheta }\left (\underline{m},\,\underline{S}\right )& =& \left (\frac{\partial U} {\partial \underline{S}}\right )_{\underline{m}} =\underline{\underline{\varOmega _{S}}}^{-1} \cdot \left (\int _{\varOmega }\theta \,\underline{\varphi _{ S}}\,d\varOmega \right ){}\end{array}$$
(9.59)
$$\displaystyle\begin{array}{rcl} \underline{\varPsi }\left (\underline{m},\,\underline{S}\right )& =& \left (\frac{\partial U} {\partial \underline{m}}\right )_{\underline{S}} =\underline{\underline{\varOmega _{\rho }}}^{-1} \cdot \left (\int _{\varOmega }\psi \,\underline{\varphi _{\rho }}\,d\varOmega \right ){}\end{array}$$
(9.60)

where \(\underline{\boldsymbol{p}}\), K, Θ and Ψ are respectively nodal vectors of linear momentum, kinetic coenergy per unit mass, temperature, and Gibbs free energy per unit mass.

It is important to notice that Eq. (9.57) defines, in the BG terminology, a multibond modulated transformer MTF relating the nodal vectors of velocity and linear momentum, as shown in Fig. 9.2. According to the power conservation across the MTF, the generalized effort \(\underline{\boldsymbol{F}}\) is given by:

$$\displaystyle{ \underline{\boldsymbol{F}} =\underline{\underline{ M}} \cdot \underline{\boldsymbol{\dot{ V }}} }$$
(9.61)
Fig. 9.2
figure 2

Modulated transformer connected to the inertial IC-port

Regarding the convention used in multibonds it can be observed that, in Fig. 9.2, the generalized efforts and flows are nodal vectors whose elements are vector variables. For a three-dimensional problem, it means that these type of multibonds are equivalent to 3 n single bonds, being n the size of the nodal vectors involved (in this case, n V ), as shown in Fig. 9.3.

Fig. 9.3
figure 3

Multibond with nodal vector of vector variables for a three-dimensional problem (a ), equivalent to n multibonds of vector variables (b ), each one of these equivalent to three single bonds (c )

According to Eq. (9.57), the nodal vector of linear momentum can be regarded as a system volume integral of the local values weighted by the velocity interpolation function. It can be easily shown that the system linear momentum \(\boldsymbol{p}\) can be obtained as:

$$\displaystyle{ \boldsymbol{p} =\int _{\varOmega }\boldsymbol{p}_{v}\,d\varOmega =\sum _{ m=1}^{n_{V } }\boldsymbol{p}_{m} }$$
(9.62)

According to Eqs. (9.58)–(9.60), the nodal vectors K, Θ and Ψ can be regarded as system volume averages of the corresponding local values, weighted by the interpolation functions. Therefore, it is important to realize that the values of the nodal vectors may be different from the corresponding values calculated with the local variables at the nodal positions.

The time derivative of the system total energy can be written as:

$$\displaystyle{ \dot{E} = \left (\underline{\varPsi }+\underline{K}\right )^{T} \cdot \underline{\dot{ m}} +\underline{\boldsymbol{ p}}^{T} \cdot \underline{\boldsymbol{\dot{ V }}} +\underline{\varTheta } ^{T} \cdot \underline{\dot{ S}} }$$
(9.63)

It can also be shown that the volume integrals of the left side terms of Eqs. (9.24), (9.27), and (9.28) can be calculated as:

$$\displaystyle{ \int _{\varOmega }\left (\kappa +\psi \right ) \frac{\partial \rho } {\partial t}\,d\varOmega = \left (\underline{K}+\underline{\varPsi }\right )^{T} \cdot \underline{\dot{ m}} }$$
(9.64)
$$\displaystyle{ \int _{\varOmega }\boldsymbol{p}_{v} \cdot \frac{\partial \boldsymbol{V }} {\partial t} \,d\varOmega =\underline{\boldsymbol{ p}}^{T} \cdot \underline{\boldsymbol{\dot{ V }}} }$$
(9.65)
$$\displaystyle{ \int _{\varOmega }\theta \,\frac{\partial s_{v}} {\partial t} \,d\varOmega =\underline{\varTheta } ^{T} \cdot \underline{\dot{ S}} }$$
(9.66)

2.2.4 System Constitutive and Maxwell Relations

The system constitutive relations are:

$$\displaystyle{ \underline{\varPsi }+\underline{K} =\underline{\varPsi } \left (\underline{m},\,\underline{S}\right ) +\underline{ K}\left (\underline{\boldsymbol{V }}\right ) }$$
(9.67)
$$\displaystyle{ \underline{\boldsymbol{p}} =\underline{\boldsymbol{ p}}\left (\underline{m},\,\underline{\boldsymbol{V }}\right ) =\underline{\underline{ M}} \cdot \underline{\boldsymbol{ V }} }$$
(9.68)
$$\displaystyle{ \underline{\varTheta }=\underline{\varTheta } \left (\underline{m},\,\underline{S}\right ) }$$
(9.69)

The Maxwell relations corresponding to the system total energy arise from the equality of the mixed partial derivatives of the system total energy expressed as a function of the independent variables m, \(\underline{\boldsymbol{V }}\), and S, regarded as the state variables for the BG formalism:

$$\displaystyle{ \left ( \frac{\partial \underline{\varTheta }} {\partial \underline{m}}\right )_{\underline{S}} = \left [ \frac{\partial } {\partial \underline{S}}\left (\underline{\varPsi }+\underline{K}\right )\right ]_{\underline{m}}^{T} = \left ( \frac{\partial \underline{\varPsi }} {\partial \underline{S}}\right )_{\underline{m}}^{T} =\underline{\underline{\varOmega _{ S}}}^{-1} \cdot \underline{\underline{ M_{ S\,\rho }}} \cdot \underline{\underline{\varOmega _{\rho }}}^{-1} }$$
(9.70)
$$\displaystyle{ \left ( \frac{\partial \underline{\varTheta }} {\partial \underline{\boldsymbol{V }}}\right )_{\underline{S}} = \left ( \frac{\partial \underline{\boldsymbol{p}}} {\partial \underline{S}}\right )_{\underline{\boldsymbol{V }}}^{T} =\underline{\underline{ \mathbf{0}}} }$$
(9.71)
$$\displaystyle{ \left ( \frac{\partial \underline{\boldsymbol{p}}} {\partial \underline{m}}\right )_{\underline{\boldsymbol{V }}} = \left [ \frac{\partial } {\partial \underline{\boldsymbol{V }}}\left (\underline{\psi }+\underline{K}\right )\right ]_{\underline{m}}^{T} = \left (\frac{\partial \underline{K}} {\partial \underline{\boldsymbol{V }}}\right )_{\underline{m}}^{T} =\underline{\underline{\boldsymbol{ M}_{ V \,\rho }}} \cdot \underline{\underline{\varOmega _{\rho }}}^{-1} }$$
(9.72)

where the matrices M Sρ (n S rows and n ρ columns) and \(\underline{\underline{\boldsymbol{M}_{V \,\rho }}}\) (n V rows and n ρ columns) result:

$$\displaystyle{ \left \{M_{S\,\rho }\right \}_{l\,k} =\int _{\varOmega } \frac{\theta } {\rho \,c_{v}}\left (\frac{\alpha } {\rho \,\kappa _{\theta }} -\frac{s_{v}} {\rho } \right )\varphi _{S\,l}\,\varphi _{\rho \,k}\,d\varOmega }$$
(9.73)
$$\displaystyle{ \left \{\boldsymbol{M}_{V \,\rho }\right \}_{m\,k} =\int _{\varOmega }\boldsymbol{V }\,\varphi _{V \,m}\,\varphi _{\rho \,k}\,d\varOmega }$$
(9.74)

The constitutive relations (9.67)–(9.69) and the Maxwell relations (9.70)–(9.72) define a multibond IC-field associated with the system total energy, as shown in Fig. 9.4. This field has an inertial port (the velocity port) and two capacitive ports (the entropy and the mass ports). The generalized effort variables associated with these ports are respectively \(\underline{\boldsymbol{\dot{V }}}\), Θ and \(\left (\underline{\varPsi }+\underline{K}\right )\), while the generalized flow variables are respectively \(\underline{\boldsymbol{p}}\), \(\underline{\dot{S}}\) and \(\underline{\dot{m}}\).

Fig. 9.4
figure 4

System IC-field representing energy storage

In Fig. 9.4, the generalized efforts and flows of the multibonds connected to the capacitive ports are nodal vectors whose elements are scalar variables; these type of multibonds are equivalent to n (in this case, n ρ or n S ) single bonds, as shown in Fig. 9.5.

Fig. 9.5
figure 5

Multibond with nodal vector of scalar variables (a ), equivalent to n single bonds (b )

2.3 State Equations

2.3.1 Mass Port

Nodal density weight functions \(w_{\rho \,k}\left (\boldsymbol{r},\,t\right )\) are introduced, with the following properties:

$$\displaystyle{ \sum _{k=1}^{n_{\rho }}w_{\rho \, k}\left (\boldsymbol{r},\,t\right ) = 1\forall \,\boldsymbol{r}\ \in \ \varOmega,\,\forall \,t }$$
(9.75)
$$\displaystyle{ w_{\rho \,k}\left (\boldsymbol{r}_{n},\,t\right ) =\delta _{k\,n}\mbox{, for a density node located at position }\boldsymbol{r}_{n} }$$
(9.76)

The nodal density weight functions are introduced to satisfy the power interchanged by the system through the boundary conditions, as well as to share the importance of different power terms among neighboring nodes. These functions can be used to introduce numerical schemes, for instance controlled upwind, in compressible CFD problems.

As it is done in the Petrov–Galerkin method [47], each term of the mass balance equation (9.24) is multiplied by the test function w ρk ; then, the resulting terms are integrated over the domain Ω and Green’s theorem is applied whenever necessary, obtaining:

$$\displaystyle{ \underline{\dot{m}} =\underline{\dot{ m}_{W}^{(\varGamma )}} +\underline{\dot{ m}_{ W}} +\underline{\dot{ m}_{U}} +\underline{\dot{ m}_{K}} }$$
(9.77)

where the different nodal vectors of mass rates are:

$$\displaystyle{ \underline{\dot{m}_{W}^{\left (\varGamma \right )}} = -\left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \left [\int _{\varGamma }\underline{w_{\rho }}\,\rho \left (\psi +\kappa \right )\boldsymbol{V } \cdot \boldsymbol{\check{ n}}\,d\varGamma \right ] }$$
(9.78)
$$\displaystyle{ \underline{\dot{m}_{W}} = \left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \left [\int _{\varOmega }\rho \left (\psi +\kappa \right )\boldsymbol{V } \cdot \underline{\nabla w_{\rho }}\,d\varOmega \right ] }$$
(9.79)
$$\displaystyle{ \underline{\dot{m}_{U}} = \left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \left (\int _{\varOmega }\underline{w_{\rho }}\,\rho \,\boldsymbol{V } \cdot \nabla \psi \,d\varOmega \right ) }$$
(9.80)
$$\displaystyle{ \underline{\dot{m}_{K}} = \left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \left (\int _{\varOmega }\underline{w_{\rho }}\,\rho \,\boldsymbol{V } \cdot \nabla \kappa \,d\varOmega \right ) }$$
(9.81)

The square matrices Ψ and K (size n ρ ) are defined as:

$$\displaystyle{ \left \{\varPsi \right \}_{k\,j} = \frac{1} {\varOmega _{\rho \,j}}\int _{\varOmega }\psi \,w_{\rho \,k}\,\varphi _{\rho \,j}\,d\varOmega }$$
(9.82)
$$\displaystyle{ \left \{K\right \}_{k\,j} = \frac{1} {\varOmega _{\rho \,j}}\int _{\varOmega }\kappa \,w_{\rho \,k}\,\varphi _{\rho \,j}\,d\varOmega }$$
(9.83)

The nodal vectors Ψ and K are the sum of the corresponding matrix columns:

$$\displaystyle{ \varPsi _{j} =\sum _{ k=1}^{n_{\rho }}\left \{\varPsi \right \}_{ k\,j} }$$
(9.84)
$$\displaystyle{ K_{j} =\sum _{ k=1}^{n_{\rho }}\left \{K\right \}_{ k\,j} }$$
(9.85)

Taking into account Eqs. (9.84) and (9.85) it can be verified that the product \(\left (\underline{\varPsi }+\underline{K}\right )^{T} \cdot \underline{\dot{ m}_{X}}\), where \(\underline{\dot{m}_{X}}\) is any nodal vector of mass rate, recovers the corresponding power term integrated in the system. So, the product \(\left (\underline{\varPsi }+\underline{K}\right )^{T} \cdot \underline{\dot{ m}_{W}^{(\varGamma )}}\) recovers the power due to the flux of Gibbs free energy plus kinetic coenergy through the system boundary Γ, while \(\left (\underline{\varPsi }+\underline{K}\right )^{T} \cdot \underline{\dot{ m}_{W}}\) is a power term that vanishes, because of Eq. (9.75). Notice that \(\dot{m}_{W\,k}^{(\varGamma )}\) may be nonzero only for the nodes located at the system boundary. Making the product of Ψ +K times Eq. (9.77), it can be easily shown that the integral mass balance equation is satisfied, that is:

$$\displaystyle{ \int _{\varOmega }\left (\psi +\kappa \right ) \frac{\partial \rho } {\partial t}\,d\varOmega = -\int _{\varGamma }\rho \left (\psi +\kappa \right )\boldsymbol{V } \cdot \boldsymbol{\check{ n}}\,d\varGamma +\int _{\varOmega }\rho \,\boldsymbol{V } \cdot \nabla \psi \,d\varOmega +\int _{\varOmega }\rho \,\boldsymbol{V } \cdot \nabla \kappa \,d\varOmega }$$
(9.86)

2.3.2 Velocity Port

As it is done in the Galerkin method [47], the momentum conservation equation is multiplied by the test function φ Vm and integrated over the domain Ω. Applying Green’s theorem whenever necessary, it can be obtained:

$$\displaystyle{ \underline{\boldsymbol{\dot{V }}} =\underline{\underline{ M}}^{-1} \cdot \left (\underline{\boldsymbol{F}_{ V }^{\left (\varGamma \right )}} +\underline{\boldsymbol{ F}_{ G}} +\underline{\boldsymbol{ F}_{R}} -\underline{\boldsymbol{ F}_{P}} -\underline{\boldsymbol{ F}_{V }} -\underline{\boldsymbol{ F}_{K}}\right ) }$$
(9.87)

where the different nodal vectors of forces are:

$$\displaystyle{ \underline{\boldsymbol{F}_{V }^{\left (\varGamma \right )}} =\int _{\varGamma }\left (\underline{\underline{\tau }}\cdot \boldsymbol{\check{n}}\right )\underline{\varphi _{ V }}\,d\varGamma }$$
(9.88)
$$\displaystyle{ \underline{\boldsymbol{F}_{G}} =\int _{\varOmega }\rho \,\boldsymbol{G}\,\underline{\varphi _{V }}\,d\varOmega }$$
(9.89)
$$\displaystyle{ \underline{\boldsymbol{F}_{R}} =\int _{\varOmega }\rho \,\boldsymbol{V } \times \left (\nabla \times \boldsymbol{ V }\right )\underline{\varphi _{V }}\,d\varOmega }$$
(9.90)
$$\displaystyle{ \underline{\boldsymbol{F}_{P}} =\int _{\varOmega }\nabla P\,\underline{\varphi _{V }}\,d\varOmega }$$
(9.91)
$$\displaystyle{ \underline{\boldsymbol{F}_{V }} =\int _{\varOmega }\underline{\underline{\tau }} \cdot \underline{\nabla \varphi _{V }}\,d\varOmega }$$
(9.92)
$$\displaystyle{ \underline{\boldsymbol{F}_{K}} =\int _{\varOmega }\rho \,\nabla \kappa \,\underline{\varphi _{V }}\,d\varOmega }$$
(9.93)

Adding the nodal components of Eq. (9.87) it can be easily shown that the integral momentum equation is satisfied, that is:

$$\displaystyle{ \int _{\varOmega }\rho \,\frac{D\boldsymbol{V }} {Dt} \,d\varOmega =\int _{\varGamma }\left (-P\,\underline{\underline{I}}+\underline{\underline{\tau }}\right ) \cdot \boldsymbol{\check{ n}}\,d\varGamma +\int _{\varOmega }\rho \,\boldsymbol{G}\,d\varOmega }$$
(9.94)

The reason why the Galerkin method was chosen is that the dot product \(\underline{\boldsymbol{F}_{X}}^{T} \cdot \underline{\boldsymbol{ V }}\), where \(\underline{\boldsymbol{F}_{X}}\) is any nodal vector of force, recovers the corresponding power term integrated in the system. It can be observed that the dot product \(\underline{\boldsymbol{F}_{V }^{(\varGamma )}}^{T} \cdot \underline{\boldsymbol{ V }}\) recovers the power due to the flux of the viscous stress through the system boundary, while the dot product \(\underline{\boldsymbol{F}_{V }}^{T} \cdot \underline{\boldsymbol{ V }}\) recovers the power dissipation. Notice that \(\boldsymbol{F}_{V \,m}^{\left (\varGamma \right )}\) may be nonzero only for the nodes located at the system boundary.

Making the dot product of Eq. (9.87) and \(\underline{\boldsymbol{V }}\) and taking into account Eq. (9.25), it can be easily shown that the integral velocity balance equation is satisfied, that is:

$$\displaystyle\begin{array}{rcl} \int _{\varOmega }\boldsymbol{p}_{v} \cdot \frac{\partial \boldsymbol{V }} {\partial t} \,d\varOmega & =& \int _{\varGamma }\left (\underline{\underline{\tau }}\cdot \boldsymbol{V }\right ) \cdot \boldsymbol{\check{ n}}\,d\varGamma +\int _{\varOmega }\rho \,\boldsymbol{G} \cdot \boldsymbol{ V }\,d\varOmega -\int _{\varOmega }\boldsymbol{V } \cdot \nabla P\,d\varOmega \\ & & -\int _{\varOmega }\left (\nabla \boldsymbol{V }:\underline{\underline{\tau }}\right )\,d\varOmega -\int _{\varOmega }\rho \,\boldsymbol{V } \cdot \nabla \kappa \,d\varOmega {}\end{array}$$
(9.95)

2.3.3 Entropy Port

Nodal entropy weight functions \(w_{S\,l}\left (\boldsymbol{r},\,t\right )\) are also introduced, with the following properties:

$$\displaystyle{ \sum _{l=1}^{n_{S} }w_{S\,l}\left (\boldsymbol{r},\,t\right ) = 1\forall \,\boldsymbol{r}\, \in \,\varOmega,\,\forall \,t }$$
(9.96)
$$\displaystyle{ w_{S\,l}\left (\boldsymbol{r}_{n},\,t\right ) =\delta _{l\,n}\mbox{, for an entropy node located at position }\boldsymbol{r}_{n} }$$
(9.97)

The nodal entropy weight functions are also introduced to satisfy the power interchanged by the system through the boundary conditions, as well as to share the importance of different power terms among neighboring nodes. These functions can be used, for instance, to introduce controlled upwind schemes in advection-diffusion problems.

As it is done in the Petrov–Galerkin method [47], each term of the entropy balance equation (9.28) is multiplied by the test function w Sl ; then, the resulting terms are integrated over the domain Ω and Gauss’ theorem is applied whenever necessary, obtaining:

$$\displaystyle{ \underline{\dot{S}} =\underline{\dot{ S}_{Q}^{\left (\varGamma \right )}} +\underline{\dot{ S}_{ C}^{\left (\varGamma \right )}} +\underline{\dot{ S}_{ Q}} +\underline{\dot{ S}_{C}} +\underline{\dot{ S}_{F}} -\underline{\dot{ S}_{U}} +\underline{\dot{ S}_{P}} +\underline{\dot{ S}_{V }} }$$
(9.98)

where the different nodal vectors of entropy rates are:

$$\displaystyle{ \underline{\dot{S}_{Q}^{\left (\varGamma \right )}} = -\underline{\underline{\varTheta }}^{-1} \cdot \left (\int _{\varGamma }\underline{w_{ S}}\,\boldsymbol{q} \cdot \boldsymbol{\check{ n}}\,d\varGamma \right ) }$$
(9.99)
$$\displaystyle{ \underline{\dot{S}_{C}^{\left (\varGamma \right )}} = -\underline{\underline{\varTheta }}^{-1} \cdot \left (\int _{\varGamma }\underline{w_{ S}}\,\theta \,s_{v}\,\boldsymbol{V } \cdot \boldsymbol{\check{ n}}\,d\varGamma \right ) }$$
(9.100)
$$\displaystyle{ \underline{\dot{S}_{Q}} =\underline{\underline{\varTheta }} ^{-1} \cdot \left (\int _{\varOmega }\boldsymbol{q} \cdot \underline{\nabla w_{ S}}\,d\varOmega \right ) }$$
(9.101)
$$\displaystyle{ \underline{\dot{S}_{C}} =\underline{\underline{\varTheta }} ^{-1} \cdot \left (\int _{\varOmega }\theta \,s_{ v}\,\boldsymbol{V } \cdot \underline{\nabla w_{S}}\,d\varOmega \right ) }$$
(9.102)
$$\displaystyle{ \underline{\dot{S}_{F}} =\underline{\underline{\varTheta }} ^{-1} \cdot \left (\int _{\varOmega }\underline{w_{ S}}\,\rho \,\varPhi \,d\varOmega \right ) }$$
(9.103)
$$\displaystyle{ \underline{\dot{S}_{U}} =\underline{\underline{\varTheta }} ^{-1} \cdot \left (\int _{\varOmega }\underline{w_{ S}}\,\rho \,\boldsymbol{V } \cdot \nabla \psi \,d\varOmega \right ) }$$
(9.104)
$$\displaystyle{ \underline{\dot{S}_{P}} =\underline{\underline{\varTheta }} ^{-1} \cdot \left (\int _{\varOmega }\underline{w_{ S}}\,\boldsymbol{V } \cdot \nabla P\,d\varOmega \right ) }$$
(9.105)
$$\displaystyle{ \underline{\dot{S}_{V }} =\underline{\underline{\varTheta }} ^{-1} \cdot \left [\int _{\varOmega }\underline{w_{ S}}\left (\nabla \boldsymbol{V }:\underline{\underline{\tau }}\right )d\varOmega \right ] }$$
(9.106)

In Eqs. (9.99)–(9.106) the temperature matrix Θ results:

$$\displaystyle{ \left \{\varTheta \right \}_{l\,j} = \frac{1} {\varOmega _{S\,j}}\int _{\varOmega }\theta \,w_{S\,l}\,\varphi _{S\,j}\,d\varOmega }$$
(9.107)

The nodal vector of temperature is the sum of the temperature matrix columns:

$$\displaystyle{ \varTheta _{j} =\sum _{ l=1}^{n_{S} }\left \{\varTheta \right \}_{l\,j} }$$
(9.108)

Taking into account Eq. (9.108) it can be verified that the product \(\underline{\varTheta }^{T} \cdot \underline{\dot{ S}_{X}}\), where \(\underline{\dot{S}_{X}}\) is any nodal vector of entropy rate, recovers the corresponding power integrated in the system. Thus, the products \(\underline{\varTheta }^{T} \cdot \underline{\dot{ S}_{Q}^{\left (\varGamma \right )}}\) and \(\underline{\varTheta }^{T} \cdot \underline{\dot{ S}_{C}^{\left (\varGamma \right )}}\) recovers respectively the power due to heat flux and entropy advection, while \(\underline{\varTheta }^{T} \cdot \underline{\dot{ S}_{Q}}\) and \(\underline{\varTheta }^{T} \cdot \underline{\dot{ S}_{C}}\) are power terms that vanish, because of Eq. (9.96). Notice that \(\dot{S}_{Q\,l}^{\left (\varGamma \right )}\) and \(\dot{S}_{C\,l}^{\left (\varGamma \right )}\) may be nonzero only for the nodes located at the system boundary. Making the product of Eq. (9.98) times Θ, it can be easily shown that the integral entropy balance equation is satisfied, that is:

$$\displaystyle\begin{array}{rcl} \int _{\varOmega }\theta \,\frac{\partial s_{v}} {\partial t} \,d\varOmega & =& -\int _{\varGamma }\left (\boldsymbol{q} +\theta \, s_{v}\,\boldsymbol{V }\right ) \cdot \boldsymbol{\check{ n}}\,d\varGamma +\int _{\varOmega }\rho \,\varPhi \,d\varOmega -\int _{\varOmega }\rho \,\boldsymbol{V } \cdot \nabla \psi \,d\varOmega \\ & & +\int _{\varOmega }\boldsymbol{V } \cdot \nabla P\,d\varOmega +\int _{\varOmega }\left (\nabla \boldsymbol{V }:\underline{\underline{\tau }}\right )\,d\varOmega {}\end{array}$$
(9.109)

2.4 Coupling Matrices

Once defined the generalized effort and flow variables, it is necessary to represent the power coupling (appearing in the balance equations per unit volume shown in Sect. 9.2.1.4) to a discretized level. This representation is performed through the coupling matrices, which relate generalized variables whose product gives rise to power terms appearing in pairs of multiports. Depending on the variables being related, it will be seen that these matrices define modulated transformers MTF, a modulated resistance-entropy source field MRS or a modulated gyrator MGY. As the nodal vectors may have different size, the coupling matrices are rectangular, thus setting a restriction in the allowable causalities.

2.4.1 Coupling Between the Velocity and Mass Ports

From Eqs. (9.81) and (9.93):

$$\displaystyle{ \underline{\dot{m}_{K}} = \left [\left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \underline{\underline{\boldsymbol{ M}_{ K}}}\right ] \cdot \underline{\boldsymbol{ V }} }$$
(9.110)
$$\displaystyle{ \underline{\boldsymbol{F}_{K}} = \left [\left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \underline{\underline{\boldsymbol{ M}_{ K}}}\right ]^{T} \cdot \left (\underline{\varPsi }+\underline{K}\right ) }$$
(9.111)

where \(\underline{\underline{\boldsymbol{M}_{K}}}\) is a rectangular matrix (n ρ rows and n V columns) defined as:

$$\displaystyle{ \left \{\boldsymbol{M}_{K}\right \}_{k\,m} =\int _{\varOmega }w_{\rho \,k}\,\varphi _{V \,m}\,\rho \,\nabla \kappa \,d\varOmega }$$
(9.112)

Equations (9.110) and (9.111) define a multibond MTF modulated by the state variables, as shown in Fig. 9.6.

Fig. 9.6
figure 6

Modulated transformer coupling the velocity and mass ports

2.4.2 Coupling Between the Entropy and Mass Ports

From Eqs. (9.80) and (9.104):

$$\displaystyle{ \underline{\dot{m}_{U}} = \left [\left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \underline{\underline{ M_{ U}}} \cdot \left (\underline{\underline{\varTheta }}^{-1}\right )^{T}\right ]\cdot \underline{\varTheta } }$$
(9.113)
$$\displaystyle{ \underline{\dot{S}_{U}} = \left [\left (\underline{\underline{\varPsi }}+\underline{\underline{K}}\right )^{-1} \cdot \underline{\underline{ M_{ U}}} \cdot \left (\underline{\underline{\varTheta }}^{-1}\right )^{T}\right ]^{T} \cdot \left (\underline{\varPsi }+\underline{K}\right ) }$$
(9.114)

where M U is a rectangular matrix (n ρ rows and n S columns) defined as:

$$\displaystyle{ \left \{M_{U}\right \}_{k\,l} =\int _{\varOmega }w_{\rho \,k}\,w_{S\,l}\,\rho \,\boldsymbol{V } \cdot \nabla \psi \,d\varOmega }$$
(9.115)

Equations (9.113) and (9.114) define a multibond MGY modulated by the state variables, as shown in Fig. 9.7.

Fig. 9.7
figure 7

Modulated gyrator coupling the entropy and mass ports

2.4.3 Coupling Between the Velocity and Entropy Ports

From Eqs. (9.91) and (9.105):

$$\displaystyle{ \underline{\boldsymbol{F}_{P}} = \left (\underline{\underline{\varTheta }}^{-1} \cdot \underline{\underline{\boldsymbol{ M}_{ P}}}\right )^{T}\cdot \underline{\varTheta } }$$
(9.116)
$$\displaystyle{ \underline{\dot{S}_{P}} = \left (\underline{\underline{\varTheta }}^{-1} \cdot \underline{\underline{\boldsymbol{ M}_{ P}}}\right ) \cdot \underline{\boldsymbol{ V }} }$$
(9.117)

where \(\underline{\underline{\boldsymbol{M}_{P}}}\) is a rectangular matrices (n V rows and n S columns) defined as:

$$\displaystyle{ \left \{\boldsymbol{M}_{P}\right \}_{m\,l} =\int _{\varOmega }\varphi _{V \,m}\,w_{S\,l}\,\nabla P\,d\varOmega }$$
(9.118)

Equations (9.116) and (9.117) define a multibond MTF modulated by the state variables, as shown in Fig. 9.8.

Fig. 9.8
figure 8

Modulated transformer coupling the velocity and entropy ports

From Eqs. (9.92) and (9.106):

$$\displaystyle{ \underline{\boldsymbol{F}_{V }} = \left (\underline{\underline{\varTheta }}^{-1} \cdot \underline{\underline{\boldsymbol{ M}_{ V }}}\right )^{T}\cdot \underline{\varTheta } }$$
(9.119)
$$\displaystyle{ \underline{\dot{S}_{V }} = \left (\underline{\underline{\varTheta }}^{-1} \cdot \underline{\underline{\boldsymbol{ M}_{ V }}}\right ) \cdot \underline{\boldsymbol{ V }} }$$
(9.120)

where \(\underline{\underline{\boldsymbol{M}_{V }}}\) is a rectangular matrices (n V rows and n S columns) defined as:

$$\displaystyle{ \left \{\boldsymbol{M}_{V }\right \}_{m\,l} =\int _{\varOmega }\left (\underline{\underline{\tau }}\cdot \nabla \varphi _{V \,m}\right )w_{S\,l}\,d\varOmega }$$
(9.121)

Equations (9.119) and (9.120) define a multibond MRS modulated by the state variables, as shown in Fig. 9.9.

Fig. 9.9
figure 9

Modulated resistance-entropy source field coupling the velocity and entropy ports

2.5 System BG

The system BG is shown in Fig. 9.10. Energy storing (kinetic and potential) is represented by an IC-field. A MTF with the inertia matrix M is connected to the inertial port of the IC-field, in order to bring the nodal velocities as generalized flow variables.

Fig. 9.10
figure 10

System BG for a compressible flow

At the 1-junction with common \(\underline{\boldsymbol{V }}\) all the nodal vector forces are added; in this way, the effort balance represents the linear momentum conservation equation for the nodal velocity values. At the 0-junction with common \(\left (\underline{\varPsi }+\underline{K}\right )\) all the nodal mass rates are added; in this way, the flow balance represents the mass conservation equations for the nodal mass values. At the 0-junction with common Θ all the nodal entropy rates are added; in this way, the flow balance represents the entropy conservation equation for the nodal entropy values.

The MTFs, the MRS, and the MGY between the junction elements connect power terms that appear in the balance equations corresponding to pairs of multiports. As seen in Sect. 9.2.4, their coupling matrices are rectangular, setting a restriction in the allowable causalities.

The acausal source elements \(\boldsymbol{S}\) connected to the bonds with \(\underline{\dot{m}_{W}^{\left (\varGamma \right )}}\), \(\underline{\boldsymbol{F}_{T}^{\left (\varGamma \right )}}\), \(\underline{\dot{S}_{Q}^{\left (\varGamma \right )}}\) and \(\underline{\dot{S}_{C}^{\left (\varGamma \right )}}\) represent different source terms; in each single port these sources behave as effort or flow sources, depending on the boundary conditions. The rest of the sources, effort \(\boldsymbol{S}_{e}\) or flow \(\boldsymbol{S}_{f}\) (the ones connected to the bonds with \(\underline{\dot{m}_{W}}\), \(\underline{\boldsymbol{F}_{R}} +\underline{\boldsymbol{ F}_{G}}\) and \(\underline{\dot{S}_{Q}} +\underline{\dot{ S}_{C}} +\underline{\dot{ S}_{F}}\)) represent volumetric power terms; the determination of causality for these sources and for other bonds shown in the graph results from the standard causality extension procedure described in [32].

The net power input (sum over the bonds) corresponding to the multibond with the rotational force \(\underline{\boldsymbol{F}_{R}}\) is zero, because of Eq. (9.25). As seen before, the contributions of \(\underline{\dot{S}_{Q}}\) and \(\underline{\dot{S}_{C}}\) to the net power input are also zero.

2.6 Initial and Boundary Conditions

2.6.1 Initial Conditions

In order to solve the state equations, it is needed to set initial and boundary conditions. The nodal initial values may be readily specified as:

$$\displaystyle{ \underline{m}\left (t = 0\right ) =\underline{ m_{0}} }$$
(9.122)
$$\displaystyle{ \underline{\boldsymbol{V }}\left (t = 0\right ) =\underline{\boldsymbol{ V }_{0}} }$$
(9.123)
$$\displaystyle{ \underline{S}\left (t = 0\right ) =\underline{ S_{0}} }$$
(9.124)

Alternatively, if spatial functions \(\rho _{0}\left (\boldsymbol{r}\right )\), \(\boldsymbol{V }_{0}\left (\boldsymbol{r}\right )\), and \(s_{v\,0}\left (\boldsymbol{r}\right )\) are specified for the initial time respectively for density, velocity, and entropy per unit volume, the nodal values must be determined in order to conserve the initial system mass, linear momentum, and entropy. In this case, it can be easily shown that:

$$\displaystyle{ m_{0\,k} =\int _{\varOmega }\rho _{0}\left (\boldsymbol{r}\right )\varphi _{\rho \,k}\,d\varOmega }$$
(9.125)
$$\displaystyle{ \boldsymbol{V }_{0\,m} = \frac{\int _{\varOmega }\rho _{0}\left (\boldsymbol{r}\right )\boldsymbol{V }_{0}\left (\boldsymbol{r}\right )\varphi _{V \,m}\,d\varOmega } {\int _{\varOmega }\rho _{0}\left (\boldsymbol{r}\right )\varphi _{V \,m}\,d\varOmega } }$$
(9.126)
$$\displaystyle{ S_{0\,l} =\int _{\varOmega }s_{v\,0}\left (\boldsymbol{r}\right )\varphi _{S\,l}\,d\varOmega }$$
(9.127)

2.6.2 Boundary Conditions

The boundary conditions establish relationships among the variables at the boundary Γ. At a discretized level, the boundary conditions can be regarded, in the BG methodology, as the input variables. It is necessary, for the model being mathematically well defined, that the boundary conditions allow to determine the causality for all the bonds in the resulting BG. The boundary conditions are introduced through the bonds corresponding to the superficial source terms \(\underline{\dot{m}_{W}^{\left (\varGamma \right )}}\), \(\underline{\boldsymbol{F}_{T}^{\left (\varGamma \right )}}\), \(\underline{\dot{S}_{Q}^{\left (\varGamma \right )}}\), and \(\underline{\dot{S}_{C}^{\left (\varGamma \right )}}\). All boundary conditions can be described in terms of generalized effort or flow sources.

In a general boundary value problem, boundary conditions can be classified in essential, natural, and mixed.

In an essential boundary condition (often called Dirichlet boundary condition), independent variables are specified at a part of the boundary. Typical examples in CFD can be problems in which the flow conditions (velocity and/or thermophysical properties) are specified at the inlet or outlet of a flow passage section or when normal and tangential components are specified at a wall satisfying the no-normal or no-slip condition. For these cases, a derivative causality will result for some boundary bonds belonging to the IC-field.

Natural boundary conditions (often called Neumann boundary conditions) are those that are automatically satisfied after solution of the problem. These boundary conditions appear when gradients of the independent variables are specified at a part of the boundary. In a CFD problem, natural boundary conditions are associated with imposed components of the viscous stress tensor or heat flux at the boundary. For these cases, integral causality will result for the boundary nodes belonging to the IC-field.

Finally, mixed boundary conditions are those that involve gradients as well as values of the independent variables at a part of the boundary. For these cases, integral causality will also result for the boundary nodes belonging to the IC-field. Newton’s cooling law, relating the normal component of the heat flux to the difference between the boundary and a reference temperature, is a typical example.

2.6.3 Considerations for Pure Advective Flows

If heat conduction effects are neglected in the conservation equation (9.23), the multibonds corresponding to \(\underline{\dot{S}_{Q}^{\left (\varGamma \right )}}\) and \(\underline{\dot{S}_{Q}}\) disappear. This approximation makes the entropy balance equation first order and has consequences in the causality assignment. In particular, for pure advective flows only thermophysical properties at parts of the boundary can be specified. In this case, the entropy boundary conditions are introduced through the bonds corresponding to the superficial source term \(\underline{\dot{S}_{C}^{\left (\varGamma \right )}}\).

2.6.4 Considerations for Inviscid Flows

If the viscous stress tensor is neglected in the conservation equation (9.22), the multibond corresponding to \(\underline{\boldsymbol{F}_{T}^{\left (\varGamma \right )}}\) disappears. This approximation makes the momentum balance equation first order and has consequences in the causality assignment. For instance, only the normal component of the velocity field can be specified at a wall, while the other components are part of the problem solution.

2.6.5 Procedure for Causality Assignment

In [32] a sequential causal assignment procedure is described. Sources are chosen first, the required causality is assigned, and the causal implications are extended through the graph as far as possible, using the constraint elements (in this case 0-junctions, 1-junctions, MTFs, MRS and MGY). Then, the ports corresponding to the storage elements (in this case, the IC-field) are chosen, integral causality is assigned, and, again, the causal implications are extended through the graph as far as possible.

In a grid generated for a CFD problem usually there is a huge amount of nodes. The domain is divided in cells, the volume integrations are performed locally in each cell, and the results are assembled to build the system integrals. For doing this, it is necessary to know what is called the connectivity information, that is, the information needed to completely identify each cell and all of the neighbors of that cell in a computational grid.

As a result of the calculation procedure, the resulting matrices are sparse, that is, have a few nonzero elements. Regarding causality extension through the MTFs, MRS, and MGY elements, the constitutive laws are sets of linear relationships among the variables involved. Thus, causality can be extended for a bond with a variable only when the bonds corresponding to the rest of the variables in the linear relationship have assigned causalities.

It is worth noting that, as the interpolation functions are zero at the boundary Γ for inner nodes, causality is assigned by definition at these bonds. Thus, a zero-effort source is connected to an inner \(\boldsymbol{F}_{V \,m}^{(\varGamma )}\), and respectively zero-flow sources are connected to an inner \(\dot{m}_{W\,k}^{\left (\varGamma \right )}\), \(\dot{S}_{Q\,l}^{\left (\varGamma \right )}\) and \(\dot{S}_{C\,l}^{\left (\varGamma \right )}\).

As there are only energy storing and conserving elements, all bonds should have causality assigned after the procedure detailed above. The order of the system is the number of bonds connected to the energy storing elements, resulting with integral causality. This causality procedure can be implemented automatically, knowing the connectivity of the computational grid, as a way of checking the correctness of the boundary conditions in the problem.

As a consequence of the causality extension, the sources connected to the bonds with \(\underline{\boldsymbol{F}_{G}} +\underline{\boldsymbol{ F}_{R}}\) always behave as effort sources, and the sources connected to the bonds with \(\underline{\dot{S}_{Q}} +\underline{\dot{ S}_{C}} +\underline{\dot{ S}_{F}}\), \(\underline{\dot{S}_{C}^{\left (\varGamma \right )}}\), and \(\underline{\dot{m}_{W}}\) always behave as flow sources. Besides, causality for the bonds connected to the coupling MTFs, MRS, and MGY is also defined. For the MTFs and the MRS, it always results \(\underline{\boldsymbol{V }}\) the input and respectively \(\underline{\dot{m}_{K}}\), \(\underline{\dot{S}_{P}}\) and \(\underline{\dot{S}_{V }}\) outputs. For the MGY, it always results Θ the input and \(\underline{\dot{m}_{U}}\) the output.

The resulting causality for the coupling MTFs and MRS indicate that fluid motion generates the entropy rate (both reversible and irreversible) and mass rates, in agreement with the Second Principle of Thermodynamics. Besides, Θ and Ψ + K always result inputs to the coupling MTFs and MRS, indicating that thermophysical properties influence the corresponding output forces.

3 Incompressible Flows

An interesting type of problems are those in which the fluid is incompressible, that is, density is constant.

When viscosity variations with temperature are small, the traditional incompressible form of the Navier–Stokes (N–S) equation is usually selected for the analysis. A set of equations (continuity, momentum, and thermal energy) results with three unknowns, for which usually velocity, pressure, and temperature are chosen; this is known as the primitive-variable approach. Other alternatives have a limitation to bi-dimensional flows (vorticity-stream function approach), or are less attractive for three-dimensional flows (vector potential approach); consequently, the N–S equations are often solved in their primitive variable form.

For constant viscosity, the energy equation can be uncoupled, so the temperature field can be obtained after the velocity field has been computed. As the nonlinearities are related to the convective term, the attention is focused on the solution of the continuity and momentum equations.

An important characteristic of the N–S equations is that no time derivative of pressure appears. Pressure is no longer a thermophysical property, but a function that must act in such a way that the resulting velocity field has divergence zero. In an incompressible flow pressure perturbations propagate at infinite speed, obeying an elliptic, Poisson’s type partial differential equation, where the source term is a function of the velocity field.

A strategy often employed for the numerical solution of the incompressible N–S equations is the pressure correction approach, in which a derived equation is used to determine the pressure field. Typically, the momentum equations are solved for the velocity components using linearized expressions in which time-lagged values are used for the variables other than the unknown, including pressure. In this step, the obtained velocity field does not satisfy the continuity equation. Next, the solution is substituted in the discretized continuity equation and often a Poisson equation is developed for the pressure (or pressure changes), from which a new pressure field is obtained. This pressure field is used to calculate a new velocity field until a solution is produced that satisfies both the momentum and the continuity equations. The literature on numerical schemes using the pressure correction approach is extensive, differing the methods in the algorithms used to solve the component equations and the improved pressure field. A review of these methods can be found in [42].

In this section a single-phase, single-component, multidimensional incompressible flow with viscosity and thermal effects is considered for the application of the BG methodology [5, 7]. Main characteristics of the methodology explained in Sect. 9.2 will not be repeated here; only the new concepts will be stressed.

3.1 Continuum Formulation

3.1.1 Energy and Power Representation

For an incompressible fluid, the density ρ 0 is no longer a state variable. The total energy per unit volume e v can be written as:

$$\displaystyle{ e_{v} = u_{v}\left (s_{v}\right ) + t_{v}^{{\ast}}\left (\boldsymbol{V }\right ) }$$
(9.128)

For a single-phase, single-component fluid with constant specific heat c v , the kinetic coenergy and internal energy per unit volume can be written as:

$$\displaystyle{ t_{v}^{{\ast}} = \frac{1} {2}\,\rho _{0}\,\boldsymbol{V }^{2} =\rho _{ 0}\,\kappa }$$
(9.129)
$$\displaystyle{ u_{v} = u_{v\,R} +\rho _{0}\,c_{v}\,\theta _{R}\,\left [\exp \left ( \frac{s_{v}} {\rho _{0}\,c_{v}}\right ) - 1\right ] }$$
(9.130)

where u vR and θ R are respectively reference values of internal energy per unit volume and absolute temperature, for which the entropy per unit volume is zero. The linear momentum per unit volume and the absolute temperature are defined as:

$$\displaystyle{ \boldsymbol{p}_{v} = \frac{dt_{v}^{{\ast}}} {d\boldsymbol{V }} =\rho _{0}\,\boldsymbol{V } }$$
(9.131)
$$\displaystyle{ \theta = \frac{du_{v}} {ds_{v}} =\theta _{R}\,\exp \left ( \frac{s_{v}} {\rho _{0}\,c_{v}}\right ) }$$
(9.132)

The time derivative of Eq. (9.128) can be written as:

$$\displaystyle{ \frac{\partial e_{v}} {\partial t} =\boldsymbol{ p}_{v} \cdot \frac{\partial \boldsymbol{V }} {\partial t} +\theta \, \frac{\partial s_{v}} {\partial t} }$$
(9.133)

As the internal energy per unit volume is only a function of the entropy per unit volume and the kinetic coenergy per unit volume is only a function of the velocity, these two energy domains can be decoupled.

3.1.2 Conservation Equations

For an incompressible fluid the continuity, linear momentum, and thermal energy conservation equations are [44]:

$$\displaystyle{ \nabla \cdot \boldsymbol{ V } = 0}$$
(9.134)
$$\displaystyle{ \rho _{0}\,\frac{\partial \boldsymbol{V }} {\partial t} = -\rho _{0}\,\nabla \kappa +\rho _{0}\,\boldsymbol{V } \times \left (\nabla \times \boldsymbol{ V }\right ) -\nabla P +\rho _{0}\,\boldsymbol{G} + \nabla \cdot \underline{\underline{\tau }} }$$
(9.135)
$$\displaystyle{ \frac{\partial u_{v}} {\partial t} = -\nabla \cdot \boldsymbol{ q} -\nabla u_{v} \cdot \boldsymbol{ V } + \nabla \boldsymbol{V }:\underline{\underline{\tau }} +\rho _{0}\,\varPhi }$$
(9.136)

For a newtonian, incompressible fluid and assuming Fourier’s law, the viscous stress and the heat flux can be written as:

$$\displaystyle{ \underline{\underline{\tau }}=\mu \, \left (\nabla \boldsymbol{V } + \nabla \boldsymbol{V }^{T}\right ) }$$
(9.137)
$$\displaystyle{ \boldsymbol{q} = -\lambda \,\nabla \theta = - \frac{\lambda \,\theta } {\rho _{0}\,c_{v}}\,\nabla s_{v} }$$
(9.138)

3.1.3 Balance Equations

Transforming the conservation equations in the same fashion as it was made in Sect. 9.2.1.4, it can be obtained:

$$\displaystyle{ \boldsymbol{p}_{v} \cdot \frac{\partial \boldsymbol{V }} {\partial t} = \nabla \cdot \left (\underline{\underline{\tau }}\cdot \boldsymbol{V }\right ) -\nabla \cdot \left (P\,\boldsymbol{V }\right ) -\rho _{0}\,\nabla \kappa \cdot \boldsymbol{ V } +\rho _{0}\,\boldsymbol{G} \cdot \boldsymbol{ V } -\nabla \boldsymbol{V }:\underline{\underline{\tau }} \qquad \quad }$$
(9.139)
$$\displaystyle{ \theta \,\frac{\partial s_{v}} {\partial t} = -\nabla \cdot \boldsymbol{ q} -\nabla \cdot \left (\theta \,s_{v}\,\boldsymbol{V }\right ) + s_{v}\,\nabla \theta \cdot \boldsymbol{ V } +\rho _{0}\,\varPhi + \nabla \boldsymbol{V }:\underline{\underline{\tau }} }$$
(9.140)

The only coupling term \(\nabla \boldsymbol{V }:\underline{\underline{\boldsymbol{\tau }}}\) represents the power transfer (mechanical energy dissipation) between the velocity and entropy equations; this coupling term appears, with opposite signs, in the balance equations. Adding the balance equations, it can be easily obtained the conservation of total energy:

$$\displaystyle{ \rho _{0}\,\frac{D\hat{e}} {Dt} = \nabla \cdot \left [\left (-P\,\underline{\underline{I}}+\underline{\underline{\tau }}\right ) \cdot \boldsymbol{ V } -\boldsymbol{ q}\right ] +\rho _{0}\,\boldsymbol{G} \cdot \boldsymbol{ V } +\rho _{0}\,\varPhi }$$
(9.141)

where \(\hat{e} =\hat{ u} + \frac{1} {2}\,\boldsymbol{V }^{2}\) is the total energy per unit mass and \(\frac{D} {Dt}\) is the material derivative.

3.2 Discrete Formulation

3.2.1 Description of the Flow Fields

The description of the flow fields corresponding to the velocity and entropy per unit volume is made as in Sect. 9.2.2.1. The description of the pressure field is made as:

$$\displaystyle{ P\left (\boldsymbol{r},\,t\right ) =\sum _{ k=1}^{n_{P} }P_{k}\left (t\right )\,\varphi _{P\,k}\left (\boldsymbol{r}\right ) =\underline{ P}^{T} \cdot \underline{\varphi _{ P}} }$$
(9.142)

where P (size n P ) is the time-dependent nodal pressure vector and φ P is the corresponding nodal shape function.

3.2.2 System Total Energy

Following the same procedure as in Sect. 9.2.2.3, the system total energy E results:

$$\displaystyle{ E = U\left (\underline{S}\right ) + T^{{\ast}}\left (\underline{\boldsymbol{V }}\right ) }$$
(9.143)

The system kinetic coenergy can be expressed as the following bilinear form:

$$\displaystyle{ T^{{\ast}} = \frac{1} {2}\,\underline{\boldsymbol{V }}^{T} \cdot \underline{\underline{ M}} \cdot \underline{\boldsymbol{ V }} }$$
(9.144)

where M is the system inertia matrix:

$$\displaystyle{ \left \{M\right \}_{m\,n} =\rho _{0}\int _{\varOmega }\varphi _{V \,m}\,\varphi _{V \,n}\,d\varOmega }$$
(9.145)

Comparing Eq. (9.56) with Eq. (9.145), it is verified that the inertia matrix is constant for incompressible flows.

The following potentials are defined:

$$\displaystyle{ \underline{\boldsymbol{p}}\left (\underline{\boldsymbol{V }}\right ) = \frac{dT^{{\ast}}} {d\underline{\boldsymbol{V }}} =\underline{\underline{ M}} \cdot \underline{\boldsymbol{ V }} =\int _{\varOmega }\boldsymbol{p}_{v}\,\underline{\varphi _{V }}\,d\varOmega =\rho _{0}\int _{\varOmega }\boldsymbol{V }\,\underline{\varphi _{V }}\,d\varOmega }$$
(9.146)
$$\displaystyle{ \underline{\varTheta }\left (\underline{S}\right ) = \frac{dU} {d\underline{S}} =\underline{\underline{\varOmega _{S}}}^{-1} \cdot \left [\int _{\varOmega }\theta \,\underline{\varphi _{ S}}\,d\varOmega \right ] }$$
(9.147)

where \(\underline{\boldsymbol{p}}\) and Θ are respectively nodal vectors of linear momentum and temperature. The potentials defined in Eqs. (9.146) and (9.147) allow to represent kinetic and internal energy storage respectively as an inertial I and a capacitive C multibond field, as shown in Fig. 9.11.

Fig. 9.11
figure 11

Inertial (a ) and capacitive (b ) fields, representing kinetic and internal energy storage for an incompressible fluid

As the inertia matrix is constant, Eq. (9.146) defines a multibond transformer relating the nodal vectors of velocity and linear momentum, as shown in Fig. 9.12a, with generalized effort given by:

$$\displaystyle{ \underline{\boldsymbol{F}} =\underline{\underline{ M}} \cdot \underline{\boldsymbol{\dot{ V }}} }$$
(9.148)
Fig. 9.12
figure 12

Multibond transformer connected to the inertial port (a ), and equivalent inertia field for incompressible flow (b )

From Eqs. (9.146) and (9.148), \(\underline{\boldsymbol{F}} =\underline{\boldsymbol{\dot{ p}}}\) for incompressible flows. In this case, the combination of the inertia field from Fig. 9.11a and the transformer of Fig. 9.12a are equivalent to an inertia field in which the generalized momentum is the nodal vector of linear momentum, as shown in Fig. 9.12b.

The time derivative of Eq. (9.143) can be written as:

$$\displaystyle{ \dot{E} =\underline{\boldsymbol{ p}}^{T} \cdot \underline{\boldsymbol{\dot{ V }}} +\underline{\varTheta } ^{T} \cdot \underline{\dot{ S}} }$$
(9.149)

3.3 State Equations

3.3.1 Velocity Port

Following the same procedure as in Sect. 9.2.3.2, the velocity state equation results:

$$\displaystyle{ \underline{\boldsymbol{\dot{V }}} =\underline{\underline{ M}}^{-1} \cdot \left (\underline{\boldsymbol{F}_{ V }^{\left (\varGamma \right )}} +\underline{\boldsymbol{ F}_{ P}^{\left (\varGamma \right )}} +\underline{\boldsymbol{ F}_{ R}} +\underline{\boldsymbol{ F}_{P}} +\underline{\boldsymbol{ F}_{G}} -\underline{\boldsymbol{ F}_{V }} -\underline{\boldsymbol{ F}_{K}}\right ) }$$
(9.150)

where \(\underline{\boldsymbol{F}_{V }^{\left (\varGamma \right )}}\) and \(\underline{\boldsymbol{F}_{V }}\) were already defined respectively in Eqs. (9.88) and (9.92), while the rest of the forces are defined as:

$$\displaystyle{ \underline{\boldsymbol{F}_{P}^{\left (\varGamma \right )}} = -\int _{\varGamma }P\,\underline{\varphi _{ V }}\,\boldsymbol{\check{n}}\,d\varGamma }$$
(9.151)
$$\displaystyle{ \underline{\boldsymbol{F}_{R}} =\rho _{0}\int _{\varOmega }\boldsymbol{V } \times \left (\nabla \times \boldsymbol{ V }\right )\,\underline{\varphi _{V }}\,d\varOmega }$$
(9.152)
$$\displaystyle{ \underline{\boldsymbol{F}_{P}} =\int _{\varOmega }P\,\underline{\nabla \varphi _{V }}\,d\varOmega }$$
(9.153)
$$\displaystyle{ \underline{\boldsymbol{F}_{G}} =\rho _{0}\int _{\varOmega }\boldsymbol{G}\,\underline{\varphi _{V }}\,d\varOmega }$$
(9.154)
$$\displaystyle{ \underline{\boldsymbol{F}_{K}} =\rho _{0}\int _{\varOmega }\nabla \kappa \,\underline{\varphi _{V }}\,d\varOmega }$$
(9.155)

Adding the nodal components of Eq. (9.150) it can be easily shown that the integral momentum equation is satisfied:

$$\displaystyle{ \rho _{0}\int _{\varOmega }\frac{D\boldsymbol{V }} {Dt} \,d\varOmega =\int _{\varGamma }\left (-P\,\underline{\underline{I}}+\underline{\underline{\tau }}\right ) \cdot \boldsymbol{\check{ n}}\,d\varGamma +\rho _{0}\int _{\varOmega }\boldsymbol{G}\,d\varOmega }$$
(9.156)

3.3.2 Entropy Port

Following the same procedure as in Sect. 9.2.3.3, the entropy state equation results:

$$\displaystyle{ \underline{\dot{S}} =\underline{\dot{ S}_{Q}^{\left (\varGamma \right )}} +\underline{\dot{ S}_{ C}^{\left (\varGamma \right )}} +\underline{\dot{ S}_{ Q}} +\underline{\dot{ S}_{C}} +\underline{\dot{ S}_{F}} +\underline{\dot{ S}_{A}} +\underline{\dot{ S}_{V }} }$$
(9.157)

where \(\underline{\dot{S}_{Q}^{\left (\varGamma \right )}}\), \(\underline{\dot{S}_{C}^{\left (\varGamma \right )}}\), \(\underline{\dot{S}_{Q}}\), \(\underline{\dot{S}_{C}}\) and \(\underline{\dot{S}_{V }}\) were already defined respectively in Eqs. (9.99)–(9.102) and (9.106), while the rest of the nodal vectors of entropy rate are defined as:

$$\displaystyle{ \underline{\dot{S}_{F}} =\underline{\underline{\varTheta }} ^{-1} \cdot \left (\rho _{ 0}\int _{\varOmega }\underline{w_{S}}\,\varPhi \,d\varOmega \right ) }$$
(9.158)
$$\displaystyle{ \underline{\dot{S}_{A}} =\underline{\underline{\varTheta }} ^{-1} \cdot \left (\int _{\varOmega }\underline{w_{ S}}\,s_{v}\,\boldsymbol{V } \cdot \nabla \theta \,d\varOmega \right ) }$$
(9.159)

Multiplying Eq. (9.157) by Θ, it can be easily shown that the entropy balance equation (9.140) integrated in volume is satisfied, that is:

$$\displaystyle\begin{array}{rcl} \int _{\varOmega }\theta \,\frac{\partial s_{v}} {\partial t} \,d\varOmega & =& -\int _{\varGamma }\left (\boldsymbol{q} +\theta \, s_{v}\,\boldsymbol{V }\right ) \cdot \boldsymbol{\check{n}}\,d\varGamma +\int _{\varOmega }s_{v}\,\boldsymbol{V } \cdot \nabla \theta \,d\varGamma \\ & & +\rho _{0}\int _{\varOmega }\varPhi \,d\varOmega +\int _{\varOmega }\left (\nabla \boldsymbol{V }:\underline{\underline{ \tau }}\right )d\varOmega {}\end{array}$$
(9.160)

3.3.3 Pressure and Integral Incompressibility Constraint

Making the dot product of Eq. (9.150) and \(\underline{\boldsymbol{V }}\) and taking into account Eq. (9.25), it can be obtained:

$$\displaystyle\begin{array}{rcl} \int _{\varOmega }\boldsymbol{p}_{v} \cdot \frac{\partial \boldsymbol{V }} {\partial t} \,d\varOmega & =& \int _{\varGamma }\left (\underline{\underline{\tau }}\cdot \boldsymbol{V }\right ) \cdot \boldsymbol{\check{ n}}\,d\varGamma -\int _{\varGamma }\left (P \cdot \boldsymbol{\check{ n}}\right )\,d\varGamma -\rho _{0}\int _{\varOmega }\nabla \kappa \cdot \boldsymbol{ V }\,d\varOmega \\ & & +\rho _{0}\int _{\varOmega }\boldsymbol{G} \cdot \boldsymbol{ V }\,d\varOmega -\int _{\varOmega }\left (\nabla \boldsymbol{V }:\underline{\underline{\tau }}\right )\,d\varOmega +\underline{\boldsymbol{ F}_{P}}^{T} \cdot \underline{\boldsymbol{ V }}{}\end{array}$$
(9.161)

Comparing Eq. (9.139) integrated in volume with Eq. (9.161), the velocity balance equation (conservation of mechanical energy) integrated over the domain Ω is satisfied if \(\underline{\boldsymbol{F}_{P}}^{T} \cdot \underline{\boldsymbol{ V }} = 0\). This power term can be expressed as:

$$\displaystyle{ \underline{\boldsymbol{F}_{P}}^{T} \cdot \underline{\boldsymbol{ V }} =\int _{\varOmega }P\left (\nabla \cdot \boldsymbol{ V }\right )d\varOmega =\underline{ P}^{T} \cdot \underline{ Q} }$$
(9.162)

where the nodal vector of volumetric flow Q results:

$$\displaystyle{ \underline{Q} =\int _{\varOmega }\underline{\varphi _{P}}\left (\nabla \cdot \boldsymbol{ V }\right )d\varOmega }$$
(9.163)

As a consequence, the integral incompressibility condition that must satisfy the discretized velocity field is:

$$\displaystyle{ \underline{Q} =\underline{ 0} }$$
(9.164)

The system of equations (9.150) and (9.164) is coincident with the one obtained by the Galerkin method for the weak formulation of the problem in Finite Elements [47], in which general boundary conditions are possible at the bonds with the superficial forces \(\underline{\boldsymbol{F}_{V }^{\left (\varGamma \right )}}\) and \(\underline{\boldsymbol{F}_{P}^{\left (\varGamma \right )}}\).

Adding the components of vector Q, it can be verified that the integral continuity equation is satisfied, that is:

$$\displaystyle{ \int _{\varOmega }\left (\nabla \cdot \boldsymbol{ V }\right )d\varOmega =\int _{\varGamma }\boldsymbol{V } \cdot \boldsymbol{\check{ n}}\,d\varGamma = 0 }$$
(9.165)

The power conserving transformation between the force and pressure ports is represented by a multibond transformer, as shown in Fig. 9.13, with relations given by:

$$\displaystyle{ \underline{\boldsymbol{F}_{P}} =\underline{\underline{\boldsymbol{ M}_{PV }}} \cdot \underline{ P} }$$
(9.166)
$$\displaystyle{ \underline{Q} =\underline{\underline{\boldsymbol{ M}_{PV }}}^{T} \cdot \underline{\boldsymbol{ V }} }$$
(9.167)

where \(\underline{\underline{\boldsymbol{M}_{PV }}}\) is a rectangular matrix, with n V rows and n P columns, defined as:

$$\displaystyle{ \left \{\boldsymbol{M}_{PV }\right \}_{m\,k} =\int _{\varOmega }\nabla \varphi _{V \,m}\,\varphi _{P\,k}\,d\varOmega }$$
(9.168)
Fig. 9.13
figure 13

Multibond transformer representing the integral incompressibility constraint

Concerning the bond corresponding to the superficial pressure force \(\underline{\boldsymbol{F}_{P}^{\left (\varGamma \right )}}\), the power term can be written as:

$$\displaystyle{ \underline{\boldsymbol{F}_{P}^{\left (\varGamma \right )}} \cdot \underline{\boldsymbol{ V }} = -\int _{\varGamma }P\,\boldsymbol{V } \cdot \boldsymbol{\check{n}}\,d\varGamma =\underline{ P}^{T} \cdot \underline{ Q^{\left (\varGamma \right )}} }$$
(9.169)

where the nodal vector of superficial volumetric flow \(\underline{Q^{\left (\varGamma \right )}}\) is defined as:

$$\displaystyle{ \underline{Q^{\left (\varGamma \right )}} = -\int _{\varGamma }\underline{\varphi _{ P}}\,\mathbf{\mathit{{V}}} \cdot \boldsymbol{\check{ n}}\,d\varGamma }$$
(9.170)

The power conserving transformation between the superficial force and pressure is represented by a multibond transformer, as shown in Fig. 9.14, with relations given by:

$$\displaystyle{ \underline{\boldsymbol{F}_{P}^{\left (\varGamma \right )}} =\underline{\underline{\boldsymbol{ M}_{ PV }^{\left (\varGamma \right )}}} \cdot \underline{ P} }$$
(9.171)
$$\displaystyle{ \underline{Q^{\left (\varGamma \right )}} =\underline{\underline{\boldsymbol{ M}_{ PV }^{\left (\varGamma \right )}}}^{T} \cdot \underline{\boldsymbol{ V }} }$$
(9.172)

where \(\underline{\underline{\boldsymbol{M}_{PV }^{\left (\varGamma \right )}}}\) is a rectangular matrix, with n V rows and n P columns, defined as:

$$\displaystyle{ \left \{\boldsymbol{M}_{PV }^{\left (\varGamma \right )}\right \}_{ m\,k} = -\int _{\varGamma }\varphi _{V \,m}\,\varphi _{P\,k}\,\boldsymbol{\check{n}}\,d\varGamma }$$
(9.173)
Fig. 9.14
figure 14

Multibond transformer representing the superficial pressure force

3.4 System BG

The system BG is shown in Fig. 9.15. Energy storage (kinetic and internal) are represented respectively by an inertial I and a capacitive C field. At the 1-junction with common \(\underline{\boldsymbol{V }}\) all the nodal vector forces are added; in this way, the effort balance represents the linear momentum conservation equation for the nodal velocity values. At the 0-junction with common Θ all the nodal entropy rates are added; in this way, the flow balance represents the thermal energy conservation equation for the nodal entropy values.

Fig. 9.15
figure 15

System BG for an incompressible flow

The MRS field connecting the 1 and 0 junctions represents the power transfer between the velocity and entropy ports, due to viscous dissipation.

The sources S (the ones connected to the bonds with \(\underline{\boldsymbol{F}_{V }^{\left (\varGamma \right )}}\), \(\underline{Q^{\left (\varGamma \right )}}\), \(\underline{\dot{S}_{Q}^{\left (\varGamma \right )}}\), and \(\underline{\dot{S}_{C}^{\left (\varGamma \right )}}\)) represent different source terms related to the boundary conditions; as seen in Sect. 9.2.6.2, in each single port these sources behave as effort or flow sources, depending on the boundary conditions.

The rest of the sources, effort S e or flow S f (the ones connected to the bonds with Q, \(\underline{\boldsymbol{F}_{R}} +\underline{\boldsymbol{ F}_{G}} -\underline{\boldsymbol{ F}_{K}}\) and \(\underline{\dot{S}_{Q}} +\underline{\dot{ S}_{C}} +\underline{\dot{ S}_{F}} +\underline{\dot{ S}_{A}}\)) represent volumetric power terms; the determination of causality for these sources and for the bonds connected to the MRS field results from the causality extension procedure detailed in Sect. 9.2.6.5. The power input in any bond corresponding to the multibond with Q is zero, according to the integral incompressibility constraint, Eq. (9.164); as a consequence the causality is such that, in any of these bonds, flow is imposed to the ports connected to the transformer and the modulated source becomes a flow source S f . The net power input (sum over the bonds) corresponding to the multibond with the rotational force \(\underline{\boldsymbol{F}_{R}}\) is zero, because of Eq. (9.25). As seen before, the net power input corresponding to the multibonds with the entropy rates \(\underline{\dot{S}_{Q}}\) and \(\underline{\dot{S}_{C}}\) is also zero.

4 Applications

4.1 Numerical Benchmarks

As it was stated before, the applications of this methodology to CFD problems were successful so far.

In [11, 27, 37], as an application example focused on the upwind problem, the formalism was applied to a simple one-dimensional (0 ≤ x ≤ L, where L is the length) advection-diffusion problem in which the thermophysical properties are constant, the velocity field is constant and thermal power source is zero. The resulting state equation involves only the entropy capacitive port of the system total energy. For each node, the shape functions were chosen to be piecewise constant and the weight functions to be piecewise linear, displaced by an upwind parameter β (\(\left \vert \beta \right \vert \leq \frac{1} {2}\), as seen in Fig. 9.16a–c. The existing contributions coming from the discontinuities in the description of the flow fields could be successfully handled in the integration process by using distributional derivatives [31].

Fig. 9.16
figure 16

Entropy test functions. In dashed line, the shape functions and, in solid line, the weight functions [11]. (a ) Inner node. (b ) First node. (c ) Last node

This kind of problem is interesting because destabilization of the numerical solution, related to the nodalization, may arise. The following thermal energy equation results:

$$\displaystyle{ \rho \,c_{v}\,\left ( \frac{\partial \theta } {\partial t} + V \, \frac{\partial \theta } {\partial x}\right ) =\lambda \, \frac{\partial ^{2}\theta } {\partial x^{2}} }$$
(9.174)

As stated in Sect. 9.2.6.5, the resulting equation is second order and two space boundary conditions are needed. Considering the boundary conditions θ0, t = θ 0, \(\theta \left (L,\,t\right ) =\theta _{L}\) and \(\theta \left (x,\,0\right ) =\theta _{0}\), the nondimensional steady state solution θ is [35]:

$$\displaystyle{ \theta _{\infty }^{{\ast}}\left (x^{{\ast}}\right ) = \frac{\theta _{\infty }-\theta _{0}} {\theta _{L} -\theta _{0}} = \frac{\exp \left (x^{{\ast}}\,Pe_{L}\right ) - 1} {\exp \left (Pe_{L}\right ) - 1} }$$
(9.175)
$$\displaystyle{ Pe_{L} = \frac{\rho \,c_{v}\,V \,L} {\lambda } }$$
(9.176)

where V is the velocity and Pe L is the Peclet number. The transient nondimensional temperature

$$\displaystyle{ \theta ^{{\ast}} = \frac{\theta -\theta _{0}} {\theta _{L} -\theta _{0}} }$$
(9.177)

satisfies

$$\displaystyle{ \frac{\partial \theta ^{{\ast}}} {\partial Fo} + Pe_{L}\, \frac{\partial \theta ^{{\ast}}} {\partial x^{{\ast}}} = \frac{\partial ^{2}\theta ^{{\ast}}} {\partial x^{{\ast}2}} }$$
(9.178)
$$\displaystyle{ Fo = \frac{\lambda \,t} {\rho \,c_{v}\,L^{2}} }$$
(9.179)

where Fo is the Fourier number. The solution of Eq. (9.178) is:

$$\displaystyle\begin{array}{rcl} \theta _{ad}^{{\ast}}\left (x^{{\ast}},\,Fo,\,Pe_{ L}\right )& =& \frac{\exp \left (x^{{\ast}}\,Pe_{L}\right ) - 1} {\exp \left (Pe_{L}\right ) - 1} +\exp \left [-\left (1 - x^{{\ast}}\right )\frac{Pe_{L}} {2} \right ] \\ & & \times \sum _{m=1}^{\infty } \frac{8\left (-1\right )^{m}m\,\pi } {\left (Pe_{L}^{2} + 4\,m^{2}\,\pi ^{2}\right )}\,\sin \left (m\,\pi \,x^{{\ast}}\right ) \\ & & \times \exp \left [-\frac{1} {4}\left (Pe_{L}^{2} + 4\,m^{2}\,\pi ^{2}\right )Fo\right ] {}\end{array}$$
(9.180)

For diffusive problems, the corresponding entropy rate vectors \(\underline{\dot{S}_{Q}}\) and \(\underline{\dot{S}_{Q}^{\left (\varGamma \right )}}\) are nonzero. To satisfy the temperature boundary conditions, the sources \(\dot{S}_{Q1}^{\left (\varGamma \right )}\) and \(\dot{S}_{Qn}^{\left (\varGamma \right )}\) were adjusted in the iterative process in order to keep constant temperature values at x = 0 and x = L.

It was verified that, for centered schemes (no upwind, β = 0), the numerical solution is stable if the grid Peclet number \(Pe_{h} = \frac{\rho \,c_{v}\,V \,h} {\lambda } < 2\), thus limiting the maximum grid spacing.

Many schemes for stabilizing the numerical solution for coarse meshes exist [35]. In the simulations, full upwind was chosen (\(\beta = \frac{1} {2}\,\mbox{ sgn}\left (V \right )\)); with full upwind, the solution is intrinsically stable, though it has more numerical diffusion. Figure 9.17 shows the comparison of the nondimensional numerical and analytical solutions for different nondimensional times (Fourier numbers) and full upwind. In order to obtain a fair simulation of the transient behavior, a sufficient number of time steps should be calculated before the times of interest. Here, a fixed time step was implemented such that there are ten steps until the first Fourier number plotted. A fair agreement can be observed.

Fig. 9.17
figure 17

Comparison of analytical (solid line, Pe L  = 2) and numerical nondimensional temperatures for combined advection and diffusion, with full upwind [11]

In order to decrease the numerical diffusion for a stable numerical solution of a coarse mesh, different upwind schemes can be used. In particular, the following upwind scheme provides a numerical solution coincident with the exact one for one-dimensional advection-diffusion flow in steady state [27]:

$$\displaystyle{ \beta = \frac{\exp Pe_{h} + 1} {2\left (\exp Pe_{h} - 1\right )} - \frac{1} {Pe_{h}} }$$
(9.181)

Figure 9.18 shows the comparison of the nondimensional numerical and analytical solutions for different nondimensional times (Fourier numbers) using this controlled upwind scheme. An excellent agreement can be observed.

Fig. 9.18
figure 18

Comparison of analytical (solid line, Pe L  = 2) and numerical nondimensional temperatures for combined advection and diffusion, with controlled upwind [11]

An important point in obtaining discrete solutions for problems of continuous nature is to ensure that the error (difference between the discrete and the analytical solutions) diminishes as the discretization is refined; this is verified with a mesh convergence test. Such analysis is shown in Fig. 9.19 for combined advection and diffusion flow, where increasing the number of nodes leads the steady state numerical solution closer to the analytical solution.

Fig. 9.19
figure 19

Influence of number of nodes on steady state solution: mesh convergence test. Comparison of analytical (solid line, Pe L  = 2) and numerical solutions with full upwind for combined advection and diffusion [11]

A quantitative mesh convergence analysis is shown in Fig. 9.20, where the maximum normalized deviation between the analytical and numerical solution is plotted against the number of nodes. It can be seen that the rate of convergence is highly dependent on the upwind scheme used. Full upwind is intrinsically stable but has a slower convergence rate. It should be noted that zero upwind could have provided an unstable solution. The optimal upwind scheme for this specific case, given by Eq. (9.181), provides the best result. This is in accordance with standard results [35].

Fig. 9.20
figure 20

Mesh convergence analysis for different upwind schemes. Relative deviation of numerical and analytical steady state solutions for combined advection and diffusion as a function of number of nodes [11]

As seen before, the solution was easily stabilized by modifying the entropy weight functions in a very simple and automatic fashion, loosely related to the Petrov–Galerkin approach used in the FEM. As a consequence, advection-diffusion problems can be handled in the formalism through the right choice of automatically calculated upwind-biased weight functions. A full upwind scheme can be safely used.

In [1, 4], the resulting state equations were presented for a one-dimensional problem with constant piecewise shape functions and lumped forms of the temperature, Gibbs free energy, and kinetic coenergy per unit mass matrices. This nodalization and the choice of the shape functions allowed to perform a closed calculation of the state equations. As for this case the state variables correspond to the mass, velocity, and entropy in control volumes, it was possible to make a comparison with other numerical schemes. The existing contributions coming from the discontinuities in the description of the flow fields could be successfully handled in the integration process by using distributional derivatives [31]. Although viscous effects could not be modeled with a constant piecewise velocity profile, heat conduction could be taken into account with entropy weight functions with nonzero gradients at the discontinuities. The density and entropy weight functions, which are elements of this approach, were capable of taking into account the upwind nature of the fluid equations. Based on the linearized expressions of the state equations, a comparison was made with a finite-volume and with a finite-difference numerical scheme, obtaining an interpretation of the density and entropy weight functions appearing in the BG formalism. It was found that the density and entropy weight functions can be regarded as weight factors in the calculation of the corresponding fluxes within a control volume, while the gradient of the entropy weight function come out to be proportional to the weight factors in the calculation of the conductive entropy fluxes. Based on the Second Principle of Thermodynamics, it was also shown that the entropy weight functions must decrease as the distance to the corresponding node position increases.

In [28] the methodology was used to solve the so-called shock tube problem [45]. Concerning the shape functions, constant piecewise were adopted for density and entropy, while continuous linear were adopted for velocity, in order to be able to model viscous effects. As weight functions, linear piecewise were adopted for the entropy, while linear continuous were adopted for the density. Lumped forms of the temperature, Gibbs free energy, and kinetic coenergy per unit mass matrices were also chosen. No-flow and adiabatic boundary conditions were specified at both tube ends. Comparing the numerical and analytical solutions a reasonable agreement was found, being the numerical results a bit diffusive because of the artificial viscosity introduced. Although more work would be needed in the selection of weight and shape functions, the simple ones chosen in this work have shown to be adequate for dealing with a complex nonlinear problem involving all physical effects.

4.2 Extension to Other Flow Problems

4.2.1 Multicomponent Flows

In [2, 3] the methodology was extended to single-phase, multicomponent flows. A classical mixture, or solution, is a material in which the components are not physically distinct, that is, the mixing is at molecular level. In this case, when described using Continuum Theory, all the components of the solution are able to occupy the same region of space at the same time [25] and can be assumed to be in thermodynamic equilibrium. In a solution, each component has its own velocity, density, and internal energy. The balance principles for the components resemble those for a single component, except that they are allowed to interact with one another.

Two approximations were studied: the multivelocity model [2] and the diffusion model [3]. It was shown that, for the multivelocity model, the resulting independent variables are the densities and velocities of the components and the mixture entropy per unit volume. In the diffusion model, the dynamics of a multicomponent solution is described in terms of the average (center of mass) velocity of the mixture and the mass flux of each component relative to the average velocity, thus reducing the number of state variables. These relative mass fluxes are modeled using diffusion theory.

The diffusive mass fluxes consist of different contributions associated with the driving forces (mechanical or thermal) existing in the system [12]. In ordinary diffusion, the mass flux depends in a complicated way on the concentration gradients of the present components; in most of the problems, this is the most important contribution. The pressure diffusion indicates that there may be a differential net movement of a component in the mixture if there is a pressure gradient imposed to the system; this effect is important in centrifuge separation, in which tremendous pressure gradients are established. The forced diffusion appears when the components are under different external forces, as in the case of ionic systems in the presence of electric fields. Finally, the thermal diffusion describes the tendency for the components to separate under the influence of a temperature gradient. Although this effect is small, it can be enhanced by producing very steep temperature gradients.

The relative fluxes are assumed to be dependent on the entropy per unit volume and the component densities. This functional dependence allows to deal with ordinary (concentration driven) diffusion, pressure diffusion, forced diffusion (with steady forces), and thermal diffusion [12].

4.2.2 One-Dimensional Incompressible Pipe Flow

Incompressible pipe flow is a classic branch of Hydraulics which addresses liquid and low velocity gas flows within a closed conduit, without a free surface. The behavior of pipe flow is governed mainly by the Reynolds number, measuring the relative influence of inertial and viscous forces.

The one-dimensional analysis demands that suitable average values of all flow parameters are assumed to be functions of time and the coordinate along the length of the pipe. Small changes in pipe direction and cross-sectional area are allowed, as long as they do not create flow separation or secondary flows. In order to reintroduce the information lost in the averaging process, closure laws for wall momentum and heat transfer, as well as suitable profile correction factors, must be defined.

For incompressible flows, the volumetric flow is independent of position. The resulting effort balance at the inertial port results in the generalized Bernoulli equation, showing transient, convective, and frictional contributions to the piezometric pressure drop.

The BG methodology was applied to the PDEs corresponding to the one-dimensional approximations for incompressible pipe flows in [6]. In [11, 37] different transient problems were numerically implemented and simulated: advective heating of a fluid flow due to constant wall heat flux and due to constant wall temperature, advective heating of a fluid flow due to viscous dissipation and combined advection-diffusion. Viscous dissipation is of particular interest as it is not modeled in other BG formulations, which decouples the inertial and thermal ports. Also, combined advection-diffusion is important given that other BG formulations only take into account advection effects. For each simulation the complementary effects were suppressed for a correct comparison against analytical benchmark solutions. Finally, a unit cell BG representation was shown by enforcing a lumping approximation (summing over the rows or columns) in the matrices associated with the transient terms; comparisons were made for simulations run with this approximation, showing no deterioration of the obtained solutions.

4.2.3 Traffic Flow

Traffic flow was regarded, in the pioneer works [33, 38], as a compressible flow whose behavior is described by a density transport equation and a constitutive algebraic equilibrium law relating density and velocity. The so-called Lighthill, Whitham, and Richards (LWR) model has some limitations, being the most important the impossibility of describing problems in which boundary conditions are established at both ends of a traffic pathway (stop-and-go waves [41]).

To overcome the limitations of the LWR model, two-equation models were developed by adding a velocity transport equation [36]. As it was pointed out in [24], a vehicle can be regarded as a particle that responds to frontal stimuli, which means that the characteristic directions (eigenvalues) of the hyperbolic system of equations cannot be greater than the local velocity. Besides, the velocity cannot change sign (wrong-way-travel). Many models do not satisfy these requirements; as a consequence, they can lead to unrealistic results [24]. In [30] a continuum traffic flow model based on an improved car-following model was developed; the resulting system of equations is hyperbolic and doesn’t suffer wrong-way-travel problems, making it suitable for the study of diverse nonlinear dynamical phenomena observed in freeway traffic. This model was extended to simulate the flow in two lanes [19].

In [20, 21] the BG methodology was used to frame traffic flow models, by making an analogy between traffic flow and compressible flow. Two-equation traffic flow models were framed within the BG methodology and some transient simulations corresponding to propagation of shock and rarefaction waves were successfully run.

4.2.4 One-Dimensional Compressible Pipe Flow

In [8] the BG methodology was used to model compressible one-dimensional pipe flows with rigid walls. All physical effects compatible with the one-dimensional approximation such as shear wall and normal stresses, wall and axial heat conduction, and flow passage area changes can be modeled naturally. The BG representation is similar to the one obtained in Sect. 9.2. Although only the theoretical aspects were presented, the model is suitable to study isentropic, Fanno or Rayleigh flows, as well as nozzle performance.

5 Conclusions and Perspectives

The present contribution addresses the theoretical development of a general true BG approach for CFD. The system state equations are obtained in terms of state variables.

For single-phase, single-component compressible flows the state variables result nodal values of mass, velocity, and entropy. The set of generalized effort and flow variables was derived based on energy considerations, while the state equations were obtained as a Galerkin formulation of the momentum conservation equation and Petrov–Galerkin formulations of the mass and entropy balance equations; as a consequence, the computational tools developed for the FEM, as well as for other numerical methods, can be used to solve the resulting state equations. It is interesting to notice that the matrices resulting for the mass and entropy state equations (respectively Ψ + K and Θ) are different to the ones found when other formulations for the mass and thermal energy conservation equations are discretized.

For single-phase, single-component incompressible flows the state variables result nodal values of pressure, velocity, and entropy. The resulting representation shows the role of pressure as external function acting to satisfy the incompressibility condition and the coupling between the inertial and thermal ports through the power dissipation term. The state equations for momentum and continuity equations are coincident with the one obtained by using the Galerkin method for the weak formulation of the problem in the FEM. The integral incompressibility constraint was derived based on the integral conservation of mechanical energy. The weak formulation for thermal energy equation was modeled with true BG elements, resulting a Petrov–Galerkin method. Again, the matrix resulting for entropy state equation Θ is different to the ones found when other formulations for the thermal energy conservation equation are discretized.

Regarding the power interaction between the system and the external environment, this is made through the boundary source terms \(\underline{\dot{m}_{W}^{\left (\varGamma \right )}}\) and \(\underline{\dot{S}_{C}^{\left (\varGamma \right )}}\) (related to fluid flow across the boundary), \(\underline{\boldsymbol{F}_{V }^{\left (\varGamma \right )}}\) (related to viscous stresses applied at the boundary), and \(\underline{\dot{S}_{Q}^{\left (\varGamma \right )}}\) (related to heat power at the boundary). Other (more subtle) interaction could be established through the force per unit mass \(\boldsymbol{G}\), which may include non-inertial or electrodynamic forces, as in Magnetohydrodynamics.

As a result of a combination of BG concepts with elements of numerical methods, a new approach was developed, which is a foundation of a bridge between BGs and CFD. As the formulation is based on the definition of nodal discretized variables, different numerical schemes can be obtained by means of the appropriate choice of the interpolation and weight functions.

For the applications of the methodology made so far (single-phase, single or multicomponent systems) the modeling and determination of the state equations can be made based on Continuum Theory, conservation laws, Thermodynamics of equilibrium, and constitutive laws coming from the molecular theory. The difficulties in the resolution of a problem are limited, in these cases, to discretization and numerical aspects. Besides framing these flows within the BG theory, the contributions coming from the methodology in these problems are related to the establishment of acceptable boundary conditions satisfying causality.

For more sophisticated flows, like turbulent [46] or multiphase [25], the situation is different. Due to the closure problem in the Reynolds-averaged Navier–Stokes (RANS) equation approach for incompressible turbulence, for instance, it doesn’t exist a theory for all turbulent flows, but models with restricted validity. These models differ in order (algebraic or with a variable number of transport equations), definition of independent variables and fundamentals, so there is no equivalence between them. The situation is far more complex for multiphase flows, where the existence of interfaces makes indispensable the definition of statistical averages related to the existence of a phase (component indicator function); new variables such as the void fraction or the interfacial volumetric area are vital in the description of multiphase systems.

It is interesting to notice that the state of the art in multiphase modeling is not sufficient to guarantee well-posed equations. For one-dimensional bubbly flow, there exist complex eigenvalues for a range of working parameters, which is physically unacceptable. These complex characteristics seem to arise from the unsuccessful modeling of the coupling terms between the momentum equations for each phase [25], being the systematic inclusion of terms soundly based on Physics the remedy to yield an appropriate working model. The concept of balance equations in the BG methodology, with coupling terms between ports, would render a new perspective to deal with this problem.

It becomes evident that the difficulties in the resolution of complex flows like turbulent or multiphase is related to modeling as well as to discretization. Thus, a methodology synthesizing properties of dynamic systems is very useful to frame different models, as well as to develop new ones. Obviously, BG theory does not replace Physics, but works as a structure that allows to discover mathematical inconsistencies from the beginning of the modeling process. A BG based methodology contributes to answer questions such as what the independent variables are, what equations must be satisfied in order to guarantee conservation of energy in the system, and how the boundary conditions are introduced.

This contribution shows that starting from the governing PDEs and using discretization techniques coming from CFD is the right strategy for producing general models, framed within the BG theory, for fluid dynamic systems. The author hopes that the findings of this contribution encourage other researchers to use this formalism in more complex problems.