  We propose a data-driven, closure model for Reynolds-averaged Navier-Stokes
(RANS) simulations that incorporates aleatoric, model uncertainty. The proposed
closure consists of two parts. A parametric one, which utilizes previously
proposed, neural-network-based tensor basis functions dependent on the rate of
strain and rotation tensor invariants. This is complemented by latent, random
variables which account for aleatoric model errors. A fully Bayesian
formulation is proposed, combined with a sparsity-inducing prior in order to
identify regions in the problem domain where the parametric closure is
insufficient and where stochastic corrections to the Reynolds stress tensor are
needed. Training is performed using sparse, indirect data, such as mean
velocities and pressures, in contrast to the majority of alternatives that
require direct Reynolds stress data. For inference and learning, a Stochastic
Variational Inference scheme is employed, which is based on Monte Carlo
estimates of the pertinent objective in conjunction with the reparametrization
trick. This necessitates derivatives of the output of the RANS solver, for
which we developed an adjoint-based formulation. In this manner, the parametric
sensitivities from the differentiable solver can be combined with the built-in,
automatic differentiation capability of the neural network library in order to
enable an end-to-end differentiable framework. We demonstrate the capability of
the proposed model to produce accurate, probabilistic, predictive estimates for
all flow quantities, even in regions where model errors are present, on a
separated flow in the backward-facing step benchmark problem.
