irregular model simulation with chtMultiregionFoam
1 Attachment(s)
Hello everyone
I am simulating a turbulence and heat transfer problem with chtMultiregionFoam.But the geometrical model is irregular.It looks like the picture I attached.I have used chtMultiregionFoam before but with simple model only ,like rectangular duct flow.So I just know how to deal with the simple model which I can assign different fields in the file named makeCellSets.setSet easily. Can you tell me how to assign the different domains with complex geometrical model?The meshes I used are generated with ICEM. Thank you very much! regards! lg88 |
Hi lg88,
Well... since the mesh is coming from somewhere else, you'll need some form of identification coming from the ICEM's side. So it really depends on how far you've gotten right now. Are you able to export and convert the whole and complete mesh to OpenFOAM? Or are you exporting in parts? You can use STL surfaces to help isolate the zones for each volume and then use surfaceToPatch. Then work from there with setSet or topoSet. If the meshes come in separate volumes, you'll have to use mergeMesh at some point... either before or after the sets have been defined. Good luck! Bruno |
Hi Bruno
Yes ,I have exported and converted the whole and complete mesh to OpenFOAM.But if necessary I think I can exported the mesh in parts also. Code:
You can use STL surfaces to help isolate the zones for each volume and then use surfaceToPatch. How to use surfaceToPatch and setSet or topoSet? Can you tell me where can I obtain relative tutorials or information about that? Thank you very much! lg88 |
Hi lg88,
Have you never used snappyHexMesh? STL is the usual file format for 3D geometries, which was the first format used with snappyHexMesh in the famous "motorBike" tutorial. You can find such STL files being used with snappyHexMesh in the tutorial "heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater". Run the following commands to see tutorials that use topoSet, createPatch and so on: Code:
find $FOAM_TUTORIALS -name topoSetDict As for surfaceToPatch, it should be intuitive after you understand the other tutorials, specially if you check the arguments it expects: Code:
surfaceToPatch -help Bruno |
Hi Bruno
Yes,I have never used snappyHexMesh.The mesh I used before was generated by ICEM.And I will look into the tutorials which you suggested. By the way, Code:
If the meshes come in separate volumes, you'll have to use mergeMesh at some point... regards lg88 |
Hi lg88,
I wrote "at some point", in the sense of bullet points. The steps I imagined were:
As for mergeMeshes: unfortunately I've never understood it very well either. All I know is that mergeMesh will place the requested meshes into the same mesh space, but it will not attach faces automatically. Here's the page at openfoamwiki.net: http://openfoamwiki.net/index.php/MergeMeshes Good luck! Bruno |
Hi Bruno
Can you tell me how to define cells for each volume as a particular cell zone?The second step that you told me to do.I just give them different region names and put them at different folders as the folder structure in chtMultiRegionHeater. regards! lg88 |
Hi lg88,
OK, let's try to do this in steps then. Here's what I'm going to ask you to do:
This way it'll be easier to explain how to do it, namely with a practical example. Best regards, Bruno |
1 Attachment(s)
[Moderator note: The following quote is a group of posts that were moved from this thread: http://www.cfd-online.com/Forums/openfoam-solving/123840-heattransfer-pipe-using-chtmultiregionfoam.html]
Quote:
Hi Bruno, I want to learn how to define boundaries of a irregular region. I have a U-shape pipe which is buried in a solid region. I create this U-pipe using the topoSetDict and the blockMesh was defined for the cubic solid region. Now, I have a problem defining boundaries. In the chtMultiRegionFoam/multiRegionLiquidHeater the boundaries were defined as minX,maxX,minY,maxY, blaaa But, in my case this is only can be valid for solid. But for the fluid, as I have to give different boundary condition for inlet and outlet of the pipe, I can't understand how to define boundaries. I have attached the schematic of my domain. Can you give me a hint for this. Best, Kumudu |
Hi Kumudu,
OK, regarding the case set-up, I suggest that you start by studying this very simple tutorial: http://openfoamwiki.net/index.php/Ge..._-_planeWall2D - then start playing with the case configuration, as explained in that tutorial. This will give you more experience than any answer people can give you. In addition, it will give you the sense that you need (and how) to be able validate your simulations. As for the geometry+mesh, I suggest you should do one step at a time, by starting with a simple example and then gradually add more complexity to it. In summary, I suggest that you follow these steps:
Best regards, Bruno |
Quote:
Thank you very much. I have already done steps up to 3rd . I just have to go through the 4rth step. Thanks again. This means a lot to me. Best, Kumudu |
Quote:
OK, then what exactly do you have?
|
1 Attachment(s)
Quote:
I didn't do it right now. I am not that talented:). I did it before. I created a single blockMesh. And created regions using topoSet. Since, after topoSet command is run, I ran the command, splitMeshRegions -cellZones -overwrite. Now I have more than one block. Only problem I had using multiRegionLiquidHeater tutorial case, is my less knowledge in merging mesh, I guess. I can't understand how to define boundaries as inlet and outlet for the fluid region. Because , I used only one blockMesh. I am attaching the one pipe case, that I created.I realized that some boundary conditions may be wrong. I will make them correct and upload the corrected one. I will upload the fluid region having the U-shape created using topoSet. And blockMeshDict (one block). then, you can tell me exactly what should I do to define different boundaries at the blockMesh. Thank Bruno, Kumudu |
Hi Bruno,
I think I have misunderstood the steps. I haven't really go through SwiftBlock properly. I will go through these steps. And let you know. I thought you are saying that make a one fluid region using one pipe. I am really going crazy with thesis. Thanks again. Once I did all these steps, I will posted the new one. Best, Kumudu |
1 Attachment(s)
Hi Kumudu,
This is indeed a nice simple example! Although a bit familiar... looks a bit like the 2D plane wall: http://openfoamwiki.net/index.php/Ge..._-_planeWall2D - but extended to 3D. You've got at least one problem here, as shown in the attached image "Screenshot from 2013-12-26 19:06:11.jpg", that after running splitMeshRegions, the 3 regions are far from perfect. You need to better define the boxes in "topoSetDict". Have a look into the region folders inside the "constant" folder. Look for the files "polyMesh/boundary" in all of them and you'll find the names of the patches that were assigned automatically to each one side of the regions. For example, if you look into the file "constant/bottomWater/polyMesh/boundary", you'll find two new patches:
Quote:
Good luck! Best regards, Bruno |
Thanks Bruno,
You are so generous and brilliant. Above the the comment, I think, I understood the problem. Quote:
Quote:
In the Example/system/bottomWater/changeDictionaryDict, I have defined, the boundary conditions for velocity and temperature For velocity,U Code:
U Code:
T Thanks again. Kumudu |
2 Attachment(s)
Quote:
Dear Bruno, As you suggested I read the link on SwiftBlock. I think this for irregular geometries. For the time being, I just need to create the U-pipe using three rectangles. That is done. For now, I am not concern about the cylindrical Shapes of pipes. I have created the U-pipe using topoSet. As I said before, my only concern is to define the boundaries of the region I created for fluid because I need to name the boundaries of the liquid region as inlet, outlet and wall. You can see that, in the attachment that I have created the U-pipe easily using topoSet. I can do this for cylindrical shape (without using boxToCell ) using cylinderToCell. So, I will get the pipe (cylindrical shape) geometry easily. I did the following, blockMesh for ground (a cube with for now I reducing the sizes to 120 mm*120mm*50m) topoSet (this will create liquid region as the U-shape pipe and other all parts as ground) splitMeshRegions -cellZones -overwrite ok, now I have U-shape block for liquid region and cubic shape block for ground, cells other than included in the water (pipe shape). This way I can get a perfect mesh without any complex meshing method. Lets say, I defined one block in the blockMeshDict with all faces as walls. So, my U-shape is with walls. I can even change the inlet and outlet as patches if I am considering my pipe flow as open pipe flow by setting maxZ into patches in the changeDictionaryDict. So, every thing is good, other than defining inlet and outlet boundary conditions for liquid. Because, If I consider closed pipe flow, B.C for velocity, inlet, fixedValue= (0,0,-4) outlet, zeroGradient wall, fixedValue = (0,0,0) Just tell me now how to define the inlet and outlet faces as the same to liquid. Then, I can easily give required boundary conditions in the changeDictionaryDict as follows, Code:
U Thank you very much for helping me. I am really really grateful to you for this. Best regards, Kumudu |
Hi Kumudu,
Quote:
Quote:
Quote:
Quote:
Quote:
OK, the main utility that you are missing and are searching for is createPatch. It's similar to topoSet, in the sense that the dictionary shares some similar features, but the objective of createPatch is very simple: to take a "faceSet", existing patch or patches and create a new patch from any of them. It will also do some house cleaning, by removing the patches that have no mesh faces assigned to them :D. Therefore, since you already have good experience with topoSet, you can easily create one or more "faceSet" that are the selection of faces in already existing patches, even in case you don't want to use the whole patch. In case you don't already know, this page gives a very nice description of what topoSet can do: http://openfoamwiki.net/index.php/TopoSet Now for createPatch: http://openfoamwiki.net/index.php/CreatePatch - That wiki pretty much sums it all very nicely. The information that might escape you upon reading the wiki page is this:
Best regards, Bruno |
Quote:
Again, I am really grateful to you. Thanks, Kumudu |
Hi Kumudu,
You're welcome! Quote:
In other words: the selection won't modify the mesh itself. But you can do some mesh manipulation, once the correct selections are made and operated upon. Not wanting to throw you off the right track, but this is just to give you an idea of what can be done with sets: http://openfoamwiki.net/index.php/SetSet#Usage_example - in that example, the idea is to select all cells and faces that are sort-of damaged and remove them completely by using subsetMesh to operate on the cell selection. Best regards, Bruno |
Quote:
I didn't really had time to go through the tutorial you sent me, because, I got some error in running the prepared case in the campus server. So, I am still figuring it out. Then, I have to look in to the tutorial you sent me. Thanks again. Best regards, Kumudu |
1 Attachment(s)
Quote:
The idea is that a "faceSet" allows you to select a specific group of faces in the mesh; this means that you could define the new "inlet" patch from, for example, a few faces from "maxY", instead of renaming the complete patch "maxY" in the respective region. Attached is the image "example.png", that gives a better idea of what createPatch can do. In it you will see the possible scenarios:
The detail I was trying to indicate in the previous post, is that the faces selected with "f0", cannot be morphed directly into a circle. For that, you would need an additional application that would manipulate the mesh in a way that it would distort the mesh, by using the selection "f0" to know which faces needed to be manipulated. The conclusion from all of this... is this: when you come to the point that you need the cylinder shape for the I-pipe, you need to design it directly in "blockMeshDict". Because topoSet and createPatch will only be able to do assign names to the existing mesh. |
Quote:
wow. You are a great teacher:). Thanks alot. So, what if I create the cylindrical tube using topoSet, cylinderToCell. You mean I still cannot rename it using createPatch or faceSet. Only square shapes. Thanks thanks. Kumudu |
Quote:
Give it a try and you will see for yourself what I mean ;) |
Quote:
Best regards, Kumudu |
Grading the mesh for chtMultiRegionFoam
1 Attachment(s)
Quote:
The instructions you gave worked perfectly. Now I have another problem, As I didn't give any cell expansion ratio, the number of cells are so high. Therefore, I cannot load the soil region to view in the paraview. So, I need to grade my blockMesh, as in the attached picture. Can you tell me how to do this?. Thanks in advance. Kumudu |
Hi Kumudu,
I cannot open properly the DOCX file because I'm using LibreOffice. If you could attach in PDF format, it would be easier for me to properly see the content. In general, there are at least 3 ways for creating a cell expansion:
Best regards, Bruno |
1 Attachment(s)
Quote:
Thanks for replying me. Sorry. Here is the pdf version. Best regards, Kumudu |
Hi Kumudu,
Ah, much better! The PDF is a lot clearer! I think you can easily use the current configuration you have for "blockMeshDict". You need to create a "cellSet" that selects all cells that are to be refined and then use refineHexMesh: http://openfoamwiki.net/index.php/RefineHexMesh Example: Code:
refineHexMesh c0
Bruno |
Quote:
Many many thanks to you. I will do the way you said. Best regards, Kumudu |
Dear Bruno,
Can you tell me, whether the following steps are correct ? 1.blockMesh 2.topoSet defining faceSet for inlet and outlet 3.createPatch -overwrite(rename the patches as inlet and outlet) 4. topoSet defining regions 5.topoSet to define cellSet that corresponding to fine mash 6.refineHexMesh 7.splitMeshRegions -cellZones -overwrite Thanks , Best regards, Kumudu |
Hi Kumudu,
Good thing you listed the whole list. I forgot about splitMeshRegions. My advice is to do it in this order:
Best regards, Bruno |
Quote:
Thanks Bruno Kumudu:) |
Quote:
I am sorry for disturbing you. I actually did the other way around for the previous case, without go into refining the mesh 1.blockMesh 2.topoSet defining faceSet for inlet and outlet 3.createPatch -overwrite(rename the patches as inlet and outlet) 4. topoSet defining regions 5.topoSet to define cellSet that corresponding to fine mash 6.refineHexMesh 7.splitMeshRegions -cellZones -overwrite But, it gave me the solution. However, there was a problem in that. It showed maxZ in the polyMesh/water, which shouldn't be there. But, Glyne showed that the direction of the velocity is correct. I just copied 0/water/T, Code:
boundaryField Quote:
I run the topoSet for inlet and outlet case as this : Code:
runApplication topoSet -dict system/topoSetDict01 Quote:
Thanks Bruno, Again sorry Kumudu |
Hi Kumudu,
The "-region" option, I referred to it here: http://www.cfd-online.com/Forums/ope...tml#post467877 post 18 Examples: Code:
topoSet -region water Best regards, Bruno |
Quote:
Thanks. Yes, as you said, I looked in to the "0/water/polyMesh/boundary". There are faces associated to the maxZ. So, it means, if I included the topoSet for faceSet defining inlet and outlet in the system/water/topoSet01 and run (I don't understand the correct way to run) topoSet -region water -dict system/water/topoSetDict1 and then, include the createPatch in the system/water/createPatchDict and run as createPatch -region water -dict system/water/createPatchDict But, I got an error running the createPatch when I included the system/water/createPatch previously saying "cannot find the createPatch". At that time I didn't included the -region option. I actually didn't previously understood the "-region option". Sorry. Could you please tell me the correct way to run it?. I think the command lines are wrong. Best regards, Kumudu |
Hi Kumudu,
I need to see the full command you used and the full output message from that command. Otherwise, I can't deduce what went wrong. The reason why there are still faces associated to "maxZ" is probably because the inlet and outlet do not fully replace all faces for it. If you can share the case you have right now, it's easier to help you. Best regards, Bruno |
1 Attachment(s)
Quote:
I am attaching the file. Thanks again, Kumudu |
Hi Kumudu,
First problem - this line: Code:
topoSet -dict system/topoSetDict1 Code:
topoSet -dict system/topoSetDict01 Same goes for "system/topoSetDict2" -> "system/topoSetDict02". As to explain what I meant before - you currently have got this: Code:
runApplication blockMesh Code:
runApplication blockMesh Bruno PS: I will probably only be able to answer to questions in 6-7 days from now. Good luck! |
Dear Bruno,
Thank you very much. I actually run, topoSet -dict system/topoSetDict01 I didn't use the Allrun command. That is why I forgot to put the correct name for the topoSet in the Allrun file. Sorry for that. Now I understand correctly. Thank you very much. Without your help , I will be stuck in my thesis.Now I am really happy:). Thanks, Kumudu --------------------------------- Quote:
I will need to run the refineMeshDict for more than once. I saw that refineMesh has been used in the multiphase/cavitatingFoam/les/throttle/Allrun as follows, Code:
refineMeshByCellSet() Thanks in advance, Kumudu |
All times are GMT -4. The time now is 13:07. |