From 5dc1c259d43b9a7bab0738bea1c24250337b7956 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 21 Sep 2012 12:03:08 +0100 Subject: [PATCH 1/8] ENH: verticalChannel: updated for fowRateInletVelocity --- .../changeDictionary/changeDictionary.C | 160 ++++++++++++------ .../verticalChannel/0.org/U | 6 +- .../verticalChannel/0/H2O | 54 ------ .../verticalChannel/0/T | 54 ------ .../verticalChannel/0/U | 57 ------- .../verticalChannel/0/air | 54 ------ .../verticalChannel/0/alphat | 56 ------ .../verticalChannel/0/k | 57 ------- .../verticalChannel/0/mut | 58 ------- .../verticalChannel/0/omega | 62 ------- .../verticalChannel/Allclean | 4 - .../verticalChannel/Allrun | 6 + .../constant/polyMesh/boundary | 58 ------- .../{0/p => system/changeDictionaryDict} | 49 ++---- 14 files changed, 139 insertions(+), 596 deletions(-) delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/H2O delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/T delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/U delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/air delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/alphat delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/k delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/mut delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega delete mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/polyMesh/boundary rename tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/{0/p => system/changeDictionaryDict} (58%) diff --git a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C index ad178b765c..3c664cfc3b 100644 --- a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C +++ b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C @@ -52,6 +52,7 @@ Description } } \endverbatim + Replacement entries starting with '~' will remove the entry. Usage @@ -172,6 +173,46 @@ bool addEntry } + +// List of indices into thisKeys +labelList findMatches +( + const HashTable& shortcuts, + const wordList& shortcutNames, + const wordList& thisKeys, + const keyType& key +) +{ + labelList matches; + + if (key.isPattern()) + { + // Wildcard match + matches = findStrings(key, thisKeys); + + } + else if (shortcuts.size()) + { + // See if patchGroups expand to valid thisKeys + labelList indices = findStrings(key, shortcutNames); + forAll(indices, i) + { + const word& name = shortcutNames[indices[i]]; + const wordList& keys = shortcuts[name]; + forAll(keys, j) + { + label index = findIndex(thisKeys, keys[j]); + if (index != -1) + { + matches.append(index); + } + } + } + } + return matches; +} + + // Dictionary merging/editing. // literalRE: // - true: behave like dictionary::merge, i.e. add regexps just like @@ -185,6 +226,8 @@ bool merge const HashTable& shortcuts ) { + const wordList shortcutNames(shortcuts.toc()); + bool changed = false; // Save current (non-wildcard) keys before adding items. @@ -203,7 +246,18 @@ bool merge { const keyType& key = mergeIter().keyword(); - if (literalRE || !(key.isPattern() || shortcuts.found(key))) + if (key[0] == '~') + { + word eraseKey = key(1, key.size()-1); + if (thisDict.remove(eraseKey)) + { + // Mark thisDict entry as having been match for wildcard + // handling later on. + thisKeysSet.erase(eraseKey); + } + changed = true; + } + else if (literalRE || !(key.isPattern() || shortcuts.found(key))) { entry* entryPtr = thisDict.lookupEntryPtr ( @@ -255,59 +309,69 @@ bool merge { const keyType& key = mergeIter().keyword(); - // List of indices into thisKeys - labelList matches; - - if (key.isPattern()) + if (key[0] == '~') { - // Wildcard match - matches = findStrings(key, thisKeys); + word eraseKey = key(1, key.size()-1); - } - else if (shortcuts.size()) - { - // See if patchGroups expand to valid thisKeys - const wordList shortcutNames = shortcuts.toc(); - labelList indices = findStrings(key, shortcutNames); - forAll(indices, i) - { - const word& name = shortcutNames[indices[i]]; - const wordList& keys = shortcuts[name]; - forAll(keys, j) - { - label index = findIndex(thisKeys, keys[j]); - if (index != -1) - { - matches.append(index); - } - } - } - } - - // Add all matches - forAll(matches, i) - { - const word& thisKey = thisKeys[matches[i]]; - - entry& thisEntry = const_cast + // List of indices into thisKeys + labelList matches ( - thisDict.lookupEntry(thisKey, false, false) + findMatches + ( + shortcuts, + shortcutNames, + thisKeys, + eraseKey + ) ); - if - ( - addEntry - ( - thisDict, - thisEntry, - mergeIter(), - literalRE, - HashTable(0) // no shortcuts - // at deeper levels - ) - ) + // Remove all matches + forAll(matches, i) { - changed = true; + const word& thisKey = thisKeys[matches[i]]; + thisKeysSet.erase(thisKey); + } + changed = true; + } + else + { + // List of indices into thisKeys + labelList matches + ( + findMatches + ( + shortcuts, + shortcutNames, + thisKeys, + key + ) + ); + + // Add all matches + forAll(matches, i) + { + const word& thisKey = thisKeys[matches[i]]; + + entry& thisEntry = const_cast + ( + thisDict.lookupEntry(thisKey, false, false) + ); + + if + ( + addEntry + ( + thisDict, + thisEntry, + mergeIter(), + literalRE, + HashTable(0) // no shortcuts + // at deeper levels + ) + ) + { + changed = true; + } } } } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U index 7f8c434997..029e4cce0a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U @@ -32,13 +32,15 @@ boundaryField inletCentral { type flowRateInletVelocity; - massFlowRate constant 0.00379; + //massFlowRate constant 0.00379; + volumetricFlowRate constant 0.00379; value uniform (0 14.68 0); } inletSides { type flowRateInletVelocity; - massFlowRate constant 0.00832; + //massFlowRate constant 0.00832; + volumetricFlowRate constant 0.00832; value uniform (0 17.79 0); } outlet diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/H2O b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/H2O deleted file mode 100644 index baa8dd2152..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/H2O +++ /dev/null @@ -1,54 +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 H2O; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.01; - -boundaryField -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - walls - { - type zeroGradient; - } - outlet - { - type inletOutlet; - inletValue uniform 0.0; - } - inletSides - { - type fixedValue; - value uniform 0.01; - } - inletCentral - { - type fixedValue; - value uniform 0.01; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/T b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/T deleted file mode 100644 index df744edb03..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/T +++ /dev/null @@ -1,54 +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 T; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 473.0; - -boundaryField -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - walls - { - type zeroGradient; - } - outlet - { - type inletOutlet; - inletValue uniform 473.0; - } - inletSides - { - type fixedValue; - value uniform 473.0; - } - inletCentral - { - type fixedValue; - value uniform 573.0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/U b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/U deleted file mode 100644 index 7f8c434997..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/U +++ /dev/null @@ -1,57 +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 volVectorField; - location "0"; - object U; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0 0); - -boundaryField -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - inletCentral - { - type flowRateInletVelocity; - massFlowRate constant 0.00379; - value uniform (0 14.68 0); - } - inletSides - { - type flowRateInletVelocity; - massFlowRate constant 0.00832; - value uniform (0 17.79 0); - } - outlet - { - type inletOutlet; - inletValue uniform (0 0 0); - } - walls - { - type fixedValue; - value uniform (0 0 0); - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/air b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/air deleted file mode 100644 index 81541afef9..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/air +++ /dev/null @@ -1,54 +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 air; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.99; - -boundaryField -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - walls - { - type zeroGradient; - } - outlet - { - type inletOutlet; - inletValue uniform 1.0; - } - inletSides - { - type fixedValue; - value uniform 0.99; - } - inletCentral - { - type fixedValue; - value uniform 0.99; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/alphat b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/alphat deleted file mode 100644 index 33d260bf7c..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/alphat +++ /dev/null @@ -1,56 +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 -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - inletCentral - { - type calculated; - value uniform 0; - } - inletSides - { - type calculated; - value uniform 0; - } - outlet - { - type calculated; - value uniform 0; - } - walls - { - type alphatWallFunction; - Prt 0.85; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/k b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/k deleted file mode 100644 index 2a76936893..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/k +++ /dev/null @@ -1,57 +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 k; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform 3.75e-9; - -boundaryField -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - inletCentral - { - type turbulentIntensityKineticEnergyInlet; - intensity 0.15; - value uniform 3.75e-9; - } - inletSides - { - type turbulentIntensityKineticEnergyInlet; - intensity 0.16; - value uniform 3.75e-9; - } - outlet - { - type inletOutlet; - inletValue uniform 3.75e-9; - } - walls - { - type compressible::kqRWallFunction; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/mut b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/mut deleted file mode 100644 index 7cfeaae133..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/mut +++ /dev/null @@ -1,58 +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 mut; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -1 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - inletCentral - { - type calculated; - value uniform 0; - } - inletSides - { - type calculated; - value uniform 0; - } - outlet - { - type calculated; - value uniform 0; - } - walls - { - type mutkWallFunction; - Cmu 0.09; - kappa 0.41; - E 9.8; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega deleted file mode 100644 index efd2924775..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega +++ /dev/null @@ -1,62 +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 omega; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 -1 0 0 0 0]; - -internalField uniform 4.5e-3; - -boundaryField -{ - back - { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - inletCentral - { - type compressible::turbulentMixingLengthFrequencyInlet; - mixingLength 0.007; - k k; - value uniform 4.5e-3; - } - inletSides - { - type compressible::turbulentMixingLengthFrequencyInlet; - mixingLength 0.007; - k k; - value uniform 4.5e-3; - } - outlet - { - type inletOutlet; - inletValue uniform 4.5e-3; - } - walls - { - type compressible::omegaWallFunction; - Cmu 0.09; - kappa 0.41; - E 9.8; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allclean b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allclean index 6ac02e9eab..b0a57810b3 100755 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allclean +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allclean @@ -7,10 +7,6 @@ cd ${0%/*} || exit 1 # run from this directory # remove old time and post-processing folders rm -rf 0 *[1-9]* processor* postProcessing - -# copy 0.org to 0 -cp -r 0.org 0 - cleanCase # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allrun b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allrun index 8d4cb3681e..babec860ab 100755 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allrun +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/Allrun @@ -7,10 +7,16 @@ cd ${0%/*} || exit 1 # run from this directory # create mesh runApplication blockMesh +cp -r 0.org 0 + # initialise with potentialFoam solution runApplication potentialFoam + rm -f 0/phi +# change flowRateInletVelocity to massFlowRate +runApplication changeDictionary + # run the solver runApplication `getApplication` diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/polyMesh/boundary b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/polyMesh/boundary deleted file mode 100644 index e8088bf7bd..0000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/polyMesh/boundary +++ /dev/null @@ -1,58 +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 polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( - back - { - type symmetryPlane; - nFaces 9340; - startFace 265900; - } - front - { - type symmetryPlane; - nFaces 9340; - startFace 275240; - } - inletCentral - { - type patch; - nFaces 100; - startFace 284580; - } - inletSides - { - type patch; - nFaces 200; - startFace 284680; - } - outlet - { - type patch; - nFaces 300; - startFace 284880; - } - walls - { - type wall; - nFaces 9320; - startFace 285180; - } -) - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/p b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/changeDictionaryDict similarity index 58% rename from tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/p rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/changeDictionaryDict index 921f06d7a1..e70391b71f 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/p +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/changeDictionaryDict @@ -9,44 +9,29 @@ FoamFile { version 2.0; format ascii; - class volScalarField; - location "0"; - object p; + class dictionary; + object changeDictionaryDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 100000; - -boundaryField +dictionaryReplacement { - back + U { - type symmetryPlane; - } - front - { - type symmetryPlane; - } - inletCentral - { - type zeroGradient; - } - inletSides - { - type zeroGradient; - } - outlet - { - type fixedValue; - value uniform 100000; - } - walls - { - type zeroGradient; + boundaryField + { + inletCentral + { + ~volumetricFlowRate; + massFlowRate constant 0.00379; + } + inletSides + { + ~volumetricFlowRate; + massFlowRate constant 0.00832; + } + } } } - // ************************************************************************* // From b512a8f3734c6a5e60f213f5c1ef855fa8a92e29 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 21 Sep 2012 12:06:51 +0100 Subject: [PATCH 2/8] BUG: iglooWithFridges: missing file --- .../iglooWithFridges/system/meshQualityDict | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/meshQualityDict diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/meshQualityDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/meshQualityDict new file mode 100644 index 0000000000..1b5837a15e --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/meshQualityDict @@ -0,0 +1,64 @@ +/*--------------------------------*- 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 dictionary; + object meshQualityDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +//- Maximum non-orthogonality allowed. Set to 180 to disable. +maxNonOrtho 65; + +//- Max skewness allowed. Set to <0 to disable. +maxBoundarySkewness 20; +maxInternalSkewness 4; + +//- Max concaveness allowed. Is angle (in degrees) below which concavity +// is allowed. 0 is straight face, <0 would be convex face. +// Set to 180 to disable. +maxConcave 80; + +//- Minimum pyramid volume. Is absolute volume of cell pyramid. +// Set to a sensible fraction of the smallest cell volume expected. +// Set to very negative number (e.g. -1E30) to disable. +minVol 1e-13; + +//- Minimum quality of the tet formed by the face-centre +// and variable base point minimum decomposition triangles and +// the cell centre. Set to very negative number (e.g. -1E30) to +// disable. +// <0 = inside out tet, +// 0 = flat tet +// 1 = regular tet +minTetQuality 1e-30; + +//- Minimum face area. Set to <0 to disable. +minArea -1; + +//- Minimum face twist. Set to <-1 to disable. dot product of face normal +//- and face centre triangles normal +minTwist 0.05; + +//- minimum normalised cell determinant +//- 1 = hex, <= 0 = folded or flattened illegal cell +minDeterminant 0.001; + +//- minFaceWeight (0 -> 0.5) +minFaceWeight 0.05; + +//- minVolRatio (0 -> 1) +minVolRatio 0.01; + +//must be >0 for Fluent compatibility +minTriangleTwist -1; + + +// ************************************************************************* // From deed6d371d76effa617886c868152f466d61a494 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 24 Sep 2012 10:48:41 +0100 Subject: [PATCH 3/8] STYLE: fileMonitor: space added --- src/OSspecific/POSIX/fileMonitor.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index 030e7639f4..f17e7b1dc9 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.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 @@ -168,7 +168,7 @@ namespace Foam FatalErrorIn("fileMonitorWatcher(const bool, const label)") << "You selected inotify but this file was compiled" << " without FOAM_USE_INOTIFY" - << "Please select another fileModification test method" + << " Please select another fileModification test method" << exit(FatalError); #endif } From 1e0cf2f9600aad87b8b11ba832d794d5f8a8ac9a Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 24 Sep 2012 10:49:06 +0100 Subject: [PATCH 4/8] BUG: verticalChannel: U starting off with incompressible mode for potentialFoam --- .../verticalChannel/0.org/U | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U index 029e4cce0a..e3127719aa 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0.org/U @@ -32,15 +32,17 @@ boundaryField inletCentral { type flowRateInletVelocity; - //massFlowRate constant 0.00379; - volumetricFlowRate constant 0.00379; + massFlowRate constant 0.00379; + //volumetricFlowRate constant 0.00379; + rhoInlet 1.0; value uniform (0 14.68 0); } inletSides { type flowRateInletVelocity; - //massFlowRate constant 0.00832; - volumetricFlowRate constant 0.00832; + massFlowRate constant 0.00832; + //volumetricFlowRate constant 0.00832; + rhoInlet 1.0; value uniform (0 17.79 0); } outlet From 93fe2b5f432867b7558f3a1716754d5df6574a3c Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 24 Sep 2012 10:51:57 +0100 Subject: [PATCH 5/8] ENH: verticalChannel: no need for Allrun --- .../LTSReactingParcelFoam/verticalChannel/Allrun | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100755 tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/Allrun diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/Allrun b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/Allrun deleted file mode 100755 index 3aa141a08b..0000000000 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/Allrun +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# create mesh -runApplication blockMesh - -# run the solver -runApplication `getApplication` - -# ----------------------------------------------------------------- end-of-file From e1b6dfa6ebe2f1a391459c567f4ff590c2334d8c Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 24 Sep 2012 12:00:52 +0100 Subject: [PATCH 6/8] ENH: flowRateVelocityInlet: fall back to rhoInlet --- .../flowRateInletVelocityFvPatchVectorField.C | 37 +++++++++++++------ .../flowRateInletVelocityFvPatchVectorField.H | 7 ++-- .../verticalChannel/0.org/U | 8 +--- .../reactingParcelFoam/verticalChannel/Allrun | 3 -- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 9b72859c9d..f5cd4413b1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -72,7 +72,7 @@ flowRateInletVelocityFvPatchVectorField ) : fixedValueFvPatchField(p, iF), - rhoInlet_(0.0) + rhoInlet_(dict.lookupOrDefault("rhoInlet", -VGREAT)) { if (dict.found("volumetricFlowRate")) { @@ -107,14 +107,9 @@ flowRateInletVelocityFvPatchVectorField vectorField("value", dict, p.size()) ); } - else if (volumetric_) - { - evaluate(Pstream::blocking); - } else { - rhoInlet_ = readScalar(dict.lookup("rhoInlet")); - updateCoeffs(rhoInlet_); + evaluate(Pstream::blocking); } } @@ -202,10 +197,30 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() else { // mass flow-rate - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + if + ( + patch().boundaryMesh().mesh().foundObject(rhoName_) + ) + { + const fvPatchField& rhop = + patch().lookupPatchField(rhoName_); - operator==(n*avgU/rhop); + operator==(n*avgU/rhop); + } + else + { + // Use constant density + if (rhoInlet_ < 0) + { + FatalErrorIn + ( + "flowRateInletVelocityFvPatchVectorField::updateCoeffs()" + ) << "Did not find registered density field " << rhoName_ + << " and no constant density 'rhoInlet' specified" + << exit(FatalError); + } + operator==(n*avgU/rhoInlet_); + } } fixedValueFvPatchField::updateCoeffs(); @@ -219,7 +234,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const if (!volumetric_) { writeEntryIfDifferent(os, "rho", "rho", rhoName_); - os.writeKeyword("rhoInlet") << rhoInlet_ << token::END_STATEMENT << nl; + writeEntryIfDifferent(os, "rhoInlet", -VGREAT, rhoInlet_); } writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index 192e14b7d1..1a5d2f493d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -29,7 +29,7 @@ Description magnitude as an integral over its area. Either specify 'volumetricFlowRate' or 'massFlowRate' (requires additional - 'rho' entry). + 'rho' or 'rhoInlet' entry). Example of the boundary condition specification: \verbatim @@ -44,9 +44,10 @@ Description inlet { type flowRateInletVelocity; - volumetricFlowRate 0.2; // mass flow rate [kg/s] + massFlowRate 0.2; // mass flow rate [kg/s] rho rho; // rho [m3/s or kg/s] - value uniform (0 0 0); // placeholder + rhoInlet 1.0 // uniform rho if no rho field registered + // (e.g. at startup) } \endverbatim diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/0.org/U b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/0.org/U index e3127719aa..a403d36428 100644 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/0.org/U +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/0.org/U @@ -33,17 +33,13 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.00379; - //volumetricFlowRate constant 0.00379; - rhoInlet 1.0; - value uniform (0 14.68 0); + rhoInlet 1.0; // fallback value for e.g. potentialFoam } inletSides { type flowRateInletVelocity; massFlowRate constant 0.00832; - //volumetricFlowRate constant 0.00832; - rhoInlet 1.0; - value uniform (0 17.79 0); + rhoInlet 1.0; // fallback value for e.g. potentialFoam } outlet { diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun index babec860ab..4fe0655e63 100755 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun @@ -14,9 +14,6 @@ runApplication potentialFoam rm -f 0/phi -# change flowRateInletVelocity to massFlowRate -runApplication changeDictionary - # run the solver runApplication `getApplication` From 2132e8b1e2f3968264673b24b6094e989e5f8a57 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 24 Sep 2012 12:49:13 +0100 Subject: [PATCH 7/8] BUG: iglooWithFridges: missing constraint type setup --- .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p | 3 +++ .../buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh | 3 +++ 9 files changed, 27 insertions(+) diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T index 9258abe4ff..dd74be1133 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/T @@ -20,6 +20,9 @@ internalField uniform 265; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type fixedValue; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U index 2ff6e8ed59..f1a91fe971 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/U @@ -20,6 +20,9 @@ internalField uniform (0 0 0); boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type fixedValue; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat index 7cb2dd1fde..aefa32d852 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/alphat @@ -21,6 +21,9 @@ internalField uniform 0; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type alphatWallFunction; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon index 0fa9bf60f2..b75802e0e8 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/epsilon @@ -21,6 +21,9 @@ internalField uniform 0.01; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type epsilonWallFunction; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k index a6ee8bf7dd..04edc9d0d7 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/k @@ -21,6 +21,9 @@ internalField uniform 0.1; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type kqRWallFunction; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat index 7209416f4a..5c82ad4a55 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/kappat @@ -21,6 +21,9 @@ internalField uniform 0; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type kappatJayatillekeWallFunction; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut index 06abd5dc3a..b8dae4d50f 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut @@ -21,6 +21,9 @@ internalField uniform 0; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type nutkWallFunction; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p index f9f45682d5..19bfa3d347 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p @@ -20,6 +20,9 @@ internalField uniform 0; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type calculated; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh index eb39e94eab..e39f2ab7ce 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/p_rgh @@ -20,6 +20,9 @@ internalField uniform 0; boundaryField { + //- Set patchGroups for constraint patches + #include "${WM_PROJECT_DIR}/etc/caseDicts/setConstraintTypes" + ground { type fixedFluxPressure; From fa443cb65f9d66328ecabaeb845f33e555e16e9c Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 24 Sep 2012 12:49:59 +0100 Subject: [PATCH 8/8] GIT: boundary: derived file --- .../constant/polyMesh/boundary | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary deleted file mode 100644 index 911d0d6aa0..0000000000 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/boundary +++ /dev/null @@ -1,63 +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 polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( - maxY - { - type symmetryPlane; - inGroups 1(symmetryPlane); - nFaces 400; - startFace 22800; - } - minX - { - type symmetryPlane; - inGroups 1(symmetryPlane); - nFaces 400; - startFace 23200; - } - maxX - { - type symmetryPlane; - inGroups 1(symmetryPlane); - nFaces 400; - startFace 23600; - } - minY - { - type symmetryPlane; - inGroups 1(symmetryPlane); - nFaces 400; - startFace 24000; - } - ground - { - type wall; - nFaces 400; - startFace 24400; - } - maxZ - { - type symmetryPlane; - inGroups 1(symmetryPlane); - nFaces 400; - startFace 24800; - } -) - -// ************************************************************************* //