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

[snappyHexMesh] sHM and cyclicGgi

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 20, 2010, 11:59
Default sHM and cyclicGgi
  #1
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Hi Foamers,

when i want to run sHM, I get the following error message:

Code:
Cannot handle coupled patch cyclicX of type cyclicGgi

    From function syncTools::getMasterFaces(const polyMesh&)
    in file meshes/polyMesh/syncTools/syncTools.C at line 352.

FOAM aborting

Aborted
I´ve made the following steps:

1) Run blockMesh (creates the box)
2) run createPatch
3) run snappyHexMesh => crash

i try to simulate the flow around a cylinder in a cuboid-box. the cylinder is placed near one side of the box to have an unsymmetric flow. so i use cyclicGgi to have a symmetric flow as i would have, if i had placed the cylinder right in the middle of the box.
this is only a test case for me, because i would like to implement cyclicGgi in a case in which it is absolute necessary.

have i done something wrong or it is not possible to use cyclicGgi and sHM in the same case?
is cyclicGgi the rigth patch type or is cyclic better? what are the differences?

as i am new in sHM and cyclic boundaries, any help is appreciated!

My createPatchDict:

Code:
matchTolerance 1E-3;
pointSync true;
patches
(
    {
    name cyclicX;
    type cyclicGgi;
    dictionary
    {
            type cyclicGgi;
    }
        constructFrom patches;
        patches (minX maxX);//("periodic.*");
    }
    {
    name cyclicY;
    type cyclicGgi;
    dictionary
    {
            type cyclicGgi;
    }
        constructFrom patches;
        patches (minY maxY);
    }
);
and my polyMesh/boundary-file:

Code:
4
(
    minZ
    {
        type            patch;
        nFaces          100;
        startFace       5500;
    }
    maxZ
    {
        type            patch;
        nFaces          100;
        startFace       5600;
    }
    cyclicX
    {
        type            cyclicGgi;
        nFaces          400;
        startFace       5700;
        shadowPatch     ;
        zone            ;
        bridgeOverlap   off;
        rotationAxis    (0 0 1);
        rotationAngle   0;
        separationOffset (0 0 0);
    }
    cyclicY
    {
        type            cyclicGgi;
        nFaces          400;
        startFace       6100;
        shadowPatch     ;
        zone            ;
        bridgeOverlap   off;
        rotationAxis    (0 0 1);
        rotationAngle   0;
        separationOffset (0 0 0);
    }
)
FabOr is offline   Reply With Quote

Old   October 20, 2010, 17:07
Default
  #2
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hello,

seems to me that SHM does not handle cyclic boundaries. You should change steps 2 and 3:

1) create the surrounding coarse mesh with blockMesh
2) apply SHM
3) apply createPatch to make the appropriate patches cyclic

Hope that helps. Please keep us posted how it is working out.

Regards Markus
markusrehm is offline   Reply With Quote

Old   October 21, 2010, 04:58
Default
  #3
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
thanks for your reply, markus.

i´ve changed steps 2 and 3, and it works.

but when i want to run simpleFoam, i get the following error-message:

Code:
Reading field p

inconsistent patch and patchField types for 
    patch type cyclicGgi and patchField type cyclicGGi

file: /srv/fabor/snap-Test-Zyl_cyclic_2/0.03/p::cyclicX from line 47 to line 47.

    From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
    in file /usr/local/opt/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/newFvPatchField.C at line 140.

FOAM exiting
My p-file:

Code:
dimensions      [0 2 -2 0 0 0 0];
internalField   uniform 100000; 

boundaryField
{
    minZ
    {
    type          fixedValue;
    value        uniform 100000;
    }
    maxZ
    {
        type            zeroGradient;
    }
    Zylinder_Zylinder
    {
    type        zeroGradient;
    }
    cyclicX
    {
    type        cyclicGGi;
    }
    cyclicY
    {
    type        cyclicGGi;
    }
}
Any ideas?
FabOr is offline   Reply With Quote

Old   October 21, 2010, 09:02
Default
  #4
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
the mistake of the last post was only a mistake in writing the patch names.

but i haven´t get my case running...

my steps are:

1)blockMesh
2)sHM
3)createPatch
4)copy the p,U,...-files into last directory
5)run simpleFoam => crash:

Code:
Create time

Create mesh for time = 0.04

Reading field p

Reading field U

Reading/calculating face flux field phi

Segmentation fault
i´ve already tested if my OF1.5-dev is running on this case without createPatch.
so the mistake must be related to createPatch/simpleFoam

any help is much appreciated!
FabOr is offline   Reply With Quote

Old   October 22, 2010, 05:35
Default
  #5
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hello,

you should try running the solver in DEBUG-mode to obtain more information.

