CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   How to change the number of parcels at each patch with simulation time step (https://www.cfd-online.com/Forums/openfoam-pre-processing/206217-how-change-number-parcels-each-patch-simulation-time-step.html)

AJAY BHANDARI August 30, 2018 01:50

How to change the number of parcels at each patch with simulation time step
 
Hi Bruno,

Thanks for your reply. I will see whether brownian motion can be used in my case or not.

But before that can you please help me in answering the following questions

I already explained my problem in my previous post and i am using uncoupled kinematicparcelfoam for coupling lagrangian particles with the eulerian one. Now in that i have to do two things.

1. I have to enter different number of parcels at each patch in the computational domain. Can you tell me the best injection model to do that?? So far I know only manual injection or patch injection

2. Next, in my case as simulation time step changes the number of particles at each patch change. So please tell how can i do that in my problem?? Where i have to do the changes and how to do that changes so that i can change the number of particles at each patch with simulation time step??

If some more description om my problem is needed. Please tell

Best
Ajay

[Moderator note: Moved from https://www.cfd-online.com/Forums/op...liftforce.html]

wyldckat September 1, 2018 15:49

Quick answers: I've moved your post to a new thread, given that it was not related anymore to the other thread.


Quote:

Originally Posted by AJAY BHANDARI (Post 704587)
1. I have to enter different number of parcels at each patch in the computational domain. Can you tell me the best injection model to do that?? So far I know only manual injection or patch injection

You can define one injection block for each patch, you don't need to define all patches in a single block. If you had provided an example of how you were defining one of the blocks, I could have given the modified example.


Quote:

Originally Posted by AJAY BHANDARI (Post 704587)
2. Next, in my case as simulation time step changes the number of particles at each patch change. So please tell how can i do that in my problem?? Where i have to do the changes and how to do that changes so that i can change the number of particles at each patch with simulation time step??

Without knowing how exactly you will get the different particle distributions, it's extremely hard to try and explain several different ways you could do that.
The best I can do is suggest that you study all of the injection models that exist. You can find a graph with the existing models here: https://cpp.openfoam.org/v6/classFoa...tionModel.html
Then based on the features available on each model, then you can decide how to create a new model that does what you want.

Quote:

Originally Posted by AJAY BHANDARI (Post 704587)
If some more description om my problem is needed. Please tell

This thread: https://www.cfd-online.com/Forums/op...-get-help.html - was written also because it's hard for experienced users to find the time needed to help here on the forum. What I mean is that I will possibly only be able to take a look at this thread of your in 7 days from now, which means that since you didn't provide enough information when you wrote your post, I'm not able to help further any sooner.

AJAY BHANDARI September 5, 2018 08:55

Hi bruno,

By patch i mean each mesh element.

What i mean to say is that suppose there is a rectangular computational domain in which there are 500 mesh elements.

1. Now i want to enter particles at each mesh element in the computational domain.

2. Now further i want to change the number of particles at each mesh element as simulation time step progresses.
For example: if at one mesh element if i add a manual injector and give the particle coordinates to be injected and lets say particles added are 4. Then at the next time step at the same coordinate i have to inject let's say 2 particles and so on.
Then how to do that.

One solution, which i am trying is that to add different injection models (manual injector) in the kinematic cloud properties and from each manual injector i am reading kinematic cloud positions file (in which the coordinates and no. of parcels at each mesh element are specified).
And for time i am specifying different Start of injection (SOI) for each injector model.

A sample i am attaching.

Code:


injectionModels
    {
    model1
        {
            type            manualInjection;
            massTotal      0;
            parcelBasisType fixed;
            nParticle      1;
            SOI            32;
            positionsFile  "kinematicCloudPositions";
            U0              (1E-06 1E-06 1E-06);
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value  0.006;
                }
            }
        }
        model2
        {
            type            manualInjection;
            massTotal      0;
            parcelBasisType fixed;
            nParticle      1;
            SOI            36;
            positionsFile  "kinematicCloudPositions1";
            U0              (1E-06 1E-06 1E-06);
            sizeDistribution
            {
                type        fixedValue;
                fixedValueDistribution
                {
                    value  0.006;
                }
            }
        }
    }

