I would like to understand the probabilistic interpretation of the following elliptic problem with mixed Dirichlet-Neumann boundary conditions:

Let $B := \{ x \in \mathbb{R}^n, \quad \| x \|_2 \leq 1 \}, n \geq 1$. We assume that the boundary of $B$ is composed of two disjoint subsets : $\partial B = \Gamma_N \cup \Gamma_D$. Consider $\lambda>0,\ f \in \mathcal{C}(\bar{B}), g \in \mathcal{C}(\partial B)$ and $u$ satisfying \begin{align} \lambda u - \frac{1}{2} \Delta u & = f \quad \mbox{in} \quad B,\\ u & = g \quad \mbox{in} \quad \Gamma_D,\\ \frac{\partial u}{\partial n} & = 0 \quad \mbox{in} \quad \Gamma_N. \end{align}

I believe that it is a stopping problem for a reflected Wiener process, in the sense that \begin{equation} u(x) = \mathbb{E} \left ( \int_0^\tau \exp(-\lambda t) f(\beta(t)) dt \right ) + \mathbb{E} \exp(-\lambda \tau) g(\beta(\tau)) \end{equation} where \begin{align} & d \beta(t) \in \partial \mathbf{1}_\bar{B} (\beta(t)) + d w(t)\\ & \tau = \inf \{ t>0, \quad \beta(t) \in \Gamma_D \}. \end{align} here $\mathbf{1}_\bar{B}(x) = 0$ if $x \in \bar{B}$ and $\infty$ otherwise. Also, $w(t)$ is Wiener process. If it is correct, how to establish it rigorously?

thanks for your help!

\begin{equation} \star \star \star \end{equation} Let me comment the purely Dirichlet case / stopped case. We keep working with the domain $B$ and the functions $f$ and $g$. Consider $u$ satisfying \begin{align} \lambda u - \frac{1}{2} \Delta u & = f \quad \mbox{in} \quad B,\\ u & = g \quad \mbox{in} \quad \partial B. \end{align} So, if we define \begin{equation} \tau_B = \inf \{ t > 0, \quad w(t) \in \partial B \} \end{equation} which is known to satisfy $\mathbb{E} \tau_B = \frac{1-|x|^2}{n} < \infty$ then Dynkin formula (rigorously speaking we need $u \in \mathcal{C}^2$) tells us that \begin{equation} u(x) = \mathbb{E} \exp(-\lambda \tau_B) g(x+w(\tau_B)) + \mathbb{E} \int_0^{\tau_B} \exp(-\lambda s) f(x+w(s)) ds. \end{equation} \begin{equation} \star \star \star \end{equation}