Markus
markusrehm is offline   Reply With Quote

Old   October 26, 2010, 08:29
Default
  #6
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Hi Markus,

unfortunately i dont know how to run in debug.mode.

i added the last line in simpleFoam-folder make/options:

Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/RAS \
    -I$(LIB_SRC)/transportModels \
    -DFULLDEBUG -g -O0 \
and run wmake. am i so far right?
then i´ve tried to run simpleFoam in my case-folder again to receive more information about the segmentation fault. but it crashs like before...

can you give me a hint?

thx
FabOr is offline   Reply With Quote

Old   October 26, 2010, 12:17
Default
  #7
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hi,

See http://openfoamwiki.net/index.php/Main_FAQ

in
8.1 An application ends with a segmentation fault. What is wrong?

...To find out where this occurs make a separate copy of the OF-sources, recompile them with the swich

WM_COMPILE_OPTION set to Debug

(just uncomment the right lines in the bashrc/cshrc files). This makes OF run slower, but accesses to List<> etc are checked for ranges and the program aborts if you access outside of a range (plus you get a stack trace). This won't solve your problem, but it will help you find out where it occurs.
See also General debugging tips. For recompiling OpenFOAM look at Howto_compile_OpenFOAM


Markus
markusrehm is offline   Reply With Quote

Old   October 27, 2010, 09:31
Default
  #8
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Thx for the answer.

i changed lines 92, 94 and 96 in bashrc (folder: OpenFOAM/OpenFOAM-1.5-dev/etc):

Code:
# Compilation options (architecture, precision, optimised, debug or profiling)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_NCOMPPROCS=2

# WM_ARCH_OPTION = 32 | 64
: ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION

# WM_PRECISION_OPTION = DP | SP
: ${WM_PRECISION_OPTION:=DP}; export WM_PRECISION_OPTION

 WM_COMPILE_OPTION = Opt | Debug | Prof                
: ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
: ${WM_COMPILE_OPTION:=Debug}; export WM_COMPILE_OPTION        

 WM_JAVAC_OPTION = Opt | Debug
: ${WM_JAVAC_OPTION:=Opt}; export WM_JAVAC_OPTION

# WM_MPLIB = | OPENMPI| LAM | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
and in cshrc-file in the same folder, lines 91-93, 95 and 97:

Code:
# Compilation options (architecture, precision, optimised, debug or profiling)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_NCOMPPROCS 2

# WM_ARCH_OPTION = 32 | 64
if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64

# WM_PRECISION_OPTION = DP | SP
if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP

 WM_COMPILE_OPTION = Opt | Debug | Prof                
if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt    
if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Debug   
setenv WM_COMPILE_OPTION Opt
setenv WM_COMPILE_OPTION Debug                
                
 WM_JAVAC_OPTION = Opt | Debug
if ( ! $?WM_JAVAC_OPTION ) setenv WM_JAVAC_OPTION Opt

# WM_MPLIB = | OPENMPI | LAM | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI
My next step was to run ./Allwmake in OpenFOAM-1.5-dev/application.
But the only output was that everything is up to date.
In OpenFOAM-1.5-dev folder the same (see log).

If i run simpleFoam in my case-directory, because nothing changed
=> segmentation fault.

What am I doing wrong?

Attached Allwmake log and bashrc/cshrc

EDIT: Now I am compiling my debug-version of OF. I followed the instructions of http://www.cfd-online.com/Forums/ope...oam-1-6-a.html post #2.
Attached Files
File Type: gz bashrc.tar.gz (2.6 KB, 0 views)
File Type: gz cshrc.tar.gz (2.4 KB, 0 views)
File Type: gz log.tar.gz (2.6 KB, 1 views)

Last edited by FabOr; October 27, 2010 at 10:57.
FabOr is offline   Reply With Quote

Old   October 27, 2010, 17:52
Default
  #9
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hi Fabian,

you do not need to change the bashrc or cshrc (by the way you need only one of them - depending on the type of shell you have - so let us suppose your linux uses bash-shell like for example OpenSUSE does).

What you do is:
1) Change the environment variable to debug
export WM_COMPILE_OPTION=Debug
(check it with echo $WM_COMPILE_OPTION)

2) source your bashrc again
. ~/.bashrc
this will run all the initialisation scripts for OF and set the right stuff for the Debug mode

3) rerun Allwmake as before but pay attention that the executables are written to
/home/fabian/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linuxGccDPDebug/
usually it is written do *Opt

4) Run the solver again - to check which one you are using type
which simpleFoam

To reuse the Opt branch again do
export WM_COMPILE_OPTION=Opt
and source again.

Hope that helps.

Markus
markusrehm is offline   Reply With Quote

Old   October 28, 2010, 05:43
Default
  #10
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
thank you very much. the debug mode works.

