1 Introduction

Material and heat balance calculation is essential for chemical technology assessment. It helps to quantify all reagents, outputs, wastes, intermediate components, as well as to determine the heat flows between all the process-line nodes. In the simplest case, the balance of the process line comprising apparatus connected in series is calculated straightforward, which means that one knows the quantity of input flows at the first node and can sequentially calculate the quantities of output flows at every next node. For process flowcharts with branching and recycled flows, material balance calculation is more complicated. The most obvious method for calculating material balance with recycled flows is to perform sequential iterative calculation of balances at each node while tracking the changes in estimated values and terminating the computations when certain convergence condition is met. This method has been implemented in the ATEK software platform [1] intended for simulation of nuclear fuel cycle technologies and the ATEK-based software package VIZART [2] that was developed to simulate radiochemical production processes. The limitations of this method include the increase in computational time, iterative accumulation of errors, and possible oscillations of solution that violate convergence condition. These limitations have practically no influence when calculating simple process flowcharts but have a significant effect if system under consideration gets more complex. The analytical solution is proposed in order to improve calculation procedure and to remove the above limitations.

2 Assumptions made

For mathematical representation, let us assign a separate flow in the balance flowchart to each individual component (pure substance or mixing element), heat or energy flow entering or leaving the node. For the sake of simplicity, it is proposed to exclude from consideration time dependences and kinetic aspects of processes. Then, the problem of material and heat balance calculation for the process flows can be stated as follows: calculate the quantities of all intermediate and output flows at each node if the quantities of input flows and the laws of their transformation are known. In the simplest case, transformation at the node can be represented by the linear operator, i.e. the matrix.

This approach can be developed further. If we know the quantities of some reagents needed to run a process at the node and the quantities of other reagents that are available in any amount can be determined stoichiometrically, the corresponding flows can be represented as the output flows with negative quantities.

3 Linear flowchart

Taking into account the assumptions made, we consider a flowchart that consists of several successive nodes each having a number of inputs and outputs. Output flows of some nodes are the input flows of the next following nodes. Flows can arrive at the node from the outside or leave the flowchart. An example of such flowchart is given in Fig. 1.

Fig. 1
figure 1

An example of linear flowchart with three nodes

Flow transformations taking place at each node can be written as

$${\mathbf{P}} = {\mathbf{F}} \cdot {\mathbf{M}} ,$$
(1)

where F is a row-vector of input flows, M is a matrix with coefficients that characterize transformation of flows, P is a row-vector of the output flows. In the general case, the number of input flows is not necessarily equal to the number of output flows. For each node, input flow vector F can be written as a sum

$${\mathbf{F}} = {\mathbf{N}} + {\mathbf{B}} ,$$
(2)

where N is a vector of flows arriving at a certain node from a previous one, B is a vector of flows that arrive at this node from the outside. The flows that come from the outside are considered to be constants. Since the number of flows leaving the kth node is not necessarily equal to the number of flows entering the (k+1)th node, we need to match the dimensions of corresponding vectors and matrices in order to generalize the calculation procedure. For this purpose, we propose to write down both the flows leaving the kth node and the flows entering the (k+1)th node in the form of vectors of general dimension nG

$$n_{{\text{G}}} = n_{{{\text{O}}\left( k \right)}} + n_{{{\text{I}}\left( {k + 1} \right)}} - n_{{{\text{I}}/{\text{O}}\left( k \right)}}$$
(3)

where nO(k) is the number of flows leaving the kth node, nI(k+1) is the number of flows entering the (k+1)th node, nI/O(k) is the number of flows leaving the kth node and entering the (k+1)th node. In this case, components of vector Pk that correspond to the indexes of flows arriving at the next node from the outside are equal to zeroes. If so, at the kth node, the columns of matrix M that correspond to the indexes of flows arriving at the (k+1)th node from the outside should be zeroes. Likewise, at the (k+1)th node, the rows of matrix M that correspond to the flows leaving the flowchart after the kth node should also be zeroes. Components of vector B, except for those that correspond to the indexes of flows arriving at the node from the outside, are equal to zeroes.

