  This paper addresses the issue of predicting separated flows with
Reynolds-averaged Navier-Stokes (RANS) turbulence models, which are essential
for many engineering tasks. Traditional RANS models usually struggle with this
task, so recent efforts have focused on data-driven methods such as field
inversion and machine learning (FIML) to correct this issue by adjusting the
baseline equations. However, these FIML methods often reduce accuracy in
attached boundary layers. To address this issue, we developed a "conditioned
field inversion" technique. This method adjusts the corrective factor \b{eta}
(used by FIML) in the shear-stress transport (SST) model. It multiplies \b{eta}
with a shield function f_d that is off in the boundary layer and on elsewhere.
This maintains the accuracy of the baseline model for the attached flows. We
applied both conditioned and classic field inversion to the NASA hump and a
curved backward-facing step (CBFS), creating two datasets. These datasets were
used to train two models: SR-CND (from our new method) and SR-CLS (from the
traditional method). The SR-CND model matches the SR-CLS model in predicting
separated flows in various scenarios, such as periodic hills, the NLR7301
airfoil, the 3D SAE car model, and the 3D Ahmed body, and significantly
outperforms the baseline SST model. Importantly, the SR-CND model maintains
accuracy in the attached boundary layers, whereas the SR-CLS model does not.
Therefore, the proposed method improves separated flow predictions while
maintaining the accuracy of the original model for attached flows, offering a
better way to create data-driven turbulence models.
