From 8cf4b6fcd5fb4aaa5a8c7bfdbb071c4e1ad15d1d Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Mon, 9 May 2016 11:03:58 +0100 Subject: [PATCH] Enable full gradient cacheing capability --- .../rhopSonicFoam/rhopSonicFoam.C | 2 - .../solvers/compressible/sonicDyMFoam/eEqn.H | 1 + .../solvers/compressible/sonicFoam/eEqn.H | 1 + .../steadyCompressibleFoam/rhoFromP.H | 1 + .../steadyCompressibleMRFFoam/rhoFromP.H | 1 + .../steadyCompressibleSRFFoam/rhoFromP.H | 1 + .../porousSimpleIbFoam/pEqn.H | 5 +-- .../immersedBoundary/simpleIbFoam/pEqn.H | 5 +-- .../MRFSimpleFoam/MRFSimpleFoam.C | 1 - .../consistentPimpleDyMFoam/pEqn.H | 2 - .../consistentSimpleFoam/pEqn.H | 5 +-- .../solvers/incompressible/simpleFoam/pEqn.H | 6 +-- .../simpleSRFFoam/simpleSRFFoam.C | 1 - .../solvers/multiphase/cavitatingFoam/pEqn.H | 2 - .../solvers/multiphase/interFoam/alphaEqn.H | 3 ++ .../viscoelasticFluidFoam.C | 1 - .../coupledFvMatrix/coupledFvMatrix.C | 22 ++++++++-- .../coupledFvScalarMatrix.C | 33 ++++++-------- .../EulerLocalDdtScheme/EulerLocalDdtScheme.C | 6 +-- .../EulerLocalDdtScheme/EulerLocalDdtScheme.H | 6 +-- .../backwardDualDdtScheme.C | 6 +-- .../backwardDualDdtScheme.H | 6 +-- src/finiteArea/faMatrices/faMatrix/faMatrix.C | 16 ++++--- src/finiteArea/faMatrices/faMatrix/faMatrix.H | 15 +++---- .../faMatrices/faMatrix/faMatrixSolve.C | 8 +++- .../faScalarMatrix/faScalarMatrix.C | 19 ++++++-- .../faConvectionScheme/faConvectionScheme.H | 2 +- .../gaussFaConvectionScheme.C | 2 +- .../gaussFaConvectionScheme.H | 2 +- .../EulerFaDdtScheme/EulerFaDdtScheme.C | 6 +-- .../EulerFaDdtScheme/EulerFaDdtScheme.H | 6 +-- .../backwardFaDdtScheme/backwardFaDdtScheme.C | 6 +-- .../backwardFaDdtScheme/backwardFaDdtScheme.H | 6 +-- .../boundedBackwardFaDdtScheme.C | 6 +-- .../boundedBackwardFaDdtScheme.H | 6 +-- .../ddtSchemes/faDdtScheme/faDdtScheme.H | 6 +-- .../steadyStateFaDdtScheme.C | 6 +-- .../steadyStateFaDdtScheme.H | 6 +-- .../divSchemes/faDivScheme/faDivScheme.H | 17 ++++---- src/finiteArea/finiteArea/fam/famDdt.C | 6 +-- src/finiteArea/finiteArea/fam/famDdt.H | 6 +-- src/finiteArea/finiteArea/fam/famDiv.C | 8 ++-- src/finiteArea/finiteArea/fam/famDiv.H | 8 ++-- src/finiteArea/finiteArea/fam/famLaplacian.C | 32 +++++++------- src/finiteArea/finiteArea/fam/famLaplacian.H | 34 +++++++-------- src/finiteArea/finiteArea/fam/famSup.C | 14 +++--- src/finiteArea/finiteArea/fam/famSup.H | 14 +++--- .../faLaplacianScheme/faLaplacianScheme.C | 2 +- .../faLaplacianScheme/faLaplacianScheme.H | 4 +- .../gaussFaLaplacianScheme.C | 2 +- .../gaussFaLaplacianScheme.H | 2 +- .../cfdTools/general/adjustPhi/adjustPhi.C | 4 +- .../cfdTools/general/adjustPhi/adjustPhi.H | 2 +- .../fvPatchFields/fvPatchField/fvPatchField.C | 2 +- .../fvPatchFields/fvPatchField/fvPatchField.H | 2 +- .../adjConvectionScheme/adjConvectionScheme.H | 2 +- .../explicitAdjConvectionScheme.C | 2 +- .../explicitAdjConvectionScheme.H | 2 +- .../noAdjConvectionScheme.C | 2 +- .../noAdjConvectionScheme.H | 2 +- .../convectionScheme/convectionScheme.H | 2 +- .../explicitConvectionScheme.C | 2 +- .../explicitConvectionScheme.H | 2 +- .../gaussConvectionScheme.C | 2 +- .../gaussConvectionScheme.H | 2 +- .../multivariateGaussConvectionScheme.C | 2 +- .../multivariateGaussConvectionScheme.H | 2 +- .../noConvectionScheme/noConvectionScheme.C | 2 +- .../noConvectionScheme/noConvectionScheme.H | 2 +- .../EulerD2dt2Scheme/EulerD2dt2Scheme.C | 6 +-- .../EulerD2dt2Scheme/EulerD2dt2Scheme.H | 6 +-- .../backwardD2dt2Scheme/backwardD2dt2Scheme.C | 15 ++++--- .../backwardD2dt2Scheme/backwardD2dt2Scheme.H | 11 +++-- .../d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.H | 6 +-- .../steadyStateD2dt2Scheme.C | 6 +-- .../steadyStateD2dt2Scheme.H | 6 +-- .../CoEulerDdtScheme/CoEulerDdtScheme.C | 6 +-- .../CoEulerDdtScheme/CoEulerDdtScheme.H | 6 +-- .../CrankNicolsonDdtScheme.C | 6 +-- .../CrankNicolsonDdtScheme.H | 6 +-- .../EulerDdtScheme/EulerDdtScheme.C | 6 +-- .../EulerDdtScheme/EulerDdtScheme.H | 6 +-- .../ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C | 6 +-- .../ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H | 6 +-- .../backwardDdtScheme/backwardDdtScheme.C | 6 +-- .../backwardDdtScheme/backwardDdtScheme.H | 6 +-- .../boundedBackwardDdtScheme.C | 6 +-- .../boundedBackwardDdtScheme.H | 6 +-- .../ddtSchemes/ddtScheme/ddtScheme.H | 6 +-- .../steadyInertialDdtScheme.C | 6 +-- .../steadyInertialDdtScheme.H | 6 +-- .../steadyStateDdtScheme.C | 6 +-- .../steadyStateDdtScheme.H | 6 +-- .../divSchemes/divScheme/divScheme.C | 4 +- src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.C | 8 ++-- src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.H | 8 ++-- src/finiteVolume/finiteVolume/fvm/fvmD2dt2.C | 12 +++--- src/finiteVolume/finiteVolume/fvm/fvmD2dt2.H | 12 +++--- src/finiteVolume/finiteVolume/fvm/fvmDdt.H | 16 +++---- src/finiteVolume/finiteVolume/fvm/fvmDiv.C | 20 ++++----- src/finiteVolume/finiteVolume/fvm/fvmDiv.H | 20 ++++----- src/finiteVolume/finiteVolume/fvm/fvmGrad.C | 4 +- src/finiteVolume/finiteVolume/fvm/fvmGrad.H | 7 +-- .../finiteVolume/fvm/fvmLaplacian.C | 32 +++++++------- .../finiteVolume/fvm/fvmLaplacian.H | 32 +++++++------- src/finiteVolume/finiteVolume/fvm/fvmSup.C | 26 +++++------ src/finiteVolume/finiteVolume/fvm/fvmSup.H | 26 +++++------ .../gradSchemes/gradScheme/gradScheme.C | 5 ++- .../gaussLaplacianScheme.C | 31 +++++++------ .../gaussLaplacianScheme.H | 6 +-- .../gaussLaplacianSchemes.C | 2 +- .../laplacianScheme/laplacianScheme.C | 2 +- .../laplacianScheme/laplacianScheme.H | 42 +++++++++--------- .../noLaplacianScheme/noLaplacianScheme.C | 2 +- .../noLaplacianScheme/noLaplacianScheme.H | 2 +- .../correctedSnGrad/correctedSnGrad.C | 43 ++++++++++++------- .../correctedSnGrad/correctedSnGrad.H | 35 +++++++++++++-- .../correctedSnGrad/correctedSnGrads.C | 23 ++++++++++ .../fvMatrices/fvMatrix/fvMatrix.C | 30 +++++++++---- .../fvMatrices/fvMatrix/fvMatrix.H | 15 +++---- .../fvMatrices/fvMatrix/fvMatrixSolve.C | 8 +++- .../fvScalarMatrix/fvScalarMatrix.C | 10 +++-- .../immersedBoundaryAdjustPhi.C | 2 +- .../immersedBoundaryAdjustPhi.H | 2 +- .../tetFemMatrix/tetFemMatrix.C | 4 +- .../tetFemMatrix/tetFemMatrix.H | 11 ++--- .../tetFemMatrix/tetFemMatrixSolve.C | 11 ++++- .../tetFemMatrix/tetFemScalarMatrix.C | 19 ++++++-- src/tetFiniteElement/tetFemMethod/tetFem.C | 20 ++++----- src/tetFiniteElement/tetFemMethod/tetFem.H | 22 +++++----- .../simpleFoam/motorBike/system/fvSchemes | 9 ++++ 131 files changed, 650 insertions(+), 513 deletions(-) diff --git a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C b/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C index fff8b8fae..7c9e808b4 100644 --- a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C +++ b/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C @@ -137,8 +137,6 @@ int main(int argc, char *argv[]) ) + HbyAblend*fvc::ddtPhiCorr(rrhoUA, rho, rhoU, phi); - p.boundaryField().updateCoeffs(); - surfaceScalarField phiGradp = rrhoUAf*mesh.magSf()*fvc::snGrad(p); diff --git a/applications/solvers/compressible/sonicDyMFoam/eEqn.H b/applications/solvers/compressible/sonicDyMFoam/eEqn.H index 7b11958a7..5a4596437 100644 --- a/applications/solvers/compressible/sonicDyMFoam/eEqn.H +++ b/applications/solvers/compressible/sonicDyMFoam/eEqn.H @@ -54,4 +54,5 @@ // Recalculate density rho = thermo.rho(); + rho.correctBoundaryConditions(); } diff --git a/applications/solvers/compressible/sonicFoam/eEqn.H b/applications/solvers/compressible/sonicFoam/eEqn.H index 2b54224ac..3f9cc4184 100644 --- a/applications/solvers/compressible/sonicFoam/eEqn.H +++ b/applications/solvers/compressible/sonicFoam/eEqn.H @@ -39,4 +39,5 @@ // Recalculate density rho = thermo.rho(); + rho.correctBoundaryConditions(); } diff --git a/applications/solvers/compressible/steadyCompressibleFoam/rhoFromP.H b/applications/solvers/compressible/steadyCompressibleFoam/rhoFromP.H index 31278008e..5dcfe3bf7 100644 --- a/applications/solvers/compressible/steadyCompressibleFoam/rhoFromP.H +++ b/applications/solvers/compressible/steadyCompressibleFoam/rhoFromP.H @@ -12,4 +12,5 @@ rho = Foam::min(rho, rhoMax); rho = Foam::max(rho, rhoMin); rho.relax(); + rho.correctBoundaryConditions(); } diff --git a/applications/solvers/compressible/steadyCompressibleMRFFoam/rhoFromP.H b/applications/solvers/compressible/steadyCompressibleMRFFoam/rhoFromP.H index 31278008e..5dcfe3bf7 100644 --- a/applications/solvers/compressible/steadyCompressibleMRFFoam/rhoFromP.H +++ b/applications/solvers/compressible/steadyCompressibleMRFFoam/rhoFromP.H @@ -12,4 +12,5 @@ rho = Foam::min(rho, rhoMax); rho = Foam::max(rho, rhoMin); rho.relax(); + rho.correctBoundaryConditions(); } diff --git a/applications/solvers/compressible/steadyCompressibleSRFFoam/rhoFromP.H b/applications/solvers/compressible/steadyCompressibleSRFFoam/rhoFromP.H index 31278008e..5dcfe3bf7 100644 --- a/applications/solvers/compressible/steadyCompressibleSRFFoam/rhoFromP.H +++ b/applications/solvers/compressible/steadyCompressibleSRFFoam/rhoFromP.H @@ -12,4 +12,5 @@ rho = Foam::min(rho, rhoMax); rho = Foam::max(rho, rhoMin); rho.relax(); + rho.correctBoundaryConditions(); } diff --git a/applications/solvers/immersedBoundary/porousSimpleIbFoam/pEqn.H b/applications/solvers/immersedBoundary/porousSimpleIbFoam/pEqn.H index b49a24366..0f038a02b 100644 --- a/applications/solvers/immersedBoundary/porousSimpleIbFoam/pEqn.H +++ b/applications/solvers/immersedBoundary/porousSimpleIbFoam/pEqn.H @@ -1,5 +1,4 @@ - p.boundaryField().updateCoeffs(); - +{ volScalarField AU = UEqn().A(); U = UEqn().H()/AU; @@ -48,4 +47,4 @@ // Momentum corrector U -= fvc::grad(p)/AU; U.correctBoundaryConditions(); - +} diff --git a/applications/solvers/immersedBoundary/simpleIbFoam/pEqn.H b/applications/solvers/immersedBoundary/simpleIbFoam/pEqn.H index 6a54f2e8d..b51224baa 100644 --- a/applications/solvers/immersedBoundary/simpleIbFoam/pEqn.H +++ b/applications/solvers/immersedBoundary/simpleIbFoam/pEqn.H @@ -1,5 +1,4 @@ - p.boundaryField().updateCoeffs(); - +{ volScalarField AU = UEqn().A(); U = UEqn().H()/AU; @@ -48,4 +47,4 @@ // Momentum corrector U -= fvc::grad(p)/AU; U.correctBoundaryConditions(); - +} diff --git a/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C b/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C index 00ecd40a5..db4ac9af5 100644 --- a/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C +++ b/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C @@ -74,7 +74,6 @@ int main(int argc, char *argv[]) solve(UEqn() == -fvc::grad(p)); - p.boundaryField().updateCoeffs(); volScalarField rAU = 1.0/UEqn().A(); U = rAU*UEqn().H(); UEqn.clear(); diff --git a/applications/solvers/incompressible/consistentPimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/consistentPimpleDyMFoam/pEqn.H index c90d2f5cc..e36f3eba5 100644 --- a/applications/solvers/incompressible/consistentPimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/consistentPimpleDyMFoam/pEqn.H @@ -1,6 +1,4 @@ { - p.boundaryField().updateCoeffs(); - // Prepare clean Ap without time derivative contribution and // without contribution from under-relaxation // HJ, 26/Oct/2015 diff --git a/applications/solvers/incompressible/consistentSimpleFoam/pEqn.H b/applications/solvers/incompressible/consistentSimpleFoam/pEqn.H index 021350f09..41050f45d 100644 --- a/applications/solvers/incompressible/consistentSimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/consistentSimpleFoam/pEqn.H @@ -1,5 +1,4 @@ - p.boundaryField().updateCoeffs(); - +{ // Prepare clean 1/Ap without contribution from under-relaxation // HJ, 26/Oct/2015 volScalarField rUA @@ -56,4 +55,4 @@ // re-used. HJ, 22/Jan/2016 U = UUrf*(U - rUA*fvc::grad(p)) + (1 - UUrf)*U.prevIter(); U.correctBoundaryConditions(); - +} diff --git a/applications/solvers/incompressible/simpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/pEqn.H index 42ebfc225..0e649b016 100644 --- a/applications/solvers/incompressible/simpleFoam/pEqn.H +++ b/applications/solvers/incompressible/simpleFoam/pEqn.H @@ -1,9 +1,9 @@ - p.boundaryField().updateCoeffs(); - +{ volScalarField AU = UEqn().A(); U = UEqn().H()/AU; UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); + adjustPhi(phi, U, p); // Non-orthogonal pressure corrector loop @@ -41,4 +41,4 @@ // Momentum corrector U -= fvc::grad(p)/AU; U.correctBoundaryConditions(); - +} diff --git a/applications/solvers/incompressible/simpleSRFFoam/simpleSRFFoam.C b/applications/solvers/incompressible/simpleSRFFoam/simpleSRFFoam.C index 528c913b1..a06982bf4 100644 --- a/applications/solvers/incompressible/simpleSRFFoam/simpleSRFFoam.C +++ b/applications/solvers/incompressible/simpleSRFFoam/simpleSRFFoam.C @@ -75,7 +75,6 @@ int main(int argc, char *argv[]) solve(UrelEqn() == -fvc::grad(p)); - p.boundaryField().updateCoeffs(); volScalarField AUrel = UrelEqn().A(); Urel = UrelEqn().H()/AUrel; UrelEqn.clear(); diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index f943f11bc..9d7956629 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -18,8 +18,6 @@ phiv = (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phiv); - p.boundaryField().updateCoeffs(); - surfaceScalarField phiGradp = rUAf*mesh.magSf()*fvc::snGrad(p); phiv -= phiGradp/rhof; diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index 0b2fb4ebf..77aa821d7 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -33,3 +33,6 @@ << " Max(alpha1) = " << max(alpha1).value() << endl; } + + +solve(fvm::ddt(rho) + fvc::div(rhoPhi)); diff --git a/applications/solvers/viscoelastic/viscoelasticFluidFoam/viscoelasticFluidFoam.C b/applications/solvers/viscoelastic/viscoelasticFluidFoam/viscoelasticFluidFoam.C index 1e1223dc7..f98a21b9d 100644 --- a/applications/solvers/viscoelastic/viscoelasticFluidFoam/viscoelasticFluidFoam.C +++ b/applications/solvers/viscoelastic/viscoelasticFluidFoam/viscoelasticFluidFoam.C @@ -79,7 +79,6 @@ int main(int argc, char *argv[]) solve(UEqn() == -fvc::grad(p)); - p.boundaryField().updateCoeffs(); volScalarField rUA = 1.0/UEqn().A(); U = rUA*UEqn().H(); UEqn.clear(); diff --git a/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C b/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C index 5e0d0ea3e..e1529d1ae 100644 --- a/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C +++ b/src/coupledMatrix/coupledFvMatrices/coupledFvMatrix/coupledFvMatrix.C @@ -198,7 +198,14 @@ Foam::coupledFvMatrix::solve(const dictionary& solverControls) { fvMatrix& curMatrix = static_cast& >(matrices[rowI]); - curMatrix.psi().internalField().replace(cmpt, psiCmpt[rowI]); + + GeometricField& psiRef = + const_cast&> + ( + curMatrix.psi() + ); + + psiRef.internalField().replace(cmpt, psiCmpt[rowI]); curMatrix.diag() = saveDiag[rowI]; } } @@ -206,9 +213,16 @@ Foam::coupledFvMatrix::solve(const dictionary& solverControls) // Correct boundary conditions forAll (matrices, rowI) { - fvMatrix& curMatrix = - static_cast& >(matrices[rowI]); - curMatrix.psi().correctBoundaryConditions(); + const fvMatrix& curMatrix = + static_cast&>(matrices[rowI]); + + GeometricField& psiRef = + const_cast&> + ( + curMatrix.psi() + ); + + psiRef.correctBoundaryConditions(); } return solverPerfVec; diff --git a/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C b/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C index d384d4692..7a5cd5b7e 100644 --- a/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C +++ b/src/coupledMatrix/coupledFvMatrices/coupledFvScalarMatrix/coupledFvScalarMatrix.C @@ -69,11 +69,13 @@ coupledSolverPerformance coupledFvMatrix::solve static_cast(matrices[rowI]); saveDiag.set(rowI, new scalarField(curMatrix.diag())); - // HR 17/Feb/2013 + // Need to be able to compare references to support hacks - // such as in jumpCyclic - // psi.set(rowI, new scalarField(curMatrix.psi())); - psi.set(rowI, &curMatrix.psi()); + // such as in jumpCyclic. HR 17/Feb/2013 + scalarField& psiRef = + const_cast(curMatrix.psi().internalField()); + + psi.set(rowI, &psiRef); source.set(rowI, new scalarField(curMatrix.source())); curMatrix.addBoundarySource(source[rowI], 0); @@ -114,27 +116,20 @@ coupledSolverPerformance coupledFvMatrix::solve solverPerf.print(); - // HR 17/Feb/2013 - // Not needed since reference is used - // Update solution - //forAll (matrices, rowI) - //{ - // fvScalarMatrix& curMatrix = - // static_cast(matrices[rowI]); - // - // curMatrix.psi().internalField() = psi[rowI]; - //} - // Correct boundary conditions forAll (matrices, rowI) { - fvScalarMatrix& curMatrix = - static_cast(matrices[rowI]); + const fvScalarMatrix& curMatrix = + static_cast(matrices[rowI]); - curMatrix.psi().correctBoundaryConditions(); + volScalarField& psiRef = + const_cast(curMatrix.psi()); + + psiRef.correctBoundaryConditions(); } - //HR 17.2.2013: Clear references to internal field without deleting the objects + // Clear references to internal field without deleting the objects + // HR 17.2.2013 forAll (matrices, rowI) { psi.set(rowI, NULL).ptr(); diff --git a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C index 1adfabef7..e8c7b725f 100644 --- a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C +++ b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.C @@ -296,7 +296,7 @@ template tmp > EulerLocalDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { const objectRegistry& registry = this->mesh(); @@ -342,7 +342,7 @@ tmp > EulerLocalDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { const objectRegistry& registry = this->mesh(); @@ -386,7 +386,7 @@ tmp > EulerLocalDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { const objectRegistry& registry = this->mesh(); diff --git a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H index 0ab283ca9..d376b0019 100644 --- a/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H +++ b/src/dbns/timeStepping/EulerLocalDdtScheme/EulerLocalDdtScheme.H @@ -133,19 +133,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C index 1b7f9ca52..624f9b721 100644 --- a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C +++ b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.C @@ -399,7 +399,7 @@ template tmp > backwardDualDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { const objectRegistry& registry = this->mesh(); @@ -479,7 +479,7 @@ tmp > backwardDualDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { const objectRegistry& registry = this->mesh(); @@ -557,7 +557,7 @@ tmp > backwardDualDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { const objectRegistry& registry = this->mesh(); diff --git a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H index 545876dd2..08e23ff9f 100644 --- a/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H +++ b/src/dbns/timeStepping/backwardDualDdtScheme/backwardDualDdtScheme.H @@ -165,19 +165,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrix.C b/src/finiteArea/faMatrices/faMatrix/faMatrix.C index 520f14791..1f5c9a5f5 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrix.C +++ b/src/finiteArea/faMatrices/faMatrix/faMatrix.C @@ -190,7 +190,7 @@ void faMatrix::addBoundarySource template faMatrix::faMatrix ( - GeometricField& psi, + const GeometricField& psi, const dimensionSet& ds ) : @@ -205,7 +205,7 @@ faMatrix::faMatrix { if (debug) { - Info<< "faMatrix(GeometricField&," + Info<< "faMatrix(const GeometricField&," " const dimensionSet&) : " "constructing faMatrix for field " << psi_.name() << endl; @@ -235,7 +235,13 @@ faMatrix::faMatrix ); } - psi_.boundaryField().updateCoeffs(); + // Update the boundary coefficients of psi without changing its event No. + GeometricField& psiRef = + const_cast&>(psi_); + + label currentStatePsi = psiRef.eventNo(); + psiRef.boundaryField().updateCoeffs(); + psiRef.eventNo() = currentStatePsi; } @@ -273,7 +279,7 @@ faMatrix::faMatrix(const faMatrix& fam) template faMatrix::faMatrix ( - GeometricField& psi, + const GeometricField& psi, Istream& is ) : @@ -288,7 +294,7 @@ faMatrix::faMatrix { if (debug) { - Info<< "faMatrix(GeometricField&," + Info<< "faMatrix(const GeometricField&," " Istream&) : " "constructing faMatrix for field " << psi_.name() << endl; diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrix.H b/src/finiteArea/faMatrices/faMatrix/faMatrix.H index 67f356a2c..b82f45509 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrix.H +++ b/src/finiteArea/faMatrices/faMatrix/faMatrix.H @@ -71,7 +71,7 @@ class faMatrix // Private data // Reference to GeometricField - GeometricField& psi_; + const GeometricField& psi_; //- Dimension set dimensionSet dimensions_; @@ -189,7 +189,7 @@ public: //- Construct given a field to solve for faMatrix ( - GeometricField&, + const GeometricField&, const dimensionSet& ); @@ -197,7 +197,11 @@ public: faMatrix(const faMatrix&); //- Construct from Istream given field to solve for - faMatrix(GeometricField&, Istream&); + faMatrix + ( + const GeometricField&, + Istream& + ); // Destructor @@ -214,11 +218,6 @@ public: return psi_; } - GeometricField& psi() - { - return psi_; - } - const dimensionSet& dimensions() const { return dimensions_; diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C index f70d111e5..d357ae08f 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C +++ b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C @@ -75,6 +75,10 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls) // HJ, 20/Nov/2007 lduInterfaceFieldPtrsList interfaces = psi_.boundaryField().interfaces(); + // Cast into a non-const to solve. HJ, 6/May/2016 + GeometricField& psi = + const_cast&>(psi_); + for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++) { // copy field and source @@ -139,11 +143,11 @@ lduSolverPerformance faMatrix::solve(const dictionary& solverControls) solverPerfVec = solverPerf; } - psi_.internalField().replace(cmpt, psiCmpt); + psi.internalField().replace(cmpt, psiCmpt); diag() = saveDiag; } - psi_.correctBoundaryConditions(); + psi.correctBoundaryConditions(); return solverPerfVec; } diff --git a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C index 9278f3948..dc4d5fa4c 100644 --- a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C +++ b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C @@ -113,14 +113,22 @@ lduSolverPerformance faMatrix::faSolver::solve faMat_.addBoundarySource(totalSource, false); solver_->read(solverControls); + + // Cast into a non-const to solve. HJ, 6/May/2016 + GeometricField& psi = + const_cast&> + ( + faMat_.psi() + ); + lduSolverPerformance solverPerf = - solver_->solve(faMat_.psi().internalField(), totalSource); + solver_->solve(psi.internalField(), totalSource); solverPerf.print(); faMat_.diag() = saveDiag; - faMat_.psi().correctBoundaryConditions(); + psi.correctBoundaryConditions(); return solverPerf; } @@ -139,6 +147,9 @@ lduSolverPerformance faMatrix::solve << endl; } + GeometricField& psi = + const_cast&>(psi_); + scalarField saveDiag = diag(); addBoundaryDiag(diag(), 0); @@ -158,13 +169,13 @@ lduSolverPerformance faMatrix::solve internalCoeffs_, interfaces, solverControls - )->solve(psi_.internalField(), totalSource); + )->solve(psi.internalField(), totalSource); solverPerf.print(); diag() = saveDiag; - psi_.correctBoundaryConditions(); + psi.correctBoundaryConditions(); return solverPerf; } diff --git a/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.H b/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.H index e4039f5ec..20abe4063 100644 --- a/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.H +++ b/src/finiteArea/finiteArea/convectionSchemes/faConvectionScheme/faConvectionScheme.H @@ -143,7 +143,7 @@ public: virtual tmp > famDiv ( const edgeScalarField&, - GeometricField& + const GeometricField& ) const = 0; virtual tmp > facDiv diff --git a/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.C b/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.C index 5572c8451..125064802 100644 --- a/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.C +++ b/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.C @@ -58,7 +58,7 @@ tmp > gaussConvectionScheme::famDiv ( const edgeScalarField& faceFlux, - GeometricField& vf + const GeometricField& vf ) const { tmp tweights = tinterpScheme_().weights(vf); diff --git a/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.H b/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.H index 42543ef97..77bcc062f 100644 --- a/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.H +++ b/src/finiteArea/finiteArea/convectionSchemes/gaussFaConvectionScheme/gaussFaConvectionScheme.H @@ -117,7 +117,7 @@ public: tmp > famDiv ( const edgeScalarField&, - GeometricField& + const GeometricField& ) const; tmp > facDiv diff --git a/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.C b/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.C index b46db55d1..679ae4522 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.C +++ b/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.C @@ -501,7 +501,7 @@ template tmp > EulerFaDdtScheme::famDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfam @@ -537,7 +537,7 @@ tmp > EulerFaDdtScheme::famDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam @@ -574,7 +574,7 @@ tmp > EulerFaDdtScheme::famDdt ( const areaScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam diff --git a/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.H b/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.H index d6a9918a9..c36f92251 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.H +++ b/src/finiteArea/finiteArea/ddtSchemes/EulerFaDdtScheme/EulerFaDdtScheme.H @@ -146,19 +146,19 @@ public: tmp > famDdt ( - GeometricField& + const GeometricField& ); tmp > famDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > famDdt ( const areaScalarField&, - GeometricField& + const GeometricField& ); }; diff --git a/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.C b/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.C index 544d589e0..5db447900 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.C +++ b/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.C @@ -700,7 +700,7 @@ template tmp > backwardFaDdtScheme::famDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfam @@ -752,7 +752,7 @@ tmp > backwardFaDdtScheme::famDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam @@ -803,7 +803,7 @@ tmp > backwardFaDdtScheme::famDdt ( const areaScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam diff --git a/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.H b/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.H index 57ff5495f..82f8e74d6 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.H +++ b/src/finiteArea/finiteArea/ddtSchemes/backwardFaDdtScheme/backwardFaDdtScheme.H @@ -157,19 +157,19 @@ public: tmp > famDdt ( - GeometricField& + const GeometricField& ); tmp > famDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > famDdt ( const areaScalarField&, - GeometricField& + const GeometricField& ); }; diff --git a/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.C b/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.C index df17357a6..b509d5056 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.C +++ b/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.C @@ -819,7 +819,7 @@ boundedBackwardFaDdtScheme::facDdt0 tmp boundedBackwardFaDdtScheme::famDdt ( - areaScalarField& vf + const areaScalarField& vf ) { tmp tfam @@ -890,7 +890,7 @@ tmp boundedBackwardFaDdtScheme::famDdt ( const dimensionedScalar& rho, - areaScalarField& vf + const areaScalarField& vf ) { tmp tfam @@ -960,7 +960,7 @@ tmp boundedBackwardFaDdtScheme::famDdt ( const areaScalarField& rho, - areaScalarField& vf + const areaScalarField& vf ) { tmp tfam diff --git a/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.H b/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.H index 9c7d4f13b..ce32745a2 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.H +++ b/src/finiteArea/finiteArea/ddtSchemes/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.H @@ -168,19 +168,19 @@ public: tmp famDdt ( - areaScalarField& + const areaScalarField& ); tmp famDdt ( const dimensionedScalar&, - areaScalarField& + const areaScalarField& ); tmp famDdt ( const areaScalarField&, - areaScalarField& + const areaScalarField& ); }; diff --git a/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.H b/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.H index 3a4278d42..7b7cbe5d7 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.H +++ b/src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.H @@ -190,19 +190,19 @@ public: virtual tmp > famDdt ( - GeometricField& + const GeometricField& ) = 0; virtual tmp > famDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ) = 0; virtual tmp > famDdt ( const areaScalarField&, - GeometricField& + const GeometricField& ) = 0; }; diff --git a/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.C b/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.C index ff1404f49..623aeb4e1 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.C +++ b/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.C @@ -308,7 +308,7 @@ template tmp > steadyStateFaDdtScheme::famDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfam @@ -329,7 +329,7 @@ tmp > steadyStateFaDdtScheme::famDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam @@ -350,7 +350,7 @@ tmp > steadyStateFaDdtScheme::famDdt ( const areaScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam diff --git a/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.H b/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.H index 8842e5bc2..fd21515ec 100644 --- a/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.H +++ b/src/finiteArea/finiteArea/ddtSchemes/steadyStateFaDdtScheme/steadyStateFaDdtScheme.H @@ -145,19 +145,19 @@ public: tmp > famDdt ( - GeometricField& + const GeometricField& ); tmp > famDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > famDdt ( const areaScalarField&, - GeometricField& + const GeometricField& ); }; diff --git a/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.H b/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.H index 22f738ee0..85c169ed7 100644 --- a/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.H +++ b/src/finiteArea/finiteArea/divSchemes/faDivScheme/faDivScheme.H @@ -162,17 +162,16 @@ public: // Add the patch constructor functions to the hash tables -#define makeFaDivTypeScheme(SS, Type) \ - \ -defineNamedTemplateTypeNameAndDebug(SS, 0); \ - \ -divScheme::addIstreamConstructorToTable > \ +#define makeFaDivTypeScheme(SS, Type) \ + \ +defineNamedTemplateTypeNameAndDebug(SS, 0); \ + \ +divScheme::addIstreamConstructorToTable > \ add##SS##Type##IstreamConstructorToTable_; - -#define makeFaDivScheme(SS) \ - \ -makeFaDivTypeScheme(SS, vector) \ +#define makeFaDivScheme(SS) \ + \ +makeFaDivTypeScheme(SS, vector) \ makeFaDivTypeScheme(SS, tensor) diff --git a/src/finiteArea/finiteArea/fam/famDdt.C b/src/finiteArea/finiteArea/fam/famDdt.C index 04300d7a1..6aa292d35 100644 --- a/src/finiteArea/finiteArea/fam/famDdt.C +++ b/src/finiteArea/finiteArea/fam/famDdt.C @@ -44,7 +44,7 @@ template tmp > ddt ( - GeometricField& vf + const GeometricField& vf ) { return fa::faDdtScheme::New @@ -60,7 +60,7 @@ tmp > ddt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { return fa::faDdtScheme::New @@ -79,7 +79,7 @@ tmp > ddt ( const areaScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { return fa::faDdtScheme::New diff --git a/src/finiteArea/finiteArea/fam/famDdt.H b/src/finiteArea/finiteArea/fam/famDdt.H index a17ba34c0..53355ed7c 100644 --- a/src/finiteArea/finiteArea/fam/famDdt.H +++ b/src/finiteArea/finiteArea/fam/famDdt.H @@ -52,21 +52,21 @@ namespace fam template tmp > ddt ( - GeometricField& + const GeometricField& ); template tmp > ddt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); template tmp > ddt ( const areaScalarField&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteArea/finiteArea/fam/famDiv.C b/src/finiteArea/finiteArea/fam/famDiv.C index b3a3f94d1..d7715994c 100644 --- a/src/finiteArea/finiteArea/fam/famDiv.C +++ b/src/finiteArea/finiteArea/fam/famDiv.C @@ -45,7 +45,7 @@ tmp > div ( const edgeScalarField& flux, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -62,7 +62,7 @@ tmp > div ( const tmp& tflux, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -77,7 +77,7 @@ tmp > div ( const edgeScalarField& flux, - GeometricField& vf + const GeometricField& vf ) { return fam::div(flux, vf, "div("+flux.name()+','+vf.name()+')'); @@ -88,7 +88,7 @@ tmp > div ( const tmp& tflux, - GeometricField& vf + const GeometricField& vf ) { tmp > Div(fam::div(tflux(), vf)); diff --git a/src/finiteArea/finiteArea/fam/famDiv.H b/src/finiteArea/finiteArea/fam/famDiv.H index bbd0fe22e..0e9ecb55c 100644 --- a/src/finiteArea/finiteArea/fam/famDiv.H +++ b/src/finiteArea/finiteArea/fam/famDiv.H @@ -55,7 +55,7 @@ namespace fam tmp > div ( const edgeScalarField&, - GeometricField&, + const GeometricField&, const word& name ); @@ -63,7 +63,7 @@ namespace fam tmp > div ( const tmp&, - GeometricField&, + const GeometricField&, const word& name ); @@ -71,14 +71,14 @@ namespace fam tmp > div ( const edgeScalarField&, - GeometricField& + const GeometricField& ); template tmp > div ( const tmp&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteArea/finiteArea/fam/famLaplacian.C b/src/finiteArea/finiteArea/fam/famLaplacian.C index 59bd8464b..05fddf196 100644 --- a/src/finiteArea/finiteArea/fam/famLaplacian.C +++ b/src/finiteArea/finiteArea/fam/famLaplacian.C @@ -45,7 +45,7 @@ template tmp > laplacian ( - GeometricField& vf + const GeometricField& vf ) { edgeScalarField Gamma @@ -69,7 +69,7 @@ template tmp > laplacian ( - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -95,7 +95,7 @@ tmp > laplacian ( const dimensionedScalar& gamma, - GeometricField& vf + const GeometricField& vf ) { edgeScalarField Gamma @@ -120,7 +120,7 @@ tmp > laplacian ( const dimensionedScalar& gamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -146,7 +146,7 @@ tmp > laplacian ( const areaScalarField& gamma, - GeometricField& vf + const GeometricField& vf ) { return fam::laplacian @@ -163,7 +163,7 @@ tmp > laplacian ( const areaScalarField& gamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -180,7 +180,7 @@ tmp > laplacian ( const tmp& tgamma, - GeometricField& vf + const GeometricField& vf ) { tmp > Laplacian(fam::laplacian(tgamma(), vf)); @@ -194,7 +194,7 @@ tmp > laplacian ( const tmp& tgamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -209,7 +209,7 @@ tmp > laplacian ( const edgeScalarField& gamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -226,7 +226,7 @@ tmp > laplacian ( const tmp& tgamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -241,7 +241,7 @@ tmp > laplacian ( const edgeScalarField& gamma, - GeometricField& vf + const GeometricField& vf ) { return fam::laplacian @@ -257,7 +257,7 @@ tmp > laplacian ( const tmp& tgamma, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam(fam::laplacian(tgamma(), vf)); @@ -271,7 +271,7 @@ tmp > laplacian ( const areaTensorField& gamma, - GeometricField& vf + const GeometricField& vf ) { const faMesh& mesh = vf.mesh(); @@ -289,7 +289,7 @@ tmp > laplacian ( const tmp& tgamma, - GeometricField& vf + const GeometricField& vf ) { tmp > Laplacian = fam::laplacian(tgamma(), vf); @@ -303,7 +303,7 @@ tmp > laplacian ( const edgeTensorField& gamma, - GeometricField& vf + const GeometricField& vf ) { const faMesh& mesh = vf.mesh(); @@ -320,7 +320,7 @@ tmp > laplacian ( const tmp& tgamma, - GeometricField& vf + const GeometricField& vf ) { tmp > Laplacian = fam::laplacian(tgamma(), vf); diff --git a/src/finiteArea/finiteArea/fam/famLaplacian.H b/src/finiteArea/finiteArea/fam/famLaplacian.H index 3c53ecdbf..4eb78e09f 100644 --- a/src/finiteArea/finiteArea/fam/famLaplacian.H +++ b/src/finiteArea/finiteArea/fam/famLaplacian.H @@ -53,14 +53,14 @@ namespace fam template tmp > laplacian ( - GeometricField& + const GeometricField& ); template tmp > laplacian ( - GeometricField&, + const GeometricField&, const word& ); @@ -69,7 +69,7 @@ namespace fam tmp > laplacian ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); @@ -77,7 +77,7 @@ namespace fam tmp > laplacian ( const dimensionedScalar&, - GeometricField&, + const GeometricField&, const word& ); @@ -86,14 +86,14 @@ namespace fam tmp > laplacian ( const areaScalarField&, - GeometricField& + const GeometricField& ); template tmp > laplacian ( const areaScalarField&, - GeometricField&, + const GeometricField&, const word& ); @@ -101,21 +101,21 @@ namespace fam tmp > laplacian ( const areaScalarField&, - GeometricField& + const GeometricField& ); template tmp > laplacian ( const tmp&, - GeometricField&, + const GeometricField&, const word& ); template tmp > laplacian ( const tmp&, - GeometricField&, + const GeometricField&, const word& ); @@ -124,7 +124,7 @@ namespace fam tmp > laplacian ( const edgeScalarField&, - GeometricField&, + const GeometricField&, const word& ); @@ -132,7 +132,7 @@ namespace fam tmp > laplacian ( const tmp&, - GeometricField&, + const GeometricField&, const word& ); @@ -141,14 +141,14 @@ namespace fam tmp > laplacian ( const edgeScalarField&, - GeometricField& + const GeometricField& ); template tmp > laplacian ( const tmp&, - GeometricField& + const GeometricField& ); @@ -156,14 +156,14 @@ namespace fam tmp > laplacian ( const areaTensorField&, - GeometricField& + const GeometricField& ); template tmp > laplacian ( const tmp&, - GeometricField& + const GeometricField& ); @@ -171,14 +171,14 @@ namespace fam tmp > laplacian ( const edgeTensorField&, - GeometricField& + const GeometricField& ); template tmp > laplacian ( const tmp&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteArea/finiteArea/fam/famSup.C b/src/finiteArea/finiteArea/fam/famSup.C index 200f58081..7984e1d65 100644 --- a/src/finiteArea/finiteArea/fam/famSup.C +++ b/src/finiteArea/finiteArea/fam/famSup.C @@ -47,7 +47,7 @@ tmp > Su ( const GeometricField& su, - GeometricField& vf + const GeometricField& vf ) { const faMesh& mesh = vf.mesh(); @@ -72,7 +72,7 @@ tmp > Su ( const tmp >& tsu, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam = fam::Su(tsu(), vf); @@ -86,7 +86,7 @@ tmp > Sp ( const areaScalarField& sp, - GeometricField& vf + const GeometricField& vf ) { const faMesh& mesh = vf.mesh(); @@ -111,7 +111,7 @@ tmp > Sp ( const tmp& tsp, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam = fam::Sp(tsp(), vf); @@ -125,7 +125,7 @@ tmp > Sp ( const dimensionedScalar& sp, - GeometricField& vf + const GeometricField& vf ) { const faMesh& mesh = vf.mesh(); @@ -151,7 +151,7 @@ tmp > SuSp ( const areaScalarField& sp, - GeometricField& vf + const GeometricField& vf ) { const faMesh& mesh = vf.mesh(); @@ -179,7 +179,7 @@ tmp > SuSp ( const tmp& tsp, - GeometricField& vf + const GeometricField& vf ) { tmp > tfam = fam::SuSp(tsp(), vf); diff --git a/src/finiteArea/finiteArea/fam/famSup.H b/src/finiteArea/finiteArea/fam/famSup.H index eb3aa7b02..86fd79198 100644 --- a/src/finiteArea/finiteArea/fam/famSup.H +++ b/src/finiteArea/finiteArea/fam/famSup.H @@ -55,14 +55,14 @@ namespace fam tmp > Su ( const GeometricField&, - GeometricField& + const GeometricField& ); template tmp > Su ( const tmp >&, - GeometricField& + const GeometricField& ); @@ -72,14 +72,14 @@ namespace fam tmp > Sp ( const areaScalarField&, - GeometricField& + const GeometricField& ); template tmp > Sp ( const tmp&, - GeometricField& + const GeometricField& ); @@ -87,7 +87,7 @@ namespace fam tmp > Sp ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); @@ -97,14 +97,14 @@ namespace fam tmp > SuSp ( const areaScalarField&, - GeometricField& + const GeometricField& ); template tmp > SuSp ( const tmp&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C index 38ff53a40..ffeb678a7 100644 --- a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C +++ b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.C @@ -103,7 +103,7 @@ tmp > laplacianScheme::famLaplacian ( const areaScalarField& gamma, - GeometricField& vf + const GeometricField& vf ) { return famLaplacian(tinterpGammaScheme_().interpolate(gamma)(), vf); diff --git a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.H b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.H index fe53ac7f2..940b8f9e3 100644 --- a/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.H +++ b/src/finiteArea/finiteArea/laplacianSchemes/faLaplacianScheme/faLaplacianScheme.H @@ -171,13 +171,13 @@ public: virtual tmp > famLaplacian ( const edgeScalarField&, - GeometricField& + const GeometricField& ) = 0; virtual tmp > famLaplacian ( const areaScalarField&, - GeometricField& + const GeometricField& ); virtual tmp > facLaplacian diff --git a/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.C b/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.C index d85ecf96f..cc30ea83a 100644 --- a/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.C +++ b/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.C @@ -44,7 +44,7 @@ tmp > gaussLaplacianScheme::famLaplacian ( const edgeScalarField& gamma, - GeometricField& vf + const GeometricField& vf ) { tmp tdeltaCoeffs = this->tlnGradScheme_().deltaCoeffs(vf); diff --git a/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.H b/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.H index 96c8abfb1..537374aa1 100644 --- a/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.H +++ b/src/finiteArea/finiteArea/laplacianSchemes/gaussFaLaplacianScheme/gaussFaLaplacianScheme.H @@ -92,7 +92,7 @@ public: tmp > famLaplacian ( const edgeScalarField&, - GeometricField& + const GeometricField& ); tmp > facLaplacian diff --git a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C index a58c687fa..1f791832e 100644 --- a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C +++ b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C @@ -45,12 +45,12 @@ bool Foam::adjustPhi ( surfaceScalarField& phi, const volVectorField& U, - volScalarField& p + const volScalarField& p ) { if (p.needReference()) { - p.boundaryField().updateCoeffs(); + // Removed updateCoeffs. HJ, 9/May/2016 scalar massIn = 0.0; scalar fixedMassOut = 0.0; diff --git a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.H b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.H index d7432a1ab..0ed0df74d 100644 --- a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.H +++ b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.H @@ -51,7 +51,7 @@ bool adjustPhi ( surfaceScalarField& phi, const volVectorField& U, - volScalarField& p + const volScalarField& p ); } // End namespace Foam diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index d6d658486..952b3b75d 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -242,7 +242,7 @@ void Foam::fvPatchField::evaluate(const Pstream::commsTypes) template -void Foam::fvPatchField::manipulateMatrix(fvMatrix& matrix) +void Foam::fvPatchField::manipulateMatrix(fvMatrix& matrix) const { // do nothing } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 60c5fbae5..3dc9a9ec4 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -463,7 +463,7 @@ public: // Matrix manipulation //- Manipulate matrix - virtual void manipulateMatrix(fvMatrix& matrix); + virtual void manipulateMatrix(fvMatrix& matrix) const; // I-O diff --git a/src/finiteVolume/finiteVolume/adjConvectionSchemes/adjConvectionScheme/adjConvectionScheme.H b/src/finiteVolume/finiteVolume/adjConvectionSchemes/adjConvectionScheme/adjConvectionScheme.H index 25e3efaf0..b81c73dee 100644 --- a/src/finiteVolume/finiteVolume/adjConvectionSchemes/adjConvectionScheme/adjConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/adjConvectionSchemes/adjConvectionScheme/adjConvectionScheme.H @@ -136,7 +136,7 @@ public: virtual tmp > fvmAdjDiv ( const volVectorField&, - GeometricField& + const GeometricField& ) const = 0; virtual tmp > fvcAdjDiv diff --git a/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.C b/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.C index 164cf9aaf..44f6db40b 100644 --- a/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.C @@ -45,7 +45,7 @@ tmp > explicitAdjConvectionScheme::fvmAdjDiv ( const volVectorField& Up, - GeometricField& vf + const GeometricField& vf ) const { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.H b/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.H index eff508ad8..4cfd059ed 100644 --- a/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/adjConvectionSchemes/explicitAdjConvectionScheme/explicitAdjConvectionScheme.H @@ -104,7 +104,7 @@ public: tmp > fvmAdjDiv ( const volVectorField&, - GeometricField& + const GeometricField& ) const; tmp > fvcAdjDiv diff --git a/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.C b/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.C index fb4b69315..e5f421e87 100644 --- a/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.C @@ -45,7 +45,7 @@ tmp > noAdjConvectionScheme::fvmAdjDiv ( const volVectorField& Up, - GeometricField& vf + const GeometricField& vf ) const { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.H b/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.H index c7a363035..e18158562 100644 --- a/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/adjConvectionSchemes/noAdjConvectionScheme/noAdjConvectionScheme.H @@ -104,7 +104,7 @@ public: tmp > fvmAdjDiv ( const volVectorField&, - GeometricField& + const GeometricField& ) const; tmp > fvcAdjDiv diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.H b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.H index f6abb25ff..b60089d08 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.H +++ b/src/finiteVolume/finiteVolume/convectionSchemes/convectionScheme/convectionScheme.H @@ -176,7 +176,7 @@ public: virtual tmp > fvmDiv ( const surfaceScalarField&, - GeometricField& + const GeometricField& ) const = 0; virtual tmp > fvcDiv diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.C index 5902fe27f..71d00ad18 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.C @@ -68,7 +68,7 @@ tmp > explicitConvectionScheme::fvmDiv ( const surfaceScalarField& faceFlux, - GeometricField& vf + const GeometricField& vf ) const { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.H b/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.H index 1ee13f8c9..e51e8d999 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/convectionSchemes/explicitConvectionScheme/explicitConvectionScheme.H @@ -127,7 +127,7 @@ public: tmp > fvmDiv ( const surfaceScalarField&, - GeometricField& + const GeometricField& ) const; tmp > fvcDiv diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C index 2d74ffe6f..9c7149dcc 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C @@ -68,7 +68,7 @@ tmp > gaussConvectionScheme::fvmDiv ( const surfaceScalarField& faceFlux, - GeometricField& vf + const GeometricField& vf ) const { tmp tweights = tinterpScheme_().weights(vf); diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H index 8fa4fc42b..b9df2df1c 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H @@ -123,7 +123,7 @@ public: tmp > fvmDiv ( const surfaceScalarField&, - GeometricField& + const GeometricField& ) const; tmp > fvcDiv diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.C index 20ef05348..8385bfcf1 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.C @@ -80,7 +80,7 @@ tmp > multivariateGaussConvectionScheme::fvmDiv ( const surfaceScalarField& faceFlux, - GeometricField& vf + const GeometricField& vf ) const { return gaussConvectionScheme diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.H b/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.H index ad864e833..38e238fd4 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/convectionSchemes/multivariateGaussConvectionScheme/multivariateGaussConvectionScheme.H @@ -113,7 +113,7 @@ public: tmp > fvmDiv ( const surfaceScalarField&, - GeometricField& + const GeometricField& ) const; tmp > fvcDiv diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.C index 18a8641ff..925962312 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.C @@ -86,7 +86,7 @@ tmp > noConvectionScheme::fvmDiv ( const surfaceScalarField& faceFlux, - GeometricField& vf + const GeometricField& vf ) const { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.H b/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.H index b46a26a10..720e855d5 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/convectionSchemes/noConvectionScheme/noConvectionScheme.H @@ -117,7 +117,7 @@ public: tmp > fvmDiv ( const surfaceScalarField&, - GeometricField& + const GeometricField& ) const; tmp > fvcDiv diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C index 174b698c6..15d8a3b88 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.C @@ -231,7 +231,7 @@ template tmp > EulerD2dt2Scheme::fvmD2dt2 ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -291,7 +291,7 @@ tmp > EulerD2dt2Scheme::fvmD2dt2 ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -352,7 +352,7 @@ tmp > EulerD2dt2Scheme::fvmD2dt2 ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.H b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.H index 3a928d301..0c879c96d 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.H +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/EulerD2dt2Scheme/EulerD2dt2Scheme.H @@ -108,19 +108,19 @@ public: tmp > fvmD2dt2 ( - GeometricField& + const GeometricField& ); tmp > fvmD2dt2 ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmD2dt2 ( const volScalarField&, - GeometricField& + const GeometricField& ); }; diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.C index 2c5860c68..246cf87ad 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.C @@ -55,7 +55,10 @@ scalar backwardD2dt2Scheme::deltaT0_() const template -scalar backwardD2dt2Scheme::deltaT0_(GeometricField& vf) const +scalar backwardD2dt2Scheme::deltaT0_ +( + const GeometricField& vf +) const { // Bug fix, Zeljko Tukovic: solver with outer iterations over a time-step // HJ, 12/Feb/2010 @@ -228,7 +231,7 @@ template tmp > backwardD2dt2Scheme::fvmD2dt2 ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -256,7 +259,7 @@ backwardD2dt2Scheme::fvmD2dt2 notImplemented ( type() - + "::fvmD2dt2(GeometricField& vf)" + + "::fvmD2dt2(const GeometricField& vf)" ); } else @@ -284,7 +287,7 @@ tmp > backwardD2dt2Scheme::fvmD2dt2 ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -315,7 +318,7 @@ backwardD2dt2Scheme::fvmD2dt2 + "::fvcD2dt2" + "(" + "const dimensionedScalar& rho, " - + "GeometricField& vf" + + "const GeometricField& vf" + ")" ); } @@ -339,7 +342,7 @@ tmp > backwardD2dt2Scheme::fvmD2dt2 ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.H b/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.H index 29cfe89e2..77d25ea23 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.H +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/backwardD2dt2Scheme/backwardD2dt2Scheme.H @@ -67,7 +67,10 @@ class backwardD2dt2Scheme //- Return the previous time-step or GREAT if the old timestep field // wasn't available in which case Euler ddt is used - scalar deltaT0_(GeometricField&) const; + scalar deltaT0_ + ( + const GeometricField& + ) const; //- Disallow default bitwise copy construct backwardD2dt2Scheme(const backwardD2dt2Scheme&); @@ -118,19 +121,19 @@ public: tmp > fvmD2dt2 ( - GeometricField& + const GeometricField& ); tmp > fvmD2dt2 ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmD2dt2 ( const volScalarField&, - GeometricField& + const GeometricField& ); }; diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.H b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.H index 2cd74a8b7..dd6f20dcf 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.H +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/d2dt2Scheme/d2dt2Scheme.H @@ -152,19 +152,19 @@ public: virtual tmp > fvmD2dt2 ( - GeometricField& + const GeometricField& ) = 0; virtual tmp > fvmD2dt2 ( const dimensionedScalar&, - GeometricField& + const GeometricField& ) = 0; virtual tmp > fvmD2dt2 ( const volScalarField&, - GeometricField& + const GeometricField& ) = 0; }; diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.C b/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.C index eec013c45..8919afeb1 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.C +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.C @@ -106,7 +106,7 @@ template tmp > steadyStateD2dt2Scheme::fvmD2dt2 ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -127,7 +127,7 @@ tmp > steadyStateD2dt2Scheme::fvmD2dt2 ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -148,7 +148,7 @@ tmp > steadyStateD2dt2Scheme::fvmD2dt2 ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.H b/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.H index 39fa50215..9abd68eaa 100644 --- a/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.H +++ b/src/finiteVolume/finiteVolume/d2dt2Schemes/steadyStateD2dt2Scheme/steadyStateD2dt2Scheme.H @@ -107,19 +107,19 @@ public: tmp > fvmD2dt2 ( - GeometricField& + const GeometricField& ); tmp > fvmD2dt2 ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmD2dt2 ( const volScalarField&, - GeometricField& + const GeometricField& ); }; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C index 6cd38efc9..e0d9c9abd 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C @@ -368,7 +368,7 @@ template tmp > CoEulerDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -404,7 +404,7 @@ tmp > CoEulerDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -441,7 +441,7 @@ tmp > CoEulerDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H index 771af1af1..bca19b6bb 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H @@ -141,19 +141,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C index ab541d8d5..76cc2c644 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C @@ -624,7 +624,7 @@ template tmp > CrankNicolsonDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { DDt0Field >& ddt0 = @@ -708,7 +708,7 @@ tmp > CrankNicolsonDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { DDt0Field >& ddt0 = @@ -790,7 +790,7 @@ tmp > CrankNicolsonDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { DDt0Field >& ddt0 = diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H index 36ce441a3..36d011218 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H @@ -212,19 +212,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C index b6e92c12d..9abdebdb3 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C @@ -261,7 +261,7 @@ template tmp > EulerDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -297,7 +297,7 @@ tmp > EulerDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -334,7 +334,7 @@ tmp > EulerDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H index 7161cbb8b..82111d62f 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H @@ -119,19 +119,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C index afcb1e51c..85159a43d 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C @@ -371,7 +371,7 @@ template tmp > SLTSDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -409,7 +409,7 @@ tmp > SLTSDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -446,7 +446,7 @@ tmp > SLTSDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H index c13b45152..7e16397dc 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H @@ -142,19 +142,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C index e8ce56d43..78756e0a9 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C @@ -362,7 +362,7 @@ template tmp > backwardDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -414,7 +414,7 @@ tmp > backwardDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -465,7 +465,7 @@ tmp > backwardDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H index 4e45b5ddd..f5a77db60 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H @@ -130,19 +130,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C index caa4b1d55..fcbddb4c6 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C @@ -412,7 +412,7 @@ boundedBackwardDdtScheme::fvcDdt tmp boundedBackwardDdtScheme::fvmDdt ( - volScalarField& vf + const volScalarField& vf ) { tmp tfvm @@ -483,7 +483,7 @@ tmp boundedBackwardDdtScheme::fvmDdt ( const dimensionedScalar& rho, - volScalarField& vf + const volScalarField& vf ) { tmp tfvm @@ -553,7 +553,7 @@ tmp boundedBackwardDdtScheme::fvmDdt ( const volScalarField& rho, - volScalarField& vf + const volScalarField& vf ) { tmp tfvm diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.H index 8cca75bd3..c446d9fd7 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedBackwardDdtScheme/boundedBackwardDdtScheme.H @@ -141,19 +141,19 @@ public: tmp fvmDdt ( - volScalarField& + const volScalarField& ); tmp fvmDdt ( const dimensionedScalar&, - volScalarField& + const volScalarField& ); tmp fvmDdt ( const volScalarField&, - volScalarField& + const volScalarField& ); tmp fvcDdtPhiCorr diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H index c81e0f3fb..7eab6e0fe 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H @@ -163,19 +163,19 @@ public: virtual tmp > fvmDdt ( - GeometricField& + const GeometricField& ) = 0; virtual tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ) = 0; virtual tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ) = 0; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.C index 137813cef..33c94f7e0 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.C @@ -373,7 +373,7 @@ template tmp > steadyInertialDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -409,7 +409,7 @@ tmp > steadyInertialDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -446,7 +446,7 @@ tmp > steadyInertialDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.H index 1dead26c7..84ecbc8c8 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/steadyInertialDdtScheme/steadyInertialDdtScheme.H @@ -142,19 +142,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.C index 8d1a410dc..a59762167 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.C @@ -161,7 +161,7 @@ template tmp > steadyStateDdtScheme::fvmDdt ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -182,7 +182,7 @@ tmp > steadyStateDdtScheme::fvmDdt ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm @@ -203,7 +203,7 @@ tmp > steadyStateDdtScheme::fvmDdt ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.H index 2f68e812a..360de16f2 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.H @@ -118,19 +118,19 @@ public: tmp > fvmDdt ( - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); tmp > fvmDdt ( const volScalarField&, - GeometricField& + const GeometricField& ); typedef typename ddtScheme::fluxFieldType fluxFieldType; diff --git a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C index e5b3b9f2c..cddd04f91 100644 --- a/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C +++ b/src/finiteVolume/finiteVolume/divSchemes/divScheme/divScheme.C @@ -112,7 +112,7 @@ divScheme::fvmUDiv ( "tmp divScheme::fvmDiv\n" "(\n" - " GeometricField&" + " const GeometricField&" ")\n" ) << "Implicit div operator currently defined only for Gauss linear. " << abort(FatalError); @@ -144,7 +144,7 @@ divScheme::fvmUDiv "tmp divScheme::fvmDiv\n" "(\n" " surfaceScalarField&" - " GeometricField&" + " const GeometricField&" ")\n" ) << "Implicit div operator currently defined only for Gauss linear. " << abort(FatalError); diff --git a/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.C b/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.C index 61ae80300..85dbe1c58 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.C @@ -43,7 +43,7 @@ tmp > adjDiv ( const volVectorField& Up, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -60,7 +60,7 @@ tmp > adjDiv ( const tmp& tUp, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -75,7 +75,7 @@ tmp > adjDiv ( const volVectorField& Up, - GeometricField& vf + const GeometricField& vf ) { return fvm::adjDiv(Up, vf, "adjDiv("+Up.name()+','+vf.name()+')'); @@ -86,7 +86,7 @@ tmp > adjDiv ( const tmp& tUp, - GeometricField& vf + const GeometricField& vf ) { tmp > AdjDiv(fvm::adjDiv(tUp(), vf)); diff --git a/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.H b/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.H index 0fb840598..5a7b96165 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.H +++ b/src/finiteVolume/finiteVolume/fvm/fvmAdjDiv.H @@ -55,7 +55,7 @@ namespace fvm tmp > adjDiv ( const volVectorField&, - GeometricField&, + const GeometricField&, const word& name ); @@ -63,7 +63,7 @@ namespace fvm tmp > adjDiv ( const tmp&, - GeometricField&, + const GeometricField&, const word& name ); @@ -72,14 +72,14 @@ namespace fvm tmp > adjDiv ( const volVectorField&, - GeometricField& + const GeometricField& ); template tmp > adjDiv ( const tmp&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.C b/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.C index 75192b99d..2a7e844c6 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.C @@ -44,7 +44,7 @@ template tmp > d2dt2 ( - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -61,7 +61,7 @@ tmp > d2dt2 ( const dimensionedScalar& rho, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -78,7 +78,7 @@ tmp > d2dt2 ( const volScalarField& rho, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -94,7 +94,7 @@ template tmp > d2dt2 ( - GeometricField& vf + const GeometricField& vf ) { return fvm::d2dt2(vf, "d2dt2(" + vf.name() + ')'); @@ -106,7 +106,7 @@ tmp > d2dt2 ( const dimensionedScalar& rho, - GeometricField& vf + const GeometricField& vf ) { return fvm::d2dt2(rho, vf, "d2dt2(" + rho.name() + ',' + vf.name() + ')'); @@ -118,7 +118,7 @@ tmp > d2dt2 ( const volScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { return fvm::d2dt2(rho, vf, "d2dt2(" + rho.name() + ',' + vf.name() + ')'); diff --git a/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.H b/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.H index 29eafef45..07da40f4b 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.H +++ b/src/finiteVolume/finiteVolume/fvm/fvmD2dt2.H @@ -53,14 +53,14 @@ namespace fvm tmp > d2dt2 ( const dimensionedScalar&, - GeometricField&, + const GeometricField&, const word& name ); template tmp > d2dt2 ( - GeometricField&, + const GeometricField&, const word& name ); @@ -68,7 +68,7 @@ namespace fvm tmp > d2dt2 ( const volScalarField&, - GeometricField&, + const GeometricField&, const word& name ); @@ -76,21 +76,21 @@ namespace fvm tmp > d2dt2 ( const dimensionedScalar&, - GeometricField&, + const GeometricField&, const word& name ); template tmp > d2dt2 ( - GeometricField& + const GeometricField& ); template tmp > d2dt2 ( const volScalarField&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmDdt.H b/src/finiteVolume/finiteVolume/fvm/fvmDdt.H index 906a04ef1..3a113c4eb 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmDdt.H +++ b/src/finiteVolume/finiteVolume/fvm/fvmDdt.H @@ -53,7 +53,7 @@ namespace fvm template tmp > ddt ( - GeometricField&, + const GeometricField&, const word& name ); @@ -61,7 +61,7 @@ namespace fvm tmp > ddt ( const geometricOneField&, - GeometricField&, + const GeometricField&, const word& name ); @@ -69,7 +69,7 @@ namespace fvm tmp > ddt ( const dimensionedScalar&, - GeometricField&, + const GeometricField&, const word& name ); @@ -77,35 +77,35 @@ namespace fvm tmp > ddt ( const volScalarField&, - GeometricField&, + const GeometricField&, const word& name ); template tmp > ddt ( - GeometricField& + const GeometricField& ); template tmp > ddt ( const geometricOneField&, - GeometricField& + const GeometricField& ); template tmp > ddt ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); template tmp > ddt ( const volScalarField&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmDiv.C b/src/finiteVolume/finiteVolume/fvm/fvmDiv.C index 69123bfd5..13c31bc42 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmDiv.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmDiv.C @@ -45,7 +45,7 @@ tmp > div ( const surfaceScalarField& rho, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -63,7 +63,7 @@ tmp > div ( const tmp& trho, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -78,7 +78,7 @@ tmp > div ( const surfaceScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { return fvm::div(rho, vf, "div(" + rho.name() + ',' + vf.name() + ')'); @@ -90,7 +90,7 @@ tmp > div ( const tmp& trho, - GeometricField& vf + const GeometricField& vf ) { tmp > Div(fvm::div(trho(), vf)); @@ -105,7 +105,7 @@ tmp BlockLduSystem::type> > UDiv ( - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -124,7 +124,7 @@ tmp > UDiv ( const surfaceScalarField& rho, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -143,7 +143,7 @@ tmp > UDiv ( const tmp& trho, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -163,7 +163,7 @@ tmp BlockLduSystem::type> > UDiv ( - GeometricField& vf + const GeometricField& vf ) { return fvm::UDiv @@ -181,7 +181,7 @@ tmp > UDiv ( const surfaceScalarField& rho, - GeometricField& vf + const GeometricField& vf ) { return fvm::UDiv @@ -200,7 +200,7 @@ tmp > UDiv ( const tmp& trho, - GeometricField& vf + const GeometricField& vf ) { tmp diff --git a/src/finiteVolume/finiteVolume/fvm/fvmDiv.H b/src/finiteVolume/finiteVolume/fvm/fvmDiv.H index 3a1be601e..c00ea91dc 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmDiv.H +++ b/src/finiteVolume/finiteVolume/fvm/fvmDiv.H @@ -56,7 +56,7 @@ namespace fvm tmp > div ( const surfaceScalarField&, - GeometricField&, + const GeometricField&, const word& name ); @@ -64,7 +64,7 @@ namespace fvm tmp > div ( const tmp&, - GeometricField&, + const GeometricField&, const word& name ); @@ -72,14 +72,14 @@ namespace fvm tmp > div ( const surfaceScalarField&, - GeometricField& + const GeometricField& ); template tmp > div ( const tmp&, - GeometricField& + const GeometricField& ); // Implicit div operators for block systems @@ -89,7 +89,7 @@ namespace fvm BlockLduSystem::type> > UDiv ( - GeometricField&, + const GeometricField&, const word& ); @@ -100,7 +100,7 @@ namespace fvm > UDiv ( const surfaceScalarField&, - GeometricField&, + const GeometricField&, const word& ); @@ -111,7 +111,7 @@ namespace fvm > UDiv ( const tmp&, - GeometricField&, + const GeometricField&, const word& ); @@ -121,7 +121,7 @@ namespace fvm BlockLduSystem::type> > UDiv ( - GeometricField& + const GeometricField& ); template @@ -131,7 +131,7 @@ namespace fvm > UDiv ( const surfaceScalarField&, - GeometricField& + const GeometricField& ); template @@ -141,7 +141,7 @@ namespace fvm > UDiv ( const tmp&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmGrad.C b/src/finiteVolume/finiteVolume/fvm/fvmGrad.C index bb2d55c8a..483b6e65b 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmGrad.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmGrad.C @@ -44,7 +44,7 @@ tmp BlockLduSystem::type> > grad ( - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -62,7 +62,7 @@ tmp BlockLduSystem::type> > grad ( - GeometricField& vf + const GeometricField& vf ) { return fvm::grad diff --git a/src/finiteVolume/finiteVolume/fvm/fvmGrad.H b/src/finiteVolume/finiteVolume/fvm/fvmGrad.H index 6541ba76f..938b454f8 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmGrad.H +++ b/src/finiteVolume/finiteVolume/fvm/fvmGrad.H @@ -25,7 +25,8 @@ InNamespace Foam::fvm Description - Calculate the BlockLduSystem (matrix & source) for the gradient of the field + Calculate the BlockLduSystem (matrix & source) for the gradient + of the field. Intended use: block coupled solvers. i.e. implicit grad(p) in momentum equation. @@ -61,7 +62,7 @@ namespace fvm BlockLduSystem::type> > grad ( - GeometricField&, + const GeometricField&, const word& ); @@ -71,7 +72,7 @@ namespace fvm BlockLduSystem::type> > grad ( - GeometricField& + const GeometricField& ); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C b/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C index a2254cf0e..5d1b2c294 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.C @@ -42,7 +42,7 @@ template tmp > laplacian ( - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -67,7 +67,7 @@ template tmp > laplacian ( - GeometricField& vf + const GeometricField& vf ) { surfaceScalarField Gamma @@ -97,7 +97,7 @@ tmp > laplacian ( const zeroField&, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -113,7 +113,7 @@ tmp > laplacian ( const zeroField&, - GeometricField& vf + const GeometricField& vf ) { return tmp > @@ -128,7 +128,7 @@ tmp > laplacian ( const geometricOneField&, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -141,7 +141,7 @@ tmp > laplacian ( const geometricOneField&, - GeometricField& vf + const GeometricField& vf ) { return fvm::laplacian(vf); @@ -153,7 +153,7 @@ tmp > laplacian ( const dimensioned& gamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -179,7 +179,7 @@ tmp > laplacian ( const dimensioned& gamma, - GeometricField& vf + const GeometricField& vf ) { GeometricField Gamma @@ -206,7 +206,7 @@ tmp > laplacian ( const GeometricField& gamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -223,7 +223,7 @@ tmp > laplacian ( const tmp >& tgamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -238,7 +238,7 @@ tmp > laplacian ( const GeometricField& gamma, - GeometricField& vf + const GeometricField& vf ) { return fvm::laplacian @@ -255,7 +255,7 @@ tmp > laplacian ( const tmp >& tgamma, - GeometricField& vf + const GeometricField& vf ) { tmp > Laplacian(fvm::laplacian(tgamma(), vf)); @@ -271,7 +271,7 @@ tmp > laplacian ( const GeometricField& gamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -288,7 +288,7 @@ tmp > laplacian ( const tmp >& tgamma, - GeometricField& vf, + const GeometricField& vf, const word& name ) { @@ -303,7 +303,7 @@ tmp > laplacian ( const GeometricField& gamma, - GeometricField& vf + const GeometricField& vf ) { return fvm::laplacian @@ -320,7 +320,7 @@ tmp > laplacian ( const tmp >& tGamma, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm(fvm::laplacian(tGamma(), vf)); diff --git a/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.H b/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.H index 77a147d1e..e1704bdc9 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.H +++ b/src/finiteVolume/finiteVolume/fvm/fvmLaplacian.H @@ -54,14 +54,14 @@ namespace fvm template tmp > laplacian ( - GeometricField&, + const GeometricField&, const word& ); template tmp > laplacian ( - GeometricField& + const GeometricField& ); @@ -69,7 +69,7 @@ namespace fvm tmp > laplacian ( const zeroField&, - GeometricField&, + const GeometricField&, const word& ); @@ -77,7 +77,7 @@ namespace fvm tmp > laplacian ( const zeroField&, - GeometricField& + const GeometricField& ); @@ -85,7 +85,7 @@ namespace fvm tmp > laplacian ( const geometricOneField&, - GeometricField&, + const GeometricField&, const word& ); @@ -93,7 +93,7 @@ namespace fvm tmp > laplacian ( const geometricOneField&, - GeometricField& + const GeometricField& ); @@ -101,7 +101,7 @@ namespace fvm tmp > laplacian ( const dimensioned&, - GeometricField&, + const GeometricField&, const word& ); @@ -109,7 +109,7 @@ namespace fvm tmp > laplacian ( const dimensioned&, - GeometricField& + const GeometricField& ); @@ -117,7 +117,7 @@ namespace fvm tmp > laplacian ( const GeometricField&, - GeometricField&, + const GeometricField&, const word& ); @@ -125,7 +125,7 @@ namespace fvm tmp > laplacian ( const GeometricField&, - GeometricField& + const GeometricField& ); @@ -133,7 +133,7 @@ namespace fvm tmp > laplacian ( const tmp >&, - GeometricField&, + const GeometricField&, const word& ); @@ -141,7 +141,7 @@ namespace fvm tmp > laplacian ( const tmp >&, - GeometricField& + const GeometricField& ); @@ -149,7 +149,7 @@ namespace fvm tmp > laplacian ( const GeometricField&, - GeometricField&, + const GeometricField&, const word& ); @@ -157,7 +157,7 @@ namespace fvm tmp > laplacian ( const tmp >&, - GeometricField&, + const GeometricField&, const word& ); @@ -165,14 +165,14 @@ namespace fvm tmp > laplacian ( const GeometricField&, - GeometricField& + const GeometricField& ); template tmp > laplacian ( const tmp >&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteVolume/finiteVolume/fvm/fvmSup.C b/src/finiteVolume/finiteVolume/fvm/fvmSup.C index ed3ff8a8e..517b412f8 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmSup.C +++ b/src/finiteVolume/finiteVolume/fvm/fvmSup.C @@ -34,7 +34,7 @@ Foam::tmp > Foam::fvm::Su ( const DimensionedField& su, - GeometricField& vf + const GeometricField& vf ) { const fvMesh& mesh = vf.mesh(); @@ -59,7 +59,7 @@ Foam::tmp > Foam::fvm::Su ( const tmp >& tsu, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm = fvm::Su(tsu(), vf); @@ -72,7 +72,7 @@ Foam::tmp > Foam::fvm::Su ( const tmp >& tsu, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm = fvm::Su(tsu(), vf); @@ -85,7 +85,7 @@ Foam::zeroField Foam::fvm::Su ( const zeroField&, - GeometricField& vf + const GeometricField& vf ) { return zeroField(); @@ -97,7 +97,7 @@ Foam::tmp > Foam::fvm::Sp ( const DimensionedField& sp, - GeometricField& vf + const GeometricField& vf ) { const fvMesh& mesh = vf.mesh(); @@ -122,7 +122,7 @@ Foam::tmp > Foam::fvm::Sp ( const tmp >& tsp, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm = fvm::Sp(tsp(), vf); @@ -135,7 +135,7 @@ Foam::tmp > Foam::fvm::Sp ( const tmp& tsp, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm = fvm::Sp(tsp(), vf); @@ -149,7 +149,7 @@ Foam::tmp > Foam::fvm::Sp ( const dimensionedScalar& sp, - GeometricField& vf + const GeometricField& vf ) { const fvMesh& mesh = vf.mesh(); @@ -174,7 +174,7 @@ Foam::zeroField Foam::fvm::Sp ( const zeroField&, - GeometricField& + const GeometricField& ) { return zeroField(); @@ -186,7 +186,7 @@ Foam::tmp > Foam::fvm::SuSp ( const DimensionedField& susp, - GeometricField& vf + const GeometricField& vf ) { const fvMesh& mesh = vf.mesh(); @@ -214,7 +214,7 @@ Foam::tmp > Foam::fvm::SuSp ( const tmp >& tsusp, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm = fvm::SuSp(tsusp(), vf); @@ -227,7 +227,7 @@ Foam::tmp > Foam::fvm::SuSp ( const tmp& tsusp, - GeometricField& vf + const GeometricField& vf ) { tmp > tfvm = fvm::SuSp(tsusp(), vf); @@ -240,7 +240,7 @@ Foam::zeroField Foam::fvm::SuSp ( const zeroField&, - GeometricField& vf + const GeometricField& vf ) { return zeroField(); diff --git a/src/finiteVolume/finiteVolume/fvm/fvmSup.H b/src/finiteVolume/finiteVolume/fvm/fvmSup.H index 13836bc0a..fc1a9f165 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvmSup.H +++ b/src/finiteVolume/finiteVolume/fvm/fvmSup.H @@ -55,28 +55,28 @@ namespace fvm tmp > Su ( const DimensionedField&, - GeometricField& + const GeometricField& ); template tmp > Su ( const tmp >&, - GeometricField& + const GeometricField& ); template tmp > Su ( const tmp >&, - GeometricField& + const GeometricField& ); template zeroField Su ( const zeroField&, - GeometricField& + const GeometricField& ); @@ -86,21 +86,21 @@ namespace fvm tmp > Sp ( const DimensionedField&, - GeometricField& + const GeometricField& ); template tmp > Sp ( const tmp >&, - GeometricField& + const GeometricField& ); template tmp > Sp ( const tmp&, - GeometricField& + const GeometricField& ); @@ -108,7 +108,7 @@ namespace fvm tmp > Sp ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); @@ -116,7 +116,7 @@ namespace fvm zeroField Sp ( const zeroField&, - GeometricField& + const GeometricField& ); @@ -126,28 +126,28 @@ namespace fvm tmp > SuSp ( const DimensionedField&, - GeometricField& + const GeometricField& ); template tmp > SuSp ( const tmp >&, - GeometricField& + const GeometricField& ); template tmp > SuSp ( const tmp&, - GeometricField& + const GeometricField& ); template zeroField SuSp ( const zeroField&, - GeometricField& + const GeometricField& ); } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index fe1bf712b..0dfe7e70e 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -297,8 +297,9 @@ gradScheme::fvmGrad "(\n" " GeometricField&" ")\n" - ) << "Implicit gradient operator currently defined only for Gauss linear " - << "and leastSquares (cell and face limiters are optional)." + ) << "Implicit gradient operator currently defined only for " + << "Gauss linear and leastSquares " + << "(cell and face limiters are optional)." << abort(FatalError); typedef typename outerProduct::type GradType; diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C index c898508d5..3023d47e4 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C @@ -46,7 +46,7 @@ tmp > gaussLaplacianScheme::fvmLaplacianUncorrected ( const surfaceScalarField& gammaMagSf, - GeometricField& vf + const GeometricField& vf ) { tmp tdeltaCoeffs = @@ -103,8 +103,8 @@ gaussLaplacianScheme::gammaSnGradCorr IOobject::NO_WRITE ), mesh, - SfGammaCorr.dimensions() - *vf.dimensions()*mesh.deltaCoeffs().dimensions() + SfGammaCorr.dimensions()* + vf.dimensions()*mesh.deltaCoeffs().dimensions() ) ); @@ -148,18 +148,19 @@ tmp > gaussLaplacianScheme::fvmLaplacian ( const GeometricField& gamma, - GeometricField& vf + const GeometricField& vf ) { const fvMesh& mesh = this->mesh(); - surfaceVectorField Sn = mesh.Sf()/mesh.magSf(); + const surfaceVectorField Sn(mesh.Sf()/mesh.magSf()); - surfaceVectorField SfGamma = mesh.Sf() & gamma; - GeometricField SfGammaSn = - SfGamma & Sn; - - surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn; + const surfaceVectorField SfGamma(mesh.Sf() & gamma); + const GeometricField SfGammaSn + ( + SfGamma & Sn + ); + const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn); tmp > tfvm = fvmLaplacianUncorrected(SfGammaSn, vf); fvMatrix& fvm = tfvm(); @@ -194,15 +195,13 @@ gaussLaplacianScheme::fvcLaplacian { const fvMesh& mesh = this->mesh(); - surfaceVectorField Sn = mesh.Sf()/mesh.magSf(); - - surfaceVectorField SfGamma = mesh.Sf() & gamma; - GeometricField SfGammaSn + const surfaceVectorField Sn(mesh.Sf()/mesh.magSf()); + const surfaceVectorField SfGamma(mesh.Sf() & gamma); + const GeometricField SfGammaSn ( SfGamma & Sn ); - - surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn; + const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn); tmp > tLaplacian ( diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.H b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.H index fcac0c31a..83e65fc08 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.H +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.H @@ -61,7 +61,7 @@ class gaussLaplacianScheme tmp > fvmLaplacianUncorrected ( const surfaceScalarField& gammaMagSf, - GeometricField& + const GeometricField& ); tmp > gammaSnGradCorr @@ -125,7 +125,7 @@ public: tmp > fvmLaplacian ( const GeometricField&, - GeometricField& + const GeometricField& ); tmp > fvcLaplacian @@ -145,7 +145,7 @@ template<> \ tmp > gaussLaplacianScheme::fvmLaplacian \ ( \ const GeometricField&, \ - GeometricField& \ + const GeometricField& \ ); \ \ template<> \ diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C index 6c3b60101..136186377 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianSchemes.C @@ -43,7 +43,7 @@ Foam::tmp > \ Foam::fv::gaussLaplacianScheme::fvmLaplacian \ ( \ const GeometricField& gamma, \ - GeometricField& vf \ + const GeometricField& vf \ ) \ { \ const fvMesh& mesh = this->mesh(); \ diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C index 202a29a88..daf9c25c9 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.C @@ -101,7 +101,7 @@ tmp > laplacianScheme::fvmLaplacian ( const GeometricField& gamma, - GeometricField& vf + const GeometricField& vf ) { return fvmLaplacian(tinterpGammaScheme_().interpolate(gamma)(), vf); diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H index 86ce5e686..9d655fce9 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/laplacianScheme/laplacianScheme.H @@ -172,13 +172,13 @@ public: virtual tmp > fvmLaplacian ( const GeometricField&, - GeometricField& + const GeometricField& ) = 0; virtual tmp > fvmLaplacian ( const GeometricField&, - GeometricField& + const GeometricField& ); virtual tmp > fvcLaplacian @@ -212,28 +212,28 @@ public: // Add the patch constructor functions to the hash tables -#define makeFvLaplacianTypeScheme(SS, Type, GType) \ - \ - typedef SS SS##Type##GType; \ - defineNamedTemplateTypeNameAndDebug(SS##Type##GType, 0); \ - \ - laplacianScheme:: \ - addIstreamConstructorToTable > \ +#define makeFvLaplacianTypeScheme(SS, Type, GType) \ + \ + typedef SS SS##Type##GType; \ + defineNamedTemplateTypeNameAndDebug(SS##Type##GType, 0); \ + \ + laplacianScheme:: \ + addIstreamConstructorToTable > \ add##SS##Type##GType##IstreamConstructorToTable_; -#define makeFvLaplacianScheme(SS) \ - \ -makeFvLaplacianTypeScheme(SS, scalar, scalar) \ -makeFvLaplacianTypeScheme(SS, scalar, symmTensor) \ -makeFvLaplacianTypeScheme(SS, scalar, tensor) \ -makeFvLaplacianTypeScheme(SS, vector, scalar) \ -makeFvLaplacianTypeScheme(SS, sphericalTensor, scalar) \ -makeFvLaplacianTypeScheme(SS, symmTensor, scalar) \ -makeFvLaplacianTypeScheme(SS, symmTensor, symmTensor) \ -makeFvLaplacianTypeScheme(SS, tensor, scalar) \ -makeFvLaplacianTypeScheme(SS, vector, tensor) \ -makeFvLaplacianTypeScheme(SS, vector, diagTensor) \ +#define makeFvLaplacianScheme(SS) \ + \ +makeFvLaplacianTypeScheme(SS, scalar, scalar) \ +makeFvLaplacianTypeScheme(SS, scalar, symmTensor) \ +makeFvLaplacianTypeScheme(SS, scalar, tensor) \ +makeFvLaplacianTypeScheme(SS, vector, scalar) \ +makeFvLaplacianTypeScheme(SS, sphericalTensor, scalar) \ +makeFvLaplacianTypeScheme(SS, symmTensor, scalar) \ +makeFvLaplacianTypeScheme(SS, symmTensor, symmTensor) \ +makeFvLaplacianTypeScheme(SS, tensor, scalar) \ +makeFvLaplacianTypeScheme(SS, vector, tensor) \ +makeFvLaplacianTypeScheme(SS, vector, diagTensor) \ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.C index 4d6d77426..0133501e5 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.C @@ -78,7 +78,7 @@ tmp > noLaplacianScheme::fvmLaplacian ( const GeometricField& gamma, - GeometricField& vf + const GeometricField& vf ) { const surfaceScalarField& deltaCoeffs = this->mesh().deltaCoeffs(); diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.H b/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.H index b996b71b9..22c324a07 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.H +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/noLaplacianScheme/noLaplacianScheme.H @@ -116,7 +116,7 @@ public: tmp > fvmLaplacian ( const GeometricField&, - GeometricField& + const GeometricField& ); tmp > fvcLaplacian diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C index b20771336..a346307b0 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.C @@ -52,6 +52,32 @@ correctedSnGrad::~correctedSnGrad() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +Foam::tmp > +Foam::fv::correctedSnGrad::fullGradCorrection +( + const GeometricField& vf +) const +{ + const fvMesh& mesh = this->mesh(); + + // construct GeometricField + tmp > tssf = + mesh.correctionVectors() + & linear::type>(mesh).interpolate + ( + gradScheme::New + ( + mesh, + mesh.schemesDict().gradScheme("grad(" + vf.name() + ')') + )().grad(vf, "grad(" + vf.name() + ')') + ); + tssf().rename("snGradCorr(" + vf.name() + ')'); + + return tssf; +} + + template tmp > correctedSnGrad::correction @@ -85,21 +111,8 @@ correctedSnGrad::correction ssf.replace ( cmpt, - mesh.correctionVectors() - & linear - < - typename - outerProduct::cmptType>::type - >(mesh).interpolate - ( - gradScheme::cmptType>::New - ( - mesh, - mesh.schemesDict().gradScheme(ssf.name()) - )() - //gaussGrad::cmptType>(mesh) - .grad(vf.component(cmpt)) - ) + correctedSnGrad::cmptType>(mesh) + .fullGradCorrection(vf.component(cmpt)) ); } diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.H b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.H index eb9a717e5..36090435a 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrad.H @@ -84,9 +84,8 @@ public: {} - // Destructor - - virtual ~correctedSnGrad(); + //- Destructor + virtual ~correctedSnGrad(); // Member Functions @@ -107,12 +106,40 @@ public: } //- Return the explicit correction to the correctedSnGrad - // for the given field + // for the given field using the gradient of the field + // This is needed for use of cached gradient when possible + // HJ, 6/May/2016 + tmp > + fullGradCorrection + ( + const GeometricField& + ) const; + + //- Return the explicit correction to the correctedSnGrad + // for the given field using the gradients of the field components virtual tmp > correction(const GeometricField&) const; }; +// * * * * * * * * Template Member Function Specialisations * * * * * * * * // + +// This is needed for use of cached gradient when possible +// HJ, 6/May/2016 +template<> +tmp correctedSnGrad::correction +( + const volScalarField& vsf +) const; + + +template<> +tmp correctedSnGrad::correction +( + const volVectorField& vvf +) const; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fv diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrads.C b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrads.C index 985dd20e9..e6f39e72c 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrads.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/correctedSnGrad/correctedSnGrads.C @@ -39,4 +39,27 @@ namespace fv } } + +template<> +Foam::tmp +Foam::fv::correctedSnGrad::correction +( + const volScalarField& vsf +) const +{ + return fullGradCorrection(vsf); +} + + +template<> +Foam::tmp +Foam::fv::correctedSnGrad::correction +( + const volVectorField& vvf +) const +{ + return fullGradCorrection(vvf); +} + + // ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 2b16f6776..e52be5a91 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -246,7 +246,7 @@ void Foam::fvMatrix::correctImplicitBoundarySource template Foam::fvMatrix::fvMatrix ( - GeometricField& psi, + const GeometricField& psi, const dimensionSet& ds ) : @@ -261,9 +261,12 @@ Foam::fvMatrix::fvMatrix { if (debug) { - Info<< "fvMatrix(GeometricField&," - " const dimensionSet&) : " - "constructing fvMatrix for field " << psi_.name() + InfoIn + ( + "fvMatrix(" + "const GeometricField&," + "const dimensionSet&)" + ) << "constructing fvMatrix for field " << psi_.name() << endl; } @@ -291,7 +294,13 @@ Foam::fvMatrix::fvMatrix ); } - psi_.boundaryField().updateCoeffs(); + // Update the boundary coefficients of psi without changing its event No. + GeometricField& psiRef = + const_cast&>(psi_); + + label currentStatePsi = psiRef.eventNo(); + psiRef.boundaryField().updateCoeffs(); + psiRef.eventNo() = currentStatePsi; } @@ -388,7 +397,7 @@ Foam::fvMatrix::fvMatrix(const tmp >& tfvm) template Foam::fvMatrix::fvMatrix ( - GeometricField& psi, + const GeometricField& psi, Istream& is ) : @@ -477,12 +486,17 @@ void Foam::fvMatrix::setValues const unallocLabelList& nei = mesh.neighbour(); scalarField& Diag = diag(); + Field& psi = + const_cast + < + GeometricField& + >(psi_).internalField(); forAll(cellLabels, i) { label celli = cellLabels[i]; - psi_[celli] = values[i]; + psi[celli] = values[i]; source_[celli] = values[i]*Diag[celli]; if (symmetric() || asymmetric()) @@ -715,7 +729,7 @@ void Foam::fvMatrix::completeAssembly() assemblyCompleted_ = true; - typename GeometricField:: + const typename GeometricField:: GeometricBoundaryField& bFields = psi_.boundaryField(); forAll(bFields, patchI) diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H index 2aa0c8ea0..fb3b23394 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H @@ -115,7 +115,7 @@ class fvMatrix // Private data // Reference to GeometricField - GeometricField& psi_; + const GeometricField& psi_; //- Dimension set dimensionSet dimensions_; @@ -187,7 +187,7 @@ public: //- Construct given a field to solve for fvMatrix ( - GeometricField&, + const GeometricField&, const dimensionSet& ); @@ -200,7 +200,11 @@ public: # endif //- Construct from Istream given field to solve for - fvMatrix(GeometricField&, Istream&); + fvMatrix + ( + const GeometricField&, + Istream& + ); //- Clone @@ -227,11 +231,6 @@ public: return psi_; } - GeometricField& psi() - { - return psi_; - } - const dimensionSet& dimensions() const { return dimensions_; diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index 003d85fd8..089cf34fe 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -102,6 +102,10 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix::solve // HJ, 20/Nov/2007 lduInterfaceFieldPtrsList interfaces = psi_.boundaryField().interfaces(); + // Cast into a non-const to solve. HJ, 6/May/2016 + GeometricField& psi = + const_cast&>(psi_); + for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++) { if (validComponents[cmpt] == -1) continue; @@ -160,11 +164,11 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix::solve solverPerfVec = solverPerf; } - psi_.internalField().replace(cmpt, psiCmpt); + psi.internalField().replace(cmpt, psiCmpt); diag() = saveDiag; } - psi_.correctBoundaryConditions(); + psi.correctBoundaryConditions(); return solverPerfVec; } diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C index fc75343b1..4986dfc48 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -60,7 +60,7 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix::solve const dictionary& solverControls ) { - profilingTrigger profSolve("fvMatrix::solve_"+psi_.name()); + profilingTrigger profSolve("fvMatrix::solve_" + psi_.name()); if (debug) { @@ -82,6 +82,10 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix::solve // HJ, 20/Nov/2007 lduInterfaceFieldPtrsList interfaces = psi_.boundaryField().interfaces(); + // Cast into a non-const to solve. HJ, 6/May/2016 + GeometricField& psi = + const_cast&>(psi_); + // Solver call lduSolverPerformance solverPerf = lduSolver::New ( @@ -91,14 +95,14 @@ Foam::lduMatrix::solverPerformance Foam::fvMatrix::solve internalCoeffs_, interfaces, solverControls - )->solve(psi_.internalField(), totalSource); + )->solve(psi.internalField(), totalSource); solverPerf.print(); // Diagonal has been restored, clear complete assembly flag? diag() = saveDiag; - psi_.correctBoundaryConditions(); + psi.correctBoundaryConditions(); return solverPerf; } diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.C b/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.C index 39b46ffcc..9b8f77d59 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.C +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.C @@ -36,7 +36,7 @@ License void Foam::immersedBoundaryAdjustPhi ( surfaceScalarField& phi, - volVectorField& U + const volVectorField& U ) { const fvMesh& mesh = phi.mesh(); diff --git a/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.H b/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.H index 9ef2007fa..13be2682a 100644 --- a/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.H +++ b/src/immersedBoundary/immersedBoundary/immersedBoundaryAdjustPhi/immersedBoundaryAdjustPhi.H @@ -47,7 +47,7 @@ namespace Foam void immersedBoundaryAdjustPhi ( surfaceScalarField& phi, - volVectorField& U + const volVectorField& U ); } // End namespace Foam diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.C b/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.C index 4277b8a99..ddac7e9c1 100644 --- a/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.C +++ b/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.C @@ -47,7 +47,7 @@ const label tetFemMatrix::fixFillIn = 4; template tetFemMatrix::tetFemMatrix ( - GeometricField& psi, + const GeometricField& psi, const dimensionSet& ds ) : @@ -93,7 +93,7 @@ tetFemMatrix::tetFemMatrix(const tetFemMatrix& tetFem) template tetFemMatrix::tetFemMatrix ( - GeometricField& psi, + const GeometricField& psi, Istream& is ) : diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.H b/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.H index f5011aeb5..37e550dd6 100644 --- a/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.H +++ b/src/tetFiniteElement/tetFemMatrix/tetFemMatrix.H @@ -72,7 +72,7 @@ class tetFemMatrix // Private data //- Reference to GeometricField - GeometricField& psi_; + const GeometricField& psi_; //- Dimension set dimensionSet dimensions_; @@ -154,7 +154,7 @@ public: //- Construct given a field to solve for tetFemMatrix ( - GeometricField&, + const GeometricField&, const dimensionSet& ); @@ -164,7 +164,7 @@ public: //- Construct from Istream given field to solve for tetFemMatrix ( - GeometricField&, + const GeometricField&, Istream& ); @@ -184,11 +184,6 @@ public: return psi_; } - GeometricField& psi() - { - return psi_; - } - const dimensionSet& dimensions() const { return dimensions_; diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C b/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C index cbd908e6c..d872bd627 100644 --- a/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C +++ b/src/tetFiniteElement/tetFemMatrix/tetFemMatrixSolve.C @@ -77,6 +77,13 @@ lduSolverPerformance tetFemMatrix::solve // HJ, 20/Nov/2007 lduInterfaceFieldPtrsList interfaces = psi_.boundaryField().interfaces(); + // Cast into a non-const to solve. HJ, 6/May/2016 + GeometricField& psi = + const_cast&> + ( + psi_ + ); + for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++) { if (validComponents[cmpt] == -1) continue; @@ -154,7 +161,7 @@ lduSolverPerformance tetFemMatrix::solve solverPerfVec = solverPerf; } - psi_.internalField().replace(cmpt, psiCmpt); + psi.internalField().replace(cmpt, psiCmpt); reconstructMatrix(); } @@ -165,7 +172,7 @@ lduSolverPerformance tetFemMatrix::solve << endl; } - psi_.correctBoundaryConditions(); + psi.correctBoundaryConditions(); return solverPerfVec; } diff --git a/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C b/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C index 8d1fdacd5..91c2b9447 100644 --- a/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C +++ b/src/tetFiniteElement/tetFemMatrix/tetFemScalarMatrix.C @@ -58,11 +58,18 @@ lduSolverPerformance tetFemMatrix::solve // Store the boundary coefficients for insertion of boundary conditions storeBoundaryCoeffs(); + // Cast into a non-const to solve. HJ, 6/May/2016 + GeometricField& psi = + const_cast&> + ( + psi_ + ); + // Set component boundary conditions scalarField sourceCpy = source_; // Store the boundary coefficients for insertion of boundary conditions - setComponentBoundaryConditions(0, psi_, sourceCpy); + setComponentBoundaryConditions(0, psi, sourceCpy); // Add the coupling coefficients addCouplingCoeffs(); @@ -109,7 +116,7 @@ lduSolverPerformance tetFemMatrix::solve coupledIntCoeffs, interfaces, solverControls - )->solve(psi_.internalField(), sourceCpy); + )->solve(psi.internalField(), sourceCpy); solverPerf.print(); @@ -122,7 +129,7 @@ lduSolverPerformance tetFemMatrix::solve << endl; } - psi_.correctBoundaryConditions(); + psi.correctBoundaryConditions(); return solverPerf; } @@ -138,7 +145,11 @@ tmp tetFemMatrix::residual() // Set component boundary conditions scalarField sourceCpy = source_; - setComponentBoundaryConditions(0, psi_, sourceCpy); + // Make a copy of psi to make sure it is not corrupted + // HJ, 6/May/2016 + scalarField psiCpy = psi_; + + setComponentBoundaryConditions(0, psiCpy, sourceCpy); // Add the coupling coefficients addCouplingCoeffs(); diff --git a/src/tetFiniteElement/tetFemMethod/tetFem.C b/src/tetFiniteElement/tetFemMethod/tetFem.C index aad9db9fc..04f032547 100644 --- a/src/tetFiniteElement/tetFemMethod/tetFem.C +++ b/src/tetFiniteElement/tetFemMethod/tetFem.C @@ -42,7 +42,7 @@ namespace Foam template tmp > tetFem::laplacian ( - GeometricField& vf + const GeometricField& vf ) { elementScalarField Gamma @@ -66,7 +66,7 @@ template tmp > tetFem::laplacian ( const elementScalarField& gamma, - GeometricField& vf + const GeometricField& vf ) { const tetPolyMesh& mesh = vf.mesh(); @@ -182,7 +182,7 @@ tmp > tetFem::laplacian template tmp > tetFem::smoother ( - GeometricField& vf + const GeometricField& vf ) { tmp > tfem @@ -207,7 +207,7 @@ template tmp > tetFem::laplacian ( const dimensionedScalar& gamma, - GeometricField& vf + const GeometricField& vf ) { elementScalarField Gamma @@ -230,7 +230,7 @@ tmp > tetFem::laplacian template tmp > tetFem::laplacianTranspose ( - GeometricField& vf + const GeometricField& vf ) { elementScalarField Gamma @@ -254,7 +254,7 @@ template tmp > tetFem::laplacianTranspose ( const elementScalarField& gamma, - GeometricField& vf + const GeometricField& vf ) { const tetPolyMesh& mesh = vf.mesh(); @@ -399,7 +399,7 @@ template tmp > tetFem::laplacianTranspose ( const dimensionedScalar& gamma, - GeometricField& vf + const GeometricField& vf ) { elementScalarField Gamma @@ -423,7 +423,7 @@ template tmp > tetFem::laplacianTrace ( const elementScalarField& gamma, - GeometricField& vf + const GeometricField& vf ) { const tetPolyMesh& mesh = vf.mesh(); @@ -564,7 +564,7 @@ template tmp > tetFem::laplacianTrace ( const dimensionedScalar& gamma, - GeometricField& vf + const GeometricField& vf ) { elementScalarField Gamma @@ -587,7 +587,7 @@ tmp > tetFem::laplacianTrace template tmp > tetFem::laplacianTrace ( - GeometricField& vf + const GeometricField& vf ) { elementScalarField Gamma diff --git a/src/tetFiniteElement/tetFemMethod/tetFem.H b/src/tetFiniteElement/tetFemMethod/tetFem.H index aaba2ff69..8b121350b 100644 --- a/src/tetFiniteElement/tetFemMethod/tetFem.H +++ b/src/tetFiniteElement/tetFemMethod/tetFem.H @@ -46,7 +46,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Namespace tetFem functions Declaration + Namespace tetFem functions Declaration \*---------------------------------------------------------------------------*/ namespace tetFem @@ -56,66 +56,66 @@ namespace tetFem template static tmp > laplacian ( - GeometricField& + const GeometricField& ); template static tmp > laplacian ( const elementScalarField&, - GeometricField& + const GeometricField& ); template static tmp > smoother ( - GeometricField& + const GeometricField& ); template static tmp > laplacian ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); template static tmp > laplacianTranspose ( - GeometricField& + const GeometricField& ); template static tmp > laplacianTranspose ( const elementScalarField&, - GeometricField& + const GeometricField& ); template static tmp > laplacianTranspose ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); template static tmp > laplacianTrace ( - GeometricField& + const GeometricField& ); template static tmp > laplacianTrace ( const elementScalarField&, - GeometricField& + const GeometricField& ); template static tmp > laplacianTrace ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); }; diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes index c9329c21e..ec4614be9 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes @@ -34,6 +34,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; div((nuEff*dev(grad(U).T()))) Gauss linear; + div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes @@ -60,4 +61,12 @@ fluxRequired p; } +cacheFields +{ + grad(U); + grad(p); + grad(k); + grad(omega); +} + // ************************************************************************* //