CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Commercial meshers] Usage of createPatchDict

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes
  • 3 Post By Bombolati
  • 6 Post By blacksquirrel
  • 1 Post By Bombolati
  • 1 Post By Antimony

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 3, 2012, 11:55
Default Usage of createPatchDict
  #1
New Member
 
Francesco
Join Date: Jun 2012
Location: Rome, Italy
Posts: 23
Rep Power: 14
Bombolati is on a distinguished road
Hi, yesterday I opened a thread with a problem with the utility foamToVTK, and this shows me a new problem about my mesh. Bruno Santos (the moderator) gives me a valuable advice to check my mesh with checkMesh utility. And for my particular boundary condition says me to looking for a thread useful for me with the keywords foam3DMeshToFluent cyclic.
Now I've read the forum with this keywords but in every thread with cyclicle boundary condition problems the problem is not solved. I'm unlucky!
So I want to summarize the problem.
I convert the mesh with fluent3DMeshToFoam. ok.
I run the checkMesh utility and there isn't a problem yet. ok.
Now I need to change some patch from type patch to type cyclic.
The first time I have changed directly the boundary file with this keywords for the patch 1:
matchTolerance 0.0001; neighbourPatch patch 2; transform rotational; rotationAxis (0 0 1); rotationCentre (0 0 0);
for the patch 2:
matchTolerance 0.0001; neighbourPatch patch 1; transform rotational; rotationAxis (0 0 1); rotationCentre (0 0 0);
This attempt give the error above when I run the checkMesh utility.
Now I'm trying to use the createPatch utility but I don't understand which is its behaviour. I have find the example between the OF file but it isn't clear.
I try to explain what I have understand. This is the createPatchDict that I have done.

{
name patch1 (The patch name that I want change);
patchInfo (this is the section in which i set the new patch features)
{
type cyclic;
neighbourPatch patch2;
transform rotational;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
}
constructForm patches (I have no idea what is this keyword);
patches (periodic1) (I have no idea);
}
{
name patch2 (The patch name that I want change);
patchInfo (this is the section in which i set the new patch features)
{
type cyclic;
neighbourPatch patch1;
transform rotational;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
}
constructForm patches (I have no idea what is this keyword);
patches (periodic1) (I have no idea);
}

If I run the utility it starts and have finish with a warning that says:in file meshes/polymesh/polyBoundaryMesh/polyboundaryMesh.c at line 573 OF can't find any patch names matching periodic1
This error occurs two times. The funny things is that this utility doesn't convert any patch in my boundary file, but create a directory named 1e-07 (as the value of deltaT in the controlDict file) in which there is an other polyMesh directory that contains the same file of that one in the constant directory.

Please help me, I'm looking for a solution all day in the forum, please forgive any grammatical errors I'm so tired. Thanks a lot.
Chandsome, Bashar and kooki_13 like this.
Bombolati is offline   Reply With Quote

Old   October 4, 2012, 05:00
Default
  #2
Member
 
Join Date: Jun 2011
Posts: 53
Rep Power: 15
blacksquirrel is on a distinguished road
Hello Bombolati,

After using fluent3DMeshtoFoam you have two patches ("patchA" and "patchB") which should be cyclic but are labeled with "patch" or "wall".
Then you can use the createPatch utility.

In the createPatchDict you write
name patch1;
this is the new name of your cyclic patch

