1 Introduction

It would be pretty surprising not to come across mathematical formulations involving convection, diffusion, or reaction processes (or any combination of these)—which are essential constituents used for modeling numerous phenomena arising in the natural and engineering sciences, as well as in economics, finance, and other social and behavioral sciences. One such model arising in financial mathematics is the Heston model (Heston, 1993), which was introduced by Steve Heston as an extension of the famous Black–Scholes–Merton (BSM) equations (Black & Scholes, 1973; Merton, 1976). Its deterministic nature, which assumes constant volatility, was one of the main drawbacks of the BSM model, even though it was one of the most useful models to that date for analyzing financial dynamics in option pricing. The constant volatility assumption is not appropriate for the actual market environment since various factors, such as price and maturity, tend to affect the volatility of options. Heston’s model, in contrast to the BSM model, treats volatility as an outcome of a stochastic process, which is much more realistic.

Since the backgrounds of potential readers may vary from decision sciences to numerical analysis and from finance to computer sciences, for both completeness and to facilitate the readability of the manuscript, we feel the need to present a brief review of the terminology used throughout the manuscript in the following lines. The term “option,” which is a financial instrument, refers to a right but not the obligation to buy/sell an asset at a prescribed price within a specified period. A “call option” holder has the right but not the obligation to buy the underlying asset at a predetermined (also known as the “exercise” or “strike”) price on or before the expiration date. On the other hand, a “put option” gives the holder the option but not the obligation to sell the underlying asset. Another classification of options can also be done according to their exercise time: European-style options and American-style options. European-style options are those that can only be exercised on the expiration date, while American-style options have a flexible exercise window that extends through the expiration date. For a European-type call option, if U denotes the current price of the underlying asset and the exercise price is K, then the payoff function is given by

$$\begin{aligned} \max \left( U_{T}-K, 0\right) = \left( U_{T}-K\right) ^{+}, \end{aligned}$$
(1)

where \(U_{T}\) represents the price of the asset at the expiration time. If \(U_{T}>K\), the option holder exercises the option with a gain of \(U_{T}-K\). On the other hand, in American options, the holder has the right to exercise the option anytime during the predetermined period if the price of the underlying asset is above the exercise price K. An option having a different (generally more complex) structure than the one given by Eq. (1), such as the digital and barrier options, is called “exotic.” Further details on financial derivatives and the computational tools to deal with them can be found in Achdou and Pironneau (2005), Uğur (2008), Seydel (2012) and in ’t Hout (2017).

Since obtaining explicit (analytical) formulas is typically not possible except for simplified cases, one usually relies on numerical methods for simulating financial models. The following lines attempt to present a brief review of the literature on the computational approaches employed for computing Heston’s model. For more details, the reader can refer to the references listed within them. Zvan et al. (1998) described several approaches for enforcing American-style early exercise constraints by adding a penalty source term. They employed a finite element method (FEM) to discretize the diffusive terms and a finite volume method for the advective terms. Clarke and Parrott (1999) developed a multigrid method for solving the discrete linear complementarity problems (LCPs) that arise when pricing American-style options. They employed an implicit finite difference scheme with an adaptive time-stepping technique. The work of d’Halluin et al. (2004) developed an implicit time-stepping scheme and used the penalty technique proposed in Zvan et al. (1998) to enforce American-style option constraints. Ikonen and Toivanen (2007) analyzed and compared various computational methods for pricing American-type put options under Heston’s model, reporting that the accuracies of the methods in question appear to be similar.

Persson and von Sydow (2010) considered American-style options for both constant and stochastic volatilities with a space- and time-adaptive finite difference method (FDM). Kunoth et al. (2012) derived a variational inequality for American-type option pricing and then discretized it with linear finite elements in space. They solved the linear inequality systems with a projective Gauss–Seidel technique, along with some studies on various multiscale methods to accelerate the solution process, with a particular emphasis on the monotone multigrid method. In Ballestra and Pacelli (2013), a radial basis function (RBF) method was developed for option pricing under the BSM and Heston models. The authors evaluated their scheme on a broad set of test problems, including vanilla, digital, and barrier call options. Düring et al. (2014) proposed a high-order compact finite differences scheme for European-style option pricing subject to Heston’s model on non-uniform meshes.

A variation of the RBF method was proposed for pricing a multi-asset American-type put option problem in the framework of unsteady convection–diffusion equations (Safdari-Vaighani et al., 2014). In Haentjens and in ’t Hout (2015), the authors dealt with pricing American-type options under Heston’s model with the Alternating Direction Implicit (ADI) time discretization schemes. Düring and Miles (2017) proposed a high-order ADI scheme, for which they reported second-order accuracy in time and fourth-order in space, for option pricing in stochastic volatility models. Mollapourasl et al. (2017) employed a RBF approach with the partition of unity method (PUM) applied to a linear complementary formulation for American options under Heston’s model. They proposed a Crank–Nicolson (CN) scheme combined with an operator splitting method for discretization of the problem. The researchers proposed several splitting methods based on linear multistep methods and stabilizing corrections, presenting applications to European-type call options subject to the Heston model in Hundsdorfer and in ’t Hout (2018). Teng and Clevenhaus (2019) studied an ADI scheme for solving the Heston model extended with a stochastic correlation, which resulted in 3D computation.

In recent years, Kozpınar et al. (2020) proposed a discontinuous Galerkin finite element formulation (dGFEM) for computing European- and American-type option pricing with Rannacher smoothing (Rannacher, 1984) as a time integrator. The symmetric interior penalty Galerkin (SIPG) method (Arnold, 1982), which is a popular and powerful discontinuous Galerkin scheme used for handling discontinuities across element boundaries by adding an interior penalty term, was used for the convective part of the Heston model. Lin and Zhu (2020) considered the pricing problem for American-style convertible bonds under the Heston model. They proposed a predictor-corrector scheme complemented with an ADI scheme for the correction step to solve the model. In Mehrdoust et al. (2021), pricing of an American put option in the double Heston model was studied, and an analytical solution to the model was derived through the affine form of the model and the Fourier transform method. In Zhang et al. (2022), the authors considered American put options using a penalty approach and then employed a semi-implicit FEM. And most recently, in order to maximize the expected return of the trader by managing inventories, Aydoğan et al. (2022) addressed optimal trading strategies via price impact models using Heston’s model. They considered quadratic and exponential utility functions, and employed a finite difference scheme for solving the model.

As can be seen from the brief overview provided above, the computational literature for option pricing is overwhelmingly dominated by numerical tools based on the FDM, and the use of finite element methods is much less common. The fact that the FDM is simple to comprehend, straightforward to use, and simple to code are a few of the factors contributing to its popularity. It also has a long history and a well-developed theory. Beyond these, the FDM has gained more traction than other conventional methods (finite element/volume) because financial models are usually defined on simple, rectangular computational domains, for which the FDM typically performs pretty well. Two other common computational approaches employed for option pricing are the binomial tree method (Cox et al., 1979) and Monte Carlo (MC) simulations (Boyle, 1977). Compared to the binomial tree method, the FDM is more efficient and accurate when dealing with a large number of option prices. Despite being a flexible alternative for high-dimensional option pricing problems and its suitability for risk management and simulations, the MC approach may lose this benefit due to its high computational cost and challenges with handling early exercises. Regarding the finite element methods, they provide accuracy and adaptivity and are useful for solving problems with complex geometries and/or when PDEs control the underlying dynamics. On the other hand, conventional numerical discretization methods, including the FDM and FEM, suffer from numerical instabilities in convection dominance, necessitating special treatments, such as adaptive mesh strategies and stabilized formulations, to resolve discontinuities and strong gradients accurately. Therefore, stabilized finite element methods enhanced with discontinuity-capturing mechanisms can be a good alternative for financial computations.

