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 odd Fatal Error:ExpressionResult::calcIsSingleValueInternal< bool>() (https://www.cfd-online.com/Forums/openfoam-solving/157904-odd-fatal-error-expressionresult-calcissinglevalueinternal-bool.html)

immortality August 10, 2015 19:12

an odd Fatal Error:ExpressionResult::calcIsSingleValueInternal< bool>()
 
its the output of my case run. its so weird and unclear about the source of the error:
Code:

Create time

Create mesh for time = 0

Reading thermophysical properties

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

Reading field U

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;
    gamma1          0.5532;
    gamma2          0.4403;
    beta1          0.075;
    beta2          0.0828;
    betaStar        0.09;
    a1              0.31;
    c1              10;
    Cmu            0.09;
    Prt            1;
    b1              1;
    F3              false;
}

fluxScheme: Kurganov

Starting time loop

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

Creating expression field CRRv ...swak4Foam: Allocating new repository for sampledMeshes
swak4Foam: Allocating new repository for sampledGlobalVariables

"Loaded plugin functions for 'FieldValueExpressionDriver':"
  rhoTurb_R:
    "volSymmTensorField rhoTurb_R()"
  rhoTurb_alphaEff:
    "volScalarField rhoTurb_alphaEff()"
  rhoTurb_devRhoReff:
    "volSymmTensorField rhoTurb_devRhoReff()"
  rhoTurb_epsilon:
    "volScalarField rhoTurb_epsilon()"
  rhoTurb_k:
    "volScalarField rhoTurb_k()"
  rhoTurb_muEff:
    "volScalarField rhoTurb_muEff()"
  rhoTurb_mut:
    "volScalarField rhoTurb_mut()"
  thermo_Cp:
    "volScalarField thermo_Cp()"
  thermo_Cv:
    "volScalarField thermo_Cv()"
  thermo_T:
    "volScalarField thermo_T()"
  thermo_alpha:
    "volScalarField thermo_alpha()"
  thermo_hc:
    "volScalarField thermo_hc()"
  thermo_he:
    "volScalarField thermo_he()"
  thermo_mu:
    "volScalarField thermo_mu()"
  thermo_p:
    "volScalarField thermo_p()"
  thermo_psi:
    "volScalarField thermo_psi()"
  thermo_rho:
    "volScalarField thermo_rho()"

swak4Foam: Setting default mesh
 type:volScalarField
Creating expression field CRRp ... type:volScalarField
faceSource massflow_left:
    total faces  = 54
    total area  = 1.2e-05


faceSource Average_left:
    total faces  = 54
    total area  = 1.2e-05


faceSource massflow_right:
    total faces  = 54
    total area  = 1.2e-05


faceSource Average_right:
    total faces  = 54
    total area  = 1.2e-05


faceSource n1_Average:
    total faces  = 868
    total area  = 1.2e-05


faceSource n2_Average:
    total faces  = 216
    total area  = 1.2e-05


swak4Foam: Allocating new repository for sampledSurfaces
faceSource n3_Average:
    total faces  = 868
    total area  = 1.2e-05


faceSource h1_Average:
    total faces  = 11204
    total area  = 0.000207


faceSource h2_Average:
    total faces  = 2800
    total area  = 0.000207


faceSource h3_Average:
    total faces  = 11204
    total area  = 0.000207


Mean and max Courant Numbers = 0.0284841995776 0.0869432167197
deltaT = 1.19047619048e-08
Time = 1.1904762e-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


--> FOAM FATAL ERROR:
This specialisation is not implemented


    From function ExpressionResult::calcIsSingleValueInternal<bool>()
    in file ExpressionResult/ExpressionResult.C at line 373.

FOAM exiting

