CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Particle transfer from one region to another (https://www.cfd-online.com/Forums/openfoam/101885-particle-transfer-one-region-another.html)

anon_a May 16, 2012 08:23

Particle transfer from one region to another
 
Hello again!

I have been using a modified version of the chtMultiRegionFoam solver which also contains a particle solver. When two of my fluid domains are in contact, particles need to be exchanged. I would like to find an efficient way to move particles from one region to another when the corresponding boundaries are crossed.

I suppose I could use an IOField but is it possible to do it without the use of the hard disk? Any pointers to some existing part of the code?

gschaider May 21, 2012 15:58

Quote:

Originally Posted by anon_a (Post 361407)
Hello again!

I have been using a modified version of the chtMultiRegionFoam solver which also contains a particle solver. When two of my fluid domains are in contact, particles need to be exchanged. I would like to find an efficient way to move particles from one region to another when the corresponding boundaries are crossed.

I suppose I could use an IOField but is it possible to do it without the use of the hard disk? Any pointers to some existing part of the code?

If two fluid domains are in contact, why don't you make them one fluid domain?
a) you'll avoid the problem you describe
b) flow solution (especially on the interface) will be MUCH better

anon_a May 22, 2012 00:37

1 Attachment(s)
Thank you for your answer, which is quite reasonable given that I did not provide a lot of information.

My modified solver currently uses rhoCentralFoam in some of the regions and dsmcFoam in some others (and therefore I can not simply join the two fluid regions). Due to the very different nature of the methods based on the Navier-Stokes equations and particle-based methods and of course due to the different physics, a layer of cells is usually chosen to be modeled by both methods in order to have a smooth surface. Check the attached figure for the approach I am trying to implement.

Therefore, I would like to transmit particles between the main DSMC region and the interface. There are other uses as well but this is probably the most important one.

Any ideas?

gschaider May 22, 2012 04:47

Quote:

Originally Posted by anon_a (Post 362329)
Thank you for your answer, which is quite reasonable given that I did not provide a lot of information.

My modified solver currently uses rhoCentralFoam in some of the regions and dsmcFoam in some others (and therefore I can not simply join the two fluid regions). Due to the very different nature of the methods based on the Navier-Stokes equations and particle-based methods and of course due to the different physics, a layer of cells is usually chosen to be modeled by both methods in order to have a smooth surface. Check the attached figure for the approach I am trying to implement.

Therefore, I would like to transmit particles between the main DSMC region and the interface. There are other uses as well but this is probably the most important one.

Any ideas?

Basically your problem is similar to the transfer of particles in parallel runs (particle leaves a mesh, enters another). The way they do it here is write the particle to a Pstream the other processor reads it from a stream. Have a look at that and let yourself be inspired (in a worst case scenario you write to a string-stream, pass the string to another part of the program that reads from a string stream. But it should be possible to do it all in memory)

anon_a May 22, 2012 06:47

Thanks again for your answer. (I think) I tried to use something similar to the parallelization scheme in the past but did not succeed. I will check that again.

The approach I was currently following was to make dynamic lists for the properties of crossing particles in the main solver and pass references to them through the member function arguments. Without a file involved off course. Just a rough estimation, would this be more/less/equally efficient to the approach you mention?

gschaider May 22, 2012 08:21

Quote:

Originally Posted by anon_a (Post 362406)
Thanks again for your answer. (I think) I tried to use something similar to the parallelization scheme in the past but did not succeed. I will check that again.

The approach I was currently following was to make dynamic lists for the properties of crossing particles in the main solver and pass references to them through the member function arguments. Without a file involved off course. Just a rough estimation, would this be more/less/equally efficient to the approach you mention?

Don't know how many particels you expect to cross, but I don't think that efficiency should be the primary concern, but correctness. And the "construct from stream"-approach is tested (as it is used for parallel runs). With your approach it is easy to forget a property. Also is the stream approach easier to parallelize


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