So, as the nodes are connected in series, we have

$${\mathbf{N}}_{k + 1} = {\mathbf{P}}_{k} ,$$
(4)

where k is the number of the node. For the first node, vector N1 is a zero vector.

Let us consider an example with a flowchart shown in Fig. 1. According to the flow indexing, vectors N,P, and B, as well as matrices M can be written as

$${\mathbf{N}}_{1} = \left[ {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \right]$$
(5)
$${\mathbf{B}}_{1} = \left[ {\begin{array}{*{20}c} {{\mathbf{B}}_{\left( 1 \right)1} } & {{\mathbf{B}}_{\left( 1 \right)2} } \\ \end{array} } \right]$$
(6)
$${\mathbf{M}}_{1} = \left[ {\begin{array}{*{20}c} {{\mathbf{M}}_{\left( 1 \right)1,1} } & {{\mathbf{M}}_{\left( 1 \right)1,2} } & {{\mathbf{M}}_{\left( 1 \right)1,3} } & 0 \\ {{\mathbf{M}}_{\left( 1 \right)2,1} } & {{\mathbf{M}}_{\left( 1 \right)2,2} } & {{\mathbf{M}}_{\left( 1 \right)2,3} } & 0 \\ \end{array} } \right]$$
(7)
$${\mathbf{P}}_{1} = \left[ {\begin{array}{*{20}c} {{\mathbf{P}}_{\left( 1 \right)1} } & {{\mathbf{P}}_{\left( 1 \right)2} } & {{\mathbf{P}}_{\left( 1 \right)3} } & 0 \\ \end{array} } \right]$$
(8)
$${\mathbf{N}}_{2} = \left[ {\begin{array}{*{20}c} {{\mathbf{P}}_{\left( 1 \right)1} } & {{\mathbf{P}}_{\left( 1 \right)2} } & {{\mathbf{P}}_{\left( 1 \right)3} } & 0 \\ \end{array} } \right]$$
(9)
$${\mathbf{B}}_{2} = \left[ {\begin{array}{*{20}c} 0 & 0 & 0 & {{\mathbf{B}}_{\left( 2 \right)4} } \\ \end{array} } \right]$$
(10)
$${\mathbf{M}}_{2} = \left[ {\begin{array}{*{20}c} 0 & 0 \\ {{\mathbf{M}}_{\left( 2 \right)2,1} } & 0 \\ {{\mathbf{M}}_{\left( 2 \right)3,1} } & 0 \\ {{\mathbf{M}}_{\left( 2 \right)4,1} } & 0 \\ \end{array} } \right]$$
(11)
$${\mathbf{P}}_{2} = \left[ {\begin{array}{*{20}c} {{\mathbf{P}}_{\left( 2 \right)1} } & 0 \\ \end{array} } \right]$$
(12)
$${\mathbf{N}}_{3} = \left[ {\begin{array}{*{20}c} {{\mathbf{P}}_{\left( 2 \right)1} } & 0 \\ \end{array} } \right]$$
(13)
$${\mathbf{B}}_{3} = \left[ {\begin{array}{*{20}c} 0 & {{\mathbf{B}}_{\left( 3 \right)2} } \\ \end{array} } \right]$$
(14)
$${\mathbf{M}}_{3} = \left[ {\begin{array}{*{20}c} {{\mathbf{M}}_{\left( 3 \right)1,1} } & {{\mathbf{M}}_{\left( 3 \right)1,2} } & {{\mathbf{M}}_{\left( 3 \right)1,3} } \\ {{\mathbf{M}}_{\left( 3 \right)2,1} } & {{\mathbf{M}}_{\left( 3 \right)2,2} } & {{\mathbf{M}}_{\left( 3 \right)2,3} } \\ \end{array} } \right]$$
(15)
$${\mathbf{P}}_{3} = \left[ {\begin{array}{*{20}c} {{\mathbf{P}}_{\left( 3 \right)1} } & {{\mathbf{P}}_{\left( 3 \right)2} } & {{\mathbf{P}}_{\left( 3 \right)3} } \\ \end{array} } \right]$$
(16)

According to Eqs. (1) and (2),

$${\mathbf{P}}_{1} = \left( {{\mathbf{N}}_{1} + {\mathbf{B}}_{1} } \right) \cdot {\mathbf{M}}_{1} = {\mathbf{N}}_{1} \cdot {\mathbf{M}}_{1} + {\mathbf{B}}_{1} \cdot {\mathbf{M}}_{1}$$
(17)

According to Eqs. (17) and (3),

$${\mathbf{P}}_{2} = \left( {{\mathbf{N}}_{2} + {\mathbf{B}}_{2} } \right) \cdot {\mathbf{M}}_{2} = {\mathbf{N}}_{1} \cdot {\mathbf{M}}_{1} \cdot {\mathbf{M}}_{2} + {\mathbf{B}}_{1} \cdot {\mathbf{M}}_{1} \cdot {\mathbf{M}}_{2} + {\mathbf{B}}_{2} \cdot {\mathbf{M}}_{2}$$
(18)

In a similar way, the expression for the kth node of an arbitrary linear flowchart having no recycled flows can be written as

$${\mathbf{P}}_{k} = {\mathbf{N}}_{1} \cdot \mathop \prod \limits_{i = 1}^{k} {\mathbf{M}}_{i} + \mathop \sum \limits_{i = 1}^{k} \left( {{\mathbf{B}}_{i} \cdot \mathop \prod \limits_{j = i}^{k} {\mathbf{M}}_{j} } \right)$$
(19)

This expression can be written in concise form:

$${\mathbf{P}} = {\mathbf{N}} \cdot {\mathbf{M}}^{*} + {\mathbf{B}}^{*}$$
(20)

where M* is the matrix that describes transformation of flows at all nodes of linear flowchart segment under consideration, B* is the vector that describes all the flows arriving at the nodes of this linear segment from the outside while taking into account transformations at all the next following nodes:

$${\mathbf{M}}^{*} = \mathop \prod \limits_{i = 1}^{k} {\mathbf{M}}_{i}$$
(21)
$${\mathbf{B}}^{*} = \mathop \sum \limits_{i = 1}^{k} \left( {{\mathbf{B}}_{i} \cdot \mathop \prod \limits_{j = i}^{k} {\mathbf{M}}_{j} } \right) ,$$
(22)

where k is the number of nodes of the linear segment under consideration.

4 Flowchart with branching

As it was shown earlier, arbitrary linear segment of a flowchart can be represented as a single node with output flows related to the input flows by Eq. (20). For the flowchart with branching (Fig. 2), parallel segments can be replaced by successive ones in such a way that flows bypassing the node would go unchanged through a new ‘effective’ node.

Fig. 2
figure 2

An example of flowchart with branching

In Fig. 2, flow 2 bypasses the node 2 and enters the node 3 while flow 1 bypasses the node 3 and enters the node 2. After that both flows enters node 4. Figure 3 shows linear analogue of this flowchart when input flow 2 goes through the node 2 without any changes and in a similar manner, input flow 1 goes unchanged through the node 3.

Fig. 3
figure 3

Linear representation of flowchart with branching. Dashed lines show new ‘effective’ nodes

5 Flowchart with cycle

In the previous section we have shown that flowchart segment with branching can be represented as a linear segment which, in its turn, can be represented as a single node. Then, if several output flows of this single node possibly representing a certain complex flowchart are redirected to its input, we can obtain a flowchart similar to that given in Fig. 4.

Fig. 4
figure 4

Node with several recycled flows

Let us now apply the above dimensions-matching method proposed for the input and output flow vectors to a single node. We can say that this node is adjacent to itself due to the presence of recycled flows. Then, according to Eq. (20), the expression describing the output flow vector N can be written in the recurrent form as

$${\mathbf{N}}_{k + 1} = {\mathbf{N}}_{k} \cdot {\mathbf{M}}^{*} + {\mathbf{B}}^{*}$$
(23)

where k is the step number in the iterative flowchart calculation. Similarly, for (k + 2), we have

$${\mathbf{N}}_{k + 2} = {\mathbf{N}}_{k} \cdot {\mathbf{M}}^{*2} + {\mathbf{B}}^{*} \cdot {\mathbf{M}}^{*} + {\mathbf{B}}^{*}$$
(24)

Then, the explicit formula for the (k + 1)th step can be written as

$${\mathbf{N}}_{k + 1} = {\mathbf{N}}_{1} \cdot {\mathbf{M}}^{*k} + \mathop \sum \limits_{i = 0}^{k - 1} {\mathbf{B}}^{*} \cdot {\mathbf{M}}^{*i}$$
(25)

According to dimensions-matching method, all the columns of matrix M* that correspond to the indexes of input flows arriving from the outside should contain zeroes. All the rows of matrix M* that correspond to the indexes of flows that leave the flowchart should also contain zeroes.

For notational convenience, let Fo be a set of flows arriving from the outside and To be a set of flows leaving the flowchart. For the flowchart given in Fig. 2, matrix M* is as follows

$${\mathbf{M}}^{*} = \left[ {\begin{array}{*{20}c} 0 & 0 & {M_{1,3}^{*} } & {M_{1,4}^{*} } & {M_{1,5}^{*} } & {M_{1,6}^{*} } \\ 0 & 0 & {M_{2,3}^{*} } & {M_{2,4}^{*} } & {M_{2,5}^{*} } & {M_{2,6}^{*} } \\ 0 & 0 & {M_{3,3}^{*} } & {M_{3,4}^{*} } & {M_{3,5}^{*} } & {M_{3,6}^{*} } \\ 0 & 0 & {M_{4,3}^{*} } & {M_{4,4}^{*} } & {M_{4,5}^{*} } & {M_{4,6}^{*} } \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} } \right]$$
(26)

