From 4f736b5c419273ef906feac322b15365c888cfd7 Mon Sep 17 00:00:00 2001 From: sergio Date: Fri, 10 Feb 2017 11:40:15 -0800 Subject: [PATCH 01/10] temperatureCoupledBase: alphaAni set to none by default boundaryRadiationProperties: updating to new format dynamicMeshDict and snappyHexMeshDict in utorials/multiphase/interDyMFoam/RAS/motorBike to follow Mattijs Git lab id 381 --- .../temperatureCoupledBase.C | 2 +- .../constant/boundaryRadiationProperties | 19 +++++-------------- .../RAS/motorBike/constant/dynamicMeshDict | 2 +- .../RAS/motorBike/system/snappyHexMeshDict | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index be069684f3..8a7027a59c 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -78,7 +78,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase patch_(patch), method_(KMethodTypeNames_.read(dict.lookup("kappaMethod"))), kappaName_(dict.lookupOrDefault("kappa", "none")), - alphaAniName_(dict.lookupOrDefault("alphaAni","Anialpha")) + alphaAniName_(dict.lookupOrDefault("alphaAni","none")) {} diff --git a/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/boundaryRadiationProperties b/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/boundaryRadiationProperties index 20a028ae66..36db108b2d 100644 --- a/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/boundaryRadiationProperties +++ b/tutorials/combustion/fireFoam/LES/simplePMMApanel/constant/boundaryRadiationProperties @@ -9,25 +9,16 @@ FoamFile { version 2.0; format ascii; - class volScalarField; + class dictionary; + location "constant"; object boundaryRadiationProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField +".*" { - ".*" - { - type boundaryRadiation; - mode lookup; - emissivity uniform 1.0; - absorptivity uniform 0.0; - value uniform 0.0; - } + mode lookup; + emissivity 1.0; } // ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/RAS/motorBike/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/RAS/motorBike/constant/dynamicMeshDict index 444d610391..e8ee89cf0e 100644 --- a/tutorials/multiphase/interDyMFoam/RAS/motorBike/constant/dynamicMeshDict +++ b/tutorials/multiphase/interDyMFoam/RAS/motorBike/constant/dynamicMeshDict @@ -29,7 +29,7 @@ dynamicRefineFvMeshCoeffs // Have slower than 2:1 refinement nBufferLayers 1; // Refine cells only up to maxRefinement levels - maxRefinement 3; + maxRefinement 4; // Stop refinement if maxCells reached maxCells 2000000; // Flux field and corresponding velocity field. Fluxes on changed diff --git a/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/snappyHexMeshDict b/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/snappyHexMeshDict index 3dac7f631f..b7ce19ef33 100644 --- a/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/snappyHexMeshDict +++ b/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/snappyHexMeshDict @@ -38,7 +38,7 @@ geometry //// Optional: avoid patch-face merging. Allows mesh to be used for //// refinement/unrefinement -//mergePatchFaces off; // default on +mergePatchFaces on; // default on From 376912eff2e820418c86535bfdfc5ea872874d25 Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 14 Feb 2017 08:30:53 -0800 Subject: [PATCH 02/10] ENH: adding runTime selectable wallDist calculation to inverseDistanceDiffusivity --- .../inverseDistanceDiffusivity.C | 45 +++++-------------- .../inverseDistanceDiffusivity.H | 4 +- 2 files changed, 12 insertions(+), 37 deletions(-) diff --git a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C index 273e91e5de..d628d09563 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,7 @@ License #include "HashSet.H" #include "surfaceInterpolate.H" #include "zeroGradientFvPatchFields.H" +#include "wallDist.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -68,42 +69,18 @@ Foam::inverseDistanceDiffusivity::~inverseDistanceDiffusivity() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::inverseDistanceDiffusivity::y() const -{ - labelHashSet patchSet(mesh().boundaryMesh().patchSet(patchNames_)); - - if (patchSet.size()) - { - return tmp - ( - new scalarField(patchWave(mesh(), patchSet, false).distance()) - ); - } - else - { - return tmp(new scalarField(mesh().nCells(), 1.0)); - } -} - - void Foam::inverseDistanceDiffusivity::correct() { - volScalarField y_ - ( - IOobject + faceDiffusivity_ = + 1.0 + /fvc::interpolate ( - "y", - mesh().time().timeName(), - mesh() - ), - mesh(), - dimless, - zeroGradientFvPatchScalarField::typeName - ); - y_.primitiveFieldRef() = y(); - y_.correctBoundaryConditions(); - - faceDiffusivity_ = 1.0/fvc::interpolate(y_); + wallDist::New + ( + mesh(), + mesh().boundaryMesh().patchSet(patchNames_) + ).y() + ); } diff --git a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H index e5f6f3c9a5..05e5439479 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H +++ b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,8 +60,6 @@ class inverseDistanceDiffusivity // Private Member Functions - //- Return patch-cell-centre distance field - tmp y() const; //- Disallow default bitwise copy construct inverseDistanceDiffusivity(const inverseDistanceDiffusivity&); From 973cf0397dc392537c447523ddc3e2a5fd055bc3 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 16 Feb 2017 09:14:17 +0100 Subject: [PATCH 03/10] CONFIG: provide foamConfigurePaths -mpi option - makes it easier to switch between mpi implementations (eg, openmpi, intelmpi etc) - add comment about compiler setting for KNL --- bin/tools/foamConfigurePaths | 12 +++++++++++- etc/bashrc | 2 +- etc/cshrc | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/tools/foamConfigurePaths b/bin/tools/foamConfigurePaths index 442eaf83e1..98f7c55c94 100755 --- a/bin/tools/foamConfigurePaths +++ b/bin/tools/foamConfigurePaths @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -55,6 +55,7 @@ usage: ${0##*/} -metis-path dir specify 'METIS_ARCH_PATH' -paraview ver specify 'ParaView_VERSION' (eg, 5.0.1) -paraview-path dir specify 'ParaView_DIR' (eg, /opt/paraviewopenfoam3120) + -mpi name specify type for 'WM_MPLIB' (eg, FJMPI, INTELMPI, etc) -openmpi ver specify ThirdParty openmpi version for 'FOAM_MPI' -openmpi-system activate system openmpi -openmpi-third activate ThirdParty openmpi (using default version) @@ -338,6 +339,15 @@ do shift ;; + -mpi) + # Explicitly set WM_MPLIB=... + [ "$#" -ge 2 ] || die "'$1' option requires an argument" + replace etc/bashrc WM_MPLIB "$2" + optMpi=system + adjusted=true + shift + ;; + -openmpi) # Replace FOAM_MPI=openmpi-.. and set to use third-party # The edit is slightly fragile, but works diff --git a/etc/bashrc b/etc/bashrc index 3f5d04e83b..d9c253492b 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -61,7 +61,7 @@ export FOAM_INST_DIR export WM_COMPILER_TYPE=system #- Compiler: -# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc +# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc | IccKNL export WM_COMPILER=Gcc unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH diff --git a/etc/cshrc b/etc/cshrc index d5f315ee16..9928e0073f 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -60,7 +60,7 @@ setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | setenv WM_COMPILER_TYPE system #- Compiler: -# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc +# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc | IccKNL setenv WM_COMPILER Gcc setenv WM_COMPILER_ARCH # defined but empty unsetenv WM_COMPILER_LIB_ARCH From a37dffad4f6dbe57414bd0021f1bd4c54b0245a5 Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 20 Feb 2017 10:34:01 -0800 Subject: [PATCH 04/10] ENH:Delete 'not Implemented' function updateCoeffs() in slicedFvPatchField. ACMI patch is used with mesh.C() in isoSurface which uses slicedFvPatch. --- .../fvPatchFields/basic/sliced/slicedFvPatchField.C | 9 +-------- .../fvPatchFields/basic/sliced/slicedFvPatchField.H | 6 +----- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C index ba0dd92f09..74898ee00f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -159,13 +159,6 @@ Foam::tmp> Foam::slicedFvPatchField::snGrad() const } -template -void Foam::slicedFvPatchField::updateCoeffs() -{ - NotImplemented; -} - - template Foam::tmp> Foam::slicedFvPatchField::patchInternalField() const diff --git a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H index 75fe587197..5b29aa77b5 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -153,10 +153,6 @@ public: //- Return patch-normal gradient virtual tmp> snGrad() const; - //- Update the coefficients associated with the patch field - // Sets Updated to true - virtual void updateCoeffs(); - //- Return internal field next to patch as patch field virtual tmp> patchInternalField() const; From a3ff45d50afd5fef639a4c81bdc52ab0c9d931bd Mon Sep 17 00:00:00 2001 From: Prashant Date: Thu, 23 Feb 2017 11:33:29 +0530 Subject: [PATCH 05/10] Use subDict for changeDictionary, Fixes #409 --- .../chtMultiRegionFoam/externalSolarLoad/Allrun.pre | 2 +- .../createZeroDirectory/snappyMultiRegionHeater/Allrun | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre index a7367af14a..37a6301975 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun.pre @@ -21,7 +21,7 @@ done for i in air solid floor do - changeDictionary -region $i > log.changeDictionary.$i 2>&1 + runApplication -s $i changeDictionary -region $i -subDict dictionaryReplacement done # ----------------------------------------------------------------------------- diff --git a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allrun b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allrun index cd9d35d580..6b946fe298 100755 --- a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allrun +++ b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/Allrun @@ -15,8 +15,7 @@ runApplication splitMeshRegions -cellZones -overwrite for i in bottomAir topAir heater leftSolid rightSolid do - runApplication changeDictionary -region $i - mv log.changeDictionary log.changeDictionary.$i 2>&1 + runApplication -s $i changeDictionary -region $i -subDict dictionaryReplacement done runApplication decomposePar -allRegions From 09c9e1a89a2cfd6395367fb3dc75c74241dbaebc Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 27 Feb 2017 16:46:12 -0800 Subject: [PATCH 06/10] ENH: Adding skyCloudCoverFraction to SunLoadFairWeatherConditions mode in the solarCalculator. This scalar allows to introduce a factor for cloudy sky between 0 (clear) and 1 (fully cloudy) --- .../submodels/solarCalculator/solarCalculator.C | 11 ++++++++++- .../submodels/solarCalculator/solarCalculator.H | 8 ++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C index d887867658..dea53edd91 100644 --- a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C +++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.C @@ -206,6 +206,12 @@ void Foam::solarCalculator::init() } case mSunLoadFairWeatherConditions: { + dict_.readIfPresent + ( + "skyCloudCoverFraction", + skyCloudCoverFraction_ + ); + A_ = readScalar(dict_.lookup("A")); B_ = readScalar(dict_.lookup("B")); @@ -218,7 +224,9 @@ void Foam::solarCalculator::init() calculateBetaTetha(); } - directSolarRad_ = A_/exp(B_/sin(beta_)); + directSolarRad_ = + (1.0 - 0.75*pow(skyCloudCoverFraction_, 3.0)) + * A_/exp(B_/sin(beta_)); groundReflectivity_ = readScalar(dict_.lookup("groundReflectivity")); @@ -257,6 +265,7 @@ Foam::solarCalculator::solarCalculator B_(0.0), beta_(0.0), tetha_(0.0), + skyCloudCoverFraction_(0.0), Setrn_(0.0), SunPrime_(0.0), C_(readScalar(dict.lookup("C"))), diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H index 6d3b13c12b..ca7c7a3746 100644 --- a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H +++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,6 +52,7 @@ Description 2) SunLoadFairWeatherConditions: The solar fluxes are calculated following the Fair Weather Conditions Method from the ASHRAE Handbook. The entries are: + skyCloudCoverFraction: Fraction of sky covered by clouds (0-1) A : Apparent solar irradiation at air mass m = 0 B : Atmospheric extinction coefficient beta: Solar altitude (in degrees) above the horizontal. This @@ -61,7 +62,7 @@ Description In this model the flux is calculated as: - directSolarRad = A/exp(B/sin(beta)); + directSolarRad = skyCloudCoverFraction*A/exp(B/sin(beta)); 3) SunLoadTheoreticalMaximum: The entries are: Setrn @@ -158,6 +159,9 @@ private: scalar beta_; scalar tetha_; + //- Sky cloud cover fraction [0-1] + scalar skyCloudCoverFraction_; + //- Maximum theoretical direct solar load model parameters scalar Setrn_; From 62197e9ccdb1dddd55f458787bd69e37292972de Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 28 Feb 2017 10:35:55 -0800 Subject: [PATCH 07/10] ENH: Correcting coefficient description in solarCalculator.H header --- .../radiation/submodels/solarCalculator/solarCalculator.H | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H index ca7c7a3746..ecc67329d4 100644 --- a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H +++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H @@ -62,7 +62,8 @@ Description In this model the flux is calculated as: - directSolarRad = skyCloudCoverFraction*A/exp(B/sin(beta)); + directSolarRad = + (1 - skyCloudCoverFraction^3)*A/exp(B/sin(beta)); 3) SunLoadTheoreticalMaximum: The entries are: Setrn From 05de53d08673e3d3c88784dbc21676a70164ecd1 Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 28 Feb 2017 10:37:43 -0800 Subject: [PATCH 08/10] ENH: Minor modification to the description --- .../radiation/submodels/solarCalculator/solarCalculator.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H index ecc67329d4..9eeb5bfc4d 100644 --- a/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H +++ b/src/thermophysicalModels/radiation/submodels/solarCalculator/solarCalculator.H @@ -63,7 +63,7 @@ Description In this model the flux is calculated as: directSolarRad = - (1 - skyCloudCoverFraction^3)*A/exp(B/sin(beta)); + (1 - 0.75*skyCloudCoverFraction^3)*A/exp(B/sin(beta)); 3) SunLoadTheoreticalMaximum: The entries are: Setrn From 6253452dcfa2376e73aa288008a7b80fc8655bd0 Mon Sep 17 00:00:00 2001 From: Prashant Date: Thu, 2 Mar 2017 10:22:24 +0530 Subject: [PATCH 09/10] Fixes #416 --- .../solvers/scalarTransport/scalarTransport.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/functionObjects/solvers/scalarTransport/scalarTransport.C b/src/functionObjects/solvers/scalarTransport/scalarTransport.C index 641241b91e..ebee2bc436 100644 --- a/src/functionObjects/solvers/scalarTransport/scalarTransport.C +++ b/src/functionObjects/solvers/scalarTransport/scalarTransport.C @@ -277,13 +277,13 @@ bool Foam::functionObjects::scalarTransport::execute() const volScalarField& alpha = mesh_.lookupObject(phaseName_); - const surfaceScalarField& limitedPhiAlpa = + const surfaceScalarField& limitedPhiAlpha = mesh_.lookupObject(phasePhiCompressedName_); D *= pos(alpha - 0.99); - // Reset D dimensions consistent with limitedPhiAlpa - D.dimensions().reset(limitedPhiAlpa.dimensions()/dimLength); + // Reset D dimensions consistent with limitedPhiAlpha + D.dimensions().reset(limitedPhiAlpha.dimensions()/dimLength); // Solve tmp tTPhiUD; @@ -292,7 +292,7 @@ bool Foam::functionObjects::scalarTransport::execute() fvScalarMatrix sEqn ( fvm::ddt(s) - + fvm::div(limitedPhiAlpa, s, divScheme) + + fvm::div(limitedPhiAlpha, s, divScheme) - fvm::laplacian(D, s, laplacianScheme) == alpha*fvOptions_(s) From 215349aa69a1358050f5fba5645b5ffb8c064925 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 10 Mar 2017 13:05:35 +0100 Subject: [PATCH 10/10] BUG: in wordRe::operator=(const keyType&) - the regex was not being unset on assignment. - drop unused recompile() method as being dubious --- applications/test/wordRe/Test-wordRe.C | 4 ++-- src/OpenFOAM/primitives/strings/wordRe/wordRe.H | 7 ++----- src/OpenFOAM/primitives/strings/wordRe/wordReI.H | 15 ++++----------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/applications/test/wordRe/Test-wordRe.C b/applications/test/wordRe/Test-wordRe.C index e3fae58cc5..f5dfcda831 100644 --- a/applications/test/wordRe/Test-wordRe.C +++ b/applications/test/wordRe/Test-wordRe.C @@ -75,8 +75,8 @@ int main(int argc, char *argv[]) wre.info(Info) << " after DETECT" << endl; wre.uncompile(); wre.info(Info) << " uncompiled" << endl; - wre.recompile(); - wre.info(Info) << " recompiled" << endl; + wre.compile(); + wre.info(Info) << " re-compiled" << endl; wre.set("something .* value", wordRe::LITERAL); wre.info(Info) << " set as LITERAL" << endl; diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H index c5a0a3b95e..612b2c96ab 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H +++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H @@ -39,8 +39,8 @@ Description Note If the string contents are changed - eg, by the operator+=() or by - string::replace(), etc - it will be necessary to use compile() or - recompile() to synchronize the regular expression. + string::replace(), etc - it will be necessary to use compile() to + synchronize the regular expression. SourceFiles wordRe.C @@ -161,9 +161,6 @@ public: //- Possibly compile the regular expression, with greater control inline bool compile(const compOption) const; - //- Recompile an existing regular expression - inline bool recompile() const; - //- Frees precompiled regular expression, making wordRe a literal. // Optionally strips invalid word characters inline void uncompile(const bool doStripInvalid = false) const; diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H index d35a8134b7..093093e055 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H +++ b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H @@ -165,17 +165,6 @@ inline bool Foam::wordRe::compile() const } -inline bool Foam::wordRe::recompile() const -{ - if (re_.exists()) - { - re_ = *this; - } - - return re_.exists(); -} - - inline void Foam::wordRe::uncompile(const bool doStripInvalid) const { if (re_.clear()) @@ -265,6 +254,10 @@ inline void Foam::wordRe::operator=(const keyType& str) { compile(); } + else + { + re_.clear(); + } }