From 040f333f631d15f8bbb5f8090cabbe45f353b133 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 25 Jan 2012 09:50:08 +0000 Subject: [PATCH 1/6] ENH: Added -overwrite option to mergeMeshes utility --- .../mesh/manipulation/mergeMeshes/mergeMeshes.C | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C b/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C index 99631e1e49..3841e16bf3 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C +++ b/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C @@ -61,6 +61,8 @@ int main(int argc, char *argv[]) ); argList::noParallel(); + #include "addOverwriteOption.H" + argList::validArgs.append("masterCase"); argList::addOption ( @@ -83,6 +85,8 @@ int main(int argc, char *argv[]) FatalError.exit(); } + const bool overwrite = args.optionFound("overwrite"); + fileName masterCase = args[1]; word masterRegion = polyMesh::defaultRegion; args.optionReadIfPresent("masterRegion", masterRegion); @@ -126,7 +130,10 @@ int main(int argc, char *argv[]) ) ); - runTimeMaster++; + if (!overwrite) + { + runTimeMaster++; + } Info<< "Writing combined mesh to " << runTimeMaster.timeName() << endl; From f5d026dd713df4408834dcd7182b8d23dd5ae793 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 25 Jan 2012 10:00:07 +0000 Subject: [PATCH 2/6] STYLE: Removed duplicate ;;'s in tutorial dictionaries --- .../constant/heater/solidThermophysicalProperties | 2 +- .../constant/heater/solidThermophysicalProperties | 2 +- .../constant/heater/solidThermophysicalProperties | 2 +- .../constant/heater/solidThermophysicalProperties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties index eff5806ae7..ec1061eb2d 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties @@ -136,7 +136,7 @@ charCoeffs thermodynamics { Hf 0; - C0 611.0;; // Cp = C0*(T/Tref)^n0 + C0 611.0; // Cp = C0*(T/Tref)^n0 Tref 300; n0 1.31; } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties index d169d6aebd..b345dace24 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/constant/heater/solidThermophysicalProperties @@ -141,7 +141,7 @@ charCoeffs thermodynamics { Hf 0; - C0 611.0;; // Cp = C0*(T/Tref)^n0 + C0 611.0; // Cp = C0*(T/Tref)^n0 Tref 300; n0 1.31; } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties index fdad307ca2..54ca602eee 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties @@ -136,7 +136,7 @@ charCoeffs thermodynamics { Hf 0; - C0 611.0;; // Cp = C0*(T/Tref)^n0 + C0 611.0; // Cp = C0*(T/Tref)^n0 Tref 300; n0 1.31; } diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/constant/heater/solidThermophysicalProperties index 4921a907f1..004cda2c14 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/constant/heater/solidThermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/constant/heater/solidThermophysicalProperties @@ -141,7 +141,7 @@ charCoeffs thermodynamics { Hf 0; - C0 611.0;; // Cp = C0*(T/Tref)^n0 + C0 611.0; // Cp = C0*(T/Tref)^n0 Tref 300; n0 1.31; } From 50ddfebf38ffd90895d2dd0c2a065d4d57173865 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 25 Jan 2012 10:03:03 +0000 Subject: [PATCH 3/6] ENH: Added -dict option to createPatch utility --- .../manipulation/createPatch/createPatch.C | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 7afe8356a6..1df5e9dae8 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -490,11 +490,17 @@ void syncPoints int main(int argc, char *argv[]) { -# include "addOverwriteOption.H" -# include "addRegionOption.H" + #include "addOverwriteOption.H" + #include "addRegionOption.H" + argList::addOption + ( + "dict", + "word", + "name of dictionary to provide patch information" + ); -# include "setRootCase.H" -# include "createTime.H" + #include "setRootCase.H" + #include "createTime.H" runTime.functionObjects().off(); Foam::word meshRegionName = polyMesh::defaultRegion; @@ -502,13 +508,18 @@ int main(int argc, char *argv[]) const bool overwrite = args.optionFound("overwrite"); - Info<< "Reading createPatchDict." << nl << endl; + word sampleDictName + ( + args.optionLookupOrDefault("dict", "createPatchDict") + ); + + Info<< "Reading " << sampleDictName << nl << endl; IOdictionary dict ( IOobject ( - "createPatchDict", + sampleDictName, runTime.system(), ( meshRegionName != polyMesh::defaultRegion @@ -526,7 +537,7 @@ int main(int argc, char *argv[]) // Whether to synchronise points const Switch pointSync(dict.lookup("pointSync")); -# include "createNamedPolyMesh.H" + #include "createNamedPolyMesh.H" const word oldInstance = mesh.pointsInstance(); From 6dd1d80c181c43526d39ba5284d57049cd6df700 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 25 Jan 2012 10:36:43 +0000 Subject: [PATCH 4/6] STYLE: Minor code clean-up --- .../utilities/mesh/manipulation/createPatch/createPatch.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 1df5e9dae8..54b9c03391 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -508,18 +508,18 @@ int main(int argc, char *argv[]) const bool overwrite = args.optionFound("overwrite"); - word sampleDictName + word dictName ( args.optionLookupOrDefault("dict", "createPatchDict") ); - Info<< "Reading " << sampleDictName << nl << endl; + Info<< "Reading " << dictName << nl << endl; IOdictionary dict ( IOobject ( - sampleDictName, + dictName, runTime.system(), ( meshRegionName != polyMesh::defaultRegion From 71e623d5589d5818a830d26fe431936ac76eb31e Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 25 Jan 2012 10:54:05 +0000 Subject: [PATCH 5/6] ENH: creatPatch: added message when requested (new) patch already exists --- .../utilities/mesh/manipulation/createPatch/createPatch.C | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 54b9c03391..7922d487a2 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -618,6 +618,11 @@ int main(int argc, char *argv[]) ).ptr() ); } + else + { + Info<< "Patch '" << patchName << "' already exists. Only " + << "moving patch faces - type will remain the same" << endl; + } } // Copy old patches. From a420f79ba8b7765d2947dff6e5fe2ed254817aa4 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 25 Jan 2012 13:24:39 +0000 Subject: [PATCH 6/6] BUG: Corrected reactingParcel I/O wrt state labels --- .../parcels/Templates/ReactingParcel/ReactingParcelIO.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C index 6641e4301c..159b70c082 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C @@ -128,7 +128,7 @@ void Foam::ReactingParcel::readFields wordList stateLabels(nPhases, ""); if (compModel.nPhase() == 1) { - stateLabels = compModel.stateLabels(); + stateLabels = compModel.stateLabels()[0]; } @@ -198,7 +198,7 @@ void Foam::ReactingParcel::writeFields wordList stateLabels(phaseTypes.size(), ""); if (compModel.nPhase() == 1) { - stateLabels = compModel.stateLabels(); + stateLabels = compModel.stateLabels()[0]; } forAll(phaseTypes, j)