In this current study, we are interested in obtaining stabilized and accurate finite element approximations of the Heston model for pricing European- and American-type options. To that end, the streamline-upwind/Petrov–Galerkin (SUPG) (Hughes & Brooks, 1979; Brooks & Hughes, 1982) stabilized finite element formulation enhanced with YZ\(\beta\) shock-capturing (Tezduyar, 2004a, b, 2007), called the SUPG-YZ\(\beta\) formulation, is employed. The linear complementarity problems for simulating the American-style options are handled with an efficient and practical penalty approach introduced in Nielsen et al. (2008). Some of the distinguishing features of this current paper from many of the studies reported in the literature are that it deals with both European- and American-type options that require the use of different formulations and techniques, that it is the first study that employs a SUPG-based stabilized formulation for simulating such problems, and that it deals with option pricing models that contain much stronger convection terms. As we deal with convection-dominated option pricing simulations, we also contribute to the literature by introducing new “challenging” parameter sets that can be used as benchmarks. For each test problem and parameter set, the numerical results obtained with the classical finite element formulation, also called the Galerkin FEM (GFEM), and the SUPG formulation without using any shock-capturing technique are also compared with those obtained with the SUPG-YZ\(\beta\) formulation. Furthermore, in contrast to the overwhelming number of studies in the literature, we achieve quite good solution profiles despite very strong gradients due to the convection dominance by employing only linear elements on uniform meshes, without any need for staggered meshes, adaptive mesh strategies, or high-order polynomials. In other words, computational cost is significantly lower than those in the FDM and MC simulations.

The rest of the manuscript is organized as follows. The next section introduces the Heston model. Section 3 presents the SUPG-stabilized formulation and the YZ\(\beta\) discontinuity-capturing mechanism for computing the Heston model. In Sect. 4, several computational details are discussed, such as temporal discretization, iterative solution processes for solving systems of equations, and the details of the penalty approach employed for solving LCPs are given. In Sect. 5, through comparisons with other reported methods and results, the proposed formulation and techniques are tested on a wide range of test problems, including pricing digital options. Finally, in Sect. 6, concluding remarks are made, along with some suggestions for future work.

2 Heston’s Model

Heston’s model (Heston, 1993), which treats the volatility as a result of stochastic process, can be expressed as a parabolic partial differential equation (PDE) for European-style put options as follows Heston (1993) and Kozpınar et al. (2020):

$$\begin{aligned}{} & {} \frac{\partial U}{\partial \tau } - \frac{v}{2} \sigma ^{2}\frac{\partial ^{2} U}{\partial v^{2}} - \rho \sigma v \frac{\partial ^{2} U}{\partial v \partial x} - \frac{v}{2} \frac{\partial ^{2} U}{\partial x^{2}} - \left( \kappa (\theta - v) - \lambda (\tau , v, x)\right) \frac{\partial U}{\partial v} \nonumber \\{} & {} \quad - \left( r_{d} - r_{f} - \frac{v}{2}\right) \frac{\partial U}{\partial x} + r_{d}U = 0, \end{aligned}$$
(2)

where \(U(\tau , v,x)\) denotes the European-style option price, \(\tau \in \left( 0, T\right]\) indicates the time to maturity T at time t, i.e., \(\tau =T-t\), \(v \ge 0\) is the variance described by a Cox–Ingersoll–Ross (CIR) process (Cox et al., 1985), and \(x = \log (S/K) \in \left( -\infty , \infty \right)\) represents the underlying price. The mean reversion rate and level are shown by the parameters \(\kappa\) and \(\theta\), respectively. The parameters \(r_d\) and \(r_f\) denote the domestic and foreign interest rates, respectively. The parameter \(\sigma \in \mathbb {R}^{+}\) represents the volatility of volatility, and \(\rho \in \left[ -1,1\right]\) is the correlation associated with the Wiener process, which is also called Brownian motion and is a kind of Markov stochastic process.

The function \(\lambda (\tau , v, x)\) denotes the market price of volatility risk, and is assumed to be zero throughout this study, as also done in Kozpınar et al. (2020). For completeness, we assume that Eq. (2) is equipped with the initial condition \(U(0, v, x ) = U^{0}(v, x )\) and appropriately determined boundary conditions for the moment. For a detailed discussion and the derivation of the PDE given by Eq. (2), we refer the interested reader to Zvan et al. (1998) and Kunoth et al. (2012) and references therein.

It is obvious that spatial domain associated with Eq. (2), which spans from minus infinity to infinity in the x-direction, should be truncated due to computational reasons, and the resulting computational domain should be a good representative of the original one. For the moment, we consider the spatial computational domain as \(\Omega = \left( v_{\text {min}}, v_{\text {max}}\right) \times \left( x_{\text {min}}, x_{\text {max}}\right)\).

In light of the above discussions, for European-type options, Heston’s model given by Eq. (2) can be described in a more compact and mathematically complete form as follows (Kozpınar et al., 2020):

$$\begin{aligned} \frac{\partial U}{\partial \tau } - \nabla \cdot \left( \textbf{A} \nabla U\right) + \textbf{b} \cdot \nabla U + r_{d} U = 0&, \quad \text {in} \quad \mathcal {I} \times \Omega , \end{aligned}$$
(3)
$$\begin{aligned} U(\tau , v, x ) = U^{D}(\tau , v, x )&, \quad \text {on} \quad \mathcal {I} \times \Gamma ^{D},\end{aligned}$$
(4)
$$\begin{aligned} \textbf{A} \nabla U(\tau , v, x ) \cdot \textbf{n} = U^{N}(\tau , v, x )&, \quad \text {on} \quad \mathcal {I} \times \Gamma ^{N},\end{aligned}$$
(5)
$$\begin{aligned} U(0, v, x ) = U^{0}(v, x )&, \quad \text {in} \quad \left\{ 0\right\} \times \Omega , \end{aligned}$$
(6)

where the functions \(U^{D}\) and \(U^{N}\) are given Dirichlet- and Neumann-type boundary conditions, and \(\Gamma ^{D}\) and \(\Gamma ^{N}\) represent the boundary parts where these conditions are prescribed, respectively. Note that \(\partial \Omega = \Gamma = \Gamma ^{D} \cup \Gamma ^{N}\) and \(\Gamma ^{D} \cap \Gamma ^{N}=\emptyset\) hold. The time interval \(\mathcal {I}\) is defined as \(\mathcal {I}=\left( 0, T\right]\), \(\textbf{n}\) is the outward-oriented unit normal vector, and \(U^{0}\) is the given initial data, which is also called the “payoff function.” The diffusivity matrix \(\textbf{A}\) and convection vector \(\textbf{b}\) read (Kozpınar et al., 2020)

