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/)
-   -   an sigFpe error on Turbulence (https://www.cfd-online.com/Forums/openfoam-solving/118354-sigfpe-error-turbulence.html)

immortality May 25, 2013 14:02

an sigFpe error on Turbulence
 
1 Attachment(s)
Code:

Selecting thermodynamics package
{
type            hePsiThermo;
mixture        pureMixture;
transport      sutherland;
thermo          janaf;
equationOfState perfectGas;
specie          specie;
energy          sensibleEnthalpy;
}

--> FOAM Warning :
From function polyBoundaryMesh::groupPatchIDs() const
in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 474
Patch empty specifies a group empty which is also a patch name. This might give problems later on.
Reading field U

Reading field gas

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
bounding k, min: 0 max: 1.943998e-05 average: 1.943998e-05
bounding omega, min: 0 max: 3.018677379 average: 3.018677379
[0] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #2  in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #4  void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
[0] #5  at kOmegaSST.C:0
[0] #6  Foam::compressible::RASModels::kOmegaSST::F2() const in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #7  Foam::compressible::RASModels::kOmegaSST::F23() const in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #8  Foam::compressible::RASModels::kOmegaSST::kOmegaSST(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&, Foam::word const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #9  Foam::compressible::RASModel::adddictionaryConstructorToTable<Foam::compressible::RASModels::kOmegaSST>::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #10  Foam::compressible::RASModel::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #11  Foam::compressible::turbulenceModel::addturbulenceModelConstructorToTable<Foam::compressible::RASModel>::NewturbulenceModel(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #12  Foam::compressible::turbulenceModel::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so"
[0] #13
[0]  in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
[0] #14  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #15
[0]  in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
[Ehsan-com:18253] *** Process received signal ***
[Ehsan-com:18253] Signal: Floating point exception (8)
[Ehsan-com:18253] Signal code:  (-6)
[Ehsan-com:18253] Failing at address: 0x3e80000474d
[Ehsan-com:18253] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36460) [0x7f682a821460]
[Ehsan-com:18253] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f682a8213e5]
[Ehsan-com:18253] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36460) [0x7f682a821460]
[Ehsan-com:18253] [ 3] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so(_ZN4Foam6divideERNS_5FieldIdEERKNS_5UListIdEES6_+0xe6) [0x7f682b9c6e36]
[Ehsan-com:18253] [ 4] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont(_ZN4Foam6divideINS_12fvPatchFieldENS_7volMeshEEEvRNS_14GeometricFieldIdT_T0_EERKS6_S9_+0x8f) [0x44594f]
[Ehsan-com:18253] [ 5] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(+0x178129) [0x7f682c79d129]
[Ehsan-com:18253] [ 6] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZNK4Foam12compressible9RASModels9kOmegaSST2F2Ev+0x122) [0x7f682c79e552]
[Ehsan-com:18253] [ 7] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZNK4Foam12compressible9RASModels9kOmegaSST3F23Ev+0x11) [0x7f682c7a0571]
[Ehsan-com:18253] [ 8] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZN4Foam12compressible9RASModels9kOmegaSSTC1ERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEERKNS3_INS_6VectorIdEES4_S5_EERKNS3_IdNS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_11fluidThermoERKNS_4wordESO_+0x1048) [0x7f682c7a1fb8]
[Ehsan-com:18253] [ 9] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZN4Foam12compressible8RASModel31adddictionaryConstructorToTableINS0_9RASModels9kOmegaSSTEE3NewERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEERKNS6_INS_6VectorIdEES7_S8_EERKNS6_IdNS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_11fluidThermoERKNS_4wordE+0x66) [0x7f682c7ac2a6]
[Ehsan-com:18253] [10] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZN4Foam12compressible8RASModel3NewERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEERKNS2_INS_6VectorIdEES3_S4_EERKNS2_IdNS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_11fluidThermoERKNS_4wordE+0x33a) [0x7f682c6b8b9a]
[Ehsan-com:18253] [11] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZN4Foam12compressible15turbulenceModel36addturbulenceModelConstructorToTableINS0_8RASModelEE18NewturbulenceModelERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEERKNS5_INS_6VectorIdEES6_S7_EERKNS5_IdNS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_11fluidThermoERKNS_4wordE+0x10) [0x7f682c6bd8a0]
[Ehsan-com:18253] [12] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so(_ZN4Foam12compressible15turbulenceModel3NewERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEERKNS2_INS_6VectorIdEES3_S4_EERKNS2_IdNS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_11fluidThermoERKNS_4wordE+0x3fa) [0x7f682cab8f2a]
[Ehsan-com:18253] [13] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont() [0x421543]
[Ehsan-com:18253] [14] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f682a80c30d]
[Ehsan-com:18253] [15] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont() [0x42bb0d]
[Ehsan-com:18253] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 18253 on node Ehsan-com exited on signal 8 (Floating point exception).
--------------------------------------------------------------------------
Killing PID 18247
 PyFoam WARNING on line 232 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 18247 was already dead
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/18247/status'


