CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to debug the error for LTSInterFoam (http://www.cfd-online.com/Forums/openfoam-solving/121152-how-debug-error-ltsinterfoam.html)

k.kshitij July 23, 2013 00:45

How to debug the error for LTSInterFoam
 
Hi All,

I'm performing steady state CFD simulation for atomizing a liquid jet in a cylindrical nozzle. I have compiled the code in debug mode and I get the following message when my simulation diverges, can anybody please suggest me what does the error message say. I want to learn in general how to understand these messages and locate where the problem is. Thanks in anticipation.
HTML Code:

Create time

Create mesh for time = 0

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu            0.09;
    C1              1.44;
    C2              1.92;
    sigmaEps        1.3;
}


Reading g
Calculating field g.h

No finite volume options present


PIMPLE: Operating solver in PISO mode

time step continuity errors : sum local = 11.5327, global = -11.5327, cumulative = -11.5327
GAMGPCG:  Solving for pcorr, Initial residual = 1, Final residual = 0.0252914, No Iterations 4
GAMGPCG:  Solving for pcorr, Initial residual = 0.000189297, Final residual = 8.84765e-06, No Iterations 2
time step continuity errors : sum local = 0.380693, global = 0.00297738, cumulative = -11.5297
Courant Number mean: 5737.01 max: 435114

Starting time loop

Time = 1

Flow time scale min/max = 1.28348e-05, 1e+15
Smoothed flow time scale min/max = 1.28348e-05, 5.36101e+14
MULES: Solving for alpha1
Phase-1 volume fraction = 3.70466e-05  Min(alpha1) = 0  Max(alpha1) = 1
MULES: Solving for alpha1
Phase-1 volume fraction = 7.41328e-05  Min(alpha1) = 0  Max(alpha1) = 1
MULES: Solving for alpha1
Phase-1 volume fraction = 0.000111258  Min(alpha1) = 0  Max(alpha1) = 1
MULES: Solving for alpha1
Phase-1 volume fraction = 0.000148421  Min(alpha1) = 0  Max(alpha1) = 1
DILUPBiCG:  Solving for epsilon, Initial residual = 1, Final residual = 0.0333823, No Iterations 12
bounding epsilon, min: -4.2004e-06 max: 2.56295e-05 average: 5.48135e-06
DILUPBiCG:  Solving for k, Initial residual = 1, Final residual = 0.000150965, No Iterations 1
#0  Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/printStack.C:221
#1  Foam::sigFpe::sigHandler(int) at ~/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/signals/sigFpe.C:117
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ~/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverScale.C:57 (discriminator 1)
#4  Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ~/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C:297
#5  Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ~/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C:99
#6  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ~/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C:164 (discriminator 1)
#7  Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ~/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude/fvMatrixSolve.C:81
#8 
 at ~/OpenFOAM/OpenFOAM-2.2.0/applications/solvers/multiphase/my_interFoam/LTSInterFoam/../pEqn.H:37 (discriminator 1)
#9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10 
 at ??:?
Floating point exception (core dumped)


Artur July 23, 2013 03:46

I am no expert so may easily be wrong but I think that the problem starts here:
Quote:

Originally Posted by k.kshitij (Post 441353)
bounding epsilon, min: -4.2004e-06 max: 2.56295e-05 average: 5.48135e-06

And then when you divide by a very small number you get a floating point exception:
Quote:

Floating point exception (core dumped)
I've had that happen to me at least a couple of times with pimpleDyMFoam.

Artur July 23, 2013 04:01

Having gone through your stack print out I noticed this:

Quote:

Originally Posted by k.kshitij (Post 441353)
#8 at ~/OpenFOAM/OpenFOAM-2.2.0/applications/solvers/multiphase/my_interFoam/LTSInterFoam/../pEqn.H:37 (discriminator 1)

it seems to me that you are using a modified version of the solver (my_interFoam?) and it crashes when solving for pEqn around line 37. When I had a quick look at the original code for LTSInterFoam I noticed that the UEqn is solved right after the
Code:

