|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
hii evrybody,
i want to implement a new evaporation model in dieselSpray, the are two models; standartEvaporation model and RutlandFlash boil model wich are both assuming the D2 law. i want to implement a 0D model that calculate the equilibrium state of the droplet after evaporation, i have a c++ code that do this ![]() ![]() thank's... ![]() Last edited by Tag; June 10, 2011 at 09:57. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
formulate the problem in a way that it can be written as
Code:
d m_d -- m_d = - ------ dt tau or relaxationTime in http://foam.sourceforge.net/doc/Doxy...tionModel.html |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
Thank you for your answer Niklas, have you an idea of what the Sevap in the Rho equation contains ?
Sevap += dieselSpray.evaporationSource(i); My 0D model have not time for the moment, it caculate only the properties of droplets at the equilibrium state, it doesn't assume a D2 law or Abramzon model, i use the secant methode to calculate these properties. So if i know what Sevap contains, i think that i can implement it.. thank you |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
I suspected that you would say that
![]() actually you can relate your model to a characteristic time and use the existing framework to add your new evaporation model. in FOAM the mass of the droplet is calculated/updated according to this equation Code:
(m^n - m^{n-1}) m^n --------------------- = - -------- (1) dt tau dt is the integration step and tau is the characteristic evaporation time (evaporation model) if you know that the mass of the drop is updated according to this equation, you can calculate the new mass, m^n, according to your equilibrium conditions and related that to tau. like this: according to (1) you will get Code:
m^n K*dt ------------ = 1/( 1 + dt/tau) = K => tau = ----------- m^{n-1} 1 - K This way you dont have to calculate the source terms and bother with Sevap as it will be handled automatically. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
thank you Niklas,
I think it's easier to do that, I will keep you informed on the progress of my implementation. i will haves somme questions about the mass fraction of the liquids phase and gazous phase, temperature, pressure modification and updating ... Thank you again Niklas.... Noureddine. |
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
Hii Niklas,
I have successfully implemented my 0D model in OpenFoam as you suggest. for the case of standartEvaporationModel and my 0D evaporation model: i want to know how the temperature and other properties like volume fraction and the diameter of the droplets are calculated and updated, I suspect that the B term in evaporation model is considered constant. Thank you. |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
Great,
Im not following, which B-term? if you want to find out how these properties are updated, just check the updateProperties-function in parcel.C. |
|
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
Dear Niklas,
B is the Spalding mass number. I have to give the initial mass fractions of the liquide, gaz, N2 and O2 (air) and their temperatures in cell to my 0Dmodel that calculate the equilibrium temperature and then the final mass fractions of these species in the same cell, in order to estimate the mass ratio of the liquide : m (n)/m(n-1)= Yl(n)/Yl(n-1) (Yl mass fraction of liquide). the problème that i don't found yet these propertise in openfoam. Can you give me an idea to how i do that ? Thank's..... |
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
Hi,
where can i find the total mass, the gas temperature, the fractions of different species in cell(i), i had to use these properties in one class that I've created in dieselSpray SubModels. Thank U. |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
Have you checked parcel.C?
All is in there. if you want the mass of the cell you have to get the density and cell volume Code:
scalar cellV = sDB.mesh().V()[celli]; scalar rho = sDB.rho()[celli]; scalar cellMass = rho*cellV; Code:
scalar Tg0 = sDB.TInterpolator().interpolate(position(), celli, facei); Code:
label j = sDB.liquidToGasIndex()[i]; const volScalarField& Yj = sDB.composition().Y()[j]; scalar Yfg0 = Yj[celli]; |
|
![]() |
![]() |
![]() |
![]() |
#11 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
Hi Niklas,
thank you for your answer, i suspected that and you confirmed me thses information, what about the mass fraction of vapor ? |
|
![]() |
![]() |
![]() |
![]() |
#12 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
again...
vapor mass fraction of liquid index i (which has index j among the gas species) Code:
label j = sDB.liquidToGasIndex()[i]; const volScalarField& Yj = sDB.composition().Y()[j]; scalar Yfg0 = Yj[celli]; |
|
![]() |
![]() |
![]() |
![]() |
#13 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
oops
![]() |
|
![]() |
![]() |
![]() |
![]() |
#14 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
last question,
know you how the spalding number that used in the evaporation model (ys-y/1-ys) (somme thing lick that.) is calculated in openFoam? |
|
![]() |
![]() |
![]() |
![]() |
#15 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
standardEvaporationModel.C
B = 1 + Xratio Code:
/* (pressure - partialFuelVaporPressure)/ (pressure - pressureAtSurface) = 1 + Xratio if the pressure @ Surface > pressure this lead to boiling and Xratio -> infinity (as it should) ... this is numerically nasty NB! by N. Nordin X_v,s = (p_v,s/p) X_v,d where X_v,d = 1 for single component fuel according to eq (3.136) in D. Clerides Thesis */ scalar Xratio = (Xs - Xf)/max(SMALL, 1.0 - Xs); if (Xratio > 0.0) { lgExpr = log(1.0 + Xratio); } |
|
![]() |
![]() |
![]() |
![]() |
#16 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
thank you Niklas,
i have already seen this in standardEvaporationModel.C, Xs is a variable of the relaxationTime function, but when this function is used we must give the Xs that is, i think is calculated by another function or expression, this is what i want to know. thank you. |
|
![]() |
![]() |
![]() |
![]() |
#17 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
Ah, OK.
Thats done in parcel/setRelaxationTimes.C However, Xs just calls the function which is defined in the liquidMixture class thermophysicalModels/liquidMixture/liquidMixture/liquidMixture.C which just looks like this Code:
Foam::scalarField Foam::liquidMixture::Xs ( const scalar p, const scalar Tg, const scalar Tl, const scalarField& xg, const scalarField& xl ) const { scalarField xs(xl.size(), 0.0); // Raoult's Law forAll(xs, i) { scalar Ti = min(TrMax*properties_[i].Tc(), Tl); xs[i] = properties_[i].pv(p, Ti)*xl[i]/p; } return xs; } |
|
![]() |
![]() |
![]() |
![]() |
#18 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
Hi Niklas,
To use the molar fraction and gas temperature in my "model0D" class, i have to use an instance of the "spray" class, so what kind of inheritance can do that easily ? Thank's.... |
|
![]() |
![]() |
![]() |
![]() |
#19 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 ![]() ![]() |
Im not sure I understand your question, but the access calls to those variables are posted in my previous mails.
|
|
![]() |
![]() |
![]() |
![]() |
#20 |
New Member
Noureddine TAGUELMIMT
Join Date: Mar 2011
Location: Rouen, France
Posts: 21
Rep Power: 15 ![]() |
Hi,
This is a part of a header of the class i created called model0D, #ifndef model0D_H #define model0D_H namespace Foam { // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // class spray; // line added to call the spray class class model0D { And, in the model0D.C i added the properties lick gas temperature : spray mysDB; scalar Tg0 = mysDB.TInterpolator().interpolate(position(), celli, facei); but it doesn't work!!, i suspect that i haven't made the necessary operations to make correct calling between the two classes . Thank you.... |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
multiphaseInterFoam for RAS turbulence model | chiven | OpenFOAM Bugs | 8 | December 6, 2017 02:08 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 05:36 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 03:32 |
multi fluid mixture model issue | rystokes | CFX | 3 | August 9, 2009 19:13 |
Advanced Turbulence Modeling in Fluent, Realizable k-epsilon Model | Jonas Larsson | FLUENT | 5 | March 13, 2000 03:27 |