wyldckat May 25, 2013 14:32

Hi Ehsan,

As I've told you in the past, the turbulence fields cannot be initialized with 0 (zero), even if they're calculated in the next iteration. In this case, you have this:
Code:

    left
    {
      type groovyBC;
      #include "variables"
      fractionExpression "port3 || port1 && phi<=0 ? 1 : 0";
      valueExpression "1.5*sqr(l*I*U)";
      value uniform 0;
      gradientExpression "0";
      //type            fixedValue;
      //value          uniform 84.375;
    }

The line "value uniform 0;" should start with the same initial value you've used for other BCs and internal fields, namely ".00001943998".

Best regards,
Bruno

immortality May 25, 2013 14:43

oh,what a careless doing!
let me test it.

immortality May 26, 2013 06:01

Hi
the new error is:
Code:

Reading field gas

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
alphaK1        0.85034;
alphaK2        1;
alphaOmega1    0.5;
alphaOmega2    0.85616;
Prt            1;
gamma1          0.5532;
gamma2          0.4403;
beta1          0.075;
beta2          0.0828;
betaStar        0.09;
a1              0.31;
b1              1;
c1              10;
F3              false;
}

fluxScheme: Kurganov

Starting time loop

Mean and max Courant Numbers = 0.9922503451 4.611736676
deltaT = 2.127659574e-08
Time = 2.12766e-08

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
[3] swak4Foam: Allocating new repository for sampledGlobalVariables
[0] swak4Foam: Allocating new repository for sampledGlobalVariables
[1] swak4Foam: Allocating new repository for sampledGlobalVariables
[2] swak4Foam: Allocating new repository for sampledGlobalVariables
smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 4.280414458e-10, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 8.835901747e-11, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for h, Initial residual = 0.002767777019, Final residual = 1.506991027e-10, No Iterations 2
time step continuity errors : sum local = 1.068829835e-19, global = -7.298774384e-21, cumulative = -7.298774384e-21
[0] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #2  in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #4  Foam::operator/(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #5  parserPatch::PatchValueExpressionParser::parse() in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
[0] #6  Foam::PatchValueExpressionDriver::parseInternal(int) in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
[0] #7  Foam::CommonValueExpressionDriver::parse(std::string const&, Foam::word const&) in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
[0] #8  Foam::groovyBCFvPatchField<double>::updateCoeffs() in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libgroovyBC.so"
[0] #9  Foam::compressible::RASModels::kOmegaSST::correct() in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #10
[0]  in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
[0] #11  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #12
[0]  in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
[Ehsan-com:08087] *** Process received signal ***
[Ehsan-com:08087] Signal: Floating point exception (8)
[Ehsan-com:08087] Signal code:  (-6)
[Ehsan-com:08087] Failing at address: 0x3e800001f97
[Ehsan-com:08087] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36460) [0x7fdf3e71e460]
[Ehsan-com:08087] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7fdf3e71e3e5]
[Ehsan-com:08087] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36460) [0x7fdf3e71e460]
[Ehsan-com:08087] [ 3] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so(_ZN4Foam6divideERNS_5FieldIdEERKNS_5UListIdEES6_+0xe6) [0x7fdf3f8c3e36]
[Ehsan-com:08087] [ 4] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so(_ZN4FoamdvERKNS_5UListIdEES3_+0x62) [0x7fdf3f8c6a82]
[Ehsan-com:08087] [ 5] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so(_ZN11parserPatch26PatchValueExpressionParser5parseEv+0x822b) [0x7fdf2ff4641b]
[Ehsan-com:08087] [ 6] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so(_ZN4Foam26PatchValueExpressionDriver13parseInternalEi+0x39) [0x7fdf30017a59]
[Ehsan-com:08087] [ 7] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so(_ZN4Foam27CommonValueExpressionDriver5parseERKSsRKNS_4wordE+0x61) [0x7fdf2ffc5651]
[Ehsan-com:08087] [ 8] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libgroovyBC.so(_ZN4Foam20groovyBCFvPatchFieldIdE12updateCoeffsEv+0x72) [0x7fdf37991f02]
[Ehsan-com:08087] [ 9] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZN4Foam12compressible9RASModels9kOmegaSST7correctEv+0xa53) [0x7fdf406a17f3]
[Ehsan-com:08087] [10] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont() [0x426c19]
[Ehsan-com:08087] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fdf3e70930d]
[Ehsan-com:08087] [12] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont() [0x42bb0d]
[Ehsan-com:08087] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 8087 on node Ehsan-com exited on signal 8 (Floating point exception).
--------------------------------------------------------------------------
Killing PID 8081
 PyFoam WARNING on line 232 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 8081 was already dead
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/8081/status'


