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

Stdbad_cast error

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 8, 2005, 13:52
Default Hi all, I've set up a diese
  #1
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hi all,

I've set up a dieselFoam case with an axi-symmetric mesh. When I try running it, get the following error:

Exec : dieselFoam /home/ervin/OpenFOAM/ervin-1.0.2/run/tutorials/dieselFoam spray
Date : Mar 08 2005
Time : 19:46:25
Host : isi014.mot.upv.es
PID : 11157
Root : /home/ervin/OpenFOAM/ervin-1.0.2/run/tutorials/dieselFoam
Case : spray
Nprocs : 1
Create database

Create mesh for time = 0


Reading thermophysicalProperties
Selecting thermodynamics package hMixtureThermo<dieselmixture<sutherlandtransport<s peciethermo<janafthermo<perfec tgas>>>>>
Reading field U

Reading/calculating face flux field phi

Creating turbulence model.

Selecting turbulence model RNGkEpsilon
Creating field DpDt

Constructing chemical mechanism
terminate called after throwing an instance of 'std::bad_cast'
what(): St8bad_cast

Can you please tell me how to correct it?

Thanks!

Ervin
adorean is offline   Reply With Quote

Old   March 9, 2005, 07:51
Default Hi, Try this in constant/th
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi,

Try this in constant/thermophysicalProperties

thermoType hMixtureThermo<reactingmixture>;

N
niklas is offline   Reply With Quote

Old   March 9, 2005, 07:54
Default ...ok the mail and www version
  #3
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
...ok the mail and www version of the reply are not the same so have a look at the www version.

N
niklas is offline   Reply With Quote

Old   March 9, 2005, 10:10
Default Hi Niklas, Now it says:
  #4
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hi Niklas,

Now it says:

--> FOAM FATAL IO ERROR : keyword CHEMKINFile is undefined in dictionary "/home/ervin/OpenFOAM/ervin-1.0.2/run/tutorials/dieselFoam/spray/constant/thermo physicalProperties"

file: /home/ervin/OpenFOAM/ervin-1.0.2/run/tutorials/dieselFoam/spray/constant/thermop hysicalProperties from line 28 to line 44.

Function: dictionary::lookupEntry(const word& keyword) const
in file: db/dictionary/dictionary.C at line: 148.

FOAM exiting

I actually want to simulate a non-reactive, non-evaporating spray. Why does it ask me for a CHEMKINFile?

Thanks!

Ervin
adorean is offline   Reply With Quote

Old   March 9, 2005, 12:54
Default Hi, It needs the chemkin fi
  #5
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi,

It needs the chemkin file because from that it reads which species to use in the simulation
and it also needs the thermo data even though it is a non-evaporating, non-reactive spray.
is it without heat-transfer also?
...only then is the chemkin stuff 'useless'

bear in mind that the spray library has been developed towards a multi-component, real chemistry approach.

if you want to track particles using an incompressible approach you can easily rename dieselSpray and remove everything related to
mass/heat transfer.

N
niklas is offline   Reply With Quote

Old   March 10, 2005, 07:54
Default Hi, For a non-evaporating,
  #6
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hi,

For a non-evaporating, non-reactive, with heat transfer, spray case got the following error message:

--> FOAM FATAL IO ERROR : keyword liquidFuelComponents is undefined in dictionary "/home/ervin/OpenFOAM/ervin-1.0.2/run/tutorials/dieselFoam/spray/constant/thermo physicalProperties"

What parameter is liquidFuelComponents and how should I add it to "thermophysicalProperties"? (with what values?)

Thanks

Ervin
adorean is offline   Reply With Quote

Old   March 10, 2005, 08:08
Default Hi, liquidFuelComponents ar
  #7
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi,

liquidFuelComponents are the components that you want to use for the liquid fuel and for those components
you must also define the thermal/physical properties. (cp, surface tension, viscosity...etc)

If you want the default properties you would add this to you dictionary.

liquidFuelComponents
(
nameOfFuel
);

nameOfFuel nameOfFuel defaultCoeffs;


so....
lets assume your fuel is nHeptane. You would then add this.

liquidFuelComponents
(
C7H16
);

C7H16 C7H16 defaultCoeffs;

Note that the naming convention follow the chemkin format.

and if you want to use a liquid that consists of three components you could use

liquidFuelComponents
(
C10H22
C7H16
aC10H11
);

and add the thermal/physical specifications for those components.

Next error message you will get will probably be related to the injector, since you must also
define each molar concentration X.
so for a single component you'd have to add
X
(
1
)

to your injectorProperties.

easy peasy

N
niklas is offline   Reply With Quote

