diff --git a/.gitignore b/.gitignore index a897b8121d..92f3a658f9 100644 --- a/.gitignore +++ b/.gitignore @@ -75,9 +75,10 @@ doc/Doxygen/DTAGS # Ignore .tags in the main directory /.tags -# Ignore eclipse project files in the main directory +# Ignore project files in the main directory /.cproject /.project +/.dir-locals.el # Ignore the test directory /tutorialsTest diff --git a/applications/Allwmake b/applications/Allwmake index 14ba388bf1..d851254b23 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -17,10 +17,7 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || { exit 1 } -set -x - wmake -all $targetType solvers wmake -all $targetType utilities - #------------------------------------------------------------------------------ diff --git a/applications/solvers/combustion/chemFoam/createFields.H b/applications/solvers/combustion/chemFoam/createFields.H index 62be3ce0dd..8b35089fc8 100644 --- a/applications/solvers/combustion/chemFoam/createFields.H +++ b/applications/solvers/combustion/chemFoam/createFields.H @@ -12,7 +12,7 @@ ( "initialConditions", runTime.constant(), - runTime, + mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) @@ -37,7 +37,7 @@ ( "rho", runTime.timeName(), - runTime, + mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), @@ -50,7 +50,7 @@ ( "Rspecific", runTime.timeName(), - runTime, + mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), @@ -69,7 +69,7 @@ ( "U", runTime.timeName(), - runTime, + mesh, IOobject::NO_READ, IOobject::NO_WRITE ), diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean index 34bab5c449..787221b83c 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwclean +++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso BCs wclean diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 8595a53d01..5dee7d1a88 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x (wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam) diff --git a/applications/solvers/lagrangian/DPMFoam/Allwclean b/applications/solvers/lagrangian/DPMFoam/Allwclean index 6d736b2373..158a56c8f3 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwclean +++ b/applications/solvers/lagrangian/DPMFoam/Allwclean @@ -1,7 +1,6 @@ #!/bin/sh cd ${0%/*} || exit 1 -set -x wclean libso DPMTurbulenceModels wclean diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake index 9f702db886..1f021bfc2f 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwmake +++ b/applications/solvers/lagrangian/DPMFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType DPMTurbulenceModels diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index 0e26512420..deb5e2378b 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso twoPhaseMixtureThermo wclean diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index 6542a62356..20da00c472 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType twoPhaseMixtureThermo diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean index 628a70b516..657fd9d242 100755 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso multiphaseMixtureThermo wclean diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake index 2a3c534c30..b92d87aef4 100755 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType multiphaseMixtureThermo wmake $targetType diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwclean b/applications/solvers/multiphase/driftFluxFoam/Allwclean index dcdca8527f..e3d46596be 100755 --- a/applications/solvers/multiphase/driftFluxFoam/Allwclean +++ b/applications/solvers/multiphase/driftFluxFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso mixtureViscosityModels wclean libso relativeVelocityModels diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwmake b/applications/solvers/multiphase/driftFluxFoam/Allwmake index e4af29196a..069235819e 100755 --- a/applications/solvers/multiphase/driftFluxFoam/Allwmake +++ b/applications/solvers/multiphase/driftFluxFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType mixtureViscosityModels wmake $targetType relativeVelocityModels diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index c8e3bb3721..b6e7fbae00 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -24,6 +24,9 @@ License \*---------------------------------------------------------------------------*/ #include "relativeVelocityModel.H" +#include "fixedValueFvPatchFields.H" +#include "slipFvPatchFields.H" +#include "partialSlipFvPatchFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,6 +36,34 @@ namespace Foam defineRunTimeSelectionTable(relativeVelocityModel, dictionary); } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const +{ + const volVectorField& U = mixture_.U(); + + wordList UdmTypes + ( + U.boundaryField().size(), + calculatedFvPatchScalarField::typeName + ); + + forAll(U.boundaryField(), i) + { + if + ( + isA(U.boundaryField()[i]) + || isA(U.boundaryField()[i]) + || isA(U.boundaryField()[i]) + ) + { + UdmTypes[i] = fixedValueFvPatchVectorField::typeName; + } + } + + return UdmTypes; +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -55,11 +86,12 @@ Foam::relativeVelocityModel::relativeVelocityModel "Udm", alphac_.time().timeName(), alphac_.mesh(), - IOobject::NO_READ, + IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), alphac_.mesh(), - dimensionedVector("Udm", dimVelocity, Zero) + dimensionedVector("Udm", dimVelocity, Zero), + UdmPatchFieldTypes() ) {} diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H index 475c87704e..420a7c3e8a 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,12 +52,16 @@ class relativeVelocityModel { // Private Member Functions + //- Return the list of patchFieldTypes for Udm derived from U + wordList UdmPatchFieldTypes() const; + //- Disallow default bitwise copy construct relativeVelocityModel(const relativeVelocityModel&); //- Disallow default bitwise assignment void operator=(const relativeVelocityModel&); + protected: // Protected data diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean b/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean index 8717ef8953..eaec8f77a1 100755 --- a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean +++ b/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso temperaturePhaseChangeTwoPhaseMixtures wclean diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean index bc351e27d8..573e235fdc 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso phaseChangeTwoPhaseMixtures wclean diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake index c0ac039a55..dfcde284ea 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType phaseChangeTwoPhaseMixtures wmake $targetType diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean index 6d174c19d9..727191ec35 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso multiphaseSystem wclean libso interfacialModels diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake index d81a6d71a8..d38522312d 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmakeLnInclude interfacialModels wmake $targetType multiphaseSystem diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean index 75d8939d31..9b5595f2a0 100755 --- a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean +++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso multiphaseMixture wclean diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake index 000e9f7743..50f78a705c 100755 --- a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType multiphaseMixture wmake $targetType diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/Allwclean index 5474c3349a..ad8f3f8faf 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso phaseSystems wclean libso interfacialModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake index f67d35aa29..87e6a81e3f 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmakeLnInclude interfacialModels wmakeLnInclude interfacialCompositionModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C index 6ca75c6ed4..b5dd4ab37a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C @@ -77,11 +77,39 @@ void Foam::AnisothermalPhaseModel::correctThermo() } +template +Foam::tmp +Foam::AnisothermalPhaseModel::filterPressureWork +( + const tmp& pressureWork +) const +{ + const volScalarField& alpha = *this; + + scalar pressureWorkAlphaLimit = + this->thermo_->lookupOrDefault("pressureWorkAlphaLimit", 0.0); + + if (pressureWorkAlphaLimit > 0) + { + return + ( + max(alpha - pressureWorkAlphaLimit, scalar(0)) + /max(alpha - pressureWorkAlphaLimit, pressureWorkAlphaLimit) + )*pressureWork; + } + else + { + return pressureWork; + } +} + + template Foam::tmp Foam::AnisothermalPhaseModel::heEqn() { const volScalarField& alpha = *this; + const volVectorField& U = this->U(); const surfaceScalarField& alphaPhi = this->alphaPhi(); const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi(); @@ -93,7 +121,8 @@ Foam::AnisothermalPhaseModel::heEqn() tmp tEEqn ( - fvm::ddt(alpha, this->rho(), he) + fvm::div(alphaRhoPhi, he) + fvm::ddt(alpha, this->rho(), he) + + fvm::div(alphaRhoPhi, he) - fvm::Sp(contErr, he) + fvc::ddt(alpha, this->rho(), K_) + fvc::div(alphaRhoPhi, K_) @@ -112,13 +141,15 @@ Foam::AnisothermalPhaseModel::heEqn() // Add the appropriate pressure-work term if (he.name() == this->thermo_->phasePropertyName("e")) { - tEEqn.ref() += - fvc::ddt(alpha)*this->thermo().p() - + fvc::div(alphaPhi, this->thermo().p()); + tEEqn.ref() += filterPressureWork + ( + fvc::div(fvc::absolute(alphaPhi, alpha, U), this->thermo().p()) + + this->thermo().p()*fvc::ddt(alpha) + ); } else if (this->thermo_->dpdt()) { - tEEqn.ref() -= alpha*this->fluid().dpdt(); + tEEqn.ref() -= filterPressureWork(alpha*this->fluid().dpdt()); } return tEEqn; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H index 7a9cbd51bf..86edbcd1f8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H @@ -58,6 +58,15 @@ class AnisothermalPhaseModel volScalarField K_; + // Private member functions + + //- Optionally filter the pressure work term as the phase-fraction -> 0 + tmp filterPressureWork + ( + const tmp& pressureWork + ) const; + + public: // Constructors diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C index 96a76de169..b15f2898b5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,12 @@ Foam::ReactingPhaseModel::ReactingPhaseModel BasePhaseModel(fluid, phaseName, index, false), reaction_ ( - ReactionType::New(fluid.mesh(), this->name()) + ReactionType::New + ( + fluid.mesh(), + combustionModel::combustionPropertiesName, + this->name() + ) ) { this->thermo_ = &reaction_->thermo(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean index 983c20bdc1..451b6672a9 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso multiphaseSystem wclean libso multiphaseCompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake index ea7fab7a82..05211a0039 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType multiphaseSystem wmake $targetType multiphaseCompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H index 0130a872c9..e4689efee6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H @@ -35,6 +35,7 @@ for (int Ecorr=0; Ecorr phiFs(phases.size()); // --- Pressure corrector loop while (pimple.correct()) { - // Update continuity errors due to temperature changes - fluid.correct(); - volScalarField rho("rho", fluid.rho()); // Correct p_rgh for consistency with p and the updated densities diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C index 9807a0ae20..55b6773862 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C @@ -77,11 +77,6 @@ int main(int argc, char *argv[]) //#include "pUf/createDDtU.H" - int nEnergyCorrectors - ( - pimple.dict().lookupOrDefault("nEnergyCorrectors", 1) - ); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -90,6 +85,11 @@ int main(int argc, char *argv[]) { #include "readTimeControls.H" + int nEnergyCorrectors + ( + pimple.dict().lookupOrDefault("nEnergyCorrectors", 1) + ); + if (LTS) { #include "setRDeltaT.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean index 59ec72ff10..2d0f2fde9e 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso twoPhaseSystem wclean libso twoPhaseCompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake index d151b361df..49c983288e 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType twoPhaseSystem wmake $targetType twoPhaseCompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H index 0cdbfba8b9..d9f1e85e6f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H @@ -29,36 +29,25 @@ for (int Ecorr=0; Ecorr E2eqn(phase2.heEqn()); + tmp E2Eqn(phase2.heEqn()); - if (E2eqn.valid()) + if (E2Eqn.valid()) { - E2eqn = + E2Eqn = ( - E2eqn + E2Eqn == *heatTransfer[phase2.name()] + alpha2*rho2*(U2&g) + fvOptions(alpha2, rho2, phase2.thermo().he()) ); - E2eqn->relax(); - fvOptions.constrain(E2eqn.ref()); - E2eqn->solve(); + E2Eqn->relax(); + fvOptions.constrain(E2Eqn.ref()); + E2Eqn->solve(); } } fluid.correctThermo(); + fluid.correct(); } - -Info<< phase1.name() << " min/max T " - << min(phase1.thermo().T()).value() - << " - " - << max(phase1.thermo().T()).value() - << endl; - -Info<< phase2.name() << " min/max T " - << min(phase2.thermo().T()).value() - << " - " - << max(phase2.thermo().T()).value() - << endl; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createRDeltaTf.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createRDeltaTf.H new file mode 100644 index 0000000000..5a4c77eacf --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createRDeltaTf.H @@ -0,0 +1,21 @@ +tmp trDeltaTf; + +if (LTS && faceMomentum) +{ + trDeltaTf = tmp + ( + new surfaceScalarField + ( + IOobject + ( + fv::localEulerDdt::rDeltaTfName, + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("one", dimless/dimTime, 1) + ) + ); +} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H index 9020cd6d5d..3b225202e9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H @@ -83,9 +83,6 @@ tmp phiF2; // --- Pressure corrector loop while (pimple.correct()) { - // Update continuity errors due to temperature changes - fluid.correct(); - volScalarField rho("rho", fluid.rho()); // Correct p_rgh for consistency with p and the updated densities diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H index 63b61cd61a..c7bccf66ea 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/DDtU.H @@ -1,9 +1,2 @@ - ddtPhi1 = - ( - (phi1 - phi1.oldTime())/runTime.deltaT() - ); - - ddtPhi2 = - ( - (phi2 - phi2.oldTime())/runTime.deltaT() - ); +ddtPhi1 = fvc::ddt(phi1); +ddtPhi2 = fvc::ddt(phi2); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H index 7445d4af23..14e66e47a8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/createDDtU.H @@ -1,9 +1,2 @@ - surfaceScalarField ddtPhi1 - ( - (phi1 - phi1.oldTime())/runTime.deltaT() - ); - - surfaceScalarField ddtPhi2 - ( - (phi2 - phi2.oldTime())/runTime.deltaT() - ); +surfaceScalarField ddtPhi1(fvc::ddt(phi1)); +surfaceScalarField ddtPhi2(fvc::ddt(phi2)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H index b27c9f4646..7950d76b94 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H @@ -32,10 +32,10 @@ surfaceScalarField rAUf1 IOobject::groupName("rAUf", phase1.name()), 1.0 /( - (alphaRhof10 + Vmf)/runTime.deltaT() + byDt(alphaRhof10 + Vmf) + fvc::interpolate(U1Eqn.A()) + Kdf - ) + ) ); surfaceScalarField rAUf2 @@ -43,10 +43,10 @@ surfaceScalarField rAUf2 IOobject::groupName("rAUf", phase2.name()), 1.0 /( - (alphaRhof20 + Vmf)/runTime.deltaT() + byDt(alphaRhof20 + Vmf) + fvc::interpolate(U2Eqn.A()) + Kdf - ) + ) ); @@ -93,9 +93,6 @@ tmp Ff2; while (pimple.correct()) { - // Update continuity errors due to temperature changes - fluid.correct(); - volScalarField rho("rho", fluid.rho()); // Correct p_rgh for consistency with p and the updated densities @@ -160,7 +157,7 @@ while (pimple.correct()) rAUf1 *( (alphaRhof10 + Vmf) - *MRF.absolute(phi1.oldTime())/runTime.deltaT() + *byDt(MRF.absolute(phi1.oldTime())) + fvc::flux(U1Eqn.H()) + Vmf*ddtPhi2 + Kdf*MRF.absolute(phi2) @@ -178,7 +175,7 @@ while (pimple.correct()) rAUf2 *( (alphaRhof20 + Vmf) - *MRF.absolute(phi2.oldTime())/runTime.deltaT() + *byDt(MRF.absolute(phi2.oldTime())) + fvc::flux(U2Eqn.H()) + Vmf*ddtPhi1 + Kdf*MRF.absolute(phi1) diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C index 40bcc365a0..f180257e9c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C @@ -43,6 +43,22 @@ Description #include "localEulerDdtScheme.H" #include "fvcSmooth.H" +namespace Foam +{ + tmp byDt(const surfaceScalarField& sf) + { + if (fv::localEulerDdt::enabled(sf.mesh())) + { + return fv::localEulerDdt::localRDeltaTf(sf.mesh())*sf; + } + else + { + return sf/sf.mesh().time().deltaT(); + } + } +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) @@ -76,13 +92,9 @@ int main(int argc, char *argv[]) ) ); + #include "createRDeltaTf.H" #include "pUf/createDDtU.H" - int nEnergyCorrectors - ( - pimple.dict().lookupOrDefault("nEnergyCorrectors", 1) - ); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -91,9 +103,18 @@ int main(int argc, char *argv[]) { #include "readTimeControls.H" + int nEnergyCorrectors + ( + pimple.dict().lookupOrDefault("nEnergyCorrectors", 1) + ); + if (LTS) { #include "setRDeltaT.H" + if (faceMomentum) + { + #include "setRDeltaTf.H" + } } else { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaTf.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaTf.H new file mode 100644 index 0000000000..1c0366dc3b --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaTf.H @@ -0,0 +1 @@ +trDeltaTf.ref() = fvc::interpolate(fv::localEulerDdt::localRDeltaT(mesh)); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H old mode 100755 new mode 100644 diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean index aec9873881..056bc90a3d 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso twoPhaseSystem wclean libso interfacialModels diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake index a73a5ce416..9eb3ae37c4 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmakeLnInclude interfacialModels wmake $targetType twoPhaseSystem diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H index 25b97c17a1..308e7589f9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/EEqns.H @@ -16,7 +16,8 @@ - contErr1*K1 + ( he1.name() == thermo1.phasePropertyName("e") - ? fvc::ddt(alpha1)*p + fvc::div(alphaPhi1, p) + ? fvc::div(fvc::absolute(alphaPhi1, alpha1, U1), p) + + p*fvc::ddt(alpha1) : -alpha1*dpdt ) @@ -48,7 +49,8 @@ - contErr2*K2 + ( he2.name() == thermo2.phasePropertyName("e") - ? fvc::ddt(alpha2)*p + fvc::div(alphaPhi2, p) + ? fvc::div(fvc::absolute(alphaPhi2, alpha2, U2), p) + + p*fvc::ddt(alpha1) : -alpha2*dpdt ) diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C index eedb89cc55..f5522c7509 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C @@ -248,4 +248,30 @@ bool Foam::phaseModel::read(const dictionary& phaseProperties) } +void Foam::phaseModel::correctInflowFlux(surfaceScalarField& alphaPhi) const +{ + surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef(); + + // Ensure that the flux at inflow BCs is preserved + forAll(alphaPhiBf, patchi) + { + fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi]; + + if (!alphaPhip.coupled()) + { + const scalarField& phip = phi().boundaryField()[patchi]; + const scalarField& alphap = boundaryField()[patchi]; + + forAll(alphaPhip, facei) + { + if (phip[facei] < SMALL) + { + alphaPhip[facei] = alphap[facei]*phip[facei]; + } + } + } + } +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H index 5fb0245513..a5ae107c90 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H @@ -319,6 +319,9 @@ public: return alphaRhoPhi_; } + //- Ensure that the flux at inflow BCs is preserved + void correctInflowFlux(surfaceScalarField& alphaPhi) const; + //- Correct the phase properties // other than the thermodynamics and turbulence // which have special treatment diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index 7c2323a030..808fe255f9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -444,28 +444,7 @@ void Foam::twoPhaseSystem::solve() ) ); - surfaceScalarField::Boundary& alphaPhic1Bf = - alphaPhic1.boundaryFieldRef(); - - // Ensure that the flux at inflow BCs is preserved - forAll(alphaPhic1Bf, patchi) - { - fvsPatchScalarField& alphaPhic1p = alphaPhic1Bf[patchi]; - - if (!alphaPhic1p.coupled()) - { - const scalarField& phi1p = phi1.boundaryField()[patchi]; - const scalarField& alpha1p = alpha1.boundaryField()[patchi]; - - forAll(alphaPhic1p, facei) - { - if (phi1p[facei] < 0) - { - alphaPhic1p[facei] = alpha1p[facei]*phi1p[facei]; - } - } - } - } + phase1_.correctInflowFlux(alphaPhic1); if (nAlphaSubCycles > 1) { @@ -537,6 +516,7 @@ void Foam::twoPhaseSystem::solve() phase2_.alphaPhi() = phi_ - phase1_.alphaPhi(); alpha2 = scalar(1) - alpha1; + phase2_.correctInflowFlux(phase2_.alphaPhi()); phase2_.alphaRhoPhi() = fvc::interpolate(phase2_.rho())*phase2_.alphaPhi(); diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake index a7a614f5ca..6e64d2c834 100755 --- a/applications/utilities/mesh/conversion/Optional/Allwmake +++ b/applications/utilities/mesh/conversion/Optional/Allwmake @@ -11,7 +11,6 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/etc/config.sh/functions _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) -set -x # Build libccmio (.a|.so) $WM_THIRD_PARTY_DIR/makeCCMIO lib # libso diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwclean b/applications/utilities/mesh/generation/extrude2DMesh/Allwclean index 48a8fb0d12..71e45051ee 100755 --- a/applications/utilities/mesh/generation/extrude2DMesh/Allwclean +++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean libso extrude2DMesh wclean diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake index 37a2358c58..f8637ab7e5 100755 --- a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake +++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType extrude2DMesh wmake $targetType diff --git a/applications/utilities/mesh/generation/foamyMesh/Allwclean b/applications/utilities/mesh/generation/foamyMesh/Allwclean index 8fbad74784..725d20869d 100755 --- a/applications/utilities/mesh/generation/foamyMesh/Allwclean +++ b/applications/utilities/mesh/generation/foamyMesh/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x wclean conformalVoronoiMesh wclean conformalVoronoi2DMesh diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake index 280efe9bdf..c3f900341e 100755 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for compilation (at least for error catching) . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x if [ -d "${FASTDUALOCTREE_SRC_PATH}" ] then diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake index ce9bef7333..49aaea637e 100755 --- a/applications/utilities/mesh/manipulation/setSet/Allwmake +++ b/applications/utilities/mesh/manipulation/setSet/Allwmake @@ -11,7 +11,7 @@ unset COMP_FLAGS LINK_FLAGS # if [ -f /usr/include/readline/readline.h ] then - echo "Found -- enabling readline support." + echo " found -- enabling readline support." export COMP_FLAGS="-DHAS_READLINE" export LINK_FLAGS="-lreadline" fi diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSet.C b/applications/utilities/mesh/manipulation/topoSet/topoSet.C index d5e5358bf5..eb03d855f1 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSet.C +++ b/applications/utilities/mesh/manipulation/topoSet/topoSet.C @@ -36,9 +36,6 @@ Description #include "Time.H" #include "polyMesh.H" #include "topoSetSource.H" -#include "cellSet.H" -#include "faceSet.H" -#include "pointSet.H" #include "globalMeshData.H" #include "timeSelector.H" #include "IOobjectList.H" diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index e5b372e0c9..d4ea1bd2a3 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -342,8 +342,12 @@ FoamFile // // cellZoneSet // ~~~~~~~~~~~ -// (mirrors operations on a cellSet into a cellZone) +// Manipulates a cellZone (as well as a cellSet) +// Takes any cellSet source. The difference with a cellSet is +// - reads the cells from the cellZone, not the cellSet +// - write to the cellZone as well as the cellSet // +// For backwards compatibility: // // Select based on cellSet // source setToCellZone; // sourceInfo @@ -355,6 +359,9 @@ FoamFile // // faceZoneSet // ~~~~~~~~~~~ +// Manipulates a faceZone (as well as a faceSet). It can only be used +// with two special sources: +// // // Select based on faceSet without orientation // source setToFaceZone; // sourceInfo @@ -394,17 +401,19 @@ FoamFile // // pointZoneSet // ~~~~~~~~~~~~ -// (mirrors operations on a pointSet into a pointZone) +// Manipulates a pointZone (as well as a pointSet) +// Takes any pointSet source. The difference with a pointSet is +// - reads the cells from the pointZone, not the pointSet +// - write to the pointZone as well as the pointSet // +// For backwards compatibility: // // Select based on pointSet // source setToPointZone; // sourceInfo // { // set p0; // name of pointSet // } -// -// -// + actions ( @@ -465,6 +474,19 @@ actions option all; } } + + + // Example: create cellZone from geometric region + { + name c0; + type cellZoneSet; + action new; + source boxToCell; + sourceInfo + { + box (0.04 0 0)(0.06 100 100); + } + } ); // ************************************************************************* // diff --git a/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C b/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C index 7cd62abbdc..2528355e11 100644 --- a/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C +++ b/applications/utilities/miscellaneous/foamDictionary/foamDictionary.C @@ -57,6 +57,9 @@ Usage - \par -includes List the \c #include and \c #includeIfPresent files to standard output + - \par -disableFunctionEntries + Do not expand macros or directives (#include etc) + Example usage: - Change simulation to run for one timestep only: \verbatim @@ -97,6 +100,15 @@ Usage -entry boundaryField \endverbatim + - Change patch type: + \verbatim + foamDictionary constant/polyMesh/boundary \ + -entry entry0.fixedWalls.type -set patch + \endverbatim + This uses special parsing of Lists which stores these in the + dictionary with keyword 'entryDDD' where DDD is the position + in the dictionary (after ignoring the FoamFile entry). + \*---------------------------------------------------------------------------*/ #include "argList.H" @@ -271,6 +283,11 @@ int main(int argc, char *argv[]) "Read the specified dictionary file, expand the macros etc. and write " "the resulting dictionary to standard output" ); + argList::addBoolOption + ( + "disableFunctionEntries", + "Disable expansion of dictionary directives - #include, #codeStream etc" + ); argList args(argc, argv); @@ -281,6 +298,15 @@ int main(int argc, char *argv[]) Foam::functionEntries::includeEntry::log = true; } + const bool disableEntries = args.optionFound("disableFunctionEntries"); + if (disableEntries) + { + Info<< "Not expanding variables or dictionary directives" + << endl; + entry::disableFunctionEntries = true; + } + + fileName dictFileName(args[1]); autoPtr dictFile(new IFstream(dictFileName)); @@ -460,7 +486,7 @@ int main(int argc, char *argv[]) { FatalIOErrorInFunction(dictFile) << "Cannot find entry " << entryName - << exit(FatalError, 2); + << exit(FatalIOError, 2); } } } diff --git a/applications/utilities/miscellaneous/foamHelp/Allwmake b/applications/utilities/miscellaneous/foamHelp/Allwmake index 87d2293c26..c00e52a898 100755 --- a/applications/utilities/miscellaneous/foamHelp/Allwmake +++ b/applications/utilities/miscellaneous/foamHelp/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType helpTypes wmake $targetType diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake b/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake index 150ac3019a..81e0196f99 100755 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType foamToVTK wmake $targetType diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt index 7fb8a8170e..49e64bf76c 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt @@ -78,9 +78,9 @@ ENDIF() TARGET_LINK_LIBRARIES( PVFoamReader_SM LINK_PUBLIC - OpenFOAM - finiteVolume vtkPVFoam + finiteVolume + OpenFOAM ) #----------------------------------------------------------------------------- diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h index 2bdeaa6028..6ca0f3f7a5 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqPVFoamReaderPanel.h @@ -106,10 +106,6 @@ public: //- Construct from components pqPVFoamReaderPanel(pqProxy*, QWidget*); - - - //- Destructor - // virtual ~pqPVFoamReaderPanel(); }; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt index aa15cc4055..34c9353fe9 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt @@ -79,9 +79,9 @@ ENDIF() TARGET_LINK_LIBRARIES( PVblockMeshReader_SM LINK_PUBLIC - OpenFOAM - blockMesh vtkPVblockMesh + blockMesh + OpenFOAM ) #----------------------------------------------------------------------------- diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml index 3a80fe5136..28df8ae78b 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml @@ -30,16 +30,17 @@ - + - A simple way to cause a reader GUI modification. + Rescan for updated blockMeshDict. @@ -102,6 +103,7 @@ + diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx index 70b1489dd0..06f0db328d 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.cxx @@ -58,12 +58,30 @@ pqPVblockMeshReaderPanel::pqPVblockMeshReaderPanel : pqAutoGeneratedObjectPanel(proxy, p) { - // create first sublayout (at top of the panel) + // Create first sublayout (at top of the panel) QGridLayout *form = new QGridLayout(); this->PanelLayout->addLayout(form, 0, 0, 1, -1); vtkSMProperty* prop = 0; - // checkbox for showing point numbers + + // Refresh button for updating blocks + if ((prop = this->proxy()->GetProperty("UiRefresh")) != 0) + { + prop->SetImmediateUpdate(1); + QPushButton* refresh = new QPushButton("Refresh"); + refresh->setToolTip("Rescan for updated blockMeshDict."); + + form->addWidget(refresh, 0, 0, Qt::AlignLeft); + QObject::connect + ( + refresh, + SIGNAL(clicked()), + this, + SLOT(RefreshPressed()) + ); + } + + // Checkbox for showing point numbers if ((prop = this->proxy()->GetProperty("UiShowPointNumbers")) != 0) { prop->SetImmediateUpdate(true); @@ -97,7 +115,7 @@ void pqPVblockMeshReaderPanel::ShowPointNumbersToggled() this->proxy()->GetProperty("UiShowPointNumbers") )->SetElement(0, ShowPointNumbers_->isChecked()); - // update the active view + // Update the active view if (this->view()) { this->view()->render(); @@ -107,4 +125,19 @@ void pqPVblockMeshReaderPanel::ShowPointNumbersToggled() } +void pqPVblockMeshReaderPanel::RefreshPressed() +{ + // Update everything + vtkSMIntVectorProperty::SafeDownCast + ( + this->proxy()->GetProperty("UiRefresh") + )->Modified(); + + vtkSMSourceProxy::SafeDownCast(this->proxy())->UpdatePipeline(); + + // Render all views + pqApplicationCore::instance()->render(); +} + + // ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h index f6a8acf247..4c15bc374e 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqPVblockMeshReaderPanel.h @@ -67,6 +67,7 @@ class pqPVblockMeshReaderPanel protected slots: void ShowPointNumbersToggled(); + void RefreshPressed(); public: @@ -75,10 +76,6 @@ public: //- Construct from components pqPVblockMeshReaderPanel(pqProxy*, QWidget*); - - - //- Destructor - // virtual ~pqPVblockMeshReaderPanel(); }; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx index ce5b4a309a..6d559e7a33 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx @@ -60,7 +60,6 @@ vtkPVblockMeshReader::vtkPVblockMeshReader() foamData_ = nullptr; ShowPointNumbers = 1; - UpdateGUI = 0; BlockSelection = vtkDataArraySelection::New(); CurvedEdgesSelection = vtkDataArraySelection::New(); @@ -97,7 +96,7 @@ vtkPVblockMeshReader::~vtkPVblockMeshReader() if (foamData_) { - // remove point numbers + // Remove point numbers updatePointNumbersView(false); delete foamData_; } @@ -117,7 +116,6 @@ vtkPVblockMeshReader::~vtkPVblockMeshReader() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -// Do everything except set the output info int vtkPVblockMeshReader::RequestInformation ( vtkInformation* vtkNotUsed(request), @@ -158,23 +156,10 @@ int vtkPVblockMeshReader::RequestInformation foamData_->updateInfo(); } - // might need some other type of error handling - -// { -// vtkErrorMacro("could not find valid OpenFOAM blockMesh"); -// -// // delete foamData and flag it as fatal error -// delete foamData_; -// foamData_ = nullptr; -// return 0; -// } - - return 1; } -// Set the output info int vtkPVblockMeshReader::RequestData ( vtkInformation* vtkNotUsed(request), @@ -190,7 +175,7 @@ int vtkPVblockMeshReader::RequestData return 0; } - // catch previous error + // Catch previous error if (!foamData_) { vtkErrorMacro("Reader failed - perhaps no mesh?"); @@ -233,6 +218,19 @@ int vtkPVblockMeshReader::RequestData } +void vtkPVblockMeshReader::SetRefresh(int val) +{ + // Delete the current blockMesh to force re-read and update + if (foamData_) + { + updatePointNumbersView(false); + delete foamData_; + foamData_ = 0; + } + + Modified(); +} + void vtkPVblockMeshReader::SetShowPointNumbers(const int val) { @@ -248,7 +246,7 @@ void vtkPVblockMeshReader::updatePointNumbersView(const bool show) { pqApplicationCore* appCore = pqApplicationCore::instance(); - // need to check this, since our destructor calls this + // Need to check this, since our destructor calls this if (!appCore) { return; @@ -273,7 +271,7 @@ void vtkPVblockMeshReader::updatePointNumbersView(const bool show) ); } - // use refresh here? + // Use refresh here? } diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h index a08c85acb4..b160b7c035 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h @@ -77,10 +77,8 @@ public: vtkGetMacro(ShowPointNumbers, int); // Description: - // GUI update control - vtkSetMacro(UpdateGUI, int); - vtkGetMacro(UpdateGUI, int); - + // Refresh blockMesh from changes to blockMeshDict + virtual void SetRefresh(int); // Description: // Blocks selection list control @@ -158,9 +156,6 @@ private: //- Show Point Numbers int ShowPointNumbers; - //- Dummy variable/switch to invoke a reader update - int UpdateGUI; - vtkDataArraySelection* BlockSelection; vtkDataArraySelection* CurvedEdgesSelection; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C index a9932ffcc9..dd40c8e359 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C @@ -72,12 +72,17 @@ void Foam::vtkPVblockMesh::updateInfoBlocks arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() ); const blockMesh& blkMesh = *meshPtr_; + const int nBlocks = blkMesh.size(); for (int blockI = 0; blockI < nBlocks; ++blockI) { const blockDescriptor& blockDef = blkMesh[blockI]; - word partName = Foam::name(blockI); + // Display either blockI as a number or with its name + // (looked up from blockMeshDict) + OStringStream os; + blockDescriptor::write(os, blockI, blkMesh.meshDict()); + word partName(os.str()); // append the (optional) zone name if (!blockDef.zoneName().empty()) @@ -121,9 +126,10 @@ void Foam::vtkPVblockMesh::updateInfoEdges forAll(edges, edgeI) { OStringStream ostr; - - ostr<< edges[edgeI].start() << ":" << edges[edgeI].end() << " - " - << edges[edgeI].type(); + blockVertex::write(ostr, edges[edgeI].start(), blkMesh.meshDict()); + ostr<< ":"; + blockVertex::write(ostr, edges[edgeI].end(), blkMesh.meshDict()); + ostr << " - " << edges[edgeI].type(); // Add "beg:end - type" to GUI list arraySelection->AddArray(ostr.str().c_str()); @@ -352,7 +358,9 @@ void Foam::vtkPVblockMesh::updateFoamMesh() dictPath = dbPtr_().constant()/polyMesh::meshSubDir/dictName; } - IOdictionary meshDict + // Store dictionary since is used as database inside blockMesh class + // for names of vertices and blocks + IOdictionary* meshDictPtr = new IOdictionary ( IOobject ( @@ -360,11 +368,12 @@ void Foam::vtkPVblockMesh::updateFoamMesh() dbPtr_(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, - false + true ) ); + meshDictPtr->store(); - meshPtr_ = new blockMesh(meshDict, meshRegion_); + meshPtr_ = new blockMesh(*meshDictPtr, meshRegion_); } @@ -429,15 +438,22 @@ void Foam::vtkPVblockMesh::renderPointNumbers if (show && meshPtr_) { - const pointField& cornerPts = meshPtr_->vertices(); - const scalar scaleFactor = meshPtr_->scaleFactor(); + const blockMesh& blkMesh = *meshPtr_; + const pointField& cornerPts = blkMesh.vertices(); + const scalar scaleFactor = blkMesh.scaleFactor(); pointNumberTextActorsPtrs_.setSize(cornerPts.size()); forAll(cornerPts, pointi) { vtkTextActor* txt = vtkTextActor::New(); - txt->SetInput(Foam::name(pointi).c_str()); + // Display either pointi as a number or with its name + // (looked up from blockMeshDict) + { + OStringStream os; + blockVertex::write(os, pointi, blkMesh.meshDict()); + txt->SetInput(os.str().c_str()); + } // Set text properties vtkTextProperty* tprop = txt->GetTextProperty(); diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index e30d26d0ed..0510d50bb9 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.C @@ -384,24 +384,18 @@ public: int main(int argc, char *argv[]) { + #include "addDictOption.H" #include "addRegionOption.H" #include "setRootCase.H" #include "createTime.H" #include "createNamedMesh.H" - Info<< "Reading setFieldsDict\n" << endl; + const word dictName("setFieldsDict"); + #include "setSystemMeshDictionaryIO.H" - IOdictionary setFieldsDict - ( - IOobject - ( - "setFieldsDict", - runTime.system(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); + Info<< "Reading " << dictName << "\n" << endl; + + IOdictionary setFieldsDict(dictIO); if (setFieldsDict.found("defaultFieldValues")) { diff --git a/applications/utilities/preProcessing/wallFunctionTable/Allwmake b/applications/utilities/preProcessing/wallFunctionTable/Allwmake index 2aa17958a9..06612a9c67 100755 --- a/applications/utilities/preProcessing/wallFunctionTable/Allwmake +++ b/applications/utilities/preProcessing/wallFunctionTable/Allwmake @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x wmake $targetType tabulatedWallFunction wmake $targetType diff --git a/bin/foamTags b/bin/foamTags index aca6e45bc3..ec881c5eb5 100755 --- a/bin/foamTags +++ b/bin/foamTags @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -46,8 +46,7 @@ then exit 1 fi - -for cmd in etags ectags +for cmd in etags ctags-exuberant do type $cmd >/dev/null 2>&1 || { echo "${0##*/} cannot build tag files: '$cmd' command not found" @@ -55,29 +54,16 @@ do } done - cd $WM_PROJECT_DIR || exit 1 mkdir .tags 2>/dev/null - -etagsCmd="etags --declarations -l c++ -o .tags/etags -" -#etagsDefCmd="etags -l c++ -o .tags/etagsDef -" -#etagsDecCmd="etags --declarations -l c++ -o .tags/etagsDec -" - -etagsCmd="ectags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -" -etagsDefCmd="ectags -e --extra=+fq --file-scope=no -o .tags/etagsDef -L -" -etagsDecCmd="ectags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etagsDec -L -" - -ectagsDecCmd="ectags -o .tags/ectagsDec --file-scope=no --c-kinds=+p --excmd=n --extra=+fq --fields=+afiKmnsSzt -L -" +#etagsCmd="etags --declarations -l c++ -o .tags/etags -" +etagsCmd="ctags-exuberant -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -" find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsCmd -find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsDefCmd -find -H $WM_PROJECT_DIR \( -name "*.H" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsDecCmd -find -H $WM_PROJECT_DIR \( -name "*.H" -o -name lnInclude -prune -o -name Doxygen -prune \) | $ectagsDecCmd -gtags -i --gtagsconf bin/tools/gtagsrc .tags - -foamEbrowse +#gtags -i --gtagsconf bin/tools/gtagsrc .tags +#foamEbrowse #------------------------------------------------------------------------------ diff --git a/bin/tools/MakefileDirs b/bin/tools/MakefileDirs index 1a0c45ba2d..183c424bc4 100644 --- a/bin/tools/MakefileDirs +++ b/bin/tools/MakefileDirs @@ -1,8 +1,8 @@ -#-------------------------------*- makefile -*--------------------------------- +#----------------------------*- makefile-gmake -*------------------------------ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/bin/tools/foamLog.db b/bin/tools/foamLog.db index 08077630c8..ed9f55c5ab 100644 --- a/bin/tools/foamLog.db +++ b/bin/tools/foamLog.db @@ -36,8 +36,9 @@ contCumulative/time step continuity errors :/cumulative = minFu/min\(fu\) = /min(fu) = minFt/min\(ft\) = /min(ft) = -#- Execution time: +#- Timing: executionTime/ExecutionTime = /ExecutionTime = +clockTime/ClockTime = /ClockTime = #- Interface Courant no: IntCourantMax/Interface Courant Number /max: diff --git a/doc/Allwmake b/doc/Allwmake index ba28b7955f..f6684e337c 100755 --- a/doc/Allwmake +++ b/doc/Allwmake @@ -1,6 +1,5 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -set -x # fix permissions (NB: '+X' and not '+x'!) chmod a+rX $WM_PROJECT_DIR $WM_PROJECT_DIR/doc Doxygen diff --git a/doc/Doxygen/Allwmake b/doc/Doxygen/Allwmake index c065d2a925..8ca2ed256d 100755 --- a/doc/Doxygen/Allwmake +++ b/doc/Doxygen/Allwmake @@ -2,9 +2,9 @@ cd ${0%/*} || exit 1 # Run from this directory [ -d "$WM_PROJECT_DIR" ] || { - echo "Error: WM_PROJECT_DIR directory does not exist" - echo " Check the OpenFOAM entries in your dot-files and source them." - echo " WM_PROJECT_DIR=$WM_PROJECT_DIR" + echo " Error: WM_PROJECT_DIR directory does not exist" + echo " Check the OpenFOAM entries in your dot-files and source them." + echo " WM_PROJECT_DIR=$WM_PROJECT_DIR" exit 1 } @@ -58,7 +58,6 @@ do done #------------------------------------------------------------------------------ -set -x rm -rf latex man diff --git a/doc/tools/find-its b/doc/tools/find-its deleted file mode 100755 index 44c85130fb..0000000000 --- a/doc/tools/find-its +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# Script -# find-its -# -# Description -# Search for files with "it's" -# This contraction (== "it is") looks too much like "its" (possesive) -# and confuses non-native (and some native) English speakers. -# -#------------------------------------------------------------------------------ -set -x -cd $WM_PROJECT_DIR || exit 1 - -git grep -e "it's" - -#------------------------------------------------------------------------------ diff --git a/doc/tools/find-trailingspace b/doc/tools/find-trailingspace index a7bf8390f2..1dfcf1ed3e 100755 --- a/doc/tools/find-trailingspace +++ b/doc/tools/find-trailingspace @@ -7,7 +7,6 @@ # Search for files with trailing whitesapce # #------------------------------------------------------------------------------ -set -x cd $WM_PROJECT_DIR || exit 1 tab=$'\t' diff --git a/etc/bashrc b/etc/bashrc index c4fc2e21df..dd9b7807e2 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[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc +# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc export WM_COMPILER=Gcc unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH @@ -85,7 +85,7 @@ export WM_COMPILE_OPTION=Opt #- MPI implementation: # WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI -# | MPI | QSMPI | SGIMPI +# | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI export WM_MPLIB=SYSTEMOPENMPI #- Operating System: diff --git a/etc/caseDicts/postProcessing/fields/add b/etc/caseDicts/postProcessing/fields/add new file mode 100644 index 0000000000..3eea74aff9 --- /dev/null +++ b/etc/caseDicts/postProcessing/fields/add @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Web: www.OpenFOAM.org + \\/ M anipulation | +------------------------------------------------------------------------------- +Description + Add a list of fields. + +\*---------------------------------------------------------------------------*/ + +type add; +libs ("libfieldFunctionObjects.so"); + +fields (); + +executeControl writeTime; +writeControl writeTime; + +// ************************************************************************* // diff --git a/etc/caseDicts/postProcessing/fields/subtract b/etc/caseDicts/postProcessing/fields/subtract new file mode 100644 index 0000000000..6f9126cd7d --- /dev/null +++ b/etc/caseDicts/postProcessing/fields/subtract @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Web: www.OpenFOAM.org + \\/ M anipulation | +------------------------------------------------------------------------------- +Description + From the first field subtract the remaining fields in the list. + +\*---------------------------------------------------------------------------*/ + +type subtract; +libs ("libfieldFunctionObjects.so"); + +fields (); + +executeControl writeTime; +writeControl writeTime; + +// ************************************************************************* // diff --git a/etc/config.csh/paraview b/etc/config.csh/paraview index d768864f30..1f017c8e7d 100644 --- a/etc/config.csh/paraview +++ b/etc/config.csh/paraview @@ -58,6 +58,8 @@ set cmake_version=cmake-system #------------------------------------------------------------------------------ +if ( ! $?ParaView_DIR ) setenv ParaView_DIR + # Clean the PATH if ( ! $?ParaView_DIR ) setenv ParaView_DIR set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"` diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler index f49f285746..5777a1fa80 100644 --- a/etc/config.sh/compiler +++ b/etc/config.sh/compiler @@ -41,9 +41,6 @@ ThirdParty) Gcc | Gcc48) gcc_version=gcc-4.8.5 ;; - Gcc47) - gcc_version=gcc-4.7.4 - ;; Gcc49) gcc_version=gcc-4.9.3 ;; diff --git a/etc/controlDict b/etc/controlDict index 1334cc1bb1..26657f8745 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -888,7 +888,6 @@ DebugSwitches wallHeatTransfer 0; wallLayerCells 0; wallModel 0; - warnUnboundedGauss 1; waveTransmissive 0; wedge 0; weighted 0; diff --git a/etc/cshrc b/etc/cshrc index 759413c0c8..3d52b585a4 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -61,7 +61,7 @@ echo $FOAM_INST_DIR setenv WM_COMPILER_TYPE system #- Compiler: -# WM_COMPILER = Gcc | Gcc4[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc +# WM_COMPILER = Gcc | Gcc4[8-9] | Gcc5[1-4] | Gcc6[1-2] | Clang | Icc setenv WM_COMPILER Gcc setenv WM_COMPILER_ARCH # defined but empty unsetenv WM_COMPILER_LIB_ARCH @@ -86,7 +86,7 @@ setenv WM_COMPILE_OPTION Opt #- MPI implementation: # WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI -# | MPI | QSMPI | SGIMPI +# | MPI | FJMPI | QSMPI | SGIMPI | INTELMPI setenv WM_MPLIB SYSTEMOPENMPI #- Operating System: diff --git a/src/Allwmake b/src/Allwmake index 511c735a7e..96b82df71a 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -17,8 +17,6 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || { exit 1 } -set -x - # Update OpenFOAM version strings if required wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null diff --git a/src/ODE/ODESolvers/ODESolver/ODESolver.C b/src/ODE/ODESolvers/ODESolver/ODESolver.C index 3dce5378e3..69d8b5879c 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolver.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolver.C @@ -34,7 +34,7 @@ namespace Foam } -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // Foam::scalar Foam::ODESolver::normalizeError ( diff --git a/src/OSspecific/POSIX/Allwmake b/src/OSspecific/POSIX/Allwmake index bd5b6259b9..d932523c92 100755 --- a/src/OSspecific/POSIX/Allwmake +++ b/src/OSspecific/POSIX/Allwmake @@ -12,7 +12,7 @@ unset COMP_FLAGS LINK_FLAGS # if [ -f /usr/include/sys/inotify.h ] then - echo "Found -- enabling inotify for file monitoring." + echo " found -- enabling inotify for file monitoring." export COMP_FLAGS="-DFOAM_USE_INOTIFY" else unset COMP_FLAGS diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 5548e5f54f..790170941b 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -542,6 +542,22 @@ time_t Foam::lastModified(const fileName& name, const bool followLink) } +double Foam::highResLastModified(const fileName& name) +{ + fileStat fileStatus(name); + if (fileStatus.isValid()) + { + return + fileStatus.status().st_mtime + + 1e-9*fileStatus.status().st_atim.tv_nsec; + } + else + { + return 0; + } +} + + Foam::fileNameList Foam::readDir ( const fileName& directory, diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index d3f010f093..ff7deb7538 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.C @@ -126,7 +126,7 @@ namespace Foam // For stat //- From watch descriptor to modified time - DynamicList lastMod_; + DynamicList lastMod_; @@ -261,7 +261,7 @@ namespace Foam << abort(FatalError); } - lastMod_(watchFd) = lastModified(fName); + lastMod_(watchFd) = highResLastModified(fName); } return true; @@ -395,12 +395,12 @@ void Foam::fileMonitor::checkFiles() const { forAll(watcher_->lastMod_, watchFd) { - time_t oldTime = watcher_->lastMod_[watchFd]; + double oldTime = watcher_->lastMod_[watchFd]; if (oldTime != 0) { const fileName& fName = watchFile_[watchFd]; - time_t newTime = lastModified(fName); + double newTime = highResLastModified(fName); if (newTime == 0) { @@ -615,7 +615,7 @@ void Foam::fileMonitor::setUnmodified(const label watchFd) if (!useInotify_) { - watcher_->lastMod_[watchFd] = lastModified(watchFile_[watchFd]); + watcher_->lastMod_[watchFd] = highResLastModified(watchFile_[watchFd]); } } diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 7b9f07486b..b5c58d1729 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -39,6 +39,7 @@ $(ints)/lists/labelListIOList.C primitives/Scalar/doubleScalar/doubleScalar.C primitives/Scalar/floatScalar/floatScalar.C primitives/Scalar/scalar/scalar.C +primitives/Scalar/scalar/invIncGamma.C primitives/Scalar/lists/scalarList.C primitives/Scalar/lists/scalarIOList.C primitives/Scalar/lists/scalarListIOList.C @@ -187,6 +188,10 @@ dictionaryEntry = $(dictionary)/dictionaryEntry $(dictionaryEntry)/dictionaryEntry.C $(dictionaryEntry)/dictionaryEntryIO.C +dictionaryListEntry = $(dictionary)/dictionaryListEntry +$(dictionaryListEntry)/dictionaryListEntry.C +$(dictionaryListEntry)/dictionaryListEntryIO.C + functionEntries = $(dictionary)/functionEntries $(functionEntries)/calcEntry/calcEntry.C $(functionEntries)/codeStream/codeStream.C diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H index 0fb024f2d1..1d4c7d844f 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H @@ -119,7 +119,7 @@ private: // Static data - //- Relative peturbation tolerance. Determines when point is + //- Relative perturbation tolerance. Determines when point is // considered to be close to face/edge of bb of node. // The tolerance is relative to the bounding box of the smallest // node. diff --git a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C index d54b7fb390..60b390223c 100644 --- a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C +++ b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C @@ -25,7 +25,7 @@ License #include "DictionaryBase.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template void Foam::DictionaryBase::addEntries() diff --git a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.C b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.C index 24027496c7..1970653b5b 100644 --- a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.C +++ b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBaseIO.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,6 +62,4 @@ Foam::Ostream& Foam::operator<< } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index 609155d492..5ecf80de63 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -238,6 +238,7 @@ private: const label index ); + protected: // Protected data diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 5ddb36617b..6aa26c2f7b 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -80,7 +80,7 @@ const int Foam::Time::maxPrecision_(3 - log10(SMALL)); Foam::word Foam::Time::controlDictName("controlDict"); -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::Time::adjustDeltaT() { diff --git a/src/OpenFOAM/db/Time/Time.H b/src/OpenFOAM/db/Time/Time.H index 027288b193..d6869a208f 100644 --- a/src/OpenFOAM/db/Time/Time.H +++ b/src/OpenFOAM/db/Time/Time.H @@ -59,6 +59,7 @@ SourceFiles namespace Foam { + // Forward declaration of classes class argList; @@ -86,6 +87,7 @@ class Time //- The controlDict unwatchedIOdictionary controlDict_; + public: //- Write control options diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index fcd2255caf..ea449f50e6 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -46,6 +46,131 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +const Foam::entry* Foam::dictionary::lookupScopedSubEntryPtr +( + const word& keyword, + bool recursive, + bool patternMatch +) const +{ + string::size_type dotPos = keyword.find('.'); + + if (dotPos == string::npos) + { + // Non-scoped lookup + return lookupEntryPtr(keyword, recursive, patternMatch); + } + else + { + if (dotPos == 0) + { + // Starting with a '.'. Go up for every 2nd '.' found + + const dictionary* dictPtr = this; + + string::size_type begVar = dotPos + 1; + string::const_iterator iter = keyword.begin() + begVar; + string::size_type endVar = begVar; + while (iter != keyword.end() && *iter == '.') + { + ++iter; + ++endVar; + + // Go to parent + if (&dictPtr->parent_ == &dictionary::null) + { + FatalIOErrorInFunction + ( + *this + ) << "No parent of current dictionary" + << " when searching for " + << keyword.substr(begVar, keyword.size()-begVar) + << exit(FatalIOError); + } + dictPtr = &dictPtr->parent_; + } + + return dictPtr->lookupScopedSubEntryPtr + ( + keyword.substr(endVar), + false, + patternMatch + ); + } + else + { + // Extract the first word + word firstWord = keyword.substr(0, dotPos); + + const entry* entPtr = lookupScopedSubEntryPtr + ( + firstWord, + false, //recursive + patternMatch + ); + + if (!entPtr) + { + // Fall back to finding key with '.' so e.g. if keyword is + // a.b.c.d it would try + // a.b, a.b.c, a.b.c.d + + string::size_type nextDotPos = keyword.find + ( + '.', + dotPos+1 + ); + + while (true) + { + const entry* subEntPtr = lookupEntryPtr + ( + keyword.substr(0, nextDotPos), + false, //recursive, + patternMatch + ); + if (nextDotPos == string::npos) + { + // Parsed the whole word. Return entry or null. + return subEntPtr; + } + + if (subEntPtr && subEntPtr->isDict()) + { + return subEntPtr->dict().lookupScopedSubEntryPtr + ( + keyword.substr + ( + nextDotPos, + keyword.size()-nextDotPos + ), + false, + patternMatch + ); + } + + nextDotPos = keyword.find('.', nextDotPos+1); + } + } + + if (entPtr->isDict()) + { + return entPtr->dict().lookupScopedSubEntryPtr + ( + keyword.substr(dotPos, keyword.size()-dotPos), + false, + patternMatch + ); + } + else + { + return nullptr; + } + } + } +} + + bool Foam::dictionary::findInPatterns ( const bool patternMatch, @@ -473,7 +598,7 @@ const Foam::entry* Foam::dictionary::lookupScopedEntryPtr } // At top. Recurse to find entries - return dictPtr->lookupScopedEntryPtr + return dictPtr->lookupScopedSubEntryPtr ( keyword.substr(1, keyword.size()-1), false, @@ -482,93 +607,12 @@ const Foam::entry* Foam::dictionary::lookupScopedEntryPtr } else { - string::size_type dotPos = keyword.find('.'); - - if (dotPos == string::npos) - { - // Non-scoped lookup - return lookupEntryPtr(keyword, recursive, patternMatch); - } - else - { - if (dotPos == 0) - { - // Starting with a '.'. Go up for every 2nd '.' found - - const dictionary* dictPtr = this; - - string::size_type begVar = dotPos + 1; - string::const_iterator iter = keyword.begin() + begVar; - string::size_type endVar = begVar; - while - ( - iter != keyword.end() - && *iter == '.' - ) - { - ++iter; - ++endVar; - - // Go to parent - if (&dictPtr->parent_ == &dictionary::null) - { - FatalIOErrorInFunction - ( - *this - ) << "No parent of current dictionary" - << " when searching for " - << keyword.substr(begVar, keyword.size()-begVar) - << exit(FatalIOError); - } - dictPtr = &dictPtr->parent_; - } - - return dictPtr->lookupScopedEntryPtr - ( - keyword.substr(endVar), - false, - patternMatch - ); - } - else - { - // Extract the first word - word firstWord = keyword.substr(0, dotPos); - - const entry* entPtr = lookupScopedEntryPtr - ( - firstWord, - false, //recursive - patternMatch - ); - - if (!entPtr) - { - FatalIOErrorInFunction - ( - *this - ) << "keyword " << firstWord - << " is undefined in dictionary " - << name() << endl - << "Valid keywords are " << keys() - << exit(FatalIOError); - } - - if (entPtr->isDict()) - { - return entPtr->dict().lookupScopedEntryPtr - ( - keyword.substr(dotPos, keyword.size()-dotPos), - false, - patternMatch - ); - } - else - { - return nullptr; - } - } - } + return lookupScopedSubEntryPtr + ( + keyword, + recursive, + patternMatch + ); } } @@ -628,6 +672,21 @@ const Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword) const } +Foam::dictionary* Foam::dictionary::subDictPtr(const word& keyword) +{ + entry* entryPtr = lookupEntryPtr(keyword, false, true); + + if (entryPtr) + { + return &entryPtr->dict(); + } + else + { + return nullptr; + } +} + + const Foam::dictionary& Foam::dictionary::subDict(const word& keyword) const { const entry* entryPtr = lookupEntryPtr(keyword, false, true); diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 4a7c728437..6f03c6babc 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -161,6 +161,15 @@ class dictionary // Private Member Functions + //- Find and return an entry data stream pointer if present + // otherwise return nullptr. Allows scoping using '.' + const entry* lookupScopedSubEntryPtr + ( + const word&, + bool recursive, + bool patternMatch + ) const; + //- Search patterns table for exact match or regular expression match bool findInPatterns ( @@ -364,7 +373,8 @@ public: ) const; //- Find and return an entry data stream pointer if present - // otherwise return nullptr. Allows scoping using '.' + // otherwise return nullptr. Allows scoping using '.'. + // Special handling for ':' at start of keyword and '..'. const entry* lookupScopedEntryPtr ( const word&, @@ -379,6 +389,10 @@ public: // otherwise return nullptr. const dictionary* subDictPtr(const word&) const; + //- Find and return a sub-dictionary pointer if present + // otherwise return nullptr. + dictionary* subDictPtr(const word&); + //- Find and return a sub-dictionary const dictionary& subDict(const word&) const; diff --git a/src/mesh/blockMesh/block/block.C b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.C similarity index 63% rename from src/mesh/blockMesh/block/block.C rename to src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.C index 1722b0095e..055a55b59d 100644 --- a/src/mesh/blockMesh/block/block.C +++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,44 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "block.H" +#include "dictionaryListEntry.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::block::block +Foam::dictionaryListEntry::dictionaryListEntry ( - const pointField& vertices, - const blockEdgeList& edges, - const blockFaceList& faces, - Istream& is + const dictionary& parentDict, + const dictionaryListEntry& dictEnt ) : - blockDescriptor(vertices, edges, faces, is) -{ - createPoints(); - createBoundary(); -} - - -Foam::block::block(const blockDescriptor& blockDesc) -: - blockDescriptor(blockDesc) -{ - createPoints(); - createBoundary(); -} - - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -Foam::Ostream& Foam::operator<<(Ostream& os, const block& b) -{ - os << b.points() << nl - << b.cells() << nl - << b.boundaryPatches() << endl; - - return os; -} + dictionaryEntry(parentDict, dictEnt) +{} // ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H new file mode 100644 index 0000000000..762bfaad9b --- /dev/null +++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::dictionaryListEntry + +Description + Read/write List of dictionaries. + + The List entries get stored in a + dictionary which itself is stored in the parent dictionary with + keyword 'entryDDD' where DDD is the position in the parent dictionary. + The printing is again in List format - the keyword is only printed as + comment. Can be used to e.g. manipulate polyMesh/boundary files. + +SourceFiles + dictionaryListEntry.C + dictionaryListEntryIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dictionaryListEntry_H +#define dictionaryListEntry_H + +#include "dictionaryEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +class dictionaryListEntry; + +Ostream& operator<<(Ostream&, const dictionaryListEntry&); + + +/*---------------------------------------------------------------------------*\ + Class dictionaryListEntry Declaration +\*---------------------------------------------------------------------------*/ + +class dictionaryListEntry +: + public dictionaryEntry +{ + // Private Member Functions + + //- Returns size of dictionary without FoamFile + static label realSize(const dictionary&); + + //- Dissallow bitwise copy + dictionaryListEntry(const dictionary&); + + +public: + + // Constructors + + //- Construct from the parent dictionary and Istream + dictionaryListEntry(const dictionary& parentDict, Istream&); + + //- Construct as copy for the given parent dictionary + dictionaryListEntry + ( + const dictionary& parentDict, + const dictionaryListEntry& + ); + + autoPtr clone(const dictionary& parentDict) const + { + return autoPtr(new dictionaryListEntry(parentDict, *this)); + } + + + // Member functions + + //- Write + virtual void write(Ostream&) const; + + //- Return info proxy. + // Used to print token information to a stream + InfoProxy info() const + { + return *this; + } + + + // Ostream operator + + friend Ostream& operator<<(Ostream&, const dictionaryListEntry&); +}; + + +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C new file mode 100644 index 0000000000..7d31932e9a --- /dev/null +++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "dictionaryListEntry.H" +#include "keyType.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::label Foam::dictionaryListEntry::realSize(const dictionary& dict) +{ + if (dict.size() < 1 || dict.first()->keyword() != "FoamFile") + { + return dict.size(); + } + else + { + return dict.size() - 1; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dictionaryListEntry::dictionaryListEntry +( + const dictionary& parentDict, + Istream& is +) +: + dictionaryEntry + ( + word("entry" + Foam::name(realSize(parentDict))), + parentDict, + dictionary::null + ) +{ + token firstToken(is); + if (firstToken.isLabel()) + { + label s = firstToken.labelToken(); + + is.readBeginList("List"); + + for (label i=0; i or '(', found " + << firstToken.info() + << exit(FatalIOError); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::dictionaryListEntry::write(Ostream& os) const +{ + os << nl << indent << size() + << token::SPACE << "// " << keyword() << nl + << indent << token::BEGIN_LIST << incrIndent << nl; + + // Write contents + dictionary::write(os, false); + + // Write end delimiter + os << decrIndent << indent << token::END_LIST << nl; + + // Check state of IOstream + os.check("Ostream& operator<<(Ostream&, const dictionaryListEntry&)"); +} + + +// * * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryListEntry& de) +{ + de.write(os); + return os; +} + + +template<> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& ip +) +{ + const dictionaryListEntry& e = ip.t_; + + os << " dictionaryListEntry '" << e.keyword() << "'" << endl; + + return os; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/entry/entry.H b/src/OpenFOAM/db/dictionary/entry/entry.H index 00373cb8da..c37809927a 100644 --- a/src/OpenFOAM/db/dictionary/entry/entry.H +++ b/src/OpenFOAM/db/dictionary/entry/entry.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,6 +75,9 @@ class entry // Private Member Functions + //- Get the next valid keyword. Return true if is valid keyType. + static bool getKeyword(keyType&, token&, Istream&); + //- Get the next valid keyword otherwise return false static bool getKeyword(keyType&, Istream&); diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C index 48b539588b..2a10aee4b8 100644 --- a/src/OpenFOAM/db/dictionary/entry/entryIO.C +++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C @@ -23,21 +23,19 @@ License \*---------------------------------------------------------------------------*/ +#include "entry.H" #include "primitiveEntry.H" #include "dictionaryEntry.H" #include "functionEntry.H" #include "includeEntry.H" #include "inputModeEntry.H" #include "stringOps.H" +#include "dictionaryListEntry.H" -#include "IOstreams.H" +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -bool Foam::entry::getKeyword(keyType& keyword, Istream& is) +bool Foam::entry::getKeyword(keyType& keyword, token& keywordToken, Istream& is) { - token keywordToken; - // Read the next valid token discarding spurious ';'s do { @@ -65,25 +63,43 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is) keyword = keywordToken.stringToken(); return true; } - // If it is the end of the dictionary or file return false... - else if (keywordToken == token::END_BLOCK || is.eof()) + else { return false; } - // Otherwise the token is invalid +} + + +bool Foam::entry::getKeyword(keyType& keyword, Istream& is) +{ + token keywordToken; + bool ok = getKeyword(keyword, keywordToken, is); + + if (ok) + { + return true; + } else { - cerr<< "--> FOAM Warning : " << std::endl - << " From function " - << "entry::getKeyword(keyType&, Istream&)" << std::endl - << " in file " << __FILE__ - << " at line " << __LINE__ << std::endl - << " Reading " << is.name().c_str() << std::endl - << " found " << keywordToken << std::endl - << " expected either " << token::END_BLOCK << " or EOF" - << std::endl; - - return false; + // Do some more checking + if (keywordToken == token::END_BLOCK || is.eof()) + { + return false; + } + else + { + // Otherwise the token is invalid + cerr<< "--> FOAM Warning : " << std::endl + << " From function " + << "entry::getKeyword(keyType&, Istream&)" << std::endl + << " in file " << __FILE__ + << " at line " << __LINE__ << std::endl + << " Reading " << is.name().c_str() << std::endl + << " found " << keywordToken << std::endl + << " expected either " << token::END_BLOCK << " or EOF" + << std::endl; + return false; + } } } @@ -93,22 +109,68 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is) is.fatalCheck("entry::New(const dictionary& parentDict, Istream&)"); keyType keyword; + token keyToken; - // Get the next keyword and if invalid return false - if (!getKeyword(keyword, is)) + // Get the next keyword and if a valid keyword return true + bool valid = getKeyword(keyword, keyToken, is); + + if (!valid) { - return false; + // Do some more checking + if (keyToken == token::END_BLOCK || is.eof()) + { + return false; + } + else if + ( + keyToken.isLabel() + || (keyToken.isPunctuation() && keyToken.pToken() == token::BEGIN_LIST) + ) + { + is.putBack(keyToken); + return parentDict.add + ( + new dictionaryListEntry(parentDict, is), + false + ); + } + else + { + // Otherwise the token is invalid + cerr<< "--> FOAM Warning : " << std::endl + << " From function " + << "entry::getKeyword(keyType&, Istream&)" << std::endl + << " in file " << __FILE__ + << " at line " << __LINE__ << std::endl + << " Reading " << is.name().c_str() << std::endl + << " found " << keyToken << std::endl + << " expected either " << token::END_BLOCK << " or EOF" + << std::endl; + return false; + } } else // Keyword starts entry ... { - if - ( - !disableFunctionEntries - && keyword[0] == '#' - ) // ... Function entry + if (keyword[0] == '#') // ... Function entry { word functionName = keyword(1, keyword.size()-1); - return functionEntry::execute(functionName, parentDict, is); + if (disableFunctionEntries) + { + return parentDict.add + ( + new functionEntry + ( + keyword, + parentDict, + is + ), + false + ); + } + else + { + return functionEntry::execute(functionName, parentDict, is); + } } else if ( diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index a758de39a4..5837bd5773 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "functionEntry.H" +#include "IOstreams.H" +#include "ISstream.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,6 +47,34 @@ namespace Foam } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::token Foam::functionEntry::readLine(const word& key, Istream& is) +{ + string s; + dynamic_cast(is).getLine(s); + + return token(string(key+s), is.lineNumber()); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::functionEntry::functionEntry +( + const word& key, + const dictionary& dict, + Istream& is +) +: + primitiveEntry + ( + word(key+dict.name()+Foam::name(is.lineNumber())), + readLine(key, is) + ) +{} + + // * * * * * * * * * * * * Member Function Selectors * * * * * * * * * * * * // bool Foam::functionEntry::execute @@ -132,4 +162,17 @@ bool Foam::functionEntry::execute } +void Foam::functionEntry::write(Ostream& os) const +{ + // Contents should be single string token + const token& t = operator[](0); + const string& s = t.stringToken(); + + for (size_t i = 0; i < s.size(); i++) + { + os.write(s[i]); + } +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H index 8c67c54403..0c9bd6604e 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H @@ -48,13 +48,13 @@ SourceFiles #include "word.H" #include "memberFunctionSelectionTables.H" +#include "primitiveEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class primitiveEntry; class dictionary; /*---------------------------------------------------------------------------*\ @@ -62,9 +62,14 @@ class dictionary; \*---------------------------------------------------------------------------*/ class functionEntry +: + public primitiveEntry { // Private Member Functions + //- Read line as string token + static token readLine(const word& key, Istream& is); + //- Disallow default bitwise copy construct functionEntry(const functionEntry&); @@ -74,6 +79,12 @@ class functionEntry public: + // Constructors + + //- Construct from keyword, parent dictionary and Istream + functionEntry(const word&, const dictionary&, Istream&); + + // Member Function Selectors declareMemberFunctionSelectionTable @@ -119,6 +130,9 @@ public: primitiveEntry&, Istream& ); + + //- Write + virtual void write(Ostream&) const; }; diff --git a/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C b/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C index 5fcaf92d35..448a4f1dc7 100644 --- a/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C +++ b/src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C @@ -316,6 +316,8 @@ void Foam::codedBase::createLibrary } +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + void Foam::codedBase::updateLibrary ( const word& name @@ -388,7 +390,4 @@ Foam::codedBase::~codedBase() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - // ************************************************************************* // diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index 97d94cadfd..1cf46f877e 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -64,23 +64,24 @@ Description libs | Libraries containing implementation | yes | region | Name of region for multi-region cases | no | enabled | On/off switch | no | yes + log | Log information to standard output | no | yes timeStart| Start time | no | timeEnd | End time | no | - evaluateControl | See time controls below | no | timeStep - evaluateInterval | Steps between output | no | - writeControl | See time controls below | no | timeStep - writeInterval | Steps between output | no | + executeControl | See time controls below | no | timeStep + executeInterval | Steps between each execute phase | no | + writeControl | See time controls below | no | timeStep + writeInterval | Steps between each write phase | no | \endtable Time controls: \table Option | Description - timeStep | Execute/write every 'writeInterval' time-steps - writeTime | Execute/write every 'writeInterval' output times - adjustableRunTime | Execute/write every 'writeInterval' run time period - runTime | Execute/write every 'writeInterval' run time period - clockTime | Execute/write every 'writeInterval' clock time period - cpuTime | Execute/write every 'writeInterval' CPU time period + timeStep | Execute/write every 'Interval' time-steps + writeTime | Execute/write every 'Interval' output times + adjustableRunTime | Execute/write every 'Interval' run time period + runTime | Execute/write every 'Interval' run time period + clockTime | Execute/write every 'Interval' clock time period + cpuTime | Execute/write every 'Interval' CPU time period none | Execute/write every time-step \endtable @@ -91,6 +92,14 @@ Description libraries and the \c libs entry is used to specify which library should be loaded. + Each function object has two separate run phases: + + - The \c execute phase is meant to be used for updating calculations + or for management tasks. + - The \c write phase is meant for writing the calculated data to disk. + + For each phase the respective time controls are provided, as listed above. + Class Foam::functionObject diff --git a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C index 5c803a73df..0cddd5cc56 100644 --- a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C +++ b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObjectTemplates.C @@ -59,7 +59,7 @@ bool Foam::functionObjects::regionFunctionObject::store if (cacheable && fieldName == tfield().name()) { WarningInFunction - << "Cannot store cache-able field with the named used in the cache." + << "Cannot store cache-able field with the name used in the cache." << nl << " Either choose a different name or cache the field" << " and use the 'writeObjects' functionObject." diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index 724e1ef1da..5a6177c391 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -35,14 +35,14 @@ namespace Foam defineTypeNameAndDebug(regIOobject, 0); } -int Foam::regIOobject::fileModificationSkew +float Foam::regIOobject::fileModificationSkew ( - Foam::debug::optimisationSwitch("fileModificationSkew", 30) + Foam::debug::floatOptimisationSwitch("fileModificationSkew", 30) ); registerOptSwitch ( "fileModificationSkew", - int, + float, Foam::regIOobject::fileModificationSkew ); diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.H b/src/OpenFOAM/db/regIOobject/regIOobject.H index 718dd432d1..d345dc8602 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.H +++ b/src/OpenFOAM/db/regIOobject/regIOobject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,7 +130,7 @@ public: //- Runtime type information TypeName("regIOobject"); - static int fileModificationSkew; + static float fileModificationSkew; // Constructors diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H index 9696efeed2..ae8235eec3 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraint.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,6 +87,9 @@ public: //- Return the accumulated unconstrained directions. Directions // coded as first n rows of tensor. inline void unconstrainedDirections(label& n, tensor& vecs) const; + + //- Constrain a displacement + inline vector constrainDisplacement(const vector& disp) const; }; @@ -103,7 +106,7 @@ inline pointConstraint transform(const tensor& tt, const pointConstraint& v); //- contiguous template bool contiguous(); template<> -inline bool contiguous() {return true;} +inline bool contiguous() {return true;} diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H index 27aa1debf4..0a3d14d2dd 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointConstraint/pointConstraintI.H @@ -45,7 +45,7 @@ inline Foam::pointConstraint::pointConstraint(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::pointConstraint::applyConstraint(const vector& cd) +inline void Foam::pointConstraint::applyConstraint(const vector& cd) { if (first() == 0) { @@ -74,7 +74,7 @@ void Foam::pointConstraint::applyConstraint(const vector& cd) } -void Foam::pointConstraint::combine(const pointConstraint& pc) +inline void Foam::pointConstraint::combine(const pointConstraint& pc) { if (first() == 0) { @@ -115,7 +115,7 @@ void Foam::pointConstraint::combine(const pointConstraint& pc) } -Foam::tensor Foam::pointConstraint::constraintTransformation() const +inline Foam::tensor Foam::pointConstraint::constraintTransformation() const { if (first() == 0) { @@ -136,8 +136,11 @@ Foam::tensor Foam::pointConstraint::constraintTransformation() const } -void Foam::pointConstraint::unconstrainedDirections(label& n, tensor& tt) -const +inline void Foam::pointConstraint::unconstrainedDirections +( + label& n, + tensor& tt +) const { n = 3-first(); @@ -179,7 +182,36 @@ const } -void Foam::combineConstraintsEqOp::operator() +inline Foam::vector Foam::pointConstraint::constrainDisplacement +( + const vector& d +) const +{ + vector cd; + + if (first() == 0) + { + cd = d; + } + else if (first() == 1) + { + // Remove plane normal + cd = d-(d&second())*second(); + } + else if (first() == 2) + { + // Keep line direction only + cd = (d&second())*second(); + } + else + { + cd = Zero; + } + return cd; +} + + +inline void Foam::combineConstraintsEqOp::operator() ( pointConstraint& x, const pointConstraint& y @@ -189,7 +221,7 @@ void Foam::combineConstraintsEqOp::operator() } -Foam::pointConstraint Foam::transform +inline Foam::pointConstraint Foam::transform ( const tensor& tt, const pointConstraint& v diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 5ab9330972..f645a7ef35 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -909,8 +909,23 @@ void Foam::argList::parse << regIOobject::fileCheckTypesNames [ regIOobject::fileModificationChecking - ] - << endl; + ]; + if + ( + ( + regIOobject::fileModificationChecking + == regIOobject::timeStamp + ) + || ( + regIOobject::fileModificationChecking + == regIOobject::timeStampMaster + ) + ) + { + Info<< " (fileModificationSkew " + << regIOobject::fileModificationSkew << ")"; + } + Info<< endl; Info<< "allowSystemOperations : "; if (dynamicCode::allowSystemOperations) diff --git a/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H index d286493919..fa4850fb5a 100644 --- a/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H +++ b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,6 +52,9 @@ namespace mathematical const scalar twoPi(2*pi); const scalar piByTwo(0.5*pi); + //- Euler's constant + const scalar Eu(0.57721566490153286060651209); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace mathematical diff --git a/src/OpenFOAM/global/debug/debug.C b/src/OpenFOAM/global/debug/debug.C index 279be74090..bdf1698d07 100644 --- a/src/OpenFOAM/global/debug/debug.C +++ b/src/OpenFOAM/global/debug/debug.C @@ -190,6 +190,19 @@ int Foam::debug::optimisationSwitch(const char* name, const int defaultValue) } +float Foam::debug::floatOptimisationSwitch +( + const char* name, + const float defaultValue +) +{ + return optimisationSwitches().lookupOrAddDefault + ( + name, defaultValue, false, false + ); +} + + void Foam::debug::addDebugObject(const char* name, simpleRegIOobject* obj) { simpleObjectRegistryEntry* ptr = debugObjects().lookupPtr(name); diff --git a/src/OpenFOAM/global/debug/debug.H b/src/OpenFOAM/global/debug/debug.H index 4eeb8cbb53..190f73be30 100644 --- a/src/OpenFOAM/global/debug/debug.H +++ b/src/OpenFOAM/global/debug/debug.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,6 +74,13 @@ namespace debug //- Lookup optimisation switch or add default value. int optimisationSwitch(const char* name, const int defaultValue=0); + //- Lookup optimisation switch or add default value. + float floatOptimisationSwitch + ( + const char* name, + const float defaultValue=0 + ); + //- Internal function to lookup a sub-dictionary from controlDict. dictionary& switchSet(const char* subDictName, dictionary*& subDictPtr); diff --git a/src/OpenFOAM/include/OSspecific.H b/src/OpenFOAM/include/OSspecific.H index 8cf277cd70..4b47e34425 100644 --- a/src/OpenFOAM/include/OSspecific.H +++ b/src/OpenFOAM/include/OSspecific.H @@ -133,6 +133,9 @@ off_t fileSize(const fileName&, const bool followLink=true); //- Return time of last file modification time_t lastModified(const fileName&, const bool followLink=true); +//- Return time of last file modification +double highResLastModified(const fileName&); + //- Read a directory and return the entries as a string list fileNameList readDir ( diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.H b/src/OpenFOAM/matrices/Matrix/Matrix.H index 884979f3d8..cad1c85aa9 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.H +++ b/src/OpenFOAM/matrices/Matrix/Matrix.H @@ -298,7 +298,7 @@ public: mType& ); - // Write Matrix to Ostream. + //- Write Matrix to Ostream. friend Ostream& operator<< ( Ostream&, diff --git a/src/OpenFOAM/matrices/Matrix/MatrixIO.C b/src/OpenFOAM/matrices/Matrix/MatrixIO.C index b965bb37d7..fc315f4ca4 100644 --- a/src/OpenFOAM/matrices/Matrix/MatrixIO.C +++ b/src/OpenFOAM/matrices/Matrix/MatrixIO.C @@ -29,7 +29,7 @@ License #include "token.H" #include "contiguous.H" -// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template Foam::Matrix::Matrix(Istream& is) diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H index 543d16b848..6da53ea3ef 100644 --- a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H @@ -108,7 +108,7 @@ Type det(const SymmetricSquareMatrix&); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #include "SymmetricSquareMatrixI.H" +#include "SymmetricSquareMatrixI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 65898e9c13..21520669da 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -43,7 +43,7 @@ namespace Foam } -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::GAMGAgglomeration::compactLevels(const label nCreatedLevels) { diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C index ff7c0cddd5..f73bf0fbb6 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCGStab/PBiCGStab.C @@ -223,7 +223,7 @@ Foam::solverPerformance Foam::PBiCGStab::solve // --- Calculate omega from tA and sA // (cheaper than using zA with preconditioned tA) - omega = gSumProd(tA, sA)/tAtA; + omega = gSumProd(tA, sA, matrix().mesh().comm())/tAtA; // --- Update solution and residual for (label cell=0; cell::operator=(const tmp& t) } -//- Return the const reference of the non-const reference argument -template -inline const T& Const(T& t) -{ - return t; -} - - -//- Return the const reference of the non-const rvalue reference argument -template -inline const T& Const(T&& t) -{ - return t; -} - - // ************************************************************************* // diff --git a/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H b/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H index 75f66f44e8..00af03f852 100644 --- a/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H +++ b/src/OpenFOAM/memory/tmpNrc/tmpNrcI.H @@ -301,20 +301,4 @@ inline void Foam::tmpNrc::operator=(const tmpNrc& t) } -//- Return the const reference of the non-const reference argument -template -inline const T& Const(T& t) -{ - return t; -} - - -//- Return the const reference of the non-const rvalue reference argument -template -inline const T& Const(T&& t) -{ - return t; -} - - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H index 371d95a063..653da9c46d 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H +++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,6 +92,14 @@ public: const bool doCollapse = false ); + //- Construct from components + inline cellShape + ( + const word& model, + const labelList&, + const bool doCollapse = false + ); + //- Construct from Istream inline cellShape(Istream& is); diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H index 5120cd4dfa..42055e04c9 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H +++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeI.H @@ -25,6 +25,7 @@ License #include "Istream.H" #include "cell.H" +#include "cellModeller.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -51,6 +52,23 @@ inline Foam::cellShape::cellShape } +inline Foam::cellShape::cellShape +( + const word& model, + const labelList& l, + const bool doCollapse +) +: + labelList(l), + m(cellModeller::lookup(model)) +{ + if (doCollapse) + { + collapse(); + } +} + + inline Foam::cellShape::cellShape(Istream& is) { is >> *this; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C index a3f7b46897..8f4866269d 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.C @@ -33,11 +33,11 @@ License namespace Foam { -defineTypeNameAndDebug(mapDistributeBase, 0); + defineTypeNameAndDebug(mapDistributeBase, 0); } -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // Foam::List Foam::mapDistributeBase::schedule ( diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C index 3c8819d642..343461da42 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C @@ -51,7 +51,7 @@ namespace Foam } -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::coupledPolyPatch::writeOBJ(Ostream& os, const point& pt) { diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C index e59c5220be..5e5821b4a7 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C @@ -38,7 +38,8 @@ namespace Foam addToRunTimeSelectionTable(polyPatch, wedgePolyPatch, dictionary); } -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::wedgePolyPatch::calcGeometry(PstreamBuffers&) { diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C index 7e557268a6..9a6238c733 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C @@ -43,7 +43,8 @@ namespace Foam const char* const Foam::faceZone::labelsName = "faceLabels"; -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::faceZone::calcFaceZonePatch() const { diff --git a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H index 27db3cc56d..924a97db55 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H +++ b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,9 +79,6 @@ protected: // Protected Member Functions - //- Return a reference to the look-up map - const Map