mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: argList::opt method instead of the longer argList::lookupOrDefault
- also replaced a few instances of readIfPresent with opt<> for constant values.
This commit is contained in:
@ -38,10 +38,9 @@ if (args.found("initialiseUBCs"))
|
||||
// Construct a pressure field
|
||||
// If it is available read it otherwise construct from the velocity BCs
|
||||
// converting fixed-value BCs to zero-gradient and vice versa.
|
||||
word pName("p");
|
||||
|
||||
// Update name of the pressure field from the command-line option
|
||||
args.readIfPresent("pName", pName);
|
||||
// Allow override from command-line -pName option
|
||||
const word pName = args.opt<word>("pName", "p");
|
||||
|
||||
// Infer the pressure BCs from the velocity
|
||||
wordList pBCTypes
|
||||
|
||||
@ -38,10 +38,9 @@ if (args.found("initialiseUBCs"))
|
||||
// Construct a pressure field
|
||||
// If it is available read it otherwise construct from the velocity BCs
|
||||
// converting fixed-value BCs to zero-gradient and vice versa.
|
||||
word pName("p");
|
||||
|
||||
// Update name of the pressure field from the command-line option
|
||||
args.readIfPresent("pName", pName);
|
||||
// Allow override from command-line -pName option
|
||||
const word pName = args.opt<word>("pName", "p");
|
||||
|
||||
// Infer the pressure BCs from the velocity
|
||||
wordList pBCTypes
|
||||
|
||||
@ -119,8 +119,10 @@ volScalarField alphac
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
|
||||
word kinematicCloudName("kinematicCloud");
|
||||
args.readIfPresent("cloud", kinematicCloudName);
|
||||
const word kinematicCloudName
|
||||
(
|
||||
args.opt<word>("cloud", "kinematicCloud")
|
||||
);
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
basicKinematicTypeCloud kinematicCloud
|
||||
|
||||
@ -57,8 +57,10 @@ volScalarField mu
|
||||
laminarTransport.nu()*rhoInfValue
|
||||
);
|
||||
|
||||
word kinematicCloudName("kinematicCloud");
|
||||
args.readIfPresent("cloud", kinematicCloudName);
|
||||
const word kinematicCloudName
|
||||
(
|
||||
args.opt<word>("cloud", "kinematicCloud")
|
||||
);
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
basicKinematicCollidingCloud kinematicCloud
|
||||
|
||||
@ -51,7 +51,7 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
|
||||
const word kinematicCloudName
|
||||
(
|
||||
args.lookupOrDefault<word>("cloud", "kinematicCloud")
|
||||
args.opt<word>("cloud", "kinematicCloud")
|
||||
);
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
|
||||
Reference in New Issue
Block a user