$$\begin{aligned} \textbf{A} = \frac{v}{2} \begin{bmatrix} \sigma ^2 &{} \rho \sigma \\ \rho \sigma &{} 1 \end{bmatrix}, \quad \textbf{b} = \begin{bmatrix} v \kappa - \kappa \theta + \frac{1}{2} \sigma ^{2} \\ \frac{v}{2} - \left( r_{d}-r_{f} - \frac{\rho \theta }{2}\right) \end{bmatrix}. \end{aligned}$$
(7)

When pricing American-type options, the early exercise feature should also be taken into consideration due to the flexibility American options provide to their holders. The Heston model thus has the following form for pricing American-type put options (Kozpınar et al., 2020):

$$\begin{aligned} \frac{\partial U}{\partial \tau } - \nabla \cdot \left( \textbf{A} \nabla U\right) + \textbf{b} \cdot \nabla U + r_{d} U \ge 0,&\end{aligned}$$
(8)
$$\begin{aligned} \left( \frac{\partial U}{\partial \tau } - \nabla \cdot \left( \textbf{A} \nabla U\right) + \textbf{b} \cdot \nabla U + r_{d} U\right) \left( U-U^{0}\right) = 0,&\end{aligned}$$
(9)
$$\begin{aligned} U -U^{0} \ge 0&, \end{aligned}$$
(10)

where the terms can be deduced from those given for Eqs. (3)–(6). Besides, the system is also assumed to be equipped with the initial and boundary conditions similar to that of its European counterpart. The problem given by Eqs. (8)–(10) is called a “linear complementarity problem.”

Since inequality-type variational formulations associated with American-style option pricing problems in the form of Eqs. (8)–(10) are transformed into equality-type formulations as in their European counterparts, we present the SUPG-based stabilized formulation for only European-style option pricing problems in the form of Eqs. (3)–(6). The details are provided in Sect. 4.

3 Streamline-Upwind/Petrov–Galerkin Formulation

Although the finite element methods are famous for their robustness, solid theoretical foundations, and many other distinguishing features, the classical FEM fails to compute convection-dominated problems accurately, yielding node-to-node nonphysical oscillations. To overcome such numerical instabilities, extremely fine spatial discretizations can be used, adaptive mesh strategies can be adopted, or the classical formulations can be stabilized. However, employing finer or adaptive meshes might be restrictive or inapplicable in many cases. Therefore, various stabilized formulations have been developed and proposed since the early 1970s, and the streamline-upwind/Petrov–Galerkin is among the most robust and prominent ones in the FEM framework.

The SUPG formulation was originally developed for incompressible flow computations by Hughes and Brooks (1979) and Brooks and Hughes (1982). The formulation was extended for simulating compressible flows by Tezduyar and Hughes (1982), Tezduyar and Hughes (1983), and Hughes and Tezduyar (1984). Although the SUPG-stabilized formulations were successful in eliminating globally propagated spurious oscillations, the test computations demonstrated that some additional treatments were required to accurately resolve steep gradients around shocks and near discontinuities. To that end, the SUPG was reformulated and augmented with a shock-capturing term in Hughes et al. (1987), resulting in better shock representations. Although the stabilization parameter, which was introduced in the (SUPG)\(_{82}\) framework in Hughes and Brooks (1979) and Brooks and Hughes (1982), underwent some minor changes, the stabilized formulation was supplemented with the same shock-capturing parameter \(\delta _{91}\) (Le Beau & Tezduyar, 1991) until 2004. In 2004, Tezduyar introduced new ways of determining the stabilization and shock-capturing parameters, including the YZ\(\beta\) shock-capturing technique (Tezduyar, 2004a, b, 2007). Today, such stabilized formulations and shock-capturing technologies are used in numerical simulations of many real-world phenomena, from hypersonic flow computations to dam-break problems and natural convection heat transfer to arterial drug delivery applications. For more on the historical development of stabilized formulations in the SUPG framework, we refer the interested reader to Takizawa et al. (2017).

The YZ\(\beta\) technique comes with some advantages over those previously introduced (Tezduyar & Senga, 2006, 2007; Tezduyar et al., 2006): it is simpler to calculate the YZ\(\beta\) shock-capturing parameter, the parameter \(\beta\), which is called the “sharpness parameter,” offers flexibility for weak/moderate and sharper shocks, and it achieves better shock representations. In this work, we adopt the SUPG formulation by augmenting it with the YZ\(\beta\) shock-capturing mechanism. We call this combination the “SUPG-YZ\(\beta\) formulation,” as in Cengizci et al. (2022) and Cengizci and Uğur (2023).

In light of the introductory material and brief discussion given above, the GFEM formulation of Heston’s model for European-type options can be obtained by multiplying both sides of Eq. (3) by a test function W: find \(U \in \mathcal {S}_{U}\) such that for all test functions \(W \in \mathcal {V}_{U}\),

$$\begin{aligned} \int _{\Omega } W \left( \frac{\partial U}{\partial \tau } -\nabla \cdot \left( \textbf{A} \nabla U \right) +\textbf{b}\cdot \nabla U +r_{d} U \right) ~d\Omega =0. \end{aligned}$$
(11)

In this formulation, the solution and test function spaces are defined as

$$\begin{aligned} \mathcal {S}_{U}&=\{U \;|\;\, U\in H^{1}(\Omega ), \, U=U^{D} \hspace{5.0pt}\text {on} \hspace{5.0pt}\Gamma ^{D}\}, \end{aligned}$$
(12)
$$\begin{aligned} \mathcal {V}_{U}&=\{W \;|\;\, W\in H^{1}(\Omega ), \, W=0 \hspace{5.0pt}\text {on} \hspace{5.0pt}\Gamma ^{D}\}. \end{aligned}$$
(13)

Here, the Sobolev space \(H^{1}\) is defined as follows:

$$\begin{aligned} H^{1}(\Omega )=\{U \;|\; U \in L^{2}(\Omega ), \hspace{5.0pt}D^{1}U \in L^{2}(\Omega ) \}, \end{aligned}$$
(14)

where \(D^{1}U\) represents the first-order weak derivative of U, and \(L^{2}(\Omega )\) is the space of square-integrable functions defined in \(\Omega\).

By using Green’s formula for integrating the diffusion term \(\nabla \cdot \left( \textbf{A} \nabla U \right)\) in Eq. (11) by parts, a weak formulation of the Heston model for European-type option pricing can be expressed as follow: find \(U \in \mathcal {S}_{U}\) such that for all test functions \(W \in \mathcal {V}_{U}\),

$$\begin{aligned} \int _{\Omega } \nabla W \cdot \textbf{A} \nabla U~d\Omega + \int _{\Omega } W \left( \frac{\partial U}{\partial \tau } + \textbf{b}\cdot \nabla U + r_{d} U \right) ~d\Omega - \int _{\Gamma ^{N}} U^{N} W~d\Gamma =0. \end{aligned}$$
(15)

In this way, Neumann-type boundary conditions can also be incorporated into the discretized formulation. Then, the spatially discretized GFEM formulation can be given as follows: find \(U^{h} \in \mathcal {S}^{h}_{U}\) such that for all test functions \(W^{h} \in \mathcal {V}^{h}_{U}\),

