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

@ -111,7 +111,7 @@ Foam::tmp<Foam::volScalarField> Foam::consumptionSpeed::omega0Sigma
iomega0[celli] = omega0Sigma(sigma[celli], 1.0);
}
volScalarField::GeometricBoundaryField& bomega0 = omega0.boundaryField();
volScalarField::GeometricBoundaryField& bomega0 = omega0.boundaryFieldRef();
forAll(bomega0, patchi)
{

View File

@ -384,11 +384,11 @@ Foam::dynamicRefineFvMesh::refine
}
// Recalculate new boundary faces.
surfaceScalarField::GeometricBoundaryField& bphi =
phi.boundaryField();
forAll(bphi, patchI)
surfaceScalarField::GeometricBoundaryField& phiBf =
phi.boundaryFieldRef();
forAll(phiBf, patchI)
{
fvsPatchScalarField& patchPhi = bphi[patchI];
fvsPatchScalarField& patchPhi = phiBf[patchI];
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
@ -430,7 +430,7 @@ Foam::dynamicRefineFvMesh::refine
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI];
fvsPatchScalarField& patchPhi = phiBf[patchI];
patchPhi[i] = patchPhiU[i];
}
@ -574,8 +574,8 @@ Foam::dynamicRefineFvMesh::unrefine
}
surfaceScalarField& phi = *iter();
surfaceScalarField::GeometricBoundaryField& bphi =
phi.boundaryField();
surfaceScalarField::GeometricBoundaryField& phiBf =
phi.boundaryFieldRef();
const surfaceScalarField phiU
(
@ -610,7 +610,7 @@ Foam::dynamicRefineFvMesh::unrefine
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI];
fvsPatchScalarField& patchPhi = phiBf[patchI];
patchPhi[i] = patchPhiU[i];
}
}

View File

@ -62,7 +62,7 @@ void Foam::fvMeshAdder::MapVolField
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& bfld = fld.boundaryField();
GeometricBoundaryField& bfld = fld.boundaryFieldRef();
{
const labelList& oldPatchMap = meshMap.oldPatchMap();
@ -330,7 +330,7 @@ void Foam::fvMeshAdder::MapSurfaceField
const labelList& oldPatchStarts = meshMap.oldPatchStarts();
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
GeometricBoundaryField& bfld = fld.boundaryField();
GeometricBoundaryField& bfld = fld.boundaryFieldRef();
// Internal field
// ~~~~~~~~~~~~~~

View File

@ -114,7 +114,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
{
fldType& fld = *iter();
typename fldType::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
const FieldField<fvsPatchField, T>& oldBfld = oldBflds[fieldI++];
@ -162,7 +162,7 @@ void Foam::fvMeshDistribute::initPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
forAll(bfld, patchI)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,7 +48,7 @@ void Foam::fvMeshTools::addPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
label sz = bfld.size();
bfld.setSize(sz+1);
@ -102,7 +102,7 @@ void Foam::fvMeshTools::setPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
if (patchFieldDict.found(fld.name()))
{
@ -141,7 +141,7 @@ void Foam::fvMeshTools::setPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
bfld[patchI] == value;
}
@ -160,7 +160,7 @@ void Foam::fvMeshTools::trimPatchFields(fvMesh& mesh, const label nPatches)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
GeoField& fld = *iter();
fld.boundaryField().setSize(nPatches);
fld.boundaryFieldRef().setSize(nPatches);
}
}
@ -183,7 +183,7 @@ void Foam::fvMeshTools::reorderPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
bfld.reorder(oldToNew);
}

View File

