diff --git a/applications/solvers/combustion/chemFoam/createBaseFields.H b/applications/solvers/combustion/chemFoam/createBaseFields.H index 0762f2708d..80dea2584b 100644 --- a/applications/solvers/combustion/chemFoam/createBaseFields.H +++ b/applications/solvers/combustion/chemFoam/createBaseFields.H @@ -54,4 +54,3 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl; T.write(); } - diff --git a/applications/solvers/combustion/chemFoam/setDeltaT.H b/applications/solvers/combustion/chemFoam/setDeltaT.H index 46d9f7bf43..52407c9475 100644 --- a/applications/solvers/combustion/chemFoam/setDeltaT.H +++ b/applications/solvers/combustion/chemFoam/setDeltaT.H @@ -3,4 +3,3 @@ if (adjustTimeStep) runTime.setDeltaT(min(dtChem, maxDeltaT)); Info<< "deltaT = " << runTime.deltaT().value() << endl; } - diff --git a/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H b/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H index 5ddbdab95e..7f280b8aa3 100644 --- a/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H +++ b/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H @@ -1,4 +1,3 @@ const dictionary& Bpiso = mesh.solutionDict().subDict("BPISO"); const int nBcorr = Bpiso.lookupOrDefault("nCorrectors", 1); - diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H index 616fabd7fe..66fd738d7a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H @@ -2,4 +2,3 @@ const int nNonOrthCorr = simple.lookupOrDefault("nNonOrthogonalCorrectors", 0); - diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index 20bb4fa240..b6a9fd853b 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -182,6 +182,11 @@ if (alphaApplyPrevCorr && MULESCorr) { talphaPhiCorr0 = alphaPhi - talphaPhiCorr0; + talphaPhiCorr0.ref().rename("alphaPhiCorr0"); + } + else + { + talphaPhiCorr0.clear(); } if diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 3663697976..b2b468456a 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,6 +128,9 @@ int main(int argc, char *argv[]) << runTime.elapsedCpuTime() - timeBeforeMeshUpdate << " s" << endl; + // Do not apply previous time-step mesh compression flux + talphaPhiCorr0.clear(); + gh = (g & mesh.C()) - ghRef; ghf = (g & mesh.Cf()) - ghRef; } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index be4def509e..798e9c2eb6 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,11 +64,8 @@ void Foam::multiphaseSystem::solveAlphas() forAllIter(PtrDictionary, phases_, iter) { - phaseModel& phase1 = iter(); - volScalarField& alpha1 = phase1; - - phase1.alphaPhi() = - dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0); + phaseModel& phase = iter(); + volScalarField& alpha1 = phase; alphaPhiCorrs.set ( @@ -79,7 +76,7 @@ void Foam::multiphaseSystem::solveAlphas() fvc::flux ( phi_, - phase1, + phase, "div(phi," + alpha1.name() + ')' ) ) @@ -92,13 +89,13 @@ void Foam::multiphaseSystem::solveAlphas() phaseModel& phase2 = iter2(); volScalarField& alpha2 = phase2; - if (&phase2 == &phase1) continue; + if (&phase2 == &phase) continue; - surfaceScalarField phir(phase1.phi() - phase2.phi()); + surfaceScalarField phir(phase.phi() - phase2.phi()); scalarCoeffSymmTable::const_iterator cAlpha ( - cAlphas_.find(interfacePair(phase1, phase2)) + cAlphas_.find(interfacePair(phase, phase2)) ); if (cAlpha != cAlphas_.end()) @@ -108,7 +105,7 @@ void Foam::multiphaseSystem::solveAlphas() (mag(phi_) + mag(phir))/mesh_.magSf() ); - phir += min(cAlpha()*phic, max(phic))*nHatf(phase1, phase2); + phir += min(cAlpha()*phic, max(phic))*nHatf(phase, phase2); } word phirScheme @@ -119,39 +116,18 @@ void Foam::multiphaseSystem::solveAlphas() alphaPhiCorr += fvc::flux ( -fvc::flux(-phir, phase2, phirScheme), - phase1, + phase, phirScheme ); } - surfaceScalarField::Boundary& alphaPhiCorrBf = - alphaPhiCorr.boundaryFieldRef(); - - // Ensure that the flux at inflow BCs is preserved - forAll(alphaPhiCorrBf, patchi) - { - fvsPatchScalarField& alphaPhiCorrp = alphaPhiCorrBf[patchi]; - - if (!alphaPhiCorrp.coupled()) - { - const scalarField& phi1p = phase1.phi().boundaryField()[patchi]; - const scalarField& alpha1p = alpha1.boundaryField()[patchi]; - - forAll(alphaPhiCorrp, facei) - { - if (phi1p[facei] < 0) - { - alphaPhiCorrp[facei] = alpha1p[facei]*phi1p[facei]; - } - } - } - } + phase.correctInflowOutflow(alphaPhiCorr); MULES::limit ( 1.0/mesh_.time().deltaT().value(), geometricOneField(), - phase1, + phase, phi_, alphaPhiCorr, zeroField(), @@ -182,29 +158,30 @@ void Foam::multiphaseSystem::solveAlphas() forAllIter(PtrDictionary, phases_, iter) { - phaseModel& phase1 = iter(); + phaseModel& phase = iter(); surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei]; - alphaPhi += upwind(mesh_, phi_).flux(phase1); + alphaPhi += upwind(mesh_, phi_).flux(phase); + phase.correctInflowOutflow(alphaPhi); MULES::explicitSolve ( geometricOneField(), - phase1, + phase, alphaPhi, zeroField(), zeroField() ); - phase1.alphaPhi() += alphaPhi; + phase.alphaPhi() = alphaPhi; - Info<< phase1.name() << " volume fraction, min, max = " - << phase1.weightedAverage(mesh_.V()).value() - << ' ' << min(phase1).value() - << ' ' << max(phase1).value() + Info<< phase.name() << " volume fraction, min, max = " + << phase.weightedAverage(mesh_.V()).value() + << ' ' << min(phase).value() + << ' ' << max(phase).value() << endl; - sumAlpha += phase1; + sumAlpha += phase; phasei++; } @@ -215,6 +192,15 @@ void Foam::multiphaseSystem::solveAlphas() << ' ' << max(sumAlpha).value() << endl; + // Correct the sum of the phase-fractions to avoid 'drift' + volScalarField sumCorr(1.0 - sumAlpha); + forAllIter(PtrDictionary, phases_, iter) + { + phaseModel& phase = iter(); + volScalarField& alpha = phase; + alpha += alpha*sumCorr; + } + calcAlphas(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C index f8b323346f..a1990a88c9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -236,6 +236,24 @@ bool Foam::phaseModel::read(const dictionary& phaseDict) } +void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const +{ + surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef(); + const volScalarField::Boundary& alphaBf = boundaryField(); + const surfaceScalarField::Boundary& phiBf = phi().boundaryField(); + + forAll(alphaPhiBf, patchi) + { + fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi]; + + if (!alphaPhip.coupled()) + { + alphaPhip = phiBf[patchi]*alphaBf[patchi]; + } + } +} + + Foam::tmp Foam::phaseModel::d() const { return dPtr_().d(); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H index d1f1157b9a..90e48183ca 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -208,6 +208,9 @@ public: return alphaPhi_; } + //- Ensure that the flux at inflow/outflow BCs is preserved + void correctInflowOutflow(surfaceScalarField& alphaPhi) const; + //- Correct the phase properties void correct(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 5dd59dead1..21b5edefe4 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -681,6 +681,14 @@ void Foam::multiphaseMixture::solveAlphas << ' ' << max(sumAlpha).value() << endl; + // Correct the sum of the phase-fractions to avoid 'drift' + volScalarField sumCorr(1.0 - sumAlpha); + forAllIter(PtrDictionary, phases_, iter) + { + phase& alpha = iter(); + alpha += alpha*sumCorr; + } + calcAlphas(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C index 435bb7df2a..de32766bc6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,9 +86,7 @@ Foam::interfaceCompositionModels::Saturated::update ( const volScalarField& Tf ) -{ - // do nothing -} +{} template diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C index b33289a0b7..4335bace8a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -375,6 +375,18 @@ void Foam::ThermalPhaseChangePhaseSystem::correctThermo() volScalarField hef1(phase1.thermo().he(phase1.thermo().p(), Tf)); volScalarField hef2(phase2.thermo().he(phase2.thermo().p(), Tf)); + volScalarField L + ( + min + ( + (pos(iDmdt)*he2 + neg(iDmdt)*hef2) + - (neg(iDmdt)*he1 + pos(iDmdt)*hef1), + 0.3*mag(hef2 - hef1) + ) + ); + + volScalarField iDmdtNew(iDmdt); + if (massTransfer_ ) { volScalarField H1 @@ -389,28 +401,13 @@ void Foam::ThermalPhaseChangePhaseSystem::correctThermo() Tf = saturationModel_->Tsat(phase1.thermo().p()); - scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt")); + iDmdtNew = + (H1*(Tf - T1) + H2*(Tf - T2))/L; - iDmdt = - (1 - iDmdtRelax)*iDmdt - + iDmdtRelax*(H1*(Tf - T1) + H2*(Tf - T2)) - /min - ( - (pos(iDmdt)*he2 + neg(iDmdt)*hef2) - - (neg(iDmdt)*he1 + pos(iDmdt)*hef1), - 0.3*mag(hef2 - hef1) - ); - - Info<< "iDmdt." << pair.name() - << ": min = " << min(iDmdt.primitiveField()) - << ", mean = " << average(iDmdt.primitiveField()) - << ", max = " << max(iDmdt.primitiveField()) - << ", integral = " << fvc::domainIntegrate(iDmdt).value() - << endl; } else { - iDmdt == dimensionedScalar("0", dmdt.dimensions(), 0); + iDmdtNew == dimensionedScalar("0",dmdt.dimensions(), 0); } volScalarField H1(this->heatTransferModels_[pair][pair.first()]->K()); @@ -423,16 +420,7 @@ void Foam::ThermalPhaseChangePhaseSystem::correctThermo() H2.boundaryFieldRef() = max(H2.boundaryField(), phase2.boundaryField()*HLimit); - volScalarField mDotL - ( - iDmdt* - ( - (pos(iDmdt)*he2 + neg(iDmdt)*hef2) - - (neg(iDmdt)*he1 + pos(iDmdt)*hef1) - ) - ); - - Tf = (H1*T1 + H2*T2 + mDotL)/(H1 + H2); + Tf = (H1*T1 + H2*T2 + iDmdtNew*L)/(H1 + H2); Info<< "Tf." << pair.name() << ": min = " << min(Tf.primitiveField()) @@ -440,6 +428,19 @@ void Foam::ThermalPhaseChangePhaseSystem::correctThermo() << ", max = " << max(Tf.primitiveField()) << endl; + scalar iDmdtRelax(this->mesh().fieldRelaxationFactor("iDmdt")); + iDmdt = (1 - iDmdtRelax)*iDmdt + iDmdtRelax*iDmdtNew; + + if (massTransfer_ ) + { + Info<< "iDmdt." << pair.name() + << ": min = " << min(iDmdt.primitiveField()) + << ", mean = " << average(iDmdt.primitiveField()) + << ", max = " << max(iDmdt.primitiveField()) + << ", integral = " << fvc::domainIntegrate(iDmdt).value() + << endl; + } + // Accumulate dmdt contributions from boundaries volScalarField wDmdt ( diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C index 9fa7c0f589..da10824230 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,6 +165,24 @@ bool Foam::phaseModel::compressible() const } +void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const +{ + surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef(); + const volScalarField::Boundary& alphaBf = boundaryField(); + const surfaceScalarField::Boundary& phiBf = phi()().boundaryField(); + + forAll(alphaPhiBf, patchi) + { + fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi]; + + if (!alphaPhip.coupled()) + { + alphaPhip = phiBf[patchi]*alphaBf[patchi]; + } + } +} + + const Foam::tmp& Foam::phaseModel::divU() const { NotImplemented; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H index 719ef80a8c..41fb67e715 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -283,6 +283,9 @@ public: //- Access the mass flux of the phase virtual surfaceScalarField& alphaRhoPhi() = 0; + //- Ensure that the flux at inflow/outflow BCs is preserved + void correctInflowOutflow(surfaceScalarField& alphaPhi) const; + // Transport diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C index b9abe549a0..19e768416f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,9 +76,7 @@ void Foam::phaseSystem::generatePairs // pair already exists if (phasePairs_.found(key)) - { - // do nothing ... - } + {} // new ordered pair else if (key.ordered()) diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index ca37c2245b..805d99844e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,15 +71,17 @@ void Foam::multiphaseSystem::solveAlphas() { bool LTS = fv::localEulerDdt::enabled(mesh_); + forAll(phases(), phasei) + { + phases()[phasei].correctBoundaryConditions(); + } + PtrList alphaPhiCorrs(phases().size()); forAll(phases(), phasei) { phaseModel& phase = phases()[phasei]; volScalarField& alpha1 = phase; - phase.alphaPhi() = - dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0); - alphaPhiCorrs.set ( phasei, @@ -134,28 +136,7 @@ void Foam::multiphaseSystem::solveAlphas() ); } - surfaceScalarField::Boundary& alphaPhiCorrBf = - alphaPhiCorr.boundaryFieldRef(); - - // Ensure that the flux at inflow BCs is preserved - forAll(alphaPhiCorr.boundaryField(), patchi) - { - fvsPatchScalarField& alphaPhiCorrp = alphaPhiCorrBf[patchi]; - - if (!alphaPhiCorrp.coupled()) - { - const scalarField& phi1p = phase.phi().boundaryField()[patchi]; - const scalarField& alpha1p = alpha1.boundaryField()[patchi]; - - forAll(alphaPhiCorrp, facei) - { - if (phi1p[facei] < 0) - { - alphaPhiCorrp[facei] = alpha1p[facei]*phi1p[facei]; - } - } - } - } + phase.correctInflowOutflow(alphaPhiCorr); if (LTS) { @@ -215,8 +196,9 @@ void Foam::multiphaseSystem::solveAlphas() phaseModel& phase = phases()[phasei]; volScalarField& alpha = phase; - surfaceScalarField& alphaPhic = alphaPhiCorrs[phasei]; - alphaPhic += upwind(mesh_, phi_).flux(phase); + surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei]; + alphaPhi += upwind(mesh_, phi_).flux(phase); + phase.correctInflowOutflow(alphaPhi); volScalarField::Internal Sp ( @@ -298,12 +280,12 @@ void Foam::multiphaseSystem::solveAlphas() ( geometricOneField(), alpha, - alphaPhic, + alphaPhi, Sp, Su ); - phase.alphaPhi() += alphaPhic; + phase.alphaPhi() = alphaPhi; Info<< phase.name() << " volume fraction, min, max = " << phase.weightedAverage(mesh_.V()).value() @@ -319,6 +301,14 @@ void Foam::multiphaseSystem::solveAlphas() << ' ' << min(sumAlpha).value() << ' ' << max(sumAlpha).value() << endl; + + // Correct the sum of the phase-fractions to avoid 'drift' + volScalarField sumCorr(1.0 - sumAlpha); + forAll(phases(), phasei) + { + volScalarField& alpha = phases()[phasei]; + alpha += alpha*sumCorr; + } } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 60b92573c4..3dfc5e971b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,9 @@ License #include "saturationModel.H" #include "wallFvPatch.H" #include "uniformDimensionedFields.H" +#include "mathematicalConstants.H" +using namespace Foam::constant::mathematical; // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -157,6 +159,12 @@ alphatWallBoilingWallFunctionFvPatchScalarField ( dict.subDict("departureFreqModel") ); + + if (dict.found("dDep")) + { + dDep_ = scalarField("dDep", dict, p.size()); + } + break; } } @@ -259,10 +267,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() // Lookup the fluid model const ThermalPhaseChangePhaseSystem < - MomentumTransferPhaseSystem - < - twoPhaseSystem> - >& fluid = refCast + MomentumTransferPhaseSystem + >& fluid = + refCast < const ThermalPhaseChangePhaseSystem < @@ -477,9 +484,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() const scalarField Ja(rhoLiquidw*Cpw*Tsub/(rhoVaporw*L)); const scalarField Al(fLiquid*4.8*exp(-Ja/80)); - const scalarField A2(min(M_PI*sqr(dDep_)*N*Al/4, scalar(1))); + const scalarField A2(min(pi*sqr(dDep_)*N*Al/4, scalar(1))); const scalarField A1(max(1 - A2, scalar(1e-4))); - const scalarField A2E(min(M_PI*sqr(dDep_)*N*Al/4, scalar(5))); + const scalarField A2E(min(pi*sqr(dDep_)*N*Al/4, scalar(5))); // Wall evaporation heat flux [kg/s3 = J/m2s] const scalarField Qe((1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*L); @@ -495,7 +502,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() // Quenching heat transfer coefficient const scalarField hQ ( - 2*(alphaw*Cpw)*fDep*sqrt((0.8/fDep)/(M_PI*alphaw/rhow)) + 2*(alphaw*Cpw)*fDep*sqrt((0.8/fDep)/(pi*alphaw/rhow)) ); // Quenching heat flux @@ -622,11 +629,13 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const os << indent << token::BEGIN_BLOCK << incrIndent << nl; departureFreqModel_->write(os); os << decrIndent << indent << token::END_BLOCK << nl; + break; } } dmdt_.writeEntry("dmdt", os); + dDep_.writeEntry("dDep", os); alphatConv_.writeEntry("alphatConv", os); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H index d724d98611..2e5303b8eb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -269,7 +269,7 @@ public: // Member functions - //- Calculate and return the departure diameter field + //- Return the departure diameter field const scalarField& dDeparture() const { return dDep_; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index 8115f05cd0..62bbe6af40 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,7 +201,6 @@ void Foam::twoPhaseSystem::solve() word alphaScheme("div(phi," + alpha1.name() + ')'); word alpharScheme("div(phir," + alpha1.name() + ')'); - const surfaceScalarField& phi = this->phi(); const surfaceScalarField& phi1 = phase1_.phi(); const surfaceScalarField& phi2 = phase2_.phi(); @@ -236,9 +235,7 @@ void Foam::twoPhaseSystem::solve() } alpha1.correctBoundaryConditions(); - surfaceScalarField alpha1f(fvc::interpolate(max(alpha1, scalar(0)))); - surfaceScalarField phic("phic", phi); surfaceScalarField phir("phir", phi1 - phi2); tmp alphaDbyA; @@ -279,7 +276,7 @@ void Foam::twoPhaseSystem::solve() ), // Divergence term is handled explicitly to be // consistent with the explicit transport solution - fvc::div(phi)*min(alpha1, scalar(1)) + fvc::div(phi_)*min(alpha1, scalar(1)) ); if (tdgdt.valid()) @@ -300,11 +297,11 @@ void Foam::twoPhaseSystem::solve() } } - surfaceScalarField alphaPhic1 + surfaceScalarField alphaPhi1 ( fvc::flux ( - phic, + phi_, alpha1, alphaScheme ) @@ -316,28 +313,7 @@ void Foam::twoPhaseSystem::solve() ) ); - surfaceScalarField::Boundary& alphaPhic1Bf = - alphaPhic1.boundaryFieldRef(); - - // Ensure that the flux at inflow BCs is preserved - forAll(alphaPhic1Bf, patchi) - { - fvsPatchScalarField& alphaPhic1p = alphaPhic1Bf[patchi]; - - if (!alphaPhic1p.coupled()) - { - const scalarField& phi1p = phi1.boundaryField()[patchi]; - const scalarField& alpha1p = alpha1.boundaryField()[patchi]; - - forAll(alphaPhic1p, facei) - { - if (phi1p[facei] < 0) - { - alphaPhic1p[facei] = alpha1p[facei]*phi1p[facei]; - } - } - } - } + phase1_.correctInflowOutflow(alphaPhi1); if (nAlphaSubCycles > 1) { @@ -355,14 +331,14 @@ void Foam::twoPhaseSystem::solve() !(++alphaSubCycle).end(); ) { - surfaceScalarField alphaPhic10(alphaPhic1); + surfaceScalarField alphaPhi10(alphaPhi1); MULES::explicitSolve ( geometricOneField(), alpha1, - phi, - alphaPhic10, + phi_, + alphaPhi10, (alphaSubCycle.index()*Sp)(), (Su - (alphaSubCycle.index() - 1)*Sp*alpha1)(), phase1_.alphaMax(), @@ -371,11 +347,11 @@ void Foam::twoPhaseSystem::solve() if (alphaSubCycle.index() == 1) { - phase1_.alphaPhi() = alphaPhic10; + phase1_.alphaPhi() = alphaPhi10; } else { - phase1_.alphaPhi() += alphaPhic10; + phase1_.alphaPhi() += alphaPhi10; } } @@ -387,15 +363,15 @@ void Foam::twoPhaseSystem::solve() ( geometricOneField(), alpha1, - phi, - alphaPhic1, + phi_, + alphaPhi1, Sp, Su, phase1_.alphaMax(), 0 ); - phase1_.alphaPhi() = alphaPhic1; + phase1_.alphaPhi() = alphaPhi1; } if (alphaDbyA.valid()) @@ -415,8 +391,8 @@ void Foam::twoPhaseSystem::solve() phase1_.alphaRhoPhi() = fvc::interpolate(phase1_.rho())*phase1_.alphaPhi(); - phase2_.alphaPhi() = phi - phase1_.alphaPhi(); - alpha2 = scalar(1) - alpha1; + phase2_.alphaPhi() = phi_ - phase1_.alphaPhi(); + phase2_.correctInflowOutflow(phase2_.alphaPhi()); phase2_.alphaRhoPhi() = fvc::interpolate(phase2_.rho())*phase2_.alphaPhi(); @@ -425,6 +401,13 @@ void Foam::twoPhaseSystem::solve() << " Min(alpha1) = " << min(alpha1).value() << " Max(alpha1) = " << max(alpha1).value() << endl; + + // Ensure the phase-fractions are bounded + alpha1.max(0); + alpha1.min(1); + + // Update the phase-fraction of the other phase + alpha2 = scalar(1) - alpha1; } } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C index f5522c7509..87a249277a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -248,27 +248,19 @@ bool Foam::phaseModel::read(const dictionary& phaseProperties) } -void Foam::phaseModel::correctInflowFlux(surfaceScalarField& alphaPhi) const +void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const { surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef(); + const volScalarField::Boundary& alphaBf = boundaryField(); + const surfaceScalarField::Boundary& phiBf = phi().boundaryField(); - // Ensure that the flux at inflow BCs is preserved forAll(alphaPhiBf, patchi) { fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi]; if (!alphaPhip.coupled()) { - const scalarField& phip = phi().boundaryField()[patchi]; - const scalarField& alphap = boundaryField()[patchi]; - - forAll(alphaPhip, facei) - { - if (phip[facei] < SMALL) - { - alphaPhip[facei] = alphap[facei]*phip[facei]; - } - } + alphaPhip = phiBf[patchi]*alphaBf[patchi]; } } } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H index a5ae107c90..894907fe7c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -319,8 +319,8 @@ public: return alphaRhoPhi_; } - //- Ensure that the flux at inflow BCs is preserved - void correctInflowFlux(surfaceScalarField& alphaPhi) const; + //- Ensure that the flux at inflow/outflow BCs is preserved + void correctInflowOutflow(surfaceScalarField& alphaPhi) const; //- Correct the phase properties // other than the thermodynamics and turbulence diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index 808fe255f9..c6861dcf2c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -444,7 +444,7 @@ void Foam::twoPhaseSystem::solve() ) ); - phase1_.correctInflowFlux(alphaPhic1); + phase1_.correctInflowOutflow(alphaPhic1); if (nAlphaSubCycles > 1) { @@ -515,8 +515,7 @@ void Foam::twoPhaseSystem::solve() fvc::interpolate(phase1_.rho())*phase1_.alphaPhi(); phase2_.alphaPhi() = phi_ - phase1_.alphaPhi(); - alpha2 = scalar(1) - alpha1; - phase2_.correctInflowFlux(phase2_.alphaPhi()); + phase2_.correctInflowOutflow(phase2_.alphaPhi()); phase2_.alphaRhoPhi() = fvc::interpolate(phase2_.rho())*phase2_.alphaPhi(); @@ -525,6 +524,12 @@ void Foam::twoPhaseSystem::solve() << " Min(" << alpha1.name() << ") = " << min(alpha1).value() << " Max(" << alpha1.name() << ") = " << max(alpha1).value() << endl; + + // Ensure the phase-fractions are bounded + alpha1.max(0); + alpha1.min(1); + + alpha2 = scalar(1) - alpha1; } } diff --git a/applications/test/graph/graphTest2.C b/applications/test/graph/graphTest2.C index 39692fd3f9..f01b5ccca4 100644 --- a/applications/test/graph/graphTest2.C +++ b/applications/test/graph/graphTest2.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,4 +62,3 @@ int main() // ************************************************************************* // - diff --git a/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H b/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H index 11b8993f28..22b31b514c 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H +++ b/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H @@ -48,4 +48,3 @@ } Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl; - diff --git a/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H b/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H index 11b8993f28..22b31b514c 100644 --- a/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H +++ b/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H @@ -48,4 +48,3 @@ } Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl; - diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 9239b81a5d..62cd1230df 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -468,7 +468,8 @@ void readCells IOWarningInFunction(is) << "Cell type " << feID << " not supported" << endl; } - is.getLine(line); // Do nothing + + is.getLine(line); } } diff --git a/applications/utilities/mesh/generation/blockMesh/blockMesh.C b/applications/utilities/mesh/generation/blockMesh/blockMesh.C index c1c5016b35..dcc06edb8f 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMesh.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -82,6 +82,11 @@ int main(int argc, char *argv[]) "blockTopology", "write block edges and centres as .obj files" ); + argList::addBoolOption + ( + "noClean", + "keep the existing files in the polyMesh" + ); argList::addOption ( "dict", @@ -171,6 +176,30 @@ int main(int argc, char *argv[]) dictPath = runTime.system()/regionPath/dictName; } + if (!args.optionFound("noClean")) + { + fileName polyMeshPath + ( + runTime.path()/runTime.constant()/regionPath/polyMesh::meshSubDir + ); + + if (exists(polyMeshPath)) + { + if (exists(polyMeshPath/dictName)) + { + Info<< "Not deleting polyMesh directory " << nl + << " " << polyMeshPath << nl + << " because it contains " << dictName << endl; + } + else + { + Info<< "Deleting polyMesh directory" << nl + << " " << polyMeshPath << endl; + rmDir(polyMeshPath); + } + } + } + IOobject meshDictIO ( dictPath, diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index e4bd6ceb23..777730a96d 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -666,15 +666,6 @@ void writeMesh } refinementHistory::removeFiles(mesh); - //label flag = meshRefinement::MESH; - //if (writeLevel) - //{ - // flag |= meshRefinement::SCALARLEVELS; - //} - //if (debug & meshRefinement::OBJINTERSECTIONS) - //{ - // flag |= meshRefinement::OBJINTERSECTIONS; - //} meshRefiner.write ( debugLevel, @@ -726,117 +717,6 @@ int main(int argc, char *argv[]) autoPtr meshPtr; -// if (surfaceSimplify) -// { -// IOdictionary foamyHexMeshDict -// ( -// IOobject -// ( -// "foamyHexMeshDict", -// runTime.system(), -// runTime, -// IOobject::MUST_READ_IF_MODIFIED, -// IOobject::NO_WRITE -// ) -// ); -// -// const dictionary& motionDict = -// foamyHexMeshDict.subDict("motionControl"); -// -// const scalar defaultCellSize = -// readScalar(motionDict.lookup("defaultCellSize")); -// -// Info<< "Constructing single cell mesh from boundBox" << nl << endl; -// -// boundBox bb(args.optionRead("surfaceSimplify")); -// -// labelList owner(6, label(0)); -// labelList neighbour(0); -// -// const cellModel& hexa = *(cellModeller::lookup("hex")); -// faceList faces = hexa.modelFaces(); -// -// meshPtr.set -// ( -// new fvMesh -// ( -// IOobject -// ( -// fvMesh::defaultRegion, -// runTime.timeName(), -// runTime, -// IOobject::NO_READ -// ), -// xferMove>(bb.points()()), -// faces.xfer(), -// owner.xfer(), -// neighbour.xfer() -// ) -// ); -// -// List patches(1); -// -// patches[0] = new wallPolyPatch -// ( -// "boundary", -// 6, -// 0, -// 0, -// meshPtr().boundaryMesh(), -// wallPolyPatch::typeName -// ); -// -// meshPtr().addFvPatches(patches); -// -// const scalar initialCellSize = ::pow(meshPtr().V()[0], 1.0/3.0); -// const label initialRefLevels = -// ::log(initialCellSize/defaultCellSize)/::log(2); -// -// Info<< "Default cell size = " << defaultCellSize << endl; -// Info<< "Initial cell size = " << initialCellSize << endl; -// -// Info<< "Initial refinement levels = " << initialRefLevels << endl; -// -// Info<< "Mesh starting size = " << meshPtr().nCells() << endl; -// -// // meshCutter must be destroyed before writing the mesh otherwise it -// // writes the cellLevel/pointLevel files -// { -// hexRef8 meshCutter(meshPtr(), false); -// -// for (label refinei = 0; refinei < initialRefLevels; ++refinei) -// { -// // Mesh changing engine. -// polyTopoChange meshMod(meshPtr(), true); -// -// // Play refinement commands into mesh changer. -// meshCutter.setRefinement -// ( -// identity(meshPtr().nCells()), -// meshMod -// ); -// -// // Create mesh (no inflation), return map from old to new mesh -// autoPtr map = -// meshMod.changeMesh(meshPtr(), false); -// -// // Update fields -// meshPtr().updateMesh(map); -// -// // Delete mesh volumes. -// meshPtr().clearOut(); -// -// Info<< "Refinement Iteration " << refinei + 1 -// << ", Mesh size = " << meshPtr().nCells() << endl; -// } -// } -// -// Info<< "Mesh end size = " << meshPtr().nCells() << endl; -// -// Info<< "Create mesh" << endl; -// meshPtr().write(); -// } -// else { word regionName; if (args.optionReadIfPresent("region", regionName)) diff --git a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C index 83576de60a..23ac90868c 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C +++ b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,10 +87,12 @@ int main(int argc, char *argv[]) #include "createNamedPolyMesh.H" + const fileName setsSubPath(mesh.dbDir()/polyMesh::meshSubDir/"sets"); + // Search for list of objects for the time of the mesh word setsInstance = runTime.findInstance ( - polyMesh::meshSubDir/"sets", + setsSubPath, word::null, IOobject::MUST_READ, mesh.facesInstance() @@ -98,7 +100,7 @@ int main(int argc, char *argv[]) IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets"); - Info<< "Searched : " << setsInstance/polyMesh::meshSubDir/"sets" + Info<< "Searched : " << setsInstance/setsSubPath << nl << "Found : " << objects.names() << nl << endl; diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C index ec53cb414d..d552c294f7 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpBoundary/helpBoundaryTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,7 +93,7 @@ void Foam::helpTypes::helpBoundary::fixedValueFieldConditions IOobject::NO_WRITE, false ), - mesh, + mesh, dimensioned("zero", dimless, Zero) ); @@ -142,9 +142,7 @@ void Foam::helpTypes::helpBoundary::fixedValueFieldConditions } } catch (...) - { - // do nothing - } + {} } if (!foundFixed) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H index 0c841369cf..66e0616aba 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/findFields.H @@ -114,4 +114,3 @@ if (timeDirs.size()) volumeFields.erase(missing); } } - diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H index 91c718994f..70964a667d 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H @@ -40,4 +40,4 @@ Info<< nl << "Time [" << timeIndex << "] = " << runTime.timeName() << nl; -// end-of-file +// end-of-file \ No newline at end of file diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C b/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C index 7c74c7e203..036217d15c 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/foamToGMV.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,4 +100,3 @@ int main(int argc, char *argv[]) // ************************************************************************* // - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_exit_routine.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_exit_routine.H index b6fdf9c2c4..277450fc47 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_exit_routine.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_exit_routine.H @@ -1,4 +1,3 @@ -// Do nothing void USERD_exit_routine ( void @@ -10,4 +9,3 @@ void USERD_exit_routine #endif } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_changing_geometry_status.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_changing_geometry_status.H index 2df1e6a761..f346f338bf 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_changing_geometry_status.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_changing_geometry_status.H @@ -8,4 +8,3 @@ int USERD_get_changing_geometry_status(void) // Choose the most general option return Z_CHANGE_CONN; } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_descrip_lines.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_descrip_lines.H index 1076d2de38..d10346eb94 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_descrip_lines.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_descrip_lines.H @@ -29,4 +29,3 @@ int USERD_get_descrip_lines #endif return Z_OK; } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_element_label_status.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_element_label_status.H index d65e7bad70..99b0ba28e1 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_element_label_status.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_element_label_status.H @@ -8,4 +8,3 @@ int USERD_get_element_label_status(void) #endif return TRUE; } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_variable_info.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_variable_info.H index 1bf375cad7..40c181015b 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_variable_info.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_gold_variable_info.H @@ -118,6 +118,3 @@ int USERD_get_gold_variable_info return Z_OK; } - - - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_node_label_status.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_node_label_status.H index 65791f70f7..bd0d977c76 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_node_label_status.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_node_label_status.H @@ -9,4 +9,3 @@ int USERD_get_node_label_status(void) return TRUE; } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_sol_times.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_sol_times.H index 223b0c2164..8c71ca3b9a 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_sol_times.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_sol_times.H @@ -41,4 +41,3 @@ int USERD_get_sol_times return Z_OK; } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_var_value_at_specific.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_var_value_at_specific.H index d569726f6a..c7b5a92ae6 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_var_value_at_specific.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_var_value_at_specific.H @@ -68,4 +68,3 @@ int USERD_get_var_value_at_specific #endif return Z_OK; } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_structured_data.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_structured_data.H index c53db0cf87..d8a4c90a19 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_structured_data.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_structured_data.H @@ -59,4 +59,3 @@ int USERD_get_block_ghost_flags { return(Z_OK); } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianScalar.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianScalar.H index dd20ba0db8..b853ac7147 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianScalar.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianScalar.H @@ -32,4 +32,3 @@ else // Info<< "getLagrangianScalar: nVar = " << nVar << endl; return Z_UNDEF; } - diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianVector.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianVector.H index 31e4bc729c..de1d12aa37 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianVector.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/getLagrangianVector.H @@ -44,4 +44,3 @@ else // Info<< "getLagrangianVector: nVar = " << nVar << endl; return Z_UNDEF; } - diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H index 85ec143ca9..767d626880 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H @@ -45,4 +45,3 @@ } scalarField samples(nIntervals, 0); - diff --git a/bin/foamGraphExecTime b/bin/foamGraphExecTime index 73bd8d5633..5bacabe4a1 100755 --- a/bin/foamGraphExecTime +++ b/bin/foamGraphExecTime @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -29,7 +29,7 @@ # Deprecated script extract the 'ExecutionTime' for each time-step from a # log file for graphing. # -# Superceded by the more general foamLog script. +# Superseded by the more general foamLog script. #------------------------------------------------------------------------------ Script=${0##*/} diff --git a/bin/foamGraphResKE b/bin/foamGraphResKE index 57e936b457..e023c71090 100755 --- a/bin/foamGraphResKE +++ b/bin/foamGraphResKE @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -29,7 +29,7 @@ # Deprecated script extract initial turbulence residuals for each time-step # from a log file for graphing. # -# Superceded by the more general foamLog script. +# Superseded by the more general foamLog script. #------------------------------------------------------------------------------ Script=${0##*/} diff --git a/bin/foamGraphResUVWP b/bin/foamGraphResUVWP index 580db29f76..8f8fcaccd3 100755 --- a/bin/foamGraphResUVWP +++ b/bin/foamGraphResUVWP @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -29,7 +29,7 @@ # Deprecated script extract initial velocity and pressure residuals for each # time-step from a log file for graphing. # -# Superceded by the more general foamLog script. +# Superseded by the more general foamLog script. #------------------------------------------------------------------------------ Script=${0##*/} diff --git a/bin/stressComponents b/bin/stressComponents index d325b6f100..45888e2564 100755 --- a/bin/stressComponents +++ b/bin/stressComponents @@ -31,7 +31,7 @@ #------------------------------------------------------------------------------ Script=${0##*/} -echo $Script "has been superceded by the -postProcess solver option:" +echo $Script "has been superseded by the -postProcess solver option:" echo " -funcs '(R components(turbulenceProperties:R))'" echo "e.g." echo "simpleFoam -postProcess -funcs '(R components(turbulenceProperties:R))'" diff --git a/bin/wallGradU b/bin/wallGradU index ec4588a9be..c44ed73ff8 100755 --- a/bin/wallGradU +++ b/bin/wallGradU @@ -31,7 +31,7 @@ #------------------------------------------------------------------------------ Script=${0##*/} -echo $Script "has been superceded by the postProcess utility:" +echo $Script "has been superseded by the postProcess utility:" echo " postProcess -func 'grad(U)'" #------------------------------------------------------------------------------ diff --git a/bin/wdot b/bin/wdot index 8e66e1cadf..d569cbfe6f 100755 --- a/bin/wdot +++ b/bin/wdot @@ -31,7 +31,7 @@ #------------------------------------------------------------------------------ Script=${0##*/} -echo $Script "has been superceded by the postProcess utility:" +echo $Script "has been superseded by the postProcess utility:" echo "postProcess -func XiReactionRate" #------------------------------------------------------------------------------ diff --git a/src/Allwmake b/src/Allwmake index f668d9db04..624257ff37 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -51,7 +51,6 @@ wmake $targetType sampling wmake $targetType dynamicFvMesh wmake $targetType sampling wmake $targetType topoChangerFvMesh -wmake $targetType sampling # Compile scotchDecomp, metisDecomp etc. parallel/Allwmake $targetType $* diff --git a/src/OSspecific/POSIX/dummyPrintStack.C b/src/OSspecific/POSIX/dummyPrintStack.C index 59ece6f986..2ef74cfc24 100644 --- a/src/OSspecific/POSIX/dummyPrintStack.C +++ b/src/OSspecific/POSIX/dummyPrintStack.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,4 +31,3 @@ void Foam::error::printStack(Ostream& os) {} // ************************************************************************* // - diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H index 441c785408..3960b4ffe2 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -341,4 +341,3 @@ void inplaceRotateList(ListType& list, label n); #endif // ************************************************************************* // - diff --git a/src/OpenFOAM/containers/NamedEnum/NamedEnum.H b/src/OpenFOAM/containers/NamedEnum/NamedEnum.H index c96703ce29..b2705f2805 100644 --- a/src/OpenFOAM/containers/NamedEnum/NamedEnum.H +++ b/src/OpenFOAM/containers/NamedEnum/NamedEnum.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -119,7 +119,7 @@ public: //- Return the name of the given enumeration element const char* operator[](const Enum e) const { - return names[e]; + return names[int(e)]; } }; diff --git a/src/OpenFOAM/db/IOstreams/gzstream/COPYING.LIB b/src/OpenFOAM/db/IOstreams/gzstream/COPYING.LIB index 583509c7ef..4490927b70 100644 --- a/src/OpenFOAM/db/IOstreams/gzstream/COPYING.LIB +++ b/src/OpenFOAM/db/IOstreams/gzstream/COPYING.LIB @@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -158,7 +158,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -267,7 +267,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -422,7 +422,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest @@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! - - diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedSphericalTensor/dimensionedSphericalTensor.H b/src/OpenFOAM/dimensionedTypes/dimensionedSphericalTensor/dimensionedSphericalTensor.H index 2ac54853a2..7b2b331d82 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedSphericalTensor/dimensionedSphericalTensor.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedSphericalTensor/dimensionedSphericalTensor.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,4 +64,3 @@ dimensionedSphericalTensor inv(const dimensionedSphericalTensor&); #endif // ************************************************************************* // - diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedTensor/dimensionedTensor.H b/src/OpenFOAM/dimensionedTypes/dimensionedTensor/dimensionedTensor.H index 0fd1b882e7..2797c807c7 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedTensor/dimensionedTensor.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedTensor/dimensionedTensor.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,4 +86,3 @@ dimensionedTensor operator*(const dimensionedVector&); #endif // ************************************************************************* // - diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedVector/dimensionedVector.H b/src/OpenFOAM/dimensionedTypes/dimensionedVector/dimensionedVector.H index 4a93c36b3f..657f6c4c46 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedVector/dimensionedVector.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedVector/dimensionedVector.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,4 +56,3 @@ typedef dimensioned dimensionedVector; #endif // ************************************************************************* // - diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/lduInterfacePtrsList.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/lduInterfacePtrsList.H index 4e8a19b70a..b0e7d896ee 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/lduInterfacePtrsList.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/lduInterfacePtrsList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,4 +47,3 @@ namespace Foam #endif // ************************************************************************* // - diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceFieldPtrsList.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceFieldPtrsList.H index 9934682b11..9e37cde453 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceFieldPtrsList.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterfaceFields/lduInterfaceField/lduInterfaceFieldPtrsList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,4 +47,3 @@ namespace Foam #endif // ************************************************************************* // - diff --git a/src/OpenFOAM/primitives/strings/fileName/fileNameIO.C b/src/OpenFOAM/primitives/strings/fileName/fileNameIO.C index dd686bb131..3e193ecf99 100644 --- a/src/OpenFOAM/primitives/strings/fileName/fileNameIO.C +++ b/src/OpenFOAM/primitives/strings/fileName/fileNameIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C index 77d01435f6..7bfeabc0ab 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -151,16 +151,6 @@ realizableKE::realizableKE transport, propertiesName ), - - Cmu_ - ( - dimensioned::lookupOrAddToDict - ( - "Cmu", - this->coeffDict_, - 0.09 - ) - ), A0_ ( dimensioned::lookupOrAddToDict @@ -240,7 +230,6 @@ bool realizableKE::read() { if (eddyViscosity>::read()) { - Cmu_.readIfPresent(this->coeffDict()); A0_.readIfPresent(this->coeffDict()); C2_.readIfPresent(this->coeffDict()); sigmak_.readIfPresent(this->coeffDict()); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.H b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.H index f47616f4f3..9738b10455 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.H +++ b/src/TurbulenceModels/turbulenceModels/RAS/realizableKE/realizableKE.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,7 +48,6 @@ Description \verbatim realizableKECoeffs { - Cmu 0.09; A0 4.0; C2 1.9; sigmak 1.0; @@ -90,7 +89,6 @@ protected: // Model coefficients - dimensionedScalar Cmu_; dimensionedScalar A0_; dimensionedScalar C2_; dimensionedScalar sigmak_; diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index fa3b7feaed..6358104a9b 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "PaSR.H" -#include "fvmSup.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -39,19 +38,18 @@ Foam::combustionModels::PaSR::PaSR : laminar(modelType, mesh, combustionProperties, phaseName), Cmix_(readScalar(this->coeffs().lookup("Cmix"))), - turbulentReaction_(this->coeffs().lookup("turbulentReaction")), kappa_ ( IOobject ( - IOobject::groupName("PaSR:kappa", phaseName), + IOobject::groupName(typeName + ":kappa", phaseName), mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, - dimensionedScalar("kappa", dimless, 0.0) + dimensionedScalar("kappa", dimless, 0) ) {} @@ -72,35 +70,31 @@ void Foam::combustionModels::PaSR::correct() { laminar::correct(); - if (turbulentReaction_) - { - tmp tepsilon(this->turbulence().epsilon()); - const volScalarField& epsilon = tepsilon(); - tmp tmuEff(this->turbulence().muEff()); - const volScalarField& muEff = tmuEff(); - tmp ttc(this->tc()); - const volScalarField& tc = ttc(); - tmp trho(this->rho()); - const volScalarField& rho = trho(); + tmp tepsilon(this->turbulence().epsilon()); + const scalarField& epsilon = tepsilon(); - forAll(epsilon, i) + tmp tmuEff(this->turbulence().muEff()); + const scalarField& muEff = tmuEff(); + + tmp ttc(this->tc()); + const scalarField& tc = ttc(); + + tmp trho(this->rho()); + const scalarField& rho = trho(); + + forAll(epsilon, i) + { + const scalar tk = + Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + SMALL), 0)); + + if (tk > SMALL) { - scalar tk = - Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + SMALL), 0)); - - if (tk > SMALL) - { - kappa_[i] = tc[i]/(tc[i] + tk); - } - else - { - kappa_[i] = 1.0; - } + kappa_[i] = tc[i]/(tc[i] + tk); + } + else + { + kappa_[i] = 1.0; } - } - else - { - kappa_ = 1.0; } } } @@ -122,7 +116,7 @@ Foam::combustionModels::PaSR::Qdot() const ( new volScalarField ( - IOobject::groupName("PaSR:dQ", this->phaseName_), + IOobject::groupName(typeName + ":Qdot", this->phaseName_), kappa_*laminar::Qdot() ) ); @@ -135,7 +129,6 @@ bool Foam::combustionModels::PaSR::read() if (laminar::read()) { this->coeffs().lookup("Cmix") >> Cmix_; - this->coeffs().lookup("turbulentReaction") >> turbulentReaction_; return true; } else diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H index 3189e46ceb..e83b3eb52e 100644 --- a/src/combustionModels/PaSR/PaSR.H +++ b/src/combustionModels/PaSR/PaSR.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,10 +28,11 @@ Group grpCombustionModels Description - Partially stirred reactor combustion model. The model calculates a finite - rate, based on both turbulence and chemistry time scales. Depending on - mesh resolution, the Cmix parameter can be used to scale the turbulence - mixing time scale. + Partially stirred reactor turbulent combustion model. + + This model calculates a finite rate, based on both turbulence and chemistry + time scales. Depending on mesh resolution, the Cmix parameter can be used + to scale the turbulence mixing time scale. SourceFiles PaSR.C @@ -64,9 +65,6 @@ class PaSR //- Mixing constant scalar Cmix_; - //- Turbulent reaction switch - Switch turbulentReaction_; - //- Mixing parameter volScalarField kappa_; diff --git a/src/combustionModels/laminar/laminar.C b/src/combustionModels/laminar/laminar.C index 679a086780..b33f302b18 100644 --- a/src/combustionModels/laminar/laminar.C +++ b/src/combustionModels/laminar/laminar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -170,8 +170,8 @@ bool Foam::combustionModels::laminar::read() { if (Type::read()) { - this->coeffs().lookup("integrateReactionRate") - >> integrateReactionRate_; + integrateReactionRate_ = + this->coeffs().lookupOrDefault("integrateReactionRate", true); return true; } else diff --git a/src/combustionModels/noCombustion/noCombustion.C b/src/combustionModels/noCombustion/noCombustion.C index 190459f5ae..4101ed61ca 100644 --- a/src/combustionModels/noCombustion/noCombustion.C +++ b/src/combustionModels/noCombustion/noCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,9 +52,7 @@ Foam::combustionModels::noCombustion::~noCombustion() template void Foam::combustionModels::noCombustion::correct() -{ -// Do Nothing -} +{} template @@ -83,7 +81,7 @@ Foam::combustionModels::noCombustion::Qdot() const ( IOobject ( - IOobject::groupName("Qdot", this->phaseName_), + IOobject::groupName(typeName + ":Qdot", this->phaseName_), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, diff --git a/src/dynamicMesh/meshCut/refineCell/refineCell.C b/src/dynamicMesh/meshCut/refineCell/refineCell.C index f5e4f585e5..d1e0d230a2 100644 --- a/src/dynamicMesh/meshCut/refineCell/refineCell.C +++ b/src/dynamicMesh/meshCut/refineCell/refineCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,4 +94,3 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const refineCell& r) // ************************************************************************* // - diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C index 259f747bc8..f1c248e467 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -1938,7 +1938,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory) polyMesh::meshSubDir, mesh_, IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), labelList(mesh_.nCells(), 0) ), @@ -1951,7 +1951,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory) polyMesh::meshSubDir, mesh_, IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), labelList(mesh_.nPoints(), 0) ), @@ -1964,7 +1964,7 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory) polyMesh::meshSubDir, mesh_, IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), dimensionedScalar("level0Edge", dimLength, getLevel0EdgeLength()) ), @@ -1977,9 +1977,10 @@ Foam::hexRef8::hexRef8(const polyMesh& mesh, const bool readHistory) polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), - (readHistory ? mesh_.nCells() : 0) // All cells visible if not be read + // All cells visible if not read or readHistory = false + (readHistory ? mesh_.nCells() : 0) ), faceRemover_(mesh_, GREAT), // merge boundary faces wherever possible savedPointLevel_(0), @@ -2057,7 +2058,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), cellLevel ), @@ -2070,7 +2071,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), pointLevel ), @@ -2083,7 +2084,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), dimensionedScalar ( @@ -2101,7 +2102,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), history ), @@ -2165,7 +2166,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), cellLevel ), @@ -2178,7 +2179,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), pointLevel ), @@ -2191,7 +2192,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), dimensionedScalar ( @@ -2209,7 +2210,7 @@ Foam::hexRef8::hexRef8 polyMesh::meshSubDir, mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), List(0), labelList(0), @@ -3069,7 +3070,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2 // fMesh.time().timeName(), // fMesh, // IOobject::NO_READ, - // IOobject::AUTO_WRITE, + // IOobject::NO_WRITE, // false // ), // fMesh, diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C index fb4254a4e2..fa91070a43 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/refinementHistory.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -336,7 +336,6 @@ void Foam::refinementHistory::freeSplitCell(const label index) } -// Mark entry in splitCells. Recursively mark its parent and subs. void Foam::refinementHistory::markSplit ( const label index, @@ -373,7 +372,6 @@ void Foam::refinementHistory::markSplit } -// Mark index and all its descendants void Foam::refinementHistory::mark ( const label val, @@ -739,7 +737,6 @@ Foam::refinementHistory::refinementHistory } -// Construct as copy Foam::refinementHistory::refinementHistory ( const IOobject& io, @@ -760,7 +757,6 @@ Foam::refinementHistory::refinementHistory } -// Construct from multiple Foam::refinementHistory::refinementHistory ( const IOobject& io, @@ -877,7 +873,6 @@ Foam::refinementHistory::refinementHistory } -// Construct from Istream Foam::refinementHistory::refinementHistory(const IOobject& io, Istream& is) : regIOobject(io), @@ -1154,7 +1149,6 @@ void Foam::refinementHistory::updateMesh(const mapPolyMesh& map) } -// Update numbering for subsetting void Foam::refinementHistory::subset ( const labelList& pointMap, diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 43f7545f90..e154c13f59 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -238,7 +238,6 @@ fvMatrices/fvMatrices.C fvMatrices/fvScalarMatrix/fvScalarMatrix.C fvMatrices/solvers/MULES/MULES.C fvMatrices/solvers/MULES/CMULES.C -fvMatrices/solvers/MULES/IMULES.C fvMatrices/solvers/GAMGSymSolver/GAMGAgglomerations/faceAreaPairGAMGAgglomeration/faceAreaPairGAMGAgglomeration.C interpolation = interpolation/interpolation diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C index 41fc3b1194..34ee43bede 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/CMULESTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -151,17 +151,17 @@ void Foam::MULES::limiterCorr const dictionary& MULEScontrols = mesh.solverDict(psi.name()); - label nLimiterIter + const label nLimiterIter ( readLabel(MULEScontrols.lookup("nLimiterIter")) ); - scalar smoothLimiter + const scalar smoothLimiter ( MULEScontrols.lookupOrDefault("smoothLimiter", 0) ); - scalar extremaCoeff + const scalar extremaCoeff ( MULEScontrols.lookupOrDefault("extremaCoeff", 0) ); @@ -207,8 +207,8 @@ void Foam::MULES::limiterCorr forAll(phiCorrIf, facei) { - label own = owner[facei]; - label nei = neighb[facei]; + const label own = owner[facei]; + const label nei = neighb[facei]; psiMaxn[own] = max(psiMaxn[own], psiIf[nei]); psiMinn[own] = min(psiMinn[own], psiIf[nei]); @@ -216,9 +216,9 @@ void Foam::MULES::limiterCorr psiMaxn[nei] = max(psiMaxn[nei], psiIf[own]); psiMinn[nei] = min(psiMinn[nei], psiIf[own]); - scalar phiCorrf = phiCorrIf[facei]; + const scalar phiCorrf = phiCorrIf[facei]; - if (phiCorrf > 0.0) + if (phiCorrf > 0) { sumPhip[own] += phiCorrf; mSumPhim[nei] += phiCorrf; @@ -253,7 +253,7 @@ void Foam::MULES::limiterCorr { forAll(phiCorrPf, pFacei) { - label pfCelli = pFaceCells[pFacei]; + const label pfCelli = pFaceCells[pFacei]; psiMaxn[pfCelli] = max(psiMaxn[pfCelli], psiPf[pFacei]); psiMinn[pfCelli] = min(psiMinn[pfCelli], psiPf[pFacei]); @@ -262,11 +262,11 @@ void Foam::MULES::limiterCorr forAll(phiCorrPf, pFacei) { - label pfCelli = pFaceCells[pFacei]; + const label pfCelli = pFaceCells[pFacei]; - scalar phiCorrf = phiCorrPf[pFacei]; + const scalar phiCorrf = phiCorrPf[pFacei]; - if (phiCorrf > 0.0) + if (phiCorrf > 0) { sumPhip[pfCelli] += phiCorrf; } @@ -309,17 +309,17 @@ void Foam::MULES::limiterCorr for (int j=0; j 0.0) + if (lambdaPhiCorrf > 0) { sumlPhip[own] += lambdaPhiCorrf; mSumlPhim[nei] += lambdaPhiCorrf; @@ -344,7 +344,7 @@ void Foam::MULES::limiterCorr scalar lambdaPhiCorrf = lambdaPf[pFacei]*phiCorrfPf[pFacei]; - if (lambdaPhiCorrf > 0.0) + if (lambdaPhiCorrf > 0) { sumlPhip[pfCelli] += lambdaPhiCorrf; } @@ -379,7 +379,7 @@ void Foam::MULES::limiterCorr forAll(lambdaIf, facei) { - if (phiCorrIf[facei] > 0.0) + if (phiCorrIf[facei] > 0) { lambdaIf[facei] = min ( @@ -415,9 +415,9 @@ void Foam::MULES::limiterCorr forAll(lambdaPf, pFacei) { - label pfCelli = pFaceCells[pFacei]; + const label pfCelli = pFaceCells[pFacei]; - if (phiCorrfPf[pFacei] > 0.0) + if (phiCorrfPf[pFacei] > 0) { lambdaPf[pFacei] = min(lambdaPf[pFacei], lambdap[pfCelli]); @@ -438,11 +438,11 @@ void Foam::MULES::limiterCorr forAll(lambdaPf, pFacei) { // Limit outlet faces only - if (phiPf[pFacei] > SMALL*SMALL) + if ((phiPf[pFacei] + phiCorrfPf[pFacei]) > SMALL*SMALL) { - label pfCelli = pFaceCells[pFacei]; + const label pfCelli = pFaceCells[pFacei]; - if (phiCorrfPf[pFacei] > 0.0) + if (phiCorrfPf[pFacei] > 0) { lambdaPf[pFacei] = min(lambdaPf[pFacei], lambdap[pfCelli]); diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/IMULES.C b/src/finiteVolume/fvMatrices/solvers/MULES/IMULES.C deleted file mode 100644 index 62bda3abcb..0000000000 --- a/src/finiteVolume/fvMatrices/solvers/MULES/IMULES.C +++ /dev/null @@ -1,54 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "IMULES.H" -#include "profiling.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -void Foam::MULES::implicitSolve -( - volScalarField& psi, - const surfaceScalarField& phi, - surfaceScalarField& phiPsi, - const scalar psiMax, - const scalar psiMin -) -{ - addProfiling(solve, "MULES::implicitSolve"); - - implicitSolve - ( - geometricOneField(), - psi, - phi, - phiPsi, - zeroField(), zeroField(), - psiMax, psiMin - ); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/IMULES.H b/src/finiteVolume/fvMatrices/solvers/MULES/IMULES.H deleted file mode 100644 index fdef6b283b..0000000000 --- a/src/finiteVolume/fvMatrices/solvers/MULES/IMULES.H +++ /dev/null @@ -1,94 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Global - IMULES - -Description - IMULES: Multidimensional universal limiter for implicit solution. - - Solve a convective-only transport equation using an explicit universal - multi-dimensional limiter applied to an implicit formulation requiring - iteration to guarantee boundedness. The number of iterations required - to obtain boundedness increases with the Courant number of the simulation. - - It may be more efficient to use CMULES. - -SourceFiles - IMULES.C - IMULESTemplates.C - -\*---------------------------------------------------------------------------*/ - -#ifndef IMULES_H -#define IMULES_H - -#include "MULES.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace MULES -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template -void implicitSolve -( - const RhoType& rho, - volScalarField& gamma, - const surfaceScalarField& phi, - surfaceScalarField& phiCorr, - const SpType& Sp, - const SuType& Su, - const scalar psiMax, - const scalar psiMin -); - -void implicitSolve -( - volScalarField& gamma, - const surfaceScalarField& phi, - surfaceScalarField& phiCorr, - const scalar psiMax, - const scalar psiMin -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace MULES -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "IMULESTemplates.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/IMULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/IMULESTemplates.C deleted file mode 100644 index c636cc8033..0000000000 --- a/src/finiteVolume/fvMatrices/solvers/MULES/IMULESTemplates.C +++ /dev/null @@ -1,239 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "IMULES.H" -#include "gaussConvectionScheme.H" -#include "surfaceInterpolate.H" -#include "fvmDdt.H" -#include "fvmSup.H" -#include "fvcDiv.H" -#include "profiling.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace MULES -{ - template - inline tmp interpolate(const RhoType& rho) - { - NotImplemented; - return tmp(nullptr); - } - - template<> - inline tmp interpolate(const volScalarField& rho) - { - return fvc::interpolate(rho); - } -} -} - - -template -void Foam::MULES::implicitSolve -( - const RhoType& rho, - volScalarField& psi, - const surfaceScalarField& phi, - surfaceScalarField& phiPsi, - const SpType& Sp, - const SuType& Su, - const scalar psiMax, - const scalar psiMin -) -{ - addProfiling(solve, "MULES::implicitSolve"); - - const fvMesh& mesh = psi.mesh(); - - const dictionary& MULEScontrols = mesh.solverDict(psi.name()); - - label maxIter - ( - readLabel(MULEScontrols.lookup("maxIter")) - ); - - scalar maxUnboundedness - ( - readScalar(MULEScontrols.lookup("maxUnboundedness")) - ); - - scalar CoCoeff - ( - readScalar(MULEScontrols.lookup("CoCoeff")) - ); - - scalarField allCoLambda(mesh.nFaces()); - - { - slicedSurfaceScalarField CoLambda - ( - IOobject - ( - "CoLambda", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh, - dimless, - allCoLambda, - false // Use slices for the couples - ); - - if (phi.dimensions() == dimDensity*dimVelocity*dimArea) - { - tmp Cof = - mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs() - *mag(phi/interpolate(rho))/mesh.magSf(); - - CoLambda == 1.0/max(CoCoeff*Cof, scalar(1)); - } - else - { - tmp Cof = - mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs() - *mag(phi)/mesh.magSf(); - - CoLambda == 1.0/max(CoCoeff*Cof, scalar(1)); - } - } - - scalarField allLambda(allCoLambda); - //scalarField allLambda(mesh.nFaces(), 1.0); - - slicedSurfaceScalarField lambda - ( - IOobject - ( - "lambda", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh, - dimless, - allLambda, - false // Use slices for the couples - ); - - linear CDs(mesh); - upwind UDs(mesh, phi); - //fv::uncorrectedSnGrad snGrads(mesh); - - fvScalarMatrix psiConvectionDiffusion - ( - fvm::ddt(rho, psi) - + fv::gaussConvectionScheme(mesh, phi, UDs).fvmDiv(phi, psi) - //- fv::gaussLaplacianScheme(mesh, CDs, snGrads) - //.fvmLaplacian(Dpsif, psi) - - fvm::Sp(Sp, psi) - - Su - ); - - surfaceScalarField phiBD(psiConvectionDiffusion.flux()); - - surfaceScalarField& phiCorr = phiPsi; - phiCorr -= phiBD; - - for (label i=0; i("phir"); - - phiCorr = - fvc::flux - ( - phi, - psi, - gammaScheme - ) - + fvc::flux - ( - -fvc::flux(-phir, scalar(1) - psi, gammarScheme), - psi, - gammarScheme - ) - - phiBD; - */ - } - } - - phiPsi = psiConvectionDiffusion.flux() + lambda*phiCorr; -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C index 3272d81d9f..743cb8eae5 100644 --- a/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C +++ b/src/finiteVolume/fvMatrices/solvers/MULES/MULESTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -185,12 +185,12 @@ void Foam::MULES::limiter const dictionary& MULEScontrols = mesh.solverDict(psi.name()); - label nLimiterIter + const label nLimiterIter ( MULEScontrols.lookupOrDefault