**2. Mathematical Modeling**

Consider a rigid rectangular tank as the physical domain of this research with length L, base at *y* = <sup>−</sup>*h*, free surface *y* = 0. Figure 1 shows the schematic of the problem with Coordinate system. As a first approximation the fluid motion can considered by the use of velocity potential. The replace of velocity potential in the continuity Equation ( ∇.*V* = ∂*u* ∂*x* + ∂*v* ∂*y* = 0) leads to Laplace equation as, (see Equation 1.23 in [8])

$$\frac{\partial^2 \phi}{\partial \mathbf{x}^2} + \frac{\partial^2 \phi}{\partial y^2} = 0 \,. \tag{1}$$

**Figure 1.** Diagram of fluid-vessel interaction with its cross section.

The boundary condition of the fluid domain in the right wall is the no-slip condition.

$$\left.\frac{\partial\phi}{\partial x}\right|\_{x=L} = 0\tag{2}$$

where *L* is the tank length. The no-slip condition at the left wall is

$$\left.\frac{\partial\phi}{\partial x}\right|\_{x=0} = 0\tag{3}$$

and the no-slip condition at the bottom wall is

$$\left.\frac{\partial\phi}{\partial y}\right|\_{y=-h} = 0\tag{4}$$

where *h* is the fluid height. At the free surface, the kinematic boundary is

$$\left. \frac{\partial \phi}{\partial y} \right|\_{y=\eta} = \left. \frac{\partial \eta}{\partial t} + \frac{\partial \eta}{\partial \mathbf{x}} \left. \frac{\partial \phi}{\partial \mathbf{x}} \right|\_{y=\eta} \tag{5}$$

and the total pressure equation (neglecting the surface tension) from the Bernoulli equation is

$$P = -\rho \left(\frac{\partial \phi}{\partial t} + \frac{1}{2} \left\{ \left(\frac{\partial \phi}{\partial x}\right)^2 + \left(\frac{\partial \phi}{\partial y}\right)^2 \right\} + \mathcal{g}y + \ddot{\mathcal{X}}x \right) \tag{6}$$

where *g* is the gravity acceleration. The pressure at the free surface can be derived from the Equation of the motion (ρ- ∂*V*∂*t* + (*<sup>V</sup>*.<sup>∇</sup>)*V* = −∇*p* + ρ-→*g* − →*a* + ∇.μ-∇*V* + ∇*V<sup>T</sup>*) by the aid of fluid density (ρ) and viscosity (μ) as well. The linearized surface conditions (leads to linear wave theory) are

$$
\phi\_y(y=0) = \eta\_{t\prime} \tag{7}
$$

which is the kinematic condition for free surface elevation (η) and

$$
\phi\_t(y=0) + \mathcal{g}\eta + \mathbf{x}\ddot{X} = 0\tag{8}
$$

for kinetic condition. Combining the kinematic and dynamic free-surface conditions leads to the equation

$$
\pm \phi\_{tt}(y=0) + g\phi\_y(y=0) = \mathbf{x}\dddot{\mathbf{X}}.\tag{9}
$$

The solution satisfying Equation (l) with the rigid wall boundary conditions, Equations (2)–(4) is obtained in a general form as a sum of infinite sloshing modes as

$$\phi = \sum\_{i=1}^{\infty} a\_i(t) \cos(\frac{i\pi x}{L}) \frac{\cosh\left(\frac{i\pi(y+h)}{L}\right)}{\frac{i\pi}{L}\sinh\left(\frac{i\pi h}{L}\right)}\tag{10}$$

