Thanks for the video......I'm using blender 2.81 I wrote a little python script to change the titles, put it in the directory where your stl's are and it creates a subdirectory that has the components renamed and a combined stl file, copy and paste this into a file such as fixName.py and run with python fixNames.py: import glob,os def fixFile(filename,outf,subdir): head,tail=os.path.split(filename) outFn=os.path.join(head,subdir,tail) file_name = os.path.basename(filename) partName=tail.rsplit('.')[0] print partName,"outFn='%s'"%outFn with open(filename) as inf: with open(outFn,"wb") as out2: for l in inf: # inf.readline(): if l.startswith("solid"): l="solid %s "%partName if l.startswith("endsolid"): l="endsolid %s "%partName print >>outf,l, print >>out2,l, #outf.write(l) outFn="combined.stl" files=[f for f in glob.glob("*.stl") if not f.startswith(outFn)] dirname="retitled" os.makedirs(dirname) with open(outFn,"wb") as outf: #fixFile("rightEar.stl",outf) for f in files: fixFile(f,outf,dirname)
Thank you @Elden Crom, was going to write my self. I just made compatible for python 3 import glob import os def fixFile(filename, outf, subdir): head, tail = os.path.split(filename) outFn = os.path.join(head, subdir, tail) file_name = os.path.basename(filename) partName = tail.rsplit('.')[0] print(partName, "outFn='%s'" % outFn) with open(filename) as inf: with open(outFn, "w") as out2: for l in inf: # inf.readline(): if l.startswith("solid"): l = "solid %s " % partName if l.startswith("endsolid"): l = "endsolid %s " % partName print(l, file=outf, end='') # >>outf, l, print(l, file=out2, end='') # >>out2, l, # outf.write(l) # out2.write(l) # outf.write(l) outFn = "combined.stl" files = [f for f in glob.glob("*.stl") if not f.startswith(outFn)] dirname = "retitled" os.makedirs(dirname) with open(outFn, "w") as outf: # fixFile("rightEar.stl",outf) for f in files: fixFile(f, outf, dirname)
Great video. One update is that this add-in is part of the current version of blender, so you may want to update with note and hyperlink to click ahead because the rheologic explanation is not not needed.
Hi Keith, Do you still access this add-in in the same fashion as the video shows? I don't seem to see this in my version of blender (2.83.1) when trying to search it like the video shows. Thanks!
I know this is an older video. Jozsef or others, if you happen to see this message, can you confirm for me if the Andrew Price RUclips tutorials you refer too are posted under the name: Blender Guru? If you (Jozsef) are recommending Blender tutorials I want to make sure I am watching the correct ones.
really nice tutorial, but what about the units, if I import a cad model in blender or Salome, what will be the effect on the units. I am using Salome now and the defaults units are in meters, so if I export the .stl file for snappyHexMesh will the units still be in meters or I have to change manually.
Hi! So I’m very new to all of this. How would I take my combined stl file and use it for a simulation in open foam. My goal is to have a simulation that shows the aerodynamic flow around the monkey head within the wind tunnel cube as you had created in the video.
Hi József. I am a complete newbie to OpenFOAM and am mainly interested in modelling fluid flow through porous materials. Basically, we have a tube filled with fibres, which creates a fairly complex geometry that comes from SEM images. What free tools could import XYZ coordinate files and create an input geometry for OpenFOAM? Thank you very much!
while exporting through Rheo stl, do we have to change the scale from 1 to 0.001 in order to convert to m. because i do it after importing from CAD to blender i change my scale from 1 to 0.001 to make it into m.
Thank you for the tutorial. Rheologic blender export add on is not supported by blender 2.8x and the STL export capability in blender generates separate STL files with wrong headers: "Solid Exported from blender...". Any suggestion on how to create STL files with correct solid name? Thank you
hello Jozsef, To import the geometry to openFOAM, is it neccesary to define the inlets, outlets and walls before? I am using inventor, can I do that there?
Hi sir I have a question here. Need to ask for your help. okay. let say I have a 3d CAD model of a car, and i want to run the simulation using OpenFOAM. Can I know, what softwares that is needed in the process to get to know about the aerodynamic of the car. And a bit explanation if possible. Thank you sir, I just confused on what is the software needed to solve this.
dear Jozsef, I am having trouble with this tutorial at minute 15.12 you combine all the .stls to one with the following line "cat *.stl >> combined.stl" my issue is that the combine.stl is opened in ParaView correctly but any other program I use to see .stl tells me that the STL file is broken (needs reparation). for the test, I was using surfaces (not solids) for example, divided a cube in its 6 surfaces and exported each of them in separate .stls, and tried to combine them to create the cube. ( i don't know if using only surfaces could provoke this issue or if I should use another command) thanks for the help, and the great videos.
Thank you very much for this great tutorial. I tried to use SwiftBlock to generate the SHM file but it didn't work on blender 2.79. In your tutorial we can see only the geometry of the objects. What about the mesh ? Please if you can make an example it will be very helpfull.
Great work Jozsef, I use salome for building and meshing the geometry, for me it was easier than Blender. the mesh can be prepared including any boundary patches (surfaces) or regions (volumes) and once converted (unvToFoam) the same can be found (including names) in OpenFOAM. I have a concern, in case of multi region, do we need to have one mesh only and assigning the regions over the mesh, or we need to have separate mesh? for example with one mesh, the regions can be separated in openfoam using splitMeshRegions but as far I know, only one polymesh folder is constructed. however, if we need to use a multi region solver, each region shall have it's own polymesh folder. if we divide the simulation domain for different meshes (region wise), we will have separate polymesh folders, but are compatible with each other according to openfoam? can the openfoam understand the global/merged mesh
I am not entirely sure, what your question is. Yes, first you create your overall mesh as one big mesh and then you separate it with splitMeshRegions. Then you have submeshes. chtMultiRegionFoam just uses those submeshes, not the original mesh. Was this your question?
Thanks for your reply yes indeed, I just got confused since the general structure for multiRegion solver mentions that the ployMesh shall be inside each region separately in the constant folder and the blockMesh is executed for each region. so, with using salome with the MAIN mesh concept there will be no need. The UnvToFoam and splitMeshRegions shall be executed in the case folder. There was an error during the splitMeshRegions execution. now it's ok this command segregates the constant, system and 0 folders according to the detected regions in the unv file. thank you again
Hi Jozsef, Can you please do a tutorial on swiftBlock? I need a tool that sort of convert stl points into blockMesh. I know how to use snappy, and other similar type of edges smoother or features, but I need a precise grid in faces and this is feasible in blockmesh Thanks Robert
For complicated real life geometries. Simple geometries are easy with blockMesh, but imagine to set up manually a blockMeshDict for an engine block. There is a blender plugin, which does help a bit called swiftBlock, but I would still use snappy for complicated geometries.
Hi József Nagy, i Hope you are going well. I am a new user on OpenFOAM and trying to follow the same instructions as you have in this monkey head tutorial. Even I have same results, views in paraview after exporting (.stl) file with ASCII but when you are applying (nano test.stl) to see which part belongs to which boundary my Ubuntu is not working (Error reading file.stl: Permission denied). I think I am missing some features to install in Ubuntu-19.10.. Could you please guide me How I can manage this issue?
@@OpenFOAMJozsefNagy Thanks Sir, I did by using this command in terminal as i am using VIRTUEL BOX : "sudo usermod -G vboxsf -a username" then restart the terminal.
For the latest version of Blender (Mac OS), if you want to install an addon (ie. Rheologic), I found this helpful for me. blender.stackexchange.com/questions/1688/installing-an-addon
another amazing tutorial! (and great to catch up in Gothenburg ^ ^)
Thank you! It was nice to talk to you!
"Calculate the drag coefficient of the monkey" 🐒
So many gems in this video
One of the rare tutorials that involve blender and NOT instantly obliterating the default cube.
this comment is extremely underrated
True
Great Videos (ALL OF THEM) Jósef. Please keep it up. Your efforts are much appreciated.
Thank you. I am glad. Please support me further!
Köszi! Lényegre törő és átfogó előadás volt!
Simply amazing, Jozsef! This is awesome!
I am glad. Thank you.
Thanks for the video......I'm using blender 2.81 I wrote a little python script to change the titles, put it in the directory where your stl's are and it creates a subdirectory that has the components renamed and a combined stl file, copy and paste this into a file such as fixName.py and run with python fixNames.py:
import glob,os
def fixFile(filename,outf,subdir):
head,tail=os.path.split(filename)
outFn=os.path.join(head,subdir,tail)
file_name = os.path.basename(filename)
partName=tail.rsplit('.')[0]
print partName,"outFn='%s'"%outFn
with open(filename) as inf:
with open(outFn,"wb") as out2:
for l in inf: # inf.readline():
if l.startswith("solid"):
l="solid %s
"%partName
if l.startswith("endsolid"):
l="endsolid %s
"%partName
print >>outf,l,
print >>out2,l,
#outf.write(l)
outFn="combined.stl"
files=[f for f in glob.glob("*.stl") if not f.startswith(outFn)]
dirname="retitled"
os.makedirs(dirname)
with open(outFn,"wb") as outf:
#fixFile("rightEar.stl",outf)
for f in files:
fixFile(f,outf,dirname)
Thank you for providing this script. I will test it.
Thank you @Elden Crom, was going to write my self. I just made compatible for python 3
import glob
import os
def fixFile(filename, outf, subdir):
head, tail = os.path.split(filename)
outFn = os.path.join(head, subdir, tail)
file_name = os.path.basename(filename)
partName = tail.rsplit('.')[0]
print(partName, "outFn='%s'" % outFn)
with open(filename) as inf:
with open(outFn, "w") as out2:
for l in inf: # inf.readline():
if l.startswith("solid"):
l = "solid %s
" % partName
if l.startswith("endsolid"):
l = "endsolid %s
" % partName
print(l, file=outf, end='') # >>outf, l,
print(l, file=out2, end='') # >>out2, l,
# outf.write(l)
# out2.write(l)
# outf.write(l)
outFn = "combined.stl"
files = [f for f in glob.glob("*.stl") if not f.startswith(outFn)]
dirname = "retitled"
os.makedirs(dirname)
with open(outFn, "w") as outf:
# fixFile("rightEar.stl",outf)
for f in files:
fixFile(f, outf, dirname)
@@parth3791 Thank you so much
You sir are a GOD! Thank you so much!
Great video. One update is that this add-in is part of the current version of blender, so you may want to update with note and hyperlink to click ahead because the rheologic explanation is not not needed.
Hi Keith,
Do you still access this add-in in the same fashion as the video shows? I don't seem to see this in my version of blender (2.83.1) when trying to search it like the video shows. Thanks!
@@garrettmoyer7049 The Rheo add on only works for blender versions v2.7x not 2.8.
thank you ; it help a lot
Thank you Jozsef! I have been using RhinoCAD and can do as you recommend for STL (ASCII) then combine.
Great!
I know this is an older video. Jozsef or others, if you happen to see this message, can you confirm for me if the Andrew Price RUclips tutorials you refer too are posted under the name: Blender Guru? If you (Jozsef) are recommending Blender tutorials I want to make sure I am watching the correct ones.
Please disregard. I now see that you linked to his page in your comments
always awesome
Thanks!
you have a very nice channel, I am subscribed!
Thank you
Can I bring the openFoam simulation to Blender?
Thank you
really nice tutorial, but what about the units, if I import a cad model in blender or Salome, what will be the effect on the units.
I am using Salome now and the defaults units are in meters, so if I export the .stl file for snappyHexMesh will the units still be in meters or I have to change manually.
OpenFOAM assumes, that your geoemtry is in meters. If it is in mm, your can scale it with transformPoints -scale '(0.001 0.001 0.001)'
Gracias.
I'm new to Blender, so I'm not following some things. How did you select a face of the cube and give it a separate name?
Right mouse button is select. With P you separate and rename it afterwards.
Hi! So I’m very new to all of this. How would I take my combined stl file and use it for a simulation in open foam. My goal is to have a simulation that shows the aerodynamic flow around the monkey head within the wind tunnel cube as you had created in the video.
Do you know about a tutorial or video with simulation of an air bubble being injected in liquid column ?
Thanks!
Sir,
If working on 2D simulation. Do i need to give some thickness to the body while making CAD model in any CAD making software.
2D is a bit different. cfMesh can generate 2D meshes snappy cannot. You can use blockMesh and extrudeMesh for 2D.
Hi József. I am a complete newbie to OpenFOAM and am mainly interested in modelling fluid flow through porous materials. Basically, we have a tube filled with fibres, which creates a fairly complex geometry that comes from SEM images. What free tools could import XYZ coordinate files and create an input geometry for OpenFOAM? Thank you very much!
Salome, Blender, FreeCad, input is mostly in STL. Check my Multiphase simulation project on how to get the geometry into OF.
@@OpenFOAMJozsefNagy Thanks a lot, József.
while exporting through Rheo stl, do we have to change the scale from 1 to 0.001 in order to convert to m. because i do it after importing from CAD to blender i change my scale from 1 to 0.001 to make it into m.
If you draw in mm yes you have to scale.
How can you use blender with blockMesh?
very useful tutorial :)
I am glad.
Great video again! Thank you!
I have a questions: Is it possible to export .obj files of the faces and the geometry instead of .stl?
Yes, as far as I know OBJ works also with snappy.
@@OpenFOAMJozsefNagy😊thank you for the response!
Great, now I have the geometry. But how do I continue? I need to create a blockMeshDict file in order to start the simulation, but how do I do that?
Check my multiphase simulation project for a detailed case setup.
@@OpenFOAMJozsefNagy Alright, thanks
Thanks!
Thank you for the tutorial. Rheologic blender export add on is not supported by blender 2.8x and the STL export capability in blender generates separate STL files with wrong headers: "Solid Exported from blender...". Any suggestion on how to create STL files with correct solid name? Thank you
I have the same problem! Any one found another way to export stl files separately with correct naming?
hello Jozsef,
To import the geometry to openFOAM, is it neccesary to define the inlets, outlets and walls before?
I am using inventor, can I do that there?
Yes it is important. I am not familiar with inventor. Sorry.
Hi sir
I have a question here.
Need to ask for your help.
okay. let say I have a 3d CAD model of a car, and i want to run the simulation using OpenFOAM. Can I know, what softwares that is needed in the process to get to know about the aerodynamic of the car. And a bit explanation if possible. Thank you sir, I just confused on what is the software needed to solve this.
You need the stl file of the car. snappy can work with that. Check out my multiphase simulation project, how this works.
dear Jozsef,
I am having trouble with this tutorial at minute 15.12 you combine all the .stls to one with the following line "cat *.stl >> combined.stl" my issue is that the combine.stl is opened in ParaView correctly but any other program I use to see .stl tells me that the STL file is broken (needs reparation). for the test, I was using surfaces (not solids) for example, divided a cube in its 6 surfaces and exported each of them in separate .stls, and tried to combine them to create the cube. ( i don't know if using only surfaces could provoke this issue or if I should use another command) thanks for the help, and the great videos.
I am not sure. Some software packages have only a limited STL support.
@@OpenFOAMJozsefNagy oh well, either way, thanks a lot for the answer! as always love your videos!
@@francootaola9172 Thank you
Thanks a lot !
I am glad to help.
Thank you very much for this great tutorial. I tried to use SwiftBlock to generate the SHM file but it didn't work on blender 2.79. In your tutorial we can see only the geometry of the objects. What about the mesh ? Please if you can make an example it will be very helpfull.
Check out my multiphase simulation project for additional information.
Great work Jozsef,
I use salome for building and meshing the geometry, for me it was easier than Blender. the mesh can be prepared including any boundary patches (surfaces) or regions (volumes) and once converted (unvToFoam) the same can be found (including names) in OpenFOAM.
I have a concern, in case of multi region, do we need to have one mesh only and assigning the regions over the mesh, or we need to have separate mesh?
for example with one mesh, the regions can be separated in openfoam using splitMeshRegions but as far I know, only one polymesh folder is constructed. however, if we need to use a multi region solver, each region shall have it's own polymesh folder.
if we divide the simulation domain for different meshes (region wise), we will have separate polymesh folders, but are compatible with each other according to openfoam? can the openfoam understand the global/merged mesh
I am not entirely sure, what your question is. Yes, first you create your overall mesh as one big mesh and then you separate it with splitMeshRegions. Then you have submeshes. chtMultiRegionFoam just uses those submeshes, not the original mesh. Was this your question?
Thanks for your reply
yes indeed, I just got confused since the general structure for multiRegion solver mentions that the ployMesh shall be inside each region separately in the constant folder and the blockMesh is executed for each region.
so, with using salome with the MAIN mesh concept there will be no need. The UnvToFoam and splitMeshRegions shall be executed in the case folder.
There was an error during the splitMeshRegions execution. now it's ok
this command segregates the constant, system and 0 folders according to the detected regions in the unv file.
thank you again
Great, I am glad!
Is there a way to import a part from SolidWorks?
Video coming up soon. Make sure to subscribe not to miss it.
Hi Jozsef,
Can you please do a tutorial on swiftBlock? I need a tool that sort of convert stl points into blockMesh. I know how to use snappy, and other similar type of edges smoother or features, but I need a precise grid in faces and this is feasible in blockmesh
Thanks
Robert
I think the programmer's of swiftBlock can help you.
I created all my geometries in Solidworks and all of them are centered at the origin but in Paraview they are everywhere, how do I fix it.
What do you mean "everywhere"?
@@OpenFOAMJozsefNagy none of them is centered at the origin in paraview.
@@OpenFOAMJozsefNagy Can I send you an image of the models?
@@estaykylyshbek8347 Sorry for the late reply. Sure, send it to my email, but I guess this is an issue with the export function of your CAD tool
@@OpenFOAMJozsefNagy could you please leave your email address ?
Hi, When will be the case of using snappyHexMesh instead of blockMesh?
For complicated real life geometries. Simple geometries are easy with blockMesh, but imagine to set up manually a blockMeshDict for an engine block. There is a blender plugin, which does help a bit called swiftBlock, but I would still use snappy for complicated geometries.
thank you so much for this video,can we use .CATPart or .CATProduct file for openFoam ??
No, only STL or OBJ formats.
So how can you convert from .stl to .step or .iges for example so as to mesh in another software?
In an external CAD tool. Freecad, salome
@@OpenFOAMJozsefNagy thanks. Salome worked.. after a bit of effort
@@djdelta777 I am glad!
Hi József Nagy, i Hope you are going well. I am a new user on OpenFOAM and trying to follow the same instructions as you have in this monkey head tutorial. Even I have same results, views in paraview after exporting (.stl) file with ASCII but when you are applying (nano test.stl) to see which part belongs to which boundary my Ubuntu is not working (Error reading file.stl: Permission denied). I think I am missing some features to install in Ubuntu-19.10.. Could you please guide me How I can manage this issue?
I guess you have to modify the permission of the file
@@OpenFOAMJozsefNagy Thanks Sir, I did by using this command in terminal as i am using VIRTUEL BOX : "sudo usermod -G vboxsf -a username"
then restart the terminal.
@@ijazakbar3276 Is your username "username"?
chmod +x file.stl?
@@OpenFOAMJozsefNagy yes sir, the name ones has have for his/her terminal (UNIX Username)
Rheology add-on is not available for blender 2.8 now.
Yes, v2.8 is more or less a new software, so the add on can only work for v2.79 of blender.
In need your help in developing a model
You can contact me over the form at www.eulerian-solutions.com/training.html
You blew past how to separate the inlet and outlet. I'm new to blender.
Select the nodes and press P to separate.
For the latest version of Blender (Mac OS), if you want to install an addon (ie. Rheologic), I found this helpful for me. blender.stackexchange.com/questions/1688/installing-an-addon
Thank you, this is a good guide, how to install an addon for blender.
Evolved from Monke to create the digital Monke