View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003598||OpenFOAM||Feature||public||2020-11-23 19:30||2020-11-24 17:13|
|Fixed in Version||dev|
|Summary||0003598: distanceSurface -based sampling not implementing zones|
|Description||I noticed that zoneKey_ is created in constructor of "distanceSurface.C" but it is not updated anywhere, yielding no action when "zone" keyword is used in sampledSurface dictionary entry. |
I'd imagine one could implement the zoneKey_ treatment similar to other xSurface methods?
|Tags||No tags attached.|
> I'd imagine one could implement the zoneKey_ treatment similar to other xSurface methods?
Probably, have you tried?
||Not yet, just noticed this and decided to report first. I'll give it a go.|
||Do you need it?|
When using distanceSurface together with e.g. searchableCylinder object with an ambition to sample data only on the cylinder side, you will get the top / bottom cylinder discs included as well as expected from the searchableCylinder implementation, which biases e.g. areaAverage etc. functionObject results. I was hoping to achieve separation between top/bottom discs and side surface by defining cell-zones such that discs wouldn't be sampled.
Of course one option is to modify the searchable-objects but they seem more difficult and brittle pieces of code compared to zone modification.
As an attachment you find an implementation for which I added zone-capability following the approach used in "sampledCuttingPlane" class. I tested it for my particular case at hand and it worked as intended.
distanceSurface.tar.gz (5,029 bytes)
||One of the constructors is commented-out, is there a reason for that?|
commit a00831687097d0c19d1ca431cfd7e68dee3fc265 (HEAD -> master, origin/master, origin/HEAD)
Author: Henry Weller <http://cfd.direct>
Date: Tue Nov 24 16:25:47 2020 +0000
sampledSurface::distanceSurface: Added zone support using zoneKey
combining functionality from sampledCuttingPlane and sampledPlane.
Updated sampledCuttingPlane to use zoneKey.
I think it would be best if the zone sub-setting were abstracted so that it can be applied to the other sampledSurfaces, in particular sampledIsoSurface, without further code duplication.
I do not have any test cases setup for these changes, please let me know if they work correctly.
||Even better would be to rewrite the iso-surface algorithm on which the sampledCuttingPlane and distanceSurface are based to operate directly on a cell-set to avoid the inefficient mesh sub-setting.|
Tested your implementation and it works as intended with my present case (unfortunately can't share it publicly).
Regarding the other constructor, I had left it commented by accident because didn't see it being used and wanted to minimize changes on my first implementation. I tested your implementation by adding the the second constructor as it was earlier, and expectedly, it still compiles and works as intended.
Thanks for the work!
|2020-11-23 19:30||peksa||New Issue|
|2020-11-23 19:49||henry||Note Added: 0011745|
|2020-11-23 19:53||peksa||Note Added: 0011746|
|2020-11-23 21:17||henry||Note Added: 0011748|
|2020-11-23 22:23||peksa||Note Added: 0011749|
|2020-11-24 14:22||peksa||File Added: distanceSurface.tar.gz|
|2020-11-24 14:22||peksa||Note Added: 0011751|
|2020-11-24 15:32||henry||Note Added: 0011754|
|2020-11-24 16:32||henry||Note Added: 0011756|
|2020-11-24 16:57||henry||Note Added: 0011757|
|2020-11-24 17:03||peksa||Note Added: 0011758|
|2020-11-24 17:12||henry||Assigned To||=> henry|
|2020-11-24 17:12||henry||Status||new => resolved|
|2020-11-24 17:12||henry||Resolution||open => fixed|
|2020-11-24 17:12||henry||Fixed in Version||=> dev|
|2020-11-24 17:13||henry||Category||Bug => Feature|