|
[Sponsors] |
November 20, 2014, 04:08 |
Error in DsmcCloud::collisions() in dsmcFoam
|
#1 |
New Member
wenjie
Join Date: Dec 2012
Posts: 12
Rep Power: 13 |
Hi all,
I think I just found a possible error in the DsmcCloud::collisions() in DsmcCloud.C . There, in the number of collision pairs, it should be nC * nC instead of nC* (nC-1) according to Bird's book (p219). Does anybody agree or disagree with me? -Wenjie |
|
November 23, 2014, 15:09 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128 |
Greetings Wenjie,
I had a look at the source code and took me a while to spot the piece of code you were referring to: Code:
scalar selectedPairs = collisionSelectionRemainder_[cellI] + 0.5*nC*(nC - 1)*nParticle_*sigmaTcRMax*deltaT /mesh_.cellVolumes()[cellI]; label nCandidates(selectedPairs); collisionSelectionRemainder_[cellI] = selectedPairs - nCandidates; It's possible that the implementation done in OpenFOAM is either based in a more recent paper or version of said book, or it could be the other way around, where they could have based themselves only on the very first edition of the book. In addition, according to this git blame: https://github.com/wyldckat/OpenFOAM...ud/DsmcCloud.C - that specific part of the code you're referring to exists since the first commit for OpenFOAM 1.6.x, so there is the possibility that this is still pending some additional revision. Best regards, Bruno |
|
November 24, 2014, 07:16 |
|
#3 | |
New Member
wenjie
Join Date: Dec 2012
Posts: 12
Rep Power: 13 |
Quote:
Yes, that's the code that I was talking about. Indeed by using nC*(nC-1) instead of nC*nC, you are not counting the current particle, but it is explained in the Bird's book "Molecular Gas Dynamics and the DIrect Simulation of Gas FLows" on page 219 that the number of choices should be N^2 /2 instead of N(N-1) /2 for large number of gas molecules and this error becomes significant for small values of N. And the whole rest part is about how to increase the probability and decrease the fraction. So I still think that nC*nC should be the correct one to use here. What do you think? Best, Wenjie |
||
November 25, 2014, 05:57 |
|
#4 |
New Member
Craig White
Join Date: Nov 2013
Posts: 11
Rep Power: 12 |
It has to be N*(N-1) for the no time counter model to be correct. See section 7 in this document from Graham Bird: http://www.gab.com.au/dsmc07notes.pdf
In addition, a quick look at Bird's 1D source code confirms that he uses the N*(N-1). This is from line 5989 of DS1.f90: ASEL=0.5D00*ICCELL(2,N)*(ICCELL(2,N)-1)*WFC*FNUM*CCELL(4,N)*DTC/AAA+CCELL(2,N) Where ICCELL is the number of particles in the cell. |
|
November 25, 2014, 11:32 |
|
#5 | |
New Member
wenjie
Join Date: Dec 2012
Posts: 12
Rep Power: 13 |
Quote:
HI Bruno, Thanks for the document!. Now it's clear : ) |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
dsmcFoam setup | hherbol | OpenFOAM Pre-Processing | 1 | November 19, 2021 01:52 |
[OpenFOAM] - Coupling dsmcFoam and laplacianFoam | costrom | OpenFOAM | 0 | October 26, 2014 15:15 |
ForceCoefficients/MachNumber for dsmcFoam | CFDnewbie147 | OpenFOAM Running, Solving & CFD | 0 | April 10, 2014 10:18 |
dsmcFoam unanswered questions... | CFDnewbie147 | OpenFOAM | 0 | February 11, 2014 01:23 |
how can I Run axisymmetric flow using dsmcFoam ? | mechy | OpenFOAM | 4 | September 19, 2011 10:25 |