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

A little help with compressibleInterFoam on OpenFoam2012

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 6, 2021, 18:34
Default A little help with compressibleInterFoam on OpenFoam2012
  #1
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 6
Shibi is on a distinguished road
Hello to all,

I just compiled OpenFOAM v2012 in debug mode.

I am trying to use compressibleInterFoam in a simple rectangle with (20 x 3 x 50)mm to simulate the filling of the plate with water and air.

However, I am getting an error saying:


Code:
--> FOAM FATAL ERROR: (openfoam-2012)
Tensor is not invertible due to the zero determinant:det(Tensor) = 8e-20

    From Foam::Tensor<Cmpt> Foam::inv(const Foam::Tensor<Cmpt>&, Cmpt) [with Cmpt = double]
    in file /home/pc/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/TensorI.H at line 738.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-v2012/src/OSspecific/POSIX/printStack/printStack.C:237
#1  Foam::error::exitOrAbort(int, bool) at ~/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/error.C:262
#2  Foam::error::abort() at ~/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/error.C:298
#3  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in ~/OpenFOAM/OpenFOAM-v2012/platforms/linux64GccDPInt32Debug/bin/compressibleInterFoam
#4  Foam::Tensor<double> Foam::inv<double>(Foam::Tensor<double> const&, double) at ~/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/TensorI.H:738
#5  Foam::Tensor<double> Foam::inv<double>(Foam::Tensor<double> const&) at ~/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/TensorI.H:754
#6  Foam::inv(Foam::Field<Foam::Tensor<double> >&, Foam::UList<Foam::Tensor<double> > const&) at ~/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/fields/Fields/tensorField/tensorField.C:106 (discriminator 3)
#7  void Foam::inv<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const&) in ~/OpenFOAM/OpenFOAM-v2012/platforms/linux64GccDPInt32Debug/bin/compressibleInterFoam
#8  Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::inv<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in ~/OpenFOAM/OpenFOAM-v2012/platforms/linux64GccDPInt32Debug/bin/compressibleInterFoam
#9  Foam::tmp<Foam::GeometricField<Foam::outerProduct<Foam::Vector<double>, double>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::reconstruct<double>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in ~/OpenFOAM/OpenFOAM-v2012/platforms/linux64GccDPInt32Debug/bin/compressibleInterFoam
#10  ? in ~/OpenFOAM/OpenFOAM-v2012/platforms/linux64GccDPInt32Debug/bin/compressibleInterFoam
#11  ? in ~/OpenFOAM/OpenFOAM-v2012/platforms/linux64GccDPInt32Debug/bin/compressibleInterFoam
#12  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
 #13  ? in ~/OpenFOAM/OpenFOAM-v2012/platforms/linux64GccDPInt32Debug/bin/compressibleInterFoam


 Aborted (core dumped)
However, If I run the same setup with OpenFoam 7, the case will run without any problem...

Anyone had a similar problem?

Thanks in advance
Shibi is offline   Reply With Quote

Old   February 7, 2021, 16:20
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hi,

The difference is that v2012 has an extra guard (which doesn't exist in OF7) to prevent zero division errors in TensorI.H during tensor-inverse computations (`inv` function):

Code:
    #ifdef FULLDEBUG
    if (mag(dett) < SMALL)
    {
        FatalErrorInFunction
            << "Tensor is not invertible due to the zero determinant:"
            << "det(Tensor) = " << mag(dett)
            << abort(FatalError);
    }
     #endif


    return cof(t).T()/dett;
- You can remove this bit and recompile the code
- You can compile the code in Opt mode
- We can relax the constraint from `SMALL` to `VSMALL`
tschala and Shibi like this.
HPE is offline   Reply With Quote

Old   February 8, 2021, 13:19
Default
  #3
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 6
Shibi is on a distinguished road
Changed `SMALL` to `VSMALL`and got the problem solved!


Thanks!
Shibi is offline   Reply With Quote

Old   October 7, 2021, 03:05
Default
  #4
Member
 
Venkat Ganesh
Join Date: May 2020
Location: Cincinnati, Ohio
Posts: 49
Rep Power: 6
Venky_94 is on a distinguished road
Quote:
Originally Posted by HPE View Post
Hi,

The difference is that v2012 has an extra guard (which doesn't exist in OF7) to prevent zero division errors in TensorI.H during tensor-inverse computations (`inv` function):

Code:
    #ifdef FULLDEBUG
    if (mag(dett) < SMALL)
    {
        FatalErrorInFunction
            << "Tensor is not invertible due to the zero determinant:"
            << "det(Tensor) = " << mag(dett)
            << abort(FatalError);
    }
     #endif


    return cof(t).T()/dett;
- You can remove this bit and recompile the code
- You can compile the code in Opt mode
- We can relax the constraint from `SMALL` to `VSMALL`
Hi,

I'm facing the same issue while running in debug mode. My solver is running without issues in regular mode but throws the same error as mentioned here while running in debug mode. I followed your suggestion and tried removing the line of code, tried relaxing the constraint from `SMALL` to `VSMALL, and even copied the corresponding segment of code from OF7's TensorI.H file and replaced that in my v2012's TensorI.H file and recompiled the code. But everytime, OpenFOAM throws the same error at me in debug mode.

I go to the file location and check, the error line mentioned below is not even present in the header file. Please suggest what could be the issue.

Code:
--> FOAM FATAL ERROR: (openfoam-2012)
Tensor is not invertible due to the zero determinant:det(Tensor) = 6.5205e-29

    From Foam::Tensor<Cmpt> Foam::inv(const Foam::Tensor<Cmpt>&, Cmpt) [with Cmpt = double]
    in file /opt/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/TensorI.H at line 738.

Last edited by Venky_94; October 7, 2021 at 15:13.
Venky_94 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



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