$$\begin{aligned} \int _{\Omega } \nabla W^{h} \cdot \textbf{A} \nabla U^{h}~d\Omega + \int _{\Omega } W^{h} \left( \frac{\partial U^{h}}{\partial \tau } +\textbf{b}\cdot \nabla U^{h} + r_{d} U^{h} \right) ~d\Omega - \int _{\Gamma ^{N}} \left( U^{N}\right) ^{h} W^{h}~d\Gamma =0, \end{aligned}$$
(16)

where the superscript “h” indicates that the associated function is from a finite-dimensional subspace. The finite-dimensional solution and test function spaces are defined as follows:

$$\begin{aligned} \mathcal {S}_{U}^{h}&=\{U^{h} \;|\; \,U^{h}\in H^{h1}(\Omega ), \, U^{h}= U^{D} \hspace{5.0pt}\text {on} \hspace{5.0pt}\Gamma ^{D}\}, \end{aligned}$$
(17)
$$\begin{aligned} \mathcal {V}_{U}^{h}&=\{W^{h} \;|\; \,W^{h}\in H^{h1}(\Omega ), \, W^{h}=0 \hspace{5.0pt}\text {on} \hspace{5.0pt}\Gamma ^{D}\}, \end{aligned}$$
(18)

where the finite element space \(H^{h1}\) is defined as follows:

$$\begin{aligned} H^{h1}(\Omega )=\{ \Phi ^{h} \;|\; \Phi ^{h} \in \mathcal {C}^{0}(\overline{\Omega }), \; \Phi ^{h}|_{\Omega ^{e}} \in \mathcal {P}_{1}(\Omega ^{e}), \; \forall \Omega ^{e} \in \mathcal {T}^{h} \}. \end{aligned}$$
(19)

Here, \(\mathcal {P}_{1}(\Omega ^{e})\) represents the set of linear polynomials over \(\Omega ^{e}\), \(\mathcal {T}^{h}\) denotes the triangulation of the computational domain \(\Omega\), \(\mathcal {C}^{0}(\overline{\Omega })\) is the space of continuous functions on \(\Omega\), and \(\overline{\Omega }=\bigcup \nolimits _{\Omega ^{e} \in \mathcal {T}^{h}} \overline{\Omega ^{e}}\).

As discussed before, stabilization is needed to overcome the inadequacy of the standard GFEM formulation for solving convection-dominated problems. Towards that end, a SUPG-stabilized version of formulation (16) can be given as follows: find \(U^{h} \in \mathcal {S}^{h}_{U}\) such that for all test functions \(W^{h} \in \mathcal {V}^{h}_{U}\),

$$\begin{aligned}{} & {} \int _{\Omega } \nabla W^{h} \cdot \textbf{A} \nabla U^{h}~d\Omega + \int _{\Omega } W^{h} \left( \frac{\partial U^{h}}{\partial \tau } + \textbf{b}\cdot \nabla U^{h} + r_{d} U^{h} \right) ~d\Omega -\int _{\Gamma ^{N}} \left( U^{N}\right) ^{h} W^{h}~d\Gamma \nonumber \\{} & {} \quad + \sum _{e=1}^{n_\text {el}}\int _{\Omega ^{e}} \tau _{\text {SUPG}} \; \textbf{b} \cdot \nabla W^{h} \left( \frac{\partial U^{h}}{\partial \tau } - \nabla \cdot (\textbf{A}\nabla U^{h})+\textbf{b}\cdot \nabla U^{h} + r_{d} U^{h}\right) ~d\Omega =0, \end{aligned}$$
(20)

where “\(n_\text {el}\)” denotes the number of elements, “e” is element counter, and \(\tau _{\text {SUPG}}\) is the SUPG stabilization parameter.

As can be found in many studies reported in the literature, we employ a stabilization parameter that takes into account the time-step size as well. In this regards, the first component of the stabilization parameter, \(\tau _{\text {SUPG1}}\), is defined as follows (Bazilevs et al., 2007):

$$\begin{aligned} \tau _{\text {SUPG1}}=\frac{h^{e}}{2\Vert \textbf{b}\Vert } \min \left( 1, \frac{\text {Pe}}{3p^{2}}\right) , \end{aligned}$$
(21)

where Pe represents the element Péclet number. It is an indicator of the relative dominance of advection over diffusion within individual elements and is defined as follows:

$$\begin{aligned} \text {Pe} = \frac{\Vert \textbf{b} \Vert h^{e}}{2 \Vert \textbf{A} \Vert }. \end{aligned}$$
(22)

The second component, \(\tau _{\text {SUPG2}}\), is

$$\begin{aligned} \tau _{\text {SUPG2}}= \frac{\Delta \tau }{2}. \end{aligned}$$
(23)

Then, the stabilization parameter, \(\tau _{\text {SUPG}}\), in a similar fashion to that used in Shakib (1988), can be given as follows:

$$\begin{aligned} \tau _{\text {SUPG}}= \left[ \left( \frac{1}{\tau _{\text {SUPG1}}}\right) ^{2} + \left( \frac{1}{\tau _{\text {SUPG2}}}\right) ^{2}\right] ^{-\frac{1}{2}}. \end{aligned}$$
(24)

Here, we take the term \(h^{e}\) as the minimum edge length associated with element \(\Omega ^{e}\), and p represents the polynomial order of the interpolation functions, which is adopted as \(p=1\) throughout this work.

The SUPG formulation supplemented with YZ\(\beta\) shock-capturing mechanism, i.e., the SUPG-YZ\(\beta\) formulation, can be given as follows: find \(U^{h} \in \mathcal {S}^{h}_{U}\) such that for all test functions \(W^{h} \in \mathcal {V}^{h}_{U}\),

$$\begin{aligned}{} & {} \int _{\Omega } \nabla W^{h} \cdot \textbf{A}\nabla U^{h}~d\Omega + \int _{\Omega } W^{h} \left( \frac{\partial U^{h}}{\partial \tau } + \textbf{b} \cdot \nabla U^{h} + r_{d} U^{h} \right) ~d\Omega -\int _{\Gamma ^{N}}\left( U^{N}\right) ^{h} W^{h}~d\Gamma \nonumber \\{} & {} \quad + \sum _{e=1}^{n_\text {el}}\int _{\Omega ^{e}} \tau _{\text {SUPG}} \; \textbf{b} \cdot \nabla W^{h} \left( \frac{\partial U^{h}}{\partial \tau } - \nabla \cdot (\textbf{A} \nabla U^{h} ) + \textbf{b}\cdot \nabla U^{h} + r_{d} U^{h}\right) ~d\Omega \nonumber \\{} & {} \quad + \sum _{e=1}^{n_\text {el}}\int _{\Omega ^{e}} \nu _{\text {SHOC}} \left( \nabla W^{h} \cdot \nabla U^{h} \right) ~d\Omega =0, \end{aligned}$$
(25)

where the term \(\nu _{\text {SHOC}}\) represents the shock-capturing parameter and is defined as follows (Tezduyar, 2004a, b, 2007):

