CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   sHM and cyclicGgi (http://www.cfd-online.com/Forums/openfoam/81228-shm-cyclicggi.html)

FabOr October 20, 2010 10:59

sHM and cyclicGgi
 
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

Ive 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);
    }
)


markusrehm October 20, 2010 16:07

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

FabOr October 21, 2010 03:58

thanks for your reply, markus.

ive 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 October 21, 2010 08:02

the mistake of the last post was only a mistake in writing the patch names.

but i havent 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

ive 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!

markusrehm October 22, 2010 04:35

Hello,

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

Markus

FabOr October 26, 2010 07:29

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 ive 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

markusrehm October 26, 2010 11:17

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

FabOr October 27, 2010 08:31

3 Attachment(s)
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.

markusrehm October 27, 2010 16:52

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

FabOr October 28, 2010 04:43

thank you very much. the debug mode works.

so, ive 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!?

anger October 28, 2010 05:24

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

FabOr October 28, 2010 08:27

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!

anger October 28, 2010 15:01

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

FabOr October 29, 2010 03:58

1 Attachment(s)
Hi,

thanks for your answer Thomas.

Let me explain you what i want to do:

Ive 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

anger November 1, 2010 06:08

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

FabOr November 1, 2010 06:09

Hi,

ive 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



Ive 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!

Ralph M November 2, 2010 04:50

Quote:

Originally Posted by anger (Post 281623)
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

FabOr November 2, 2010 04:55

Hi Ralph,

Ive 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 November 2, 2010 05:01

1 Attachment(s)
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

anger November 7, 2010 07:27

1 Attachment(s)
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


All times are GMT -4. The time now is 13:10.