So you can see that from injector 1 when it reads kinematiccloudpostions file it injects particles at each mesh element according to the coordinates given in the file. Here SOI is 32 sec.

Next for injector 2 when it reads kinematiccloudpostions1 file it injects particles at each mesh element according to the coordinates given in the file and SOI is 36 sec.

So this is how i am doing to update number of particles with time step..

I am asking whether i am doping right or not..

Or is there any other way to do that.

Hope i am able to explain my problem.

wyldckat September 11, 2018 08:18

Quick note: I haven't managed to read your post properly yet, but I've stumbled upon a tutorial/report at Chalmers which may be useful to what you want to do exactly: http://www.tfd.chalmers.se/~hani/kur.../tutorial1.pdf - Start reading from chapter 5.

AJAY BHANDARI November 19, 2018 07:46

Doubt
 
Hi Bruno,


i read the report you sent to me and accordingly i changed the libraries which were needed to inject different particles at different mesh elements. But now one problem is coming.
When i run the case the running process on the terminal gets stuck on this line.
Code:

Time = 32

GAMG:  Solving for p, Initial residual = 4.28364e-09, Final residual = 4.28364e-09, No Iterations 0
DILUPBiCG:  Solving for C, Initial residual = 1, Final residual = 1.20517e-10, No Iterations 7

Evolving kinematicCloud

Solving 3-D cloud kinematicCloud
Cloud: kinematicCloud
    Current number of parcels      = 0
    Current mass in system          = 0
    Linear momentum                = (0 0 0)
  |Linear momentum|                = 0
    Linear kinetic energy          = 0
    model1:
        number of parcels added    = 0
        mass introduced            = 0
    model2:
        number of parcels added    = 0
        mass introduced            = 0
    Parcel fate (number, mass)
      - escape                      = 0, 0
      - stick                      = 0, 0
    Rotational kinetic energy      = 0

ExecutionTime = 10.57 s  ClockTime = 10 s

Time = 36

GAMG:  Solving for p, Initial residual = 4.28364e-09, Final residual = 4.28364e-09, No Iterations 0
DILUPBiCG:  Solving for C, Initial residual = 0.0369848, Final residual = 5.41162e-10, No Iterations 6

Evolving kinematicCloud

Solving 3-D cloud kinematicCloud
Time1 = 4

Time0 = 0

parcelsToInject = 5


Cloud: kinematicCloud injector: model1
    Added 5 new parcels

    201277314 move-collide subCycles


After this nothing is happening. Please help me in this regard.



PS i am not able to attach my test case here as i am getting this error message


Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.

wyldckat December 22, 2018 11:58

Hi Ajay,

Sorry, I had some very busy weeks since before your last post and I was not able to come by and see your post.

From what I can briefly see, the problem seems to be that somehow it suddenly had 201277314 sub-cycles to analyze for collisions between only 5 parcels or particles, which is really strange.

If customized code is involved, then something went wrong in its coding and there could be memory corruption happening somewhere.

Either way, I hope you've managed to solve this issue since then.

Best regards,
Bruno

AJAY BHANDARI December 23, 2018 01:08

Hi bruno,

Glad you have a look at my error message.

I was able to resolve it when i changed basickinematiccollidingcloud to basicKinematiccloud in createFields and the basic code.

By changing this the solver ran.

But i have one doubt.

1. By changing this does it mean that there will be colliding of parcels now?

2. If i have to incorporate the colliding of parcels (4 way coupling). How should i do it? What changes should i make in the solver and code??

Best
Ajay

wyldckat December 23, 2018 16:49

Quick answers:
  1. "basicKinematicCloud" does not handle collisions between particles.
  2. Depends on the type of collisions you want to do, namely if you want stochastic collisions (semi-random collisions, in function of the parcel size and presence in the same cell) or discrete particle collisions between each pair of particles (parcels).
  3. As for 4-way collisions... I'm not entirely familiar with the terminology... what types of collisions are you referring to? Because if I remember correctly, the discrete collision models that OpenFOAM has does not handle break up and coalescence...
  4. When you were using "basicKinematicCollidingCloud", how exactly did you configure the collision part in the dictionary file?


All times are GMT -4. The time now is 14:34.