Then, when raising the matrix M* to the integral power greater that unity, the values of elements \({\left({\mathbf{M}}^{*}\right)}_{i\epsilon Fo,j\epsilon To}^{n}\) are determined by the values of other elements rather than by the values corresponding to (n–1)th power. The values of elements \({\left({\mathbf{M}}^{*}\right)}_{i\epsilon Fo,j\notin (To\cup Fo)}^{n}\) and \({\left({\mathbf{M}}^{*}\right)}_{i\notin \left(To\cup Fo\right),j\epsilon To}^{n}\) are constrained by the values of elements \({\left({\mathbf{M}}^{*}\right)}_{i\notin \left(To\cup Fo\right),j\notin (To\cup Fo)}^{n}\). Hence, all the non-zero elements of matrix (M*)n depend on the elements \({\left({\mathbf{M}}^{*}\right)}_{i\notin \left(To\cup Fo\right),j\notin (To\cup Fo)}^{n}\) that can be used to construct matrix Q of the following form

$${\mathbf{Q}} = \left[ {\begin{array}{*{20}c} {{\mathbf{M}}_{3,3}^{*} } & {{\mathbf{M}}_{3,4}^{*} } \\ {{\mathbf{M}}_{4,3}^{*} } & {{\mathbf{M}}_{4,4}^{*} } \\ \end{array} } \right]$$
(27)

