mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user