boundaryField() -> boundaryFieldRef()

This commit is contained in:
Henry Weller
2016-04-23 23:16:30 +01:00
parent 45f73bf64f
commit 7c12f7743b
26 changed files with 142 additions and 110 deletions

View File

@ -99,13 +99,16 @@ void Foam::nearWallFields::sampleBoundaryField
sampledValues
);
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& fldBf = fld.boundaryFieldRef();
// Pick up data
label nPatchFaces = 0;
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchI = iter.key();
label patchi = iter.key();
fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
fvPatchField<Type>& pfld = fldBf[patchi];
Field<Type> newFld(pfld.size());
forAll(pfld, i)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -223,13 +223,15 @@ void Foam::dsmcFields::write()
const fvMesh& mesh = fDMean.mesh();
volScalarField::GeometricBoundaryField& pBf = p.boundaryFieldRef();
forAll(mesh.boundaryMesh(), i)
{
const polyPatch& patch = mesh.boundaryMesh()[i];
if (isA<wallPolyPatch>(patch))
{
p.boundaryField()[i] =
pBf[i] =
fDMean.boundaryField()[i]
& (patch.faceAreas()/mag(patch.faceAreas()));
}

View File

@ -61,13 +61,13 @@ void Foam::wallShearStress::calcShearStress
{
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchI = iter.key();
const polyPatch& pp = mesh.boundaryMesh()[patchI];
label patchi = iter.key();
const polyPatch& pp = mesh.boundaryMesh()[patchi];
vectorField& ssp = shearStress.boundaryField()[patchI];
const vectorField& Sfp = mesh.Sf().boundaryField()[patchI];
const scalarField& magSfp = mesh.magSf().boundaryField()[patchI];
const symmTensorField& Reffp = Reff.boundaryField()[patchI];
vectorField& ssp = shearStress.boundaryFieldRef()[patchi];
const vectorField& Sfp = mesh.Sf().boundaryField()[patchi];
const scalarField& magSfp = mesh.magSf().boundaryField()[patchi];
const symmTensorField& Reffp = Reff.boundaryField()[patchi];
ssp = (-Sfp/magSfp) & Reffp;
@ -175,11 +175,11 @@ void Foam::wallShearStress::read(const dictionary& dict)
if (patchSet_.empty())
{
forAll(pbm, patchI)
forAll(pbm, patchi)
{
if (isA<wallPolyPatch>(pbm[patchI]))
if (isA<wallPolyPatch>(pbm[patchi]))
{
patchSet_.insert(patchI);
patchSet_.insert(patchi);
}
}
@ -191,17 +191,17 @@ void Foam::wallShearStress::read(const dictionary& dict)
labelHashSet filteredPatchSet;
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchI = iter.key();
if (isA<wallPolyPatch>(pbm[patchI]))
label patchi = iter.key();
if (isA<wallPolyPatch>(pbm[patchi]))
{
filteredPatchSet.insert(patchI);
Info<< " " << pbm[patchI].name() << endl;
filteredPatchSet.insert(patchi);
Info<< " " << pbm[patchi].name() << endl;
}
else
{
WarningInFunction
<< "Requested wall shear stress on non-wall boundary "
<< "type patch: " << pbm[patchI].name() << endl;
<< "type patch: " << pbm[patchi].name() << endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,6 +51,9 @@ void Foam::yPlus::calcYPlus
const fvPatchList& patches = mesh.boundary();
volScalarField::GeometricBoundaryField& yPlusBf =
yPlus.boundaryFieldRef();
forAll(patches, patchi)
{
const fvPatch& patch = patches[patchi];
@ -63,8 +66,8 @@ void Foam::yPlus::calcYPlus
nutBf[patchi]
);
yPlus.boundaryField()[patchi] = nutPf.yPlus();
const scalarField& yPlusp = yPlus.boundaryField()[patchi];
yPlusBf[patchi] = nutPf.yPlus();
const scalarField& yPlusp = yPlusBf[patchi];
const scalar minYplus = gMin(yPlusp);
const scalar maxYplus = gMax(yPlusp);
@ -88,14 +91,14 @@ void Foam::yPlus::calcYPlus
}
else if (isA<wallFvPatch>(patch))
{
yPlus.boundaryField()[patchi] =
yPlusBf[patchi] =
d[patchi]
*sqrt
(
nuEffBf[patchi]
*mag(turbulenceModel.U().boundaryField()[patchi].snGrad())
)/nuBf[patchi];
const scalarField& yPlusp = yPlus.boundaryField()[patchi];
const scalarField& yPlusp = yPlusBf[patchi];
const scalar minYplus = gMin(yPlusp);
const scalar maxYplus = gMax(yPlusp);