If spectral radius Q satisfies

$$r\left( {\mathbf{Q}} \right) < 1$$
(28)

we have

$$\mathop {\lim }\limits_{n \to \infty } {\mathbf{Q}}^{n} = 0$$
(29)

Correspondingly, for matrix M*, we have

$$\mathop {\lim }\limits_{k \to \infty } {\mathbf{M}}^{*k} = 0$$
(30)

Then, according to Eq. (25),

$$\mathop {\lim }\limits_{k \to \infty } {\mathbf{N}}_{k + 1} = {\mathbf{B}}^{*} \cdot \mathop {\lim}\limits_{k \to \infty } \mathop \sum \limits_{i = 0}^{k - 1} {\mathbf{M}}^{*i}$$
(31)

Equation (31) represents a sum of geometric series. If Eq. (28) is true, this sum converges:

$$\mathop {\lim }\limits_{k \to \infty } {\mathbf{N}}_{k + 1} = {\mathbf{B}}^{*} \cdot \left( {{\mathbf{I}} - {\mathbf{M}}^{*} } \right)^{ - 1}$$
(32)

where I is the unity matrix.

It follows form Eq. (32) that if (28) is true, iterative calculation of material balance of the flowchart with recycled flow reduces to solving Eq. (32) that does not depend on initial values set for recycled flows. If the quantities of recycled flows are of no importance, we can write Eq. (32) in the form of Eq. (1) where F represents B* and M represents \({\left(\mathbf{I}-{\mathbf{M}}^{*}\right)}^{-1}\); this means that the flowchart segment with recycled flows can be represented as a single node having no recycled flows. If the intermediate flow values are needed, one can use Eq. (32) to find an asymptotic solution for the flows that are external with respect to the cycle and perform an iteration of sequential calculations.

