CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Segmentation fault with particleTracks

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 9, 2012, 19:11
Default Segmentation fault with particleTracks
  #1
New Member
 
Join Date: Nov 2012
Posts: 4
Rep Power: 14
gmagoon is on a distinguished road
Hello,
I'm trying to generate particle tracks using the particleTracks utility from trajectories obtained from solidParticleFoam.
The output ends with the following:
Code:
...
Time = 39400.897
    Reading particle positions
    Read 682 particles
Time = 39400.898
    Reading particle positions
    Read 682 particles
Time = 39400.899
    Reading particle positions
    Read 682 particles
Time = 39400.9
    Reading particle positions
    Read 682 particles

Particle statistics:
    Found 0 particles originating from processor 0



Generating 0 particle tracks for cloud defaultCloud

Time = 39400
    Reading particle positions
    Constructing tracks

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/libc.so.6"
#3  
 in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/particleTracks"
#4  __libc_start_main in "/lib/libc.so.6"
#5  
 in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/particleTracks"
Segmentation fault
This is using 1 processor and OpenFoam 2.1.0.

My particleTracksProperties file:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      particleTrackProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

cloudName       defaultCloud;

sampleFrequency 1;

maxPositions    1000000;  

// ************************************************************************* //
Any tips in figuring out what I might be doing wrong are appreciated.

I can try to provide any additional information that would help in diagnosing the problem.

Thanks in advance,
Greg
gmagoon is offline   Reply With Quote

Old   November 12, 2012, 11:13
Default
  #2
New Member
 
Join Date: Nov 2012
Posts: 4
Rep Power: 14
gmagoon is on a distinguished road
I have just now tried to run this using the gdb debugger. The results aren't particularly informative to me (looks like the crash is in the main() function), but my hope is that they will be meaningful to someone else:
Code:
...
Particle statistics:
    Found 0 particles originating from processor 0



Generating 0 particle tracks for cloud defaultCloud

Time = 39400
    Reading particle positions
    Constructing tracks


Program received signal SIGSEGV, Segmentation fault.
0x00000000004098f0 in main ()
(gdb) where
#0  0x00000000004098f0 in main ()
gmagoon is offline   Reply With Quote

Old   February 22, 2013, 15:24
Default
  #3
New Member
 
Join Date: Nov 2012
Posts: 4
Rep Power: 14
gmagoon is on a distinguished road
I think I've figured out the problem and came up with a way to address this.

I added some debugging lines to determined that was related to insufficient origId information; the code was storing -1 for all the IDs and the code was crashing on the line "if (allTracks[trackId].size() < maxPositions)" with trackId equal to -1. It turns out that I wasn't aware of the need for origId and origProcId files when I ran solidParticleFoam (which I used to generate the trajectories); solidParticleFoam didn't seem to require origID or origProcID in the 0/lagrangian/defaultCloud directory (actually, technically, I'm using 39400 as starting time here), and when I ran solidParticleFoam, it filled subsequent time directories with "1000{-1}" and "1000{0}" for these files, respectively.

If I instead put origID and origProcID in the 0/lagrangian/defaultCloud directory, filled with contents like shown below, before running solidParticleFoam, then subsequent use of particleTracks works fine, and without error.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       labelField;
    location    "39400";
    object      origId;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1000
(
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       labelField;
    location    "39400";
    object      origProcId;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1000
(
0
0
0
0
0
0
0
0
0
...
For context, there seems to be a similar issue that can be encountered when changing the number of processors that are used (http://www.openfoam.org/mantisbt/view.php?id=419), but this is unrelated, and wasn't an issue in my case.
gmagoon is offline   Reply With Quote

Old   February 7, 2015, 09:56
Default
  #4
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Hi,

I have a similar problem.
But your solution didn't work on mine.

I am using DPMFoam on OF 2.3.
neither it worked on my own solver in which I added particle tracking library into icoFoam.

In both serial and parallel runs I get the following error:

Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::coordSet::scalarCoord(int) const at ??:?
#4  Foam::writer<double>::writeTable(Foam::coordSet const&, Foam::List<Foam::List<double> const*> const&, Foam::Ostream&) const at ??:?
#5  Foam::rawSetWriter<double>::write(bool, Foam::PtrList<Foam::coordSet> const&, Foam::List<Foam::word> const&, Foam::List<Foam::List<Foam::Field<double> > > const&, Foam::Ostream&) const at ??:?
#6  
 at ??:?
#7  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8  
 at ??:?
Segmentation fault (core dumped)
origId and origProcId are as follows for a sample time step:

origId:
Code:
9(0 1 2 3 4 5 6 7 8)
origProcId:
Code:
9{0}
I even added both "origId" and "origProcId" into the "0" time step, but no success.

Here is my particleTrackProperties file:

Code:
cloudName       kinematicCloud;

sampleFrequency 1;

maxPositions    9;

setFormat       csv;    // see sampleDict for set formats
Thanks.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   February 7, 2015, 10:10
Default
  #5
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
I think I found a solution.

Changing the setFormat into vtk seems to solve the problem.
However I don't know why raw or csv formats don't work yet.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a 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
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 22:59
segmentation fault when installing OF-2.1.1 on a cluster Rebecca513 OpenFOAM Installation 9 July 31, 2012 16:06
Segmentation Fault Shawn_A OpenFOAM Running, Solving & CFD 6 October 31, 2011 15:38
ParaView segmentation fault only for multiphase gwierink OpenFOAM 9 March 25, 2010 08:23
segmentation fault usker Siemens 5 March 6, 2007 00:14


All times are GMT -4. The time now is 06:31.