|
[Sponsors] |
January 21, 2019, 10:45 |
TopoSet - When to use it?
|
#1 |
New Member
Vitor Heitor Cardoso
Join Date: Jan 2019
Location: Rio de Janeiro
Posts: 10
Rep Power: 7 |
Dear CFD community,
I am currently working on a model to simulate a single-phased flow through several obstacles, but I am still a newbie when the subject is OpenFOAM. To do so, I use the Gmesh open-source mesh generator, and then i convert it to OpenFoam format. Seems ok to me. But When i try to simulate the problem, I get the error: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PISO: Operating solver in PISO mode Reading transportProperties Reading field p --> FOAM FATAL IO ERROR: patch type 'patch' not constraint type 'empty' for patch frontAndBack of field p in file "/mnt/c/Users/heitorvitorc/Desktop/OpenFOAM/Projetos/teste_10-01-19/0/p" file: /mnt/c/Users/heitorvitorc/Desktop/OpenFOAM/Projetos/teste_10-01-19/0/p.boundaryField.frontAndBack from line 26 to line 26. From function Foam::emptyFvPatchField<Type>::emptyFvPatchField(c onst Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double] in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 80. FOAM exiting After a while I started to wonder if it is necessary to create a topoSetDict for this simulation, but the thought was totally random (I cant expose facts to prove the need for the topoSetDict). When do I need to set the topoSetDict for a simulation? Is its setup related to simulations with free surfaces? |
|
January 22, 2019, 17:23 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Previously when I've made meshes with Gmsh, the converter worked fine but changed all patch times to the generic "patch"-- in constant/polyMesh/boundary. So I would go and change them back to what I wanted them to be (ie with sed). This will allow you to use the mesh.
Caelan |
|
January 23, 2019, 05:24 |
|
#3 |
Senior Member
Zander Meiring
Join Date: Jul 2018
Posts: 125
Rep Power: 8 |
in your case: navigate to constant/polymesh/boundary. Near the top of this file you will see all your boundary names, along with some information about them. The important part of this is what their type is. Having never worked with gmsh, I assume it sets all the types to be of type patch. However, for working with a 2d mesh two of your boundaries should be of type empty (or 1 boundary if you lumped them together), and all walls should be of type wall.
When converting meshes, it's important to look at these definitions, and should be simple enough to edit manually. However, using a topoSetDict can allow openFoam to change these for you using a command. If the types are the only thing wrong, changing manually would be the simplest solution. I will however reiterate; I've never worked with mesh conversion, so I'm not sure what changes all would need to be made |
|
January 23, 2019, 05:26 |
|
#4 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Seeing the error message you get, I would say you try to run a 2D case and you have a patch named "frontAndBack" for the surfaces in the 3rd direction. The "frontAndBack" patch is defined as "empty" in every variable file in the 0 directory, but you get this error because "frontAndBack" needs to be defined as "empty" instead of "patch" in "constant/polyMesh/boundary" (or "processor*/constant/polyMesh/boundary" for a decomposed case)
Here is the generic explanation: Every patch in the mesh has a base type: patch, wall, symmetryPlane, empty, etc... The boundary conditions rely on these base types, which means there are specific boundary conditions for specific base types. Have a look in the documentation about boundaries : https://www.openfoam.com/documentati...boundaries.php As Caelan said, when you import your mesh in OpenFOAM, the converter sets the generic "patch" type to all patches in your mesh. You have to modify these base types in the "boundary" file if required. (ie. patch on the inlet and outlet patches, wall on wall patches, empty on side patches if you run a 2D case) If you run your case in serial, you can manually edit the constant/polyMesh/boundary file. If you have a decomposed case, you can use "sed" as suggested by Caelan, or use the changeDictionary utility, to edit the boundary file in every processor* directory. |
|
Tags |
openfoam 5.x, toposet, toposetdict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fail to run series of runApplication topoSet -dict | jiahui_93 | OpenFOAM Programming & Development | 1 | May 25, 2022 13:56 |
[snappyHexMesh] Porous Media using TopoSet | RobertoCirolini | OpenFOAM Meshing & Mesh Conversion | 3 | August 30, 2016 09:34 |
[Other] cellLevel field not readable by topoSet | blaise | OpenFOAM Meshing & Mesh Conversion | 0 | June 30, 2015 05:35 |
[Other] topoSet Wrong number of faces. | a19910112a | OpenFOAM Meshing & Mesh Conversion | 1 | June 9, 2015 06:41 |
[snappyHexMesh] HOW to set a circular face by toposet | Jessica | OpenFOAM Meshing & Mesh Conversion | 2 | September 12, 2013 21:54 |