wyldckat May 26, 2013 07:16

Hi Ehsan,

I saw that error yesterday and forgot to tell you about it: it's probably due to a division by zero.
Problem is that it does not indicate where exactly this occurs. And since you have 2 patches using "groovyBC", debugging this in a single step is extremely complicated.

My suggestion is to reduce the complexity by diving the problem into smaller problems:
  1. Do not run the case in parallel.
  2. Use only one patch with groovyBC.
  3. If this is not enough, remove the complexity of the expressions.
  4. The error message does give the hint that something went wrong at
    Code:

    Foam::compressible::RASModels::kOmegaSST::correct()
    This means that one of the turbulence related fields has the problem, so focus on those fields. But keep in mind that "U" and "p" could possibly also affect this!
GroovyBC should have an option for debugging:
Code:

debug on;
Problem is that I did not get any information from it :(


Good luck!
Bruno

immortality May 26, 2013 08:19

Hi dear Bruno
you told me about crashing.
I have used different initial values(internalField and on the walls)
I had set k
Code:

valueExpression "1.5*sqr(l*I*U)";
without mag(U) in below part but it didn't complait about that and i noticed it accidently,what may be the cause?
Code:

left
    {
      type groovyBC;
      #include "variables"
      fractionExpression "(port3==1) || (port1==1) && phi<=0 ? 1 : 0";
      valueExpression "1.5*sqr(l*I*mag(U))";
      value uniform .00001943998;
      gradientExpression "0";
      //type            fixedValue;
      //value          uniform 84.375;
    }

I'm testing on realizableKE to see if the error is related to turbulence model.
in laminar it works fine as I told you.
please let me know if you find the cause.

immortality May 26, 2013 11:49

Hi
I did 1 and 2 without success.
maybe the problem is on mut and alphat:
Code:

dimensions      [1 -1 -1 0 0 0 0];

internalField  uniform 0;

boundaryField
{
  left
    {
      type            zeroGradient;
    }

  right
    {     
      type            zeroGradient;
    }

  walls
    {
      type            mutkWallFunction;
        Cmu            0.09;
        kappa          0.41;
        E              9.8;
        value          uniform 0;
    }

  empty_faces
    {
        type empty;
       
    }
     
}

in zeroGradients?

immortality May 26, 2013 13:56

Hi Bruno
I found out its because of epsilon(or omega)expression I have put there.
Code:

valueExpression "pow(c_mu,.75)*pow(k,1.5)/l";//pow(c_mu,.75)*pow(k,1.5)/l
      value uniform  .0000586833;//
      gradientExpression "0";

when I change it to a constant value run begins.this sensitivity doesn't exist on k expression(it runs when k is a formula return of a constant)
could anyone give me an advice why this error occurs on epsilon(only)?
Code:

Mean and max Courant Numbers = 3.854767141 23.51635184
deltaT = 2.123142251e-09
Time = 2.12314e-09

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
swak4Foam: Allocating new repository for sampledGlobalVariables
smoothSolver:  Solving for Ux, Initial residual = 0.9999708636, Final residual = 1.04312093e-16, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 8.56824317e-17, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for h, Initial residual = 2.756366092e-06, Final residual = 4.932383918e-08, No Iterations 2
time step continuity errors : sum local = 5.001902517e-20, global = 4.832853138e-20, cumulative = 4.832853138e-20
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::operator/(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  parserPatch::PatchValueExpressionParser::parse() in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#6  Foam::PatchValueExpressionDriver::parseInternal(int) in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#7  Foam::CommonValueExpressionDriver::parse(std::string const&, Foam::word const&) in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#8  Foam::groovyBCFvPatchField<double>::updateCoeffs() in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libgroovyBC.so"
#9  Foam::compressible::RASModels::realizableKE::correct() in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#10 
 in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
#11  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12 
 in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
Floating point exception

----------------------------------------------------------------------------
I also replaced k formula but it's not because of k variable in epsilon file.
Code:

valueExpression "pow(c_mu,.75)*pow(1.5*sqr(l*I*mag(U)),1.5)/l";
this is the error:
Code:

realizableKECoeffs
{
    Cmu            0.09;
    A0              4;
    C2              1.9;
    sigmak          1;
    sigmaEps        1.2;
    Prt            1;
}

fluxScheme: Kurganov

Starting time loop

Mean and max Courant Numbers = 3.854767141 23.51635184
deltaT = 2.123142251e-09
Time = 2.12314e-09

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
swak4Foam: Allocating new repository for sampledGlobalVariables
smoothSolver:  Solving for Ux, Initial residual = 0.9999708636, Final residual = 1.04312093e-16, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 8.56824317e-17, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for h, Initial residual = 2.756366092e-06, Final residual = 4.932383918e-08, No Iterations 2
time step continuity errors : sum local = 5.001902517e-20, global = 4.832853138e-20, cumulative = 4.832853138e-20
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::operator/(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  parserPatch::PatchValueExpressionParser::parse() in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#6  Foam::PatchValueExpressionDriver::parseInternal(int) in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#7  Foam::CommonValueExpressionDriver::parse(std::string const&, Foam::word const&) in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libswak4FoamParsers.so"
#8  Foam::groovyBCFvPatchField<double>::updateCoeffs() in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/lib/libgroovyBC.so"
#9  Foam::compressible::RASModels::realizableKE::correct() in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#10 
 in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
#11  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12

I don't want a constant epsilon I need it be variable.whats wrong with it?(variable k works with constant epsilon)

wyldckat May 26, 2013 14:47

Hi Ehsan,

I got your email and I've taken a look at the files you had sent me before.

OK, so the problem is due to a "divide" gone wrong. The expression in question is:
Code:

valueExpression "pow(c_mu,.75)*pow(k,1.5)/l";
The only division here is the division by "l".

If we look at the formulas in questions for calculating "l", we find these:
Code:

                  "a=.003;"
                  "b=max(pos().y)-pos().y;"
                  "D_H=2*a*b/(a+b);"
                  "l=.07*D_H;"

So, for "D_H" to be zero, most likely it's due to "a" or "b".
"a" is constant and "b" is variable... therefore, the problem is "b".
Which leads us to "pos()", which is known for easily having positions with components equal to 0 (zero). Or because "max(p.y)==p.y". This is the problem you're having!


Now, my question is: why are you using a variable "b" and not a constant "b"?

Because from what I know (which might not be 100% correct), the "hydraulic diameter" is usually a fixed value, because it's the diameter of the whole entrance.
It's like the Reynolds number: it's usually the same for the whole inlet... at least if the flow is the same for the whole inlet! ;)

Best regards,
Bruno

immortality May 26, 2013 14:56

Oh,what an accurate man you are!exactly its for that!I 'll test some minutes later.
as you see in my case,the entrance opens to outside gradually(like a wall moves and opens to an environment) so I thought I have to use a variable hydraulic diameter and since the opening is 0 at first and becomes full opened during movement of the wall D_H should be variable.so i have to use full D_H in your opinion or my thought is correct?:)

wyldckat May 26, 2013 14:59

I forgot about the "dynamic opening" detail... but... then why aren't you using "min" as well?
Code:

"b=max(pos().y)-min(pos().y);"

immortality May 26, 2013 15:33

then it becomes whole the channel height again.I wonder why pts doesn't work?!

wyldckat May 26, 2013 15:59

Quote:

Originally Posted by immortality (Post 430131)
then it becomes whole the channel height again.

:confused: But "pos()" only refers to the positions of the face centers on the patch. It does not refer to points on the whole domain.
Therefore, if the points on your patch are dynamically moving, then the "pos()" values should adapt accordingly as well! Therefore, the min/max values refer only to the size of the current patch.

Quote:

Originally Posted by immortality (Post 430131)
I wonder why pts doesn't work?!

As I wrote above, "pos()" refers to the patch only, therefore there will be at least a few points where this is true:
Code:

pos().y == max(pos().y)
Therefore, when the values are equal, the subtraction of the two values equals to zero... which leads to the division by zero on the very last expression.

I thought you already knew that "pos()" referred to the position of the face centres of the patch only.
Quote:

Originally Posted by http://openfoamwiki.net/index.php/Contrib_groovyBC
pos
Vector field with the face-centers


immortality May 26, 2013 16:13

yes I knew.the patch left has height equal to .004m(4mm) and min(pos().y) is equal to 0 and max(pos().y) is equal to .004 then the difference expression becomes .004 that is the height totally.
imagine there are 3 cells on the left patch.points refer to inlet opened and vertical line indicate that the face of cell is a wall(fixed velocity and zeroGradient p and T) and it opens gradually like this:

Code:

  ______________                  _________________                  __________________                                ___________________
1)            |                            2)        .                                3)          .                                                  4)        .
                |                                        |                                            .                                                            .
                |_____________                  |________________                  |__________________                                .__________________