patchInfo (this is the section in which i set the new patch features)
{
type cyclic;
neighbourPatch patch2;
transform rotational;
[...]

constructFrom patches;
which means, that there are existing patches that are used to create the new patches. (It is possible to create patches from faces, then you have to write construct from faceSet)
and
patches (patchA)
which means, your new cyclic patch "patch1" is constructed from "patchA" (it is possible to construct a new patch from two or more existing patches)

and the same then for patch2:
constructFrom patches;
patches (patchB) ;

Last edited by blacksquirrel; October 5, 2012 at 08:21.
blacksquirrel is offline   Reply With Quote

Old   October 4, 2012, 06:52
Default
  #3
New Member
 
Francesco
Join Date: Jun 2012
Location: Rome, Italy
Posts: 23
Rep Power: 14
Bombolati is on a distinguished road
Thank you very much blacksquirrel, the conversion is ok and the checkMesh utility gives no error.
sadrikarami likes this.
Bombolati is offline   Reply With Quote

Old   October 5, 2012, 15:59
Default
  #4
Senior Member
 
sivakumar selvaraju
Join Date: Mar 2009
Location: India
Posts: 205
Rep Power: 18
sivakumar is on a distinguished road
Send a message via Skype™ to sivakumar
Hi there,
I have converted the .msh in to foam.
I got 2 errors,
firstly as follows,

--> FOAM FATAL ERROR:
face 6439 area does not match neighbour by 0.0103693% -- possible face ordering problem.
patch:OLR0 my area:0.000199448 neighbour area:0.000199427 matching tolerance:0.0001
Mesh face:1370739 fc0.0966635 -0.0215988 0.729129)
Neighbour fc0.0967883 -0.5304 0.500736)
If you are certain your matching is correct you can increase the 'matchTolerance' setting in the patch dictionary in the boundary file.
Rerun with cyclic debug flag set for more information.

then I have increased the matchTolerance 0.0001 to 0.001
then executed paraFoam

after that I am getting the error as follows,



--> FOAM FATAL ERROR:
More than six unsigned transforms detected:
6(((0 0 0) (1 1.57813e-06 -0.000193506 -0.000137946 0.707107 -0.707107 0.000135714 0.707107 0.707107) 1) ((0 0 0) (0.999999 3.64383e-05 -0.00152133 -0.00110151 0.707109 -0.707104 0.00104998 0.707105 0.707108) 1) ((0 0 0) (0.999996 7.7863e-05 -0.00275828 -0.00200544 0.707113 -0.707098 0.00189536 0.7071 0.707111) 1) ((0 0 0) (0.999992 0.000140037 -0.00401223 -0.00293604 0.70712 -0.707087 0.00273811 0.707093 0.707115) 1) ((0 0 0) (1 -0.000137946 0.000135714 1.57813e-06 0.707107 0.707107 -0.000193506 -0.707107 0.707107) 1) ((0 0 0) (0.999999 -0.00110151 0.00104998 3.64383e-05 0.707109 0.707105 -0.00152133 -0.707104 0.707108) 1))

From function void Foam::globalIndexAndTransform::determineTransforms ()
in file primitives/globalIndexAndTransform/globalIndexAndTransform.C at line 225.

can you guys help me.

Thanks,
Siva
sivakumar is offline   Reply With Quote

Old   December 18, 2012, 12:43
Default
  #5
New Member
 
Qiang Zhou
Join Date: May 2010
Location: Eindhoven University of Technology
Posts: 28
Rep Power: 16
michael1023 is on a distinguished road
Quote:
Originally Posted by blacksquirrel View Post
Hello Bombolati,

After using fluent3DMeshtoFoam you have two patches ("patchA" and "patchB") which should be cyclic but are labeled with "patch" or "wall".
Then you can use the createPatch utility.

In the createPatchDict you write
name patch1;
this is the new name of your cyclic patch