where ai(*t*) is an arbitrary time function and its related spatial function characterizes the velocity potential function of the n*th* sloshing mode and the dot notation (.) represents *d( )*/*dt.* The free surface profile associated with Equation (10) with the boundary condition of Equation (7) is

$$\eta = \sum\_{i=1}^{\infty} a\_i(t) \cos(\frac{i\pi x}{L}). \tag{11}$$

The surface condition of Equation (9) can be used to determine the coefficients ai(*t*), which appears in Equation (10) and Equation (11) for the external acceleration of .. *X* as

$$
\ddot{a}\_i(t) + g\frac{i\pi}{L}\tanh(\frac{i\pi h}{L})a\_i(t) + \frac{4}{i\pi}\tanh(\frac{i\pi h}{L})\ddot{X} = 0\tag{12}
$$

where the cosine expansion of the x is used as

$$\ln x = \frac{L}{2} + 2L \sum\_{i=1}^{\infty} \cos(\frac{i\pi x}{L}) \frac{(-1)^i - 1}{\left(i\pi\right)^2} \tag{13}$$

to derive Equation (11). The fundamental sloshing frequency (i = 1) of the liquid inside the rectangular tank could be obtained by considering the free oscillation in Equation (11) as

$$f\_{\mathcal{V}} = \frac{1}{2\pi} \sqrt{\frac{\pi \mathcal{S}}{L} \tanh\left(\frac{\pi h}{L}\right)}\tag{14}$$

and replacing the *X* = *X*max cos(ω<sup>t</sup>) in Equation (11) for the external motion gives

$$\ddot{\mathbf{a}}\_{l}(t) + g\frac{\text{i}\pi}{L}\tanh(\frac{\text{i}\pi l}{L})\mathbf{a}\_{l}(t) = -\frac{4}{\text{i}\pi}\tanh(\frac{\text{i}\pi l}{L})\omega^{2}X\_{\text{max}}\sin(\omega t)\tag{15}$$

where ω2*i* = *<sup>g</sup>*<sup>i</sup><sup>π</sup>*L* tanh(<sup>i</sup>π*hL* ). The steady-state solution of Equation (15) is

$$\mathbf{a}\_{l}(t) = \tanh(\frac{\mathrm{i}\pi h}{L}) \frac{4X\_{\mathrm{max}}}{\mathrm{i}\pi} \frac{\omega^2}{\omega^2 - \omega\_{\mathrm{i}}^2} \sin(\omega \mathbf{t}). \tag{16}$$

The final linearize solutions are

$$\eta = X\_{\text{max}} \sum\_{i=1}^{\infty} \tanh(\frac{\text{i}\pi h}{L}) \frac{4}{\text{i}\pi} \frac{\omega^2}{\alpha^2 - \omega\_j^2} \sin(\omega t) \cos(\frac{\text{i}\pi \text{x}}{L}) \tag{17}$$

$$\phi = LX\_{\text{max}}\omega \sum\_{i=1}^{\text{ov}} \frac{\left(\frac{2\mu}{1\pi}\right)^2}{\omega^2 - \alpha\_i^2} \cos(\omega t) \cos(\frac{i\pi\text{x}}{L}) \frac{\cosh\left(\frac{i\pi(y+h)}{L}\right)}{\cosh\left(\frac{i\pi h}{L}\right)}.\tag{18}$$

The entropy generated can be calculated by [5]

$$S'''\_{~\mathcal{S}} = \frac{\mu}{T} \boldsymbol{\varrho} + \frac{k}{T^2} (\boldsymbol{\nabla} \boldsymbol{T})^2 \tag{19}$$

where the dot notation (") represents the value per volume. The dissipation function in Equation (19) is calculated from

$$\varphi = 2\left[\left(\frac{\partial u}{\partial \mathbf{x}}\right)^2 + \left(\frac{\partial v}{\partial y}\right)^2\right] + \left(\frac{\partial u}{\partial y} + \frac{\partial v}{\partial \mathbf{x}}\right)^2. \tag{20}$$

The total entropy generated in the volume of the fluid in the case of an isothermal condition (∇*T* = 0) is calculated from Equation (18) as

$$S\_{\mathcal{S}} = \int \int \frac{\mu}{T} q \, d\mathbf{x} dy. \tag{21}$$

By substituting the analytical solution in the definition of entropy generation we get:

$$S\_{\mathcal{S}} = \frac{16\pi\mu X\_{\text{max}}^2 \omega^2}{T} \sum\_{i=1}^{\infty} \left(\frac{\omega^2}{\omega^2 - \omega\_i^2} \cos(\omega t)\right)^2 \frac{\tanh\left(\frac{i\pi\hbar}{L}\right)}{i}. \tag{22}$$

The entropy appearing in Equation (22) is the total entropy generated by the fluid, and since the energy exchanged with the moving wall has been considered as a thermodynamic system, the entropy of the working fluid is well established and can be used as an objective function. The entropy generation in an isothermal wall container could be a representation of viscous dissipation that could lead to explosion in liquids with flammable materials.