(why it doen't keep its order?!)

I found out why its zero.in most top cell max(pos().y) is equal to pos().y
I thought it may be solved by using pts(so that it give us the height of first cell from top of patch) but this error occurred :

Code:

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
swak4Foam: Allocating new repository for sampledGlobalVariables
smoothSolver:  Solving for Ux, Initial residual = 0.9999708636, Final residual = 1.04312093e-16, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 8.56824317e-17, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for h, Initial residual = 2.756366092e-06, Final residual = 4.932383918e-08, No Iterations 2
time step continuity errors : sum local = 5.001902517e-20, global = 4.832853138e-20, cumulative = 4.832853138e-20


--> FOAM FATAL ERROR:
 Parser Error for driver PatchValueExpressionDriver at "1.14-16" :"syntax error, unexpected TOKEN_points"
"max(pts().y)-pts().y"
              ^^^
---------------| 

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/test2/0/epsilon.boundaryField.left
  Evaluating expression "max(pts().y)-pts().y"


    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 1039.

FOAM exiting


immortality May 26, 2013 16:53

Hi Bruno
I foun a way.I need the cell height.how to obtain a cell height?
maybe:
Code:

mag(Sf())/.003
(.003 is the width of cell.
is it true?
--------------------------------
Bruno it works nooooooooooooooow!
thank you for helping a looooooooooooooooooot!

immortality May 27, 2013 14:20

a divergence occurs during run:
Code:

Mean and max Courant Numbers = 0.01607557706 0.09894979529
deltaT = 4.166666667e-09
Time = 1.45833e-07

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 2.53432678e-05, Final residual = 3.400159279e-18, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.002923070374, Final residual = 1.23447648e-17, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for h, Initial residual = 0.0001509404423, Final residual = 1.57438243e-11, No Iterations 2
time step continuity errors : sum local = 6.785493269e-18, global = -1.643282331e-18, cumulative = -1.547433476e-17
smoothSolver:  Solving for epsilon, Initial residual = 2.829125772e-05, Final residual = 2.173874257e-09, No Iterations 1
smoothSolver:  Solving for k, Initial residual = 0.06555279847, Final residual = 1.766026094e-09, No Iterations 2
smoothSolver:  Solving for gas, Initial residual = 0.03512513795, Final residual = 1.57971755e-18, No Iterations 2
ExecutionTime = 201.1 s  ClockTime = 204 s

Mean and max Courant Numbers = 0.01607558121 0.09936147123
deltaT = 4.166666667e-09
Time = 1.5e-07

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 2.474763712e-05, Final residual = 2.529692564e-18, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.002401737881, Final residual = 9.53868942e-18, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for h, Initial residual = 0.0001104389814, Final residual = 1.153609201e-11, No Iterations 2
time step continuity errors : sum local = 5.981543727e-18, global = -1.738321708e-18, cumulative = -1.721265646e-17
smoothSolver:  Solving for epsilon, Initial residual = 4.16137169e-05, Final residual = 3.5855628e-09, No Iterations 1
bounding epsilon, min: -7.987589016e-05 max: 29.7862492 average: 0.000844755619
smoothSolver:  Solving for k, Initial residual = 0.05659400164, Final residual = 2.181432471e-09, No Iterations 2
smoothSolver:  Solving for gas, Initial residual = 0.02862484509, Final residual = 1.237234725e-17, No Iterations 2
ExecutionTime = 201.26 s  ClockTime = 204 s

Mean and max Courant Numbers = 0.0160755859 0.09982524355
deltaT = 4.166666667e-09
Time = 1.54167e-07

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 2.420122174e-05, Final residual = 1.907369825e-18, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.001942449413, Final residual = 8.63874416e-18, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for h, Initial residual = 8.442192726e-05, Final residual = 8.934912716e-12, No Iterations 2
time step continuity errors : sum local = 6.130737338e-18, global = -1.686034509e-18, cumulative = -1.889869097e-17
[0] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #2  in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #3  Foam::sqrt(Foam::Field<double>&, Foam::UList<double> const&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #4  at realizableKE.C:0
[0] #5  Foam::compressible::RASModels::realizableKE::correct() in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
[0] #6
[0]  in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
[0] #7  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #8
[0]  in "/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont"
[Ehsan-com:05624] *** Process received signal ***
[Ehsan-com:05624] Signal: Floating point exception (8)
[Ehsan-com:05624] Signal code:  (-6)
[Ehsan-com:05624] Failing at address: 0x3e8000015f8
[Ehsan-com:05624] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36460) [0x7f6393639460]
[Ehsan-com:05624] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f63936393e5]
[Ehsan-com:05624] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36460) [0x7f6393639460]
[Ehsan-com:05624] [ 3] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so(_ZN4Foam4sqrtERNS_5FieldIdEERKNS_5UListIdEE+0x30) [0x7f63947df510]
[Ehsan-com:05624] [ 4] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(+0x155fc4) [0x7f6395592fc4]
[Ehsan-com:05624] [ 5] /opt/openfoam220/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so(_ZN4Foam12compressible9RASModels12realizableKE7correctEv+0xbc4) [0x7f63955998d4]
[Ehsan-com:05624] [ 6] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont() [0x426c19]
[Ehsan-com:05624] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f639362430d]
[Ehsan-com:05624] [ 8] /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamGasCont() [0x42bb0d]
[Ehsan-com:05624] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 5624 on node Ehsan-com exited on signal 8 (Floating point exception).
--------------------------------------------------------------------------
Warning: empty y range [4.16667e-09:4.16667e-09], adjusting to [4.125e-09:4.20833e-09]