patchInfo (this is the section in which i set the new patch features)
{
type cyclic;
neighbourPatch patch2;
transform rotational;
[...]

constructFrom patches;
which means, that there are existing patches that are used to create the new patches. (It is possible to create patches from faces, then you have to write construct from faceSet)
and
patches (patchA)
which means, your new cyclic patch "patch1" is constructed from "patchA" (it is possible to construct a new patch from two or more existing patches)

and the same then for patch2:
constructFrom patches;
patches (patchB) ;
Hi, blacksquirrel.
As you said, I have changed the createPatchDict. But there is also have a error as below:


--> FOAM FATAL ERROR:
Attempt to cast type patch to type cyclic

From function refCast<To>(From&)
in file lnInclude/typeInfo.H at line 114.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 Foam::cyclicPolyPatch::neighbPatchID() const in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#3 Foam::cyclicPolyPatch::calcGeometry(Foam::PstreamB uffers&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam:olyBoundaryMesh::calcGeometry() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 Foam:olyMesh::addPatches(Foam::List<Foam:olyPa tch*> const&, bool) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/createPatch"
#7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/createPatch"
Aborted

Could you give me some advice for this error? Thank you.
michael1023 is offline   Reply With Quote

Old   December 19, 2012, 06:35
Default
  #6
Member
 
Join Date: Jun 2011
Posts: 53
Rep Power: 15
blacksquirrel is on a distinguished road
Ok, have you checked your "boundary" file in constant/polyMesh after using fluentMeshToFoam?
What is the type of your patchA/patchB? Do you have two separate patches?

This error is strange and I've never encountered it. Maybe it helps if you change the type of your patches A and B in the boundary file to "wall" instead of patch and try again.
blacksquirrel is offline   Reply With Quote

Old   December 19, 2012, 07:14
Default
  #7
New Member
 
Qiang Zhou
Join Date: May 2010
Location: Eindhoven University of Technology
Posts: 28
Rep Power: 16
michael1023 is on a distinguished road
Hi, blacksquirrel.

Thank you for your reply. I made a mistake in createPatchDict. With help of Maddalena, I solve this problem as the link below.
http://www.cfd-online.com/Forums/ope...tml#post398207
michael1023 is offline   Reply With Quote

Old   October 6, 2016, 03:49
Default keyword patchInfo is undefined in dictionary
  #8
Member
 
Viraj Belekar
Join Date: Jun 2016
Posts: 68
Rep Power: 10
viraj20feb is on a distinguished road
Dear All,

I have attached my createPatchDict file. When I run the command "createPatch", I get the following error:
Code:
Create polyMesh for time = 0



--> FOAM FATAL IO ERROR: 
keyword patchInfo is undefined in dictionary "/home/fossee/foam/fossee-3.2/FluidStructureInteraction/run/fsiFoam/2/fluid/system/createPatchDict"

file: /home/fossee/foam/fossee-3.2/FluidStructureInteraction/run/fsiFoam/2/fluid/system/createPatchDict from line 17 to line 61.

    From function dictionary::lookupEntry(const word&, bool, bool) const
    in file db/dictionary/dictionary.C at line 395.

FOAM exiting
Can anyone help me here?

Thanks
Attached Files
File Type: gz createPatchDict.tar.gz (565 Bytes, 49 views)
viraj20feb is offline   Reply With Quote

Old   October 6, 2016, 06:33
Default
  #9
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

I assume you are using foam-extend 3.2. If that is the case, then your createPatchDict should look like this:

https://github.com/Unofficial-Extend...reatePatchDict

What you are using seems to be an older format for createPatchDict which is not longer supported, which is why foam complains....

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   October 6, 2016, 07:14
Default
  #10
Member
 
Viraj Belekar
Join Date: Jun 2016
Posts: 68
Rep Power: 10
viraj20feb is on a distinguished road
Quote:
Originally Posted by Antimony View Post
Hi,

I assume you are using foam-extend 3.2. If that is the case, then your createPatchDict should look like this:

https://github.com/Unofficial-Extend...reatePatchDict

What you are using seems to be an older format for createPatchDict which is not longer supported, which is why foam complains....

Cheers,
Antimony


Hi Antimony,

This syntax solved the error. Thanks a lot for that. But why is a new folder (0.0001) getting created with only the polyMesh folder in it, when I run 'createPatch' command? As it does not contain other files (such as p, U ), my simulation fails to run!
viraj20feb is offline   Reply With Quote

Old   October 6, 2016, 10:23
Default
  #11
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

Run createPatch with the -overwrite option and it should not write into a new time folder.

Cheers,
Antimony
kooki_13 likes this.
Antimony is offline   Reply With Quote

Old   October 7, 2016, 06:33
Default
  #12
Member
 
Viraj Belekar
Join Date: Jun 2016
Posts: 68
Rep Power: 10
viraj20feb is on a distinguished road
Quote:
Originally Posted by Antimony View Post
Hi,

Run createPatch with the -overwrite option and it should not write into a new time folder.

Cheers,
Antimony
Hi Antimony,

Thank you so much for your quick and helpful reply. It did help. I will tell you everything about my test case. I am trying to simulate blood flow in artery considering FSI. Before moving on to the complex artery geometry, I am trying to do the same with a 3D tubular structure. I am trying to implement a pulsatile flow for which I want this 'cyclic' BC. I have attached my entire test case also.

So, firstly I give this command:

Code:
blockMesh
followed by:

Code:
createPatch -overwrite
then I change the patch type to 'cyclic' for the patches 'inlet' and 'outlet' in the polyMesh/boundary file. Finally, I give the command:

Code:
./Allrun
which contains everything including the command 'fsiFoam' required to run the simulation.
But the log file for fsiFoam command gives the following error:

Code:
--> FOAM FATAL ERROR: 
face 99 area does not match neighbour 199 by 3.5344% -- possible face ordering problem.
patch:outlet my area:7.85425e-08 neighbour area:8.13684e-08 matching tolerance:0.001
Mesh face:45899 vertices:4((0.00259794 0.00259794 0.05) (0.0028866 0.0025452 0.05) (0.002828 0.002828 0.05) (0.0025452 0.0028866 0.05))
Neighbour face:45999 vertices:4((0.00310702 0.00361909 0.05) (0.0033944 0.0033944 0.05) (0.003536 0.003536 0.05) (0.00324747 0.00380221 0.05))
Other errors also exist, only the largest is reported. Please rerun with cyclic debug flag set for more information.

    From function cyclicPolyPatch::calcTransforms()
    in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 293.

FOAM aborting

Aborted (core dumped)

Can you please help? I am stuck here since a long time...Thanks a lot
Attached Files
File Type: gz 2.tar.gz (5.8 KB, 14 views)
viraj20feb is offline   Reply With Quote

Old   October 7, 2016, 07:18
Default
  #13
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

Unfortunately, I typically work only with the standard OF and not on extend. I can take a look at the case, but it will probably be much later.

Quick suggestion: In createPatchDict set the pointSync to true and see.

That was one thing I saw from these links:
1. http://www.cfd-online.com/Forums/ope...tml#post487119

2. https://github.com/OpenFOAM/OpenFOAM...reatePatchDict
(Although it is the standard OF, I think it is pretty much the same for this utility for extend as well. You can check the previously posted link as well).

Hope this helps.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   October 12, 2016, 12:15
Default merging the cyclic patch
  #14
Member
 
Bashar
Join Date: Jul 2015
Posts: 74
Rep Power: 11
Bashar is on a distinguished road
Hi,

Thanks for all your help ! I just followed the instruction and I managed to create acyclic patches. I have a question regarding the cyclic creation. I have a case for flow past plate. the original meshing was done in Fluent and they used for the the two sides of the flow domain the symmetry BC (symmetry1 and symmetry2) and then in Fluent the make both of them aperiodic BC but with a single patch not 2. I used the create patch utility and I managed to get two BC (cyclic1 and cyclic2). Can I merge these two patch in one patch like influent? my friend who work on fluent, that this will reduce the amount of computation because it will only compute for one face rather for two .
Thanks a lot and sorry for the long question

Bashar
Bashar is offline   Reply With Quote

Old   November 1, 2017, 03:25
Post creating square patch (for air inlet) on the bottom face using cellset in toposet
  #15
New Member
 
Join Date: Feb 2013
Posts: 24
Rep Power: 13
me12p1006 is on a distinguished road
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.
me12p1006 is offline   Reply With Quote

Old   February 18, 2020, 06:35
Default CreatePatchDict issue
  #16
New Member
 
Nadine Boufous
Join Date: Nov 2019
Posts: 3
Rep Power: 7
nbfs is on a distinguished road
Dear all,

I am currently facing a problem and I would really appreciate some help with this matter.

I do want to specify a region in my mesh using an STL. The definition of this region/surface as a patch will help me later for calculations. Ideally, surfaces and forceCoeff utilities will be able to integrate over two different patches, where the first patch represents the main body and the second one few empty slits in this same body. (Image attached)

I tried to define the empty slits with an stl and generate a patch with snappyHexmesh but I think I am messing something up. The name of my second patch actually appears in paraview but it is not showing up, looking at the log of CreatepatchDict it says:

Code:
 
--> FOAM Warning :
    From function Foam::labelHashSet Foam::polyBoundaryMesh::patchSet(const Foam::UList<Foam::wordRe>&, bool, bool) const
    in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 866
    Cannot find any patch or group names matching Patch
My guess is that my cells are removed but why ? How can I fix it ?

If someone do have another approach or advice please let me know !

Thank you
Attached Images
File Type: png CFD-online.PNG (85.4 KB, 14 views)
nbfs is offline   Reply With Quote

Old   February 18, 2020, 12:56
Default Problem solved
  #17
New Member
 
Nadine Boufous
Join Date: Nov 2019
Posts: 3
Rep Power: 7
nbfs is on a distinguished road
I actually solved my problem (partially). For people that are struggling with the same issue keep reading:

First thing I defined the body as a patch on SHM. Then, I created on solidWorks an STL matching the slits on the body. With SHM I defined the slits' STL as a baffle (I named it "Patch").

Code:
   refinementSurfaces
    {
        Patch
        {
            level (4 7);
            faceZone Patch;
        }
Second step, was to modify the createPatchDict
Code:
pointSync true;

patches
();

Third and last step, use the createBafflesDict

Code:
internalFacesOnly true;

baffles
{
   cyclicFaces
    {
        type        faceZone;
        zoneName    Patch;

        patches
        {
            master
            {
                name            Patch01;
                type            cyclic;
                neighbourPatch  Patch02;

            }
            slave
            {
                name            Patch02;
                type            cyclic;
                neighbourPatch  Patch01;
            }
        }
    }
}
Run it as follow: SHM -> createPatch -> createBaffles


With that you should be able to create your baffle from internal faces and generate patches that can be visualized on paraview/Ensight. I did not proceed to the calculation part yet with forceCoeff and surfaces utilities (which is actually the ultimate goal for this post) but I will post more as soon as I will get some results.

NB
nbfs is offline   Reply With Quote

Old   February 21, 2020, 09:51
Default Follow up
  #18
New Member
 
Nadine Boufous
Join Date: Nov 2019
Posts: 3
Rep Power: 7
nbfs is on a distinguished road
Dear all,

I actually changed my strategy. I started by creating baffles for the slits in my volume in SHM, then I used the creatPatchDict to create the cyclic patches. I also used the inGroup utility in SHM (it collects the patches of your choice and put it in one single group). That way I was able to get forceCoeff and surfaces utilities to comptute over the cells I initially wanted .

This web site helped a lot: https://www.erikrotteveel.com/openfo...actuator-disk/


Hope it helps !

Best,

NB
nbfs is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANSYS Meshing] is my memory usage normal? Renold ANSYS Meshing & Geometry 2 April 9, 2019 15:09
[mesh manipulation] Problem with using createPatchDict to define cyclic boundaries kaszt OpenFOAM Meshing & Mesh Conversion 0 April 1, 2016 22:18
New workstation for different usage scenarios - CPU and RAM natem Hardware 6 August 7, 2013 03:47
Boosting CPU usage earlybird FLUENT 2 November 2, 2012 11:32
OpenFOAM Solver/BC usage description murrayjc OpenFOAM 3 August 25, 2009 05:48


All times are GMT -4. The time now is 05:47.