-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dsmcFoam+: update dsmcVolFields #54
Conversation
…oring the number of DSMC parcels to reflect their physical meaning better
…ir physical meaning better
… that averaging across many runs actually works
Thank you very much, this was a huge work.
That would be great!
This makes me think that the PASS/FAIL test for DSMC cases could be improved. The random seed number number should be fixed for reproducibility. There would then be no need to introduce a tolerance to accommodate statistical scatter. I haven't implemented it because I am afraid users would copy-paste a set-up and thus use a fixed seed without knowing. |
I will create a pull request for the tutorials in the next few days when I find the time. On the random seeds: Yeah I also think this would be a good option. However, I also have no idea what would be the best option to implement this safely.. Also every small change to any method involving random numbers would then probably fail the tests, so maybe it is not the perfect solution after all? |
- NB1: the boundaryFields values for dsmcN_species and dsmcNMean_species are not set (see #54). This will be fixed in a subsequent commit - NB2: the orion and couette test cases will be reintroduced once the bug in the mixture vibrational temperature is fixed
… features yet and which causes the compilation to crash after #54
Hi,
this update should not change any computations. It does change the names of some fields and variables used in the calculation of the macroscopic fields.
Cum
to those variablesdsmc
to all fields that calculate values based on DSMC parcels vs. fields that calculate values based on the (much larger) number of simulated particles (e.g.dsmcMCum_
vs.mCum_
for the cumulative mass of DSMC parcels vs. the cumulative mass of the "real" gas)example:
previous:
const scalar rhoNMean = rhoNMeanXnParticle_[cell] / (nAvTimeSteps*cellVolume);
vs.
const scalar rhoNMean = nCum_[cell] / (nAvTimeSteps*cellVolume);
where in the second case it is directly apparent that a cumulative number is divided by the number of averaging steps over which it was accumulated and the cell volume which results in a density. Whereas in the previous version one would expect (1/m³) / (1 * m³) = 1/(m³*m³) as a unit.
example 2:
previous:
UMean_[cell] = momentumMeanXnParticle_[cell] / rhoMMeanXnParticle_[cell];
vs.
UMean_[cell] = momentumCum_[cell] / mCum_[cell];
where in the second case it is directly clear that both values are cumulative and the resulting value therefore is the mean / average. The unit also becomes much clearer as kg m/s / (kg) = m/s whereas one would expect kg m/s / (kg/m³) = m/s / m³ in the previous version.
Obviously this is just my take on it.
Edit: Note that I did not update the tutorials to the new names (dsmcN(Mean) vs. dsmcRhoN(Mean)) as of yet. However, I would add this to this (or a follow-up) merge request you are willing to merge this.
Edit: Because it makes sense to add this here: This also adds all cumulative values to the
readIn
andwriteOut
functions so that averaging across many runs actually works.