|
[Sponsors] |
June 15, 2012, 07:18 |
Specifying patch type for GmshToFoam
|
#1 |
Member
Alain Martin
Join Date: Mar 2009
Posts: 40
Rep Power: 17 |
Hi all,
I remember having used a version of GmshToFoam where the patch type as well as the name was provided in the mesh Physical group. Why was it removed? And can it be put back in without too much effort. I am tired of having to edit the boundary file for every change I make to the design. Thank you in advance. |
|
June 15, 2012, 07:56 |
|
#2 |
Disabled
Join Date: Mar 2011
Posts: 174
Rep Power: 15 |
What type of changes do you need to make to your boundary file?
Perhaps a combination of the already existing utilities changeDictionary and autoPatch may work for you. Or even sed. I have only used gmsh briefly in the past, could you please post an unedited boundary file and a "corrected" one? |
|
June 15, 2012, 08:13 |
|
#3 |
Member
Alain Martin
Join Date: Mar 2009
Posts: 40
Rep Power: 17 |
This the change I want:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 5 ( frontAndBack { type empty; nFaces 10092; startFace 7328; } lowerWall { type wall; nFaces 214; startFace 17420; } outlet { type patch; nFaces 59; startFace 17634; } upperWall { type wall; nFaces 184; startFace 17693; } inlet { type patch; nFaces 25; startFace 17877; } ) Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 5 ( frontAndBack { type patch; nFaces 10092; startFace 7328; } lowerWall { type patch; nFaces 214; startFace 17420; } outlet { type patch; nFaces 59; startFace 17634; } upperWall { type patch; nFaces 184; startFace 17693; } inlet { type patch; nFaces 25; startFace 17877; } ) |
|
June 15, 2012, 08:43 |
|
#4 |
Disabled
Join Date: Mar 2011
Posts: 174
Rep Power: 15 |
Two possibilities that I mentioned:
- changeDictionary: check the tutorials for chtMultiRegionFoam. You just run changeDictionary after placing something like this in the changeDictionaryDict in the system folder Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object changeDictionaryDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dictionaryReplacement { boundary { frontAndBack { type empty; } lowerWall { type wall; } } } // ************************************************************************* // cat constant/polyMesh/boundary > temp sed -i temp -e '42s!patch!empty!' mv temp constant/polyMesh/boundary Off course, this may not work if you make changes in the number of patches because the boundary file will change significantly. The first way is much better. But, off course, if someone knows a solution within gmsh, that would be much more elegant. |
|
June 15, 2012, 08:59 |
|
#5 |
Member
Alain Martin
Join Date: Mar 2009
Posts: 40
Rep Power: 17 |
Thank you very much. I did not know about this command, I did not run and inspect all the tutorials.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create a GeometricField of a given type on given patch? | philippose | OpenFOAM Programming & Development | 4 | August 12, 2013 13:41 |
Cyclic Boundary Condition | Luiz Eduardo Bittencourt Sampaio (Sampaio) | OpenFOAM Running, Solving & CFD | 36 | July 2, 2012 13:23 |
singularity? | mihaipruna | OpenFOAM Running, Solving & CFD | 5 | April 24, 2012 18:18 |
CheckMeshbs errors | ivanyao | OpenFOAM Running, Solving & CFD | 2 | March 11, 2009 03:34 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |