# A Cost-Efficient Approach towards Computational Fluid Dynamics Simulations on Quantum Devices
## 3 Preliminaries  
### The Basic Concepts of Finite Element Method  
Numerical simulations of real-life processes cannot be carried out unless the corresponding mathematical model of the physical system is defined along with the underlying physical laws that govern the system. These laws for space- and time-dependent problems can be expressed in terms of partial differential equations (PDEs). In most cases, however, these PDEs are extremely difficult if not impossible to solve analytically. Therefore, an approximation often has to be made that can be produced using different types of discretization methods, such as the FEM (as seen in Figure 1), FVM and FD. In the case of CFD problems, FVM is the most commonly used scheme, as it is a locally conservative method, meaning that the conservation laws are satisfied on every cell in the mesh. In FEM, the conservation laws are only satisfied globally. Local conservation is an attractive feature, especially in the case of the Navier-Stokes equations; however, FEM is more flexible and generalizable to other problems and use cases. Thus, in this paper, we decided to use FEM as our main discretization method. For more details regarding the differences between FEM and FVM, refer to [38; 39]. The main features of FEM can be best explained using a simple example, but, for a more in-depth understanding, refer to [6; 7; 8]. For this reason, let us take a look at a heat conduction problem inside a thin metal rod of length L:  
\[\text{differential equation}\quad-\lambda T^{\prime\prime}(x)=f(x)\ \forall x\in(0,L), \tag{1}\] \[\text{boundary conditions}\quad \begin{cases}T\ (x=0)=0\\ T^{\prime}(x=L)=0.\end{cases}  \tag{2}\]  
Here, \(\lambda\) denotes the thermal conductivity, \(T(x)\) denotes the temperature at point \(x\) and \(f\) is the rate of heat generation per unit volume \(([f(x)]=W/m^{3})\). The left end of the rod is kept at constant temperature level 0, whereas, at the right end, no heat is allowed to enter or leave. The next step is to multiply both sides of Equation (1) with a so-called test function \(v\) and integrate both sides over the whole domain \(\Omega=(0,L)\):  
\[-\int_{0}^{L}\lambda T^{\prime\prime}(x)v(x)dx=\int_{0}^{L}f(x)v(x)dx. \tag{3}\]  
Figure 1: The finite element mesh discretizes the domain into a finite set of smaller subdomains, which are called elements. Over these elements, a set of basis functions are defined that approximately represent the PDEs that govern the system. As we refine the mesh by increasing the number of elements, the approximation will converge to the true solution. Next, using integration by parts, the equation becomes  
\[-\int_{0}^{L}\lambda T^{\prime\prime}(x)v(x)dx=-[\lambda T^{\prime}v]_{x=0}^{x=L }+\int_{0}^{L}\lambda T^{\prime}(x)v^{\prime}(x)dx. \tag{4}\]  
If the test function \(v\) is required to satisfy the same Dirichlet boundary condition as the temperature \(T\),  
\[v(x=0)=0, \tag{5}\]  
and with the aid of the homogeneous Neumann boundary condition from Equation (2)  
\[T^{\prime}(x=L)=0, \tag{6}\]  
one can simplify Equation (4) as follows:  
\[-\int_{0}^{L}\lambda T^{\prime\prime}(x)v(x)dx=\int_{0}^{L}\lambda T^{\prime}( x)v^{\prime}(x)dx. \tag{7}\]  
After substitution, we arrive at the following equation  
\[\int_{0}^{L}\lambda T^{\prime}(x)v^{\prime}(x)dx=\int_{0}^{L}f(x)v(x)dx. \tag{8}\]  
The transformations used so far are equivalent, and no approximation has been made yet. The first transformation that involves approximation is the Galerkin projection introduced in the next step. The idea behind the Galerkin projection is that solving Equation (8) on a computer requires the infinite-dimensional space \(V\) to be replaced by a finite-dimensional subspace \(S\).