CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Velocity distribution function sampling issue in DSMC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 12, 2014, 06:31
Default Velocity distribution function sampling issue in DSMC
  #1
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,428
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
This is rather a mathematical question:
When sampling velocity distribution functions in in a Direct Simulation Monte Carlo (DSMC) we first have to choose a small velocity interval \Delta c.
Now during the sampling process, all molecules with velocities between
c - \frac{\Delta c}{2} and c + \frac{\Delta c}{2}
are counted with a velocity of c.

So after the simulation instead of the values of the distribution function for a certain velocity f(c) we actually get the mean value over the velocity interval \Delta c:
f_\text{DSMC}(c) = \frac{1}{\Delta c} \int_{c - \frac{\Delta c}{2}}^{c + \frac{\Delta c}{2}} f(c) dc.

Now here is the question since this sampling method is only second order accurate in \Delta c.
Is there a way to get a better approximation for the actual value of the velocity distribution function of the velocity f(c)?
I mean a other than reducing the velocity interval \Delta c which would result in a higher amount of statistical scatter.
Maybe by using the neighbor values f_\text{DSMC}(c - \Delta c) and f_\text{DSMC}(c + \Delta c)?


Edit:
Nevermind, I found a solution that results in a fourth order accurate interpolation of the velocity distribution function.
As soon as I get gnuplot to plot my results I will post the procedure here.

Last edited by flotus1; December 12, 2014 at 13:42.
flotus1 is offline   Reply With Quote

Old   December 12, 2014, 13:23
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by flotus1 View Post
This is rather a mathematical question:
When sampling velocity distribution functions in in a Direct Simulation Monte Carlo (DSMC) we first have to choose a small velocity interval \Delta c.
Now during the sampling process, all molecules with velocities between
c - \frac{\Delta c}{2} and c + \frac{\Delta c}{2}
are counted with a velocity of c.

So after the simulation instead of the values of the distribution function for a certain velocity f(c) we actually get the mean value over the velocity interval \Delta c:
f_\text{DSMC}(c) = \frac{1}{\Delta c} \int_{c - \frac{\Delta c}{2}}^{c + \frac{\Delta c}{2}} f(c) dc.

Now here is the question since this sampling method is only first order accurate in \Delta c.
Is there a way to get a better approximation for the actual value of the velocity distribution function of the velocity f(c)?
I mean a other than reducing the velocity interval \Delta c which would result in a higher amount of statistical scatter.
Maybe by using the neighbor values f_\text{DSMC}(c - \Delta c) and f_\text{DSMC}(c + \Delta c)?


Edit:
Nevermind, I found a solution that results in a fourth order accurate interpolation of the velocity distribution function.
As soon as I get gnuplot to plot my results I will post the procedure here.


Hello,
I am not sure to get correctly your question but the average value when c is centered between +dc and -dc is a second order approximation of the pointwise value.
It is similar to what happens in FVM.
Higher order approximations require suitable reconstruction/deconvolution techniques
FMDenaro is offline   Reply With Quote

Old   December 12, 2014, 13:39
Default
  #3
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,428
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
You are right, I tend to confuse orders of accuracy.
The thing is that for the purpose of the simulation involved, the second order accurate approximation was not accurate enough.

If the remedy is so obvious I will rather not post my solution because I feel like I reinvented the wheel now.
flotus1 is offline   Reply With Quote

Old   December 12, 2014, 13:53
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by flotus1 View Post
You are right, I tend to confuse orders of accuracy.
The thing is that for the purpose of the simulation involved, the second order accurate approximation was not accurate enough.

If the remedy is so obvious I will rather not post my solution because I feel like I reinvented the wheel now.
you can find some techniques in the field of FVM since the flux reconstruction is based on pointwise values, that is F=F(U), whereas the FV update is expressed in terms of the average value U_bar. Therefore, at each time step, some functional relation U=U(U_bar) has to be prescribed. U=U_bar is order 2. Accuracy higher than 2 can be obtained in some way.
A way can be developing in Taylor series the pointwise function and integrate each terms.
FMDenaro is offline   Reply With Quote

Old   December 13, 2014, 07:05
Default
  #5
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,428
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
For the sake of completeness, here is what I did.
The sampled DSMC value equals the following integral:

f_\text{DSMC}(c) = \frac{1}{\Delta c} \int_{c - \frac{\Delta c}{2}}^{c + \frac{\Delta c}{2}} f(c) dc = \frac{1}{\Delta c} \left[ F\left(c+\frac{\Delta c}{2} \right) + F \left( c-\frac{\Delta c}{2} \right) \right].

The sum of this value and its two neighbors is

f_\text{DSMC}(c-\Delta c) + f_\text{DSMC}(c) + f_\text{DSMC}(c+\Delta c) = \frac{1}{\Delta c} \int_{c - \frac{3 \Delta  c}{2}}^{c + \frac{3 \Delta c}{2}} f(c) dc = \frac{1}{\Delta c} \left[  F \left( c+\frac{3 \Delta c}{2} \right) + F \left( c-\frac{3 \Delta c}{2} \right) \right].

Using a 4th order central difference formula for the first derivative we can reconstruct the value of f(c):

f(c) = \frac{d}{dc} F(c) = \frac{1}{\Delta c} \left[ \frac{1}{24}F \left( c-\frac{3 \Delta c}{2} \right) - \frac{9}{8}F \left( c-\frac{\Delta c}{2} \right) + \frac{9}{8}F \left( c+\frac{\Delta c}{2} \right) - \frac{1}{24}F \left( c+\frac{3 \Delta c}{2} \right) \right] + \mathcal{O} \left( \Delta c^4 \right).

Here we can substitute the DSMC values:

f(c) = \frac{d}{dc} F(c) = -\frac{1}{24} \left[ f_\text{DSMC}(c-\Delta c) + f_\text{DSMC}(c) + f_\text{DSMC}(c+\Delta c) \right] + \frac{9}{8} f_\text{DSMC}(c) + \mathcal{O} \left( \Delta c^4 \right)

which results in

f(c) = \frac{d}{dc} F(c) = -\frac{1}{24} \left[  f_\text{DSMC}(c-\Delta c) + f_\text{DSMC}(c+\Delta c)  \right] + \frac{13}{12} f_\text{DSMC}(c) + \mathcal{O}  \left( \Delta c^4 \right).

This does exactly what I want and effectively removes the sampling bias I observed in the simulations.
flotus1 is offline   Reply With Quote

Old   December 13, 2014, 07:16
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
If I understand, you are using reconstruction via primitive function, something like the reconstruction used in the ENO/WENO scheme.

You can also proceed this way:

f(c) = f(0) + f'(0)*c + f''(0)*c^/2 + f'''(0)*c^3/6 + ....

Then, integrate analytically each terms between +Deltac/2 and -Deltac/2.
You see that terms like c, c^3 produce zero value of the integral.
This way you have a relation between the average value (LHS) and pointwise values (RHS). You can truncate at suitable order that you need
FMDenaro is offline   Reply With Quote

Old   December 13, 2014, 07:18
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
PS: of course, I suppose that f is a continuous function of c, having all regular derivatives .....
FMDenaro is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 15:07
get velocity gradient with a boundary function Chris Lucas OpenFOAM Programming & Development 4 August 27, 2012 04:11
Moving Mesh Velocity Issue: Mesh velocity does not equal displacement Doginal CFX 2 September 8, 2011 13:02
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 14:06
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11


All times are GMT -4. The time now is 07:51.