CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

Can't couple front & back faces in cyclic BC after snapping in SHM

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By hakonbar

Reply
 
LinkBack Thread Tools Display Modes
Old   April 25, 2013, 13:00
Default Can't couple front & back faces in cyclic BC after snapping in SHM
  #1
New Member
 
Håkon Bartnes Line
Join Date: Mar 2013
Posts: 27
Rep Power: 4
hakonbar is on a distinguished road
Hi everyone!

I have a problem involving the createPatch utility and snappyHexMesh. I'm setting up a 3D simulation across a wing section, and I want to couple the front and back faces of the mesh with a "cyclic" boundary condition.

In order to bring down the cell count, I have to do some work on the mesh after generating it in SHM. For this reason, I initially define the front and back faces of my mesh as "empty", and only convert them to "cyclic" later using the createPatch utility.

My problem is that if I allow SHM to go through with the snapping stage, it reorders the face list in such a way that the faces on the front and back patches can no longer find their twin on the opposite patch. This makes it impossible to convert these faces from "empty" to "cyclic".

I've tried the renumberMesh utility, but that didn't solve the problem. Do any of you know how to go about converting patches generated in snappyHexMesh to the cyclic type?

regards,
Håkon
hakonbar is offline   Reply With Quote

Old   June 4, 2013, 05:25
Default
  #2
New Member
 
Thomas Lloyd
Join Date: May 2011
Posts: 7
Rep Power: 6
Thomas_Lloyd is on a distinguished road
Dear Håkon

I recommend that you specify the cyclic patches as type "cyclic" in a blockMeshDict. Then when SHM runs, it will preserve these patches as cyclic and you should require not further mesh processing. This worked for me.

See the openfoam website for details of how ti assign patch types in blockMesh.

Regards,
Tom
Thomas_Lloyd is offline   Reply With Quote

Old   November 28, 2013, 09:40
Default
  #3
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 675
Rep Power: 8
sharonyue is on a distinguished road
Quote:
Originally Posted by Thomas_Lloyd View Post
Dear Håkon

I recommend that you specify the cyclic patches as type "cyclic" in a blockMeshDict. Then when SHM runs, it will preserve these patches as cyclic and you should require not further mesh processing. This worked for me.

See the openfoam website for details of how ti assign patch types in blockMesh.

Regards,
Tom
I just did this as you have said. My blockMeshDict is as follows:
Code:
convertToMeters 1;

vertices
(
    (0 -0.1145 0.3)
    (0.3 -0.1145 0.3)
    (0.3 -0.1145 0)
    (0 -0.1145 0)
    (0 1 0.3)
    (0.3 1 0.3)
    (0.3 1 0)
    (0 1 0)
 
    
);

blocks
(
    hex (0 3 7 4 1 2 6 5 ) (20 60 20) simpleGrading (1 1 1)//28 39 28
);

edges
(
);

boundary
(
    cyc_half0
{

type cyclic;
neighbourPatch cyc_half1;
transform rotational;
            rotationAxis (0 1 0);
            rotationCentre (0 0 0);
faces 
(
(3 7 6 2 ) 
);
}

cyc_half1
{

type cyclic;
neighbourPatch cyc_half0;
transform rotational;
            rotationAxis (0 1 0);
            rotationCentre (0 0 0);
faces 
(
(0 3 7 4 ) 
);
}
);

mergePatchPairs
(
);
It generates a block mesh with no problems. but when I run shm it says:
Code:
-> FOAM FATAL ERROR: 
More than one patch accessing the same transform but not of the same sign.
patch:cyc_half1 transform:0 sign:-1  current transforms:(-1 0 0)

    From function Foam::label Foam::globalIndexAndTransform::addToTransformIndex
(
const label,
const label,
const bool
) const

    in file lnInclude/globalIndexAndTransformI.H at line 268.

FOAM exiting
Do you know why?
sharonyue is offline   Reply With Quote

Old   December 4, 2013, 09:17
Default
  #4
Member
 
phil
Join Date: Oct 2013
Posts: 33
Rep Power: 3
gelbebanane is on a distinguished road
Hi,
you can also define your patches as wall (default for sHM) etc. in snappy and after snappy running through you can modify your 0/* files and boundary file with the "changeDictionaryDict" command.
For this you need a changeDictionaryDict file in your system folder. You can find example files either by yourself or have a look at this one located in:

/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/

In case you run in parallel you have to modify the command.
1. First move to the processor* folder
2. Then enter "changeDictionaryDict -dict /path/to/the/dict/file"
3. Repeat step 1 and 2 for all processor folders.

Greetings

Last edited by gelbebanane; December 4, 2013 at 09:18. Reason: bye
gelbebanane is offline   Reply With Quote

Old   December 8, 2013, 17:50
Default
  #5
New Member
 
Håkon Bartnes Line
Join Date: Mar 2013
Posts: 27
Rep Power: 4
hakonbar is on a distinguished road
Hi all and thanks for the advice,

My question was regarding a masters project that I handed in in June, and I seem to have misplaced the case files, so I can't go back and check it. However, the work that I intended to do on the mesh included cutting out a subset of the mesh, including some of the front and back faces, and extruding it to a lower spanwise resolution before putting it back in. It was therefore not possible to define the front and back boundaries as cyclic from the get-go, as that would mess up the subset and extrusion processes.
I also tried what you suggest, banana, but this process of cutting and extrusion changed the cell count of the mesh, which threw off the face numbering. Now, this shouldn't have been a problem when generating a cyclic boundary, as any face on one of the planes should have been able to find its twin on the other, based on its position and area. For some reason, though, this automatic face matching didn't work, and I just decided to drop the problem after a while, as it wasn't essential.

@sharon: I think the problem may be that the rotationAxis on one of your cyclic patches is defined the wrong way. Try changing one or the other to (0 -1 0). However, i also think you might be using syntax from an old version of OF, as you don't have to define the coupling of your cyclic boundaries that explicitly anymore. Check out the tutorials with cyclic boundaries. I think some of them are defined in a simpler way.

best regards,
Håkon
sharonyue likes this.
hakonbar is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Case running in serial, but Parallel run gives error atmcfd OpenFOAM Running, Solving & CFD 15 July 27, 2015 08:19
Fluent msh and cyclic boundary cfdengineering OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 January 25, 2013 04:28
Change Front and back???? vahid.najafi OpenFOAM Meshing & Mesh Conversion 3 November 1, 2012 03:59
How to Do External Mesh for Airfoil sHM msuaeronautics OpenFOAM Native Meshers: snappyHexMesh and Others 1 September 23, 2012 04:00
snappyHexMesh with cyclic patches? Axel_T OpenFOAM Native Meshers: snappyHexMesh and Others 1 October 12, 2010 10:03


All times are GMT -4. The time now is 09:21.