diff --git a/src/functionObjects/field/nearWallFields/nearWallFields.C b/src/functionObjects/field/nearWallFields/nearWallFields.C index e89fa2984868551883e27333906f0fda89d61736..c243a71ab82b345edafd34403e338e6b1fa44ee8 100644 --- a/src/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/functionObjects/field/nearWallFields/nearWallFields.C @@ -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 diff --git a/src/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C b/src/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C index 667ea7e1dcb5d66bc73c9d3c32efcab33a0088ab..b6a93f5b175682f56fed6317b7c2a734d5ab9afd 100644 --- a/src/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C +++ b/src/functionObjects/field/nearWallFields/nearWallFieldsTemplates.C @@ -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;