diff --git a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H index 9f4d8368a8..20fd654cef 100644 --- a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H +++ b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H @@ -13,7 +13,7 @@ ); volVectorField force = - U/dimensionedScalar("dt", dimTime, runTime.deltaT().value()); + U/dimensionedScalar("dt", dimTime, runTime.deltaTValue()); Kmesh K(mesh); - UOprocess forceGen(K, runTime.deltaT().value(), turbulenceProperties); + UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties); diff --git a/applications/solvers/combustion/PDRFoam/StCourantNo.H b/applications/solvers/combustion/PDRFoam/StCourantNo.H index 18d6e86a94..5f3f3359fb 100644 --- a/applications/solvers/combustion/PDRFoam/StCourantNo.H +++ b/applications/solvers/combustion/PDRFoam/StCourantNo.H @@ -41,11 +41,11 @@ Description StCoNum = max(SfUfbyDelta/mesh.magSf()).value() - *runTime.deltaT().value(); + *runTime.deltaTValue(); meanStCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())).value() - *runTime.deltaT().value(); + *runTime.deltaTValue(); } Info<< "St courant Number mean: " << meanStCoNum diff --git a/applications/solvers/combustion/PDRFoam/setDeltaT.H b/applications/solvers/combustion/PDRFoam/setDeltaT.H index 7092e9779a..c40bc4a1d7 100644 --- a/applications/solvers/combustion/PDRFoam/setDeltaT.H +++ b/applications/solvers/combustion/PDRFoam/setDeltaT.H @@ -41,12 +41,12 @@ if (adjustTimeStep) ( min ( - deltaTFact*runTime.deltaT().value(), + deltaTFact*runTime.deltaTValue(), maxDeltaT ) ); - Info<< "deltaT = " << runTime.deltaT().value() << endl; + Info<< "deltaT = " << runTime.deltaTValue() << endl; } // ************************************************************************* // diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index d06ec2e5f0..2b9b50d124 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -40,7 +40,7 @@ if (ign.ignited()) ( mesh.surfaceInterpolation::deltaCoeffs() *mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf()) - ).value()*runTime.deltaT().value(); + ).value()*runTime.deltaTValue(); Info<< "Max St-Courant Number = " << StCoNum << endl; diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index eaf3219445..ce80690224 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -89,8 +89,8 @@ int main(int argc, char *argv[]) chemistry.solve ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() ); // turbulent time scale diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 63549b99a5..42d9534654 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -80,8 +80,8 @@ int main(int argc, char *argv[]) chemistry.solve ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() ); // turbulent time scale diff --git a/applications/solvers/combustion/reactingFoam/chemistry.H b/applications/solvers/combustion/reactingFoam/chemistry.H index d059bd9ed3..691b6dcb92 100644 --- a/applications/solvers/combustion/reactingFoam/chemistry.H +++ b/applications/solvers/combustion/reactingFoam/chemistry.H @@ -3,8 +3,8 @@ chemistry.solve ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() ); // turbulent time scale diff --git a/applications/solvers/combustion/rhoReactingFoam/chemistry.H b/applications/solvers/combustion/rhoReactingFoam/chemistry.H index d059bd9ed3..691b6dcb92 100644 --- a/applications/solvers/combustion/rhoReactingFoam/chemistry.H +++ b/applications/solvers/combustion/rhoReactingFoam/chemistry.H @@ -3,8 +3,8 @@ chemistry.solve ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() ); // turbulent time scale diff --git a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H index 33b4edc8a7..a0601fc1de 100644 --- a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H +++ b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H @@ -38,11 +38,11 @@ if (mesh.nInternalFaces()) surfaceScalarField amaxSfbyDelta = mesh.surfaceInterpolation::deltaCoeffs()*amaxSf; - CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaT().value(); + CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue(); meanCoNum = (sum(amaxSfbyDelta)/sum(mesh.magSf())).value() - *runTime.deltaT().value(); + *runTime.deltaTValue(); } Info<< "Mean and max Courant Numbers = " diff --git a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C b/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C index 0571ee5082..f06b13e5de 100644 --- a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C +++ b/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) ( mesh.surfaceInterpolation::deltaCoeffs() *mag(phiv)/mesh.magSf() - ).value()*runTime.deltaT().value(); + ).value()*runTime.deltaTValue(); Info<< "\nMax Courant Number = " << CoNum << endl; diff --git a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C b/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C index 3d71de6324..def72f426b 100644 --- a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C +++ b/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) ( mesh.surfaceInterpolation::deltaCoeffs() *mag(phiv)/mesh.magSf() - ).value()*runTime.deltaT().value(); + ).value()*runTime.deltaTValue(); Info<< "Max Courant Number = " << CoNum << endl; diff --git a/applications/solvers/electromagnetics/mhdFoam/magneticFieldErr.H b/applications/solvers/electromagnetics/mhdFoam/magneticFieldErr.H index a25c31e683..a9db2ea585 100644 --- a/applications/solvers/electromagnetics/mhdFoam/magneticFieldErr.H +++ b/applications/solvers/electromagnetics/mhdFoam/magneticFieldErr.H @@ -1,4 +1,4 @@ Info<< "magnetic flux divergence error = " - << runTime.deltaT().value() + << runTime.deltaTValue() *mag(fvc::div(phiB))().weightedAverage(mesh.V()).value() << endl; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C index a3d68f55ca..93e42ee0d5 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C @@ -47,10 +47,10 @@ Foam::scalar Foam::compressibleCourantNo / fvc::interpolate(rho); CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); } Info<< "Region: " << mesh.name() << " Courant Number mean: " << meanCoNum diff --git a/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H index 125f1b23b5..570a8b0993 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H +++ b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H @@ -42,10 +42,10 @@ if (mesh.nInternalFaces()) *mag(phi)/fvc::interpolate(h); CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); // Gravity wave Courant number waveCoNum = @@ -53,7 +53,7 @@ if (mesh.nInternalFaces()) ( mesh.surfaceInterpolation::deltaCoeffs() *sqrt(fvc::interpolate(h)) - ).value()*sqrt(magg).value()*runTime.deltaT().value(); + ).value()*sqrt(magg).value()*runTime.deltaTValue(); } Info<< "Courant number mean: " << meanCoNum diff --git a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H index 07b1e9953b..3a8a5c20f1 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H @@ -3,8 +3,8 @@ chemistry.solve ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() ); // turbulent time scale diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H index 07b1e9953b..3a8a5c20f1 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H @@ -3,8 +3,8 @@ chemistry.solve ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() ); // turbulent time scale diff --git a/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H index 07b1e9953b..3a8a5c20f1 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H @@ -3,8 +3,8 @@ chemistry.solve ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() ); // turbulent time scale diff --git a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H index ee96a897b4..a9d43535ec 100644 --- a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H +++ b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H @@ -40,15 +40,15 @@ if (mesh.nInternalFaces()) mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv); CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); acousticCoNum = max ( mesh.surfaceInterpolation::deltaCoeffs()/sqrt(fvc::interpolate(psi)) - ).value()*runTime.deltaT().value(); + ).value()*runTime.deltaTValue(); } Info<< "phiv Courant Number mean: " << meanCoNum diff --git a/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H b/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H index e531649a91..dd8f23464a 100644 --- a/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H +++ b/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H @@ -43,12 +43,12 @@ if (adjustTimeStep) ( min ( - deltaTFact*runTime.deltaT().value(), + deltaTFact*runTime.deltaTValue(), maxDeltaT ) ); - Info<< "deltaT = " << runTime.deltaT().value() << endl; + Info<< "deltaT = " << runTime.deltaTValue() << endl; } // ************************************************************************* // diff --git a/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H b/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H index 7ba881c45b..500c53b6f1 100644 --- a/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H +++ b/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H @@ -44,7 +44,7 @@ if (adjustTimeStep) ( min ( - maxDeltaTFact*runTime.deltaT().value(), + maxDeltaTFact*runTime.deltaTValue(), maxDeltaT ) ); diff --git a/applications/solvers/multiphase/settlingFoam/compressibleContinuityErrs.H b/applications/solvers/multiphase/settlingFoam/compressibleContinuityErrs.H index 428465ddd9..96e37e95fb 100644 --- a/applications/solvers/multiphase/settlingFoam/compressibleContinuityErrs.H +++ b/applications/solvers/multiphase/settlingFoam/compressibleContinuityErrs.H @@ -1,5 +1,5 @@ scalar sumLocalContErr = - runTime.deltaT().value()* + runTime.deltaTValue()* mag ( fvc::ddt(rho) @@ -7,7 +7,7 @@ )().weightedAverage(rho*mesh.V()).value(); scalar globalContErr = - runTime.deltaT().value()* + runTime.deltaTValue()* ( fvc::ddt(rho) + fvc::div(phi) diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H b/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H index 75dcd68c7f..f18461d66a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H @@ -5,7 +5,7 @@ ( mesh.surfaceInterpolation::deltaCoeffs()*mag(phia - phib) /mesh.magSf() - ).value()*runTime.deltaT().value(); + ).value()*runTime.deltaTValue(); Info<< "Max Ur Courant Number = " << UrCoNum << endl; diff --git a/applications/test/fieldDependency/Make/files b/applications/test/fieldDependency/Make/files new file mode 100644 index 0000000000..98fd335a17 --- /dev/null +++ b/applications/test/fieldDependency/Make/files @@ -0,0 +1,3 @@ +fieldDependency.C + +EXE = $(FOAM_USER_APPBIN)/fieldDependency diff --git a/applications/test/fieldDependency/Make/options b/applications/test/fieldDependency/Make/options new file mode 100644 index 0000000000..fa15f12452 --- /dev/null +++ b/applications/test/fieldDependency/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/applications/test/fieldDependency/fieldDependency.C b/applications/test/fieldDependency/fieldDependency.C new file mode 100644 index 0000000000..65812996ba --- /dev/null +++ b/applications/test/fieldDependency/fieldDependency.C @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Test field dependencies. + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "Time.H" +#include "volFields.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Main program: + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + + Info<< "Creating field T\n" << endl; + volScalarField T + ( + IOobject + ( + "T", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimless, 0) + ); + + Info<< "Creating field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimless, 0) + ); + + + Info<< "p.eventNo:" << p.eventNo() << endl; + Info<< "p.uptodate:" << p.upToDate(T)<< endl; + + // Change T and mark as uptodate. + Info<< "Changing T" << endl; + T = 0.0; + T.setUpToDate(); + Info<< "T.eventNo:" << T.eventNo() << endl; + + // Check p dependency: + Info<< "p.uptodate:" << p.upToDate(T)<< endl; + + // Change p and mark as uptodate. + Info<< "Changing p." << endl; + p.setUpToDate(); + Info<< "p.uptodate:" << p.upToDate(T)<< endl; + Info<< "p.eventNo:" << p.eventNo() << endl; + + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index 54fd1bdf4f..5e240daff1 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -53,7 +53,7 @@ Description #include "removePoints.H" #include "polyMesh.H" #include "mapPolyMesh.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" using namespace Foam; @@ -445,12 +445,12 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); scalar concaveAngle = defaultConcaveAngle; args.optionReadIfPresent("concaveAngle", concaveAngle); - scalar concaveSin = Foam::sin(concaveAngle*constant::mathematical::pi/180.0); + scalar concaveSin = Foam::sin(degToRad(concaveAngle)); bool snapMeshDict = args.optionFound("snapMesh"); bool overwrite = args.optionFound("overwrite"); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index c83ab27583..c916be8daa 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -49,7 +49,7 @@ Description #include "cellSet.H" #include "cellModeller.H" #include "meshCutter.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" #include "geomCellLooper.H" #include "plane.H" #include "edgeVertex.H" @@ -539,9 +539,8 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar radAngle = featureAngle*constant::mathematical::pi/180.0; - scalar minCos = Foam::cos(radAngle); - scalar minSin = Foam::sin(radAngle); + scalar minCos = Foam::cos(degToRad(featureAngle)); + scalar minSin = Foam::sin(degToRad(featureAngle)); bool readSet = args.optionFound("set"); bool geometry = args.optionFound("geometry"); diff --git a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C index 1da7ba049e..f76e4dae46 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C +++ b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C @@ -43,7 +43,7 @@ Description #include "symmetryPolyPatch.H" #include "wedgePolyPatch.H" #include "cyclicPolyPatch.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" using namespace Foam; diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index 9ed5e27004..ba2b615df1 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -434,7 +434,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size()) { // Distribute the points to be +/- 2.5deg from the x-z plane - scalar tanTheta = Foam::tan(2.5*constant::mathematical::pi/180.0); + scalar tanTheta = Foam::tan(degToRad(2.5)); SLList::iterator iterf = pFaces[WEDGE][0].begin(); SLList::iterator iterb = pFaces[WEDGE][1].begin(); diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index 740b87a391..a1bb6a7431 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -59,7 +59,7 @@ Usage #include "Time.H" #include "timeSelector.H" #include "fvMesh.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" #include "polyTopoChange.H" #include "mapPolyMesh.H" #include "PackedBoolList.H" @@ -91,7 +91,7 @@ void simpleMarkFeatures labelList& multiCellFeaturePoints ) { - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -387,7 +387,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl diff --git a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C index bfd1dae882..5857f03e24 100644 --- a/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/starToFoam/createCoupleMatches.C @@ -33,7 +33,7 @@ Description #include "IOmanip.H" #include "boundBox.H" #include "Map.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -99,7 +99,7 @@ void starMesh::createCoupleMatches() << coupleI << ". STAR couple ID: " << couples_[coupleI].coupleID() << endl << "The angle between face normals is " - << Foam::acos(faceAreaAngle)/constant::mathematical::pi*180 + << radToDeg(Foam::acos(faceAreaAngle)) << " deg." << endl << "master cell: " << fp.masterCell() << " STAR number: " << starCellID_[fp.masterCell()] diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C index eac10738cf..a6fc986a74 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C @@ -26,7 +26,7 @@ License #include "wedge.H" #include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,8 +51,7 @@ wedge::wedge(const dictionary& dict) axis_(coeffDict_.lookup("axis")), angle_ ( - readScalar(coeffDict_.lookup("angle")) - *constant::mathematical::pi/180.0 + degToRad(readScalar(coeffDict_.lookup("angle"))) ) {} diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index 7161e6bb70..a753d03c54 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -33,7 +33,7 @@ Description #include "Time.H" #include "boundaryMesh.H" #include "repatchPolyTopoChanger.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" #include "OFstream.H" #include "ListOps.H" @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])())); bool overwrite = args.optionFound("overwrite"); - scalar minCos = Foam::cos(featureAngle*constant::mathematical::pi/180.0); + scalar minCos = Foam::cos(degToRad(featureAngle)); Info<< "Feature:" << featureAngle << endl << "minCos :" << minCos << endl diff --git a/src/Allwmake b/src/Allwmake index 2564ccf9e3..e4724a1e8f 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -38,8 +38,6 @@ wmake libso sampling wmake libso dynamicMesh wmake libso dynamicFvMesh wmake libso topoChangerFvMesh -wmake libso fvMotionSolver -wmake libso engine wmake libso ODE wmake libso randomProcesses @@ -56,4 +54,7 @@ wmake libso errorEstimation fvAgglomerationMethods/Allwmake +wmake libso fvMotionSolver +wmake libso engine + # ----------------------------------------------------------------- end-of-file diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 6ba6b90cf1..2823c2a9ec 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -1,6 +1,6 @@ global/global.Cver -global/dimensionedConstants/dimensionedConstants.C -global/dimensionedConstants/constants/constants.C +global/constants/constants.C +global/constants/dimensionedConstants.C global/argList/argList.C global/clock/clock.C diff --git a/src/OpenFOAM/db/Time/TimeState.H b/src/OpenFOAM/db/Time/TimeState.H index 56fb54d7b8..a9f1c90ef2 100644 --- a/src/OpenFOAM/db/Time/TimeState.H +++ b/src/OpenFOAM/db/Time/TimeState.H @@ -72,10 +72,8 @@ public: TimeState(); - // Destructor - - //- Virtual destructor - virtual ~TimeState(); + //- Destructor + virtual ~TimeState(); // Member functions @@ -89,22 +87,34 @@ public: virtual scalar timeToUserTime(const scalar t) const; //- Return current time value - virtual scalar timeOutputValue() const; + scalar timeOutputValue() const; //- Return current time index - virtual label timeIndex() const; + label timeIndex() const; + + //- Return time step value + inline scalar deltaTValue() const + { + return deltaT_; + } + + //- Return old time step value + inline scalar deltaT0Value() const + { + return deltaT0_; + } //- Return time step - virtual dimensionedScalar deltaT() const; + dimensionedScalar deltaT() const; //- Return old time step - virtual dimensionedScalar deltaT0() const; + dimensionedScalar deltaT0() const; // Check //- Return true if this is an output time - virtual bool outputTime() const; + bool outputTime() const; }; diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index 6e2682e199..543bee59e8 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -173,9 +173,9 @@ bool Foam::regIOobject::checkOut() } -bool Foam::regIOobject::upToDate(const word& a) const +bool Foam::regIOobject::upToDate(const regIOobject& a) const { - if (db().lookupObject(a).eventNo() >= eventNo_) + if (a.eventNo() >= eventNo_) { return false; } @@ -186,12 +186,16 @@ bool Foam::regIOobject::upToDate(const word& a) const } -bool Foam::regIOobject::upToDate(const word& a, const word& b) const +bool Foam::regIOobject::upToDate +( + const regIOobject& a, + const regIOobject& b +) const { if ( - db().lookupObject(a).eventNo() >= eventNo_ - || db().lookupObject(b).eventNo() >= eventNo_ + a.eventNo() >= eventNo_ + || b.eventNo() >= eventNo_ ) { return false; @@ -205,16 +209,16 @@ bool Foam::regIOobject::upToDate(const word& a, const word& b) const bool Foam::regIOobject::upToDate ( - const word& a, - const word& b, - const word& c + const regIOobject& a, + const regIOobject& b, + const regIOobject& c ) const { if ( - db().lookupObject(a).eventNo() >= eventNo_ - || db().lookupObject(b).eventNo() >= eventNo_ - || db().lookupObject(c).eventNo() >= eventNo_ + a.eventNo() >= eventNo_ + || b.eventNo() >= eventNo_ + || c.eventNo() >= eventNo_ ) { return false; @@ -228,18 +232,18 @@ bool Foam::regIOobject::upToDate bool Foam::regIOobject::upToDate ( - const word& a, - const word& b, - const word& c, - const word& d + const regIOobject& a, + const regIOobject& b, + const regIOobject& c, + const regIOobject& d ) const { if ( - db().lookupObject(a).eventNo() >= eventNo_ - || db().lookupObject(b).eventNo() >= eventNo_ - || db().lookupObject(c).eventNo() >= eventNo_ - || db().lookupObject(d).eventNo() >= eventNo_ + a.eventNo() >= eventNo_ + || b.eventNo() >= eventNo_ + || c.eventNo() >= eventNo_ + || d.eventNo() >= eventNo_ ) { return false; diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.H b/src/OpenFOAM/db/regIOobject/regIOobject.H index d2c9a3dcbe..cae92919b2 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.H +++ b/src/OpenFOAM/db/regIOobject/regIOobject.H @@ -154,19 +154,38 @@ public: //- Event number at last update. inline label& eventNo(); - //- Am I uptodate with respect to other regIOobjects - bool upToDate(const word&) const; - bool upToDate(const word&, const word&) const; - bool upToDate(const word&, const word&, const word&) const; + //- Return true if up-to-date with respect to given object + // otherwise false + bool upToDate(const regIOobject&) const; + + //- Return true if up-to-date with respect to given objects + // otherwise false bool upToDate ( - const word&, - const word&, - const word&, - const word& + const regIOobject&, + const regIOobject& ) const; - //- Flag me as up to date + //- Return true if up-to-date with respect to given objects + // otherwise false + bool upToDate + ( + const regIOobject&, + const regIOobject&, + const regIOobject& + ) const; + + //- Return true if up-to-date with respect to given objects + // otherwise false + bool upToDate + ( + const regIOobject&, + const regIOobject&, + const regIOobject&, + const regIOobject& + ) const; + + //- Set up to date (obviously) void setUpToDate(); diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/atomic/atomicConstants.C b/src/OpenFOAM/global/constants/atomic/atomicConstants.C similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/constants/atomic/atomicConstants.C rename to src/OpenFOAM/global/constants/atomic/atomicConstants.C diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/atomic/atomicConstants.H b/src/OpenFOAM/global/constants/atomic/atomicConstants.H similarity index 97% rename from src/OpenFOAM/global/dimensionedConstants/constants/atomic/atomicConstants.H rename to src/OpenFOAM/global/constants/atomic/atomicConstants.H index c257374441..b732207d2c 100644 --- a/src/OpenFOAM/global/dimensionedConstants/constants/atomic/atomicConstants.H +++ b/src/OpenFOAM/global/constants/atomic/atomicConstants.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Namespace - Foam::constant::atom + Foam::constant::atomic Description Atomic constants @@ -68,7 +68,7 @@ namespace atomic // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace atomic -} // end namespace constant +} // End namespace constant } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/constants.C b/src/OpenFOAM/global/constants/constants.C similarity index 96% rename from src/OpenFOAM/global/dimensionedConstants/constants/constants.C rename to src/OpenFOAM/global/constants/constants.C index f921cba983..079343360f 100644 --- a/src/OpenFOAM/global/dimensionedConstants/constants/constants.C +++ b/src/OpenFOAM/global/constants/constants.C @@ -22,9 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Collection of dimensioned constants - \*---------------------------------------------------------------------------*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/constants.H b/src/OpenFOAM/global/constants/constants.H similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/constants/constants.H rename to src/OpenFOAM/global/constants/constants.H diff --git a/src/OpenFOAM/global/dimensionedConstants/dimensionedConstants.C b/src/OpenFOAM/global/constants/dimensionedConstants.C similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/dimensionedConstants.C rename to src/OpenFOAM/global/constants/dimensionedConstants.C diff --git a/src/OpenFOAM/global/dimensionedConstants/dimensionedConstants.H b/src/OpenFOAM/global/constants/dimensionedConstants.H similarity index 93% rename from src/OpenFOAM/global/dimensionedConstants/dimensionedConstants.H rename to src/OpenFOAM/global/constants/dimensionedConstants.H index 989089c0b0..fbba918e24 100644 --- a/src/OpenFOAM/global/dimensionedConstants/dimensionedConstants.H +++ b/src/OpenFOAM/global/constants/dimensionedConstants.H @@ -27,9 +27,10 @@ Global Description Dictionary reading and supplying the dimensioned constants used within - OpenFOAM particularly for thermodynamics. The values are read from the - OpenFOAM controlDict and should be changed to run with a different set of - units from the default SI units. + OpenFOAM, particularly for thermodynamics. + + The values are read from the OpenFOAM etc/controlDict and should be + changed to run with a different set of units from the default SI units. SourceFiles dimensionedConstants.C diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/electromagnetic/electromagneticConstants.C b/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/constants/electromagnetic/electromagneticConstants.C rename to src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/electromagnetic/electromagneticConstants.H b/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.H similarity index 97% rename from src/OpenFOAM/global/dimensionedConstants/constants/electromagnetic/electromagneticConstants.H rename to src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.H index 54586cda47..0d4cd6df14 100644 --- a/src/OpenFOAM/global/dimensionedConstants/constants/electromagnetic/electromagneticConstants.H +++ b/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Namespace - Foam::constant::em + Foam::constant::electromagnetic Description Electromagnetic constants @@ -77,7 +77,7 @@ namespace electromagnetic // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace electromagnetic -} // end namespace constant +} // End namespace constant } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/fundamental/fundamentalConstants.C b/src/OpenFOAM/global/constants/fundamental/fundamentalConstants.C similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/constants/fundamental/fundamentalConstants.C rename to src/OpenFOAM/global/constants/fundamental/fundamentalConstants.C diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/fundamental/fundamentalConstants.H b/src/OpenFOAM/global/constants/fundamental/fundamentalConstants.H similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/constants/fundamental/fundamentalConstants.H rename to src/OpenFOAM/global/constants/fundamental/fundamentalConstants.H diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/math/mathematicalConstants.H b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H similarity index 93% rename from src/OpenFOAM/global/dimensionedConstants/constants/math/mathematicalConstants.H rename to src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H index 0c7e584ed8..41f3793036 100644 --- a/src/OpenFOAM/global/dimensionedConstants/constants/math/mathematicalConstants.H +++ b/src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H @@ -26,7 +26,7 @@ Namespace Foam::constant::mathematical Description - mathematical constants + mathematical constants. \*---------------------------------------------------------------------------*/ @@ -56,7 +56,10 @@ namespace mathematical // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace mathematical -} // end namespace constant +} // End namespace constant + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.C b/src/OpenFOAM/global/constants/physicoChemical/physicoChemicalConstants.C similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.C rename to src/OpenFOAM/global/constants/physicoChemical/physicoChemicalConstants.C diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.H b/src/OpenFOAM/global/constants/physicoChemical/physicoChemicalConstants.H similarity index 97% rename from src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.H rename to src/OpenFOAM/global/constants/physicoChemical/physicoChemicalConstants.H index 7f25e0dfb7..920f390e27 100644 --- a/src/OpenFOAM/global/dimensionedConstants/constants/physicoChemical/physicoChemicalConstants.H +++ b/src/OpenFOAM/global/constants/physicoChemical/physicoChemicalConstants.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Namespace - Foam::constant::phys + Foam::constant::physicoChemical Description Physico-chemical constants @@ -71,7 +71,7 @@ namespace physicoChemical // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace physicoChemical -} // end namespace constant +} // End namespace constant } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/universal/universalConstants.C b/src/OpenFOAM/global/constants/universal/universalConstants.C similarity index 100% rename from src/OpenFOAM/global/dimensionedConstants/constants/universal/universalConstants.C rename to src/OpenFOAM/global/constants/universal/universalConstants.C diff --git a/src/OpenFOAM/global/dimensionedConstants/constants/universal/universalConstants.H b/src/OpenFOAM/global/constants/universal/universalConstants.H similarity index 98% rename from src/OpenFOAM/global/dimensionedConstants/constants/universal/universalConstants.H rename to src/OpenFOAM/global/constants/universal/universalConstants.H index 305e30fe19..85f8f1d9d8 100644 --- a/src/OpenFOAM/global/dimensionedConstants/constants/universal/universalConstants.H +++ b/src/OpenFOAM/global/constants/universal/universalConstants.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Namespace - Foam::constant::uni + Foam::constant::universal Description Universal constants diff --git a/src/OpenFOAM/global/unitConversion/unitConversion.H b/src/OpenFOAM/global/unitConversion/unitConversion.H new file mode 100644 index 0000000000..0ab93f1a50 --- /dev/null +++ b/src/OpenFOAM/global/unitConversion/unitConversion.H @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam + +Description + Unit conversion functions + +\*---------------------------------------------------------------------------*/ + +#ifndef unitConversion_H +#define unitConversion_H + +#include "mathematicalConstants.H" + +using namespace Foam::constant::mathematical; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +//- Conversion from degrees to radians +inline scalar degToRad(const scalar& deg) +{ + return (deg*pi/180.0); +} + +//- Conversion from radians to degrees +inline scalar radToDeg(const scalar& rad) +{ + return (rad*180.0/pi); +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/solution/solution.C b/src/OpenFOAM/matrices/solution/solution.C index 030b3df9ae..c63dceec4e 100644 --- a/src/OpenFOAM/matrices/solution/solution.C +++ b/src/OpenFOAM/matrices/solution/solution.C @@ -59,11 +59,8 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName) IOobject::NO_WRITE ) ), - relaxationFactors_ - ( - ITstream("relaxationFactors", - tokenList())() - ), + cache_(ITstream("cache", tokenList())()), + relaxationFactors_(ITstream("relaxationFactors", tokenList())()), defaultRelaxationFactor_(0), solvers_(ITstream("solvers", tokenList())()) { @@ -151,44 +148,14 @@ Foam::label Foam::solution::upgradeSolverDict } -bool Foam::solution::read() +bool Foam::solution::cache(const word& name) const { - if (regIOobject::read()) + if (debug) { - const dictionary& dict = solutionDict(); - - if (dict.found("relaxationFactors")) - { - relaxationFactors_ = dict.subDict("relaxationFactors"); - } - - relaxationFactors_.readIfPresent("default", defaultRelaxationFactor_); - - if (dict.found("solvers")) - { - solvers_ = dict.subDict("solvers"); - upgradeSolverDict(solvers_); - } - - return true; + Info<< "Find cache entry for " << name << endl; } - else - { - return false; - } -} - -const Foam::dictionary& Foam::solution::solutionDict() const -{ - if (found("select")) - { - return subDict(word(lookup("select"))); - } - else - { - return *this; - } + return cache_.found(name); } @@ -235,6 +202,19 @@ Foam::scalar Foam::solution::relaxationFactor(const word& name) const } +const Foam::dictionary& Foam::solution::solutionDict() const +{ + if (found("select")) + { + return subDict(word(lookup("select"))); + } + else + { + return *this; + } +} + + const Foam::dictionary& Foam::solution::solverDict(const word& name) const { if (debug) @@ -259,4 +239,37 @@ const Foam::dictionary& Foam::solution::solver(const word& name) const } +bool Foam::solution::read() +{ + if (regIOobject::read()) + { + const dictionary& dict = solutionDict(); + + if (dict.found("cache")) + { + cache_ = dict.subDict("cache"); + } + + if (dict.found("relaxationFactors")) + { + relaxationFactors_ = dict.subDict("relaxationFactors"); + } + + relaxationFactors_.readIfPresent("default", defaultRelaxationFactor_); + + if (dict.found("solvers")) + { + solvers_ = dict.subDict("solvers"); + upgradeSolverDict(solvers_); + } + + return true; + } + else + { + return false; + } +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/solution/solution.H b/src/OpenFOAM/matrices/solution/solution.H index d3bf008475..36724bf495 100644 --- a/src/OpenFOAM/matrices/solution/solution.H +++ b/src/OpenFOAM/matrices/solution/solution.H @@ -53,6 +53,9 @@ class solution { // Private data + //- Dictionary of temporary fields to cache + dictionary cache_; + //- Dictionary of relaxation factors for all the fields dictionary relaxationFactors_; @@ -62,6 +65,7 @@ class solution //- Dictionary of solver parameters for all the fields dictionary solvers_; + // Private Member Functions //- Disallow default bitwise copy construct and assignment @@ -90,9 +94,8 @@ public: // Access - //- Return the selected sub-dictionary of solvers if the "select" - // keyword is given, otherwise return the complete dictionary - const dictionary& solutionDict() const; + //- Return true if the given field should be cached + bool cache(const word& name) const; //- Return true if the relaxation factor is given for the field bool relax(const word& name) const; @@ -100,6 +103,10 @@ public: //- Return the relaxation factor for the given field scalar relaxationFactor(const word& name) const; + //- Return the selected sub-dictionary of solvers if the "select" + // keyword is given, otherwise return the complete dictionary + const dictionary& solutionDict() const; + //- Return the solver controls dictionary for the given field const dictionary& solverDict(const word& name) const; diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C index c5f9a80250..cf7dfc9400 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C +++ b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C @@ -159,9 +159,9 @@ Foam::pointHit Foam::face::intersection if (curHit.hit()) { - if (Foam::mag(curHit.distance()) < nearestHitDist) + if (Foam::mag(curHit.distance()) < Foam::mag(nearestHitDist)) { - nearestHitDist = Foam::mag(curHit.distance()); + nearestHitDist = curHit.distance(); nearest.setHit(); nearest.setPoint(curHit.hitPoint()); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index 258cb163a1..5dda9f504d 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -27,7 +27,7 @@ License #include "primitiveMesh.H" #include "pyramidPointFaceRef.H" #include "ListOps.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" #include "SortableList.H" @@ -410,7 +410,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality // Severe nonorthogonality threshold const scalar severeNonorthogonalityThreshold = - ::cos(nonOrthThreshold_/180.0*constant::mathematical::pi); + ::cos(degToRad(nonOrthThreshold_)); scalar minDDotS = GREAT; @@ -472,9 +472,8 @@ bool Foam::primitiveMesh::checkFaceOrthogonality if (debug || report) { Info<< " Mesh non-orthogonality Max: " - << ::acos(minDDotS)/constant::mathematical::pi*180.0 - << " average: " << - ::acos(sumDDotS/neiSize)/constant::mathematical::pi*180.0 + << radToDeg(::acos(minDDotS)) + << " average: " << radToDeg(::acos(sumDDotS/neiSize)) << endl; } } @@ -839,7 +838,7 @@ bool Foam::primitiveMesh::checkFaceAngles << exit(FatalError); } - const scalar maxSin = Foam::sin(maxDeg/180.0*constant::mathematical::pi); + const scalar maxSin = Foam::sin(degToRad(maxDeg)); const pointField& p = points(); const faceList& fcs = faces(); @@ -915,8 +914,7 @@ bool Foam::primitiveMesh::checkFaceAngles if (nConcave > 0) { scalar maxConcaveDegr = - Foam::asin(Foam::min(1.0, maxEdgeSin)) - *180.0/constant::mathematical::pi; + radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin))); if (debug || report) { diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C index 688bdd81a2..521f3dd261 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheckMotion.C @@ -31,10 +31,7 @@ Description #include "primitiveMesh.H" #include "pyramidPointFaceRef.H" #include "cell.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -200,7 +197,7 @@ bool Foam::primitiveMesh::checkMeshMotion ) << "Severe non-orthogonality in mesh motion for face " << faceI << " between cells " << own[faceI] << " and " << nei[faceI] - << ": Angle = " << ::acos(dDotS)/constant::mathematical::pi*180.0 + << ": Angle = " << radToDeg(::acos(dDotS)) << " deg." << endl; nDotProductErrors++; diff --git a/src/dynamicFvMesh/include/meshCourantNo.H b/src/dynamicFvMesh/include/meshCourantNo.H index 9def19e957..d9cbb0f7a3 100644 --- a/src/dynamicFvMesh/include/meshCourantNo.H +++ b/src/dynamicFvMesh/include/meshCourantNo.H @@ -39,10 +39,10 @@ if (mesh.nInternalFaces()) mesh.surfaceInterpolation::deltaCoeffs()*mag(mesh.phi()); meshCoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); meanMeshCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); } Info<< "Mesh Courant Number mean: " << meanMeshCoNum diff --git a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C index 5e83fd9e78..1fef7573ab 100644 --- a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C +++ b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C @@ -27,7 +27,7 @@ License #include "topoCellLooper.H" #include "cellFeatures.H" #include "polyMesh.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" #include "DynamicList.H" #include "ListOps.H" #include "meshTools.H" @@ -44,8 +44,7 @@ namespace Foam } // Angle for polys to be considered splitHexes. -const Foam::scalar Foam::topoCellLooper::featureCos = - Foam::cos(10.0*constant::mathematical::pi/180.0); +const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(degToRad(10.0)); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C index ea8ab52a7f..3df18121c9 100644 --- a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C +++ b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C @@ -32,7 +32,7 @@ License #include "cellCuts.H" #include "splitCell.H" #include "mapPolyMesh.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" #include "meshTools.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -192,7 +192,7 @@ Foam::undoableMeshCutter::undoableMeshCutter faceRemover_ ( mesh, - Foam::cos(30.0/180.0*constant::mathematical::pi) + Foam::cos(degToRad(30.0)) ) {} diff --git a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C index d95e1f34e9..9c4030ed81 100644 --- a/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C +++ b/src/dynamicMesh/motionSmoother/polyMeshGeometry/polyMeshGeometry.C @@ -27,7 +27,7 @@ License #include "polyMeshGeometry.H" #include "pyramidPointFaceRef.H" #include "syncTools.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" namespace Foam { @@ -248,7 +248,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho << " between cells " << mesh.faceOwner()[faceI] << " and " << nei << ": Angle = " - << ::acos(dDotS)/constant::mathematical::pi*180.0 + << radToDeg(::acos(dDotS)) << " deg." << endl; } @@ -269,7 +269,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho << " between cells " << mesh.faceOwner()[faceI] << " and " << nei << ": Angle = " - << ::acos(dDotS)/constant::mathematical::pi*180.0 + << radToDeg(::acos(dDotS)) << " deg." << endl; } @@ -368,8 +368,7 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct const polyBoundaryMesh& patches = mesh.boundaryMesh(); // Severe nonorthogonality threshold - const scalar severeNonorthogonalityThreshold = - ::cos(orthWarn/180.0*constant::mathematical::pi); + const scalar severeNonorthogonalityThreshold = ::cos(degToRad(orthWarn)); // Calculate coupled cell centre @@ -504,9 +503,8 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct if (nDDotS > 0) { Info<< "Mesh non-orthogonality Max: " - << ::acos(minDDotS)/constant::mathematical::pi*180.0 - << " average: " << - ::acos(sumDDotS/nDDotS)/constant::mathematical::pi*180.0 + << radToDeg(::acos(minDDotS)) + << " average: " << radToDeg(::acos(sumDDotS/nDDotS)) << endl; } } @@ -1258,7 +1256,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles << abort(FatalError); } - const scalar maxSin = Foam::sin(maxDeg/180.0*constant::mathematical::pi); + const scalar maxSin = Foam::sin(degToRad(maxDeg)); const faceList& fcs = mesh.faces(); @@ -1338,8 +1336,7 @@ bool Foam::polyMeshGeometry::checkFaceAngles if (maxEdgeSin > SMALL) { scalar maxConcaveDegr = - Foam::asin(Foam::min(1.0, maxEdgeSin)) - *180.0/constant::mathematical::pi; + radToDeg(Foam::asin(Foam::min(1.0, maxEdgeSin))); Info<< "There are " << nConcave << " faces with concave angles between consecutive" diff --git a/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C b/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C index 8d69476e25..16cf2db379 100644 --- a/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C +++ b/src/engine/engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C @@ -119,7 +119,7 @@ void fvMotionSolverEngineMesh::move() pistonPosition_.value() += deltaZ; - scalar pistonSpeed = deltaZ/engineDB_.deltaT().value(); + scalar pistonSpeed = deltaZ/engineDB_.deltaTValue(); Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl << "Piston speed = " << pistonSpeed << " m/s" << endl; diff --git a/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C b/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C index 8bcdcccf41..5fa81d79e2 100644 --- a/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C +++ b/src/engine/engineMesh/layeredEngineMesh/layeredEngineMesh.C @@ -121,7 +121,7 @@ void layeredEngineMesh::move() } pistonPosition_.value() += deltaZ; - scalar pistonSpeed = deltaZ/engineDB_.deltaT().value(); + scalar pistonSpeed = deltaZ/engineDB_.deltaTValue(); Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl << "Piston speed = " << pistonSpeed << " m/s" << endl; diff --git a/src/engine/engineTime/engineTime.C b/src/engine/engineTime/engineTime.C index ef0d016880..1938858126 100644 --- a/src/engine/engineTime/engineTime.C +++ b/src/engine/engineTime/engineTime.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "engineTime.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -123,12 +123,6 @@ bool Foam::engineTime::read() } -Foam::scalar Foam::engineTime::degToRad(const scalar deg) const -{ - return constant::mathematical::pi*deg/180.0; -} - - Foam::scalar Foam::engineTime::degToTime(const scalar theta) const { // 6 * rpm => deg/s @@ -171,7 +165,7 @@ Foam::scalar Foam::engineTime::thetaRevolution() const Foam::scalar Foam::engineTime::deltaTheta() const { - return timeToDeg(deltaT().value()); + return timeToDeg(deltaTValue()); } @@ -222,7 +216,7 @@ Foam::dimensionedScalar Foam::engineTime::pistonSpeed() const ( "pistonSpeed", dimVelocity, - pistonDisplacement().value()/(deltaT().value() + VSMALL) + pistonDisplacement().value()/(deltaTValue() + VSMALL) ); } diff --git a/src/engine/engineTime/engineTime.H b/src/engine/engineTime/engineTime.H index f97701d240..e63a7caa0b 100644 --- a/src/engine/engineTime/engineTime.H +++ b/src/engine/engineTime/engineTime.H @@ -121,9 +121,6 @@ public: // Conversion - //- Convert degrees to radians - scalar degToRad(const scalar rad) const; - //- Convert degrees to seconds (for given engine speed in RPM) scalar degToTime(const scalar theta) const; diff --git a/src/engine/engineValve/engineValve.C b/src/engine/engineValve/engineValve.C index 396cfa139a..0c2b66b756 100644 --- a/src/engine/engineValve/engineValve.C +++ b/src/engine/engineValve/engineValve.C @@ -208,7 +208,7 @@ Foam::scalar Foam::engineValve::curVelocity() const lift(engineDB_.theta() - engineDB_.deltaTheta()), minLift_ ) - )/(engineDB_.deltaT().value() + VSMALL); + )/(engineDB_.deltaTValue() + VSMALL); } diff --git a/src/engine/ignition/ignitionSite.C b/src/engine/ignition/ignitionSite.C index 3c6529aef6..5f67356087 100644 --- a/src/engine/ignition/ignitionSite.C +++ b/src/engine/ignition/ignitionSite.C @@ -106,7 +106,7 @@ const labelList& ignitionSite::cells() const bool ignitionSite::igniting() const { scalar curTime = db_.value(); - scalar deltaT = db_.deltaT().value(); + scalar deltaT = db_.deltaTValue(); return ( @@ -120,7 +120,7 @@ bool ignitionSite::igniting() const bool ignitionSite::ignited() const { scalar curTime = db_.value(); - scalar deltaT = db_.deltaT().value(); + scalar deltaT = db_.deltaTValue(); return(curTime - deltaT >= time_); } diff --git a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H index a20e1d0f14..8cc2522e97 100644 --- a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H +++ b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H @@ -39,10 +39,10 @@ if (mesh.nInternalFaces()) mesh.surfaceInterpolation::deltaCoeffs()*mag(phi)/fvc::interpolate(rho); CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); } Info<< "Courant Number mean: " << meanCoNum diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C index 221b7949b4..38ee3466ee 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C @@ -180,7 +180,7 @@ Foam::timeActivatedExplicitMulticomponentPointSource::Su DimensionedField& sourceField = tSource(); const scalarField& V = mesh_.V(); - const scalar dt = runTime_.deltaT().value(); + const scalar dt = runTime_.deltaTValue(); forAll(pointSources_, sourceI) { @@ -240,7 +240,7 @@ Foam::timeActivatedExplicitMulticomponentPointSource::Su() DimensionedField& sourceField = tSource(); const scalarField& V = mesh_.V(); - const scalar dt = runTime_.deltaT().value(); + const scalar dt = runTime_.deltaTValue(); forAll(pointSources_, sourceI) { diff --git a/src/finiteVolume/cfdTools/general/include/setDeltaT.H b/src/finiteVolume/cfdTools/general/include/setDeltaT.H index 58cd25f233..2651bdd07f 100644 --- a/src/finiteVolume/cfdTools/general/include/setDeltaT.H +++ b/src/finiteVolume/cfdTools/general/include/setDeltaT.H @@ -41,12 +41,12 @@ if (adjustTimeStep) ( min ( - deltaTFact*runTime.deltaT().value(), + deltaTFact*runTime.deltaTValue(), maxDeltaT ) ); - Info<< "deltaT = " << runTime.deltaT().value() << endl; + Info<< "deltaT = " << runTime.deltaTValue() << endl; } // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/include/setInitialDeltaT.H b/src/finiteVolume/cfdTools/general/include/setInitialDeltaT.H index c3d9bdad3b..0c5dd30d4b 100644 --- a/src/finiteVolume/cfdTools/general/include/setInitialDeltaT.H +++ b/src/finiteVolume/cfdTools/general/include/setInitialDeltaT.H @@ -39,7 +39,7 @@ if (adjustTimeStep) ( min ( - maxCo*runTime.deltaT().value()/CoNum, + maxCo*runTime.deltaTValue()/CoNum, maxDeltaT ) ); diff --git a/src/finiteVolume/cfdTools/general/include/volContinuity.H b/src/finiteVolume/cfdTools/general/include/volContinuity.H index 8a65397de4..a8f31e2223 100644 --- a/src/finiteVolume/cfdTools/general/include/volContinuity.H +++ b/src/finiteVolume/cfdTools/general/include/volContinuity.H @@ -4,12 +4,12 @@ // Backward Differencing in time. conserve.internalField() += - (1.0 - mesh.V0()/mesh.V())/runTime.deltaT().value(); + (1.0 - mesh.V0()/mesh.V())/runTime.deltaTValue(); - scalar sumLocalContErr = runTime.deltaT().value()* + scalar sumLocalContErr = runTime.deltaTValue()* mag(conserve)().weightedAverage(mesh.V()).value(); - scalar globalContErr = runTime.deltaT().value()* + scalar globalContErr = runTime.deltaTValue()* conserve.weightedAverage(mesh.V()).value(); Info<< "volume continuity errors : sum local = " << sumLocalContErr diff --git a/src/finiteVolume/cfdTools/incompressible/CourantNo.H b/src/finiteVolume/cfdTools/incompressible/CourantNo.H index 27ab37b085..a8ac950f3d 100644 --- a/src/finiteVolume/cfdTools/incompressible/CourantNo.H +++ b/src/finiteVolume/cfdTools/incompressible/CourantNo.H @@ -39,10 +39,10 @@ if (mesh.nInternalFaces()) mesh.surfaceInterpolation::deltaCoeffs()*mag(phi); CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + .value()*runTime.deltaTValue(); } Info<< "Courant Number mean: " << meanCoNum diff --git a/src/finiteVolume/cfdTools/incompressible/continuityErrs.H b/src/finiteVolume/cfdTools/incompressible/continuityErrs.H index e2304c682b..cafd84b58b 100644 --- a/src/finiteVolume/cfdTools/incompressible/continuityErrs.H +++ b/src/finiteVolume/cfdTools/incompressible/continuityErrs.H @@ -33,10 +33,10 @@ Description { volScalarField contErr = fvc::div(phi); - scalar sumLocalContErr = runTime.deltaT().value()* + scalar sumLocalContErr = runTime.deltaTValue()* mag(contErr)().weightedAverage(mesh.V()).value(); - scalar globalContErr = runTime.deltaT().value()* + scalar globalContErr = runTime.deltaTValue()* contErr.weightedAverage(mesh.V()).value(); cumulativeContErr += globalContErr; diff --git a/src/finiteVolume/cfdTools/incompressible/movingMeshContinuityErrs.H b/src/finiteVolume/cfdTools/incompressible/movingMeshContinuityErrs.H index 04b5af8ae8..8268163cb0 100644 --- a/src/finiteVolume/cfdTools/incompressible/movingMeshContinuityErrs.H +++ b/src/finiteVolume/cfdTools/incompressible/movingMeshContinuityErrs.H @@ -33,10 +33,10 @@ Description { volScalarField contErr = fvc::div(phi + fvc::meshPhi(U)); - scalar sumLocalContErr = runTime.deltaT().value()* + scalar sumLocalContErr = runTime.deltaTValue()* mag(contErr)().weightedAverage(mesh.V()).value(); - scalar globalContErr = runTime.deltaT().value()* + scalar globalContErr = runTime.deltaTValue()* contErr.weightedAverage(mesh.V()).value(); cumulativeContErr += globalContErr; diff --git a/src/finiteVolume/cfdTools/incompressible/movingMeshRhoUContinuityErrs.H b/src/finiteVolume/cfdTools/incompressible/movingMeshRhoUContinuityErrs.H index e480176117..dea0fe4de8 100644 --- a/src/finiteVolume/cfdTools/incompressible/movingMeshRhoUContinuityErrs.H +++ b/src/finiteVolume/cfdTools/incompressible/movingMeshRhoUContinuityErrs.H @@ -32,11 +32,11 @@ Description if (mesh.moving()) { - scalar sumLocalContErr = runTime.deltaT().value()* + scalar sumLocalContErr = runTime.deltaTValue()* mag(fvc::div(phi + fvc::meshPhi(rho, U)))() .weightedAverage(mesh.V()).value(); - scalar globalContErr = runTime.deltaT().value()* + scalar globalContErr = runTime.deltaTValue()* fvc::div(phi + fvc::meshPhi(rho, U))() .weightedAverage(mesh.V()).value(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index abc4619706..1e4f3ffcc5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -223,7 +223,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs() openFraction_ + max ( - this->db().time().deltaT().value()/openingTime_, + this->db().time().deltaTValue()/openingTime_, maxOpenFractionDelta_ ) *(orientation_*sign(forceDiff)), diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index 9b67c39b78..3acad83e71 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -202,7 +202,7 @@ void advectiveFvPatchField::updateCoeffs() this->dimensionedInternalField().mesh() .ddtScheme(this->dimensionedInternalField().name()) ); - scalar deltaT = this->db().time().deltaT().value(); + scalar deltaT = this->db().time().deltaTValue(); const GeometricField& field = this->db().objectRegistry:: diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C index 17742fe879..9c24dae9cc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C @@ -112,7 +112,7 @@ void movingWallVelocityFvPatchVectorField::updateCoeffs() oldFc[i] = pp[i].centre(oldPoints); } - vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaT().value(); + vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaTValue(); const volVectorField& U = db().lookupObject("U"); scalarField phip = diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C index 6fd51f5632..e449688ffe 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C @@ -196,7 +196,7 @@ void syringePressureFvPatchScalarField::updateCoeffs() } scalar t = db().time().value(); - scalar deltaT = db().time().deltaT().value(); + scalar deltaT = db().time().deltaTValue(); const surfaceScalarField& phi = db().lookupObject("phi"); diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C index 9a7ad2d0d3..abc203a73b 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C @@ -59,8 +59,8 @@ EulerD2dt2Scheme::fvcD2dt2 IOobject::NO_WRITE ); - scalar deltaT = mesh().time().deltaT().value(); - scalar deltaT0 = mesh().time().deltaT0().value(); + scalar deltaT = mesh().time().deltaTValue(); + scalar deltaT0 = mesh().time().deltaT0Value(); scalar coefft = (deltaT + deltaT0)/(2*deltaT); scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0); @@ -137,8 +137,8 @@ EulerD2dt2Scheme::fvcD2dt2 IOobject::NO_WRITE ); - scalar deltaT = mesh().time().deltaT().value(); - scalar deltaT0 = mesh().time().deltaT0().value(); + scalar deltaT = mesh().time().deltaTValue(); + scalar deltaT0 = mesh().time().deltaT0Value(); scalar coefft = (deltaT + deltaT0)/(2*deltaT); scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0); @@ -246,8 +246,8 @@ EulerD2dt2Scheme::fvmD2dt2 fvMatrix& fvm = tfvm(); - scalar deltaT = mesh().time().deltaT().value(); - scalar deltaT0 = mesh().time().deltaT0().value(); + scalar deltaT = mesh().time().deltaTValue(); + scalar deltaT0 = mesh().time().deltaT0Value(); scalar coefft = (deltaT + deltaT0)/(2*deltaT); scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0); @@ -307,8 +307,8 @@ EulerD2dt2Scheme::fvmD2dt2 fvMatrix& fvm = tfvm(); - scalar deltaT = mesh().time().deltaT().value(); - scalar deltaT0 = mesh().time().deltaT0().value(); + scalar deltaT = mesh().time().deltaTValue(); + scalar deltaT0 = mesh().time().deltaT0Value(); scalar coefft = (deltaT + deltaT0)/(2*deltaT); scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0); @@ -368,8 +368,8 @@ EulerD2dt2Scheme::fvmD2dt2 fvMatrix& fvm = tfvm(); - scalar deltaT = mesh().time().deltaT().value(); - scalar deltaT0 = mesh().time().deltaT0().value(); + scalar deltaT = mesh().time().deltaTValue(); + scalar deltaT0 = mesh().time().deltaT0Value(); scalar coefft = (deltaT + deltaT0)/(2*deltaT); scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C index e7749610a7..5b43623c61 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C @@ -276,7 +276,7 @@ EulerDdtScheme::fvmDdt fvMatrix& fvm = tfvm(); - scalar rDeltaT = 1.0/mesh().time().deltaT().value(); + scalar rDeltaT = 1.0/mesh().time().deltaTValue(); fvm.diag() = rDeltaT*mesh().V(); @@ -311,7 +311,7 @@ EulerDdtScheme::fvmDdt ); fvMatrix& fvm = tfvm(); - scalar rDeltaT = 1.0/mesh().time().deltaT().value(); + scalar rDeltaT = 1.0/mesh().time().deltaTValue(); fvm.diag() = rDeltaT*rho.value()*mesh().V(); @@ -348,7 +348,7 @@ EulerDdtScheme::fvmDdt ); fvMatrix& fvm = tfvm(); - scalar rDeltaT = 1.0/mesh().time().deltaT().value(); + scalar rDeltaT = 1.0/mesh().time().deltaTValue(); fvm.diag() = rDeltaT*rho.internalField()*mesh().V(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C index 8a121b2d44..5b55f27a1e 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C @@ -44,14 +44,14 @@ namespace fv template scalar backwardDdtScheme::deltaT_() const { - return mesh().time().deltaT().value(); + return mesh().time().deltaTValue(); } template scalar backwardDdtScheme::deltaT0_() const { - return mesh().time().deltaT0().value(); + return mesh().time().deltaT0Value(); } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C index c8ef5c7259..c7b8d49866 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C @@ -42,13 +42,13 @@ namespace fv scalar boundedBackwardDdtScheme::deltaT_() const { - return mesh().time().deltaT().value(); + return mesh().time().deltaTValue(); } scalar boundedBackwardDdtScheme::deltaT0_() const { - return mesh().time().deltaT0().value(); + return mesh().time().deltaT0Value(); } diff --git a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C index f9354e3d84..696a60647b 100644 --- a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C +++ b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.C @@ -52,7 +52,6 @@ void Foam::fvSchemes::clear() defaultLaplacianScheme_.clear(); fluxRequired_.clear(); defaultFluxRequired_ = false; - cacheFields_.clear(); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -169,15 +168,7 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr) tokenList() )() ), - defaultFluxRequired_(false), - cacheFields_ - ( - ITstream - ( - objectPath() + "::cacheFields", - tokenList() - )() - ) + defaultFluxRequired_(false) { read(); } @@ -381,11 +372,6 @@ bool Foam::fvSchemes::read() } } - if (dict.found("cacheFields")) - { - cacheFields_ = dict.subDict("cacheFields"); - } - return true; } else @@ -563,22 +549,4 @@ bool Foam::fvSchemes::fluxRequired(const word& name) const } -bool Foam::fvSchemes::cache(const word& name) const -{ - if (debug) - { - Info<< "Lookup cache for " << name << endl; - } - - if (cacheFields_.found(name)) - { - return true; - } - else - { - return false; - } -} - - // ************************************************************************* // diff --git a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.H b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.H index 25a9da32c9..06bdadea90 100644 --- a/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.H +++ b/src/finiteVolume/finiteVolume/fvSchemes/fvSchemes.H @@ -79,8 +79,6 @@ class fvSchemes dictionary fluxRequired_; bool defaultFluxRequired_; - dictionary cacheFields_; - // Private Member Functions @@ -128,8 +126,6 @@ public: bool fluxRequired(const word& name) const; - bool cache(const word& name) const; - // Read diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C index 12a7d0b49b..151de78a1e 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C @@ -99,7 +99,7 @@ void Foam::MULES::explicitSolve scalarField& psiIf = psi; const scalarField& psi0 = psi.oldTime(); - const scalar deltaT = mesh.time().deltaT().value(); + const scalar deltaT = mesh.time().deltaTValue(); psiIf = 0.0; fvc::surfaceIntegrate(psiIf, phiPsi); @@ -328,7 +328,7 @@ void Foam::MULES::limiter const unallocLabelList& owner = mesh.owner(); const unallocLabelList& neighb = mesh.neighbour(); const scalarField& V = mesh.V(); - const scalar deltaT = mesh.time().deltaT().value(); + const scalar deltaT = mesh.time().deltaTValue(); const scalarField& phiBDIf = phiBD; const surfaceScalarField::GeometricBoundaryField& phiBDBf = diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 5dd07f3a92..28f0a8d23e 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -576,7 +576,7 @@ Foam::tmp Foam::fvMesh::movePoints(const pointField& p) // Move the polyMesh and set the mesh motion fluxes to the swept-volumes - scalar rDeltaT = 1.0/time().deltaT().value(); + scalar rDeltaT = 1.0/time().deltaTValue(); tmp tsweptVols = polyMesh::movePoints(p); scalarField& sweptVols = tsweptVols(); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C index 87cc39bfdc..bd66f20ea1 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C @@ -32,7 +32,7 @@ Description #include "surfaceFields.H" #include "demandDrivenData.H" #include "coupledFvPatch.H" -#include "mathematicalConstants.H" +#include "unitConversion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -345,7 +345,8 @@ void surfaceInterpolation::makeCorrectionVectors() const // Calculate the non-orthogonality for meshes with 1 face or more if (returnReduce(magSf.size(), sumOp