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

Segfault when using codedFixedValue and decomposePar

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2023, 12:25
Post Segfault when using codedFixedValue and decomposePar
  #1
New Member
 
Join Date: Sep 2021
Location: München
Posts: 2
Rep Power: 0
marineone is on a distinguished road
Hello guys,


I am trying to simulate a flow over a wall mounted cube. The flow domain is simple box around this cube which I have generated with blockMesh. Now I want to use the codedFixedValue functionality to have a time dependent velocity BC at the inlet as can be seen below.



Code:
inlet
    {
        type            codedFixedValue;
        value           uniform (0 0 0);
        name            periodicInletVel;
        
        codeOptions 
        #{
                -I$(LIB_SRC)/finiteVolume/lnInclude \
                -I$(LIB_SRC)/meshTools/lnInclude 
        #};


        codeInclude 
        #{ 
                #include "fvCFD.H"
                #include <cmath> 
                #include <iostream>
                #include "vector.H" 
        #};
        
        code 
        #{
                const fvPatch& boundaryPatch = this->patch();
                const vectorField& Cf = boundaryPatch.Cf();
                vectorField& field = *this;
                        
                const scalar t = this->db().time().value();
                const scalar speed = 5;
                        
                forAll(Cf, faceI)
                {
                        field[faceI] = sin(t) * vector(speed, 0, 0);

                } 
        #};
    }
Trying to decompose the mesh in 8 equal parts with this code



Code:
numberOfSubdomains 8;

method          simple;
// method          metis;
// method          ptscotch;

simpleCoeffs
{
    n               (2 2 2);
    delta           0.001;
}

hierarchicalCoeffs
{
    n               (1 1 1);
    delta           0.001;
    order           xyz;
}

manualCoeffs
{
}

metisCoeffs
{
}
leads to a Segmentation fault error. I could not figure out where exactly the problem occurs:


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::Hasher(void const*, unsigned long, unsigned int) at ??:?
#4  Foam::HashTable<Foam::tmp<Foam::fvPatchField<Foam::Vector<double> > > (*)(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&), Foam::word, Foam::string::hash>::set(Foam::word const&, Foam::tmp<Foam::fvPatchField<Foam::Vector<double> > > (* const&)(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&), bool) at ??:?
#5  ? at 0/U/boundaryField/inlet:112
#6  ? in "/lib64/ld-linux-x86-64.so.2"
#7  ? in "/lib64/ld-linux-x86-64.so.2"
#8  ? in "/lib64/ld-linux-x86-64.so.2"
#9  ? in "/lib64/ld-linux-x86-64.so.2"
#10  ? in "/lib64/ld-linux-x86-64.so.2"
#11  ? in "/lib/x86_64-linux-gnu/libdl.so.2"
#12  ? in "/lib64/ld-linux-x86-64.so.2"
#13  ? in "/lib/x86_64-linux-gnu/libdl.so.2"
#14  dlopen in "/lib/x86_64-linux-gnu/libdl.so.2"
#15  Foam::dlOpen(Foam::fileName const&, bool) at ??:?
#16  Foam::dlLibraryTable::open(Foam::fileName const&, bool) at ??:?
#17  Foam::codedBase::loadLibrary(Foam::fileName const&, Foam::string const&, Foam::dictionary const&) const at ??:?
#18  Foam::codedBase::updateLibrary() const at ??:?
#19  Foam::fvPatchField<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::codedFixedValueFvPatchField<Foam::Vector<double> > >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#20  Foam::fvPatchField<Foam::Vector<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#21  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::Boundary::readField(Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) at ??:?
#22  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields(Foam::dictionary const&) at ??:?
#23  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readFields() at ??:?
#24  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) at ??:?
#25  ? at ??:?
#26  ? at ??:?
#27  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#28  ? at ??:?
Segmentation fault
I already did some trial and error (e.g. excluding libraries, playing with the decomposeParDict values) and but none of them could fix the problem. Is there some additional code missing? Any help would be highly appreciated!
marineone is offline   Reply With Quote

Old   June 26, 2023, 07:21
Default
  #2
New Member
 
Join Date: Sep 2021
Location: München
Posts: 2
Rep Power: 0
marineone is on a distinguished road
Has anyone an idea?
marineone is offline   Reply With Quote

Old   April 10, 2024, 02:22
Default
  #3
New Member
 
Quincy
Join Date: Sep 2023
Posts: 5
Rep Power: 3
quwsk is on a distinguished road
I also encountered a same problem. Did you figured out the solution?
quwsk is offline   Reply With Quote

Old   April 12, 2024, 06:45
Default
  #4
Member
 
Amirhossein Taran
Join Date: Sep 2016
Location: Dublin, Ireland
Posts: 57
Rep Power: 10
amirhosseintaran is on a distinguished road
Quote:
Originally Posted by marineone View Post
Has anyone an idea?
Hi,

Instead of using a Simple decomposition method, can you check whether you have the same problem with scotch or not?

Scotch has no mandatory entry, so change simple to Scotch and thats it.


Bests,
Amirhossein.
amirhosseintaran is offline   Reply With Quote

Reply

Tags
codedfixedvalue, decomposepar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
pipeCyclic tutorial codeStream error in codedFixedValue BC specification fivewood OpenFOAM Running, Solving & CFD 0 January 15, 2014 23:36


All times are GMT -4. The time now is 01:30.