so, i´ve got the following error message:

Code:
Create time

Create mesh for time = 0.001

Reading field p

Reading field U

Reading/calculating face flux field phi



attempt to access element from zero sized list

    From function UList<T>::checkIndex(const label)
    in file /home/fabian/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/UListI.H at line 105.

FOAM aborting

Aborted
UListI.H, lines 99-115:

Code:
// Check index i is within valid range (0 ... size-1).
template<class T>
inline void Foam::UList<T>::checkIndex(const label i) const
{
    if (!size_)
    {
        FatalErrorIn("UList<T>::checkIndex(const label)")
            << "attempt to access element from zero sized list"
            << abort(FatalError);
    }
    else if (i<0 || i>=size_)
    {
        FatalErrorIn("UList<T>::checkIndex(const label)")
            << "index " << i << " out of range 0 ... " << size_-1
            << abort(FatalError);
    }
The error seems to be related to my BC!?
FabOr is offline   Reply With Quote

Old   October 28, 2010, 06:24
Default
  #11
Member
 
Thomas Wolfanger
Join Date: Mar 2009
Location: South West Germany
Posts: 62
Rep Power: 17
anger is on a distinguished road
Hi,

can you post your current boundary file?
I use shm with cyclics by just creating the whole mesh without ggi and changing the patch type in a last step in that file by hand (don't know whether createPatch would be an alternative)

Best regards,
-Thomas
anger is offline   Reply With Quote

Old   October 28, 2010, 09:27
Default
  #12
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Hi Thomas,

constant/polyMesh/boundary:

Code:
6
(
    minX
    {
        type            patch;
        nFaces          200;
        startFace       5500;
    }
    maxX
    {
        type            patch;
        nFaces          200;
        startFace       5700;
    }
    minY
    {
        type            patch;
        nFaces          200;
        startFace       5900;
    }
    maxY
    {
        type            patch;
        nFaces          200;
        startFace       6100;
    }
    minZ
    {
        type            patch;
        nFaces          100;
        startFace       6300;
    }
    maxZ
    {
        type            patch;
        nFaces          100;
        startFace       6400;
    }
)
after run createPatch
1/polyMesh/boundary:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "0.001/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

5
(
    minY
    {
        type            patch;
        nFaces          200;
        startFace       5500;
    }
    maxY
    {
        type            patch;
        nFaces          200;
        startFace       5700;
    }
    minZ
    {
        type            patch;
        nFaces          100;
        startFace       5900;
    }
    maxZ
    {
        type            patch;
        nFaces          100;
        startFace       6000;
    }
    cyclicX
    {
        type            cyclicGgi;
        nFaces          400;
        startFace       6100;
        shadowPatch     ;
        zone            ;
        bridgeOverlap   off;
        rotationAxis    (0 0 1);
        rotationAngle   0;
        separationOffset (0 0 0);
    }
)
Can you please upload a simple test-case which is working, Thomas?
That would be great!
FabOr is offline   Reply With Quote

Old   October 28, 2010, 16:01
Default
  #13
Member
 
Thomas Wolfanger
Join Date: Mar 2009
Location: South West Germany
Posts: 62
Rep Power: 17
anger is on a distinguished road
Hi FabOr,

if the second file was your actual one, following things are strange:
- there is only one cyclicGgi entry; there should be two (for example "cyclicY")
- not all subentries are filled in; you have to define the correct shadow patch (if the above was correct, the shadow patch entry in "cyclicX" should be "cyclicY")
- your mesh has to have the corresponding face zones which you also have to define for example via faceSet
- take care of the rotation angle; fill in the correct value for your case.

I'll have a look whether I can find a very simple test case to demonstrate the setup. Meanwhile, you could search the net (I remember that I derived my setup from a presentation of a member of the turbomachinery SIG, but I don't remember the name...)

Regards,
-Thomas
anger is offline   Reply With Quote

Old   October 29, 2010, 04:58
Default
  #14
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Hi,

thanks for your answer Thomas.

Let me explain you what i want to do:

I´ve got a stl-file which is implemented by snappyHexMesh in a simple Box(like in attached picture).
Because of unsymmetry of the stl file(but its periodic) i want to have the influence of the opposite sites in the simulation=> minX/maxX and minY/maxY. The aim of the implementation of cyclicGgi is that i dont simulate only the stl-geomatry part, but lots of them by only computing one. i hope you understand me
So i dont need a rotation axis or angle.
but i am not sure anymore if cyclicGgi is the right patch-type. i hope you can tell me if i am right.

regards
Attached Images
File Type: jpg block.jpg (19.3 KB, 38 views)
FabOr is offline   Reply With Quote

Old   November 1, 2010, 06:08
Default
  #15
Member
 
Thomas Wolfanger
Join Date: Mar 2009
Location: South West Germany
Posts: 62
Rep Power: 17
anger is on a distinguished road
Hi FabOr,

The link I mentioned above is
http://www.tfd.chalmers.se/~hani/kurser/OS_CFD/case_study_2010_OP.pdf
where you can find informations on setting up a ggi boundary for either cyclic or translational cases.
I think ggi (not cyclicGgi!) will work for your case. You could start by taking the mesh of a tutorial case (like channel395), change it to your needs and then introduce the ggi instead of the standard cyclic bc to get an idea of the correct setup. Be aware that ggi only works in 1.5-dev.

Best regards,
-Thomas
anger is offline   Reply With Quote

Old   November 1, 2010, 06:09
Default
  #16
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Hi,

i´ve got a working case with strange results.

My steps:
1) blockMesh
2) sHM
3) faceSet for minX,maxX, minY and maxY (changes needed in faceSetDict)
4) setsToZones -noFlipMap
5) change the boundary-file
6) simpleFoam



