Sampling


1) The fieldPropertiesDict dictionary

This dictionary located in the system folder is responsible for computing macroscopic quantities from microscopic particle information and for sampling species and mixture properties to obtain a statistical average. It is composed a list called dsmcFields() inside which a field dictionary can be repeated as many times as desired. The single field model available is dsmcVolFields to average volume and boundary fields in the entire domain. Other models are deprecated at present (WIP).

dsmcFields
(
    field
    {
        fieldModel          	dsmcVolFields;

        [...]
    }

    field
    {
        fieldModel          	dsmcVolFields;
        
        [...]
    }
     
);

The dsmcFields() list should be left empty when there is no need to reconstruct macroscopic fields.

For the N2 species, the macroscopic fields printed by default are:

  • dsmcN_N2: instantaneous number of DSMC parcels
  • dsmcNMean_N2: sampled number of DSMC parcels
  • rhoN_N2: number density
  • rhoM_N2: density
  • U_N2: velocity vector
  • Ma_N2: mach number
  • p_N2: pressure (or partial pressure for a mixture)
  • Ttra_N2: translational temperature
  • Trot_N2: rotational temperature
  • Tvib_N2: vibrational temperature
  • Telec_N2: electronic temperature
  • Tov_N2: overall temperature
  • fD_N2: force density
  • wallShearStress_N2: wall shear stress
  • wallHeatFlux_N2: wall heat flux

The fields cellLevel and dsmcSigmaTcRMax have already been introduced in F.2.2 Initial volume fields.



2) Steady-state simulations

In the example below, macroscopic quantities are computed for the N2 species (see the dsmcVolFieldsProperties/typeIds() list) and are given the suffix _N2 (dsmcVolFieldsProperties/fieldName) in the results folders. The same operation is repeated for the mixture (N2 O2 NO N O), providing that these species are the ones defined in A.1 Species thermophysical properties. The suffix is set to be _mixture.

dsmcFields
(
    field
    {
        fieldModel          	dsmcVolFields;

        timeProperties
        {
            timeOption               write;
            resetAtOutput               on;
            resetAtOutputUntilTime    1e-3;
        }

        dsmcVolFieldsProperties
        {
            fieldName           N2;
            typeIds             (N2);
        }
    }

    field
    {
        fieldModel          	dsmcVolFields;

        timeProperties
        {
            timeOption               write;
            resetAtOutput               on;
            resetAtOutputUntilTime    1e-3;
        }

        dsmcVolFieldsProperties
        {
            fieldName           mixture;
            typeIds             (N2 O2 NO N O);
        }
    }
     
);

There are two important parameters in field/timeProperties to control sampling: resetAtOutput and resetAtOutputUntilTime. The former is a switch that indicates whether or not cumulative fields recording microscopic information are reset at the end of each iteration. If it is on, the instantaneous solution is printed. resetAtOutputUntilTime controls the time when sampling starts, in seconds, and for times greater than this value cumulative fields will not be reset to 0.



3) Transient simulations

  resetAtOutput must be on for all field dictionaries and the entry resetAtOutputUntilTime should either be deleted or set to a value greater than the end simulation time.



4) Mean free path computation

To compute the mean free path and related fields, the measureMeanFreePath entry must be added to field/dsmcVolFieldsProperties and be swiched on for all field dictionaries. Here is the list of additional fields that are printed in the results folders when this switch is activated:

  • mean free path: mfp
  • mean free path to cell size ratio: mfpToDx
  • mean free path to mean collision separation ratio: SOFP
  • mean collision time: mct
  • mean collision time to time-step ratio: mctToDt



5) Resume sampling

Sampling can be resumed even when the simulation has stopped, providing that the averagingAcrossManyRuns switch had been defined in dsmcVolFieldsProperties and set to true before launching the first run. Here are the steps to follow at the end of the first run:

  • reconstrucPar -latestTime
  • delete everything but the time/uniform/ sub-folder in the processors directories and store them in backup-processors
  • prior to resuming the simulation: cp -r backup-processors/processor* . && decomposePar -force -latestTime

NB: the same number of CPUs must be used throughout the entire simulation as the resumeSampling_#fieldName files located in time/uniform/ cannot be reconstructed.

For more information, please read Issue #73.