CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Stdbad_cast error (http://www.cfd-online.com/Forums/openfoam-solving/58779-stdbad_cast-error.html)

adorean March 8, 2005 14:52

Hi all, I've set up a diese
 
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

niklas March 9, 2005 08:51

Hi, Try this in constant/th
 
Hi,

Try this in constant/thermophysicalProperties

thermoType hMixtureThermo<reactingmixture>;

N

niklas March 9, 2005 08:54

...ok the mail and www version
 
...ok the mail and www version of the reply are not the same so have a look at the www version.

N

adorean March 9, 2005 11:10

Hi Niklas, Now it says:
 
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

niklas March 9, 2005 13:54

Hi, It needs the chemkin fi
 
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

adorean March 10, 2005 08:54

Hi, For a non-evaporating,
 
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

niklas March 10, 2005 09:08

Hi, liquidFuelComponents ar
 
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 http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

N

adorean March 16, 2005 08:05

Hi, If I use C7H16 I get th
 
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

niklas March 16, 2005 08:34

Hi, you need to define the
 
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

conry March 16, 2005 08:39

> analyze the core-dump with g
 
> 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

niklas March 16, 2005 08:57

Hi Sorry I noticed that I forg
 
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 March 16, 2005 09:04

Me again, try to turn off t
 
Me again,

try to turn off the collision model.

N

niklas March 16, 2005 09:13

Just found the 'bug'. in tr
 
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

adorean March 22, 2005 12:58

Hi, The 'chemistry off' swi
 
Hi,

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

What else should be modified to turn off chemistry?

Thanks!

Ervin

niklas March 23, 2005 08:03

Hi, nothing... and it works
 
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

adorean April 1, 2005 04:09

Hello, I've run the 'aachen
 
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

niklas April 1, 2005 04:27

Hi, 1. This is a typical '
 
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

adorean April 1, 2005 05:19

Hi Niklas, Thank you for yo
 
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

niklas April 1, 2005 07:59

Hi, The dropletNozzleDiamet
 
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

adorean April 1, 2005 08:17

Hi, Can you please tell me
 
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


All times are GMT -4. The time now is 18:20.