gnuplot> plot
              ^
        line 0:
gnuplot> set terminal png small color
function to plot expected

                              ^
        line 0: invalid color spec, must be xRRGGBB

Warning: empty y range [4.16667e-09:4.16667e-09], adjusting to [4.125e-09:4.20833e-09]

gnuplot> set terminal png small color
                                ^
        line 0: invalid color spec, must be xRRGGBB


gnuplot> set terminal png small color
                                ^
        line 0: invalid color spec, must be xRRGGBB


gnuplot> set terminal png small color
                                ^
        line 0: invalid color spec, must be xRRGGBB


gnuplot> plot
              ^
        line 0: function to plot expected

Killing PID 5615
 PyFoam WARNING on line 232 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 5615 was already dead
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/5615/status'

I even have set k and epsilon as constants:
k:
Code:

valueExpression ".00003";//1.5*sqr(l*I*mag(U))
epsilon:
Code:

valueExpression ".0001";//pow(c_mu,.75)*pow(k,1.5)/l

wyldckat May 27, 2013 17:04

Hi Ehsan,

As for the error you showed in that post, there was a square root of "0" or of a negative value, which is why it crashed.

There are only 2 "sqrt" in "Foam::compressible::RASModels::realizableKE::corr ect()", at "src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C":
  • Here:
    Code:

    volTensorField gradU(fvc::grad(U_));
    volScalarField S2(2*magSqr(dev(symm(gradU))));
    volScalarField magS(sqrt(S2));

  • And here:
    Code:

    sqrt((mu()/rho_)*epsilon_)

