How to create and export your geometry for simulations in OpenFOAM - tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ธ.ค. 2024

ความคิดเห็น • 110

  • @luofenghuang8015
    @luofenghuang8015 7 ปีที่แล้ว +15

    another amazing tutorial! (and great to catch up in Gothenburg ^ ^)

  • @agatasoda
    @agatasoda 3 ปีที่แล้ว +3

    One of the rare tutorials that involve blender and NOT instantly obliterating the default cube.

    • @guillemoreno95
      @guillemoreno95 2 ปีที่แล้ว +2

      this comment is extremely underrated

    • @CAL1MBO
      @CAL1MBO ปีที่แล้ว +1

      True

  • @altoroos
    @altoroos 7 ปีที่แล้ว +8

    Great Videos (ALL OF THEM) Jósef. Please keep it up. Your efforts are much appreciated.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  7 ปีที่แล้ว +2

      Thank you. I am glad. Please support me further!

  • @pureheroin9902
    @pureheroin9902 6 ปีที่แล้ว +14

    "Calculate the drag coefficient of the monkey" 🐒
    So many gems in this video

  • @peti6c
    @peti6c 3 ปีที่แล้ว +1

    Köszi! Lényegre törő és átfogó előadás volt!

  • @eldencw
    @eldencw 5 ปีที่แล้ว +5

    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)

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  5 ปีที่แล้ว

      Thank you for providing this script. I will test it.

    • @parth3791
      @parth3791 4 ปีที่แล้ว +2

      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)

    • @ashuftw
      @ashuftw 4 ปีที่แล้ว +1

      @@parth3791 Thank you so much

  • @metel71
    @metel71 7 ปีที่แล้ว +2

    Simply amazing, Jozsef! This is awesome!

  • @keithrunyon7746
    @keithrunyon7746 4 ปีที่แล้ว

    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.

    • @garrettmoyer7049
      @garrettmoyer7049 4 ปีที่แล้ว

      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!

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว

      @@garrettmoyer7049 The Rheo add on only works for blender versions v2.7x not 2.8.

  • @JhoEspana
    @JhoEspana 2 ปีที่แล้ว

    Can I bring the openFoam simulation to Blender?
    Thank you

  • @peterparrish7890
    @peterparrish7890 2 ปีที่แล้ว

    How can you use blender with blockMesh?

  • @carelesseagle
    @carelesseagle 4 ปีที่แล้ว +2

    You sir are a GOD! Thank you so much!

  • @User-Tal1951
    @User-Tal1951 2 ปีที่แล้ว

    Do you know about a tutorial or video with simulation of an air bubble being injected in liquid column ?
    Thanks!

  • @shivamgupta9967
    @shivamgupta9967 ปีที่แล้ว

    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.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  ปีที่แล้ว

      2D is a bit different. cfMesh can generate 2D meshes snappy cannot. You can use blockMesh and extrudeMesh for 2D.

  • @shivamgupta9967
    @shivamgupta9967 ปีที่แล้ว

    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.

  • @vonBuchen
    @vonBuchen 9 หลายเดือนก่อน

    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!

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  9 หลายเดือนก่อน +1

      Salome, Blender, FreeCad, input is mostly in STL. Check my Multiphase simulation project on how to get the geometry into OF.

    • @vonBuchen
      @vonBuchen 9 หลายเดือนก่อน +1

      @@OpenFOAMJozsefNagy Thanks a lot, József.

  • @andrewjackson3817
    @andrewjackson3817 2 ปีที่แล้ว

    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.

  • @42mateos
    @42mateos 6 ปีที่แล้ว +1

    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?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  6 ปีที่แล้ว

      Right mouse button is select. With P you separate and rename it afterwards.

  • @jonesbr49424
    @jonesbr49424 2 ปีที่แล้ว +1

    Thank you Jozsef! I have been using RhinoCAD and can do as you recommend for STL (ASCII) then combine.

  • @hackernik6572
    @hackernik6572 10 หลายเดือนก่อน

    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?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  10 หลายเดือนก่อน

      Check my multiphase simulation project for a detailed case setup.

    • @hackernik6572
      @hackernik6572 10 หลายเดือนก่อน

      @@OpenFOAMJozsefNagy Alright, thanks

  • @oumaimaboualam5803
    @oumaimaboualam5803 4 ปีที่แล้ว +2

    thank you ; it help a lot

  • @dr.gordontaub1702
    @dr.gordontaub1702 ปีที่แล้ว

    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 TH-cam 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.

    • @dr.gordontaub1702
      @dr.gordontaub1702 ปีที่แล้ว

      Please disregard. I now see that you linked to his page in your comments

  • @LUCASSILVA-jf1zc
    @LUCASSILVA-jf1zc 2 ปีที่แล้ว

    Is there a way to import a part from SolidWorks?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  2 ปีที่แล้ว

      Video coming up soon. Make sure to subscribe not to miss it.

  • @sadeqsaleh5287
    @sadeqsaleh5287 4 ปีที่แล้ว

    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

    • @mohammadmohagheghfaghih8313
      @mohammadmohagheghfaghih8313 4 ปีที่แล้ว

      I have the same problem! Any one found another way to export stl files separately with correct naming?

  • @riturajborah382
    @riturajborah382 ปีที่แล้ว

    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?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  ปีที่แล้ว +1

      Yes, as far as I know OBJ works also with snappy.

    • @riturajborah382
      @riturajborah382 ปีที่แล้ว

      @@OpenFOAMJozsefNagy😊thank you for the response!

  • @leili8163
    @leili8163 4 ปีที่แล้ว

    Rheology add-on is not available for blender 2.8 now.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว

      Yes, v2.8 is more or less a new software, so the add on can only work for v2.79 of blender.

  • @ninjaabcde
    @ninjaabcde 3 ปีที่แล้ว

    you have a very nice channel, I am subscribed!

  • @codingspace
    @codingspace 6 ปีที่แล้ว

    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.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  6 ปีที่แล้ว +1

      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)'

  • @estaykylyshbek8347
    @estaykylyshbek8347 4 ปีที่แล้ว

    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.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว

      What do you mean "everywhere"?

    • @estaykylyshbek8347
      @estaykylyshbek8347 4 ปีที่แล้ว

      @@OpenFOAMJozsefNagy none of them is centered at the origin in paraview.

    • @estaykylyshbek8347
      @estaykylyshbek8347 4 ปีที่แล้ว

      @@OpenFOAMJozsefNagy Can I send you an image of the models?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว

      @@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

    • @estaykylyshbek8347
      @estaykylyshbek8347 4 ปีที่แล้ว

      @@OpenFOAMJozsefNagy could you please leave your email address ?

  • @francootaola9172
    @francootaola9172 4 ปีที่แล้ว

    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.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว +1

      I am not sure. Some software packages have only a limited STL support.

    • @francootaola9172
      @francootaola9172 4 ปีที่แล้ว

      @@OpenFOAMJozsefNagy oh well, either way, thanks a lot for the answer! as always love your videos!

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว

      @@francootaola9172 Thank you

  • @syafiejelima986
    @syafiejelima986 6 ปีที่แล้ว

    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.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  6 ปีที่แล้ว

      You need the stl file of the car. snappy can work with that. Check out my multiphase simulation project, how this works.

  • @rob3rt86
    @rob3rt86 6 ปีที่แล้ว

    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

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  6 ปีที่แล้ว

      I think the programmer's of swiftBlock can help you.

  • @felipelorenzoortega6640
    @felipelorenzoortega6640 5 ปีที่แล้ว

    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?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  5 ปีที่แล้ว +1

      Yes it is important. I am not familiar with inventor. Sorry.

  • @hessmess9504
    @hessmess9504 6 ปีที่แล้ว

    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.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  6 ปีที่แล้ว

      Check out my multiphase simulation project for additional information.

  • @djdelta777
    @djdelta777 5 ปีที่แล้ว

    So how can you convert from .stl to .step or .iges for example so as to mesh in another software?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  5 ปีที่แล้ว

      In an external CAD tool. Freecad, salome

    • @djdelta777
      @djdelta777 5 ปีที่แล้ว

      @@OpenFOAMJozsefNagy thanks. Salome worked.. after a bit of effort

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  5 ปีที่แล้ว

      @@djdelta777 I am glad!

  • @ISaacffds
    @ISaacffds 7 ปีที่แล้ว

    Hi, When will be the case of using snappyHexMesh instead of blockMesh?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  7 ปีที่แล้ว +1

      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.

  • @STWNoman
    @STWNoman 5 ปีที่แล้ว

    In need your help in developing a model

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  5 ปีที่แล้ว

      You can contact me over the form at www.eulerian-solutions.com/training.html

  • @DeepakKumar-cm3lk
    @DeepakKumar-cm3lk 6 ปีที่แล้ว

    thank you so much for this video,can we use .CATPart or .CATProduct file for openFoam ??

  • @salehabuhanieh3598
    @salehabuhanieh3598 7 ปีที่แล้ว

    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

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  7 ปีที่แล้ว +1

      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?

    • @salehabuhanieh3598
      @salehabuhanieh3598 7 ปีที่แล้ว

      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

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  7 ปีที่แล้ว

      Great, I am glad!

  • @ijazakbar3276
    @ijazakbar3276 4 ปีที่แล้ว

    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
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว +1

      I guess you have to modify the permission of the file

    • @ijazakbar3276
      @ijazakbar3276 4 ปีที่แล้ว

      @@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.

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว

      @@ijazakbar3276 Is your username "username"?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 ปีที่แล้ว

      chmod +x file.stl?

    • @ijazakbar3276
      @ijazakbar3276 4 ปีที่แล้ว

      @@OpenFOAMJozsefNagy yes sir, the name ones has have for his/her terminal (UNIX Username)

  • @komodiemo93
    @komodiemo93 7 ปีที่แล้ว +3

    Gracias.

  • @alina-valentinaavram7654
    @alina-valentinaavram7654 5 ปีที่แล้ว

    very useful tutorial :)

  • @antoine1407
    @antoine1407 3 ปีที่แล้ว

    Thanks!

  • @sem-devinc.3445
    @sem-devinc.3445 6 ปีที่แล้ว +1

    always awesome

  • @Veghead211
    @Veghead211 3 ปีที่แล้ว

    You blew past how to separate the inlet and outlet. I'm new to blender.

  • @juthedowser
    @juthedowser 5 ปีที่แล้ว

    Thanks a lot !

  • @isaacc4026
    @isaacc4026 7 ปีที่แล้ว +1

    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

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  7 ปีที่แล้ว

      Thank you, this is a good guide, how to install an addon for blender.

  • @mertcaj
    @mertcaj 3 ปีที่แล้ว

    Evolved from Monke to create the digital Monke