How to add 2d vtk files as geometrical models
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › How to add 2d vtk files as geometrical models
- This topic has 7 replies, 4 voices, and was last updated 7 months ago by nipinl.
-
AuthorPosts
-
June 14, 2024 at 9:51 am #8822BobbieParticipant
Dear community, how can we import a VTK format file with a 2D geometric model of a complex structure to replace the current simple and regular models in the examples?
June 14, 2024 at 6:48 pm #8826mathiasKeymasterWe dont have a 2d example, but 3d (cf. resolvedRock3d). You can set one dimension to zero in the vtk file or extent OpenLB.
June 15, 2024 at 4:32 am #8830BobbieParticipantThank you for your help. Best wishes!
July 12, 2024 at 8:20 pm #8914nipinlParticipantHi Bobbie,
Have you tried the resolvedRock3d case? or have you tried any geometric model with vtk? Because, I faces some problems in running resolvedRock3d with vti file. Just curious!!
Regards,
NipinJuly 17, 2024 at 1:11 pm #8947janParticipantDear Bobbie,
if your 2D structure can be converted to a VTI, then you can use an approach such as this, which uses the
IndicatorBlockData2D
:std::shared_ptr<BlockVTIreader3D<T, T>> vtiReader( new BlockVTIreader3D<T, T>(vtiFile, "Elevation")); vtiReader->printInfo(); auto cuboidSample = vtiReader->getCuboid(); T deltaRsample = cuboidSample.getDeltaR() * sourceScale; Vector<int, 3> extentSample = cuboidSample.getExtent(); Vector<T, 3> originSamplePhys = cuboidSample.getOrigin() * sourceScale; Vector<T, 3> extentSamplePhys = {deltaRsample * T(extentSample[0] + 0.5), deltaRsample * T(extentSample[1] + 0.5), deltaRsample * T(extentSample[2] + 0.5)}; std::shared_ptr<IndicatorBlockData2D<T>> ind( new IndicatorBlockData2D<T>(vtiReader->getBlockData(), extentSamplePhys, originSamplePhys, deltaRsample, false));
Best regards,
JanJuly 18, 2024 at 9:08 am #8960BobbieParticipantDear Nipin(Nipinl)
You are quite right and the case you mentioned seems incomplete. I have also appeared problems when I tried to make and run it. I’m also trying to improve it, but I haven’t made much progress yet. Perhaps the answer Jan gave is feasible, but I haven’t had a chance to try it. You can try it. And do you have any new findings that I hope we can continue to communicate.
Best regards,
BobbieJuly 18, 2024 at 9:27 am #8963BobbieParticipantDear Jan,
Thank you for sharing your method with great respect! I’ll give it a try and I hope it will succeed.
Best wishes,
BobbieJuly 18, 2024 at 5:10 pm #8969nipinlParticipantHi Bobbie,
I forgot to update here that my issue is resolved. I was writing vti in different format than ascii, which caused the issue. With right format, the simulation is working. I’m new to openLB, and now getting familiar with it going through the examples that are relevant to my case. Happy to communicate.Best Regards,
Nipin -
AuthorPosts
- You must be logged in to reply to this topic.