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

Stdbad_cast error

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   April 1, 2005, 08:36
Default > Can you please tell me how a
  #21
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
> Can you please tell me how and where can I turn on the turbulent dispersion?

have you looked in sprayProperties?

dispersionModel off;
or
dispersionModel stochasticDispersionRAS;
or
dispersionModel gradientDispersionRAS;

although I dont recommend using turbulent dispersion in 2D with non evaporation sprays.
It looks awful.
vijay480 likes this.
niklas is offline   Reply With Quote

Old   June 25, 2008, 11:06
Default Hello, if I use another Sch
  #22
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 182
Rep Power: 9
markusrehm is on a distinguished road
Hello,

if I use another Schmidt number say Sc_t=0.7 and put it like Niklas proposed

fvm::laplacian(turbulence->muEff()/Sc, Yi)

my temperature drops quickly to 0K.

Do I have to adjust something similiar in hEqn?

Regards Markus.
markusrehm is offline   Reply With Quote

Old   July 22, 2009, 10:36
Default peng-Robinson EOS in reactingfoam
  #23
Member
 
Hamed Aghajani
Join Date: Mar 2009
Location: London, UK
Posts: 77
Rep Power: 9
haghajani is on a distinguished road
Hi,

I am using "reactingFoam", to model high pressure carbon dioxide release in gas phase (near saturation line).

I added new Equation of state (peng Robinson). To make reactingfoam to work with Peng Robinson EOS, I have created a new chemistryReader with sutherlandTransport<specieThermo<janafThermo<pengR obinson>>> in typedef.

In consequence, I created new chemistry Model, new reacting mixture and new chemistrySolver to make openfoam read from pengRobinson Eos.

after changing the relevant libraries in reactingfoam and compiling, I tried to run a case with updated reactingfoam. I got this error;
...
Constructing chemical mechanism
terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast
Aborted

Would you please let me know where should i correct?
Is there any better approach to work with a new EoS in reactingFoam

Best regards,
Hamed
haghajani is offline   Reply With Quote

Old   July 23, 2009, 07:30
Default
  #24
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,920
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by haghajani View Post
Hi,

I am using "reactingFoam", to model high pressure carbon dioxide release in gas phase (near saturation line).

I added new Equation of state (peng Robinson). To make reactingfoam to work with Peng Robinson EOS, I have created a new chemistryReader with sutherlandTransport<specieThermo<janafThermo<pengR obinson>>> in typedef.

In consequence, I created new chemistry Model, new reacting mixture and new chemistrySolver to make openfoam read from pengRobinson Eos.

after changing the relevant libraries in reactingfoam and compiling, I tried to run a case with updated reactingfoam. I got this error;
...
Constructing chemical mechanism
terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast
Aborted

Would you please let me know where should i correct?
Is there any better approach to work with a new EoS in reactingFoam

Best regards,
Hamed
The source of your problem is the line in the chemistryModel-constructor where it says:


reactions_(dynamic_cast<const reactingMixture&>(thermo)),

To cut a long story short: reactingFoam only works with thermoPhysical-models that are subclasses of reactingMixture (and I think, but am not sure, that some stuff also assumes that your EoS is perfect gas).

So there is no trivial way to do what you want, I'm afraid

Bernhard
gschaider is offline   Reply With Quote

Old   August 11, 2009, 12:44
Default To escape bad_cast error!
  #25
Member
 
Hamed Aghajani
Join Date: Mar 2009
Location: London, UK
Posts: 77
Rep Power: 9
haghajani is on a distinguished road
Dear Bernhard,
You are right,

As far as I try new ways, i get few success!

As you mentioned, the source of problem is the line "reactions_(dynamic_cast<const nreactingMixture&>(thermo))", in my case.

Is it possible to develope thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C ; where currently is,
defineTemplateTypeNameAndDebug(hMixtureThermo<reactingMixture>, 0)

typedef hMixtureThermo<reactingMixture> hMixtureThermoReactingMixture;

