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

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 110

  • @luofenghuang8015
    @luofenghuang8015 6 лет назад +15

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

  • @pureheroin9902
    @pureheroin9902 6 лет назад +14

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

  • @agatasoda
    @agatasoda 3 года назад +2

    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 9 месяцев назад +1

      True

  • @altoroos
    @altoroos 6 лет назад +8

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

  • @peti6c
    @peti6c 3 года назад +1

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

  • @metel71
    @metel71 6 лет назад +2

    Simply amazing, Jozsef! This is awesome!

  • @eldencw
    @eldencw 4 года назад +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  4 года назад

      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

  • @carelesseagle
    @carelesseagle 3 года назад +2

    You sir are a GOD! Thank you so much!

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

  • @oumaimaboualam5803
    @oumaimaboualam5803 4 года назад +2

    thank you ; it help a lot

  • @jonesbr49424
    @jonesbr49424 2 года назад +1

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

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

    • @dr.gordontaub1702
      @dr.gordontaub1702 Год назад

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

  • @sem-devinc.3445
    @sem-devinc.3445 6 лет назад +1

    always awesome

  • @ninjaabcde
    @ninjaabcde 3 года назад

    you have a very nice channel, I am subscribed!

  • @JhoEspana
    @JhoEspana Год назад

    Can I bring the openFoam simulation to Blender?
    Thank you

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

  • @komodiemo93
    @komodiemo93 6 лет назад +3

    Gracias.

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

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

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

  • @vonBuchen
    @vonBuchen 6 месяцев назад

    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  6 месяцев назад +1

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

    • @vonBuchen
      @vonBuchen 6 месяцев назад +1

      @@OpenFOAMJozsefNagy Thanks a lot, József.

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

  • @peterparrish7890
    @peterparrish7890 2 года назад

    How can you use blender with blockMesh?

  • @alina-valentinaavram7654
    @alina-valentinaavram7654 4 года назад

    very useful tutorial :)

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

  • @hackernik6572
    @hackernik6572 7 месяцев назад

    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  6 месяцев назад

      Check my multiphase simulation project for a detailed case setup.

    • @hackernik6572
      @hackernik6572 6 месяцев назад

      @@OpenFOAMJozsefNagy Alright, thanks

  • @antoine1407
    @antoine1407 2 года назад

    Thanks!

  • @sadeqsaleh5287
    @sadeqsaleh5287 3 года назад

    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 3 года назад

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

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

  • @syafiejelima986
    @syafiejelima986 5 лет назад

    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  5 лет назад

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

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

  • @juthedowser
    @juthedowser 5 лет назад

    Thanks a lot !

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

  • @salehabuhanieh3598
    @salehabuhanieh3598 6 лет назад

    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  6 лет назад +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 6 лет назад

      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  6 лет назад

      Great, I am glad!

  • @LUCASSILVA-jf1zc
    @LUCASSILVA-jf1zc Год назад

    Is there a way to import a part from SolidWorks?

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  Год назад

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

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

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

  • @ISaacffds
    @ISaacffds 6 лет назад

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

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  6 лет назад +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.

  • @DeepakKumar-cm3lk
    @DeepakKumar-cm3lk 6 лет назад

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

  • @djdelta777
    @djdelta777 4 года назад

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

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

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

  • @STWNoman
    @STWNoman 4 года назад

    In need your help in developing a model

    • @OpenFOAMJozsefNagy
      @OpenFOAMJozsefNagy  4 года назад

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

  • @Veghead211
    @Veghead211 3 года назад

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

  • @isaacc4026
    @isaacc4026 6 лет назад +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  6 лет назад

      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