$$\begin{aligned} \nu _{\text {SHOC}}=\vert \text {Y}^{-1}\text {Z} \vert \left( \sum _{k=1}^{n_\text {sd}} \Big \vert \text {Y}^{-1} \frac{\partial U^{h}}{\partial x_{k}}\Big \vert ^{2} \right) ^{\frac{\beta }{2}-1}\left( \frac{h_{\text {SHOC}}}{2} \right) ^{\beta }. \end{aligned}$$
(26)

In Eq. (26), for both compactness and ensuring the consistency with the literature, we denote the spatial variables with \(x_{k}\)’s, where \(k=1,2, \dots n_\text {sd}\). It is clear that, in the present discussion, \(x_{1}=v\) and \(x_{2}=x\). The quantity Y is an appropriately determined positive scaling parameter or a reference value for \(U(\tau , x, v)\), i.e.,

$$\begin{aligned} \text {Y} = U_{\text {ref}}. \end{aligned}$$
(27)

For instance, it can be determined as the difference between the maximum and minimum values of the option price, that is, \(U_{\text {max}}(\tau , x, v)-U_{\text {min}}(\tau , x, v)\).

For steady problems, the term Z can be defined in its convective form as proposed in Tezduyar and Senga (2006), Tezduyar and Senga (2007), and Tezduyar et al. (2006)

$$\begin{aligned} \text {Z}=\textbf{b} \cdot \nabla U^{h}, \end{aligned}$$
(28)

and for time-dependent problems, it can be given as

$$\begin{aligned} \text {Z}=\frac{\partial U^{h}}{\partial \tau } + \textbf{b} \cdot \nabla U^{h}. \end{aligned}$$
(29)

As a variation, Z can be defined in the residual form as follows (Bazilevs et al., 2007):

$$\begin{aligned} \text {Z}=\frac{\partial U^{h}}{\partial \tau } - \nabla \cdot (\textbf{A}\nabla U^{h})+\textbf{b}\cdot \nabla U^{h} + r_{d} U^{h}. \end{aligned}$$
(30)

For defining Z, we adopt Eq. (30) in our computations.

The shock element length scale, \(h_{\text {SHOC}}\), and the unit vector \(\textbf{j}\) are given as follows:

$$\begin{aligned} h_{\text {SHOC}} = 2\left( \sum _{a=1}^{n_\text {en}}\vert \textbf{j}\cdot \nabla N_{a}\vert \right) ^{-1}, \qquad \textbf{j}= \frac{\nabla U^{h}}{\Vert \nabla U^{h}\Vert }, \end{aligned}$$
(31)

where “\(n_\text {en}\)” and \(N_{a}\) denote the number of element nodes and the shape function associated with element node “a,” respectively. In this work, we take the sharpness parameter as \(\beta =2\). The studies (Tezduyar & Senga, 2006, 2007; Tezduyar et al., 2006) by Tezduyar et al. are recommended reading for more information and some other variants of the YZ\(\beta\) formulation.

4 Some Computational Details

This section introduces the computational details, such as temporal discretization, iterative solution processes, the implementation of the penalty approach for solving LCPs, the computing ecosystem, and the computation of Greeks.

4.1 Temporal Discretization

The semi-discrete formulations [see Eqs. (16), (20), and (25)] introduced in the previous section are discretized in time with the Crank–Nicolson method, that is, as advancing from time-step n to \(n+1\):

$$\begin{aligned} \frac{\partial U^{h}}{\partial \tau } = \frac{U^{h}_{n+1} - U^{h}_{n}}{\Delta \tau } = \theta _{\text {CN}}\mathcal {J}_{n+1}^{h} + \left( 1-\theta _{\text {CN}}\right) \mathcal {J}_{n}^{h}, \end{aligned}$$
(32)

where \(\theta _{\text {CN}}\) is set as \(\theta _{\text {CN}}=1/2\), and the terms \(\mathcal {J}_{n}^{h}\) and \(\mathcal {J}_{n+1}^{h}\) represent the rest of the terms in the variational formulation computed at time steps n and \(n+1\), respectively.

4.2 Penalty Approach for Linear Complementarity Problem

For solving the complementarity problem arising in pricing American-style options, we adopt the penalty approach, which was originally introduced for solving the BSM model by Nielsen et al. (2008): we add the penalty term

$$\begin{aligned} Q_{\text {pen}}=-\frac{\epsilon _\text {pen} C_{\text {pen}}}{U(\tau ,v,x)+\epsilon _\text {pen}-q_\text {pen}(v,x)} \end{aligned}$$
(33)

to the variational formulation associated with the American option pricing problem, where \(0 < \epsilon _\text {pen} \ll 1\) is an appropriately determined positive small penalty parameter, \(C_{\text {pen}}\) is a positive constant satisfying \(C_{\text {pen}} \ge r_{d} K\) and \(\Delta t \le \frac{\epsilon _\text {pen}}{r_{d} K}\), and the function \(q_\text {pen}(v,x)\) is defined as

$$\begin{aligned} q_\text {pen}(v,x) = K - K\exp (x). \end{aligned}$$
(34)

Note that the nonlinear nature of the penalty term \(Q_{\text {pen}}\) defined by Eq. (33) introduces additional nonlinearity in the variational formulation associated with American-type option pricing problems.

In the variational form discretized in space and time, we add the penalty term implicitly, i.e., we add \(Q_{\text {pen}}^{n+1}\) to the system of equations at time-step n. Therefore, the discussion and methodology given in Sect. 3 for European-style options can be employed for American-style option pricing problems as well, since the variational formulation is transformed into an equality using the penalty approach. For more on the penalty methods, we refer interested readers to Nielsen et al. (2008) and Zvan et al. (1998).

4.3 Solution of Resulting System of Equations

The space (SUPG-YZ\(\beta\)) and time (CN) discretizations of the governing equations associated with the Heston model result in systems of nonlinear equations to be solved at each time step. Although the Heston model is a linear PDE, the resulting algebraic systems are nonlinear due to the nature of the stabilized formulation. Therefore, the nonlinear systems are linearized with the Newton–Raphson method at each time step and are solved with an ILU-preconditioned stabilized bi-conjugate gradient method (BiCG-STAB) at each nonlinear iteration.

For both linear and nonlinear solution processes, the relative and absolute tolerances are set as \(\epsilon _{\text {tol}}=10^{-12}\) for European options. Because of the additional nonlinearity introduced to the system by the penalty term (see Sect. 4.2), we set the tolerances in the nonlinear solver as \(\epsilon _{\text {tol}}=10^{-10}\) for American-style options, whereas they are the same as in European-style computations in the linear solver.

4.4 Solver Environment

All computations are performed in FEniCS, an open-source scientific computing environment. Many pre-defined finite element spaces, such as Taylor–Hood elements and bubble shape functions, are included in FEniCS. However, there is no built-in stabilized finite element formulation in the FEniCS framework. Thus, we take advantage of FEniCS’s flexibility to build our own stabilized finite element solvers using Lagrange elements. Further details can be found on the FEniCS page: https://fenicsproject.org/, and the material in Logg et al. (2012), Abali (2016) and Langtangen and Mardal (2019) can be referred to.

4.5 Computation of Greeks

Having computed the option price U, it is generally desired to measure the sensitivity (Greeks) of the computed solution with respect to a certain variable or parameter. Among others, we restrict our attention to delta (\(\varDelta _{U}\)) and gamma (\(\varGamma _{U}\)) sensitivities, which are mathematically defined as follows:

