## 2 Material and Methods
### Solar Plant Modeling
#### 2.2.2 Thermal Energy Storage Tank Modeling  
The TES tank is used as a short-term storage solution for the produced heat during the day. The thermal energy stored in the tank is equal to the heat input to the tank, minus the heat streams rejected from the tank, which are the heat input to the ORC module, the heat needed to preheat the incoming water to the electrolyzer, and the heat losses to the ambient. The tank can be split into thermal zones, where the temperature value is considered to be uniform. If it is supposed that the tank is separated into N zones, the upper zone, where the temperature is higher and the density is lower, is called Zone \"1\", while the lower zone is called Zone \"\(N\)\". Carrying out the energy balance in each mixing zone, the following expressions are made for Zone \"1\", Zone \"2\" (intermediate zone), and Zone \"\(N\)\" [14]:  
\[\frac{\rho_{oil}V_{tank}}{N}c_{p,oil}\frac{\partial T_{st,1}}{ \partial t}=\dot{m}_{col}c_{p,oil}\left(T_{col,out}-T_{st,1}\right)+\dot{m}_{ s}c_{p,oil}\left(T_{st,2}-T_{st,1}\right)-U_{tank}A_{tank,1}(T_{st,1}-T_{amb}) \tag{7}\] \[\frac{\rho_{oil}V_{tank}}{N}c_{p,oil}\frac{\partial T_{st,2}}{ \partial t}=\dot{m}_{col}c_{p,oil}\left(T_{st,1}-T_{st,2}\right)+\dot{m}_{s}c_ {p,oil}\left(T_{st,3}-T_{st,2}\right)-U_{tank}A_{tank,2}(T_{st,2}-T_{amb})\] (8) \[\frac{\rho_{oil}V_{tank}}{N}c_{p,oil}\frac{\partial T_{st,N}}{ \partial t}=\dot{m}_{col}c_{p,oil}\left(T_{st,N-1}-T_{st,N}\right)+\dot{m}_{s}c _{p,oil}\left(T_{s,out,2}-T_{st,N}\right)-U_{tank}A_{tank,N}(T_{st,N}-T_{amb}) \tag{9}\]  
More specifically, (\(\rho_{oil}\)) is the oil density, (\(c_{p,oil}\)) the specific heat of the thermal oil, (\(V_{tank}\)) the tank volume, (\(\dot{m}_{col}\)) the collector field flow rate, (\(\dot{m}_{s}\)) the oil loop flow rate, (\(T_{st,i}\)) the temperature value of the mixing zone (\(i\)), (\(U_{tank}\)) the tank heat loss coefficient which is assumed to be equal to 0.5 W/m\({}^{2}\)K [14], while (\(A_{tank,i}\)) is the outer surface of each mixing zone and is defined by the equation below [14]:  
\[A_{tank,i}=\left\{\begin{array}{l}\frac{\pi\cdot D_{tank}\cdot H_{tank}}{N}+ \pi\cdot\frac{D_{tank}^{2}}{4},\;i=1\;or\;i=N\\ \frac{\pi\cdot D_{tank}\cdot H_{tank}}{N},\;i=2:N-1\end{array}\right. \tag{10}\]  
The tank height (\(H_{tank}\)) is considered to be equal to the tank diameter (\(D_{tank}\)). Moreover, the temperature of the oil stream that feeds the ORC (\(T_{s,in}\)) is equal to the temperature of the upper tank zone (\(T_{st,1}\)), while the temperature of the collector inlet stream (\(T_{col,in}\)) is equal to the temperature of the lower tank zone (\(T_{st,N}\)). These assumptions are described below:  
\[T_{s,in}=T_{st,1} \tag{11}\]  
\[T_{col,in}=T_{st,N} \tag{12}\]  
To determine the tank temperature profile during the day, the differential Equations (7)-(9) are discretized according to the finite difference method. For Zone 1, the discretization is presented below:  
\[\frac{\partial T_{st,1}}{\partial t}=\frac{T_{st,1}-T_{st,1}^{0}}{\Delta t} \tag{13}\]  
The exponent \"0\" symbolizes the temperature values at the previous time step, while (\(\Delta t\)) is the time step. In this study, the time step is assumed at 10 min, with the tank mixing zones at 5 [30].