CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Segmentation Fault (http://www.cfd-online.com/Forums/openfoam-solving/93913-segmentation-fault.html)

Shawn_A October 30, 2011 19:11

Segmentation Fault
 
I ran into a "Segmentation Fault" that's preventing me from running pimpleDyMFoam. I'm not trying to run in parallel.

My case uses a pretty coarse grid that consists of a 1-cell high square with a round hole, which has a round 1-cell high disc in it that has a blade shaped object in the middle. It's a ggi setup, just a test to get a case running then I can change my geometry to my turbine.

I don't get any error message other than "Segmentation Fault":

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.6-ext
Exec  : pimpleDyMFoam
Date  : Oct 30 2011
Time  : 18:59:33
Host  : ubuntu-10
PID    : 23326
Case  : /home/shawn/Project/vawt
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create dynamic mesh for time = 0

Selecting dynamicFvMesh mixerGgiFvMesh
void mixerGgiFvMesh::addZonesAndModifiers() : Zones and modifiers already present.  Skipping.
Mixer mesh:
    origin: (0 0 0)
    axis  : (0 0 1)
    rpm  : -60
Reading field p

Reading field U

Reading/calculating face flux field phi

Initializing the GGI interpolator between master/shadow patches: rotorggi/statorggi
Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1        0.85034;
    alphaK2        1;
    alphaOmega1    0.5;
    alphaOmega2    0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1          0.075;
    beta2          0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
    Cmu            0.09;
}

Reading field rAU if present


Starting time loop

Courant Number mean: 0.18930684 max: 1.5164333 velocity magnitude: 1
deltaT = 0.0003
Time = 0.0003

Segmentation fault

Any ideas? Is it just that my mesh is THAT bad (coarse)?
Regards,
- Shawn

boger October 31, 2011 09:41

Can you run under the gdb debugger? Something like

Code:

% gdb pimpleDyMFoam
(gdb) run
(gdb) where

might tell you where the segfault occurred. It would be best if you can run the debug version of OpenFOAM, if you have that compiled.

Shawn_A October 31, 2011 13:26

Hi boger,

I ran the gdb debugger:

Code:

shawn@ubuntu-10:~/Project/vawt$ gdb pimpleDyMFoam
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib/OpenFOAM-1.6-ext/applications/bin/pimpleDyMFoam...(no debugging symbols found)...done.

(gdb) run
Starting program: /usr/lib/OpenFOAM-1.6-ext/applications/bin/pimpleDyMFoam
[Thread debugging using libthread_db enabled]
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.6-ext
Exec  : /usr/lib/OpenFOAM-1.6-ext/applications/bin/pimpleDyMFoam
Date  : Oct 31 2011
Time  : 13:18:07
Host  : ubuntu-10
PID    : 2345
Case  : /home/shawn/Project/vawt
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create dynamic mesh for time = 0

Selecting dynamicFvMesh mixerGgiFvMesh
void mixerGgiFvMesh::addZonesAndModifiers() : Zones and modifiers already present.  Skipping.
Mixer mesh:
    origin: (0 0 0)
    axis  : (0 0 1)
    rpm  : -60
Reading field p

Reading field U

Reading/calculating face flux field phi

Initializing the GGI interpolator between master/shadow patches: rotorggi/statorggi
Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1        0.85034;
    alphaK2        1;
    alphaOmega1    0.5;
    alphaOmega2    0.85616;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1          0.075;
    beta2          0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
    Cmu            0.09;
}

Reading field rAU if present


Starting time loop

Courant Number mean: 0.18930684 max: 1.5164333 velocity magnitude: 1
deltaT = 0.0003
Creating ggi check
Time = 0.0003


Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7adcca3 in Foam::mixerGgiFvMesh::calcMovingMasks() const ()
  from /usr/lib/OpenFOAM-1.6-ext/lib/libdynamicFvMesh.so

(gdb) where
#0  0x00007ffff7adcca3 in Foam::mixerGgiFvMesh::calcMovingMasks() const ()
  from /usr/lib/OpenFOAM-1.6-ext/lib/libdynamicFvMesh.so
#1  0x00007ffff7addabd in Foam::mixerGgiFvMesh::movingPointsMask() const ()
  from /usr/lib/OpenFOAM-1.6-ext/lib/libdynamicFvMesh.so
#2  0x00007ffff7addb00 in Foam::mixerGgiFvMesh::update() ()
  from /usr/lib/OpenFOAM-1.6-ext/lib/libdynamicFvMesh.so
#3  0x000000000041772f in ?? ()
#4  0x00007ffff3ba5c4d in __libc_start_main () from /lib/libc.so.6
#5  0x0000000000415399 in ?? ()
#6  0x00007fffffffd998 in ?? ()
#7  0x000000000000001c in ?? ()
#8  0x0000000000000001 in ?? ()
#9  0x00007fffffffddd2 in ?? ()
#10 0x0000000000000000 in ?? ()

I'm not very familiar with OF/Linux yet, but @ #3 it looks like things start to fall apart. I tried to open libdynamicFvMesh.so using gedit to see what's inside, but I can't, which is just my fault for not knowing the proper way to view it.

Regards,
Shawn

boger October 31, 2011 13:37

You actually want to read it "backwards": #0 is your culprit: calcMovingMasks. It would be *much* better if you could repeat the same exercise using the dbg-compiled version of OpenFOAM, but if you look in dynamicMesh/dynamicFvMesh/mixerGgiFvMesh/mixerGgiFvMesh.C for calcMovingMasks, you might start to get some idea of where things might go wrong. For example, do you have "static" and "moving" keywords defined in your "slider" dictionary and a "movingCells" cellZone?

Shawn_A October 31, 2011 14:59

movingCells: that was the problem. I hadn't realize keeping the same name was required.

Lesson learned: how to use the debugger
Lesson learned: make sure not to change names unless you know what the effect will be

3 cheers for boger!


One other quick unrelated question (since the case now runs and I admit I did a bit of a happy dance), is there a way to specify what directory the results are written to? It would be nice if I could have a "results" directory where all the data is stored. I didn't see an option for this in controlDict where all the other I/O params are specified.

- Shawn

boger October 31, 2011 15:32

Not that I've ever noticed, but it's probably better to start a different thread with that question.

Shawn_A October 31, 2011 15:38

Quote:

Originally Posted by boger (Post 330205)
Not that I've ever noticed, but it's probably better to start a different thread with that question.

Will do, thanks again :)
- Shawn


All times are GMT -4. The time now is 11:58.