$$\begin{aligned} \varDelta _{U}= \frac{\partial U}{\partial x} \qquad \text {and} \qquad \varGamma _{U}= \frac{\partial ^{2} U}{\partial x^{2}}. \end{aligned}$$
(35)

In words, \(\varDelta _{U}\) and \(\varGamma _{U}\) represent the sensitivities of the option price U and \(\varDelta _{U}\), respectively, to the underlying asset price x.

In order to compute these sensitivities in FEniCS, we first project the computed solution U onto a Lagrange finite element space of degree 2. After computing \(\varDelta _{U}\), it is then projected onto a Lagrange finite element space of degree 1 and derived with respect to x. The same process is followed for computing \(\varGamma _{U}\) as well, i.e., the computed \(\varDelta _{U}\) is projected onto a Lagrange finite element space of degree 1 and derived with respect to x.

5 Numerical Experiments

This section presents and compares the results obtained with the proposed methods and techniques introduced in the previous sections. To this end, three main test computations are provided: European-style call options, digital call options, and American-style put options. In addition to these classical benchmark problems studied previously, we also introduce new parameter sets for each test computation, through which Heston’s model becomes much more convection-dominated. Thus, we also demonstrate the efficiency of the proposed formulation and techniques for much more challenging computational cases. However, we first start by verifying the solver codes developed in FEniCS through a manufactured solution.

5.1 Code Verification Study

We assume that the Heston model described by Eq. (2) [or, equivalently, by Eqs. (3)–(6)] has the exact solution given as follows (Kozpınar et al., 2020):

$$\begin{aligned} U_{\text {true}}= \cos (\pi v)\cos (\pi x) \exp (-\tau ), \end{aligned}$$
(36)

where the boundary and initial conditions are determined so that the exact solution holds. Note that one should add the terms arising from the implementation of the exact solution as a source term, \(f_{\text {source}}\), to the right-hand side of the model:

$$\begin{aligned} f_{\text {source}}= & {} \pi \kappa \left( \theta - v\right) e^{-\tau } \sin {\left( \pi v \right) } \cos {\left( \pi x \right) } + r_{d} e^{-\tau } \cos {\left( \pi v \right) } \cos {\left( \pi x \right) }\nonumber \\{} & {} - \pi ^{2} \rho \sigma v e^{-\tau } \sin {\left( \pi v \right) } \sin {\left( \pi x \right) } + \frac{\pi ^{2} \sigma ^{2} v e^{- \tau } \cos {\left( \pi v \right) } \cos {\left( \pi x \right) }}{2} \nonumber \\{} & {} + \frac{\pi ^{2} v e^{- \tau } \cos {\left( \pi v \right) } \cos {\left( \pi x \right) }}{2} + \pi \left( r_{d} - r_{f} - \frac{v}{2}\right) e^{- \tau } \sin {\left( \pi x \right) } \cos {\left( \pi v \right) } \nonumber \\{} & {} - e^{-\tau } \cos {\left( \pi v \right) } \cos {\left( \pi x \right) }. \end{aligned}$$
(37)

We consider the parameter set presented in Table 1.

Table 1 The first set of parameters used for code verification and European call option (Kozpınar et al., 2020)

The spatial problem domain is \(\Omega =\left( 0,4\right) \times \left( -2,2\right)\) and it is discretized with 7396 crossed elements and 3785 nodes. Such a discretization results in the minimum element length of \(h=0.1\), and the highest value of the Péclet number is found to be around 1.1 (see Eq. (22)). The time-step size is taken as \(\Delta \tau =0.01\). The scaling parameter Y of YZ\(\beta\) is set to one. The errors in \(L^{2}\)-norm and maximum-norm (\(L^{\infty }\)) are found as \(\Vert U_{\text {true}} - U_{\text {comp}} \Vert _{L^{2}}=0.009412\) and \(\Vert U_{\text {true}} - U_{\text {comp}} \Vert _{L^{\infty }}=0.005534\), respectively, where \(U_{\text {comp}}\) represents the computed solution.

In Fig. 1, the SUPG-YZ\(\beta\) approximation and absolute error associated with it are shown. As desired, it is observed that the shock-capturing and stabilization mechanisms do not introduce excessive artificial diffusion, thereby indicating that the proposed stabilized formulation can also be safely applied to problems where convection does not dominate the governing equations. We compare the performance of the proposed methods in terms of the maximum pointwise absolute errors with degrees of freedom in Fig. 2a. We also compare the errors in Fig. 2b in \(L^{2}(L^{2})\)-norm (i.e., \(L^{2}\)-norm in both space and time; for definition, see Kozpınar et al., 2020). It is observed that all three formulations proposed yield better approximations as the number of elements increases. Finally, it is also noticed that the numerical orders of convergence exhibit similar behavior with those reported in Kozpınar et al. (2020), where the authors employed a SIPG formulation with the CN time-integration using linear interpolation polynomials.

Fig. 1
figure 1

Results for the manufactured solution with parameters given in Table 1: (a) Elevation plot for SUPG-YZ\(\beta\) approximation and (b) absolute error in SUPG-YZ\(\beta\) approximation

Fig. 2
figure 2

Comparison of errors in GFEM, SUPG, and SUPG-YZ\(\beta\) approximations with degrees of freedom for the parameter set given in Table 1: (a) pointwise absolute errors and (b) errors in \(L^{2}(L^{2})\)-norm

5.2 European-Style Call Option

For European-type call option pricing, we assume that the payoff function is given by

$$\begin{aligned} U^{0}(v,x)=\max \left( K\exp (x)-K,0\right) , \end{aligned}$$
(38)

and the spatial computational domain is \(\Omega =\left( 0,4\right) \times \left( -2,2\right)\), as in Kozpınar et al. (2020). It is discretized in space as in the code verification study presented in the preceding subsection. The time-step size is taken as \(\Delta \tau = 0.005\) and advanced until \(\tau =1.0\). The Dirichlet boundary data is given as follows (Kozpınar et al., 2020):

