Files
openfoam/applications/solvers/multiphase/interPhaseChangeFoam/alphaControls.H
Mark Olesen 8eddcc072a ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033)
- use the dictionary 'get' methods instead of readScalar for
  additional checking

     Unchecked:  readScalar(dict.lookup("key"));
     Checked:    dict.get<scalar>("key");

- In templated classes that also inherit from a dictionary, an additional
  'template' keyword will be required. Eg,

     this->coeffsDict().template get<scalar>("key");

  For this common use case, the predefined getXXX shortcuts may be
  useful. Eg,

     this->coeffsDict().getScalar("key");
2018-10-12 08:14:47 +02:00

22 lines
678 B
C

const dictionary& alphaControls = mesh.solverDict(alpha1.name());
label nAlphaCorr(alphaControls.get<label>("nAlphaCorr"));
label nAlphaSubCycles(alphaControls.get<label>("nAlphaSubCycles"));
bool MULESCorr(alphaControls.lookupOrDefault("MULESCorr", false));
// Apply the compression correction from the previous iteration
// Improves efficiency for steady-simulations but can only be applied
// once the alpha field is reasonably steady, i.e. fully developed
//bool alphaApplyPrevCorr
//(
// alphaControls.lookupOrDefault("alphaApplyPrevCorr", false)
//);
// Isotropic compression coefficient
scalar icAlpha
(
alphaControls.lookupOrDefault<scalar>("icAlpha", 0)
);