@ -428,14 +428,17 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
pointVectorField& displacement
)
{
typename pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef();
// Adapt the fixedValue bc's (i.e. copy internal point data to
// boundaryField for all affected patches)
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
label patchi = patchIDs[i];
displacement.boundaryField()[patchI] ==
displacement.boundaryField()[patchI].patchInternalField();
displacementBf[patchi] ==
displacementBf[patchi].patchInternalField();
}
// Make consistent with non-adapted bc's by evaluating those now and
@ -449,18 +452,18 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
forAll(patchSchedule, patchEvalI)
{
label patchI = patchSchedule[patchEvalI].patch;
label patchi = patchSchedule[patchEvalI].patch;
if (!adaptPatchSet.found(patchI))
if (!adaptPatchSet.found(patchi))
{
if (patchSchedule[patchEvalI].init)
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.initEvaluate(Pstream::scheduled);
}
else
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.evaluate(Pstream::scheduled);
}
}
@ -474,10 +477,10 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
// by multi-corner constraints into account.
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
label patchi = patchIDs[i];
displacement.boundaryField()[patchI] ==
displacement.boundaryField()[patchI].patchInternalField();
displacementBf[patchi] ==
displacementBf[patchi].patchInternalField();
}
}
@ -581,21 +584,24 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule();
typename pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef();
// 1. evaluate on adaptPatches
forAll(patchSchedule, patchEvalI)
{
label patchI = patchSchedule[patchEvalI].patch;
label patchi = patchSchedule[patchEvalI].patch;
if (adaptPatchSet.found(patchI))
if (adaptPatchSet.found(patchi))
{
if (patchSchedule[patchEvalI].init)
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.initEvaluate(Pstream::blocking);
}
else
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.evaluate(Pstream::blocking);
}
}
@ -605,18 +611,18 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
// 2. evaluate on non-AdaptPatches
forAll(patchSchedule, patchEvalI)
{
label patchI = patchSchedule[patchEvalI].patch;
label patchi = patchSchedule[patchEvalI].patch;
if (!adaptPatchSet.found(patchI))
if (!adaptPatchSet.found(patchi))
{
if (patchSchedule[patchEvalI].init)
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.initEvaluate(Pstream::blocking);
}
else
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.evaluate(Pstream::blocking);
}
}
@ -757,9 +763,9 @@ Foam::tmp<Foam::pointField> Foam::motionSmootherAlgo::curPoints() const
{
const pointBoundaryMesh& pbm = displacement_.mesh().boundary();
actualPatchTypes.setSize(pbm.size());
forAll(pbm, patchI)
forAll(pbm, patchi)
{
actualPatchTypes[patchI] = pbm[patchI].type();
actualPatchTypes[patchi] = pbm[patchi].type();
}
}
@ -768,17 +774,17 @@ Foam::tmp<Foam::pointField> Foam::motionSmootherAlgo::curPoints() const
const pointVectorField::GeometricBoundaryField& pfld =
displacement_.boundaryField();
actualPatchFieldTypes.setSize(pfld.size());
forAll(pfld, patchI)
forAll(pfld, patchi)
{
if (isA<fixedValuePointPatchField<vector>>(pfld[patchI]))
if (isA<fixedValuePointPatchField<vector>>(pfld[patchi]))
{
// Get rid of funny
actualPatchFieldTypes[patchI] =
actualPatchFieldTypes[patchi] =
fixedValuePointPatchField<vector>::typeName;
}
else
{
actualPatchFieldTypes[patchI] = pfld[patchI].type();
actualPatchFieldTypes[patchi] = pfld[patchi].type();
}
}
}
@ -847,14 +853,14 @@ bool Foam::motionSmootherAlgo::scaleMesh
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
Pout<< "Entering scaleMesh : coupled patches:" << endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const coupledPolyPatch& pp =
refCast<const coupledPolyPatch>(patches[patchI]);
refCast<const coupledPolyPatch>(patches[patchi]);
Pout<< '\t' << patchI << '\t' << pp.name()
Pout<< '\t' << patchi << '\t' << pp.name()
<< " parallel:" << pp.parallel()
<< " separated:" << pp.separated()
<< " forwardT:" << pp.forwardT().size()
@ -1034,20 +1040,20 @@ void Foam::motionSmootherAlgo::updateMesh()
// Check whether displacement has fixed value b.c. on adaptPatchID
forAll(adaptPatchIDs_, i)
{
label patchI = adaptPatchIDs_[i];
label patchi = adaptPatchIDs_[i];
if
(
!isA<fixedValuePointPatchVectorField>
(
displacement_.boundaryField()[patchI]
displacement_.boundaryField()[patchi]
)
)
{
FatalErrorInFunction
<< "Patch " << patches[patchI].name()
<< "Patch " << patches[patchi].name()
<< " has wrong boundary condition "
<< displacement_.boundaryField()[patchI].type()
<< displacement_.boundaryField()[patchi].type()
<< " on field " << displacement_.name() << nl
<< "Only type allowed is "
<< fixedValuePointPatchVectorField::typeName

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
@ -71,7 +71,8 @@ void Foam::fvMotionSolverEngineMesh::move()
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
motionSolver_.pointMotionU().boundaryField()[pistonIndex_] == pistonSpeed;
motionSolver_.pointMotionU().boundaryFieldRef()[pistonIndex_] ==
pistonSpeed;
{
scalarField linerPoints
@ -79,7 +80,7 @@ void Foam::fvMotionSolverEngineMesh::move()
boundary()[linerIndex_].patch().localPoints().component(vector::Z)
);
motionSolver_.pointMotionU().boundaryField()[linerIndex_] ==
motionSolver_.pointMotionU().boundaryFieldRef()[linerIndex_] ==
pistonSpeed*pos(deckHeight_.value() - linerPoints)
*(deckHeight_.value() - linerPoints)
/(deckHeight_.value() - pistonPlusLayers);

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

View File

@ -223,7 +223,7 @@ void Foam::displacementComponentLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
Foam::solve
(

View File

@ -121,7 +121,7 @@ void Foam::velocityComponentLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointMotionU_.boundaryField().updateCoeffs();
pointMotionU_.boundaryFieldRef().updateCoeffs();
Foam::solve
(

View File

@ -121,7 +121,7 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
surfaceScalarField Df(diffusivityPtr_->operator()());

View File

@ -227,7 +227,7 @@ void Foam::displacementLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivity().correct();
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
Foam::solve
(

View File

@ -525,7 +525,7 @@ void Foam::displacementLayeredMotionMotionSolver::solve()
movePoints(mesh().points());
// Apply boundary conditions
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
// Solve motion on all regions (=cellZones)
const dictionary& regionDicts = coeffDict().subDict("regions");

View File

@ -116,7 +116,7 @@ void Foam::velocityLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointMotionU_.boundaryField().updateCoeffs();
pointMotionU_.boundaryFieldRef().updateCoeffs();
Foam::solve
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -127,9 +127,12 @@ void Foam::inverseFaceDistanceDiffusivity::correct()
faceDiffusivity_[faceI] = 1.0/sqrt(dist);
}
forAll(faceDiffusivity_.boundaryField(), patchI)
typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
faceDiffusivity_.boundaryFieldRef();
forAll(faceDiffusivityBf, patchI)
{
fvsPatchScalarField& bfld = faceDiffusivity_.boundaryField()[patchI];
fvsPatchScalarField& bfld = faceDiffusivityBf[patchI];
const labelUList& faceCells = bfld.patch().faceCells();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -152,9 +152,13 @@ void Foam::inversePointDistanceDiffusivity::correct()
faceDiffusivity_[faceI] = 1.0/dist;
}
forAll(faceDiffusivity_.boundaryField(), patchI)
typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
faceDiffusivity_.boundaryFieldRef();
forAll(faceDiffusivityBf, patchI)
{
fvsPatchScalarField& bfld = faceDiffusivity_.boundaryField()[patchI];
fvsPatchScalarField& bfld = faceDiffusivityBf[patchI];
if (patchSet.found(patchI))
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -95,7 +95,7 @@ void Foam::fv::limitTemperature::correct(volScalarField& he)
// handle boundaries in the case of 'all'
if (selectionMode_ == smAll)
{
volScalarField::GeometricBoundaryField& bf = he.boundaryField();
volScalarField::GeometricBoundaryField& bf = he.boundaryFieldRef();
forAll(bf, patchi)
{

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
@ -197,7 +197,7 @@ void Foam::ParticleErosion<CloudType>::postPatch
const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_);
const label patchFaceI = pp.whichFace(p.face());
scalar& Q = QPtr_->boundaryField()[patchI][patchFaceI];
scalar& Q = QPtr_->boundaryFieldRef()[patchI][patchFaceI];
if (tan(alpha) < K_/6.0)
{
Q += coeff*(sin(2.0*alpha) - 6.0/K_*sqr(sin(alpha)));

View File

@ -204,7 +204,7 @@ bool Foam::LocalInteraction<CloudType>::correct
{
label pI = pp.index();
label fI = pp.whichFace(p.face());
massEscape().boundaryField()[pI][fI] += dm;
massEscape().boundaryFieldRef()[pI][fI] += dm;
}
break;
}
@ -221,7 +221,7 @@ bool Foam::LocalInteraction<CloudType>::correct
{
label pI = pp.index();
label fI = pp.whichFace(p.face());
massStick().boundaryField()[pI][fI] += dm;
massStick().boundaryFieldRef()[pI][fI] += dm;
}
break;
}

View File

@ -102,7 +102,7 @@ void Foam::displacementMeshMoverMotionSolver::solve()
movePoints(mesh().points());
// Update any point motion bcs (e.g. timevarying)
pointDisplacement().boundaryField().updateCoeffs();
pointDisplacement().boundaryFieldRef().updateCoeffs();
label nAllowableErrors = 0;
labelList checkFaces(identity(mesh().nFaces()));

View File

@ -199,7 +199,6 @@ void Foam::meshRefinement::collectAndPrint
}
//template<class T, class Mesh>
template<class GeoField>
void Foam::meshRefinement::addPatchFields
(
@ -215,11 +214,12 @@ void Foam::meshRefinement::addPatchFields
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = fld.boundaryField();
typename GeoField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
label sz = bfld.size();
bfld.setSize(sz+1);
bfld.set
label sz = fldBf.size();
fldBf.setSize(sz+1);
fldBf.set
(
sz,
GeoField::PatchFieldType::New
@ -233,7 +233,6 @@ void Foam::meshRefinement::addPatchFields
}
// Reorder patch field
template<class GeoField>
void Foam::meshRefinement::reorderPatchFields
(
@ -248,10 +247,7 @@ void Foam::meshRefinement::reorderPatchFields
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = fld.boundaryField();
bfld.reorder(oldToNew);
iter()->boundaryFieldRef().reorder(oldToNew);
}
}

View File

@ -2657,6 +2657,10 @@ bool Foam::snappyLayerDriver::writeLayerData
fixedValueFvPatchScalarField::typeName
);
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
@ -2667,7 +2671,7 @@ bool Foam::snappyLayerDriver::writeLayerData
{
pfld[i] = cellNLayers[faceCells[i]];
}
fld.boundaryField()[patchI] == pfld;
fldBf[patchI] == pfld;
}
Info<< indent << fld.name() << " : actual number of layers"
<< endl;
@ -2690,11 +2694,16 @@ bool Foam::snappyLayerDriver::writeLayerData
dimensionedScalar("zero", dimless, 0),
fixedValueFvPatchScalarField::typeName
);
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
fld.boundaryField()[patchI] == pbm[patchI].patchSlice
fldBf[patchI] == pbm[patchI].patchSlice
(
faceRealThickness
);
@ -2720,7 +2729,12 @@ bool Foam::snappyLayerDriver::writeLayerData
dimensionedScalar("zero", dimless, 0),
fixedValueFvPatchScalarField::typeName
);
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
@ -2744,7 +2758,7 @@ bool Foam::snappyLayerDriver::writeLayerData
}
}
fld.boundaryField()[patchI] == pfld;
fldBf[patchI] == pfld;
}
Info<< indent << fld.name()
<< " : overall layer thickness (fraction"

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);