From 4a5172706f6b8d14fba3d0e8b966ec499f1c4f68 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 6 Dec 2012 09:34:45 +0000 Subject: [PATCH 1/5] STYLE: iglooWithFridges: extraneous field --- .../iglooWithFridges/0/alphat | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat deleted file mode 100644 index aefa32d852..0000000000 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat +++ /dev/null @@ -1,53 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object alphat; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - //- Set patchGroups for constraint patches - #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - - ground - { - type alphatWallFunction; - value uniform 0; - } - - igloo_region0 - { - type alphatWallFunction; - value uniform 0; - } - - twoFridgeFreezers_seal_0 - { - type alphatWallFunction; - value uniform 0; - } - - twoFridgeFreezers_herring_1 - { - type alphatWallFunction; - value uniform 0; - } -} - - -// ************************************************************************* // From 302643fba8037f21ef3ecae76a9893f5536d09c6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 7 Dec 2012 09:46:47 +0000 Subject: [PATCH 2/5] BUG: stringOps: incorrect error message --- src/OpenFOAM/primitives/strings/stringOps/stringOps.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C index b7e11d644f..feabf36109 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C @@ -312,7 +312,7 @@ Foam::string Foam::stringOps::getVariable " const bool\n" ")\n", dict - ) << "Cannot find environment variable " + ) << "Cannot find dictionary variable " << name << exit(FatalIOError); } From 53c130b89bc475910cd1955d408053734fa48553 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 7 Dec 2012 09:47:54 +0000 Subject: [PATCH 3/5] ENH: dictionary: do not allow empty variables --- src/OpenFOAM/db/dictionary/entry/entryIO.C | 7 ++++--- .../dictionary/primitiveEntry/primitiveEntry.C | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C index c958b8f949..bc0ffb9c09 100644 --- a/src/OpenFOAM/db/dictionary/entry/entryIO.C +++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C @@ -117,11 +117,12 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is) if (keyword.size() > 2 && keyword[1] == token::BEGIN_BLOCK) { // Recursive substitution mode. Replace between {} with - // expansion. + // expansion and then let standard variable expansion deal + // with rest. string s(keyword(2, keyword.size()-3)); - // Substitute dictionary and environment variables. Allow + // Substitute dictionary and environment variables. Do not allow // empty substitutions. - stringOps::inplaceExpand(s, parentDict, true, true); + stringOps::inplaceExpand(s, parentDict, true, false); keyword.std::string::replace(1, keyword.size()-1, s); } parentDict.substituteScopedKeyword(keyword); diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C index 0566b8f350..779709e4a0 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C @@ -47,13 +47,11 @@ bool Foam::primitiveEntry::expandVariable { if (w.size() > 2 && w[0] == '$' && w[1] == token::BEGIN_BLOCK) { - // Recursive substitution mode. Replace between {} with - // expansion. + // Recursive substitution mode. Replace between {} with expansion. string s(w(2, w.size()-3)); - // Substitute dictionary and environment variables. Allow + // Substitute dictionary and environment variables. Do not allow // empty substitutions. - stringOps::inplaceExpand(s, dict, true, true); - + stringOps::inplaceExpand(s, dict, true, false); string newW(w); newW.std::string::replace(1, newW.size()-1, s); @@ -83,6 +81,15 @@ bool Foam::primitiveEntry::expandVariable if (envStr.empty()) { + FatalIOErrorIn + ( + "primitiveEntry::expandVariable" + "(const string&, const dictionary&", + dict + ) << "Illegal dictionary entry or environment variable name " + << varName << endl << "Valid dictionary entries are " + << dict.toc() << exit(FatalIOError); + return false; } append(tokenList(IStringStream('(' + envStr + ')')())); From 439159076b47f1dda8c8eeb2aebd440486c9bf4f Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 7 Dec 2012 11:27:32 +0000 Subject: [PATCH 4/5] ENH: iglooWithFridges: updated for patchGroups --- .../iglooWithFridges/0/T | 11 ++------- .../iglooWithFridges/0/U | 20 +--------------- .../iglooWithFridges/0/epsilon | 20 +--------------- .../iglooWithFridges/0/k | 20 +--------------- .../iglooWithFridges/0/kappat | 23 +------------------ .../iglooWithFridges/0/nut | 20 +--------------- .../iglooWithFridges/0/p | 20 +--------------- .../iglooWithFridges/0/p_rgh | 23 +------------------ .../constant/polyMesh/blockMeshDict | 3 ++- .../iglooWithFridges/system/controlDict | 7 ++++++ .../iglooWithFridges/system/decomposeParDict | 4 ++-- .../iglooWithFridges/system/snappyHexMeshDict | 16 +++++++++++++ 12 files changed, 36 insertions(+), 151 deletions(-) diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T index dd74be1133..7e8969b307 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T @@ -23,13 +23,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type fixedValue; - value uniform 265; - } - - igloo_region0 + wall { type fixedValue; value uniform 265; @@ -43,8 +37,7 @@ boundaryField twoFridgeFreezers_herring_1 { - type fixedValue; - value uniform 303; + $twoFridgeFreezers_seal_0; } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U index f1a91fe971..03d53ee7ed 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U @@ -23,25 +23,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type fixedValue; - value uniform (0 0 0); - } - - igloo_region0 - { - type fixedValue; - value uniform (0 0 0); - } - - twoFridgeFreezers_seal_0 - { - type fixedValue; - value uniform (0 0 0); - } - - twoFridgeFreezers_herring_1 + wall { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon index b75802e0e8..e36fe920fc 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon @@ -24,25 +24,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type epsilonWallFunction; - value uniform 0.01; - } - - igloo_region0 - { - type epsilonWallFunction; - value uniform 0.01; - } - - twoFridgeFreezers_seal_0 - { - type epsilonWallFunction; - value uniform 0.01; - } - - twoFridgeFreezers_herring_1 + wall { type epsilonWallFunction; value uniform 0.01; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k index 04edc9d0d7..0d889ec8f8 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k @@ -24,25 +24,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type kqRWallFunction; - value uniform 0.1; - } - - igloo_region0 - { - type kqRWallFunction; - value uniform 0.1; - } - - twoFridgeFreezers_seal_0 - { - type kqRWallFunction; - value uniform 0.1; - } - - twoFridgeFreezers_herring_1 + wall { type kqRWallFunction; value uniform 0.1; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat index 5c82ad4a55..44f2524e7f 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat @@ -24,28 +24,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type kappatJayatillekeWallFunction; - Prt 0.85; - value uniform 0; - } - - igloo_region0 - { - type kappatJayatillekeWallFunction; - Prt 0.85; - value uniform 0; - } - - twoFridgeFreezers_seal_0 - { - type kappatJayatillekeWallFunction; - Prt 0.85; - value uniform 0; - } - - twoFridgeFreezers_herring_1 + wall { type kappatJayatillekeWallFunction; Prt 0.85; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut index b8dae4d50f..42472f31f0 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut @@ -24,25 +24,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type nutkWallFunction; - value uniform 0; - } - - igloo_region0 - { - type nutkWallFunction; - value uniform 0; - } - - twoFridgeFreezers_seal_0 - { - type nutkWallFunction; - value uniform 0; - } - - twoFridgeFreezers_herring_1 + wall { type nutkWallFunction; value uniform 0; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p index 19bfa3d347..5a2eb19619 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p @@ -23,25 +23,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type calculated; - value $internalField; - } - - igloo_region0 - { - type calculated; - value $internalField; - } - - twoFridgeFreezers_seal_0 - { - type calculated; - value $internalField; - } - - twoFridgeFreezers_herring_1 + wall { type calculated; value $internalField; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh index e39f2ab7ce..69ceeb45df 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh @@ -23,28 +23,7 @@ boundaryField //- Set patchGroups for constraint patches #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" - ground - { - type fixedFluxPressure; - rho rhok; - value uniform 0; - } - - igloo_region0 - { - type fixedFluxPressure; - rho rhok; - value uniform 0; - } - - twoFridgeFreezers_seal_0 - { - type fixedFluxPressure; - rho rhok; - value uniform 0; - } - - twoFridgeFreezers_herring_1 + wall { type fixedFluxPressure; rho rhok; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict index 57de714b2f..c854ce532d 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict @@ -78,7 +78,8 @@ boundary ground { - type wall; + type wall; + inGroups (wall); faces ( (0 3 2 1) diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict index 590a482d4a..31ca07d47d 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/controlDict @@ -15,6 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +libs +( + "libincompressibleTurbulenceModel.so" + "libincompressibleRASModels.so" + "libincompressibleTransportModels.so" +); + application buoyantBoussinesqSimpleFoam; startFrom startTime; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/decomposeParDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/decomposeParDict index 09e2478dbb..7c42021853 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/decomposeParDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/decomposeParDict @@ -15,9 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 6; +numberOfSubdomains 2; -method hierarchical; +method scotch; simpleCoeffs { diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict index bc90ed1c2b..c5e80f8d1a 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict @@ -148,12 +148,28 @@ castellatedMeshControls level (3 3); } } + + // Optional specification of patch type (default is wall). No + // constraint types (cyclic, symmetry) etc. are allowed. + patchInfo + { + type wall; + inGroups (wall); + } } "iglo.*" { // Surface-wise min and max refinement level level (1 1); + + // Optional specification of patch type (default is wall). No + // constraint types (cyclic, symmetry) etc. are allowed. + patchInfo + { + type wall; + inGroups (wall); + } } } From 7777493411604424e540ac504cb0a41f573a8cb5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 7 Dec 2012 19:14:01 +0000 Subject: [PATCH 5/5] BUG: setFields: parallel running with different number of proc patches --- applications/utilities/preProcessing/setFields/setFields.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index 3f1f628a75..274258ffd2 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.C @@ -227,7 +227,11 @@ bool setFaceFieldType // Override bool hasWarned = false; - labelList nChanged(field.boundaryField().size(), 0); + labelList nChanged + ( + returnReduce(field.boundaryField().size(), maxOp