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

an odd Fatal Error:ExpressionResult::calcIsSingleValueInternal< bool>()

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By jherb
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 10, 2015, 20:12
Default an odd Fatal Error:ExpressionResult::calcIsSingleValueInternal< bool>()
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
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.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 11, 2015, 06:02
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
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?
wyldckat likes this.
jherb is offline   Reply With Quote

Old   August 11, 2015, 06:28
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
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?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 12, 2015, 17:21
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________

Last edited by wyldckat; August 12, 2015 at 17:25. Reason: fixed typo and added #5
wyldckat is offline   Reply With Quote

Old   August 13, 2015, 05:32
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
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
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.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 14, 2015, 16:29
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

Quote:
Originally Posted by immortality View Post
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 likes this.
__________________
wyldckat is offline   Reply With Quote

Old   August 14, 2015, 19:37
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
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.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.

Last edited by immortality; August 16, 2015 at 01:55.
immortality is offline   Reply With Quote

Old   August 16, 2015, 07:44
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
immortality likes this.

Last edited by wyldckat; August 16, 2015 at 07:48. Reason: see "edit:"
wyldckat 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 19:45
decomposePar is missing a library whk1992 OpenFOAM Pre-Processing 8 March 7, 2015 08:53
[snappyHexMesh] sHM: FATAL ERROR: More than six unsigned transforms detected Djub OpenFOAM Meshing & Mesh Conversion 0 July 15, 2014 05:43
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


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