Great stuff, Calum! Thanks a lot for that video! I just learned a lot about sHM and actually consider giving it another try. Two comments: 1.) It seems everything works for 2.0.x as well except for the surfaceFeatureExtractDict. In this version I just had to go with the old terminal command for each of the patches. Otherwise the tutorial seems to be very valid for that older version as well. 2.) How about adding the links to the different timesteps to the description? I took the freedom to kind of prepare that already for you: OpenFOAM SnappyHexMesh Tutorial CAD Model View OpenFOAM SnappyHexMesh Tutorial STL file format and patch names OpenFOAM SnappyHexMesh Tutorial Scale STL to meters OpenFOAM SnappyHexMesh Tutorial Merging STL files OpenFOAM SnappyHexMesh Tutorial triSurface folder OpenFOAM SnappyHexMesh Tutorial blockMesh OpenFOAM SnappyHexMesh Tutorial surfaceFeatureExtract OpenFOAM SnappyHexMesh Tutorial eMesh files OpenFOAM SnappyHexMesh Tutorial surfaceFeatureExtractDict OpenFOAM SnappyHexMesh Tutorial snappyHexMeshDict OpenFOAM SnappyHexMesh Tutorial Edit boundary text file OpenFOAM SnappyHexMesh Tutorial View the Mesh OpenFOAM SnappyHexMesh Tutorial Layer addition parameters OpenFOAM SnappyHexMesh Tutorial Volume refinement parameters OpenFOAM SnappyHexMesh Tutorial run simpleFoam in parallel OpenFOAM SnappyHexMesh Tutorial running showing residuals OpenFOAM SnappyHexMesh Tutorial post-processing OpenFOAM SnappyHexMesh Tutorial function object code template OpenFOAM SnappyHexMesh Tutorial U and p results Cheers, Bernhard
I owe you an important part of my thesis! A clear explanation of how to set up and run a case, from the beginning to the end. I found especially useful the part on building the geometry, meshing, exporting files, converting files and those matching problems between programs (in particular from CAD to OpenFOAM). Thank a lot!
Very helpful Calum. I am new to OpenFoam and am setting up a similar case, to the extent that I have an internal flow in a domain consisting of several parts (a spherical container with a cylindrical neck, the whole divided into four layers which are to have differing wall temperatures that result in a buoyancy-driven circulation). There is one aspect of the tutorial that had puzzled me, but perhaps now I have resolved it. We see in your tutorial (at about 39 min) that the needed entries for your patches (inlet, outlet, etc.) have been conveyed to your .../constant/polyMesh/boundary file, along with the unwanted patches stemming from blockMeshDict. In my case, while I am able to created the wanted mesh, my patch names do not propagate into .../constant/polyMesh/boundary. I have tried countless variations for snappyHexMeshDict, but have never succeeded to get those patches to appear (with their face count etc.) in constant/polyMesh/boundary. To my surprise, after a good while puzzling over this, I found that the needed entries are made in ...run/casefolder/1/polyMesh/boundary and in .../run/casefolder/2/polyMesh/boundary, so that one can copy the needed information over to .../constant/polyMesh/boundary.
Calum, thank you very much for your work. Great stuff. For the beginners, who will work on newer versions of OpenFOAM: you will encounter some problems when applying the solver (the last step) with the files provided. Solution: stackoverflow.com/questions/48421407/openfoam-foam-fatal-error-unknown-turbulencemodel-type-rasmodel/48428177#48428177 . You will also need to change WallShearStress function in controlDict, as the syntax changed slightly. Check in OpenFOAM documentation for wallShearStress.
@@MajPirate man thank you so much. I was going crazy when it didnt work. Actually the renumberMesh didnt work either. I then changed the setting descriped in the link and suddenly (at least) the solver started his job. I was a bit suprised about the time. It is my first experience in this domain and the solving just took about 3 1/2 min to finish. Update: reconstructPar shows error -> Unkown patchField Type epsilonWallFunction for patch type wall
Hey! thank you for the video mate! please do try to upload the longer one, the 2 hr 20 min length video as well, students like us live by those videos man. please do upload that :)
Hello,idk if ur still active or not bu thanks for the tutorial, i just had a couple of problems.First when i do the reconstructparmesh, it gives me 3 new polymesh folder instead of combining them into one in the original one.And when i run the simulation it gives me an error in the fvschemes from line 32 to 39 where i defined the div and it says Entry 'div((nuEff*dev2(T(grad(U)))))' not found in dictionary "system/fvSchemes.divSchemes".It would be appreciated if you could give me any tips on how to fix this
Great video! Thanks for sharing it. Please, what could be recommendation to ensure addLayers work? I have tried low refinement in surfaces and regions, and they are not generated. You mentioned a 'good background'... how would be one? Thanks!
This is a very good video. Thanks. I am a question about using SHM. If I mesh a semi-submerged pipe (with on thickness) in a large domain using SHM, it will definitely cut off the outer part of the pipe. Is there a way to keep the whole pipe but the outer top as inlet while the inner top as open through which the flow can go into the domain? I am not sure if I explain it clearly, and I hope you offer any suggestions on it. Thanks.
Thanks for the video, it helps a lot in understanding sHM. However, is there any tutorial available to show how to extract the desired surfaces from the CAD program? I'm a newbie to AutoCAD and I don't manage to extract easily surfaces from my solid, which blocks me for solving my case.
Hello. I am unable to execute simpleFoam solver in Version 8. All other processes worked fine. I even edited the surfaceFeatureExtract to surfaceFeatures. But now i am stuck at running simpleaFoam.
Calum Douglas I would like to ask if you're good as well with meshLab, and if you can publish a video on general using on how to deal with imported STL from CAD: i mean repairing, sewing ecc...
Michele Cavallerin Hi Michele, I do use MESHLAB - but I only use it for looking at STL files and also for changing their format from Binary to ASCII so I can change the patch names within the file. I put alot of effort into making my surfaces perfect before I export the STL. Much better than repairing a bad file later on....if you have a big problem I can make an STL from a STEP file for you.
Calum Douglas ok thanks you anyway, I was just asking, because sometimes I face this problem and I was hoping to know someone skilled at meshlab usage. thanks anyway, but I do prefer "bother you with other questions concerning SHM as well, maybe directly on your web site, in case of help. thanks again for the video!!! bye
Hi Calum, When you finish meshing with the SHM and modify the boundary file(delete the unnecessary patches) all the boundaries the SHM produces are of type "wall".. Is there any way to make some of them type "patch"?
Hi! I think the link you provided for the download of your tutorial files isn't working. Are there alternative links for us to access your files? Thank you!
Hi I liked your tutorial very much. The only thing I do not understand, is why you did the region refinement of "volume" in distance mode? what purpose is that? would it be the same to just refine the surface and then choose nCellsBetweenLevels higher, maybe 3?
Hi thanks great video. I am solving a conjugate heat transfer problem and using snappy for that. Is it possible to identify different regions separately nto different cellZones using snappy ? like different solid regions and the background mesh to be identified as fluid. I want to split the mesh using cellzones later. Thanks a lot
Nice video, I'm just stuck with the pyFoamPlotRunner.py. I would like to see the residuals, installed gnuplot, numpy and pyfoam, but it gives the error: AttributeError: 'GnuplotProcess' object has no attribute 'gnuplot'. Any idea?
Thanks for the tutorial Calum. I am trying to export surfaces to STL as you've indicated, however since it is not a solid or a watertight body, it does not allow me to do so. Could you tell me what CAD software did you use to export the surfaces in the STL format?
Hi, I have a question. What could be the reason of boundary file not being updated after I run reconstructParMesh -constant ? Is it possible that it would not work when the mesh is not water tight ? Or can you think of any other thing? Thank you so much for a great video and hopefully you can help me out :)
Very good, glad it was helpful. When I have time I will try to do a new video as OpenFoam has a lot of newer versions, but Snappy is basically nearly exactly the same. Only a couple of small new features have been created.
This video actually helped me a lot in my thesis . And thanks in advance as I tried snappy and one of my surfaces (fins) got removed as zero sized patch.. is their anyway to solve this issue... am doing a multi region case with chtMultiRegionFOAM ( cooling of graphics card with fin) .Kindly reply .
Hi Calum, your video helped me alot! Very good step by step explanation there. I am a physicist working on my Ph.D. and I need to model flow through capillaries. So it's quite close to your case.
Hi Jan, may I ask permission to use your comment here to put on my website please ? I am planning to make some more videos and start a proper website. Your assistance would be much appreciated. Let me know with a comment underneath please ! Thanks!
Hi. I followed your tutorial and loved it! I do have a simple question before I start on my own project. I’ve modeled an elbow pipe with a second inlet in SolidWorks. I made a “cap” for the two inlets and outlet as separate parts and then assemble the 3 caps to my wall. So I created 4 .stl files from the assembly. In the tutorial, you also have the volume.stl. So I need to make the assembly I created in to 1 part and import that in to the triSurfaces as well?
To do distance defined surface refinement requires a single, closed STL file to work from. Hence if you wish to do that, yes you will also need an STL file which is a 100% closed surface.
Calum Douglas Thanks! I did that, but now I'm getting an error after changing to my stl files. Any chance I can email you what i changed and the error it gave me or do you prefer on here?
Edward Kraft You need to explain alot more clearly what you mean by "error". You need to paste in the error message for a start, about 90% of SHMesh errors are caused by syntax errors. Usually accidentally deleting a bracket, a semicolon, or mis-spelling a file name. When you are starting out, make only one change at a time.
Thank you very much for this tutorial. That is really the best one I have found so far in the internet. Great work! :) One can see that you are really experienced with OpenFoam and CFD.
Hi Manuel, may I ask permission to use your comment here to put on my website please ? I am planning to make some more videos and start a proper website. Your assistance would be much appreciated. Let me know with a comment underneath please ! Thanks!
I have a question, can someone please help me out? I want to run the solver multiPhase/interFoam/RAS/floatingObject but by default it runs with a cuboid body, I have a cylindrical body in .stl format and I want to use it as a floating object. How can I do this? I have been able to insert the cylindrical mesh in blockMesh by using snappyHexMesh, but how can I use the cylinder as a floating object? Thanks if someone can help me out, I am doing a univerisity homework :)
Hmm not sure quite what that means but it seems you are intending it as a positive comment overall so thats ok. Dont recall Theon being much into his science....
Hi Calum, thanks for the tutorial! I have a question about the *.eMesh file that is created by the surfaceFeatureExtract command. When I try to create the mesh with SnappyHexMesh the process fails because there seems to be a problem with the *.eMesh file. I have compared it to the fridgeA.eMesh from the iglooWithFridges tutorial and it has a totally different structure. What do your *.eMesh files look like?
Hi there, I cannot help you without: -Knowing which version of OpenFOAM you are using -The error code / error message you get In what way does "The process fail" ?
Calum Douglas I'm using foam-extend-3.1 and get the following error message: "Reading external feature lines. --> FOAM FATAL IO ERROR: Expected a '(' while reading VectorSpace, found on line 19 the word 'externalStart' file: /Volumes/foam-extend-3.1/tutorials/multiphase/interFoam/ras/NACA0015Test/constant/triSurface/NACA0015.eMesh at line 19. From function Istream::readBegin(const char*) in file db/IOstreams/IOstreams/Istream.C at line 86. FOAM exiting" I have uploaded my test case to dropbox. www.dropbox.com/s/45nv9u8le7mthoa/NACA0015%20Test.zip snappyHexMesh runs without any errors when I comment out the featureEdgeMesh in snappyHexMeshDict. But it seems to ignore my stl file because I cannot see the NACA airfoil in the mesh.
Axelander1111 OpenFOAM extend is a totally different branch of OpenFOAM. Which does not share the latest developments as openfoam 2.3. I have never used it and so cant help directly. Since you`re using a totally different OpenFOAM installation you will have to just google search your error codes. Looks like is probably an issue with Binary vs ASCII file types.
Thanks for your reply! I already tried a google search but couldn't find a solution. Maybe I can try to test the case with another version of OpenFOAM.
Hi Calum! I guess you designed the pipe in a CAD software like Solid-Works/Solid-Edge or whatsoever.... How did you managed to extract the inlet/outlet/wall STL files from the CAD model (3:10)?
MegaSancho1990 Depends on what software you have. If you can save-as STL then you can do it. I just extract surfaces I want from the solid and then save each surface as an STL separately.
+Calum Douglas First of all, Thank you Calum for providing this tutorial. I managed to mesh my first model in openfoam following your neat instructions. My model is from medical scans, so the geometry is complex, but I managed to separate the STL parts using an opensource software: meshmixer. Thank you!
Hello Calum, Very good video indeed. I want to ask you a question about the boundary box. The blockMesh utility helps you define the boundary box but you define some patches on it(blockMeshdict file) why so? I mean do you need them somewhere?
In this case we`re deleting all the mesh outside of the pipe. So those patches should be deleted, however thats just because its an "internal flow" problem. If we were doing for example external aero on a car, we would keep the mesh OUTSIDE of the body, and so would need all those patch names from BlockMeshDict - eg as Inlet, Outlet, topwall etc etc. So thats why I start with a BlockMeshDict with named patches, as for many geometries and problems you WILL need them. Here those patches are not in the final mesh, and so should be deleted as it shows in my video.
Calum Douglas Thanks for helping us all baby foamers, Calum! I wonder, how does the determination of BCs change if you have both internal AND external flow? E.g. an object in a channel - so flow around the object (external) which is sitting inside a channel (internal)?
Marta Drabek You`ll need to email me a picture. Its very easy to get confused with descriptions of model setups. You can contact me via my website contact form. Then I can email you back, so you can email attachments.
Hi Calum I am trying to use snappyhexmesh for single stl file. In that case do i need to decompose, because I was trying to decomposePar but it was not working I was trying to mesh a simple cylinder, i am getting following error for decomposePar Unknown decompositionMethod ptscotch Valid decompositionMethods are : 8 ( hierarchical manual metis multiLevel none scotch simple structured )
It would help to know which version of OpenFOAM you are trying to use. But just to keep it simple, decomposing has nothing at all to do with how many STL files you may (or may not) have. DecomposePar is the command to do the meshing in parallel processing - depending on how many CPU cores you have. I suggest you update to OFv2.3 if you have not already done so. Or try to run the "motorcycle" tutorial in your openfoam installatio and see if it works Because thats also a parallel snappyhexmesh case.
Hi Calum I have one more question In this tutorial volume.stl file has complete geometry without any patch. And other STL file are for different patches. Is it necessary that we use separate stl file for each patch or we can add all patches in one file to appy boundary condition e.g in volume.stl in this tutorial
You do not need to use separate STL files you can join them together with the cat command in linux. However they are then named inside the snappyhexmeshdict in a different way. I dont think it matters which technique you use. The reason the volume stl is there, is to enable a regional distance refienment. To do that you must use a CLOSED stl volume so you cannot use the existing patches.
I have an issue related to my boundaries... I have 3 objects (2 solids and 1 fluid) which represent a pipe. Only the two solid regions appear at the polymesh/boundaries after the snap. I checked surfaceFeatureExtractDict and snappyHexMeshDict but it seems i did specify all correctly. I tried to keep all advanced settings standard tho.
I dont understand your question really, firstly what do you mean you have a fluid representing part of the pipe ? They need to be closed surfaces, exactly as in my description. You probably have problems with your STL files. Sorry its very hard to diagnose these things without photos, this process works so if it doesnt, and you followed it, then your starting CAD files are not ok. The most common problems are not scaling STL`s properly, having gaps from bad CAD and the mesh location point for snappy being in the wrong place.
+Isaac Mark First calculate what it should be: www.cfd-online.com/Tools/yplus.php Then run simulation, do yPlusRAS command in OpenFOAM- which will show you what y+ value actually IS. Alter your mesh and re-run. Iterate until satisfied. Unless you have adaptive meshing software, thats as good as it gets (there are some differences of opinion about how y+ is defined in the yPlusRas command.....but thats problem #2...I`m afraid).
Hi Calum, first things first, this tutorial is great, thank you, however I wished to ask you a question: I have created a good quality STL, snappyHexMesh runs fine and produce a good mesh, however I wasn't able to split this STL in parts to manage dimensions and boundary conditions. You can pinpoint me to the right direction perhaps? thank you
+Riccardo Maione Do the separation in the CAD program, and turn each part into an STL later on. Its a very messy buisiness manipulating STL`s you already have. But if you must then: th-cam.com/video/6rostD8O5sg/w-d-xo.html
Hi Calum, I am facing a problem with merging two different stl files into a stl file with only one single object. I tried the "cat" command but I got a stl with two seperate objects. How can I do that? Thanks
David Zhang Yes CAT command is not for doing that. I think you are much better off modifying your shape in CAD and re-exporting. However if you cannot do that I recommend experimenting with MESHLAB. However I have never actually tried to do what you are trying. It sounds messy and I do not think its a good way to get your mesh.
Excellent tutorial - however I am stuck at the first step! You import your model as a series of .stl files such that you can define your patches and refinement areas later on. How is this done? For example if I built a simple pipe in SolidWorks, how could I define the inlet and outlet patches - without physically addding any additional volume to the pipe? Best Regards
I dont really understand your question about "additional volume" because STL models are surfaces. I`m afraid that you need to go onto a Solidworks forum and ask how to extract STL surfaces from that software package. You do not need a solid model to do this, surfaces are ok too.
Right, I understand. Re: the pipe example, I am capable of exporting the pipe surfaces as an STL - however the inlet and outlet would obviously be an empty space - with no surface point data. I assume in OpenFOAM I could set this up as an "empty" patch, however I'm struggling to grasp this concept when there is no data there. I'm not sure whether my lack of understanding is CAD based or CFD theory based. Any ideas? Thanks again for your time.
You can use a closed pipe and use open foams tools which can be set to work on angle difference to automatically separate into different patches (I never use this but it works) or you can create two 2D discs to represent each pipe end. These are then inlet / outlet patches.
Hey Calum, First of all thanks for the very informative video! I have a question about the surfaceFeatureExtractDict. I've tried to follow your instructions, but with some geometrie I've made myself in a CAD software. As a starting point for the meshing I've copied the contents of the motorbike case from the tutorials as you suggested and ran the blockMesh. However when I try to run the the surfaceFeatureExtract (and also everything that follows) I get error messages. It seems that I need to change somehow also the surfaceFeatureExtractDict, which is not explained in your video. So my question is basicaly how and what should I change before I can run surfaceFeatureExtract? Thanks and keep up the good work!
It is all explained in the video, its also given in the contents that SurfaceFeatureExtract is described at 21:00. How to edit the surfaceFeatureExtract dict is shown at prescisely 23:10
Yuval Porat If you have an OF version previous to 2.2.0, you may have my problem since the surfaceFeatureExtractDict do not exist for those versions, I solved this problem executing (surfaceFeatureExtract -includedAngle 150 patchname.stl features) for every patch in order to generate the emesh files, you have to take into account that for executing this command you have to copy the stl files in the case directory instead of the triSurface directory
While following your tutorial I got to the point where I enter decomposePar but unlike your program the only out put I received was Create time Decomposing mesh region0 Create mesh Calculating distribution of cells Selecting decompositionMethod ptscotch Attempting to use an MPI routine before initializing MPI in addition to this when I entered mplrun -np 8 snappyHexMesh -overwrite -parallel I received the error: command not found Any help would be much appreciated.
+Ryan Cunningham Well I dont know if what you have pasted here is what you actually typed......but you have typed the letter "L" instead of "i" in the command mpirun..... If you have issues other than that, you probably have bigger problems. I suggest you read this web.student.chalmers.se/groups/ofw5/Basic_Training/runningInParallelLucchini.pdf
Van Sang Pham Generally means you are using a different version of OpenFOAM - or have installed something incorrectly. Please google before you post, there are lots of answers for this on cfd-online forum.....
hey, thank you Calum, very good tutorial indeed. But, I would like to get the files you show as examples, you say in the tutorial that they are available on your website but...I cannot find your website, I tried the calumdouglas.ch site but apparently it is free domain......
Hi Calum! First of all, thank you for a great video! I was wondering which program you used to extract the surfaces from the CAD model? I have managed to do it in Salome, but I end up with huge STL files, and quite bad quality. I have tried to export STL in Salome from both geometry and mesh module.
I use commercial CAD software, large sizes are common - for a full size car STL, easily 150Mb is common. Low resolution STLs cause bad meshes in SHMesh....
Hello Calum! Really nice tutorial! I'm using OpenFoam version 3.0 and when trying to run the model with the command: "mpirun -np 8 simpleFoam -parallel" the program runs but it fails almost inmediatly with the following error: "Selecting incompressible transport model Newtonian Selecting turbulence model type RASModel [0] [1] [1] [1] --> FOAM FATAL ERROR: [1] Unknown TurbulenceModel type RASModel" Do you know how I may solve it? Many thanks!
This case is from 2014. So, may be he used OpenFOAM 2.3.0 or 2.4.0. There are a large number of differences between 2.3.0 or 2.4.0 and 3.0. So, you need to change the entry names one by one. I have similar experience. I am sorry but you need to make a lot of small changes. :(
As Thaw Tar says I am using OF 2.3, I suggest you look at the example cases in your OF 3.0 folder and read the commands used for each one to understand what has changed between versions.
I really appreciate this tutorial but I was wondering about a tutorial on external flow? I find this tutorial to be for internal flows, but how about external flows? like 3D flows through porous/non-porous obstacles? do you have any suggestion on that? would appreciate your reply. thanks!
Just dont delete the patch names in the boudary file like I do here, and obviously move your locationinmesh point to the other side of the domain. Be very careful with the blockmesh density, as if its too course with a very very fine mesh right up against the object inside, it will not converge. Also SimpleFOAM does not like to converge if you have a bad mesh, so eliminate all skew elements etc. Do not waste your time running any mesh that fails checkmesh, if you really have to get it running increase your solver tolerances from maybe 0.7 up to perhaps 1.0 but the solution will be less accurate.
Calum Douglas ok, so how do you remove skewed elements, what specific "checks" need to be followed? does it matter if my geometry is really small? it seems like my geometry is really small that there still exist skewed elements (you're right, blockMesh is coarse compared to geometry mesh..tried to make "fine" the blockMesh...still there are skewed elements) and that snappyhexmesh "messes" it up which makes it fail checkMesh... :-( can you help me with this? thanks so much.
Hernan Mejias Run checkMesh, this writes the areas that fail into files for you. These can then be viewed in paraFoam, after you convert them to VTK format. This will show you which areas are bad, normally means refining those areas more, or altering your geometry.
Calum Douglas Hello there again! Thanks for the prompt reply. Well, I tried what you said and for some reason, my "simple" geometry which is a very small geometry though gets messed up and found that the skew faces occurs at the "angled" portions of my drawing...Imagine a cylinder with extruded sides (that's my simple geometry). So i got it "fixed" by using resolveangle 90 and up...but the mesh is OK for a single geometry...Unfortunately, I would like to simulate flow around multiples of this geometry, say, 50 times of such...and snappyHexMesh messes up my geometry big time...even if i increase the resolveangle to 130 (which I think shouldn't be the case or should i say would be bad), checkMesh fails big time! Of course I looked into the skew faces and well, from there, "portions" of my geometry are missing/broken/discontinued which makes my mesh fail. :-(
Hi Calum! Thanks for this great video. It's really helpful. I have one question for you. When I tried to run the mesh in parallel, I am getting this error even if I already reformatted the snappyHexMeshDict sample file. Any thoughts? thanks (keyword castellatedMeshControls is undefined in dictionary "/home/psci/OpenFOAM/psci-2.3.0/run/BBSF_nopigs_SHmesh_3Dec/processor1/system/snappyHexMeshDict" [1] [1] file: /home/psci/OpenFOAM/psci-2.3.0/run/BBSF_nopigs_SHmesh_3Dec/processor1/system/snappyHexMeshDict from line 0 to line 0. [1] [1] From function dictionary::subDict(const word& keyword) const [1] in file db/dictionary/dictionary.C at line 643.
Funny errors usually mean you have made a syntax error in the snappyhexmesh dict. Almost certainly you have accidentally deleted a bracket, or missed out a semi-colon.
This is a pretty clear video, I'm not so expert creating meshes so I'd like to know how exactly do you create .stl files, are they simply exported from a CAD?, did you create one by one? or did you split the whole geometry in every patch? thanks for the help (y)
The geometry was made in CAD as a solid model. then surfaces extracted for each required patch. Each surface can then be exported as an STL. Its very very important to set the STL export settings to maximum fine-ness for a good result with SHMesh. You can do this in opensource with Salome-Meca.
Calum Douglas Trying to follow your instructions with my own mesh I get an error when executed surfaceFeatureExtract command, I tried executing the same sequency on your example files too and I get the same error "FOAM FATAL ERROR: Wrong number of arguments, expected 2 found 0", I dont know if its a problem of my OF installation or its from the dictionary settings, have you any idea of how to solve it, thanks for the help
miguel zapata I already found the error, it was a problem of OF version in 2.1.1 that dictionary is not available so you have to input the parameters of every patch with the comand (surfaceFeatureExtract -includedAngle 150 surface.stl features) to create the emesh files
miguel zapata I believe I encountered the exact same problem, and funnily enough, also posted a similar question a minute ago :) Any help will be very appreciated!
Yuval Porat Unfortunately as it says in the video, its all based on OpenFOAM 2.3 If you`re not using that I cannot predict what errors you will get using my files on earlier versions. Given the very large upgrades made to SHMesh between 2.0 and 2.3 I suggest you upgrade.
Probably you have either bad geometry (you have gaps somewhere) or maybe you have the "location in mesh" point incorrectly placed, errors in scaling often cause problem #2
The stl format of blender has a complete different encoding than catia or some other cad softwares. Just give it a try, you can see it in a editor (may be vim)
Really annoying how OpenFOAM changes so much between versions. For others who got derailed at SurfaceFeaturesExtract, that has been deprecated in openFOAM 11 and surfaceFeaturesDict is used instead. The command to run is sufraceFeatures
Hi Pier, Ok glad you found it - as you noticed I have a new website domain now. Sorry I missed your comment because it was captured by the spam filter. Can you tell me a bit about yourself and what problems you are solving in OpenFOAM ?
Went to obtain the files for this tutorial, only for AVG to report "We've safely aborted connection on www.calum-douglas.com because it was infected with HTML:RedirMe-inf [Trj]."
Well that has not been a problem to anyone else in 4 years, so I can only surmise that your AVG is playing up. I suggest you try from a different PC and tell me if the same thing happens.
Amitvikram Dutta ParaView is really just postprocessing software. You can mess around with VTK data - but I do not think its the right choice for preparing your STLs. MeshLab is very good free Linux software for manipulating STLs.
Amitvikram Dutta I don't think Paraview has this functionality. However, if you have different solids defined in your stl file, you can assign them to patches under snappyhexmesh.
Here's my problem. I have a rather complicated geometry which is like a pipe. I need to simulate internal flows through it. The problem is, I can't seem to assign patches to it before running the sHM process. If I try to assign groups to it in Salome and then import it as different stl files, whenever I run surfaceCheck it always shows an open geometry. If I define different stl files and concatenate them as this video shows, the same problem persists
Great stuff, Calum!
Thanks a lot for that video! I just learned a lot about sHM and actually consider giving it another try.
Two comments:
1.) It seems everything works for 2.0.x as well except for the surfaceFeatureExtractDict. In this version I just had to go with the old terminal command for each of the patches. Otherwise the tutorial seems to be very valid for that older version as well.
2.) How about adding the links to the different timesteps to the description? I took the freedom to kind of prepare that already for you:
OpenFOAM SnappyHexMesh Tutorial CAD Model View
OpenFOAM SnappyHexMesh Tutorial STL file format and patch names
OpenFOAM SnappyHexMesh Tutorial Scale STL to meters
OpenFOAM SnappyHexMesh Tutorial Merging STL files
OpenFOAM SnappyHexMesh Tutorial triSurface folder
OpenFOAM SnappyHexMesh Tutorial blockMesh
OpenFOAM SnappyHexMesh Tutorial surfaceFeatureExtract
OpenFOAM SnappyHexMesh Tutorial eMesh files
OpenFOAM SnappyHexMesh Tutorial surfaceFeatureExtractDict
OpenFOAM SnappyHexMesh Tutorial snappyHexMeshDict
OpenFOAM SnappyHexMesh Tutorial Edit boundary text file
OpenFOAM SnappyHexMesh Tutorial View the Mesh
OpenFOAM SnappyHexMesh Tutorial Layer addition parameters
OpenFOAM SnappyHexMesh Tutorial Volume refinement parameters
OpenFOAM SnappyHexMesh Tutorial run simpleFoam in parallel
OpenFOAM SnappyHexMesh Tutorial running showing residuals
OpenFOAM SnappyHexMesh Tutorial post-processing
OpenFOAM SnappyHexMesh Tutorial function object code template
OpenFOAM SnappyHexMesh Tutorial U and p results
Cheers,
Bernhard
I owe you an important part of my thesis! A clear explanation of how to set up and run a case, from the beginning to the end. I found especially useful the part on building the geometry, meshing, exporting files, converting files and those matching problems between programs (in particular from CAD to OpenFOAM). Thank a lot!
Glad it was helpful.
Don't apologize for long videos when they are clear and helpful ! Thanks for sharing.
Thanks a Lot for this Video, This is the most educating video for someone with zero knowledge in SnappyHexMesh!
Excellent tutorial. The only tutorial worth watching.
Thanks so much for your comment, I`m pleased it helped you so much.
Very helpful Calum. I am new to OpenFoam and am setting up a similar case, to the extent that I have an internal flow in a domain consisting of several parts (a spherical container with a cylindrical neck, the whole divided into four layers which are to have differing wall temperatures that result in a buoyancy-driven circulation). There is one aspect of the tutorial that had puzzled me, but perhaps now I have resolved it. We see in your tutorial (at about 39 min) that the needed entries for your patches (inlet, outlet, etc.) have been conveyed to your .../constant/polyMesh/boundary file, along with the unwanted patches stemming from blockMeshDict. In my case, while I am able to created the wanted mesh, my patch names do not propagate into .../constant/polyMesh/boundary. I have tried countless variations for snappyHexMeshDict, but have never succeeded to get those patches to appear (with their face count etc.) in constant/polyMesh/boundary.
To my surprise, after a good while puzzling over this, I found that the needed entries are made in ...run/casefolder/1/polyMesh/boundary and in
.../run/casefolder/2/polyMesh/boundary, so that one can copy the needed information over to .../constant/polyMesh/boundary.
Thanks for producing this video, appreciate the work, time and effort. This speed up the learning for someone new like me..
Calum, thank you very much for your work. Great stuff. For the beginners, who will work on newer versions of OpenFOAM: you will encounter some problems when applying the solver (the last step) with the files provided. Solution: stackoverflow.com/questions/48421407/openfoam-foam-fatal-error-unknown-turbulencemodel-type-rasmodel/48428177#48428177 . You will also need to change WallShearStress function in controlDict, as the syntax changed slightly. Check in OpenFOAM documentation for wallShearStress.
Thanks Jan, sadly I am too busy to update these at the moment :(
@@CalumDouglas No worries, thank you very much for all your work here on YT. It's immensely helpful for the first steps with OpenFoam.
@@MajPirate man thank you so much. I was going crazy when it didnt work. Actually the renumberMesh didnt work either. I then changed the setting descriped in the link and suddenly (at least) the solver started his job. I was a bit suprised about the time. It is my first experience in this domain and the solving just took about 3 1/2 min to finish.
Update: reconstructPar shows error -> Unkown patchField Type epsilonWallFunction for patch type wall
@@BOBOY162 I'm glad to hear it helped!
@@MajPirate Do you know a solution for this epsilonWallfunction error?
Hey! thank you for the video mate! please do try to upload the longer one, the 2 hr 20 min length video as well, students like us live by those videos man. please do upload that :)
Hi Callum! Thanks a lot for making the video. Really helped me a lot understand Snappyhexmesh.
Calum, the tutorial answered the questions i had about snappyHexMesh and it is very informative!
Well done and thanks for the video!
Hello sir. Can I utilise the snappyhexmesh tool for a triangular cylinder geometry?
Hello,idk if ur still active or not bu thanks for the tutorial, i just had a couple of problems.First when i do the reconstructparmesh, it gives me 3 new polymesh folder instead of combining them into one in the original one.And when i run the simulation it gives me an error in the fvschemes from line 32 to 39 where i defined the div and it says Entry 'div((nuEff*dev2(T(grad(U)))))' not found in dictionary "system/fvSchemes.divSchemes".It would be appreciated if you could give me any tips on how to fix this
Thank you so much, I followed your tutorial to export the model of a cardiovascular system, now I have to put the non-newtonian flow equations QwQ
Great video! Thanks for sharing it. Please, what could be recommendation to ensure addLayers work? I have tried low refinement in surfaces and regions, and they are not generated. You mentioned a 'good background'... how would be one? Thanks!
This is a very good video. Thanks. I am a question about using SHM. If I mesh a semi-submerged pipe (with on thickness) in a large domain using SHM, it will definitely cut off the outer part of the pipe. Is there a way to keep the whole pipe but the outer top as inlet while the inner top as open through which the flow can go into the domain? I am not sure if I explain it clearly, and I hope you offer any suggestions on it. Thanks.
Thanks for the video, it helps a lot in understanding sHM. However, is there any tutorial available to show how to extract the desired surfaces from the CAD program? I'm a newbie to AutoCAD and I don't manage to extract easily surfaces from my solid, which blocks me for solving my case.
Excellent work, Calum! Many thanks!
No problem, glad you found it useful. What are you using OpenFOAM for ?
Hello. I am unable to execute simpleFoam solver in Version 8. All other processes worked fine. I even edited the surfaceFeatureExtract to surfaceFeatures. But now i am stuck at running simpleaFoam.
Thank you very much!!! Finally someone made something useful about SHM tutorial!
Glad it was useful, if you want anything more specific please let me know.
Calum Douglas
I would like to ask if you're good as well with meshLab, and if you can publish a video on general using on how to deal with imported STL from CAD: i mean repairing, sewing ecc...
Michele Cavallerin Hi Michele, I do use MESHLAB - but I only use it for looking at STL files and also for changing their format from Binary to ASCII so I can change the patch names within the file. I put alot of effort into making my surfaces perfect before I export the STL. Much better than repairing a bad file later on....if you have a big problem I can make an STL from a STEP file for you.
Calum Douglas
ok thanks you anyway, I was just asking, because sometimes I face this problem and I was hoping to know someone skilled at meshlab usage. thanks anyway, but I do prefer "bother you with other questions concerning SHM as well, maybe directly on your web site, in case of help. thanks again for the video!!! bye
Hi Calum,
When you finish meshing with the SHM and modify the boundary file(delete the unnecessary patches) all the boundaries the SHM produces are of type "wall".. Is there any way to make some of them type "patch"?
Hi! I think the link you provided for the download of your tutorial files isn't working. Are there alternative links for us to access your files? Thank you!
Thank you for sharing the video! It is so much helpful in understanding the SHM.
Hi I liked your tutorial very much. The only thing I do not understand, is why you did the region refinement of "volume" in distance mode? what purpose is that? would it be the same to just refine the surface and then choose nCellsBetweenLevels higher, maybe 3?
Thank you Calum, really a great tutorial!
Hi thanks great video. I am solving a conjugate heat transfer problem and using snappy for that. Is it possible to identify different regions separately nto different cellZones using snappy ? like different solid regions and the background mesh to be identified as fluid. I want to split the mesh using cellzones later. Thanks a lot
Nice video, I'm just stuck with the pyFoamPlotRunner.py. I would like to see the residuals, installed gnuplot, numpy and pyfoam, but it gives the error: AttributeError: 'GnuplotProcess' object has no attribute 'gnuplot'. Any idea?
Thanks for the tutorial Calum. I am trying to export surfaces to STL as you've indicated, however since it is not a solid or a watertight body, it does not allow me to do so. Could you tell me what CAD software did you use to export the surfaces in the STL format?
never mind, I just checked Salome has the capability.
Hi, I have a question. What could be the reason of boundary file not being updated after I run reconstructParMesh -constant ? Is it possible that it would not work when the mesh is not water tight ? Or can you think of any other thing? Thank you so much for a great video and hopefully you can help me out :)
Great tutorial!
It was really helpful for any OF user.
Thank you very much for sharing this knowledge with us!
Best regards from Brazil!
Thanks, Calum. This tutorial was very helpful for my project.
Very good, glad it was helpful. When I have time I will try to do a new video as OpenFoam has a lot of newer versions, but Snappy is basically nearly exactly the same. Only a couple of small new features have been created.
I am working on OpenFOAM-v1706, and it worked like a charm.
This video actually helped me a lot in my thesis . And thanks in advance as I tried snappy and one of my surfaces (fins) got removed as zero sized patch.. is their anyway to solve this issue... am doing a multi region case with chtMultiRegionFOAM ( cooling of graphics card with fin) .Kindly reply .
Hi Calum, your video helped me alot! Very good step by step explanation there. I am a physicist working on my Ph.D. and I need to model flow through capillaries. So it's quite close to your case.
Hi Jan, may I ask permission to use your comment here to put on my website please ? I am planning to make some more videos and start a proper website. Your assistance would be much appreciated. Let me know with a comment underneath please ! Thanks!
Hi. I followed your tutorial and loved it! I do have a simple question before I start on my own project. I’ve modeled an elbow pipe with a second inlet in SolidWorks. I made a “cap” for the two inlets and outlet as separate parts and then assemble the 3 caps to my wall. So I created 4 .stl files from the assembly. In the tutorial, you also have the volume.stl. So I need to make the assembly I created in to 1 part and import that in to the triSurfaces as well?
To do distance defined surface refinement requires a single, closed STL file to work from. Hence if you wish to do that, yes you will also need an STL file which is a 100% closed surface.
Calum Douglas Thanks! I did that, but now I'm getting an error after changing to my stl files. Any chance I can email you what i changed and the error it gave me or do you prefer on here?
Edward Kraft You need to explain alot more clearly what you mean by "error".
You need to paste in the error message for a start, about 90% of SHMesh errors are caused by syntax errors.
Usually accidentally deleting a bracket, a semicolon, or mis-spelling a file name. When you are starting out,
make only one change at a time.
Thank you very much for this tutorial. That is really the best one I have found so far in the internet. Great work! :) One can see that you are really experienced with OpenFoam and CFD.
You`re welcome - glad you liked it.
Hi Manuel, may I ask permission to use your comment here to put on my website please ? I am planning to make some more videos and start a proper website. Your assistance would be much appreciated. Let me know with a comment underneath please ! Thanks!
I have a question, can someone please help me out?
I want to run the solver multiPhase/interFoam/RAS/floatingObject but by default it runs with a cuboid body, I have a cylindrical body in .stl format and I want to use it as a floating object.
How can I do this? I have been able to insert the cylindrical mesh in blockMesh by using snappyHexMesh, but how can I use the cylinder as a floating object? Thanks if someone can help me out, I am doing a univerisity homework :)
it's like having a cfd lesson from Theon Greyjoy lmao
thanks for the content.
Hmm not sure quite what that means but it seems you are intending it as a positive comment overall so thats ok. Dont recall Theon being much into his science....
@@CalumDouglas i'm only saying it because i'm not used to the accent. But i did intended to be positive it has been helping me a lot.
Hi Calum,
thanks for the tutorial!
I have a question about the *.eMesh file that is created by the surfaceFeatureExtract command. When I try to create the mesh with SnappyHexMesh the process fails because there seems to be a problem with the *.eMesh file. I have compared it to the fridgeA.eMesh from the iglooWithFridges tutorial and it has a totally different structure. What do your *.eMesh files look like?
Hi there,
I cannot help you without:
-Knowing which version of OpenFOAM you are using
-The error code / error message you get
In what way does "The process fail" ?
Calum Douglas
I'm using foam-extend-3.1 and get the following error message:
"Reading external feature lines.
--> FOAM FATAL IO ERROR:
Expected a '(' while reading VectorSpace, found on line 19 the word 'externalStart'
file: /Volumes/foam-extend-3.1/tutorials/multiphase/interFoam/ras/NACA0015Test/constant/triSurface/NACA0015.eMesh at line 19.
From function Istream::readBegin(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 86.
FOAM exiting"
I have uploaded my test case to dropbox.
www.dropbox.com/s/45nv9u8le7mthoa/NACA0015%20Test.zip
snappyHexMesh runs without any errors when I comment out the featureEdgeMesh in snappyHexMeshDict. But it seems to ignore my stl file because I cannot see the NACA airfoil in the mesh.
Axelander1111 OpenFOAM extend is a totally different branch of OpenFOAM. Which does not share the latest developments as openfoam 2.3. I have never used it and so cant help directly. Since you`re using a totally different OpenFOAM installation you will have to just google search your error codes.
Looks like is probably an issue with Binary vs ASCII file types.
Thanks for your reply! I already tried a google search but couldn't find a solution. Maybe I can try to test the case with another version of OpenFOAM.
Hi Calum! I guess you designed the pipe in a CAD software like Solid-Works/Solid-Edge or whatsoever.... How did you managed to extract the inlet/outlet/wall STL files from the CAD model (3:10)?
MegaSancho1990 Depends on what software you have. If you can save-as STL then you can do it. I just extract surfaces I want from the solid and then save each surface as an STL separately.
Calum Douglas What software did you use? Did you extract the surfaces from the solid before or after saving it as STL?
MegaSancho1990 I use commercial software to do that. As I said in the comment above, extract surfaces then save each as STL.
+Calum Douglas
First of all, Thank you Calum for providing this tutorial. I managed to mesh my first model in openfoam following your neat instructions.
My model is from medical scans, so the geometry is complex, but I managed to separate the STL parts using an opensource software: meshmixer.
Thank you!
sir how to convert stl file to stp file in salome?
You are the man!!! thanks for sharing and post more if you can!!!
Hello Calum,
Very good video indeed. I want to ask you a question about the boundary box. The blockMesh utility helps you define the boundary box but you define some patches on it(blockMeshdict file) why so? I mean do you need them somewhere?
In this case we`re deleting all the mesh outside of the pipe. So those patches should be deleted, however thats just because its an "internal flow" problem. If we were doing for example external aero on a car, we would keep the mesh OUTSIDE of the body, and so would need all those patch names from BlockMeshDict - eg as Inlet, Outlet, topwall etc etc. So thats why I start with a BlockMeshDict with named patches, as for many geometries and problems you WILL need them. Here those patches are not in the final mesh, and so should be deleted as it shows in my video.
Calum Douglas
Thanks for helping us all baby foamers, Calum! I wonder, how does the determination of BCs change if you have both internal AND external flow? E.g. an object in a channel - so flow around the object (external) which is sitting inside a channel (internal)?
Marta Drabek You`ll need to email me a picture. Its very easy to get confused with descriptions of model setups. You can contact me via my website contact form. Then I can email you back, so you can email attachments.
Hi Calum
I am trying to use snappyhexmesh for single stl file. In that case do i need to decompose, because I was trying to decomposePar but it was not working
I was trying to mesh a simple cylinder, i am getting following error for decomposePar
Unknown decompositionMethod ptscotch
Valid decompositionMethods are :
8
(
hierarchical
manual
metis
multiLevel
none
scotch
simple
structured
)
It would help to know which version of OpenFOAM you are trying to use.
But just to keep it simple, decomposing has nothing at all to do with how many STL files you may (or may not) have. DecomposePar is the command to do the meshing in parallel processing - depending on how many CPU cores you have.
I suggest you update to OFv2.3 if you have not already done so. Or try to run the "motorcycle" tutorial in your openfoam installatio and see if it works Because thats also a parallel snappyhexmesh case.
Thank you
Hi Calum
I have one more question
In this tutorial volume.stl file has complete geometry without any patch. And other STL file are for different patches. Is it necessary that we use separate stl file for each patch or we can add all patches in one file to appy boundary condition e.g in volume.stl in this tutorial
You do not need to use separate STL files you can join them together with the cat command in linux. However they are then named inside the snappyhexmeshdict in a different way. I dont think it matters which technique you use. The reason the volume stl is there, is to enable a regional distance refienment. To do that you must use a CLOSED stl volume so you cannot use the existing patches.
I have an issue related to my boundaries... I have 3 objects (2 solids and 1 fluid) which represent a pipe. Only the two solid regions appear at the polymesh/boundaries after the snap. I checked surfaceFeatureExtractDict and snappyHexMeshDict but it seems i did specify all correctly. I tried to keep all advanced settings standard tho.
I dont understand your question really, firstly what do you mean you have a fluid representing part of the pipe ? They need to be closed surfaces, exactly as in my description. You probably have problems with your STL files. Sorry its very hard to diagnose these things without photos, this process works so if it doesnt, and you followed it, then your starting CAD files are not ok. The most common problems are not scaling STL`s properly, having gaps from bad CAD and the mesh location point for snappy being in the wrong place.
@@CalumDouglas Nevermind. The problem was the cad file. Thanks!
Thanks a lot for this video, it was a great help for me.
it's nice for me, because of i doing the job about meshing in openfoam auto. thanks
How do you fix your Final/InitialLayerThickness for a required y+ value. How do you estimate it for a complex Geometry?
+Isaac Mark
First calculate what it should be:
www.cfd-online.com/Tools/yplus.php
Then run simulation, do yPlusRAS command in OpenFOAM- which will show you what y+ value actually IS. Alter your mesh and re-run.
Iterate until satisfied.
Unless you have adaptive meshing software, thats as good as it gets (there are some differences of opinion about how y+ is defined in the yPlusRas command.....but thats problem #2...I`m afraid).
Hi Calum,
first things first, this tutorial is great, thank you, however I wished to ask you a question:
I have created a good quality STL, snappyHexMesh runs fine and produce a good mesh, however I wasn't able to split this STL in parts to manage dimensions and boundary conditions. You can pinpoint me to the right direction perhaps?
thank you
+Riccardo Maione
Do the separation in the CAD program, and turn each part into an STL later on. Its a very messy buisiness manipulating STL`s you already have. But if you must then:
th-cam.com/video/6rostD8O5sg/w-d-xo.html
Hi Calum, I am facing a problem with merging two different stl files into a stl file with only one single object. I tried the "cat" command but I got a stl with two seperate objects. How can I do that? Thanks
David Zhang Yes CAT command is not for doing that. I think you are much better off modifying your shape in CAD and re-exporting.
However if you cannot do that I recommend experimenting with MESHLAB. However I have never actually tried to do what you are trying. It sounds messy and I do not think its a good way to get your mesh.
Calum Douglas ok, first I'll try with meshLab and I'll let you know. Thank you Calum Douglas!
Excellent tutorial - however I am stuck at the first step! You import your model as a series of .stl files such that you can define your patches and refinement areas later on. How is this done? For example if I built a simple pipe in SolidWorks, how could I define the inlet and outlet patches - without physically addding any additional volume to the pipe?
Best Regards
I dont really understand your question about "additional volume" because STL models are surfaces.
I`m afraid that you need to go onto a Solidworks forum and ask how to extract STL surfaces from that software package. You do not need a solid
model to do this, surfaces are ok too.
Right, I understand. Re: the pipe example, I am capable of exporting the pipe surfaces as an STL - however the inlet and outlet would obviously be an empty space - with no surface point data. I assume in OpenFOAM I could set this up as an "empty" patch, however I'm struggling to grasp this concept when there is no data there. I'm not sure whether my lack of understanding is CAD based or CFD theory based. Any ideas?
Thanks again for your time.
You can use a closed pipe and use open foams tools which can be set to work on angle difference to automatically separate into different patches (I never use this but it works) or you can create two 2D discs to represent each pipe end. These are then inlet / outlet patches.
Thanks for your input, i'll keep playing with the models
Hey Calum,
First of all thanks for the very informative video!
I have a question about the surfaceFeatureExtractDict.
I've tried to follow your instructions, but with some geometrie I've made myself in a CAD software.
As a starting point for the meshing I've copied the contents of the motorbike case from the tutorials as you suggested and ran the blockMesh.
However when I try to run the the surfaceFeatureExtract (and also everything that follows) I get error messages.
It seems that I need to change somehow also the surfaceFeatureExtractDict, which is not explained in your video.
So my question is basicaly how and what should I change before I can run surfaceFeatureExtract?
Thanks and keep up the good work!
It is all explained in the video, its also given in the contents that SurfaceFeatureExtract is described at 21:00. How to edit the surfaceFeatureExtract dict is shown at prescisely 23:10
Calum Douglas So true. sorry for that. don't know how I've missed it.
Thanks again!
Yuval Porat If you have an OF version previous to 2.2.0, you may have my problem since the surfaceFeatureExtractDict do not exist for those versions, I solved this problem executing (surfaceFeatureExtract -includedAngle 150 patchname.stl features) for every patch in order to generate the emesh files, you have to take into account that for executing this command you have to copy the stl files in the case directory instead of the triSurface directory
While following your tutorial I got to the point where I enter decomposePar but unlike your program the only out put I received was
Create time
Decomposing mesh region0
Create mesh
Calculating distribution of cells
Selecting decompositionMethod ptscotch
Attempting to use an MPI routine before initializing MPI
in addition to this when I entered
mplrun -np 8 snappyHexMesh -overwrite -parallel
I received the error: command not found
Any help would be much appreciated.
+Ryan Cunningham
Well I dont know if what you have pasted here is what you actually typed......but you have typed the letter "L" instead of "i" in the command mpirun.....
If you have issues other than that, you probably have bigger problems. I suggest you read this
web.student.chalmers.se/groups/ofw5/Basic_Training/runningInParallelLucchini.pdf
Van Sang Pham Generally means you are using a different version of OpenFOAM - or have installed something incorrectly. Please google before you post, there are lots of answers for this on cfd-online forum.....
+Calum Douglas Thank you!, I will check that.
Thank you, Calum. I can't thank you enough!
Glad it helped you, what were you struggling with in particular ?
@@CalumDouglas So... I am newbie with SHMesh. But this is being helpful already. Again, thank you!
hey, thank you Calum, very good tutorial indeed. But, I would like to get the files you show as examples, you say in the tutorial that they are available on your website but...I cannot find your website, I tried the calumdouglas.ch site but apparently it is free domain......
Hi Calum! First of all, thank you for a great video! I was wondering which program you used to extract the surfaces from the CAD model? I have managed to do it in Salome, but I end up with huge STL files, and quite bad quality. I have tried to export STL in Salome from both geometry and mesh module.
I use commercial CAD software, large sizes are common - for a full size car STL, easily 150Mb is common.
Low resolution STLs cause bad meshes in SHMesh....
Hello Calum! Really nice tutorial!
I'm using OpenFoam version 3.0 and when trying to run the model with the command: "mpirun -np 8 simpleFoam -parallel" the program runs but it fails almost inmediatly with the following error:
"Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
[0] [1]
[1]
[1] --> FOAM FATAL ERROR:
[1] Unknown TurbulenceModel type RASModel"
Do you know how I may solve it?
Many thanks!
This case is from 2014. So, may be he used OpenFOAM 2.3.0 or 2.4.0. There are a large number of differences between 2.3.0 or 2.4.0 and 3.0. So, you need to change the entry names one by one. I have similar experience. I am sorry but you need to make a lot of small changes. :(
As Thaw Tar says I am using OF 2.3, I suggest you look at the example cases in your OF 3.0 folder and read the commands used for each one to understand what has changed between versions.
I really appreciate this tutorial but I was wondering about a tutorial on external flow? I find this tutorial to be for internal flows, but how about external flows? like 3D flows through porous/non-porous obstacles? do you have any suggestion on that? would appreciate your reply. thanks!
Just dont delete the patch names in the boudary file like I do here, and obviously move your locationinmesh point to the other side of the domain. Be very careful with the blockmesh density, as if its too course with a very very fine mesh right up against the object inside, it will not converge. Also SimpleFOAM does not like to converge if you have a bad mesh, so eliminate all skew elements etc. Do not waste your time running any mesh that fails checkmesh, if you really have to get it running increase your solver tolerances from maybe 0.7 up to perhaps 1.0 but the solution will be less accurate.
Calum Douglas ok, so how do you remove skewed elements, what specific "checks" need to be followed? does it matter if my geometry is really small? it seems like my geometry is really small that there still exist skewed elements (you're right, blockMesh is coarse compared to geometry mesh..tried to make "fine" the blockMesh...still there are skewed elements) and that snappyhexmesh "messes" it up which makes it fail checkMesh... :-( can you help me with this? thanks so much.
Hernan Mejias Run checkMesh, this writes the areas that fail into files for you. These can then be viewed in paraFoam, after you convert them to VTK format. This will show you which areas are bad, normally means refining those areas more, or altering your geometry.
Hernan Mejias For example:
checkMesh
foamToVTK -faceSet skewFaces
paraFoam
Calum Douglas Hello there again! Thanks for the prompt reply. Well, I tried what you said and for some reason, my "simple" geometry which is a very small geometry though gets messed up and found that the skew faces occurs at the "angled" portions of my drawing...Imagine a cylinder with extruded sides (that's my simple geometry). So i got it "fixed" by using resolveangle 90 and up...but the mesh is OK for a single geometry...Unfortunately, I would like to simulate flow around multiples of this geometry, say, 50 times of such...and snappyHexMesh messes up my geometry big time...even if i increase the resolveangle to 130 (which I think shouldn't be the case or should i say would be bad), checkMesh fails big time! Of course I looked into the skew faces and well, from there, "portions" of my geometry are missing/broken/discontinued which makes my mesh fail. :-(
Hi Calum! Thanks for this great video. It's really helpful. I have one question for you. When I tried to run the mesh in parallel, I am getting this error even if I already reformatted the snappyHexMeshDict sample file. Any thoughts? thanks
(keyword castellatedMeshControls is undefined in dictionary "/home/psci/OpenFOAM/psci-2.3.0/run/BBSF_nopigs_SHmesh_3Dec/processor1/system/snappyHexMeshDict"
[1]
[1] file: /home/psci/OpenFOAM/psci-2.3.0/run/BBSF_nopigs_SHmesh_3Dec/processor1/system/snappyHexMeshDict from line 0 to line 0.
[1]
[1] From function dictionary::subDict(const word& keyword) const
[1] in file db/dictionary/dictionary.C at line 643.
Funny errors usually mean you have made a syntax error in the snappyhexmesh dict.
Almost certainly you have accidentally deleted a bracket, or missed out a semi-colon.
This is a pretty clear video, I'm not so expert creating meshes so I'd like to know how exactly do you create .stl files, are they simply exported from a CAD?, did you create one by one? or did you split the whole geometry in every patch? thanks for the help (y)
The geometry was made in CAD as a solid model. then surfaces extracted for each required patch. Each surface can then be exported as an STL. Its very very important to set the STL export settings to maximum fine-ness for a good result with SHMesh. You can do this in opensource with Salome-Meca.
Calum Douglas Trying to follow your instructions with my own mesh I get an error when executed surfaceFeatureExtract command, I tried executing the same sequency on your example files too and I get the same error "FOAM FATAL ERROR: Wrong number of arguments, expected 2 found 0", I dont know if its a problem of my OF installation or its from the dictionary settings, have you any idea of how to solve it, thanks for the help
miguel zapata I already found the error, it was a problem of OF version in 2.1.1 that dictionary is not available so you have to input the parameters of every patch with the comand (surfaceFeatureExtract -includedAngle 150 surface.stl features) to create the emesh files
miguel zapata
I believe I encountered the exact same problem, and funnily enough, also posted a similar question a minute ago :)
Any help will be very appreciated!
Yuval Porat
Unfortunately as it says in the video, its all based on OpenFOAM 2.3
If you`re not using that I cannot predict what errors you will get using my files on earlier versions. Given the very large upgrades made to SHMesh between 2.0 and 2.3 I suggest you upgrade.
SOLIDWORKS USERS: you need to rename file extension from .STL to .stl for surfaceFeatureExtract to work.
Hello everyone!
I use snappyHexMesh but it does the refinement job, but does not remove the extra cells. Can anyone identify the problem.?
Thank you!
Probably you have either bad geometry (you have gaps somewhere) or maybe you have the "location in mesh" point incorrectly placed, errors in scaling often cause problem #2
Thank you so much
Thank you Calum, really helpful !
have you ever use blender to generate STL files?
No I`m afraid that I do not use Blender.
The stl format of blender has a complete different encoding than catia or some other cad softwares. Just give it a try, you can see it in a editor (may be vim)
great tutorial, helped me a lot
Thanks for the tutorial!
No problem, can you tell me what was most useful about it for you ?
Really annoying how OpenFOAM changes so much between versions. For others who got derailed at SurfaceFeaturesExtract, that has been deprecated in openFOAM 11 and surfaceFeaturesDict is used instead. The command to run is sufraceFeatures
Thanks for the great tutorial!
no problem, found it, thank you!
Hi Pier, Ok glad you found it - as you noticed I have a new website domain now. Sorry I missed your comment because it was captured by the spam filter. Can you tell me a bit about yourself and what problems you are solving in OpenFOAM ?
Wonderful video, thanks a lot.
Good - I`m pleased it helped you.
good and detailed explanation :)
helps a lot ,thank you
Went to obtain the files for this tutorial, only for AVG to report "We've safely aborted connection on www.calum-douglas.com because it was infected with HTML:RedirMe-inf [Trj]."
Well that has not been a problem to anyone else in 4 years, so I can only surmise that your AVG is playing up. I suggest you try from a different PC and tell me if the same thing happens.
@@CalumDouglas I used an Android tablet, not running AVG and everything is ok. Seems AVG was a little over zealous.
god you helped me a lot !
Otherwise you also have paraview who can do the same job.
David Zhang Can Paraview take an stl file and add patches to it?
Amitvikram Dutta ParaView is really just postprocessing software. You can mess around with VTK data - but I do not think its the right choice for
preparing your STLs. MeshLab is very good free Linux software for manipulating STLs.
Amitvikram Dutta I don't think Paraview has this functionality. However, if you have different solids defined in your stl file, you can assign them to patches under snappyhexmesh.
Here's my problem. I have a rather complicated geometry which is like a pipe. I need to simulate internal flows through it. The problem is, I can't seem to assign patches to it before running the sHM process. If I try to assign groups to it in Salome and then import it as different stl files, whenever I run surfaceCheck it always shows an open geometry. If I define different stl files and concatenate them as this video shows, the same problem persists
David Zhang Do you, mean by concatenating them like Callum does in this video? Whenever I try that, it results in an open surface :(
gut gemacht
Bitte schön
Excellent tutorial. Thank you!
perfect video, thank you so much!