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/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/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(); + } } 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/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; 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) 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&); 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..9eeb5bfc4d 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,8 @@ Description In this model the flux is calculated as: - directSolarRad = A/exp(B/sin(beta)); + directSolarRad = + (1 - 0.75*skyCloudCoverFraction^3)*A/exp(B/sin(beta)); 3) SunLoadTheoreticalMaximum: The entries are: Setrn @@ -158,6 +160,9 @@ private: scalar beta_; scalar tetha_; + //- Sky cloud cover fraction [0-1] + scalar skyCloudCoverFraction_; + //- Maximum theoretical direct solar load model parameters scalar Setrn_; 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/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/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 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