:(
the case was executing well before the previous installation of OF been cleared by accident. I just install everything again.:confused:

jherb August 11, 2015 05:02

I guess more information is necessary to help you: Which version of OpenFOAM, which solver.

Googling the error message results in this hit:
http://sourceforge.net/p/openfoam-ex...27a1d73c5e73f/

Do you use swak4foam?

immortality August 11, 2015 05:28

Hi dear Joachim,
I use OF 2.4.0, and the solver is rhoCentralFoam and yes I use groovyBC from swak4Foam code package.
is more thing need to be said?

wyldckat August 12, 2015 16:21

Greetings to all!

This is one of those situations where I tend to sigh... almost in desperation :(. I won't even bother to rant about this...
I say this because, although this question might be useful for many people in the future, the question did not follow the proposed guidelines: http://www.cfd-online.com/Forums/ope...-get-help.html

@Ehsan:
  1. The problem you've reported occurs when the solver is trying to solve equations. Usually there are only a few reasons why a solver would give such a message while it's trying to solve equations:
    1. The equation is incorrectly defined.
    2. The boundary conditions are incorrectly defined.
    3. Bad arithmetic operations happens (e.g. divide by zero, which results in sigFpe).
  2. Omitting details can lead to no one answering your question, because time is too precious (special one's own free time) and there are a lot more people who did provide more details than you did and in such a scenario, it can be considered that they deserve an answer before you get your answer. I thought you had already learned about this several months ago. But sorry, I digressed... (I couldn't help myself from ranting a bit :()
  3. Without knowing what is the exact boundary condition you are using with swak4Foam, it's not possible to properly diagnose the reason for the error.
  4. Therefore, the only explanation I can give you, fortunately based on jherb's answer, is this: the error message it telling you that there is a single value expression of type "bool" in your boundary condition that uses groovyBC.
    1. For example, if you have something like this:
      Code:

      a = 1 == 2;
      this will result in the variable "a" being of type "bool", which as the message states:
      Code:

      This specialisation is not implemented
    2. The reason(s) why this is not implemented (yet) is(are) probably simple enough: not enough time to implement and/or because OpenFOAM does not solve equations of type "bool".
  5. (edit: forgot about this one before) So, how can you fix this? I don't know, without seeing the whole boundary condition, or at least not without seeing a simplified version of the boundary condition, so that I (or anyone else) can try and replicate the same error and then try to solve it.

Best regards,
Bruno

immortality August 13, 2015 04:32

Hello dear Bruno,
sorry if low information bothered you, because it was running well before and as you helped a lot,all aspects of the problem was investigated and issues had been solved and I wonder why this error is shown after all those things :eek:
anyway, I tried to run the case without my edited solver and without parallel run, in the simplest form I used the original solver of OF: rhoCentralFoam and an error on Cp and Cv fields I received in return of the Fatal Error mentioned here. its in http://www.cfd-online.com/Forums/ope...tml#post559385
first of all we may better see what's happening about the specified fields, then if the current error was persisted go for more details and I will submit BCs and other important parts of the case.
thanks a lot.

wyldckat August 14, 2015 15:29

Hi Ehsan,

Quote:

Originally Posted by immortality (Post 559389)
rhoCentralFoam and an error on Cp and Cv fields I received in return of the Fatal Error mentioned here. its in http://www.cfd-online.com/Forums/ope...tml#post559385

And that issue is now solved, namely in post #40 on that thread. Ironically, you only postponed the inevitable, i.e. that without access to the case, it was almost impossible to fully diagnose the problem.
Simultaneously, since you sent me the case, I could properly diagnose this problem as well.

Remember where I wrote in the previous post:
Code:

a = 1 == 2;
That's exactly what happened. For example, you had this line:
Code:

"port2=(t1+c1r<t_mappedr && t_mappedr<t1+c2r);"
This expression returns a boolean value, i.e. type "bool", because it's either "true" or "false".
The solution was to change this to:
Code:

"port2=(t1+c1r<t_mappedr && t_mappedr<t1+c2r) ? 1 : 0;"
so that "true" would provide the number "1" and "false" would provide "0".

Now that I think about it, I forgot to point out on the other post that this was the workaround... but since you didn't specifically ask how to fix the problem...


Several lines had to be fixed in the case you sent me, because a lot of them were using that "bool" type of expression.

The strange thing that I found is that you already had this kind of conversion of boolean to number done in a few places, for example:
Code:

fractionExpression "(wall_left) || (port3 && M3>=1) || (port1 && M1>=1)? 1 : 0";
The conversion is only partial in this case, but still.



This makes me vaguely remember that we already had seen this problem a few years ago... but I can't remember exactly what happened.
Perhaps I provided you a modified swak4Foam that could handle this type of data?... I can't remember... I went Googling a bit and found this post of yours: http://www.cfd-online.com/Forums/ope...tml#post430096 - post #6, but in post #2 on that same thread I indicated an implementation you had a day before #6. The one on post #2 had this same kind of buggy expression:
Code:

fractionExpression "port3 || port1 && phi<=0 ? 1 : 0";
but on post #6 you already had:
Code:

fractionExpression "(port3==1) || (port1==1) && phi<=0 ? 1 : 0";
Therefore, something weird is going on here...

Anyway, the problem for this current thread seems to be solved.

Best regards,
Bruno

immortality August 14, 2015 18:37

dear Bruno, I am very so thankful of you, I don't know how to thank you. you are a real angel ;-)
and yes I think you or Bernhard gave me a modified version of swak4Foam that boolean calculation was included and Bernhard wanted me to leave a comment about the bug in the related page of bugs so that he remember to include it for next versions. haven't you had that version now to give me please?
in this thread it seems Boolean issue must have been solved!
http://www.cfd-online.com/Forums/ope...tml#post440973
thanks a lot again.

wyldckat August 16, 2015 06:44

Hi Ehsan,

I've re-sent you via email the version that Bernhard had done back then.
The associated bug report was this one: http://sourceforge.net/p/openfoam-ex...swak4foam/172/

This feature got lost in the commit that jherb pointed out.

I guess you'll had to report this bug again, if you want it fixed again.

edit: Now that I think about it... the version back then was swak4Foam 0.2.4 and the version I sent you is a bit after that... it's very unlikely it will build with OpenFOAM 2.4.0.

Best regards,
Bruno


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