CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   DieselFoam spray (https://www.cfd-online.com/Forums/openfoam-solving/57854-dieselfoam-spray.html)

niklas July 2, 2008 06:13

No, you have misunderstood the
 
No, you have misunderstood the massFlowRateProfile.

The format of the massFlowRateProfile is
massFlowRateProfile
(
(time1 kgPers1)
(time2 kgPers2)
(time3 kgPers3)
)

If you have injection between time1 and time2
the massflowrate at that time is linearly interpolated.
the first entry is the start of injection and
the last entry is the end of injection.

What you would like to do is something like this
(lets say you want to inject them each millisecond)
massFlowRateProfile
(
(0.0 1.0)
(1.0e-7 1.0)
(1.1e-7 0)

(0.999999e-3 0)
(1.000000e-3 1)
(1.000001e-3 1)
(1.000002e-3 0)

(1.999999e-3 0)
(2.000000e-3 1)
(2.000001e-3 1)
(2.000002e-3 0)

et.c....
);

If you have nParcels set to 20 and the mass corresponds to 20 drops, 1 drop will be injected at t=1.0 ms and then nothing until t=2.0 etc...

clear?

niklas July 2, 2008 06:23

Actually, this is better mass
 
Actually, this is better
massFlowRateProfile
(
(0.0 1.0)
(1.0e-7 0)

(1.000000e-3 0)
(1.000001e-3 1)
(1.000002e-3 0)

(2.000000e-3 0)
(2.000001e-3 1)
(2.000002e-3 0)

et.c....
);

Another approach is to set up 20 injectors and have each injector injecting just 1 parcel,
thats quite simple since its just to copy/paste and then change the injection time for each injector.

niklas July 2, 2008 06:56

Oh... And you need to be care
 
Oh...
And you need to be careful so that the area under each injection occasion in the massFlowRateProfile is the same, otherwise the parcels will not contain the same mass.

sebastian_vogl July 2, 2008 07:14

Thank you again Mr Nordin for
 
Thank you again Mr Nordin for your incredible patience. I think I understood how the massprofile works and will try to implement your example on my own.

sebastian_vogl July 3, 2008 12:07

Hallo again, I implemented
 
Hallo again,

I implemented the following massFlowProfile as you suggested, Mr Nordin, however the injector either injects the two parcels right from the beginning or I have 4 parcels in my system. In the latter case the parcels doesn't start from the injector position but from the centerpoint of the geometry which is very confusing, as I didn't tell the injector to do so. The mass for each parcel was reckoned by taking a diameter of 50µm and multiplying it with the density for C7H16 at 320K (662,6874288 kg/m³) using the NSRDS function5. So there should 2 parcels come out of the injector, each at the specified time, but it doesn't happen. Furthermore, when setting the endtime of injection 1 to 1.0e-11 or 10e-9 instead of1.0e-8 the solver stops because the temperature in the system should have exceeded 5000K and the injector pressure was around 100bar. This seems unrealistic because todays diesel enginges inject with 2000 bar and the temperature is far lower. Could you please give me some hints please?

Sincerely,
Sebastian Vogl

unitInjectorProps
{
position (0 0.0995 0);
direction (0 -1 0);
diameter 0.00005;
Cd 0.9;
mass 8.6745581581e-11;
temperature 320;
nParcels 2;

X
(
1.0
);

massFlowRateProfile
(
(0.0 1.0)
(1.0e-8 0.0)

(0.9999999999e-3 0.0)
(1.0000000000e-3 1.0)
(1.0000000001e-3 0.0)
);

niklas July 4, 2008 04:37

you are using unitInjector to
 
you are using unitInjector to inject and
for this case that is not a very good idea, since
massFlowRate and injector diamerer is used to
calculate the injection velocity.

Here's what you probably want.
This is an injection of 20 drops, separated with 0.1 ms.
I am using nozzle diameter to set the diameter of
the drops and a velocityProfile to specify the
drop-velocity, thats why Im using definedInjector instead of unitInjector. In this case I just set it to 100 m/s.

In the case I set the number of outputs pretty close to make an animation
http://files.nequam.se/drops20.avi

(You might want to reduce the elasticity coefficient to not have such a 'bouncy' wall interaction)

http://files.nequam.se/drop.tgz

niklas July 4, 2008 05:05

There is a possibility that yo
 
There is a possibility that you might experience some weird effects if your drops are too small.

In the file
OpenFOAM-1.4.1/src/lagrangian/dieselSpray/parcel/parcel.C

you have this statement (on line 303)
// remove parcel if it is 'small'
if (m() < 1.0e-12)

You might want to change this to..for example
if (m() < 1.0e-20)

then do 'wmake libso' in the dieselSpray directory.

sebastian_vogl July 7, 2008 07:55

I now implemented your example
 
I now implemented your example, however with 5 droplets first. There's quite a difference between our results. My droplets dont't flow in a row, as in your video above, but have an offset. Moreover the last parcels don't seem to fly fast enough, because the can't reach the first ones. My parcels have a diameter of 50µm and a verlocity of 100 m/s (as in your example). I also used the defined injector.

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif 5_droplets.avi.gz

sebastian_vogl July 7, 2008 08:29

Maybe I should mention that th
 
Maybe I should mention that the velocity of the surrounding air is still 0 m/s and for the drag model the "standartdragModel" is used.
Do you know why our results differ?

Yours,
Sebastian Vogl

niklas July 8, 2008 03:31

Have you looked at what spray
 
Have you looked at what spray angle you have specified in the sprayProperties?

sebastian_vogl July 8, 2008 03:45

Hello everyone, I wanted to
 
Hello everyone,

I wanted to repeat the case with the incection of 5 parcels in a row. The solution process, which was done on more processors (solution was parallelised), was completed normally after the specified end time. However during the reconstruction process I got the following error message:

--> FOAM FATAL IO ERROR : IOstream::check(const char* operation) : error in IOstream "/scratch1/aachenBombInjektorvergleich/definedInjector/5_droplets_dt_1e-4/0.0002 3/phi" for operation Ostream& operator<<(Ostream&, const Scalar&)

file: /scratch1/aachenBombInjektorvergleich/definedInjector/5_droplets_dt_1e-4/0.00023 /phi at line 491692.

From function IOstream::check(const char* operation) const
in file db/IOstreams/IOstreams/IOcheck.C at line 54.

FOAM exiting


The strange thing about it is that the file "phi" of time step 0.00023 doesn't have 491692 lines.

Could anyone please tell me what that message means?

Yours,
Sebastian Vogl

sebastian_vogl July 8, 2008 04:26

Hello again, the last probl
 
Hello again,

the last problem dealing with the reconstruction of a case is now solved. The problem was not caused by OpenFoam but simply that the disc had no place left for writing the time steps.

Yours,
Sebastian Vogl

sebastian_vogl July 8, 2008 06:45

The spray angle I used was 0.0
 
The spray angle I used was 0.0

niklas July 9, 2008 08:32

try removing the words inject
 
try removing the words
injector1
injector2
injector3

Im guessing you will be back soon after that is solved http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

sebastian_vogl July 9, 2008 08:59

As you anticipated correctly,
 
As you anticipated correctly, I am back very soon. However, removing the entries didn't solve my problem completely. This time the program says:

Constructing Spray
Selecting injectorType definedInjector
Selecting injectorType definedInjector
Selecting injectorType definedInjector
Selecting atomizationModel off
Selecting dragModel standardDragModel
Selecting evaporationModel off
Selecting heatTransferModel RanzMarshall
Selecting wallModel reflect
Selecting breakupModel off
Selecting collisionModel off
Selecting dispersionModel off
Selecting injectorModel constInjector


--> FOAM FATAL ERROR : constInjector::constInjector(const dictionary& dict, spray& sm)
Wrong number of entries in dropletNozzleDiameterRatio#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::constInjector::constInjector(Foam::dictionar y const&, Foam::spray&) in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libdieselSpray.so"
#3 Foam::injectorModel::adddictionaryConstructorToTab le<foam::constinjector>::New(F oam::dictionary const&, Foam::spray&) in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libdieselSpray.so"
#4 Foam::injectorModel::New(Foam::dictionary const&, Foam::spray&) in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libdieselSpray.so"
#5 Foam::spray::spray(Foam::volPointInterpolation const&, Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double,> const&, Foam::GeometricField<double,> const&, Foam::GeometricField<double,> const&, Foam::combustionMixture const&, Foam::PtrList<foam::sutherlandtransport<foam::spec iethermo<foam::janafthermo<foa m::perfectgas> > > > const&, Foam::dictionary const&, Foam::dictionary const&) in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt/libdieselSpray.so"
#6 main in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linux64GccDPOpt/dieselFoam "
#7 __libc_start_main in "/lib64/libc.so.6"
#8 Foam::regIOobject::readIfModified() in "/home/singh/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linux64GccDPOpt/dieselFoam "


FOAM aborting

Aborted


The only thing I can understand from this message is that I have to change my sprayproperties file for multiple injectors, too. But how?
By the way, do you know why the parcels in my video above leave the injector with an offset, instead of flying in a row?

Thank you once more for your help!

niklas July 9, 2008 09:47

You now have more than 1 injec
 
You now have more than 1 injector.
You have not specified spray angle and drop/nozzle -ratio for the second injector.
Thats what the error message is telling you.
'Wrong number of entries in dropletNozzleDiameterRatio'.

for 2 injectors it would look something like this.
constInjectorCoeffs
{
dropletNozzleDiameterRatio
(
1.0
1.0
);

sprayAngle
(
0.0
0.0
);
}

> By the way, do you know why the parcels in my video above leave the injector with an offset, instead of flying in a row?
Nope.
In my example I set droplet/nozzle=1 and used
the injector diameter to specify drop-size.
The only thing I can think of is that the true injection position is randomly positioned around the injection position within a distance set by the nozzle diameter.

So if you have a large nozzle diameter and use a small drop/nozzle ratio to set the drop diameter you could get that behaviour.

sebastian_vogl July 9, 2008 11:37

Thank you very much for your h
 
Thank you very much for your help Mr Nordin! The problem could be solved.

sebastian_vogl July 9, 2008 12:44

The case ran without any probl
 
The case ran without any problems. However the flow of the droplets isn't uniform again. The droplets of each injector behave differently and again they have an offset in their flow although I set my drop/nozzle ratio to 1 (as I had also done before) and specified the droplet diameter by nozzle diameter. The short movie below shows my results. Collision model and evaporation were set "off" for this case. Droplet velocity was 100m/s. Also interesting is the fact that the latter parcels can't reduce the distance to the first 2 of each injector.



sebastian_vogl July 9, 2008 13:44

I'm sorry, I forgot the video
 
I'm sorry, I forgot the video of my case. I had to reduce the size dramatically to post it here, but my problems with the droplet behaviour will become clear:

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif 3injectors_10droplets_smallsize.avi.gz

niklas July 10, 2008 02:40

gravity? Its impossible for m
 
gravity?
Its impossible for me to say with the info I have.
Best thing for you would be to attach the case.


All times are GMT -4. The time now is 05:42.