CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Segmentation Fault error after min-max

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 19, 2014, 08:52
Default Segmentation Fault error after min-max
  #1
New Member
 
Bharat Bhushan Sharma
Join Date: Nov 2014
Posts: 8
Rep Power: 4
bharat.gmail is on a distinguished road
Hello Dear Foamers,

I have been writing one of my solver and am stucked at one place due to segmentation fault error. Given below are the details about this error.

Code:
boundaryField
{
    adiabatic
    {
        type            zeroGradient;
    }
    heater
    {
        type            zeroGradient;
    }
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
}

DILUPBiCG:  Solving for H, Initial residual = 1, Final residual = 1.75168e-16, No Iterations 1
Enthalpy  Min(H) = -2.5054e+23 Max(H) = 5.6046e+36
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::relativePermeabilityModels::krBrooksAndCorey::correct() in "/root/OpenFOAM/root-2.3.0/platforms/linux64GccDPOpt/lib/libporousModels.so"
#4  
 in "/root/OpenFOAM/root-2.3.0/platforms/linux64GccDPOpt/bin/impesFoam"
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6  
 in "/root/OpenFOAM/root-2.3.0/platforms/linux64GccDPOpt/bin/impesFoam"
The location mentioned in above error stack is :
Code:
                forAll(H_,i)
                {

              
                    if( ( H_[i] > -ROL_.value()*(scalar(2)*hvsat_.value() - hlsat_.value()) ) && ( (H_[i] < -ROV_.value()*hvsat_.value()) || (H_[i] == -ROV_.value()*hvsat_.value()) ) )
                    {

                        T_[i] = TSAT_.value();

                        dTdH_[i] = scalar(0.0);
                        Sb_[i] = - ( H_[i] + ROV_.value()*hvsat_.value() )/( ROL_.value()*hlg_.value() + (ROL_.value() - ROV_.value())*hvsat_.value() );
                    }

                 }

This piece of code is written inside krBrooksAndCarey.H which contains a derived class called krBrooksAndCarey. This is derived from a base abstract class wherein this H_ is declared as a volScalarField using following:

volScalarField H_

Also the H volscalarField which is a primitive variable for enthalpy equation is declared in createFields.H file as:

volScalarField H
(
IOobject
(
"H",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

I think there is something wrong with H volScalarField. I think there is no connection b/w H_ and H defined separately. I wish them to be representing same field variable. But dont know how to do so.

Can someone help me sortout this problem. I am really stucked.

Bharat
bharat.gmail is offline   Reply With Quote

Old   December 19, 2014, 09:41
Default
  #2
Member
 
Likun
Join Date: Feb 2013
Posts: 52
Rep Power: 5
Likun is on a distinguished road
Send a message via Skype™ to Likun
Hi Bharat,

Just an idea, please make sure that all the variables are properly initialized, sometimes that gives a Segmentation Fault error.

Best,
Likun
Likun is offline   Reply With Quote

Old   December 20, 2014, 01:36
Default
  #3
Senior Member
 
T Chourushi
Join Date: Jul 2009
Location: India
Posts: 319
Blog Entries: 1
Rep Power: 10
Tushar@cfd is on a distinguished road
Hi all,

I agree with Likun, check the initialization of the variables. I think your solver is not able to initialize the variable (in your custom BC) which leads to the segmentation fault. I am not expert on custom BC, anyways I think the error could be in this formulation:

Code:
  forAll(H_,i)  {......}
As, a suggestion I would suggest you to try something like this....

Code:
  forAll(H_.BoundaryField(),i)  {......}
Also set the required internalField for the BC in you case directory. Wish you Best Luck

-
Best Regards!

Last edited by Tushar@cfd; December 20, 2014 at 01:58. Reason: Added a line
Tushar@cfd is offline   Reply With Quote

Old   December 24, 2014, 03:31
Question
  #4
New Member
 
Bharat Bhushan Sharma
Join Date: Nov 2014
Posts: 8
Rep Power: 4
bharat.gmail is on a distinguished road
can the error be due to values out of bound as is printed below ?

Enthalpy Min(H) = -2.5054e+23 Max(H) = 5.6046e+36

Can some one tell me what is the maximum and minimum numerical value supported by openFoam in double or single precision ?
bharat.gmail is offline   Reply With Quote

Old   December 24, 2014, 09:30
Default
  #5
New Member
 
Bharat Bhushan Sharma
Join Date: Nov 2014
Posts: 8
Rep Power: 4
bharat.gmail is on a distinguished road
problem solved....

:-)

Last edited by bharat.gmail; December 24, 2014 at 10:41.
bharat.gmail is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
y+ and u+ values with low-Re RANS turbulence models: utility + testcase florian_krause OpenFOAM 110 April 21, 2016 11:54
multiphase turbulance case floating error harsha_kulkarni OpenFOAM Running, Solving & CFD 3 February 18, 2016 06:06
Problem of simulating of small droplet with radius of 2mm liguifan OpenFOAM Running, Solving & CFD 5 June 3, 2014 02:53
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 12:59.