ENH: use simpler lookupPatchField form

This commit is contained in:
Mark Olesen
2023-01-02 09:33:00 +01:00
parent 35dae3fc3b
commit 27a7ae2d1d
94 changed files with 325 additions and 517 deletions

View File

@ -89,17 +89,10 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs()
return;
}
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>("phi");
const fvsPatchField<scalar>& phiap =
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
const fvPatchField<vector>& Up =
patch().lookupPatchField<volVectorField, vector>("U");
const fvPatchField<vector>& Uap =
patch().lookupPatchField<volVectorField, vector>("Ua");
const auto& phip = patch().lookupPatchField<surfaceScalarField>("phi");
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
const auto& Up = patch().lookupPatchField<volVectorField>("U");
const auto& Uap = patch().lookupPatchField<volVectorField>("Ua");
operator==((phiap/patch().magSf() - 1.0)*phip/patch().magSf() + (Up & Uap));

View File

@ -90,11 +90,8 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
return;
}
const fvsPatchField<scalar>& phiap =
patch().lookupPatchField<surfaceScalarField, scalar>("phia");
const fvPatchField<vector>& Up =
patch().lookupPatchField<volVectorField, vector>("U");
const auto& phiap = patch().lookupPatchField<surfaceScalarField>("phia");
const auto& Up = patch().lookupPatchField<volVectorField>("U");
scalarField Un(mag(patch().nf() & Up));
vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL));