mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add default control values to ease SIMPLE->PIMPLE transition
- add const-ness for control variables - drop unused fluxGradp variable - use lookupOrDefault instead of found/lookup combination
This commit is contained in:
@ -1,13 +1,17 @@
|
||||
dictionary pimple = mesh.solutionDict().subDict("PIMPLE");
|
||||
const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE");
|
||||
|
||||
int nOuterCorr(readInt(pimple.lookup("nOuterCorrectors")));
|
||||
int nCorr(readInt(pimple.lookup("nCorrectors")));
|
||||
const int nOuterCorr =
|
||||
pimple.lookupOrDefault<int>("nOuterCorrectors", 1);
|
||||
|
||||
int nNonOrthCorr =
|
||||
const int nCorr =
|
||||
pimple.lookupOrDefault<int>("nCorrectors", 1);
|
||||
|
||||
const int nNonOrthCorr =
|
||||
pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
bool momentumPredictor =
|
||||
pimple.lookupOrDefault<Switch>("momentumPredictor", true);
|
||||
const bool momentumPredictor =
|
||||
pimple.lookupOrDefault<bool>("momentumPredictor", true);
|
||||
|
||||
const bool transonic =
|
||||
pimple.lookupOrDefault<bool>("transonic", false);
|
||||
|
||||
bool transonic =
|
||||
pimple.lookupOrDefault<Switch>("transonic", false);
|
||||
|
||||
@ -1,15 +1,17 @@
|
||||
dictionary piso = mesh.solutionDict().subDict("PISO");
|
||||
const dictionary& piso = mesh.solutionDict().subDict("PISO");
|
||||
|
||||
int nCorr(readInt(piso.lookup("nCorrectors")));
|
||||
const int nOuterCorr =
|
||||
piso.lookupOrDefault<int>("nOuterCorrectors", 1);
|
||||
|
||||
int nNonOrthCorr =
|
||||
const int nCorr =
|
||||
piso.lookupOrDefault<int>("nCorrectors", 1);
|
||||
|
||||
const int nNonOrthCorr =
|
||||
piso.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
bool momentumPredictor =
|
||||
piso.lookupOrDefault<Switch>("momentumPredictor", true);
|
||||
const bool momentumPredictor =
|
||||
piso.lookupOrDefault<bool>("momentumPredictor", true);
|
||||
|
||||
bool transonic =
|
||||
piso.lookupOrDefault<Switch>("transonic", false);
|
||||
const bool transonic =
|
||||
piso.lookupOrDefault<bool>("transonic", false);
|
||||
|
||||
int nOuterCorr =
|
||||
piso.lookupOrDefault<int>("nOuterCorrectors", 1);
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
dictionary simple = mesh.solutionDict().subDict("SIMPLE");
|
||||
const dictionary& simple = mesh.solutionDict().subDict("SIMPLE");
|
||||
|
||||
int nNonOrthCorr =
|
||||
const int nNonOrthCorr =
|
||||
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
bool momentumPredictor =
|
||||
simple.lookupOrDefault<Switch>("momentumPredictor", true);
|
||||
const bool momentumPredictor =
|
||||
simple.lookupOrDefault<bool>("momentumPredictor", true);
|
||||
|
||||
bool fluxGradp =
|
||||
simple.lookupOrDefault<Switch>("fluxGradp", false);
|
||||
|
||||
bool transonic =
|
||||
simple.lookupOrDefault<Switch>("transonic", false);
|
||||
const bool transonic =
|
||||
simple.lookupOrDefault<bool>("transonic", false);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -29,15 +29,11 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Switch adjustTimeStep
|
||||
(
|
||||
runTime.controlDict().lookup("adjustTimeStep")
|
||||
);
|
||||
const bool adjustTimeStep =
|
||||
runTime.controlDict().lookupOrDefault<bool>("adjustTimeStep", false);
|
||||
|
||||
scalar maxCo
|
||||
(
|
||||
readScalar(runTime.controlDict().lookup("maxCo"))
|
||||
);
|
||||
scalar maxCo =
|
||||
runTime.controlDict().lookupOrDefault<scalar>("maxCo", 1.0);
|
||||
|
||||
scalar maxDeltaT =
|
||||
runTime.controlDict().lookupOrDefault<scalar>("maxDeltaT", GREAT);
|
||||
|
||||
Reference in New Issue
Block a user