$$\begin{aligned} \left\{ \begin{array}{l} \displaystyle U(\tau , v_{\text {min}}, x) = \max \left( K-K \exp (x), 0\right) , \\ \displaystyle U(\tau , v_{\text {max}}, x) = K \exp (x-r_{f}\tau ), \\ \displaystyle U(\tau , v, x_{\text {min}}) = 0, \\ \displaystyle U(\tau , v, x_{\text {max}}) = \max \left( K\exp (x_{\text {max}}-r_{f}\tau ) - K\exp (-r_{d}\tau ), 0 \right) . \end{array}\right. \end{aligned}$$
(39)

For comparison purposes only, we first consider the parameter set shown in Table 1, which was also taken into consideration in Kozpınar et al. (2020), for European call computations. This is because the set does not produce a case that is computationally challenging enough to assess the performance of the proposed formulation and techniques. To this end, we also consider a much more challenging parameter set given in Table 2. Note that by “challenging,” we mean “convection-dominance.” Recalling the diffusivity matrix \(\textbf{A}\) and convection vector \(\textbf{b}\) defined by Eq. (7) for the Heston model, we select the parameters so that the convection process dominates the diffusion process. Note that the parameters associated with the reversion level (\(\theta\)), volatility of volatility (\(\sigma\)), and correlation (\(\rho\)) presented in Table 2 show significant decrease in magnitude compared to those given in Table 2.

We observe in Fig. 3a that the SUPG-YZ\(\beta\) formulation yields oscillation-free solution profiles for the parameter set given in Table 1. This situation is what we expect since the associated parameter set is not of the type that would lead to convection dominance. We are therefore interested in whether the proposed formulation introduces excessive dissipation into the system. Also, as can be seen from Fig. 3b, the SUPG-YZ\(\beta\) formulation does not result in excessive numerical diffusion when compared to the results obtained with the GFEM and SUPG. In other words, the SUPG-YZ\(\beta\) formulation is almost exclusively activated only when necessary and provides the required amount of artificial numerical diffusion. In other words, the proposed formulation can also be used safely when solving problems that are not dominated by convection phenomena.

Fig. 3
figure 3

European-type option pricing with parameters given in Table 1; \(K=100\): (a) Elevation plot for SUPG-YZ\(\beta\) approximation and (b) comparison of GFEM, SUPG, and SUPG-YZ\(\beta\) approximations along \(x=1.6\)

Table 2 The second set of parameters used for European call option

Figure 4 compares the approximations obtained with the GFEM, SUPG, and SUPG-YZ\(\beta\) formulations for \(K=150\) with the parameter set provided in Table 2, which results in the highest local Péclet number around 350 and is quite challenging compared to what Table 1 yields and to those available in the literature. This value is around 1.62 for the parameter set given in Table 1. We clearly observe from Fig. 4a that the GFEM solution contains spurious oscillations globally spread across the computational domain and from Fig. 4b that the SUPG formulation cannot capture sharp gradients around the corner \((v,x)=(4.0,2.0)\) alone, while the YZ\(\beta\) technique performs quite well without any spurious oscillation (see Fig. 4c). The situation is also illustrated through line plots for \(K=100\) and \(K=150\) in Fig. 5, where \(x=1.6\). We observe that although the SUPG-stabilized formulation yields slightly better solution profiles than the GFEM without any globally-spread spurious oscillation, additional stabilization is required near the boundary, where localized oscillations occur. On the other hand, the SUPG-YZ\(\beta\) formulation gives a smoother solution profile with sufficient crosswind dissipation. We also present the delta (\(\varDelta _{U}\)) and gamma (\(\varGamma _{U}\)) Greeks in Fig. 6. The normalized solution, \(U_{\text {normalized}}\), is obtained by simply dividing the computed solution U by \(K\exp \left( x\right)\).

Fig. 4
figure 4

Comparison of approximations for European-type option pricing with parameters given in Table 2; \(K=150\): (a) GFEM, (b) SUPG, and (c) SUPG-YZ\(\beta\)

Fig. 5
figure 5

Comparison of GFEM, SUPG, and SUPG-YZ\(\beta\) approximations along \(x=1.6\) for European-type option pricing with parameters given in Table 2: (a) \(K=100\) and (b) \(K=150\)

Fig. 6
figure 6

European-type call option gamma and delta Greeks obtained with the SUPG-YZ\(\beta\) formulation for parameter set given in: (a) Table 1 and (b) Table 2; \(K=150\) and \(v=0.35\)

5.3 Digital (Binary) Call Option

Binary options, as their name suggests, are (exotic) options where the payoff is either a predetermined amount or nothing at all. Therefore, as in Lazar (2003) and Kozpınar et al. (2020), we adopt the following discontinuous initial condition (payoff function):

$$\begin{aligned} U^{0}(v,x)={\left\{ \begin{array}{ll} 1, &{} \text {if } \hspace{5.0pt}K\exp (x) - K < 0,\\ 0, &{} \text {if } \hspace{5.0pt}K\exp (x) - K > 0. \end{array}\right. } \end{aligned}$$
(40)

In order to compare the results with those reported in Kozpınar et al. (2020), we take the spatial computational domain as \(\Omega =\left( 0.0025,0.559951\right) \times \left( -5,5\right)\). We discretize \(\Omega\) with 8192 triangular elements and 4257 nodes. The time-step size is set as \(\Delta \tau = 0.005\), and the computations are performed until \(\tau =0.25\). The Dirichlet boundary conditions are given in a similar fashion of Kozpınar et al. (2020) as follows:

$$\begin{aligned} U (\tau , v, x_{\text {min}}) = 0, \qquad U (\tau , v, x_{\text {max}}) =K. \end{aligned}$$
(41)

On the remaining part, homogeneous Neumann boundary conditions apply, i.e.,

$$\begin{aligned} \frac{\partial U }{\partial v} (\tau , v_{\text {min}}, x) = 0, \qquad \frac{\partial U }{\partial v} (\tau , v_{\text {max}}, x) = 0. \end{aligned}$$
(42)

For comparison, we first consider the parameter set given in Table 3, which was also used in Kozpınar et al. (2020) and causes the highest value of the Péclet number, which is defined by Eq. (22), to be around 4. We also perform our computations for the parameter set introduced in Table 4, which yields the highest value of the Péclet number around 5200, i.e., much more challenging to handle in terms of achieving numerical stability due to convection dominance. This is achieved by raising the mean reversion rate (\(\kappa\)) while reducing both the mean reversion level (\(\theta\)) and the volatility of volatility (\(\rho\)) specified in Table 3.

Table 3 The first set of parameters used for digital call option (Kozpınar et al., 2020)

The initial state of the digital option pricing problem is presented in Fig. 7a. The SUPG-YZ\(\beta\) solution to ‘s shown in Fig. 7b. In these two figures, the parameter set given in Table 3 is adopted.

Fig. 7
figure 7

Digital option pricing with parameters given in Table 3; \(K=1\): (a) Initial state and (b) SUPG-YZ\(\beta\) approximation at \(\tau =0.25\)

Table 4 The second set of parameters used for digital call option

Figure 8 compares the digital option pricing approximations obtained by employing the GFEM and SUPG-YZ\(\beta\) for the parameter set introduced in Table 4. While the classical FEM approximation is contaminated by widely dispersed unwanted oscillations, the SUPG-YZ\(\beta\) formulation performs quite well, yielding smooth solution profiles even near very sharp gradients. We also observe from the line plots shown in Fig. 9a that the SUPG and SUPG-YZ\(\beta\) formulations do not introduce excessive diffusion when it is not necessary. Finally, Fig. 9b reveals that the GFEM approximation exhibits spurious oscillations, whereas the SUPG and SUPG-YZ\(\beta\) do not. The delta and gamma sensitivities of the computed solutions associated with the parameter sets presented in Tables 3 and 4 are shown in Fig. 10.

Fig. 8
figure 8

Comparison of approximations obtained for digital option pricing with parameters given in Table 4; \(K=1\): (a) GFEM and (b) SUPG-YZ\(\beta\)

Fig. 9
figure 9

Comparison of GFEM, SUPG, and SUPG-YZ\(\beta\) approximations obtained for digital option pricing along the line \(v=0.35\); \(K=1\): obtained with parameter set given in (a) Table 3 and (b) Table 4

Fig. 10
figure 10

European-type call option gamma and delta Greeks obtained with the SUPG-YZ\(\beta\) formulation for parameter set given in: (a) Table 3 and (b) Table 4; \(K=1\) and \(v=0.25\)

5.4 American-Style Put Option

Here, we deal with the American-type put option pricing problem defined by Eqs. (8)–(10) in Sect. 2. The early exercise feature of American-type requires special treatment since it results in LCPs. As in Kunoth et al. (2012), the spatial computational domain is \(\Omega =\left( 0.0025,0.4975\right) \times \left( -5,5\right)\). We discretize the computational domain with 8, 192 elements and 4, 257 element nodes. The time-step size is set as \(\Delta \tau = 0.001\). The computations are performed until the final time \(\tau =0.25\). We set the penalty parameter, described in Sect. 4.2, as \(\epsilon _\text {pen}=5.0 \times 10^{-3}\) and the penalty constant as \(C_{\text {pen}}=r_{d} K + 1\).

The payoff function is defined as follows:

$$\begin{aligned} U^{0}(v,x) = \max \left( K - K\exp (x), 0 \right) . \end{aligned}$$
(43)

The problem is equipped with boundary conditions that are similar to those in Kunoth et al. (2012) and Zhu and Kopriva (2009), as follows:

$$\begin{aligned} \left\{ \begin{array}{l} \displaystyle U(\tau , v_{\text {min}}, x) = \max \left( K - K\exp (x), 0 \right) , \\ \displaystyle U(\tau , v, x_{\text {min}}) = 0, \\ \displaystyle U(\tau , v, x_{\text {max}}) =K. \end{array}\right. \end{aligned}$$
(44)

On the remaining part of the boundary, homogeneous Neumann-type boundary conditions apply:

$$\begin{aligned} \frac{\partial U }{\partial v} (\tau , v_{\text {max}}, x) = 0. \end{aligned}$$
(45)

For comparison, we consider the parameter set given in Table 5, which was introduced in Clarke and Parrott (1999) and results in Péclet numbers [for definition, see Eq. (22)], with a maximum value of about 6. We also introduce a new set of parameters in Table 6, which causes the maximum value of the Péclet number to be around 820, to test the performance of the proposed formulation under more challenging computational conditions.

Figure 11 shows the initial data as well as the SUPG-YZ\(\beta\) approximation to the American-type put option pricing problem at time \(\tau =0.25\) for the parameter set presented in Table 5. Figure 12a demonstrates that the solution profiles along the line \(v=0.4975\) obtained with the proposed methods agree very well, indicating that the stabilized formulations do not introduce more artificial diffusion than necessary, and the evolution of SUPG-YZ\(\beta\) approximations are compared at various time steps in Fig. 12b along the line \(v=0.25\).

Table 5 The first set of parameters used for American-type put option (Kozpınar et al., 2020)
Fig. 11
figure 11

American-type option pricing with parameters given in Table 5; \(K=10\): (a) Initial state and (b) SUPG-YZ\(\beta\) approximation at \(\tau =0.25\)

Fig. 12
figure 12

American-type option pricing with parameters given in Table 5; \(K=10\) and \(v=0.25\): (a) Comparison of proposed formulations and (b) time evolution of the SUPG-YZ\(\beta\) solution

We also compare our numerical results with those reported in Zvan et al. (1998), Oosterlee (2003), Kunoth et al. (2012) and Kozpınar et al. (2020) for \(\left( v_{0}, x_{0}\right) = \left( 0.25, 0.0\right)\) at \(\tau =0.25\). At this point, our results are: \(U(v_{0}, x_{0})=0.794957\) with the GFEM and \(U(v_{0}, x_{0})=0.795854\) with the SUPG-YZ\(\beta\) formulation, whereas it is reported as \(U(v_{0}, x_{0})=0.7960\) in Oosterlee (2003), as \(U(v_{0}, x_{0})=0.7961\) in Zvan et al. (1998), as 0.794969 with the Gauss–Seidel method and 0.795687 with monotone multigrid methods in Kunoth et al. (2012), and as \(U(v_{0}, x_{0})=0.8042\) with left/right preconditioner in Kozpınar et al. (2020). As a result, it is seen that our results are in good agreement with those reported in the literature.

Fig. 13
figure 13

Effect of the penalty term \(Q_{\text {pen}}\) on function \(U(\tau , v, x)-U^{0}(v,x)\) for American-type option pricing with parameters given in Table 5; \(K=10\) and \(\tau =0.25\): (a) without penalty term and (b) with penalty term

Figure 13 illustrates the effect of the penalty term introduced by Eq. (33) through elevation plots for the function \(U(\tau ,x)-U^{0}(v,x)\) at \(\tau =0.25\). We clearly observe in Fig. 13b that the penalty approach we adopted works well and keeps \(U(\tau ,x) \ge U^{0}(v,x)\) as desired [see Eqs. (8)–(10)]. We also present Fig. 13a obtained without using the penalty term for comparison.

Table 6 The second set of parameters used for American-type put option

We evaluate the proposed formulation with the parameter set given in Table 6, which is the result of modifications corresponding to a decrease in the domestic interest rate and increases in the mean reversion rate and level, as well as the foreign interest rate shown in Table 5. We see from Fig. 14a that, as in the previous challenging cases, the standard Galerkin approach results in spurious oscillations; on the other hand, we observe from Fig. 14b that the approximation obtained with the proposed formulation does not exhibit any significant oscillatory behavior. Eventually, in Fig. 15, we present and compare the computed solutions and associated Greeks for the parameter sets given in Tables 5 and 6. The computed solution U has been divided by K to create the normalized solution in this case.

Fig. 14
figure 14

Comparison of approximations obtained for American-type option pricing with parameters given in Table 6; \(K=10\): (a) GFEM and (b) SUPG-YZ\(\beta\)

Fig. 15
figure 15

European-type call option gamma and delta Greeks obtained with the SUPG-YZ\(\beta\) formulation for parameter set given in: (a) Table 5 and (b) Table 6; \(K=10\) and \(v=0.1\)

6 Conclusions

We have dealt with the pricing of European- and American-type options under Heston’s stochastic volatility model. We have also considered digital options, which fall into the category of exotic options. To this end, we have proposed a SUPG-based stabilized finite element formulation enhanced with a discontinuity-capturing mechanism, called the YZ\(\beta\) technique, for spatial discretization and employed Crank–Nicolson time integration for temporal discretization. Following that, we have evaluated and compared the performances of the proposed method on several benchmark problems existing in the literature, confirming the validity and reliability of the approximations obtained. The results are also compared with those obtained with the GFEM and SUPG formulations, revealing that the SUPG-YZ\(\beta\) does not introduce excessive numerical dissipation. After each benchmark computation, we have assessed the robustness and efficiency of the proposed formulations for parameter sets created for much more challenging computational conditions as well.

Compared to the GFEM and SUPG, which produced several numerical instabilities, our numerical results show that the SUPG-YZ\(\beta\) formulation produces very good solution profiles with no noticeable oscillations. In addition, we have also demonstrated the effectiveness of the penalty approach we employed for simulating American-type options, both visually and by comparing our results with those reported in the literature.

The accurate and oscillation-free solution profiles obtained with the proposed methods and techniques motivate us to extend this current study to multi-asset stochastic models, which result in higher-dimensional computations.