mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +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,25 +1,11 @@
|
||||
dictionary simple = fluidRegions[i].solutionDict().subDict("SIMPLE");
|
||||
const dictionary& simple = fluidRegions[i].solutionDict().subDict("SIMPLE");
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
if (simple.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
||||
const int nNonOrthCorr =
|
||||
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
bool momentumPredictor = true;
|
||||
if (simple.found("momentumPredictor"))
|
||||
{
|
||||
momentumPredictor = Switch(simple.lookup("momentumPredictor"));
|
||||
}
|
||||
const bool momentumPredictor =
|
||||
simple.lookupOrDefault<bool>("momentumPredictor", true);
|
||||
|
||||
bool fluxGradp = false;
|
||||
if (simple.found("fluxGradp"))
|
||||
{
|
||||
fluxGradp = Switch(simple.lookup("fluxGradp"));
|
||||
}
|
||||
const bool transonic =
|
||||
simple.lookupOrDefault<bool>("transonic", false);
|
||||
|
||||
bool transonic = false;
|
||||
if (simple.found("transonic"))
|
||||
{
|
||||
transonic = Switch(simple.lookup("transonic"));
|
||||
}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
dictionary simple = solidRegions[i].solutionDict().subDict("SIMPLE");
|
||||
const dictionary& simple = solidRegions[i].solutionDict().subDict("SIMPLE");
|
||||
|
||||
const int nNonOrthCorr =
|
||||
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
if (simple.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE");
|
||||
|
||||
int nCorr(readInt(pimple.lookup("nCorrectors")));
|
||||
const int nCorr =
|
||||
pimple.lookupOrDefault<int>("nCorrectors", 1);
|
||||
|
||||
int nNonOrthCorr =
|
||||
const int nNonOrthCorr =
|
||||
pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
bool momentumPredictor =
|
||||
pimple.lookupOrDefault<Switch>("momentumPredictor", true);
|
||||
const bool momentumPredictor =
|
||||
pimple.lookupOrDefault<bool>("momentumPredictor", true);
|
||||
|
||||
|
||||
@ -1,27 +1,17 @@
|
||||
dictionary piso = fluidRegions[i].solutionDict().subDict("PISO");
|
||||
const dictionary& piso = fluidRegions[i].solutionDict().subDict("PISO");
|
||||
|
||||
int nCorr(readInt(piso.lookup("nCorrectors")));
|
||||
const int nOuterCorr =
|
||||
piso.lookupOrDefault<int>("nOuterCorrectors", 1);
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
if (piso.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
||||
const int nCorr =
|
||||
piso.lookupOrDefault<int>("nCorrectors", 1);
|
||||
|
||||
bool momentumPredictor = true;
|
||||
if (piso.found("momentumPredictor"))
|
||||
{
|
||||
momentumPredictor = Switch(piso.lookup("momentumPredictor"));
|
||||
}
|
||||
const int nNonOrthCorr =
|
||||
piso.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
bool transonic = false;
|
||||
if (piso.found("transonic"))
|
||||
{
|
||||
transonic = Switch(piso.lookup("transonic"));
|
||||
}
|
||||
const bool momentumPredictor =
|
||||
piso.lookupOrDefault<bool>("momentumPredictor", true);
|
||||
|
||||
const bool transonic =
|
||||
piso.lookupOrDefault<bool>("transonic", false);
|
||||
|
||||
int nOuterCorr = 1;
|
||||
if (piso.found("nOuterCorrectors"))
|
||||
{
|
||||
nOuterCorr = readInt(piso.lookup("nOuterCorrectors"));
|
||||
}
|
||||
|
||||
@ -4,4 +4,6 @@
|
||||
|
||||
const dictionary& pimple = solutionDict.subDict("PIMPLE");
|
||||
|
||||
int nOuterCorr(readInt(pimple.lookup("nOuterCorrectors")));
|
||||
const int nOuterCorr =
|
||||
pimple.lookupOrDefault<int>("nOuterCorrectors", 1);
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
const dictionary& piso = solidRegions[i].solutionDict().subDict("PISO");
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
if (piso.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
||||
const int nNonOrthCorr =
|
||||
piso.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user