So either "gradU" has zeros in it; or the second "sqrt" has got "mu()" or "epsilon_" equal to zero in at least one entry of the respective fields.

Best regards,
Bruno

immortality May 27, 2013 17:52

Hi Bruno
You think its related to initial conditions?
I'll test on the backward cases i sent to you before.
Could you please do some tests which of cases you want tomorrow night and let me know your opinion to reach the answer more rapidly?
Thank you.

immortality May 29, 2013 09:39

1 Attachment(s)
Hi Bruno.I attached a test case.
and this error occurs when run yPlus220:
Code:

ehsan@Ehsan-com:~/Desktop/shockTube_backwards_Tank/BackwardStep/for_test3$ yPlus220
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.0-b363e8d14789
Exec  : yPlus220
Date  : May 29 2013
Time  : 18:03:55
Host  : "Ehsan-com"
PID    : 3086
Case  : /home/ehsan/Desktop/shockTube_backwards_Tank/BackwardStep/for_test3
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Time = 0
Calculating wall distance

Writing wall distance to field y

Reading field U

--> FOAM Warning :
    From function polyBoundaryMesh::groupPatchIDs() const
    in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 474
    Patch empty specifies a group empty which is also a patch name. This might give problems later on.
Reading/calculating face flux field phi



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/ehsan/Desktop/shockTube_backwards_Tank/BackwardStep/for_test3/constant/transportProperties at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting


wyldckat May 29, 2013 15:41

Hi Ehsan,

I haven't looked at the test case yet, but from the error you've shown, it looks like the problem is that you forgot about using "-compressible".

I'll give some more feedback, once I manage to look at the case in about 30min.


All times are GMT -4. The time now is 06:28.