From 78a396430b3532f098fe2e4c573e19bb57cbda87 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sat, 7 Jan 2017 09:38:54 +0000 Subject: [PATCH] Rationalized the keyword to specify a file name in a dictionary to 'file' e.g. in tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T hot { type externalCoupledTemperature; commsDir "${FOAM_CASE}/comms"; file "data"; initByExternal yes; log true; value uniform 307.75; // 34.6 degC } Previously both 'file' and 'fileName' were used inconsistently in different classes and given that there is no confusion or ambiguity introduced by using the simpler 'file' rather than 'fileName' this change simplifies the use and maintenance of OpenFOAM. --- applications/test/fileNameClean/Test-fileNameClean.C | 4 ++-- .../utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C | 4 ++-- .../interpolation2DTable/interpolation2DTable.C | 6 +++--- .../interpolationLookUpTable/interpolationLookUpTable.C | 4 ++-- .../interpolations/interpolationTable/interpolationTable.C | 6 +++--- src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C | 6 +++--- .../primitives/functions/Function1/TableFile/TableFile.C | 6 +++--- .../externalCoupledMixed/externalCoupledMixedFvPatchField.C | 6 +++--- src/functionObjects/utilities/abort/abort.C | 4 ++-- .../effectivenessHeatExchangerSource.H | 4 ++-- .../derived/rotorDiskSource/profileModel/profileModel.C | 4 ++-- .../buoyantSimpleFoam/externalCoupledCavity/0/T | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/applications/test/fileNameClean/Test-fileNameClean.C b/applications/test/fileNameClean/Test-fileNameClean.C index 99d621fea8..9441beecc8 100644 --- a/applications/test/fileNameClean/Test-fileNameClean.C +++ b/applications/test/fileNameClean/Test-fileNameClean.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) argList::noBanner(); argList::noParallel(); argList::validArgs.insert("fileName .. fileNameN"); - argList::addOption("istream", "fileName", "test Istream values"); + argList::addOption("istream", "file", "test Istream values"); argList args(argc, argv, false, true); diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 9414149d41..645e292ea6 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -696,7 +696,7 @@ int main(int argc, char *argv[]) Foam::argList::addOption ( "outFile", - "fileName", + "file", "name of the file to save the simplified surface to" ); #include "addDictOption.H" diff --git a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C index 5b089f07ad..a656d5f7fd 100644 --- a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C +++ b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,7 +93,7 @@ Foam::interpolation2DTable::interpolation2DTable(const dictionary& dict) : List>>>(), boundsHandling_(wordToBoundsHandling(dict.lookup("outOfBounds"))), - fileName_(dict.lookup("fileName")), + fileName_(dict.lookup("file")), reader_(tableReader::New(dict)) { readTable(); @@ -445,7 +445,7 @@ void Foam::interpolation2DTable::checkOrder() const template void Foam::interpolation2DTable::write(Ostream& os) const { - os.writeKeyword("fileName") + os.writeKeyword("file") << fileName_ << token::END_STATEMENT << nl; os.writeKeyword("outOfBounds") << boundsHandlingToWord(boundsHandling_) << token::END_STATEMENT << nl; diff --git a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C index a0ee169188..32e76884b6 100644 --- a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C +++ b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -284,7 +284,7 @@ Foam::interpolationLookUpTable::interpolationLookUpTable ) : List(), - fileName_(fileName(dict.lookup("fileName")).expand()), + fileName_(fileName(dict.lookup("file")).expand()), dim_(0), min_(0.0), delta_(0.0), diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C index 8f09b560ac..6d71af1403 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C +++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,7 +97,7 @@ Foam::interpolationTable::interpolationTable(const dictionary& dict) : List>(), boundsHandling_(wordToBoundsHandling(dict.lookup("outOfBounds"))), - fileName_(dict.lookup("fileName")), + fileName_(dict.lookup("file")), reader_(tableReader::New(dict)) { readTable(); @@ -229,7 +229,7 @@ void Foam::interpolationTable::check() const template void Foam::interpolationTable::write(Ostream& os) const { - os.writeKeyword("fileName") + os.writeKeyword("file") << fileName_ << token::END_STATEMENT << nl; os.writeKeyword("outOfBounds") << boundsHandlingToWord(boundsHandling_) << token::END_STATEMENT << nl; diff --git a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C index 513298f8c7..258d4aca77 100644 --- a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C +++ b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -214,7 +214,7 @@ Foam::Function1Types::CSV::CSV componentColumns_(coeffs_.lookup("componentColumns")), separator_(coeffs_.lookupOrDefault("separator", string(","))[0]), mergeSeparators_(readBool(coeffs_.lookup("mergeSeparators"))), - fName_(coeffs_.lookup("fileName")) + fName_(coeffs_.lookup("file")) { if (componentColumns_.size() != pTraits::nComponents) { @@ -293,7 +293,7 @@ void Foam::Function1Types::CSV::writeData(Ostream& os) const << token::END_STATEMENT << nl; os.writeKeyword("mergeSeparators") << mergeSeparators_ << token::END_STATEMENT << nl; - os.writeKeyword("fileName") << fName_ << token::END_STATEMENT << nl; + os.writeKeyword("file") << fName_ << token::END_STATEMENT << nl; os << decrIndent << indent << token::END_BLOCK << endl; } diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C b/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C index 8551d1a84a..3e2645b9c2 100644 --- a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C +++ b/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ Foam::Function1Types::TableFile::TableFile fName_("none") { const dictionary coeffs(dict.subDict(entryName + "Coeffs")); - coeffs.lookup("fileName") >> fName_; + coeffs.lookup("file") >> fName_; fileName expandedFile(fName_); IFstream is(expandedFile.expand()); @@ -87,7 +87,7 @@ void Foam::Function1Types::TableFile::writeData(Ostream& os) const // the values themselves TableBase::writeEntries(os); - os.writeKeyword("fileName")<< fName_ << token::END_STATEMENT << nl; + os.writeKeyword("file")<< fName_ << token::END_STATEMENT << nl; os << decrIndent << indent << token::END_BLOCK << endl; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C index eab71dc17b..58b659684c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -497,7 +497,7 @@ externalCoupledMixedFvPatchField : mixedFvPatchField(p, iF), commsDir_(dict.lookup("commsDir")), - fName_(dict.lookup("fileName")), + fName_(dict.lookup("file")), waitInterval_(dict.lookupOrDefault("waitInterval", 1)), timeOut_(dict.lookupOrDefault("timeOut", 100*waitInterval_)), calcFrequency_(dict.lookupOrDefault("calcFrequency", 1)), @@ -809,7 +809,7 @@ void Foam::externalCoupledMixedFvPatchField::write(Ostream& os) const mixedFvPatchField::write(os); os.writeKeyword("commsDir") << commsDir_ << token::END_STATEMENT << nl; - os.writeKeyword("fileName") << fName_ << token::END_STATEMENT << nl; + os.writeKeyword("file") << fName_ << token::END_STATEMENT << nl; os.writeKeyword("waitInterval") << waitInterval_ << token::END_STATEMENT << nl; os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT << nl; diff --git a/src/functionObjects/utilities/abort/abort.C b/src/functionObjects/utilities/abort/abort.C index 54853319ec..896a2065b3 100644 --- a/src/functionObjects/utilities/abort/abort.C +++ b/src/functionObjects/utilities/abort/abort.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,7 +123,7 @@ bool Foam::functionObjects::abort::read(const dictionary& dict) action_ = nextWrite; } - if (dict.readIfPresent("fileName", abortFile_)) + if (dict.readIfPresent("file", abortFile_)) { abortFile_.expand(); } diff --git a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H index 42e3584393..e21ce5b52d 100644 --- a/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H +++ b/src/fvOptions/sources/derived/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,7 +118,7 @@ Usage Note -- the table with name "fileName" should have the same units as the +- the table with name "file" should have the same units as the secondary mass flow rate and kg/s for phi - faceZone is the faces at the inlet of the cellzone, it needs to be created with flip map flags. It is used to integrate the net mass flow diff --git a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C index 8934fa53ad..cd90b0dcdc 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/profileModel/profileModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,7 +51,7 @@ Foam::profileModel::profileModel(const dictionary& dict, const word& name) name_(name), fName_(fileName::null) { - dict.readIfPresent("fileName", fName_); + dict.readIfPresent("file", fName_); } // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T index 3bf09662bb..2f39feb6e2 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T @@ -35,7 +35,7 @@ boundaryField { type externalCoupledTemperature; commsDir "${FOAM_CASE}/comms"; - fileName "data"; + file "data"; initByExternal yes; log true; value uniform 307.75; // 34.6 degC @@ -45,7 +45,7 @@ boundaryField { type externalCoupledTemperature; commsDir "${FOAM_CASE}/comms"; - fileName "data"; + file "data"; initByExternal yes; log true; value uniform 288.15; // 15 degC