|
[Sponsors] |
November 30, 2015, 00:59 |
There is a bug in createPatch?
|
#1 | ||
New Member
Ferensa Oemry
Join Date: Nov 2015
Location: Jakarta, Indonesia
Posts: 3
Rep Power: 11 |
Dear all,
I'm new user to OpenFoam and I just have learned it for a few months. In brief, I'm interested to use OpenFoam to simulate electromagnetic fields for my study case. As starting point, I learned to reproduce Ze Huang's work in his thesis "OpenFoam Simulation for Electromagnetic Problems"and successfully obtained similar results. Since I'm planning to use a rather complex geometry, I used snappyHexMesh to reproduce Ze Huang's work for similar geometry that he created using blockMesh. The result was far from what I expected. In the first figure (see the attached file named as "Elpot_at_positive_z_direction.jpg), I noticed that there is a distinct gap interface between the small square box (rodUp) and its bigger surrounding neighbor. When checking the sets and the zones of my geometry, I found that that there is unexpected mesh (faceset) as indicated by an arrow (see "Elpot_rod_comparison.jpg") Furthermore, these unexpected mesh is created by createPatch when converting "rodUpFace" and "rodDownFace" facesets into "rodUp" and "rodDown" patches. The facesets were generated by topoSet and here is my topoSet configuration. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( // create new rodzone { name rodZone; type cellSet; action new; source zoneToCell; sourceInfo { name AMIZone; } } { name rodUpFace; type faceSet; action new; source cellToFace; sourceInfo { set rodZone; option all; } } { name rodDownFace; type faceSet; action new; source cellToFace; sourceInfo { set rodZone; option all; } } { name rodUpFace; type faceSet; action subset; source patchToFace; sourceInfo { name maxZ; } } { name rodDownFace; type faceSet; action subset; source patchToFace; sourceInfo { name minZ; } } ); // ************************************************************************* // Quote:
For my createPatch configuration: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createPatchDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Do a synchronisation of coupled points after creation of any patches. // Note: this does not work with points that are on multiple coupled patches // with transformations (i.e. cyclics). pointSync false; // Patches to create. An empty patch list just removes patches with zero // faces from $FOAM_CASE/constant/polyMesh/boundary. patches ( { name rodUp; patchInfo { type patch; } constructFrom set; set rodUpFace; } { name rodDown; patchInfo { type patch; } constructFrom set; set rodDownFace; } ); // ************************************************************************* // Quote:
1. Is this bug in createPatch? 2. Does this unexpected mesh (facesets) created by createPatch would affect the result of the solver? Thank you, Cheers Ferensa Note: If someone need to reproduce my work, please use "united.zip" file |
|||
December 6, 2015, 15:52 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Ferensa,
I've tested the case you attached with both OpenFOAM 2.4.x and 2.4.0, but I was not able to reproduce the same error. I ran the commands you instructed in the README file, namely: Code:
1. blockMesh 2. surfaceFeatureExtract 3. snappyHexMesh -overwrite 4. topoSet 5. createPatch -overwrite 6. createBaffles -overwrite Did you perhaps run any command slightly differently? Do you have any folders named "1" or "2"? Best regards, Bruno
__________________
|
|
December 8, 2015, 01:25 |
|
#3 |
New Member
Ferensa Oemry
Join Date: Nov 2015
Location: Jakarta, Indonesia
Posts: 3
Rep Power: 11 |
Dear Bruno,
Thank you for your reply. I ran the commands exactly as given in the README file, and no folders 1 and 2 inside my case folder. Here is what I did to obtain the weird surface faces on my case. After executed the commands in README file and followed by executing paraFoam, I carried out these following steps. 1) Check "include Sets" and "include Zones" boxes (as indicated in "Unite-01.jpg" figure) 2) Uncheck "internal Mesh" box. 3) Check "rodUp" and "rodDown" patches boxes (see Unite-02.jpg) 4) Check "rodUpFace" and "rodDownFace" faceSets boxes (see Unite-02.jpg) 5) Click "apply" Cheers, Ferensa |
|
December 8, 2015, 05:57 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Ferensa,
So what happens is this:
And if you want to recover the faceSets, you can use another topoSet to recreate them by using the operation "patchToFace", if I remember correctly. Best regards, Bruno |
|
December 11, 2015, 05:12 |
|
#5 |
New Member
Ferensa Oemry
Join Date: Nov 2015
Location: Jakarta, Indonesia
Posts: 3
Rep Power: 11 |
Dear Bruno,
Thank you for pointing out the change of startFace number in boundary file Note: Recovering the facesets from "rodUp" and "rodDown" patches using topoSet does not solve the issue since the patches are generated from corrupted facesets. I checked again my boundary file before and after executing CreatePatch, and now I know why the values of startFace shifted. From my experience on "propeller" case tutorial, if the boundary patch names that created by createPatch are similar with those created by blockMesh or snappyHexMesh. The startFace values of those patches would remain the same. However, if the boundary patch names that stated in createPatch are different from those created by blockMesh or snappyHexMesh, createPatch would remove the old patch names along with their ID numbers, and allocate new ID numbers for the new patch names and placed them after the old patches. This what happened in my case. The solution is simple, use the same patch names in createPatch. But I prefered to skip topoSet and just used createPatch to remove boundary patches with zero nFaces. Here is my boundary after executing snappyHexMesh Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 11 ( maxZ { type patch; nFaces 16; startFace 76488; } minZ { type patch; nFaces 16; startFace 76504; } maxX { type patch; nFaces 0; startFace 76520; } minX { type patch; nFaces 0; startFace 76520; } maxY { type patch; nFaces 0; startFace 76520; } minY { type patch; nFaces 0; startFace 76520; } rod { type wall; inGroups 1(wall); nFaces 0; startFace 76520; } rod_slave { type wall; inGroups 1(wall); nFaces 0; startFace 76520; } mold { type patch; nFaces 6400; startFace 76520; } moldUp { type patch; inGroups 1(Upper); nFaces 1584; startFace 82920; } moldDown { type patch; inGroups 1(Bottom); nFaces 1584; startFace 84504; } ) // ************************************************************************* // my new createPatchDict is Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createPatchDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Do a synchronisation of coupled points after creation of any patches. // Note: this does not work with points that are on multiple coupled patches // with transformations (i.e. cyclics). pointSync false; // Patches to create. An empty patch list just removes patches with zero // faces from $FOAM_CASE/constant/polyMesh/boundary. patches ( ); // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 5 ( maxZ { type patch; nFaces 16; startFace 76488; } minZ { type patch; nFaces 16; startFace 76504; } mold { type patch; nFaces 6400; startFace 76520; } moldUp { type patch; inGroups 1(Upper); nFaces 1584; startFace 82920; } moldDown { type patch; inGroups 1(Bottom); nFaces 1584; startFace 84504; } ) // ************************************************************************* // Unfortunately when I executed createBaffles command to create cyclicAMI patches, all ID numbers of those patches are shifted again Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 7 ( maxZ { type patch; nFaces 16; startFace 75848; } minZ { type patch; nFaces 16; startFace 75864; } mold { type patch; nFaces 6400; startFace 75880; } moldUp { type patch; inGroups 1(Upper); nFaces 1584; startFace 82280; } moldDown { type patch; inGroups 1(Bottom); nFaces 1584; startFace 83864; } AMI1_rod { type cyclicAMI; inGroups 2 (cyclicAMI baffleFaces); nFaces 640; startFace 85448; matchTolerance 0.0001; transform noOrdering; neighbourPatch AMI2_mold; } AMI2_mold { type cyclicAMI; inGroups 2 (cyclicAMI baffleFaces); nFaces 640; startFace 86088; matchTolerance 0.0001; transform noOrdering; neighbourPatch AMI1_rod; } ) // ************************************************************************* // Thank you so much for your help, Sincerely, Ferensa Last edited by wyldckat; December 12, 2015 at 16:25. Reason: Changed [QUOTE][/QUOTE] to [CODE][/CODE] |
|
December 12, 2015, 16:32 |
|
#6 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Ferensa,
Quote:
Quote:
Then again, I forgot to write something I had thought about for when createBaffles is called: Since you're reassigning internal faces to the patches that are now defined as baffles, this means that these faces need to be in the last chunk of face IDs, due to how OpenFOAM deals with face identification:I hope this makes it clearer. Because if you want to make the faceSets operational again, after using createPatch and/or createBaffles, you need to recreate them from the patches. Best regards, Bruno
__________________
|
|||
November 1, 2017, 03:24 |
creating square patch (for air inlet) on the bottom face using cellset in toposet
|
#7 |
New Member
Join Date: Feb 2013
Posts: 24
Rep Power: 13 |
Hi all,
I am trying to feed air through a square inlet on the bottom face of a 3D rectangular tank filled with water. I am able to do this using faceset in toposet dict as follows: { name faceGrabbed; type faceSet; action new; source boxToFace; sourceInfo { box (0.035 0.035 0.08)(0.04 0.04 0.08); } } But when i tried to do it with cellset (by replacing the type with cellset) as given below in toposet dict then I am facing the following error: unexpected class name cellset expected faceset while reading object faceGrabbed. { name faceGrabbed; type cellSet; action new; source boxToCell; sourceInfo { box (0.015 0.015 0)(0.02 0.02 0); } } ) My create patch dictionary is as follows: { //- name of new patch name bubble; //- type of new patch patchInfo { type patch; } //- How to construct: either from 'patches' or 'set' constructFrom set; //- if constructionFrom = set : name of faceSet set faceGrabbed; } ); I am running the following commands: blockMesh TopoSet CreatePatchDict -overwrite -------here I am getting error: Foam fatal IO error: unexpected class name cellset expected faceset while reading object faceGrabbed. Can anyone please help as I tried a lot to retrieve this. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
createPatch cyclic boundary condition | KateEisenhower | OpenFOAM Pre-Processing | 3 | September 4, 2018 15:30 |
Bug in Workbench CFX | Pierre1 | CFX | 6 | August 2, 2017 01:18 |
Possible createPatch/createBaffles bug? | simpomann | OpenFOAM Bugs | 2 | July 15, 2014 08:07 |
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) | cfdonline2mohsen | OpenFOAM | 3 | October 21, 2013 10:28 |
[Salome] unv mesh corrupted after createPatch | maddalena | OpenFOAM Meshing & Mesh Conversion | 1 | February 18, 2010 08:43 |