In fact, Eq. (28) implies a non-zero take-off from the recycled flows which results in the negative feedback when talking about these flows.

6 Sample calculation for the flowchart with cycle

As an example, we calculated material balance for the flowchart shown in Fig. 4. In our calculations, we used the following initial data:

$${\mathbf{N}}_{1} = \left[ {\begin{array}{*{20}c} 0 & 0 & {400} & {30} & {550} & {600} \\ \end{array} } \right]$$
(33)
$${\mathbf{B}}^{*} = \left[ {\begin{array}{*{20}c} 1 & 2 & 0 & 0 & 0 & 0 \\ \end{array} } \right]$$
(34)
$${\mathbf{M}}^{*} = \left[ {\begin{array}{*{20}c} 0 & 0 & {1.3} & {1.4} & {1.5} & {1.1} \\ 0 & 0 & {1.6} & {1.4} & 2 & 2 \\ 0 & 0 & {0.95} & {0.02} & {1.2} & {0.7} \\ 0 & 0 & 0 & {0.95} & 3 & 4 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} } \right]$$
(35)

Figure 5 shows the results obtained both by iterative method and using Eq. (32). Iterative calculations were performed by Eq. (23). The markers (symbols) given in Fig. 5 are used to indicate data calculated by Eq. (32).

Fig. 5
figure 5

Sample calculations for the flowchart with recycled flows. Solid lines represent the results of iterative calculations; markers are used to indicate data calculated by Eq. (32). According to calculation data, solid lines 1 and 2, as well as markers 1 and 2 lie on the x-axis

Figure 5 shows that when applying iterative method, stationary values obtained using Eq. (32) can be approached by performing 150 iterations. As flows 1 and 2 shown in the flowchart in Fig. 4 arrive from the outside, the corresponding columns of matrix M* are zero columns. Consequently, the values calculated for these flows are also zeroes. In this example, matrix M* satisfies Eq. (28).

7 Conclusions

The paper presents a method to describe steady-state process flowcharts that ignores time dependences and kinetic aspects of the processes. It is shown that linear flowchart segment as well as flowchart segment with branching or recycled flows can be represented as a single node. Formula used to obtain asymptotic solution for iterative calculations is proposed. We introduce a convergence criterion and show that there exists a solution when this convergence condition is satisfied.