CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   one parcel contains too many particles after breakup (https://www.cfd-online.com/Forums/openfoam-programming-development/151610-one-parcel-contains-too-many-particles-after-breakup.html)

xuebao123 April 14, 2015 02:36

one parcel contains too many particles after breakup
 
I use sprayFoam to simulate water droplet's breakup,the breakup model is ETAB and KHRT model,when the parcel was injected into air ,it contains only one particle,but after
breakup the number of particle in one parcel is more than 1000。

(1) I think too many particles in one parcel will influence the droplet's distribution,especially when the water was injected into supersonic flow.

(2)I'm not sure whether it's a bug or not,I want to control the number of particle in one parcel less than 50,but I don't know how to do it.

(3)Is there some way to add some new parcels to make sure the number of particle in one parcel is less than 50?

dkxls April 15, 2015 11:04

Quote:

Originally Posted by xuebao123 (Post 541560)
(3)Is there some way to add some new parcels to make sure the number of particle in one parcel is less than 50?

Yes, but if you want to have exactly this criterion for creating a new parcel then you have to write your own breakup model.
Othwerwise, have a look at the KHRT model.

-Armin

xuebao123 April 16, 2015 22:05

Quote:

Originally Posted by dkxls (Post 541897)
Yes, but if you want to have exactly this criterion for creating a new parcel then you have to write your own breakup model.
Othwerwise, have a look at the KHRT model.

-Armin

Hi,Armin.Thanks for your answer,I tried two kinds of methods.The result of first one is better than before,but the second failed.Then I will tell you the method I have tried.

(1) if one parcel contains more than 2 particles,a childParcel will be added.nParticel of the childParcel is half of parenParcel.nParticle and mass of parenParcel will be reduced.
The code is:
scalar massDrop = pow3(d)*rhopi6;
nParticle = mass/massDrop;
if (nParticle >= 2)
addParcel = true;
d = cbrt(massDrop/rhopi6);
ms = 0.0;
dChild = cbrt(massDrop/rhopi6);
massChild = 0.5*nParticle*pow3(dChild)*rhopi6;
mass -= massChild;
nParticle-=0.5*nParticle;
}
I add this code at the end of RT breakup and KHindex breakup.

(2)Since the addParcel function is realized in SprayParcel.C,I think change the code in SprayParcel.C is more effective than in KHRT model.The code is:

while(this->nParticle()>6)
{
SprayParcel<ParcelType>* myaddchild = new SprayParcel<ParcelType>(*this);
myaddchild->nParticle() =5;
td.cloud().addParticle(myaddchild);
this->mass()-=5*3.14*1000*pow3(this->d())/6;
this->nParticle()-=5;
}
I add this code after calcBreakup(td, dt, cellI); but it doesn't work.I don't no how to solve it.Can you give me some advice.

Thank you verymuch.

dkxls April 17, 2015 03:09

Please, use the CODE tags!
Some beginners guidelines are given here:
http://www.cfd-online.com/Forums/ope...tml#post424508

Quote:

Originally Posted by xuebao123 (Post 542182)
(2)Since the addParcel function is realized in SprayParcel.C,I think change the code in SprayParcel.C is more effective than in KHRT model.

I don't see any reason why you would want to change the code in SprayParcel.C. You can do everything in the breakup model, which is much easier to implement than recompiling the whole spray classes.
Besides, changes in SprayParcel.C would affect all breakup models, something you clearly don't want to do when evaluating different models.
There is also not really any benefit concerning the computational efficiency!

xuebao123 April 18, 2015 21:30

Quote:

Originally Posted by dkxls (Post 542227)
Please, use the CODE tags!
Some beginners guidelines are given here:
http://www.cfd-online.com/Forums/ope...tml#post424508


I don't see any reason why you would want to change the code in SprayParcel.C. You can do everything in the breakup model, which is much easier to implement than recompiling the whole spray classes.
Besides, changes in SprayParcel.C would affect all breakup models, something you clearly don't want to do when evaluating different models.
There is also not really any benefit concerning the computational efficiency!

Sorry,I'm new here.Thank you for your patience to answer.
(1)I have changed the code in KHRT model.I tried two methods,but I think it have some problems.
The first one(The red word is my code):
Code:

        if ((tc > 0) || (lambdaRT < d) )
    {
        tc += dt;
    }

    // characteristic RT breakup time
    scalar tauRT = cTau_/(omegaRT + VSMALL);

    // check if we have RT breakup
    if ((tc > tauRT) && (lambdaRT < d))
    {
        tc = -GREAT;
        scalar nDrops = d/lambdaRT;
        d = cbrt(d3/nDrops);
    scalar massDrop = pow3(d)*rhopi6;
    nParticle = mass/massDrop;
      if (nParticle >= 2)
        {
          addParcel = true;
          d = cbrt(massDrop/rhopi6);
          ms = 0.0;
          dChild = cbrt(massDrop/rhopi6);
          massChild = 0.5*nParticle*pow3(dChild)*rhopi6;
          mass -= massChild;
          nParticle-=0.5*nParticle;
        }

 
    }

In this way we could add one child parcel,and nParticle in parenParcel has been cut in half.But we can't control the nParticle of childParcel.So I tried another method.
The second one:
Code:

  if ((tc > 0) || (lambdaRT < d) )
    {
        tc += dt;
    }

    // characteristic RT breakup time
    scalar tauRT = cTau_/(omegaRT + VSMALL);

    // check if we have RT breakup
    if ((tc > tauRT) && (lambdaRT < d))
    {
        tc = -GREAT;
        scalar nDrops = d/lambdaRT;
        d = cbrt(d3/nDrops);
        scalar massDrop = pow3(d)*rhopi6;
        nParticle = mass/massDrop;
        if (nParticle >= 51)
        {
          addParcel = true;
          d = cbrt(massDrop/rhopi6);
          ms = 0.0;
          dChild = cbrt(massDrop/rhopi6);
          massChild = 50*pow3(dChild)*rhopi6;
          mass -= massChild;
          nParticle-=50;
        }

 
    }

In this way we could specify the nParticle of childParcel.But for a parcel contains 300 particles,we could control the nParticle of child parcel,but the nParticle of parenParcel is still large.So I want to change the code in SprayParcel.C.

(2)The code I have changed inSprayParcel.C
Code:

if (liquidCore() > 0.5)
        {
            calcAtomization(td, dt, cellI);

            // Preserve the total mass/volume by increasing the number of
            // particles in parcels due to breakup
            scalar d2 = this->d();
            this->nParticle() *= pow3(d1/d2);
        }
        else
        {
            calcBreakup(td, dt, cellI);
     
    }
   
    while(this->nParticle()>51)
    {
        SprayParcel<ParcelType>* myaddchild = new SprayParcel<ParcelType>(*this);
        myaddchild->nParticle() =50;
        td.cloud().addParticle(myaddchild);
        this->mass()-=50*rhopi6*pow3(this->d());
        this->nParticle()-=50;
        }   

    }

In this way we could control nParticle in all Parcel is below 50,I think it's better than change code in breakup model.But it doesn't work,I have no idea about it .Can you give me some advice?
Thank you very much.

dkxls April 22, 2015 04:59

Without knowing what goes wrong it's pretty difficult to say why. Any error message?
(Before posting the error message/log, please read the guidelines on how to do that properly.)


All times are GMT -4. The time now is 04:53.