[Tutorial] – Cylinder 3d – Geometry beginner question
March 11, 2022 at 11:54 am #6377SimonVParticipant
Dear OpenLB community,
I start discovering the OpenLB tool and I have some trouble to understand the “cylinder3d.cpp” file, specialy the geometry part from prepareGeometry function.
In order to understand the input parameters, I started by importing the cylinder3d.stl file within freeCad to get the 3D representation of the computational domain. What I get is:
a) (0,0,0) point is located at the bottom right corner of the inlet face
b) channel length (x-direction): 2.5m (x0.001 in main function)
b) channel depth (y-direction): 0.41m (x0.001 in main function)
c) channel height (z-direction): 0.41m (x0.001 in main function)
d) cylinder center (x,y) : (0.5m, 0.2m) (x0.001 in main function)
e) cylinder diamer : 0.1m (x0.001 in main function)
Knowing those infos, I tried to understand the prepareGeometry function.
The origin of the domain obtained from the superGeometry.getStatistics().getMinPhysR( 2 ), which turns to be [-0.0075 -0.0025 -0.0025] and not [0 0 0]. Is this due to the cuboid representation of the input geometry? Nevertheless the y and z values of the origin are immediately increased by 0.001/2. Is this “slight” shift performed to be sure that the orgin point is “in front” of the channel entry? Is this shift being determined based on the “Resolution parameters” and “conversion factors”, i.e. physDeltaX=0.01 / N=10 = 0.001?
In the same idea, the extend point obtained from superGeometry.getStatistics().getMaxPhysR( 2 ) is equal to [2.5025 0.4175 0.4175] and not [2.5, 0.41, 0.41] as initially expected. But when combined with the “origin”, we get a total dimensions of 2.51m following x-direction, 0.42m following y and z directions. Is this “extra” 0.01m linked with the physDeltaX=0.01 information?
Looking at the definition of the inflow, it extends from [-0.0175 0.0025 0.0025] to [0.02 0.41 0.41] where the x-value of the “end” point is also determined from 2*converter.getConversionFactorLength(); Is this box defined in order to be sure that only the first voxel layer is selected and labelled as “inflow”?
Regarding the outlfow the situation is tricker to me as it extends from [2.4925 0.0025 0.0025] to [0.02 0.41 0.41], i.e. all the domain excepts the inflow… Should it always be like that? This situation seems a bite contradictory to what is shown in Fig5.2 of the documentation.
Then regarding the cylinder, it extends [0.0025 0.0025 0.0025] to [1.255 0.41 0.41] which is quite larger than the actual cylinder defined in the geometry.
I am quite sure that I am missing something fondamental there, I am sorry for that. I just started learning LBM approach…
Thank you in advance for your help.March 14, 2022 at 12:30 pm #6379AdrianKeymaster
Yes, the physical simulation domain described by the cuboid geometry is slightly larger than the STL to ensure that the boundaries can be correctly represented as cells.
Specifically lines 336-337
STLreader<T> stlReader( "cylinder3d.stl", converter.getConversionFactorLength(), 0.001 ); IndicatorLayer3D<T> extendedDomain( stlReader, converter.getConversionFactorLength() );
extend the STL geometry by a single cell layer. This extended domain is then used as the input for constructing the actual cuboid geometry.
You are on point w.r.t. the reason for shifting the physical locations used for setting up the material geometry to fit physical locations. (First voxel layer as inflow, last as outflow and so on). It can be tricky to set this up in a way so that the material geometry relates to the input STL geometry as expected.
For the outflow the location [2.4925 0.0025 0.0025] is the origin of the outflow subdomain which extends [0.02 0.41 0.41] from there. This way only the last cell layer is changed from material 2 to 4 (line 96).
For the cylinder it is important not to mix up the physical indicator (IndicatorCuboid3d, line 101) used to select a subdomain of the material geometry with the actual cylinder. Notably the indicator
cylinderis actually a cuboid here which works as the following
renamecall (line 102) only changes cells with material 2 to material 5, ignoring any bulk cells. This way the cylinder boundary is changed to material 5 (the entire STL boundary was previously set to material 2 in lines 74-75).
I hope that this helps! When getting started it can be useful to only execute parts of the geometry setup and check out the resulting material numbers in ParaView.
- You must be logged in to reply to this topic.