2012-09-11 15:42:55 +00:00
|
|
|
// Do "normal" interpolation
|
|
|
|
//volPointInterpolation::interpolate(vf, pf);
|
|
|
|
|
|
|
|
//- interpolation is done just before this file
|
|
|
|
pointVectorField& pf = pointDU;
|
|
|
|
|
|
|
|
|
|
|
|
// Do the correction
|
|
|
|
//GeometricField<Type, pointPatchField, pointMesh> pfCorr
|
2015-05-17 14:25:35 +00:00
|
|
|
/*
|
|
|
|
pointVectorField pfCorr
|
2012-09-11 15:42:55 +00:00
|
|
|
(
|
2015-05-17 14:25:35 +00:00
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
// "edgeCorrectedVolPointInterpolate(" + vf.name() + ")Corr",
|
|
|
|
"edgeCorrectedVolPointInterpolate(" + DU.name() + ")Corr",
|
|
|
|
//vf.instance(),
|
|
|
|
DU,
|
|
|
|
pMesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::NO_WRITE
|
|
|
|
),
|
|
|
|
pMesh,
|
|
|
|
//dimensioned<Type>("zero", pf.dimensions(), pTraits<Type>::zero),
|
|
|
|
dimensionedVector("zero", pf.dimensions(), vector::zero),
|
|
|
|
pf.boundaryField().types()
|
|
|
|
);
|
|
|
|
*/
|
2013-10-11 13:31:14 +00:00
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
pointVectorField pfCorr
|
2012-09-11 15:42:55 +00:00
|
|
|
(
|
2015-05-17 14:25:35 +00:00
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"pointDUcorr",
|
|
|
|
runTime.timeName(),
|
|
|
|
mesh,
|
|
|
|
IOobject::NO_READ,
|
|
|
|
IOobject::NO_WRITE
|
|
|
|
),
|
|
|
|
pMesh,
|
|
|
|
dimensionedVector("vector", dimLength, vector::zero),
|
|
|
|
"calculated"
|
|
|
|
);
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
//const labelList& ptc = boundaryPoints();
|
|
|
|
#include "findBoundaryPoints.H"
|
|
|
|
|
|
|
|
//const FieldField<Field, vector>& extraVecs = extrapolationVectors(); ///*********
|
|
|
|
#include "calculateExtrapolationVectors.H"
|
|
|
|
|
|
|
|
//const FieldField<Field, scalar>& w = pointBoundaryWeights(); ///*********
|
|
|
|
#include "calculatePointBoundaryWeights.H"
|
|
|
|
|
|
|
|
//Info << "w: " << w << endl;
|
|
|
|
|
|
|
|
const labelListList& PointFaces = mesh.pointFaces();
|
|
|
|
|
|
|
|
//const fvBoundaryMesh& bm = mesh.boundary(); // declared in findBoundaryPoints.H
|
|
|
|
|
|
|
|
forAll (ptc, pointI)
|
|
|
|
{
|
2015-05-17 14:25:35 +00:00
|
|
|
const label curPoint = ptc[pointI];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2015-05-17 14:25:35 +00:00
|
|
|
const labelList& curFaces = PointFaces[curPoint];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2015-05-17 14:25:35 +00:00
|
|
|
label fI = 0;
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2015-05-17 14:25:35 +00:00
|
|
|
// Go through all the faces
|
|
|
|
forAll (curFaces, faceI)
|
2015-05-17 15:11:30 +00:00
|
|
|
{
|
2015-05-17 14:25:35 +00:00
|
|
|
if (!mesh.isInternalFace(curFaces[faceI]))
|
2015-05-17 15:11:30 +00:00
|
|
|
{
|
2015-05-17 14:25:35 +00:00
|
|
|
// This is a boundary face. If not in the empty patch
|
|
|
|
// or coupled calculate the extrapolation vector
|
|
|
|
label patchID =
|
|
|
|
mesh.boundaryMesh().whichPatch(curFaces[faceI]);
|
|
|
|
|
|
|
|
if
|
|
|
|
(
|
|
|
|
!isA<emptyFvPatch>(mesh.boundary()[patchID])
|
|
|
|
&& !mesh.boundary()[patchID].coupled()
|
|
|
|
)
|
|
|
|
{
|
|
|
|
label faceInPatchID =
|
|
|
|
bm[patchID].patch().whichFace(curFaces[faceI]);
|
|
|
|
|
|
|
|
pfCorr[curPoint] +=
|
|
|
|
w[pointI][fI]*
|
|
|
|
(
|
|
|
|
extraVecs[pointI][fI]
|
|
|
|
& gradDU.boundaryField()[patchID][faceInPatchID]
|
|
|
|
);
|
|
|
|
|
|
|
|
fI++;
|
|
|
|
}
|
2015-05-17 15:11:30 +00:00
|
|
|
}
|
|
|
|
}
|
2012-09-11 15:42:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Update coupled boundaries
|
2015-05-17 14:25:35 +00:00
|
|
|
/*
|
|
|
|
forAll (pfCorr.boundaryField(), patchI)
|
2012-09-11 15:42:55 +00:00
|
|
|
{
|
2015-05-17 14:25:35 +00:00
|
|
|
if (pfCorr.boundaryField()[patchI].coupled())
|
2012-09-11 15:42:55 +00:00
|
|
|
{
|
2015-05-17 14:25:35 +00:00
|
|
|
pfCorr.boundaryField()[patchI].initAddField();
|
2013-07-18 01:43:15 +00:00
|
|
|
}
|
2015-05-17 14:25:35 +00:00
|
|
|
}
|
|
|
|
*/
|
2012-09-11 15:42:55 +00:00
|
|
|
|
2015-05-17 14:25:35 +00:00
|
|
|
/*
|
|
|
|
forAll (pfCorr.boundaryField(), patchI)
|
2012-09-11 15:42:55 +00:00
|
|
|
{
|
2015-05-17 14:25:35 +00:00
|
|
|
if (pfCorr.boundaryField()[patchI].coupled())
|
2012-09-11 15:42:55 +00:00
|
|
|
{
|
2015-05-17 14:25:35 +00:00
|
|
|
pfCorr.boundaryField()[patchI].addField(pfCorr.internalField());
|
2012-09-11 15:42:55 +00:00
|
|
|
}
|
2015-05-17 14:25:35 +00:00
|
|
|
}
|
|
|
|
*/
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
|
2015-05-17 14:25:35 +00:00
|
|
|
//Info << "pfCorr: " << pfCorr << endl;
|
|
|
|
pfCorr.correctBoundaryConditions();
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
//pfCorr.write();
|
|
|
|
|
|
|
|
//Info << "pf: " << pf << endl;
|
|
|
|
pf += pfCorr;
|
|
|
|
|
|
|
|
//- this was already commented
|
|
|
|
// Replace extrapolated values in pf
|
|
|
|
// forAll (ptc, pointI)
|
|
|
|
// {
|
|
|
|
// pf[ptc[pointI]] = pfCorr[ptc[pointI]];
|
|
|
|
// }
|
|
|
|
|
|
|
|
pf.correctBoundaryConditions();
|
|
|
|
|
|
|
|
//pf.write();
|