CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Segfault when using codedFixedValue and decomposePar (https://www.cfd-online.com/Forums/openfoam-solving/250451-segfault-when-using-codedfixedvalue-decomposepar.html)

marineone June 15, 2023 11:25

Segfault when using codedFixedValue and decomposePar
 
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 June 26, 2023 06:21

Has anyone an idea?

quwsk April 10, 2024 01:22

I also encountered a same problem. Did you figured out the solution?

amirhosseintaran April 12, 2024 05:45

Quote:

Originally Posted by marineone (Post 852352)
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.


All times are GMT -4. The time now is 14:55.