turbulence->correct();
line and only after that comes the pEqn. I am a newbie in OpenFOAM programming so hopefully someone more experienced will comment on this, but perhaps you changed something in the code around there which makes it flip over?

k.kshitij July 23, 2013 04:12

Hi Arthur,

Thanks for the reply, though I have created the a new solver called my_interFoam I have changed nothing in it. I would be adding the temperature field to it, but right now its pretty much similar to the original interfoam. I'm still trying to get why this is happening, but thanks anyways.

Artur July 23, 2013 04:18

For the time being, if I may suggest setting your turbulent quantities in your BC files to some bigger values to see if the small bounding epsilon or k are the problem? If it turns out they aren't then at least you'll know that for sure.

simt July 23, 2013 04:34

Quote:

Originally Posted by k.kshitij (Post 441353)
Hi All,

...

PIMPLE: Operating solver in PISO mode

time step continuity errors : sum local = 11.5327, global = -11.5327, cumulative = -11.5327
GAMGPCG: Solving for pcorr, Initial residual = 1, Final residual = 0.0252914, No Iterations 4
GAMGPCG: Solving for pcorr, Initial residual = 0.000189297, Final residual = 8.84765e-06, No Iterations 2
time step continuity errors : sum local = 0.380693, global = 0.00297738, cumulative = -11.5297
Courant Number mean: 5737.01 max: 435114

Starting time loop

Time = 1

Flow time scale min/max = 1.28348e-05, 1e+15
Smoothed flow time scale min/max = 1.28348e-05, 5.36101e+14
MULES: Solving for alpha1
Phase-1 volume fraction = 3.70466e-05 Min(alpha1) = 0 Max(alpha1) = 1

...
[/HTML]

Your problems appear from start, I would recommend you to take a look at you bc's. Have you perhaps prescribed both pressure and velocity on the same boundary?

Best regards

k.kshitij July 23, 2013 06:28

Hi All,
I was able to come over the earlier error by giving the relTol as zero which was earlier set to 0.1. Now I'm getting a very weird divergence, which says
HTML Code:

  [1] --> FOAM FATAL IO ERROR: 
 [1] error in IOstream "/home/ubuntu/Injector_Sims/ec2_22_7/processor1/114/p" for operation Ostream& operator<<(Ostream&, const Scalar&)
 [1] 
 [1] file: /home/ubuntu/Injector_Sims/ec2_22_7/processor1/114/p at line 138500. 
 [1] 
 [1]    From function IOstream::check(const char*) const 
 [1]    in file db/IOstreams/IOstreams/IOstream.C at line 99.

I checked the time directories(10, 20 ..) for the value that have been written and found a the field p.gz is being written, as far as LTSinterFoam is concerned we write p_rgh fields and not the p.gz fields. But in this case both p and p_rgh is written. Can anybody tell me what is happening.

Artur July 23, 2013 06:35

From IOStream.C:

Code:

bool Foam::IOstream::check(const char* operation) const
{
    if (bad())
    {
        FatalIOErrorIn
        (
            "IOstream::check(const char*) const", *this
        )  << "error in IOstream " << name() << " for operation " << operation  <= line 99 is here
            << exit(FatalIOError);
    }

    return !bad();
}

There appears to be something wrong with your output stream. Are you dumping the data to the file correctly?

simt July 23, 2013 06:41

Quote:

Originally Posted by k.kshitij (Post 441443)
I checked the time directories(10, 20 ..) for the value that have been written and found a the field p.gz is being written, as far as LTSinterFoam is concerned we write p_rgh fields and not the p.gz fields. But in this case both p and p_rgh is written. Can anybody tell me what is happening.

interFoam (and LTSInterFoam) outputs both p_rgh and p fields. p_rgh is the only needed field to be supplied in the first time directory though as the p field is computed from p_rgh as p = p_rgh + rho * g * h.


All times are GMT -4. The time now is 07:03.