I´ve getting also an uncovered faces warning message:

Code:
Create time

Create mesh for time = 2.92

Reading field p

Reading field U

Reading/calculating face flux field phi

Initializing the GGI interpolator between master/shadow patches: maxX/minX
Evaluation of GGI weighting factors:

    From function void GGIInterpolation<MasterPatch, SlavePatch>::rescaleWeightingFactors() const
    in file /home/fabian/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/GGIInterpolationWeights.C at line 534
    Uncovered faces found.  On master: 800 on slave: 1064
  Largest slave weighting factor correction : 0 average: 0
  Largest master weighting factor correction: 0 average: 0

Initializing the GGI interpolator between master/shadow patches: minY/maxY
Evaluation of GGI weighting factors:

    From function void GGIInterpolation<MasterPatch, SlavePatch>::rescaleWeightingFactors() const
    in file /home/fabian/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/GGIInterpolationWeights.C at line 534
    Uncovered faces found.  On master: 1064 on slave: 800
  Largest slave weighting factor correction : 0 average: 0
  Largest master weighting factor correction: 0 average: 0

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model laminar

Starting time loop
So there must be a setting-error.
Due to the upload limit, i will send you the case-files and a paraview-picture of the strange results per email...

Any help is much appreciated!
FabOr is offline   Reply With Quote

Old   November 2, 2010, 04:50
Default
  #17
Senior Member
 
Ralph Moolenaar
Join Date: Aug 2010
Location: 's-Hertogenbosch, the Netherlands
Posts: 120
Rep Power: 16
Ralph M is on a distinguished road
Quote:
Originally Posted by anger View Post
Hi FabOr,
Be aware that ggi only works in 1.5-dev.
Hello Thomas,

What is the difference between the latest version of OF (I think 1.7.1 which I have) and the 1.5-dev version? So you're saying that GGI won't work in 1.7.1?

Regards,

Ralph
Ralph M is offline   Reply With Quote

Old   November 2, 2010, 04:55
Default
  #18
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Hi Ralph,

I´ve read in other threads that Ggi is only implemented in the developer-version, short -dev.
So it is not supported in the "normal" versions.

http://www.cfd-online.com/Forums/ope...confusion.html

Regards
FabOr is offline   Reply With Quote

Old   November 2, 2010, 05:01
Default
  #19
Member
 
Join Date: May 2010
Posts: 33
Rep Power: 16
FabOr is on a distinguished road
Hi all,

as i reported i get strange results using cyclicGgi and ggi.

Attached is a plot over line on the x-Axis. Because of using ggi-patch, i thought that on both sides the velocity should be equal!?

When running simpleFoam i get a message that there are uncovered faces on master and slave patch. Can that cause the error? If yes, how can uncovered faces be avoided?

best regards
Attached Images
File Type: jpg ggi_0211_1_plot.jpg (17.3 KB, 14 views)
FabOr is offline   Reply With Quote

Old   November 7, 2010, 07:27
Default
  #20
Member
 
Thomas Wolfanger
Join Date: Mar 2009
Location: South West Germany
Posts: 62
Rep Power: 17
anger is on a distinguished road
Hi FabOr,

I've set up a simple channel flow case with cyclics which technically works (which does not mean it has any physical meaning...). Maybe this gives you some hints for your own setup...

Good luck,
-Thomas
Attached Files
File Type: gz channelGgi.tar.gz (34.6 KB, 54 views)
anger 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
[snappyHexMesh] combine blockMesh features cyclicGgi and mixingPlane with multiregion snappyHexMesh AmRo OpenFOAM Meshing & Mesh Conversion 5 June 8, 2016 07:36


All times are GMT -4. The time now is 00:07.