diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index b2722a466c..132f8dbb1a 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -100,7 +100,19 @@ int main(int argc, char *argv[]) ); pEqn.setReference(pRefCell, pRefValue); - pEqn.solve(); + + if + ( + corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + { + pEqn.solve(mesh.solver("pFinal")); + } + else + { + pEqn.solve(); + } if (nonOrth == nNonOrthCorr) { diff --git a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C index 13ef29ed9b..23490b1547 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C +++ b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C @@ -308,7 +308,7 @@ Foam::SVD::SVD(const scalarRectangularMatrix& A, const scalar minCondition) g = rv1[nm]; scalar h = rv1[k]; scalar f = ((y - z)*(y + z) + (g - h)*(g + h))/(2.0*h*y); - g = sqrtSumSqr(f, 1.0); + g = sqrtSumSqr(f, scalar(1)); f = ((x - z)*(x + z) + h*((y/(f + sign(g, f))) - h))/x; scalar c = 1.0; s = 1.0; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index a8138828fd..b2c04cd24f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -143,7 +143,7 @@ void Foam::processorPolyPatch::initGeometry() ( Pstream::blocking, neighbProcNo(), - + 3*(sizeof(label) + size()*sizeof(vector)) + 3*(sizeof(label) + size()*sizeof(vector) + sizeof(float)) ); toNeighbProc @@ -163,7 +163,7 @@ void Foam::processorPolyPatch::calcGeometry() ( Pstream::blocking, neighbProcNo(), - 3*(sizeof(label) + size()*sizeof(vector)) + 3*(sizeof(label) + size()*sizeof(vector) + sizeof(float)) ); fromNeighbProc >> neighbFaceCentres_ @@ -582,7 +582,7 @@ bool Foam::processorPolyPatch::order transformedCtrs = masterCtrs-v[0]; } else - { + { transformedCtrs = masterCtrs-v; } matchedAll = matchPoints @@ -605,7 +605,7 @@ bool Foam::processorPolyPatch::order masterAnchors -= v[0]; } else - { + { masterAnchors -= v; } } diff --git a/src/OpenFOAM/primitives/uint/uintIO.C b/src/OpenFOAM/primitives/uint/uintIO.C index a40d4b7f5f..d63f1eced3 100644 --- a/src/OpenFOAM/primitives/uint/uintIO.C +++ b/src/OpenFOAM/primitives/uint/uintIO.C @@ -65,7 +65,7 @@ Istream& operator>>(Istream& is, unsigned int& i) if (t.isLabel()) { - i = unsigned(t.labelToken()); + i = static_cast(t.labelToken()); } else { diff --git a/src/OpenFOAM/primitives/ulong/ulongIO.C b/src/OpenFOAM/primitives/ulong/ulongIO.C index 9311bf0c82..251d36919e 100644 --- a/src/OpenFOAM/primitives/ulong/ulongIO.C +++ b/src/OpenFOAM/primitives/ulong/ulongIO.C @@ -44,7 +44,6 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Return a string representation of an ulong word name(const unsigned long i) { std::ostringstream osBuffer; @@ -66,7 +65,7 @@ Istream& operator>>(Istream& is, unsigned long& i) if (t.isLabel()) { - i = ulong(t.labelToken()); + i = static_cast(t.labelToken()); } else { diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C index b58c9557d4..6912872c9b 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C @@ -119,12 +119,12 @@ void SpalartAllmarasIDDES::dTildaUpdate(const volScalarField& S) 2.0*(pos(alpha)*pow(expTerm, -11.09) + neg(alpha)*pow(expTerm, -9.0)); - volScalarField fStep = min(2.0*pow(expTerm, -9.0), 1.0); + volScalarField fStep = min(2.0*pow(expTerm, -9.0), scalar(1)); volScalarField fHyb = max(1.0 - fd(S), fStep); volScalarField fAmp = 1.0 - max(ft(S), fl(S)); - volScalarField fRestore = max(fHill - 1.0, 0.0)*fAmp; + volScalarField fRestore = max(fHill - 1.0, scalar(0))*fAmp; // volScalarField ft2 = IGNORING ft2 terms @@ -132,7 +132,7 @@ void SpalartAllmarasIDDES::dTildaUpdate(const volScalarField& S) ( min ( - 100.0, + scalar(100), (1.0 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*fv2())/max(SMALL, fv1()) ) ); diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C index ab02061c5d..5ce0d72532 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -139,7 +139,7 @@ void nuSgsSpalartAllmarasWallFunctionFvPatchScalarField::evaluate do { - scalar kUu = min(kappa*magUpara/utau, 100); + scalar kUu = min(kappa*magUpara/utau, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f =