Old   March 16, 2005, 07:05
Default Hi, If I use C7H16 I get th
  #8
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hi,

If I use C7H16 I get this error:

Create time

Create mesh for time = 0


Reading thermophysicalProperties
Selecting thermodynamics package hMixtureThermo<reactingmixture>
Selecting chemistryReader chemkinReader
Reading field U

Reading/calculating face flux field phi

Creating turbulence model.

Selecting turbulence model RNGkEpsilon
Creating field DpDt

Constructing chemical mechanism
Selecting ODE solver SIBS
chemistryModel::chemistryModel: Number of species = 5 and reactions = 1

Reading environmentalProperties
Reading combustion properties

Constructing Spray
Selecting injectorType unitInjector
Selecting atomizationModel blobsSheetAtomization
Selecting dragModel standardDragModel
Selecting evaporationModel off
Selecting heatTransferModel RanzMarshall
Selecting wallModel reflect
Selecting breakupModel ReitzKHRT
Selecting collisionModel trajectory
Selecting dispersionModel off
Selecting injectorModel constInjector
Average Velocity for injector 0: 357.207 m/s, injection pressure = 591.789 bar
Constructing two dimensional spray injection.Calculated angle of wedge is 4.99791 deg.

Max Courant Number = 0

Starting time loop


Max Courant Number = 0
deltaT = 1e-05

Time = 1e-05
Evolving Spray
Segmentation fault

Can you please tell me what coul this error mean?

Thanks!

Ervin
adorean is offline   Reply With Quote

Old   March 16, 2005, 07:34
Default Hi, you need to define the
  #9
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi,

you need to define the properties of C12H26 in thermo.dat

As far as what the constants mean the forward reaction rate is given by the Arrhenius expression

kf = A*(T^n)*exp(-Ea/(R*T)),
where the 3 values are A n Ea,

the reactionrate is then calculate using the molar concentration of the species and the FORD values
w = - kf * c_fuel^FORD_fuel * c_ox^FORD_ox

but since you dont have evapotation you might as well turn off the chemistry, by setting
chemistry off
in chemistryProperties.

The segmentation fault error doesnt tell me anything about whats causing it.

analyze the core-dump with gdb, if you dont know how to do that you can find it somewhere here on the forum.

N
niklas is offline   Reply With Quote

Old   March 16, 2005, 07:39
Default > analyze the core-dump with g
  #10
New Member
 
Michael Conry
Join Date: Mar 2009
Posts: 8
Rep Power: 17
conry is on a distinguished road
> analyze the core-dump with gdb, if you
> dont know how to do that you can find it
> somewhere here on the forum.

Also, for anyone unfamiliar with gdb, there
is a graphical frontend "ddd" that offers a
slightly easier introduction to GNU debugging.
This is especially useful for those who would
use gdb only occasionally.

Michael
conry is offline   Reply With Quote

Old   March 16, 2005, 07:57
Default Hi Sorry I noticed that I forg
  #11
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi Sorry I noticed that I forgot one question:

>What are all the numbers in:

fuel C7H16 1 100.203 280 5000 1000 17.47 0.0421342 -1.6429e-05 2.99636e-09 -2.06488e-13 -31665.8 -64.7621 11.1532 -0.00949415 0.000195571 -2.49753e-07 9.84873e-11 -26753.1 -15.9228 1.67212e-06 170.672;?

These are the coefficients for the NASA polynomials, but you should replace 'fuel' by the name of the actual name the fuel.

All liquid components must have an associated gas component with the same name.

N
niklas is offline   Reply With Quote

Old   March 16, 2005, 08:04
Default Me again, try to turn off t
  #12
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Me again,

try to turn off the collision model.

N
niklas is offline   Reply With Quote

Old   March 16, 2005, 08:13
Default Just found the 'bug'. in tr
  #13
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Just found the 'bug'.

in trajectoryModel.C add the if statement to the beginning.

void trajectoryCollisionModel::collideParcels(const scalar dt) const
{
if (spray_.size() < 2)
{
return;
}
spray::iterator secondParcel = spray_.begin();

... etc.

N
niklas is offline   Reply With Quote

Old   March 22, 2005, 11:58
Default Hi, The 'chemistry off' swi
  #14
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hi,

The 'chemistry off' switch in chemistryProperties file doesn't work.

What else should be modified to turn off chemistry?

Thanks!

Ervin
adorean is offline   Reply With Quote

Old   March 23, 2005, 07:03
Default Hi, nothing... and it works
  #15
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi,

nothing... and it works fine for me.

Note though that is writes the 'Solving Chemistry' even
though it doesn't actually solve it.

N
niklas is offline   Reply With Quote

Old   April 1, 2005, 04:09
Default Hello, I've run the 'aachen
  #16
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hello,

I've run the 'aachenBomb' case and an axisymmetric case of diesel injection without evaporation, and have a few questions:

1) In both cases, the spray looks very narrow when represented with spherical glyphs, for example, in paraFoam. The spray doesn't "open". At least in a 2/3 of it's penetration length. Can this be corrected? Or how should I postprocess it to look more "realistic"?