addToRunTimeSelectionTable
(
hCombustionThermo,
hMixtureThermoReactingMixture,
fvMesh
);
addToRunTimeSelectionTable
(
basicThermo,
hMixtureThermoReactingMixture,
fvMesh
);
for reactingFoam.

I have found the link Real gases, where prof.Jasak post a comment for already all solvers except reactingFoam.

Thanks a lot,
Hamed
haghajani is offline   Reply With Quote

Old   August 11, 2009, 13:24
Default
  #26
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,920
Rep Power: 41
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by haghajani View Post
Dear Bernhard,
You are right,

As far as I try new ways, i get few success!

As you mentioned, the source of problem is the line "reactions_(dynamic_cast<const nreactingMixture&>(thermo))", in my case.

Is it possible to develope thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C ; where currently is,
defineTemplateTypeNameAndDebug(hMixtureThermo<reactingMixture>, 0)

typedef hMixtureThermo<reactingMixture> hMixtureThermoReactingMixture;

addToRunTimeSelectionTable
(
hCombustionThermo,
hMixtureThermoReactingMixture,
fvMesh
);
addToRunTimeSelectionTable
(
basicThermo,
hMixtureThermoReactingMixture,
fvMesh
);
for reactingFoam.

I have found the link Real gases, where prof.Jasak post a comment for already all solvers except reactingFoam.

Thanks a lot,
Hamed
Hi Hamed!

Something happened between my last posting and your post: OpenfOAM 1.6 was released!

Have a look at section 4.3 of http://www.opencfd.co.uk/openfoam/do...Notes-1.6.html
This might be of interest for you

Bernhard
vijay480 likes this.
gschaider is offline   Reply With Quote

Old   August 12, 2009, 12:57
Question Thread changed to Real Gas
  #27
Member
 
Hamed Aghajani
Join Date: Mar 2009
Location: London, UK
Posts: 77
Rep Power: 9
haghajani is on a distinguished road
Dear Bernhard,
Thanks a lot for the clue,

I have changed the Thread, because it is not related to std_cast error anymore, Would you please do me a favor and reply my question in the this Thread:
Real gases


Best regards,
Hamed
haghajani is offline   Reply With Quote

Old   May 29, 2013, 01:20
Default std::bad_cast error
  #28
New Member
 
Vijay Bhaskar Devarapalli
Join Date: May 2013
Posts: 4
Rep Power: 5
vijay480 is on a distinguished road
Hello all,

I tried simulating sprayEngineFoam and I have the following errror. I am working in 2.2.0 version ..

Build : 2.2.0-5be49240882f
Exec : sprayEngineFoam
Date : May 28 2013
Time : 22:00:01
Host : "ubuntu"
PID : 2971
Case : /home/sriksm/OpenFOAM/sriksm-2.2.0/run/forte
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 engine time

Create mesh for time = -180

Selecting engineMesh layered
deckHeight: 0.11
piston position: 0.0179

Reading g
Creating combustion model

Selecting combustion model PaSR<psiChemistryCombustion>
Selecting chemistry type
{
chemistrySolver ode;
chemistryThermo psi;
}

Selecting thermodynamics package
{
type hePsiThermo;
mixture inhomogeneousMixture;
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)



Can anyone please help me ?
__________________
Cheers,
Vijay.
vijay480 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Floating point error: invalid number fpingqian FLUENT 4 February 8, 2012 02:20
Errors when Compiling UDF: error C2040/error C2099 Julian K. FLUENT 1 December 21, 2008 01:23
"Error: Floating point error: invalid number" MI Kim FLUENT 2 January 4, 2007 11:00
Fatal error error writing to tmp No space left on device maka OpenFOAM Installation 2 April 3, 2006 08:48
Error: Internal error at line 743 in file 'amgif.c H.S.Fang FLUENT 2 January 7, 2002 02:57


All times are GMT -4. The time now is 02:50.