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

solidParticleFoam - segmentation fault

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2012, 17:46
Default solidParticleFoam - segmentation fault
  #1
Member
 
Join Date: Jun 2011
Posts: 42
Rep Power: 15
mikeP is on a distinguished road
Hello,

I have compiled solidParticleFoam solver, which uses solidParticle libraries. Then modified solidParticle library in order to add another dimensionedScalar in particleProperties dictionary. And also modified the solidParticleFoam accordingly.

I made the following changes in respective files in the solidParticle library (red color denotes the added code). It compiles without errors. However, when I run the solver, then I get an error, which I believe is about the particleProperties dictionary. What do you think?

mySolidParticleCloud.C
Code:
Foam::mySolidParticleCloud::mySolidParticleCloud
(
    const fvMesh& mesh,
    const word& cloudName,
    bool readFields
)
:
    Cloud<mySolidParticle>(mesh, cloudName, false),
    mesh_(mesh),
    particleProperties_
    (
        IOobject
        (
            "particleProperties",
            mesh_.time().constant(),
            mesh_,
            IOobject::MUST_READ_IF_MODIFIED,
            IOobject::NO_WRITE
        )
    ),
    rhop_(dimensionedScalar(particleProperties_.lookup("rhop")).value()),
    e_(dimensionedScalar(particleProperties_.lookup("e")).value()),
    mu_(dimensionedScalar(particleProperties_.lookup("mu")).value()),
    temp_(dimensionedScalar(particleProperties_.lookup("temp")).value())
{
    if (readFields)
    {
        mySolidParticle::readFields(*this);
    }
}
mySolidParticleCloud.H
Code:
// Private data

        const fvMesh& mesh_;

        IOdictionary particleProperties_;

        scalar rhop_;
        scalar e_;
        scalar mu_;
    scalar temp_;

...

            inline scalar rhop() const;
            inline scalar e() const;
           inline scalar mu() const;
        inline scalar temp() const;
mySolidParticleCloudI.H
Code:
inline Foam::scalar Foam::mySolidParticleCloud::rhop() const
{
    return rhop_;
}

inline Foam::scalar Foam::mySolidParticleCloud::e() const
{
    return e_;
}

inline Foam::scalar Foam::mySolidParticleCloud::mu() const
{
    return mu_;
}

inline Foam::scalar Foam::mySolidParticleCloud::temp() const
{
    return temp_;
}
And also I added the following line into the particleProperties file in constant directory:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      particleProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

rhop rhop [ 1 -3  0  0  0  0  0] 1000;
e    e    [ 0  0  0  0  0  0  0] 0.8;
mu   mu   [ 0  0  0  0  0  0  0] 0.2;
temp    temp    [ 0  0  0  1  0  0  0]    283.15;

// ************************************************************************* //
Then I run my solver mySolidParticleFoam. I get the following error:
Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam200/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/opt/openfoam200/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2  Uninterpreted: 
#3  __dynamic_cast in "/usr/lib/libstdc++.so.6"
#4  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const>(Foam::word const&) const in "/opt/openfoam200/platforms/linuxGccDPOpt/lib/libsolidParticle.so"
#5  Foam::mySolidParticleCloud::move(Foam::dimensioned<Foam::Vector<double> > const&) in "/home/username/OpenFOAM/username-2.0.0/platforms/linuxGccDPOpt/lib/libmySolidParticle.so"
#6  
 in "/home/username/OpenFOAM/username-2.0.0/platforms/linuxGccDPOpt/bin/mySolidParticleFoam"
#7  __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#8  
 in "/home/username/OpenFOAM/username-2.0.0/platforms/linuxGccDPOpt/bin/mySolidParticleFoam"
Segmentation fault
mikeP is offline   Reply With Quote

Old   February 17, 2012, 19:04
Default
  #2
Member
 
Join Date: Jun 2011
Posts: 42
Rep Power: 15
mikeP is on a distinguished road
Alright, I solved the problem.
After compiling solidParticle library, it seems that in this case I have to compile mySolidParticleFoam, as well. Even if I did not change anything in the solver itself.

This confuses me a little because in some cases it works fine even though I don't recompile the solver after making changes in mySolidParticle.C file
mikeP is offline   Reply With Quote

Old   March 28, 2014, 08:13
Default a problem
  #3
New Member
 
houwy
Join Date: Nov 2013
Posts: 21
Rep Power: 13
houwy is on a distinguished road
Quote:
Originally Posted by mikeP View Post
Alright, I solved the problem.
After compiling solidParticle library, it seems that in this case I have to compile mySolidParticleFoam, as well. Even if I did not change anything in the solver itself.

This confuses me a little because in some cases it works fine even though I don't recompile the solver after making changes in mySolidParticle.C file

Hello! Now I am using solidParticleFoam right now. I have a problem with it. In 0/lagranglan/defaultcloud/d
FoamFile
{
version 2.0;
format ascii;
class scalarField;
location "0";
object d;
}

2
(
2.0e-3
2.0e-3
)
why the diameter doesn't have a unit.
If I want to simulation the process in which particle dissolution with a fixed speed. And the diameter becomes small with time. What should I do. Modify solidParticle. C or something else.
houwy 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
[OpenFOAM] Paraview - Segmentation fault grjmell ParaView 5 January 9, 2024 14:14
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 22:59
Segmentation Fault Shawn_A OpenFOAM Running, Solving & CFD 6 October 31, 2011 15:38
forrtl: severe (174): SIGSEGV, segmentation fault occurred therockyy FLOW-3D 7 January 19, 2011 23:52
ParaView segmentation fault only for multiphase gwierink OpenFOAM 9 March 25, 2010 08:23


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