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

'std::bad_cast' error when running reactingFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 30, 2017, 16:51
Default 'std::bad_cast' error when running reactingFoam
  #1
New Member
 
Max
Join Date: Jul 2017
Posts: 12
Rep Power: 9
Speno93 is on a distinguished road
Hello there, fellow Foamers.

I'm running an simulation of a gas mixing in air with reactingFoam (seeing as I don't want the gases to react, I have turned reactions off in the chemistryProperties and combustionProperties files) However when I try to run the solver, I keep getting this error message.

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 4.1
Exec   : reactingFoam
Date   : Jul 30 2017
Time   : 20:39:30
Host   : "max-Lenovo-G50-80"
PID    : 3783
Case   : /home/max/OpenFOAM/max-4.1/run/EvaporatingExample
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Creating reaction model

Selecting combustion model laminar<psiChemistryCombustion>
Selecting chemistry type 
{
    chemistrySolver noChemistrySolver;
    chemistryThermo psi;
}

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

terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast
Aborted (core dumped)
I have no idea why its keeps doing it so I thought I would ask the folks on here if they have encounted this problem before?
Speno93 is offline   Reply With Quote

Old   November 8, 2017, 10:29
Default same problem
  #2
New Member
 
Simon Braungardt
Join Date: Oct 2015
Posts: 2
Rep Power: 0
SimOF is on a distinguished road
Hi,
I have the same problem. have you found any solution?
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Creating reaction model

Selecting combustion model laminar<psiChemistryCombustion>
Selecting chemistry type
{
chemistrySolver noChemistrySolver;
chemistryThermo psi;
}

Selecting thermodynamics package
{
type hePsiThermo;
mixture multiComponentMixture;
transport const;
thermo hConst;
energy sensibleEnthalpy;
equationOfState perfectGas;
specie specie;
}

terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast

SimOF is offline   Reply With Quote

Old   April 5, 2018, 12:41
Default
  #3
New Member
 
Clint
Join Date: Sep 2015
Posts: 10
Rep Power: 11
cdunn6754 is on a distinguished road
It's hard to say exactly, I just happen to have recently run into a similar error. My first guess would be that you should be using a reactingMixture rather than a multiComponentMixture in your thermophysicalProperties dictionary file.

The error you are getting is telling you that a dynamic_cast<> somewhere is going wrong. I think it is probably this one in the constructor for ChemistyModel

Code:
     reactions_
        (
            dynamic_cast<const reactingMixture<ThermoType>&>(this->thermo())
        ),
You are (with that dynamic_cast) trying to upcast the thermo reference to a reactingMixture reference but is derived from multiComponentMixture, not reactingMixture. If you are just simulating passive transport and not reactive flows you might want to look into using a simpler solver that doesn't necessarily include all of the reaction stuff. Then you probably could use multiComponentMixture.
cdunn6754 is offline   Reply With Quote

Reply

Tags
reactingfoam;


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
[OpenFOAM.org] Error running #codeStream/functions wmake lnInclude fails to open *.H Files tarik OpenFOAM Installation 8 June 14, 2020 04:12
[foam-extend.org] Foam Extend 3.2 in ubuntu 16.04 LTS JMosiezny OpenFOAM Installation 15 December 9, 2017 09:20
What do you all do to stabilize reactingFoam (or in general)? KarenRei OpenFOAM Running, Solving & CFD 7 December 11, 2016 15:34
Running reactingFoam in turbulence mode samchen1993 OpenFOAM Running, Solving & CFD 1 September 25, 2016 17:16
OpenFOAM parallel on VM? pimpleDyMFoam propeller tutorial has been running for hours. MBttR OpenFOAM Running, Solving & CFD 0 June 13, 2016 11:58


All times are GMT -4. The time now is 19:23.