Commit 848a6357 authored by mattijs's avatar mattijs Committed by Andrew Heather
Browse files

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.
parent c9c3912e
......@@ -78,6 +78,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
const vectorField nf(patch.nf());
const vectorField faceCellCentres(patch.patch().faceCellCentres());
const labelUList& faceCells = patch.patch().faceCells();
const vectorField::subField& faceCentres = patch.patch().faceCentres();
forAll(patch, patchFacei)
{
......@@ -129,7 +130,11 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
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
cloud.addParticle
......
......@@ -62,9 +62,17 @@ void Foam::functionObjects::nearWallFields::createFields
IOobject io(fld);
io.readOpt() = IOobject::NO_READ;
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);
sflds.set(sz, new VolFieldType(io, fld));
sflds.set(sz, new VolFieldType(io, fld, fldTypes));
Log << " created " << sflds[sz].name()
<< " to sample " << fld.name() << endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment