  Within the context of machine learning-based closure mappings for RANS
turbulence modelling, physical realizability is often enforced using ad-hoc
postprocessing of the predicted anisotropy tensor. In this study, we address
the realizability issue via a new physics-based loss function that penalizes
non-realizable results during training, thereby embedding a preference for
realizable predictions into the model. Additionally, we propose a new framework
for data-driven turbulence modelling which retains the stability and
conditioning of optimal eddy viscosity-based approaches while embedding
equivariance. Several modifications to the tensor basis neural network to
enhance training and testing stability are proposed. We demonstrate the
conditioning, stability, and generalization of the new framework and model
architecture on three flows: flow over a flat plate, flow over periodic hills,
and flow through a square duct. The realizability-informed loss function is
demonstrated to significantly increase the number of realizable predictions
made by the model when generalizing to a new flow configuration. Altogether,
the proposed framework enables the training of stable and equivariant
anisotropy mappings, with more physically realizable predictions on new data.
We make our code available for use and modification by others.
