BUG: nearWallFields: incorrect sampling location. Fixes #1464.

It was tracking to find the wanted sampling location. This tracking
was using the offsetted seed point instead of the offsetted wanted
sampling point.
This commit is contained in:
mattijs
2019-10-23 16:26:22 +01:00
committed by Andrew Heather
parent c9c3912e8d
commit 848a63572a
2 changed files with 15 additions and 2 deletions

View File

@ -78,6 +78,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
const vectorField nf(patch.nf()); const vectorField nf(patch.nf());
const vectorField faceCellCentres(patch.patch().faceCellCentres()); const vectorField faceCellCentres(patch.patch().faceCellCentres());
const labelUList& faceCells = patch.patch().faceCells(); const labelUList& faceCells = patch.patch().faceCells();
const vectorField::subField& faceCentres = patch.patch().faceCentres();
forAll(patch, patchFacei) forAll(patch, patchFacei)
{ {
@ -129,7 +130,11 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
start = faceCellCentres[patchFacei]; start = faceCellCentres[patchFacei];
} }
const point end = start-distance_*nf[patchFacei];
// TBD: why use start? and not faceCentres[patchFacei]
//const point end = start-distance_*nf[patchFacei];
const point end = faceCentres[patchFacei]-distance_*nf[patchFacei];
// Add a particle to the cloud with originating face as passive data // Add a particle to the cloud with originating face as passive data
cloud.addParticle cloud.addParticle

View File

@ -62,9 +62,17 @@ void Foam::functionObjects::nearWallFields::createFields
IOobject io(fld); IOobject io(fld);
io.readOpt() = IOobject::NO_READ; io.readOpt() = IOobject::NO_READ;
io.writeOpt() = IOobject::NO_WRITE; io.writeOpt() = IOobject::NO_WRITE;
// Override bc to be calculated
wordList fldTypes(fld.boundaryField().types());
for (const label patchi : patchSet_)
{
fldTypes[patchi] = calculatedFvPatchField<Type>::typeName;
}
io.rename(sampleFldName); io.rename(sampleFldName);
sflds.set(sz, new VolFieldType(io, fld)); sflds.set(sz, new VolFieldType(io, fld, fldTypes));
Log << " created " << sflds[sz].name() Log << " created " << sflds[sz].name()
<< " to sample " << fld.name() << endl; << " to sample " << fld.name() << endl;