integration-cfmesh issueshttps://develop.openfoam.com/Community/integration-cfmesh/-/issues2021-08-09T14:19:48Zhttps://develop.openfoam.com/Community/integration-cfmesh/-/issues/7Meshing the smallest domain in a multi-domain geometry2021-08-09T14:19:48ZBas NieuwboerMeshing the smallest domain in a multi-domain geometry### Functionality to add/problem to solve
Currently it is not possible to mesh the smallest domain in a multi-domain geometry. Cfmesh allways meshes the domain with the largest number of cells. In some cases this is unwanted such as a me...### Functionality to add/problem to solve
Currently it is not possible to mesh the smallest domain in a multi-domain geometry. Cfmesh allways meshes the domain with the largest number of cells. In some cases this is unwanted such as a mesh for the flow between two concentric cylinders. In snappyHexMesh this is solved using the locationInMesh keyword. This is not available in Cfmesh.
### Proposal
Franjo Juretic did implement a basic feature for multi-domain meshing as explained on [cfdonline].
It was pushed to github in a new branch. The commit which enables this is: https://github.com/philippose/cfMesh/commit/7230c449e9a5461a1f0e4aae91bd0117bcd98f26
I’ve implemented this commit in the module of cfMesh for openfoam v2106 and attached the two files that I’ve changed. This allows the use of the keyword: 'allowDisconnectedDomains 1' which is explained in the [cfd online] tread. Problem with this method is that the internal domains are not mapped to the geometry. At least the cellset was not mapped and the resulting mesh using subsetmesh was not snapped to the surface.
As a solution I implemented the keepDomainNumber keyword, which allows you to chose which domain you want to keep. This is not a preferred solution, but it allows you to first visualize all the domains using the allowDisconnectedDomains keyword and in a second attempt mesh the domain number you want to keep.
The best solution would be to implement the locationInMesh keyword. However that is beyond my level to implement.
Using these 2 methods one can view the whole mesh and view the different domains. Then select a single domain using the keepDomainNumber keyword.
### What does success look like, and how can we measure that?
I’ve tested it using an own geometry. One can test it using two concentric cylinders with and without the allowDisconnectedDomains keyword. When enabling the function it should make 2 cell-zones. With the keepDomainNumber keyword you should be able to chose between the two domains.
### Links / references
[cfd online] https://www.cfd-online.com/Forums/openfoam-community-contributions/150500-how-does-cfmesh-determine-region-mesh.html
[checkCellConnectionsOverFaces.C](/uploads/d0d265dbe1ae7ee312685c1afa453ab7/checkCellConnectionsOverFaces.C)
[meshOctreeAddressingCreation.C](/uploads/944475fd0c3ac7102ecd296c65c3229a/meshOctreeAddressingCreation.C)https://develop.openfoam.com/Community/integration-cfmesh/-/issues/2potential sizing issue for DynList2017-11-04T15:30:15ZMark OLESENpotential sizing issue for DynListNot sure if this is intentional or not. For the constructor
DynListCame(label sz)
will set both the allocated size and the addressable area to be `sz`. The `testDytestDynList.C`
https://develop.openfoam.com/Community/integration-...Not sure if this is intentional or not. For the constructor
DynListCame(label sz)
will set both the allocated size and the addressable area to be `sz`. The `testDytestDynList.C`
https://develop.openfoam.com/Community/integration-cfmesh/blob/port-v1712/testingInterfaces/testDynList/testDynList.C#L40
and https://develop.openfoam.com/Community/integration-cfmesh/blob/port-v1712/testingInterfaces/testDynList/testDynList.C#L50
suggests that this may not be intended (the addressable content being any random junk).
I seem to remember having something similar in a very early incarnation of DynamicList, but this form of the constructor got changed to meaning the same as "reserve allocated space, but start with a zero addressable size".
I did a quick check (by temporarily removing this constructor) and it doesn't seem to be used in too too many places. Nonetheless, it could be worth taking a look at.
@Juretic