CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   segmentation error (https://www.cfd-online.com/Forums/openfoam/85558-segmentation-error.html)

isabel March 1, 2011 11:36

segmentation error
 
Hello everybody,

I want to correct a boundary condition of a variable called “nHatfv” by means of working with “nHapt” in these lines:


surfaceVectorField::GeometricBoundaryField& nHatb = nHatfv.boundaryField();
const fvBoundaryMesh& boundary = mesh.boundary();
forAll(boundary, patchi)
{
fvsPatchVectorField& nHatp = nHatb[patchi];
vectorField nf = boundary[patchi].nf();
scalarField a12 = nHatp & nf;
scalarField b2(nHatp.size());
forAll(b2,facei)
{
b2[facei] = Foam::cos(Foam::acos(a12[facei]));
}
nHatp /=b2*a12;
}

The solver compiles Ok without errors, but when I want to run my tutorial, I have the folllowing error:

#0 Foam::errorprintStack(Foam::Ostream&) in "/home/isabel/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/home/isabel/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xb807a400]
#3 main in "/home/isabel/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxGccDPOpt/informe24"
#4 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#5 _start at /build/buildd/glibc-2.9/csu/../sysdeps/i386/elf/start.S:122
Segmentation error


and I saw that the error dissapears if I supress these lines:


forAll(b2,facei)
{
b2[facei] = Foam::cos(Foam::acos(a12[facei])-theta[facei]);
}


But I need these lines. What can I do?

deepsterblue March 1, 2011 11:40

Let me guess - do you have any empty patches?

isabel March 2, 2011 02:22

May be, in the first lime I equal “nHatb = nHatfv.boundaryField()”, but I did not defined nHatfv in my “createFields.H”.



Is this the problem?

isabel March 2, 2011 02:23

May be, in the first lime I equal “nHatb = nHatfv.boundaryField()”, but I did not defined nHatfv in my “createFields.H”.

Is this the problem?

isabel March 2, 2011 02:25

May be, in the first lime I equal “nHatb = nHatfv.boundaryField()”, but I did not defined nHatfv in my “createFields.H”.

Is this the problem?


All times are GMT -4. The time now is 05:57.