2) The Schmidt number is calculated or should it be imposed? Can the Sc number be imposed? Where exactly? In "turbulenceProperties"?

3) The "nParcels" represents what? In the "aachenBomb" case, in "injectorProperties" has a value of 5000. At the end of the injection there are 17065 parcels in the system, at time 0.00125 s.

4) Can 'chem.inp.full' be used, with 56 species and 290 reactions instead of chem.inp, with 5 species and 1 reaction?

Thank you!

Ervin
adorean is offline   Reply With Quote

Old   April 1, 2005, 04:27
Default Hi, 1. This is a typical '
  #17
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi,

1. This is a typical 'problem' when using too small initial droplet size, or breakup is too fast.
Remember that for 2D there is a strong flow direction towards the axis and small droplets is carried back to the symmetry axis by the gas.

2. The Schmidt number is 1.0. If you want to change it look into the file YEqn.H and
modify the line
fvm::laplacian(turbulence->muEff(), Yi)
to for instance
fvm::laplacian(turbulence->muEff()/Sc, Yi)
where Sc is a suitable scalar

3. the nParcels represents the total number of parcels to inject for that injector. My guess is that you are using the KHRT breakup model. Remember that drops can then break-up and form new child parcels, so if you dont have evaporation the number of parcels will definitely be higher than 5000.

4. of course, either change the input in thermodynamicalProperties to point the that file or rename it to chem.inp
niklas is offline   Reply With Quote

Old   April 1, 2005, 05:19
Default Hi Niklas, Thank you for yo
  #18
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hi Niklas,

Thank you for your swift answers.

In the following, I'm refering to the axisymmetric case.

Yes, I'm using the Reitz KHRT breakup model.

The 'dropletNozzleDiameterRatio' is 1.0, this means that I can't increase the droplet initial size, if I'm right.

So, for slowing down the breakup rate, should I change (increase) B1? Or, what else?

Which atomization model is more suitable for this case?

Is there a limit to 'nParcels'? Or some guidelines for it's value for 3D and for axi-symmetric cases?

Thanks,

Ervin
adorean is offline   Reply With Quote

Old   April 1, 2005, 07:59
Default Hi, The dropletNozzleDiamet
  #19
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hi,

The dropletNozzleDiameterRatio can have any value, although physically it doesnt make sense to use a larger value than 1.

For a wider angle you can always increase the sprayConeAngle. It is not uncommon to use a larger value than the measured one since the gas flow always will reduce it.

For atomization model I have no right answer.
Experience is the key when modeling sprays.
I normally ignore atomization and go straight for the Rosin-Rammler pdf for initial drop size.
After a while you can pretty much 'guess' what it should be.

If you want to increase the angle you can always turn on the turbulent dispersion.

There is no limit for nParcels, in general the more parcels the better statistics of the liquid, but at around 5000, for this 2D case, it only increase the computational time.

For guidelines on the number of parcels you can take the total injected volume and divide it with what you think is a characteristic droplet diameter. This will give you the total number of 'drops' in the spray and if you set nParcels to a higher value than this each parcel will represent fractions of droplets instead of parcels of droplets.
For instance in your case,
if you assume characteristic droplet size equal to nozzle diameter the number of drops will be approx. 2500, but if you reduce the characteristic
size by a 10th the number of droplets go up to 2.5 millions.... this is of course for 3D calc.

Also, I'm wondering why you want to use the full chemical mechanism when you dont have any evaporation. Where does the fuel come from?
It sounds like a bad idea to me.

N
niklas is offline   Reply With Quote

Old   April 1, 2005, 08:17
Default Hi, Can you please tell me
  #20
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hi,

Can you please tell me how and where can I turn on the turbulent dispersion?

I've asked the question about the full chemical mechanism, having a different case in mind, a 3D sector of a 'real' Diesel engine, with evaporation.

Thanks

Ervin
adorean 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
Error: Floating point error: invalid number fpingqian FLUENT 4 February 8, 2012 01:20
Errors when Compiling UDF: error C2040/error C2099 Julian K. FLUENT 1 December 21, 2008 00:23
"Error: Floating point error: invalid number" MI Kim FLUENT 2 January 4, 2007 10: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 01:57


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