diff --git a/.gitignore b/.gitignore index ec46862766..138a636d60 100644 --- a/.gitignore +++ b/.gitignore @@ -58,8 +58,8 @@ doc/Doxygen/DTAGS # Untracked configuration files /etc/prefs.csh /etc/prefs.sh -/etc/config/prefs.csh -/etc/config/prefs.sh +/etc/config.csh/prefs.csh +/etc/config.sh/prefs.sh # Source packages - anywhere *.tar.bz2 @@ -83,5 +83,3 @@ doc/Doxygen/DTAGS # Ignore the test directory /tutorialsTest - -# end-of-file diff --git a/Allwmake b/Allwmake index e0dded16f0..cf49e407b7 100755 --- a/Allwmake +++ b/Allwmake @@ -43,4 +43,4 @@ then fi -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/Guides-a4/ProgrammersGuide.pdf b/Guides-a4/ProgrammersGuide.pdf new file mode 100644 index 0000000000..ebd495d608 Binary files /dev/null and b/Guides-a4/ProgrammersGuide.pdf differ diff --git a/Guides-a4/UserGuide.pdf b/Guides-a4/UserGuide.pdf new file mode 100644 index 0000000000..7524e9d800 Binary files /dev/null and b/Guides-a4/UserGuide.pdf differ diff --git a/Guides-usletter/ProgrammersGuide.pdf b/Guides-usletter/ProgrammersGuide.pdf new file mode 100644 index 0000000000..a97bc6d99d Binary files /dev/null and b/Guides-usletter/ProgrammersGuide.pdf differ diff --git a/Guides-usletter/UserGuide.pdf b/Guides-usletter/UserGuide.pdf new file mode 100644 index 0000000000..8960561f15 Binary files /dev/null and b/Guides-usletter/UserGuide.pdf differ diff --git a/applications/Allwmake b/applications/Allwmake index f23a233b64..2a922d6ae5 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -24,4 +24,4 @@ wmake -all utilities $* wmake -all solvers $* -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/DNS/dnsFoam/dnsFoam.C b/applications/solvers/DNS/dnsFoam/dnsFoam.C index 444874c82f..ddbbd20aa0 100644 --- a/applications/solvers/DNS/dnsFoam/dnsFoam.C +++ b/applications/solvers/DNS/dnsFoam/dnsFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,16 +91,17 @@ int main(int argc, char *argv[]) { volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rAUf*fvc::ddtCorr(U, phi) ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, U, phiHbyA, rAUf); + fvScalarMatrix pEqn ( fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) diff --git a/applications/solvers/basic/potentialFoam/createFields.H b/applications/solvers/basic/potentialFoam/createFields.H index 36c4dcc08a..faad238312 100644 --- a/applications/solvers/basic/potentialFoam/createFields.H +++ b/applications/solvers/basic/potentialFoam/createFields.H @@ -13,7 +13,7 @@ volVectorField U ); // Initialise the velocity internal field to zero -U = dimensionedVector("0", U.dimensions(), vector::zero); +U = dimensionedVector("0", U.dimensions(), Zero); surfaceScalarField phi ( @@ -25,13 +25,13 @@ surfaceScalarField phi IOobject::NO_READ, IOobject::AUTO_WRITE ), - fvc::interpolate(U) & mesh.Sf() + fvc::flux(U) ); if (args.optionFound("initialiseUBCs")) { U.correctBoundaryConditions(); - phi = fvc::interpolate(U) & mesh.Sf(); + phi = fvc::flux(U); } diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index a13d288a21..356d7e5fad 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -172,8 +172,7 @@ int main(int argc, char *argv[]) U.correctBoundaryConditions(); Info<< "Interpolated velocity error = " - << (sqrt(sum(sqr((fvc::interpolate(U) & mesh.Sf()) - phi))) - /sum(mesh.magSf())).value() + << (sqrt(sum(sqr(fvc::flux(U) - phi)))/sum(mesh.magSf())).value() << endl; // Write U and phi diff --git a/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C b/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C index 958de584c3..12dbaa9e2e 100644 --- a/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C +++ b/applications/solvers/basic/scalarTransportFoam/scalarTransportFoam.C @@ -91,10 +91,10 @@ int main(int argc, char *argv[]) fvOptions(T) ); + TEqn.relax(); fvOptions.constrain(TEqn); - TEqn.solve(); - + fvOptions.correct(T); } runTime.write(); diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C index 9e507b5f92..e85e41b432 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "basicXiSubXiEq.H" -#include "zeroGradientFvPatchFields.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -93,59 +92,43 @@ Foam::tmp Foam::XiEqModels::basicSubGrid::XiEq() const const scalarField Cw = pow(mesh.V(), 2.0/3.0); - tmp tN + volScalarField N ( - new volScalarField + IOobject ( - IOobject - ( - "tN", - mesh.time().constant(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "N", + mesh.time().constant(), mesh, - dimensionedScalar("zero", Nv.dimensions(), 0.0), - zeroGradientFvPatchVectorField::typeName - ) + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", Nv.dimensions(), 0.0) ); - - volScalarField& N = tN(); - N.internalField() = Nv.internalField()*Cw; - tmp tns + volSymmTensorField ns ( - new volSymmTensorField + IOobject ( - IOobject - ( - "tns", - U.mesh().time().timeName(), - U.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "ns", + U.mesh().time().timeName(), U.mesh(), - dimensionedSymmTensor - ( - "zero", - nsv.dimensions(), - pTraits::zero - ), - zeroGradientFvPatchSymmTensorField::typeName + IOobject::NO_READ, + IOobject::NO_WRITE + ), + U.mesh(), + dimensionedSymmTensor + ( + "zero", + nsv.dimensions(), + Zero ) ); - - volSymmTensorField& ns = tns(); - ns.internalField() = nsv.internalField()*Cw; volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4))); - volScalarField b((Uhat & B_ & Uhat)/sqrt(n)); - volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); volScalarField XiSubEq diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C index 928c424191..45050a171b 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "basicXiSubG.H" -#include "zeroGradientFvPatchFields.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -71,32 +70,10 @@ Foam::tmp Foam::XiGModels::basicSubGrid::G() const const volScalarField& Lobs = db.lookupObject("Lobs"); tmp tGtot = XiGModel_->G(); - volScalarField& Gtot = tGtot(); + volScalarField& Gtot = tGtot.ref(); const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0); - - tmp tN - ( - new volScalarField - ( - IOobject - ( - "tN", - Su_.mesh().time().timeName(), - Su_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - Su_.mesh(), - dimensionedScalar("zero", Nv.dimensions(), 0.0), - zeroGradientFvPatchVectorField::typeName - ) - ); - - volScalarField& N = tN(); - - N.internalField() = Nv.internalField()*Cw; + scalarField N(Nv.internalField()*Cw); forAll(N, celli) { diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C index 9fd96b2033..7e3d2bb7aa 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "basic.H" -#include "zeroGradientFvPatchFields.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -109,13 +108,12 @@ Foam::tmp Foam::PDRDragModels::basic::Dcu() const ( "zero", dimMass/dimTime/pow(dimLength, 3), - pTraits::zero - ), - zeroGradientFvPatchSymmTensorField::typeName + Zero + ) ) ); - volSymmTensorField& DragDcu = tDragDcu(); + volSymmTensorField& DragDcu = tDragDcu.ref(); if (on_) { @@ -145,12 +143,11 @@ Foam::tmp Foam::PDRDragModels::basic::Gk() const IOobject::NO_WRITE ), U_.mesh(), - dimensionedScalar("zero", dimMass/dimLength/pow(dimTime, 3), 0.0), - zeroGradientFvPatchVectorField::typeName + dimensionedScalar("zero", dimMass/dimLength/pow(dimTime, 3), 0.0) ) ); - volScalarField& Gk = tGk(); + volScalarField& Gk = tGk.ref(); if (on_) { diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index e09c1bbd14..afe97f7f7f 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ PDRkEpsilon::PDRkEpsilon const word& modelName ) : - Foam::RASModels::kEpsilon > + Foam::RASModels::kEpsilon> ( geometricOneField(), rho, @@ -161,9 +161,9 @@ void PDRkEpsilon::correct() - fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_) ); - epsEqn().relax(); + epsEqn.ref().relax(); - epsEqn().boundaryManipulate(epsilon_.boundaryField()); + epsEqn.ref().boundaryManipulate(epsilon_.boundaryField()); solve(epsEqn); bound(epsilon_, epsilonMin_); @@ -182,7 +182,7 @@ void PDRkEpsilon::correct() - fvm::Sp(betav*rho_*epsilon_/k_, k_) ); - kEqn().relax(); + kEqn.ref().relax(); solve(kEqn); bound(k_, kMin_); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C index ad8452f5a4..0208818ee0 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,7 +108,7 @@ Foam::tmp Foam::XiEqModels::SCOPEXiEq::XiEq() const dimensionedScalar("XiEq", dimless, 0.0) ) ); - volScalarField& xieq = tXiEq(); + volScalarField& xieq = tXiEq.ref(); forAll(xieq, celli) { diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C index 4d1c8c11fd..966dae7175 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "XiEqModel.H" -#include "zeroGradientFvPatchFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -111,39 +110,30 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const false ), mesh, - dimensionedScalar("zero", Nv.dimensions(), 0.0), - zeroGradientFvPatchVectorField::typeName + dimensionedScalar("zero", Nv.dimensions(), 0.0) ) ); - - volScalarField& N = tN(); - + volScalarField& N = tN.ref(); N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0); - tmp tns + volSymmTensorField ns ( - new volSymmTensorField + IOobject ( - IOobject - ( - "tns", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "tns", + mesh.time().timeName(), mesh, - dimensionedSymmTensor - ( - "zero", - nsv.dimensions(), - pTraits::zero - ) + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedSymmTensor + ( + "zero", + nsv.dimensions(), + Zero ) ); - - volSymmTensorField& ns = tns(); - ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0); const volVectorField Uhat diff --git a/applications/solvers/combustion/PDRFoam/bEqn.H b/applications/solvers/combustion/PDRFoam/bEqn.H index 8ad1161871..e9f1a73279 100644 --- a/applications/solvers/combustion/PDRFoam/bEqn.H +++ b/applications/solvers/combustion/PDRFoam/bEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C index d4d7782287..fd07b0b3cb 100644 --- a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C +++ b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -259,7 +259,7 @@ Foam::tmp Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi ) ); - volScalarField& Su0 = tSu0(); + volScalarField& Su0 = tSu0.ref(); forAll(Su0, celli) { @@ -306,7 +306,7 @@ Foam::tmp Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi ) ); - volScalarField& Su0 = tSu0(); + volScalarField& Su0 = tSu0.ref(); forAll(Su0, celli) { @@ -358,7 +358,7 @@ Foam::tmp Foam::laminarFlameSpeedModels::SCOPE::Ma ) ); - volScalarField& ma = tMa(); + volScalarField& ma = tMa.ref(); forAll(ma, celli) { diff --git a/applications/solvers/combustion/PDRFoam/pEqn.H b/applications/solvers/combustion/PDRFoam/pEqn.H index 499885875b..c7308f8b12 100644 --- a/applications/solvers/combustion/PDRFoam/pEqn.H +++ b/applications/solvers/combustion/PDRFoam/pEqn.H @@ -1,9 +1,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); - -volVectorField HbyA("HbyA", U); -HbyA = invA & UEqn.H(); +volVectorField HbyA(constrainHbyA(invA & UEqn.H(), U, p)); if (pimple.transonic()) { @@ -12,7 +10,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) /fvc::interpolate(rho) ) @@ -43,7 +41,7 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) ) ); diff --git a/applications/solvers/combustion/XiFoam/XiDyMFoam/pEqn.H b/applications/solvers/combustion/XiFoam/XiDyMFoam/pEqn.H index 438396ae90..34a822a0a2 100644 --- a/applications/solvers/combustion/XiFoam/XiDyMFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/XiDyMFoam/pEqn.H @@ -2,9 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.transonic()) { @@ -54,6 +52,9 @@ else fvc::makeRelative(phiHbyA, rho, U); MRF.makeRelative(phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/combustion/XiFoam/ftEqn.H b/applications/solvers/combustion/XiFoam/ftEqn.H index 87bfaa9790..c0f7dcad9c 100644 --- a/applications/solvers/combustion/XiFoam/ftEqn.H +++ b/applications/solvers/combustion/XiFoam/ftEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index 2b11dc73f8..afba129157 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -2,9 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.transonic()) { @@ -13,7 +11,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); @@ -45,13 +43,16 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/combustion/chemFoam/createFields.H b/applications/solvers/combustion/chemFoam/createFields.H index ae5d54fc58..2d2e9d1ebd 100644 --- a/applications/solvers/combustion/chemFoam/createFields.H +++ b/applications/solvers/combustion/chemFoam/createFields.H @@ -80,8 +80,7 @@ IOobject::NO_WRITE ), mesh, - dimensionedVector("zero", dimVelocity, vector::zero), - p.boundaryField().types() + dimensionedVector("zero", dimVelocity, Zero) ); #include "createPhi.H" diff --git a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H index e5e7de6496..9b9d0f376b 100644 --- a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H +++ b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H @@ -25,7 +25,7 @@ fvMesh mesh runTime, IOobject::READ_IF_PRESENT ), - xferMove >(points), + xferMove>(points), faces.xfer(), owner.xfer(), neighbour.xfer() diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index c962353e3f..aca8c2c11a 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -2,9 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.transonic()) { @@ -14,7 +12,7 @@ if (pimple.transonic()) fvc::interpolate(psi) *( ( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) ) ) @@ -29,7 +27,7 @@ if (pimple.transonic()) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(rhorAUf, p) == fvOptions(psi, p, rho.name()) ); @@ -48,7 +46,7 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, rhoUf) ) ); @@ -56,13 +54,16 @@ else fvc::makeRelative(phiHbyA, rho, U); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(rhorAUf, p) == fvOptions(psi, p, rho.name()) ); diff --git a/applications/solvers/combustion/fireFoam/YEEqn.H b/applications/solvers/combustion/fireFoam/YEEqn.H index da485e7305..cee98e2429 100644 --- a/applications/solvers/combustion/fireFoam/YEEqn.H +++ b/applications/solvers/combustion/fireFoam/YEEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 4d8c59a297..b337a29bc7 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,6 @@ Description #include "psiCombustionModel.H" #include "pimpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 6f8b034581..7b5249d57e 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -2,9 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); @@ -12,7 +10,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) + phig @@ -20,16 +18,8 @@ surfaceScalarField phiHbyA MRF.makeRelative(fvc::interpolate(rho), phiHbyA); -// Update the fixedFluxPressure BCs to ensure flux consistency -setSnGrad -( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - *rho.boundaryField() - )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) -); +// Update the pressure BCs to ensure flux consistency +constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF); while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/combustion/reactingFoam/UEqn.H b/applications/solvers/combustion/reactingFoam/UEqn.H index 907c9934e2..e4caa1cea4 100644 --- a/applications/solvers/combustion/reactingFoam/UEqn.H +++ b/applications/solvers/combustion/reactingFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); -tmp UEqn +tmp tUEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,14 +10,15 @@ tmp UEqn == fvOptions(rho, U) ); +fvVectorMatrix& UEqn = tUEqn.ref(); -UEqn().relax(); +UEqn.relax(); -fvOptions.constrain(UEqn()); +fvOptions.constrain(UEqn); if (pimple.momentumPredictor()) { - solve(UEqn() == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); K = 0.5*magSqr(U); diff --git a/applications/solvers/combustion/reactingFoam/YEqn.H b/applications/solvers/combustion/reactingFoam/YEqn.H index c8d34cf1d5..8cb5664d5a 100644 --- a/applications/solvers/combustion/reactingFoam/YEqn.H +++ b/applications/solvers/combustion/reactingFoam/YEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 2f352db5da..ac7107acf0 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -3,15 +3,13 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU(1.0/UEqn().A()); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } if (pimple.transonic()) @@ -21,7 +19,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); @@ -53,13 +51,16 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/combustion/reactingFoam/pcEqn.H b/applications/solvers/combustion/reactingFoam/pcEqn.H index 3d7fffc459..713f443fc5 100644 --- a/applications/solvers/combustion/reactingFoam/pcEqn.H +++ b/applications/solvers/combustion/reactingFoam/pcEqn.H @@ -3,14 +3,13 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU(1.0/UEqn().A()); -volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volScalarField rAU(1.0/UEqn.A()); +volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1())); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } if (pimple.transonic()) @@ -20,7 +19,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) /fvc::interpolate(rho) ) @@ -64,7 +63,7 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) ) ); @@ -76,6 +75,9 @@ else volScalarField rhorAtU("rhorAtU", rho*rAtU); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H index 965ff5bad2..926e69f7c1 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H @@ -7,9 +7,7 @@ volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); @@ -17,7 +15,7 @@ ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) + phig @@ -25,16 +23,8 @@ MRF.makeRelative(fvc::interpolate(rho), phiHbyA); - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - *rho.boundaryField() - )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF); fvScalarMatrix p_rghDDtEqn ( diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C index 63b7b8a61f..d5caeb13dd 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,6 @@ Description #include "multivariateScheme.H" #include "pimpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H index c3b18e6bd7..eff014cf43 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H @@ -5,11 +5,9 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU(1.0/UEqn().A()); + volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.transonic()) { @@ -17,7 +15,7 @@ ( "phiHbyA", ( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); @@ -58,13 +56,16 @@ ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + fvScalarMatrix pDDtEqn ( fvc::ddt(rho) + psi*correction(fvm::ddt(p)) diff --git a/applications/solvers/combustion/reactingFoam/setRDeltaT.H b/applications/solvers/combustion/reactingFoam/setRDeltaT.H index b84be5a66d..12bdceb7e5 100644 --- a/applications/solvers/combustion/reactingFoam/setRDeltaT.H +++ b/applications/solvers/combustion/reactingFoam/setRDeltaT.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); const dictionary& pimpleDict = pimple.dict(); diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean index 1a0374d96d..34bab5c449 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwclean +++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso BCs wclean wclean rhoCentralDyMFoam -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 5c4ed20c24..c85e459457 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -1,7 +1,11 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -(wmake libso BCs && wmake && wmake rhoCentralDyMFoam) +(wmake $targetType BCs && wmake && wmake rhoCentralDyMFoam) -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C index 5c1459381f..d65d3943f9 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,15 +26,10 @@ License #include "mixedFixedValueSlipFvPatchField.H" #include "symmTransformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField +Foam::mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -47,7 +42,21 @@ mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField template -mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField +Foam::mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + transformFvPatchField(p, iF), + refValue_("refValue", dict, p.size()), + valueFraction_("valueFraction", dict, p.size()) +{} + + +template +Foam::mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField ( const mixedFixedValueSlipFvPatchField& ptf, const fvPatch& p, @@ -62,21 +71,7 @@ mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField template -mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - transformFvPatchField(p, iF), - refValue_("refValue", dict, p.size()), - valueFraction_("valueFraction", dict, p.size()) -{} - - -template -mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField +Foam::mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField ( const mixedFixedValueSlipFvPatchField& ptf ) @@ -86,8 +81,9 @@ mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField valueFraction_(ptf.valueFraction_) {} + template -mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField +Foam::mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField ( const mixedFixedValueSlipFvPatchField& ptf, const DimensionedField& iF @@ -101,9 +97,8 @@ mixedFixedValueSlipFvPatchField::mixedFixedValueSlipFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Map from self template -void mixedFixedValueSlipFvPatchField::autoMap +void Foam::mixedFixedValueSlipFvPatchField::autoMap ( const fvPatchFieldMapper& m ) @@ -114,9 +109,8 @@ void mixedFixedValueSlipFvPatchField::autoMap } -// Reverse-map the given fvPatchField onto this fvPatchField template -void mixedFixedValueSlipFvPatchField::rmap +void Foam::mixedFixedValueSlipFvPatchField::rmap ( const fvPatchField& ptf, const labelList& addr @@ -125,16 +119,16 @@ void mixedFixedValueSlipFvPatchField::rmap transformFvPatchField::rmap(ptf, addr); const mixedFixedValueSlipFvPatchField& dmptf = - refCast >(ptf); + refCast>(ptf); refValue_.rmap(dmptf.refValue_, addr); valueFraction_.rmap(dmptf.valueFraction_, addr); } -// Return gradient at boundary template -tmp > mixedFixedValueSlipFvPatchField::snGrad() const +Foam::tmp> +Foam::mixedFixedValueSlipFvPatchField::snGrad() const { tmp nHat = this->patch().nf(); Field pif(this->patchInternalField()); @@ -147,9 +141,11 @@ tmp > mixedFixedValueSlipFvPatchField::snGrad() const } -// Evaluate the field on the patch template -void mixedFixedValueSlipFvPatchField::evaluate(const Pstream::commsTypes) +void Foam::mixedFixedValueSlipFvPatchField::evaluate +( + const Pstream::commsTypes +) { if (!this->updated()) { @@ -170,10 +166,9 @@ void mixedFixedValueSlipFvPatchField::evaluate(const Pstream::commsTypes) } -// Return defining fields template -tmp > -mixedFixedValueSlipFvPatchField::snGradTransformDiag() const +Foam::tmp> +Foam::mixedFixedValueSlipFvPatchField::snGradTransformDiag() const { vectorField nHat(this->patch().nf()); vectorField diag(nHat.size()); @@ -189,9 +184,8 @@ mixedFixedValueSlipFvPatchField::snGradTransformDiag() const } -// Write template -void mixedFixedValueSlipFvPatchField::write(Ostream& os) const +void Foam::mixedFixedValueSlipFvPatchField::write(Ostream& os) const { transformFvPatchField::write(os); refValue_.writeEntry("refValue", os); @@ -199,8 +193,4 @@ void mixedFixedValueSlipFvPatchField::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H index d27b722a93..5ab7d3835f 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -101,9 +101,9 @@ public: ); //- Construct and return a clone - virtual tmp > clone() const + virtual tmp> clone() const { - return tmp > + return tmp> ( new mixedFixedValueSlipFvPatchField(*this) ); @@ -117,12 +117,12 @@ public: ); //- Construct and return a clone setting internal field reference - virtual tmp > clone + virtual tmp> clone ( const DimensionedField& iF ) const { - return tmp > + return tmp> ( new mixedFixedValueSlipFvPatchField(*this, iF) ); @@ -130,6 +130,15 @@ public: // Member functions + // Access + + //- Return false: this patch field is not altered by assignment + virtual bool assignable() const + { + return false; + } + + // Mapping functions //- Map (and resize as needed) from self given a mapping object @@ -170,7 +179,7 @@ public: // Evaluation functions //- Return gradient at boundary - virtual tmp > snGrad() const; + virtual tmp> snGrad() const; //- Evaluate the patch field virtual void evaluate @@ -179,7 +188,7 @@ public: ); //- Return face-gradient transform diagonal - virtual tmp > snGradTransformDiag() const; + virtual tmp> snGradTransformDiag() const; //- Write diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H index 6efbb4947d..cc5cd933b6 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ Description This boundary condition provides a fixed density inlet condition for compressible solvers, where the density of calculated using: - \f{ + \f[ \rho = \psi p \f] diff --git a/applications/solvers/compressible/rhoCentralFoam/createFields.H b/applications/solvers/compressible/rhoCentralFoam/createFields.H index 632efaf9d1..538e936e39 100644 --- a/applications/solvers/compressible/rhoCentralFoam/createFields.H +++ b/applications/solvers/compressible/rhoCentralFoam/createFields.H @@ -95,7 +95,7 @@ surfaceScalarField neg dimensionedScalar("neg", dimless, -1.0) ); -surfaceScalarField phi("phi", mesh.Sf() & fvc::interpolate(rhoU)); +surfaceScalarField phi("phi", fvc::flux(rhoU)); Info<< "Creating turbulence model\n" << endl; autoPtr turbulence diff --git a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H index 7f4b6cd7b8..bc94840d1f 100644 --- a/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H +++ b/applications/solvers/compressible/rhoCentralFoam/directionInterpolate.H @@ -3,14 +3,14 @@ namespace Foam //- Interpolate field vf according to direction dir template -tmp > interpolate +tmp> interpolate ( const GeometricField& vf, const surfaceScalarField& dir, const word& reconFieldName = word::null ) { - tmp > tsf + tmp> tsf ( fvc::interpolate ( @@ -22,7 +22,7 @@ tmp > interpolate ) ); - GeometricField& sf = tsf(); + GeometricField& sf = tsf.ref(); sf.rename(vf.name() + '_' + dir.name()); diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C index dea76502f1..92fe4857c9 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,6 @@ Description #include "dynamicFvMesh.H" #include "psiThermo.H" #include "turbulentFluidThermoModel.H" -#include "zeroGradientFvPatchFields.H" #include "fixedRhoFvPatchScalarField.H" #include "directionInterpolate.H" #include "motionSolver.H" @@ -212,7 +211,7 @@ int main(int argc, char *argv[]) "sigmaDotU", ( fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U) - + (mesh.Sf() & fvc::interpolate(tauMC)) + + fvc::dotInterpolate(mesh.Sf(), tauMC) ) & (a_pos*U_pos + a_neg*U_neg) ); diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 1b71f42b94..48a5d91769 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,6 @@ Description #include "fvCFD.H" #include "psiThermo.H" #include "turbulentFluidThermoModel.H" -#include "zeroGradientFvPatchFields.H" #include "fixedRhoFvPatchScalarField.H" #include "directionInterpolate.H" #include "localEulerDdtScheme.H" @@ -205,9 +204,9 @@ int main(int argc, char *argv[]) "sigmaDotU", ( fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U) - + (mesh.Sf() & fvc::interpolate(tauMC)) + + fvc::dotInterpolate(mesh.Sf(), tauMC) ) - & (a_pos*U_pos + a_neg*U_neg) + & (a_pos*U_pos + a_neg*U_neg) ); solve diff --git a/applications/solvers/compressible/rhoCentralFoam/setRDeltaT.H b/applications/solvers/compressible/rhoCentralFoam/setRDeltaT.H index e469bafa34..806ddd3832 100644 --- a/applications/solvers/compressible/rhoCentralFoam/setRDeltaT.H +++ b/applications/solvers/compressible/rhoCentralFoam/setRDeltaT.H @@ -1,5 +1,5 @@ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); scalar rDeltaTSmoothingCoeff ( diff --git a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H index 907c9934e2..e4caa1cea4 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); -tmp UEqn +tmp tUEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,14 +10,15 @@ tmp UEqn == fvOptions(rho, U) ); +fvVectorMatrix& UEqn = tUEqn.ref(); -UEqn().relax(); +UEqn.relax(); -fvOptions.constrain(UEqn()); +fvOptions.constrain(UEqn); if (pimple.momentumPredictor()) { - solve(UEqn() == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); K = 0.5*magSqr(U); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 2f352db5da..ac7107acf0 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -3,15 +3,13 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU(1.0/UEqn().A()); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } if (pimple.transonic()) @@ -21,7 +19,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); @@ -53,13 +51,16 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H index 3d7fffc459..713f443fc5 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H @@ -3,14 +3,13 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU(1.0/UEqn().A()); -volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volScalarField rAU(1.0/UEqn.A()); +volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1())); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } if (pimple.transonic()) @@ -20,7 +19,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) /fvc::interpolate(rho) ) @@ -64,7 +63,7 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) ) ); @@ -76,6 +75,9 @@ else volScalarField rhorAtU("rhorAtU", rho*rAtU); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index 33039b3dc9..7bd540df40 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -3,15 +3,13 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU(1.0/UEqn().A()); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } if (pimple.transonic()) @@ -21,7 +19,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) ) ); @@ -53,13 +51,16 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, rhoUf) ); fvc::makeRelative(phiHbyA, rho, U); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { // Pressure corrector diff --git a/applications/solvers/compressible/rhoPimpleFoam/setRDeltaT.H b/applications/solvers/compressible/rhoPimpleFoam/setRDeltaT.H index 30a3908b05..0a38e05ee9 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/setRDeltaT.H +++ b/applications/solvers/compressible/rhoPimpleFoam/setRDeltaT.H @@ -1,5 +1,5 @@ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); const dictionary& pimpleDict = pimple.dict(); @@ -38,7 +38,7 @@ surfaceScalarField phid ( "phid", - fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf()) + fvc::interpolate(psi)*fvc::flux(U) ); rDeltaT.dimensionedInternalField() = max diff --git a/applications/solvers/compressible/rhoSimpleFoam/UEqn.H b/applications/solvers/compressible/rhoSimpleFoam/UEqn.H index 396b923494..a6f410250b 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,11 +10,12 @@ == fvOptions(rho, U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); - solve(UEqn() == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); diff --git a/applications/solvers/compressible/rhoSimpleFoam/createFields.H b/applications/solvers/compressible/rhoSimpleFoam/createFields.H index 80f317cd85..61cea5c2e5 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoSimpleFoam/createFields.H @@ -69,9 +69,9 @@ dimensionedScalar rhoMin ); Info<< "Creating turbulence model\n" << endl; -autoPtr turbulence +autoPtr turbulence ( - compressible::New + compressible::turbulenceModel::New ( rho, U, diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 38c9806ee9..e46f2a6691 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -1,9 +1,8 @@ { - volScalarField rAU(1.0/UEqn().A()); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); - - UEqn.clear(); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); + tUEqn.clear(); bool closedVolume = false; @@ -13,7 +12,7 @@ ( "phid", fvc::interpolate(psi) - *(fvc::interpolate(HbyA) & mesh.Sf()) + *fvc::flux(HbyA) ); MRF.makeRelative(fvc::interpolate(psi), phid); @@ -23,7 +22,7 @@ fvScalarMatrix pEqn ( fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(rhorAUf, p) == fvOptions(psi, p, rho.name()) ); @@ -43,22 +42,20 @@ } else { - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::interpolate(rho*HbyA) & mesh.Sf() - ); - + surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA)); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); closedVolume = adjustPhi(phiHbyA, U, p); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (simple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(rhorAUf, p) == fvOptions(psi, p, rho.name()) ); diff --git a/applications/solvers/compressible/rhoSimpleFoam/pcEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pcEqn.H index 82161f230c..67b962f805 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pcEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pcEqn.H @@ -1,10 +1,7 @@ -volScalarField rAU(1.0/UEqn().A()); -volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); - -UEqn.clear(); +volScalarField rAU(1.0/UEqn.A()); +volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1())); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); +tUEqn.clear(); bool closedVolume = false; @@ -14,7 +11,7 @@ if (simple.transonic()) ( "phid", fvc::interpolate(psi) - *(fvc::interpolate(HbyA) & mesh.Sf()) + *fvc::flux(HbyA) ); MRF.makeRelative(fvc::interpolate(psi), phid); @@ -55,12 +52,7 @@ if (simple.transonic()) } else { - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::interpolate(rho*HbyA) & mesh.Sf() - ); - + surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA)); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); closedVolume = adjustPhi(phiHbyA, U, p); @@ -70,6 +62,9 @@ else volScalarField rhorAtU("rhorAtU", rho*rAtU); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF); + while (simple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H index fcb8f713d6..3ec153c567 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,8 +10,9 @@ == fvOptions(rho, U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); // Include the porous media resistance and solve the momentum equation // either implicit in the tensorial resistance or transport using by @@ -22,18 +23,18 @@ if (pressureImplicitPorosity) { - tmp tTU = tensor(I)*UEqn().A(); - pZones.addResistance(UEqn(), tTU()); + tmp tTU = tensor(I)*UEqn.A(); + pZones.addResistance(UEqn, tTU.ref()); trTU = inv(tTU()); - trTU().rename("rAU"); + trTU.ref().rename("rAU"); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); volVectorField gradp(fvc::grad(p)); for (int UCorr=0; UCorr turbulence +autoPtr turbulence ( - compressible::New + compressible::turbulenceModel::New ( rho, U, diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H index b0af0e3f8b..7b55983161 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H @@ -1,27 +1,22 @@ { const volScalarField& psi = thermo.psi(); - volVectorField HbyA("HbyA", U); - + tmp tHbyA; if (pressureImplicitPorosity) { - HbyA = trTU() & UEqn().H(); + tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p); } else { - HbyA = trAU()*UEqn().H(); + tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p); } + volVectorField& HbyA = tHbyA.ref(); - UEqn.clear(); + tUEqn.clear(); bool closedVolume = false; - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::interpolate(rho*HbyA) & mesh.Sf() - ); - + surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA)); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); closedVolume = adjustPhi(phiHbyA, U, p); @@ -51,13 +46,15 @@ ); } - tpEqn().setReference(pRefCell, pRefValue); + fvScalarMatrix& pEqn = tpEqn.ref(); - tpEqn().solve(); + pEqn.setReference(pRefCell, pRefValue); + + pEqn.solve(); if (simple.finalNonOrthogonalIter()) { - phi = phiHbyA - tpEqn().flux(); + phi = phiHbyA - pEqn.flux(); } } diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H index d61808b23c..bd553928b1 100644 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -2,16 +2,13 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); - +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phid ( "phid", fvc::interpolate(psi) *( - (mesh.Sf() & fvc::interpolate(HbyA)) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H index 439709ed07..92e0bb3673 100644 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H @@ -2,16 +2,13 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); - +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phid ( "phid", fvc::interpolate(psi) *( - (mesh.Sf() & fvc::interpolate(HbyA)) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) ) ); diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C index 9fda461211..1b2e272df9 100644 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C +++ b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) "phid", psi *( - (fvc::interpolate(U) & mesh.Sf()) + fvc::flux(U) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); diff --git a/applications/solvers/electromagnetics/magneticFoam/magnet.H b/applications/solvers/electromagnetics/magneticFoam/magnet.H index 031f64ca09..7e9b04a4c5 100644 --- a/applications/solvers/electromagnetics/magneticFoam/magnet.H +++ b/applications/solvers/electromagnetics/magneticFoam/magnet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,7 +72,7 @@ public: inline magnet() : remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), 0), - orientation_(vector::zero) + orientation_(Zero) {} //- Construct from components @@ -94,7 +94,7 @@ public: inline magnet(Istream& is) : remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), 0), - orientation_(vector::zero) + orientation_(Zero) { is >> *this; } diff --git a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H index be0fbfaf83..268413afec 100644 --- a/applications/solvers/electromagnetics/mhdFoam/createPhiB.H +++ b/applications/solvers/electromagnetics/mhdFoam/createPhiB.H @@ -40,7 +40,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - (fvc::interpolate(B) & mesh.Sf()) + fvc::flux(B) ); } diff --git a/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C b/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C index 497e977e85..88fd8d36dd 100644 --- a/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C +++ b/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,17 +100,17 @@ int main(int argc, char *argv[]) { volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rAUf*fvc::ddtCorr(U, phi) ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, U, phiHbyA, rAUf); + while (piso.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -150,8 +150,7 @@ int main(int argc, char *argv[]) volScalarField rAB(1.0/BEqn.A()); surfaceScalarField rABf("rABf", fvc::interpolate(rAB)); - phiB = (fvc::interpolate(B) & mesh.Sf()) - + rABf*fvc::ddtCorr(B, phiB); + phiB = fvc::flux(B) + rABf*fvc::ddtCorr(B, phiB); while (bpiso.correctNonOrthogonal()) { diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C index bc348b840e..334c0b6db2 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,6 @@ Description #include "radiationModel.H" #include "fvOptions.H" #include "pimpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H index b8d07b1f1a..0916e2788d 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H @@ -47,9 +47,9 @@ volVectorField U #include "readTransportProperties.H" Info<< "Creating turbulence model\n" << endl; -autoPtr turbulence +autoPtr turbulence ( - incompressible::New(U, phi, laminarTransport) + incompressible::turbulenceModel::New(U, phi, laminarTransport) ); // Kinematic density for buoyancy force diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H index 9ec089ee4c..51d9461c87 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H @@ -1,31 +1,22 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rAUf*fvc::ddtCorr(U, phi) + phig ); MRF.makeRelative(phiHbyA); - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H index 72bf78c7fb..d8a347f87d 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(U) @@ -10,16 +10,17 @@ == fvOptions(U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); if (simple.momentumPredictor()) { solve ( - UEqn() + UEqn == fvc::reconstruct ( diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index 8547f274fa..38af1c5cdc 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,6 @@ Description #include "radiationModel.H" #include "fvOptions.H" #include "simpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H index 014bf8045c..e78daa67b3 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H @@ -47,9 +47,9 @@ volVectorField U #include "readTransportProperties.H" Info<< "Creating turbulence model\n" << endl; -autoPtr turbulence +autoPtr turbulence ( - incompressible::New(U, phi, laminarTransport) + incompressible::turbulenceModel::New(U, phi, laminarTransport) ); // Kinematic density for buoyancy force diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H index b6d8067358..f29075b149 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H @@ -1,17 +1,16 @@ { - volScalarField rAU("rAU", 1.0/UEqn().A()); + volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); - UEqn.clear(); + tUEqn.clear(); surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) ); MRF.makeRelative(phiHbyA); @@ -20,15 +19,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); while (simple.correctNonOrthogonal()) { diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index 5437e7f625..ef952f00c4 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Description #include "radiationModel.H" #include "fvOptions.H" #include "pimpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 76b4925917..cda60d98b2 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -11,35 +11,25 @@ thermo.rho() -= psi*p_rgh; volScalarField rAU(1.0/UEqn.A()); - surfaceScalarField rAUf("rAUf", fvc::interpolate(rho*rAU)); + surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - - surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); + surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) - + rAUf*fvc::ddtCorr(rho, U, phi) + fvc::flux(rho*HbyA) + + rhorAUf*fvc::ddtCorr(rho, U, phi) ) + phig ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - *rho.boundaryField() - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF); tmp p_rghDDtEqn ( @@ -51,6 +41,7 @@ p_rghDDtEqn = ( fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) + + fvc::div(phiHbyA) == fvOptions(psi, p_rgh, rho.name()) ); @@ -61,8 +52,7 @@ fvScalarMatrix p_rghEqn ( p_rghDDtEqn() - + fvc::div(phiHbyA) - - fvm::laplacian(rAUf, p_rgh) + - fvm::laplacian(rhorAUf, p_rgh) ); p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); @@ -77,7 +67,7 @@ // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure - U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); U.correctBoundaryConditions(); fvOptions.correct(U); K = 0.5*magSqr(U); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H index 04796b4754..1a47d06a8e 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,16 +10,17 @@ == fvOptions(rho, U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); if (simple.momentumPredictor()) { solve ( - UEqn() + UEqn == fvc::reconstruct ( diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 6aa339f56e..d4e44bd888 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,6 @@ Description #include "radiationModel.H" #include "simpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 2d08a681ed..647cf954bb 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -2,19 +2,17 @@ rho = thermo.rho(); rho.relax(); - volScalarField rAU("rAU", 1.0/UEqn().A()); + volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); - UEqn.clear(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); + tUEqn.clear(); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); @@ -23,16 +21,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - *rho.boundaryField() - )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF); while (simple.correctNonOrthogonal()) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index 34fcad63b7..05191cd12a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,6 @@ Description #include "radiationModel.H" #include "fvOptions.H" #include "coordinateSystem.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C index 263dae535e..0c1604505a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,6 @@ Description #include "radiationModel.H" #include "fvOptions.H" #include "coordinateSystem.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H index b65ef6bfdb..ed0402c2d0 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,14 +10,15 @@ == fvOptions(rho, U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); solve ( - UEqn() + UEqn == fvc::reconstruct ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H index ccae3cc079..7fe544d6a5 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H @@ -4,19 +4,17 @@ rho = min(rho, rhoMax[i]); rho.relax(); - volScalarField rAU("rAU", 1.0/UEqn().A()); + volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); - UEqn.clear(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); + tUEqn.clear(); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); @@ -25,16 +23,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - *rho.boundaryField() - )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF); dimensionedScalar compressibility = fvc::domainIntegrate(psi); bool compressible = (compressibility.value() > SMALL); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H index 563ad65eba..a12d0e8146 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,16 +10,17 @@ == fvOptions(rho, U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); if (momentumPredictor) { solve ( - UEqn() + UEqn == fvc::reconstruct ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H index fa5feefbb4..82dc875847 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H @@ -15,7 +15,7 @@ ); } /* - forAll (porousFluidRegions, porousI) + forAll(porousFluidRegions, porousI) { CoNum = max ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index cd42cc00fd..d5ba5ca240 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -5,11 +5,9 @@ rho = thermo.rho(); - volScalarField rAU("rAU", 1.0/UEqn().A()); + volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); @@ -17,7 +15,7 @@ ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) + phig @@ -25,16 +23,8 @@ MRF.makeRelative(fvc::interpolate(rho), phiHbyA); - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - *rho.boundaryField() - )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF); tmp p_rghDDtEqn ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H index 10e9aa08ab..3c38dc19ae 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -55,7 +55,7 @@ ( "zero", tkappaByCp().dimensions(), - symmTensor::zero + Zero ), zeroGradientFvPatchSymmTensorField::typeName ) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H index 49fd39e45b..30a670768f 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H @@ -6,7 +6,7 @@ if (finalIter) { for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - tmp hEqn + fvScalarMatrix hEqn ( fvm::ddt(betav*rho, h) - ( @@ -18,11 +18,11 @@ if (finalIter) fvOptions(rho, h) ); - hEqn().relax(); + hEqn.relax(); - fvOptions.constrain(hEqn()); + fvOptions.constrain(hEqn); - hEqn().solve(mesh.solver(h.select(finalIter))); + hEqn.solve(mesh.solver(h.select(finalIter))); fvOptions.correct(h); } diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H index cfc3923256..9edefc0c2c 100644 --- a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H +++ b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H @@ -1,12 +1,14 @@ Info<< "Creating turbulence model\n" << endl; tmp talphaEff; - IOobject turbulenceHeader + IOobject turbulencePropertiesHeader ( "turbulenceProperties", runTime.constant(), mesh, - IOobject::MUST_READ + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false ); IOobject RASHeader @@ -25,7 +27,7 @@ IOobject::MUST_READ ); - if (turbulenceHeader.typeHeaderOk(true)) + if (turbulencePropertiesHeader.typeHeaderOk(true)) { autoPtr turbulence ( diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C index 74fcec0eb3..eb59824dc3 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,7 +63,7 @@ void zeroCells { forAll(cells, i) { - vf[cells[i]] = pTraits::zero; + vf[cells[i]] = Zero; } } @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) { // Momentum predictor - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + turbulence->divDevReff(U) @@ -118,26 +118,25 @@ int main(int argc, char *argv[]) == fvOptions(U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); - solve(UEqn() == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); - volScalarField rAU(1.0/UEqn().A()); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); - UEqn.clear(); - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::interpolate(HbyA) & mesh.Sf() - ); + volScalarField rAU(1.0/UEqn.A()); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); + tUEqn.clear(); + surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA)); adjustPhi(phiHbyA, U, p); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, U, phiHbyA, rAU); + // Non-orthogonal pressure corrector loop while (simple.correctNonOrthogonal()) { @@ -175,13 +174,13 @@ int main(int argc, char *argv[]) //( // fvc::reconstruct // ( - // mesh.magSf()*(fvc::snGrad(Ua) & fvc::interpolate(U)) + // mesh.magSf()*fvc::dotInterpolate(fvc::snGrad(Ua), U) // ) //); zeroCells(adjointTransposeConvection, inletCells); - tmp UaEqn + tmp tUaEqn ( fvm::div(-phi, Ua) - adjointTransposeConvection @@ -190,24 +189,21 @@ int main(int argc, char *argv[]) == fvOptions(Ua) ); + fvVectorMatrix& UaEqn = tUaEqn.ref(); - UaEqn().relax(); + UaEqn.relax(); - fvOptions.constrain(UaEqn()); + fvOptions.constrain(UaEqn); - solve(UaEqn() == -fvc::grad(pa)); + solve(UaEqn == -fvc::grad(pa)); fvOptions.correct(Ua); - volScalarField rAUa(1.0/UaEqn().A()); + volScalarField rAUa(1.0/UaEqn.A()); volVectorField HbyAa("HbyAa", Ua); - HbyAa = rAUa*UaEqn().H(); - UaEqn.clear(); - surfaceScalarField phiHbyAa - ( - "phiHbyAa", - fvc::interpolate(HbyAa) & mesh.Sf() - ); + HbyAa = rAUa*UaEqn.H(); + tUaEqn.clear(); + surfaceScalarField phiHbyAa("phiHbyAa", fvc::flux(HbyAa)); adjustPhi(phiHbyAa, Ua, pa); // Non-orthogonal pressure corrector loop diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H index cb7da73687..93da72123d 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H @@ -80,9 +80,9 @@ mesh.setFluxRequired(pa.name()); singlePhaseTransportModel laminarTransport(U, phi); -autoPtr turbulence +autoPtr turbulence ( - incompressible::New(U, phi, laminarTransport) + incompressible::turbulenceModel::New(U, phi, laminarTransport) ); diff --git a/applications/solvers/incompressible/boundaryFoam/createFields.H b/applications/solvers/incompressible/boundaryFoam/createFields.H index 5ecfebfcb4..dff4b701f5 100644 --- a/applications/solvers/incompressible/boundaryFoam/createFields.H +++ b/applications/solvers/incompressible/boundaryFoam/createFields.H @@ -31,9 +31,9 @@ surfaceScalarField phi singlePhaseTransportModel laminarTransport(U, phi); -autoPtr turbulence +autoPtr turbulence ( - incompressible::New(U, phi, laminarTransport) + incompressible::turbulenceModel::New(U, phi, laminarTransport) ); dimensionedVector Ubar("Ubar", dimVelocity, laminarTransport); @@ -45,5 +45,5 @@ dimensionedVector gradP ( "gradP", dimensionSet(0, 1, -2, 0, 0), - vector::zero + Zero ); diff --git a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H index 513ca54a42..ca337512dc 100644 --- a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H +++ b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H @@ -3,7 +3,7 @@ label faceId(-1); label patchId(-1); label nWallFaces(0); -vector wallNormal(vector::zero); +vector wallNormal(Zero); const fvPatchList& patches = mesh.boundary(); diff --git a/applications/solvers/incompressible/icoFoam/icoFoam.C b/applications/solvers/incompressible/icoFoam/icoFoam.C index a7d0da4a8a..dc3644fb9f 100644 --- a/applications/solvers/incompressible/icoFoam/icoFoam.C +++ b/applications/solvers/incompressible/icoFoam/icoFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,18 +104,19 @@ int main(int argc, char *argv[]) while (piso.correct()) { volScalarField rAU(1.0/UEqn.A()); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, U, phiHbyA, rAU); + // Non-orthogonal pressure corrector loop while (piso.correctNonOrthogonal()) { diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C index e1153a2772..b505329aa3 100644 --- a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C +++ b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,18 +80,19 @@ int main(int argc, char *argv[]) while (piso.correct()) { volScalarField rAU(1.0/UEqn.A()); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, U, phiHbyA, rAU); + // Non-orthogonal pressure corrector loop while (piso.correctNonOrthogonal()) { diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H index 5aa6cef0b1..0d55edd5a0 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/UrelEqn.H @@ -1,5 +1,5 @@ // Relative momentum predictor - tmp UrelEqn + tmp tUrelEqn ( fvm::ddt(Urel) + fvm::div(phi, Urel) @@ -8,11 +8,12 @@ == fvOptions(Urel) ); + fvVectorMatrix& UrelEqn = tUrelEqn.ref(); - UrelEqn().relax(); + UrelEqn.relax(); - fvOptions.constrain(UrelEqn()); + fvOptions.constrain(UrelEqn); - solve(UrelEqn() == -fvc::grad(p)); + solve(UrelEqn == -fvc::grad(p)); fvOptions.correct(Urel); diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H index d305d1a261..3cb0580ba4 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H @@ -1,11 +1,11 @@ -volScalarField rAUrel(1.0/UrelEqn().A()); +volScalarField rAUrel(1.0/UrelEqn.A()); volVectorField HbyA("HbyA", Urel); -HbyA = rAUrel*UrelEqn().H(); +HbyA = rAUrel*UrelEqn.H(); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rAUrel)*fvc::ddtCorr(Urel, phi) ); @@ -15,7 +15,7 @@ tmp rAtUrel(rAUrel); if (pimple.consistent()) { - rAtUrel = 1.0/max(1.0/rAUrel - UrelEqn().H1(), 0.1/rAUrel); + rAtUrel = 1.0/max(1.0/rAUrel - UrelEqn.H1(), 0.1/rAUrel); phiHbyA += fvc::interpolate(rAtUrel() - rAUrel)*fvc::snGrad(p)*mesh.magSf(); HbyA -= (rAUrel - rAtUrel())*fvc::grad(p); @@ -23,9 +23,12 @@ if (pimple.consistent()) if (pimple.nCorrPISO() <= 1) { - UrelEqn.clear(); + tUrelEqn.clear(); } +// Update the pressure BCs to ensure flux consistency +constrainPressure(p, Urel, phiHbyA, rAtUrel()); + // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/incompressible/pimpleFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/UEqn.H index 880c0066e3..1a6b404885 100644 --- a/applications/solvers/incompressible/pimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); -tmp UEqn +tmp tUEqn ( fvm::ddt(U) + fvm::div(phi, U) + MRF.DDt(U) @@ -10,14 +10,15 @@ tmp UEqn == fvOptions(U) ); +fvVectorMatrix& UEqn = tUEqn.ref(); -UEqn().relax(); +UEqn.relax(); -fvOptions.constrain(UEqn()); +fvOptions.constrain(UEqn); if (pimple.momentumPredictor()) { - solve(UEqn() == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); } diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index 18083aa810..c8d02ed281 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -1,11 +1,9 @@ -volScalarField rAU(1.0/UEqn().A()); -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); - +volScalarField rAU(1.0/UEqn.A()); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); @@ -17,7 +15,7 @@ tmp rAtU(rAU); if (pimple.consistent()) { - rAtU = 1.0/max(1.0/rAU - UEqn().H1(), 0.1/rAU); + rAtU = 1.0/max(1.0/rAU - UEqn.H1(), 0.1/rAU); phiHbyA += fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf(); HbyA -= (rAU - rAtU())*fvc::grad(p); @@ -25,20 +23,11 @@ if (pimple.consistent()) if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } -surfaceScalarField rAUf("rAUf", fvc::interpolate(rAtU())); - -// Update the fixedFluxPressure BCs to ensure flux consistency -setSnGrad -( - p.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) -); +// Update the pressure BCs to ensure flux consistency +constrainPressure(p, U, phiHbyA, rAtU(), MRF); // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) @@ -46,7 +35,7 @@ while (pimple.correctNonOrthogonal()) // Pressure corrector fvScalarMatrix pEqn ( - fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) + fvm::laplacian(rAtU(), p) == fvc::div(phiHbyA) ); pEqn.setReference(pRefCell, pRefValue); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H index 5b5fe720ad..a53391a90b 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H @@ -1,11 +1,9 @@ -volScalarField rAU(1.0/UEqn().A()); -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); - +volScalarField rAU(1.0/UEqn.A()); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, Uf) ); @@ -22,7 +20,7 @@ tmp rAtU(rAU); if (pimple.consistent()) { - rAtU = 1.0/max(1.0/rAU - UEqn().H1(), 0.1/rAU); + rAtU = 1.0/max(1.0/rAU - UEqn.H1(), 0.1/rAU); phiHbyA += fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf(); HbyA -= (rAU - rAtU())*fvc::grad(p); @@ -30,27 +28,18 @@ if (pimple.consistent()) if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } -surfaceScalarField rAUf("rAUf", fvc::interpolate(rAtU())); - -// Update the fixedFluxPressure BCs to ensure flux consistency -setSnGrad -( - p.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) -); +// Update the pressure BCs to ensure flux consistency +constrainPressure(p, U, phiHbyA, rAtU(), MRF); // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( - fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) + fvm::laplacian(rAtU(), p) == fvc::div(phiHbyA) ); pEqn.setReference(pRefCell, pRefValue); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C index deb266dd3d..dda9335d45 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Description #include "pimpleControl.H" #include "CorrectPhi.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index 5a56b2b0ef..6b98211430 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,7 +72,6 @@ Description #include "turbulentTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/pisoFoam/pEqn.H b/applications/solvers/incompressible/pisoFoam/pEqn.H index f8c5a45978..05c34376ec 100644 --- a/applications/solvers/incompressible/pisoFoam/pEqn.H +++ b/applications/solvers/incompressible/pisoFoam/pEqn.H @@ -1,10 +1,9 @@ volScalarField rAU(1.0/UEqn.A()); -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); @@ -12,6 +11,9 @@ MRF.makeRelative(phiHbyA); adjustPhi(phiHbyA, U, p); +// Update the pressure BCs to ensure flux consistency +constrainPressure(p, U, phiHbyA, rAU, MRF); + // Non-orthogonal pressure corrector loop while (piso.correctNonOrthogonal()) { diff --git a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C index e7693a073e..6dd8defc26 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C +++ b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rAU)*fvc::ddtCorr(h, hU, phi) - phih0 ); diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H index 75df41d00b..5e1b141030 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H @@ -1,6 +1,6 @@ // Relative momentum predictor - tmp UrelEqn + tmp tUrelEqn ( fvm::div(phi, Urel) + turbulence->divDevReff(Urel) @@ -8,11 +8,15 @@ == fvOptions(Urel) ); + fvVectorMatrix& UrelEqn = tUrelEqn.ref(); - UrelEqn().relax(); + UrelEqn.relax(); - fvOptions.constrain(UrelEqn()); + fvOptions.constrain(UrelEqn); - solve(UrelEqn() == -fvc::grad(p)); + if (simple.momentumPredictor()) + { + solve(UrelEqn == -fvc::grad(p)); - fvOptions.correct(Urel); + fvOptions.correct(Urel); + } diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H index 5658b68ec6..ea565f0949 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H @@ -64,7 +64,7 @@ volVectorField U singlePhaseTransportModel laminarTransport(U, phi); -autoPtr turbulence +autoPtr turbulence ( - incompressible::New(U, phi, laminarTransport) + incompressible::turbulenceModel::New(U, phi, laminarTransport) ); diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H index 50691c0154..e92838716c 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/pEqn.H @@ -1,22 +1,25 @@ { - volScalarField rAUrel(1.0/UrelEqn().A()); + volScalarField rAUrel(1.0/UrelEqn.A()); volVectorField HbyA("HbyA", Urel); - HbyA = rAUrel*UrelEqn().H(); + HbyA = rAUrel*UrelEqn.H(); - surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf()); + surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA)); adjustPhi(phiHbyA, Urel, p); tmp rAtUrel(rAUrel); if (simple.consistent()) { - rAtUrel = 1.0/(1.0/rAUrel - UrelEqn().H1()); + rAtUrel = 1.0/(1.0/rAUrel - UrelEqn.H1()); phiHbyA += fvc::interpolate(rAtUrel() - rAUrel)*fvc::snGrad(p)*mesh.magSf(); HbyA -= (rAUrel - rAtUrel())*fvc::grad(p); } - UrelEqn.clear(); + tUrelEqn.clear(); + + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, Urel, phiHbyA, rAtUrel()); // Non-orthogonal pressure corrector loop while (simple.correctNonOrthogonal()) diff --git a/applications/solvers/incompressible/simpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/UEqn.H index 12b5621636..81e83b55d7 100644 --- a/applications/solvers/incompressible/simpleFoam/UEqn.H +++ b/applications/solvers/incompressible/simpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(U) @@ -10,11 +10,15 @@ == fvOptions(U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); - solve(UEqn() == -fvc::grad(p)); + if (simple.momentumPredictor()) + { + solve(UEqn == -fvc::grad(p)); - fvOptions.correct(U); + fvOptions.correct(U); + } diff --git a/applications/solvers/incompressible/simpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/pEqn.H index 4438a3bff5..7e394e9c10 100644 --- a/applications/solvers/incompressible/simpleFoam/pEqn.H +++ b/applications/solvers/incompressible/simpleFoam/pEqn.H @@ -1,9 +1,7 @@ { - volScalarField rAU(1.0/UEqn().A()); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); - - surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf()); + volScalarField rAU(1.0/UEqn.A()); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); + surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA)); MRF.makeRelative(phiHbyA); adjustPhi(phiHbyA, U, p); @@ -11,13 +9,16 @@ if (simple.consistent()) { - rAtU = 1.0/(1.0/rAU - UEqn().H1()); + rAtU = 1.0/(1.0/rAU - UEqn.H1()); phiHbyA += fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf(); HbyA -= (rAU - rAtU())*fvc::grad(p); } - UEqn.clear(); + tUEqn.clear(); + + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, U, phiHbyA, rAtU(), MRF); // Non-orthogonal pressure corrector loop while (simple.correctNonOrthogonal()) diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H index 035b83ebd1..e2c9917d5a 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(U) @@ -10,8 +10,9 @@ == fvOptions(U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); // Include the porous media resistance and solve the momentum equation // either implicit in the tensorial resistance or transport using by @@ -22,18 +23,18 @@ if (pressureImplicitPorosity) { - tmp tTU = tensor(I)*UEqn().A(); - pZones.addResistance(UEqn(), tTU()); + tmp tTU = tensor(I)*UEqn.A(); + pZones.addResistance(UEqn, tTU.ref()); trTU = inv(tTU()); - trTU().rename("rAU"); + trTU.ref().rename("rAU"); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); volVectorField gradp(fvc::grad(p)); for (int UCorr=0; UCorr tHbyA; if (pressureImplicitPorosity) { - HbyA = trTU()&UEqn().H(); + tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p); } else { - HbyA = trAU()*UEqn().H(); + tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p); } +volVectorField& HbyA = tHbyA.ref(); -UEqn.clear(); -surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf()); +tUEqn.clear(); +surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA)); MRF.makeRelative(phiHbyA); @@ -28,13 +29,15 @@ while (simple.correctNonOrthogonal()) tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phiHbyA)); } - tpEqn().setReference(pRefCell, pRefValue); + fvScalarMatrix pEqn = tpEqn.ref(); - tpEqn().solve(); + pEqn.setReference(pRefCell, pRefValue); + + pEqn.solve(); if (simple.finalNonOrthogonalIter()) { - phi = phiHbyA - tpEqn().flux(); + phi = phiHbyA - pEqn.flux(); } } diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake index 8a47fb1b34..f3f30648d5 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwmake +++ b/applications/solvers/lagrangian/DPMFoam/Allwmake @@ -1,8 +1,11 @@ #!/bin/sh - cd ${0%/*} || exit 1 + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso DPMTurbulenceModels +wmake $targetType DPMTurbulenceModels wmake wmake MPPICFoam diff --git a/applications/solvers/lagrangian/DPMFoam/DPMFoam.C b/applications/solvers/lagrangian/DPMFoam/DPMFoam.C index 22c16b4c80..d539b1bbdb 100644 --- a/applications/solvers/lagrangian/DPMFoam/DPMFoam.C +++ b/applications/solvers/lagrangian/DPMFoam/DPMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,6 @@ Description #include "singlePhaseTransportModel.H" #include "PhaseIncompressibleTurbulenceModel.H" #include "pimpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" #ifdef MPPIC #include "basicKinematicMPPICCloud.H" @@ -106,14 +105,14 @@ int main(int argc, char *argv[]) ( "0", cloudSU.dimensions()/dimVolume, - vector::zero + Zero ), zeroGradientFvPatchVectorField::typeName ); cloudVolSUSu.internalField() = -cloudSU.source()/mesh.V(); cloudVolSUSu.correctBoundaryConditions(); - cloudSU.source() = vector::zero; + cloudSU.source() = Zero; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/lagrangian/DPMFoam/UcEqn.H b/applications/solvers/lagrangian/DPMFoam/UcEqn.H index 0bd4a7146d..d31bead5e1 100644 --- a/applications/solvers/lagrangian/DPMFoam/UcEqn.H +++ b/applications/solvers/lagrangian/DPMFoam/UcEqn.H @@ -14,8 +14,7 @@ surfaceScalarField rAUcf("Dp", fvc::interpolate(rAUc)); surfaceScalarField phicForces ( - (fvc::interpolate(rAUc*cloudVolSUSu/rhoc) & mesh.Sf()) - + rAUcf*(g & mesh.Sf()) + fvc::flux(rAUc*cloudVolSUSu/rhoc) + rAUcf*(g & mesh.Sf()) ); if (pimple.momentumPredictor()) diff --git a/applications/solvers/lagrangian/DPMFoam/createFields.H b/applications/solvers/lagrangian/DPMFoam/createFields.H index 9e34895a73..6c08de4b8e 100644 --- a/applications/solvers/lagrangian/DPMFoam/createFields.H +++ b/applications/solvers/lagrangian/DPMFoam/createFields.H @@ -151,7 +151,7 @@ alphac.correctBoundaryConditions(); surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac)); surfaceScalarField alphaPhic("alphaPhic", alphacf*phic); -autoPtr > +autoPtr> continuousPhaseTurbulence ( PhaseIncompressibleTurbulenceModel::New diff --git a/applications/solvers/lagrangian/DPMFoam/pEqn.H b/applications/solvers/lagrangian/DPMFoam/pEqn.H index 34cce4f166..9e46551122 100644 --- a/applications/solvers/lagrangian/DPMFoam/pEqn.H +++ b/applications/solvers/lagrangian/DPMFoam/pEqn.H @@ -6,21 +6,14 @@ ( "phiHbyA", ( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + alphacf*rAUcf*fvc::ddtCorr(Uc, phic) + phicForces ) ); - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & Uc.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUcf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, Uc, phiHbyA, rAUcf); // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H index a719c83cd7..671e316c54 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 480ce25f7c..4f6eaf3550 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -2,9 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.transonic()) { @@ -13,7 +11,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); @@ -46,13 +44,16 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H b/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H index 1c7d7cb5e2..65b0388e12 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/setRDeltaT.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); const dictionary& pimpleDict = pimple.dict(); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H index b23f00dbf1..93dacc3ba6 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H index 6f8b034581..7b5249d57e 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H @@ -2,9 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); @@ -12,7 +10,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) + phig @@ -20,16 +18,8 @@ surfaceScalarField phiHbyA MRF.makeRelative(fvc::interpolate(rho), phiHbyA); -// Update the fixedFluxPressure BCs to ensure flux consistency -setSnGrad -( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - *rho.boundaryField() - )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) -); +// Update the pressure BCs to ensure flux consistency +constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF); while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C index 8014596ae6..37c0f4235d 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Description #include "SLGThermo.H" #include "fvOptions.H" #include "pimpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index fbcc0a0f65..25bdc12cdf 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index f266fded0a..f6c8ceec21 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -7,21 +7,21 @@ volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); surfaceScalarField phiHbyA ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + fvScalarMatrix pDDtEqn ( fvc::ddt(rho) + psi*correction(fvm::ddt(p)) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H b/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H index d599d491f8..f51eeb49bf 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/setRDeltaT.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); const dictionary& pimpleDict = pimple.dict(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/UEqn.H index 2f5a74d45b..86cf5362f8 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/UEqn.H @@ -1,6 +1,6 @@ MRF.correctBoundaryVelocity(U); - tmp UEqn + tmp tUEqn ( fvm::div(phi, U) + MRF.DDt(rho, U) @@ -10,11 +10,12 @@ + parcels.SU(U) + fvOptions(rho, U) ); + fvVectorMatrix& UEqn = tUEqn.ref(); - UEqn().relax(); + UEqn.relax(); - fvOptions.constrain(UEqn()); + fvOptions.constrain(UEqn); - solve(UEqn() == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H index cd0a45f0f0..20d55a8d52 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/YEqn.H @@ -1,4 +1,4 @@ -tmp > mvConvection +tmp> mvConvection ( fv::convectionScheme::New ( diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/pEqn.H index b5d3e1471a..055eff6f0b 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/pEqn.H @@ -3,26 +3,27 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU(1.0/UEqn().A()); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); - - UEqn.clear(); - + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); + tUEqn.clear(); surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) + fvc::interpolate(rho)*fvc::flux(HbyA) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (simple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(rhorAUf, p) == parcels.Srho() + fvOptions(psi, p, rho.name()) diff --git a/applications/solvers/lagrangian/sprayFoam/UEqn.H b/applications/solvers/lagrangian/sprayFoam/UEqn.H index c26bf1cf65..97a83f7d5b 100644 --- a/applications/solvers/lagrangian/sprayFoam/UEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/UEqn.H @@ -2,7 +2,7 @@ MRF.correctBoundaryVelocity(U); -tmp UEqn +tmp tUEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + MRF.DDt(rho, U) @@ -12,14 +12,15 @@ tmp UEqn + parcels.SU(U) + fvOptions(rho, U) ); +fvVectorMatrix& UEqn = tUEqn.ref(); -UEqn().relax(); +UEqn.relax(); -fvOptions.constrain(UEqn()); +fvOptions.constrain(UEqn); if (pimple.momentumPredictor()) { - solve(UEqn() == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); K = 0.5*magSqr(U); diff --git a/applications/solvers/lagrangian/sprayFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/pEqn.H index ee450daab9..b15fb81e13 100644 --- a/applications/solvers/lagrangian/sprayFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/pEqn.H @@ -3,15 +3,13 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU(1.0/UEqn().A()); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } if (pimple.transonic()) @@ -21,7 +19,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ); @@ -54,13 +52,16 @@ else ( "phiHbyA", ( - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H index c620a892d1..90033814d3 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H @@ -3,15 +3,13 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rAU(1.0/UEqn().A()); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } if (pimple.transonic()) @@ -21,7 +19,7 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) ) ); @@ -54,13 +52,16 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(rho*HbyA) & mesh.Sf()) + fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, rhoUf) ); fvc::makeRelative(phiHbyA, rho, U); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options index 69fd826ce6..5cc555e27f 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options @@ -1,6 +1,6 @@ EXE_INC = \ - -I.. \ -I../sprayDyMFoam \ + -I.. \ -I../../reactingParcelFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H index b07846b6de..51a2da33bd 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H @@ -13,11 +13,9 @@ volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - - phi = (fvc::interpolate(HbyA) & mesh.Sf()) + phi = fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(U, Uf); fvc::makeRelative(phi, U); diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index da8047914c..4c337c4269 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -13,11 +13,9 @@ volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - - phi = (fvc::interpolate(HbyA) & mesh.Sf()) + phi = fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(U, phi); surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p)); diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index 9339e372a3..0e26512420 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso twoPhaseMixtureThermo wclean wclean compressibleInterDyMFoam -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index 835bf8346b..b658bde457 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -1,9 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso twoPhaseMixtureThermo +wmake $targetType twoPhaseMixtureThermo wmake wmake compressibleInterDyMFoam -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index 0f6bf83172..7cbbd26b14 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,7 +50,6 @@ Description #include "turbulentFluidThermoModel.H" #include "pimpleControl.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H index 89089fe616..859fc9cc4e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H @@ -1,14 +1,11 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf) ); @@ -22,15 +19,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); // Make the fluxes relative to the mesh motion fvc::makeRelative(phiHbyA, U); @@ -50,8 +40,8 @@ psi1*fvm::ddt(p_rgh) + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) ); - deleteDemandDrivenData(p_rghEqnComp1().faceFluxCorrectionPtr()); - p_rghEqnComp1().relax(); + deleteDemandDrivenData(p_rghEqnComp1.ref().faceFluxCorrectionPtr()); + p_rghEqnComp1.ref().relax(); p_rghEqnComp2 = fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2) @@ -60,8 +50,8 @@ psi2*fvm::ddt(p_rgh) + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) ); - deleteDemandDrivenData(p_rghEqnComp2().faceFluxCorrectionPtr()); - p_rghEqnComp2().relax(); + deleteDemandDrivenData(p_rghEqnComp2.ref().faceFluxCorrectionPtr()); + p_rghEqnComp2.ref().relax(); } else { diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index bb7548164b..2a113880de 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,6 @@ Description #include "twoPhaseMixtureThermo.H" #include "turbulentFluidThermoModel.H" #include "pimpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 673f1c8271..a4a3fb2e29 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -1,14 +1,11 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); @@ -22,15 +19,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); tmp p_rghEqnComp1; tmp p_rghEqnComp2; @@ -47,8 +37,8 @@ psi1*fvm::ddt(p_rgh) + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) ); - deleteDemandDrivenData(p_rghEqnComp1().faceFluxCorrectionPtr()); - p_rghEqnComp1().relax(); + deleteDemandDrivenData(p_rghEqnComp1.ref().faceFluxCorrectionPtr()); + p_rghEqnComp1.ref().relax(); p_rghEqnComp2 = fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2) @@ -57,8 +47,8 @@ psi2*fvm::ddt(p_rgh) + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) ); - deleteDemandDrivenData(p_rghEqnComp2().faceFluxCorrectionPtr()); - p_rghEqnComp2().relax(); + deleteDemandDrivenData(p_rghEqnComp2.ref().faceFluxCorrectionPtr()); + p_rghEqnComp2.ref().relax(); } else { diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean index 7ccfc0d68f..628a70b516 100755 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean @@ -5,4 +5,4 @@ set -x wclean libso multiphaseMixtureThermo wclean -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake index 04e1ddbb1f..025a2399e8 100755 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake @@ -1,8 +1,12 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso multiphaseMixtureThermo +wmake $targetType multiphaseMixtureThermo wmake -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseInterFoam.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseInterFoam.C index 667941ecc5..bff854c6ea 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseInterFoam.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Description #include "multiphaseMixtureThermo.H" #include "turbulentFluidThermoModel.H" #include "pimpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index 55af594283..14bbbe8708 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,8 +59,6 @@ void Foam::multiphaseMixtureThermo::calcAlphas() alphas_ += level*phase(); level += 1.0; } - - alphas_.correctBoundaryConditions(); } @@ -104,8 +102,7 @@ Foam::multiphaseMixtureThermo::multiphaseMixtureThermo IOobject::AUTO_WRITE ), mesh_, - dimensionedScalar("alphas", dimless, 0.0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar("alphas", dimless, 0.0) ), sigmas_(lookup("sigmas")), @@ -193,7 +190,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::he for (++phasei; phasei != phases_.end(); ++phasei) { - the() += phasei()*phasei().thermo().he(p, T); + the.ref() += phasei()*phasei().thermo().he(p, T); } return the; @@ -216,7 +213,8 @@ Foam::tmp Foam::multiphaseMixtureThermo::he for (++phasei; phasei != phases_.end(); ++phasei) { - the() += scalarField(phasei(), cells)*phasei().thermo().he(p, T, cells); + the.ref() += + scalarField(phasei(), cells)*phasei().thermo().he(p, T, cells); } return the; @@ -239,7 +237,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::he for (++phasei; phasei != phases_.end(); ++phasei) { - the() += + the.ref() += phasei().boundaryField()[patchi]*phasei().thermo().he(p, T, patchi); } @@ -255,7 +253,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::hc() const for (++phasei; phasei != phases_.end(); ++phasei) { - thc() += phasei()*phasei().thermo().hc(); + thc.ref() += phasei()*phasei().thermo().hc(); } return thc; @@ -296,7 +294,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::rho() const for (++phasei; phasei != phases_.end(); ++phasei) { - trho() += phasei()*phasei().thermo().rho(); + trho.ref() += phasei()*phasei().thermo().rho(); } return trho; @@ -317,7 +315,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::rho for (++phasei; phasei != phases_.end(); ++phasei) { - trho() += + trho.ref() += phasei().boundaryField()[patchi]*phasei().thermo().rho(patchi); } @@ -333,7 +331,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cp() const for (++phasei; phasei != phases_.end(); ++phasei) { - tCp() += phasei()*phasei().thermo().Cp(); + tCp.ref() += phasei()*phasei().thermo().Cp(); } return tCp; @@ -356,7 +354,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cp for (++phasei; phasei != phases_.end(); ++phasei) { - tCp() += + tCp.ref() += phasei().boundaryField()[patchi]*phasei().thermo().Cp(p, T, patchi); } @@ -372,7 +370,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cv() const for (++phasei; phasei != phases_.end(); ++phasei) { - tCv() += phasei()*phasei().thermo().Cv(); + tCv.ref() += phasei()*phasei().thermo().Cv(); } return tCv; @@ -395,7 +393,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cv for (++phasei; phasei != phases_.end(); ++phasei) { - tCv() += + tCv.ref() += phasei().boundaryField()[patchi]*phasei().thermo().Cv(p, T, patchi); } @@ -411,7 +409,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::gamma() const for (++phasei; phasei != phases_.end(); ++phasei) { - tgamma() += phasei()*phasei().thermo().gamma(); + tgamma.ref() += phasei()*phasei().thermo().gamma(); } return tgamma; @@ -434,7 +432,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::gamma for (++phasei; phasei != phases_.end(); ++phasei) { - tgamma() += + tgamma.ref() += phasei().boundaryField()[patchi] *phasei().thermo().gamma(p, T, patchi); } @@ -451,7 +449,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cpv() const for (++phasei; phasei != phases_.end(); ++phasei) { - tCpv() += phasei()*phasei().thermo().Cpv(); + tCpv.ref() += phasei()*phasei().thermo().Cpv(); } return tCpv; @@ -474,7 +472,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::Cpv for (++phasei; phasei != phases_.end(); ++phasei) { - tCpv() += + tCpv.ref() += phasei().boundaryField()[patchi] *phasei().thermo().Cpv(p, T, patchi); } @@ -491,7 +489,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::CpByCpv() const for (++phasei; phasei != phases_.end(); ++phasei) { - tCpByCpv() += phasei()*phasei().thermo().CpByCpv(); + tCpByCpv.ref() += phasei()*phasei().thermo().CpByCpv(); } return tCpByCpv; @@ -514,7 +512,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::CpByCpv for (++phasei; phasei != phases_.end(); ++phasei) { - tCpByCpv() += + tCpByCpv.ref() += phasei().boundaryField()[patchi] *phasei().thermo().CpByCpv(p, T, patchi); } @@ -546,7 +544,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::kappa() const for (++phasei; phasei != phases_.end(); ++phasei) { - tkappa() += phasei()*phasei().thermo().kappa(); + tkappa.ref() += phasei()*phasei().thermo().kappa(); } return tkappa; @@ -567,7 +565,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::kappa for (++phasei; phasei != phases_.end(); ++phasei) { - tkappa() += + tkappa.ref() += phasei().boundaryField()[patchi]*phasei().thermo().kappa(patchi); } @@ -586,7 +584,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::kappaEff for (++phasei; phasei != phases_.end(); ++phasei) { - tkappaEff() += phasei()*phasei().thermo().kappaEff(alphat); + tkappaEff.ref() += phasei()*phasei().thermo().kappaEff(alphat); } return tkappaEff; @@ -609,7 +607,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::kappaEff for (++phasei; phasei != phases_.end(); ++phasei) { - tkappaEff() += + tkappaEff.ref() += phasei().boundaryField()[patchi] *phasei().thermo().kappaEff(alphat, patchi); } @@ -629,7 +627,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::alphaEff for (++phasei; phasei != phases_.end(); ++phasei) { - talphaEff() += phasei()*phasei().thermo().alphaEff(alphat); + talphaEff.ref() += phasei()*phasei().thermo().alphaEff(alphat); } return talphaEff; @@ -652,7 +650,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::alphaEff for (++phasei; phasei != phases_.end(); ++phasei) { - talphaEff() += + talphaEff.ref() += phasei().boundaryField()[patchi] *phasei().thermo().alphaEff(alphat, patchi); } @@ -669,7 +667,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::rCv() const for (++phasei; phasei != phases_.end(); ++phasei) { - trCv() += phasei()/phasei().thermo().Cv(); + trCv.ref() += phasei()/phasei().thermo().Cv(); } return trCv; @@ -699,7 +697,7 @@ Foam::multiphaseMixtureThermo::surfaceTensionForce() const ) ); - surfaceScalarField& stf = tstf(); + surfaceScalarField& stf = tstf.ref(); forAllConstIter(PtrDictionary, phases_, phase1) { @@ -925,7 +923,7 @@ Foam::tmp Foam::multiphaseMixtureThermo::K { tmp tnHatfv = nHatfv(alpha1, alpha2); - correctContactAngle(alpha1, alpha2, tnHatfv().boundaryField()); + correctContactAngle(alpha1, alpha2, tnHatfv.ref().boundaryField()); // Simple expression for curvature return -fvc::div(tnHatfv & mesh_.Sf()); @@ -952,7 +950,8 @@ Foam::multiphaseMixtureThermo::nearInterface() const forAllConstIter(PtrDictionary, phases_, phase) { - tnearInt() = max(tnearInt(), pos(phase() - 0.01)*pos(0.99 - phase())); + tnearInt.ref() = + max(tnearInt(), pos(phase() - 0.01)*pos(0.99 - phase())); } return tnearInt; diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/pEqn.H index a8f4bcb9f2..70ac37c1b8 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/pEqn.H @@ -1,14 +1,11 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); @@ -22,15 +19,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); PtrList p_rghEqnComps(mixture.phases().size()); @@ -90,7 +80,7 @@ } else { - p_rghEqnComp() += hmm; + p_rghEqnComp.ref() += hmm; } phasei++; diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwclean b/applications/solvers/multiphase/driftFluxFoam/Allwclean index 4bb3b9406d..dcdca8527f 100755 --- a/applications/solvers/multiphase/driftFluxFoam/Allwclean +++ b/applications/solvers/multiphase/driftFluxFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso mixtureViscosityModels wclean libso relativeVelocityModels wclean -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwmake b/applications/solvers/multiphase/driftFluxFoam/Allwmake index ac51afd1d1..0c8b6bb8f9 100755 --- a/applications/solvers/multiphase/driftFluxFoam/Allwmake +++ b/applications/solvers/multiphase/driftFluxFoam/Allwmake @@ -1,9 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso mixtureViscosityModels -wmake libso relativeVelocityModels +wmake $targetType mixtureViscosityModels +wmake $targetType relativeVelocityModels wmake -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H b/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H index 68f027cd24..3938fde30f 100644 --- a/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H +++ b/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H @@ -34,7 +34,7 @@ ( alpha1, alphaPhi, - talphaPhiCorr0(), + talphaPhiCorr0.ref(), mixture.alphaMax(), 0 ); @@ -73,7 +73,7 @@ ( alpha1, talphaPhiUn(), - talphaPhiCorr(), + talphaPhiCorr.ref(), mixture.alphaMax(), 0 ); diff --git a/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H index b586e77fad..e77f66b880 100644 --- a/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/driftFluxFoam/alphaEqnSubCycle.H @@ -11,10 +11,7 @@ dimensionedScalar("0", phi.dimensions(), 0) ); - surfaceScalarField phir - ( - mesh.Sf() & fvc::interpolate(UdmModel.Udm()) - ); + surfaceScalarField phir(fvc::flux(UdmModel.Udm())); if (nAlphaSubCycles > 1) { diff --git a/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C b/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C index d35c3a262b..4b3e21265e 100644 --- a/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C +++ b/applications/solvers/multiphase/driftFluxFoam/driftFluxFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,6 @@ Description #include "CompressibleTurbulenceModel.H" #include "pimpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "gaussLaplacianScheme.H" #include "uncorrectedSnGrad.H" diff --git a/applications/solvers/multiphase/driftFluxFoam/pEqn.H b/applications/solvers/multiphase/driftFluxFoam/pEqn.H index 73c6ea9877..6797c44ccb 100644 --- a/applications/solvers/multiphase/driftFluxFoam/pEqn.H +++ b/applications/solvers/multiphase/driftFluxFoam/pEqn.H @@ -1,14 +1,11 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); MRF.makeRelative(phiHbyA); @@ -23,15 +20,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C index f8a133b63e..6a7d86eed9 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/general/general.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,7 +50,7 @@ Foam::relativeVelocityModels::general::general a_("a", dimless, dict), a1_("a1", dimless, dict), V0_("V0", dimVelocity, dict), - residualAlpha_(dict.lookup("residualAlpha")) + residualAlpha_("residualAlpha", dimless, dict) {} diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index be4de6b2c0..c8e3bb3721 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,8 +59,7 @@ Foam::relativeVelocityModel::relativeVelocityModel IOobject::AUTO_WRITE ), alphac_.mesh(), - dimensionedVector("Udm", dimVelocity, vector::zero), - mixture.U().boundaryField().types() + dimensionedVector("Udm", dimVelocity, Zero) ) {} diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index 6a24830137..9d6dd2dc18 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -2,7 +2,7 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - tmp > ddtAlpha + tmp> ddtAlpha ( fv::ddtScheme::New ( @@ -15,13 +15,13 @@ scalar ocCoeff = 0; if ( - isType >(ddtAlpha()) - || isType >(ddtAlpha()) + isType>(ddtAlpha()) + || isType>(ddtAlpha()) ) { ocCoeff = 0; } - else if (isType >(ddtAlpha())) + else if (isType>(ddtAlpha())) { if (nAlphaSubCycles > 1) { @@ -32,7 +32,8 @@ } ocCoeff = - refCast >(ddtAlpha()).ocCoeff(); + refCast>(ddtAlpha()) + .ocCoeff(); } else { @@ -104,7 +105,7 @@ if (alphaApplyPrevCorr && talphaPhiCorr0.valid()) { Info<< "Applying the previous iteration compression flux" << endl; - MULES::correct(alpha1, alphaPhi, talphaPhiCorr0(), 1, 0); + MULES::correct(alpha1, alphaPhi, talphaPhiCorr0.ref(), 1, 0); alphaPhi += talphaPhiCorr0(); } @@ -150,7 +151,7 @@ tmp talphaPhiCorr(talphaPhiUn() - alphaPhi); volScalarField alpha10("alpha10", alpha1); - MULES::correct(alpha1, talphaPhiUn(), talphaPhiCorr(), 1, 0); + MULES::correct(alpha1, talphaPhiUn(), talphaPhiCorr.ref(), 1, 0); // Under-relax the correction for all but the 1st corrector if (aCorr == 0) diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index c3e65f24e3..e4891edba5 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -49,8 +49,7 @@ volScalarField rho mesh, IOobject::READ_IF_PRESENT ), - alpha1*rho1 + alpha2*rho2, - alpha1.boundaryField().types() + alpha1*rho1 + alpha2*rho2 ); rho.oldTime(); diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 7f3f677349..340f2c948e 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,6 @@ Description #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H index 8400d24687..2c7df14ae7 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H @@ -1,14 +1,11 @@ { rAU = 1.0/UEqn.A(); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf) ); MRF.makeRelative(phiHbyA); @@ -30,15 +27,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index c6dc2f47e4..1d37044e9d 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,7 +51,6 @@ Description #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H index 59180b8723..4d9f0e7f01 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H @@ -50,8 +50,7 @@ volScalarField rho mesh, IOobject::READ_IF_PRESENT ), - alpha1*rho1 + alpha2*rho2 + alpha3*rho3, - alpha1.boundaryField().types() + alpha1*rho1 + alpha2*rho2 + alpha3*rho3 ); rho.oldTime(); diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C index f6c00e12a4..b5eae6b98c 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,6 @@ License // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // -//- Calculate and return the laminar viscosity void Foam::incompressibleThreePhaseMixture::calcNu() { nuModel1_->correct(); diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C index 201b6bb926..d0bb094699 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,6 @@ Description #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 31982f4c1d..43edce0c5d 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -2,13 +2,12 @@ volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); MRF.makeRelative(phiHbyA); @@ -24,15 +23,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/multiphase/interFoam/setRDeltaT.H b/applications/solvers/multiphase/interFoam/setRDeltaT.H index 01bb8aa411..dd0e6a4da4 100644 --- a/applications/solvers/multiphase/interFoam/setRDeltaT.H +++ b/applications/solvers/multiphase/interFoam/setRDeltaT.H @@ -1,5 +1,5 @@ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); const dictionary& pimpleDict = pimple.dict(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean index 0e33252d5c..bc351e27d8 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso phaseChangeTwoPhaseMixtures wclean wclean interPhaseChangeDyMFoam -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake index 9a2a5c2bab..c25175e5e6 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake @@ -1,9 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso phaseChangeTwoPhaseMixtures +wmake $targetType phaseChangeTwoPhaseMixtures wmake wmake interPhaseChangeDyMFoam -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index 172676b97f..150ccd1f78 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -4,7 +4,7 @@ surfaceScalarField phir("phir", phic*interface.nHatf()); - Pair > vDotAlphal = + Pair> vDotAlphal = mixture->vDotAlphal(); const volScalarField& vDotcAlphal = vDotAlphal[0](); const volScalarField& vDotvAlphal = vDotAlphal[1](); @@ -62,7 +62,7 @@ if (MULESCorr) { - talphaPhiCorr() -= talphaPhi(); + talphaPhiCorr.ref() -= talphaPhi(); volScalarField alpha100("alpha100", alpha10); alpha10 = alpha1; @@ -72,7 +72,7 @@ geometricOneField(), alpha1, talphaPhi(), - talphaPhiCorr(), + talphaPhiCorr.ref(), vDotvmcAlphal, ( divU*(alpha10 - alpha100) @@ -85,12 +85,12 @@ // Under-relax the correction for all but the 1st corrector if (aCorr == 0) { - talphaPhi() += talphaPhiCorr(); + talphaPhi.ref() += talphaPhiCorr(); } else { alpha1 = 0.5*alpha1 + 0.5*alpha10; - talphaPhi() += 0.5*talphaPhiCorr(); + talphaPhi.ref() += 0.5*talphaPhiCorr(); } } else @@ -100,7 +100,7 @@ geometricOneField(), alpha1, phi, - talphaPhiCorr(), + talphaPhiCorr.ref(), vDotvmcAlphal, (divU*alpha1 + vDotcAlphal)(), 1, diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H index dc0491bd03..bb336f16c0 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H @@ -51,8 +51,7 @@ volScalarField rho mesh, IOobject::READ_IF_PRESENT ), - alpha1*rho1 + alpha2*rho2, - alpha1.boundaryField().types() + alpha1*rho1 + alpha2*rho2 ); rho.oldTime(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C index a3b3e64cbc..1fcffeb2aa 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,6 @@ Description #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H index b759081eea..7501f58062 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H @@ -1,14 +1,11 @@ { rAU = 1.0/UEqn.A(); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf) ); @@ -29,17 +26,10 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); - Pair > vDotP = mixture->vDotP(); + Pair> vDotP = mixture->vDotP(); const volScalarField& vDotcP = vDotP[0](); const volScalarField& vDotvP = vDotP[1](); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index 525efbc3ab..088d9890f4 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,7 +51,6 @@ Description #include "turbulentTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 4a174eb980..0b0a31c669 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -1,14 +1,11 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); @@ -23,17 +20,10 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); - Pair > vDotP = mixture->vDotP(); + Pair> vDotP = mixture->vDotP(); const volScalarField& vDotcP = vDotP[0](); const volScalarField& vDotvP = vDotP[1](); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C index f7cc2eae21..a4663ba488 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,13 +63,13 @@ Foam::phaseChangeTwoPhaseMixtures::Kunz::Kunz // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const { const volScalarField& p = alpha1_.db().lookupObject("p"); volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - return Pair > + return Pair> ( mcCoeff_*sqr(limitedAlpha1) *max(p - pSat(), p0_)/max(p - pSat(), 0.01*pSat()), @@ -78,13 +78,13 @@ Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const ); } -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject("p"); volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - return Pair > + return Pair> ( mcCoeff_*sqr(limitedAlpha1)*(1.0 - limitedAlpha1) *pos(p - pSat())/max(p - pSat(), 0.01*pSat()), diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H index 393357a7ff..0b1c155f45 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,11 +105,11 @@ public: //- Return the mass condensation and vaporisation rates as a // coefficient to multiply (1 - alphal) for the condensation rate // and a coefficient to multiply alphal for the vaporisation rate - virtual Pair > mDotAlphal() const; + virtual Pair> mDotAlphal() const; //- Return the mass condensation and vaporisation rates as coefficients // to multiply (p - pSat) - virtual Pair > mDotP() const; + virtual Pair> mDotP() const; //- Correct the Kunz phaseChange model virtual void correct(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C index 72fdb7245e..cfe6b1b008 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,25 +63,25 @@ Foam::phaseChangeTwoPhaseMixtures::Merkle::Merkle // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotAlphal() const { const volScalarField& p = alpha1_.db().lookupObject("p"); - return Pair > + return Pair> ( mcCoeff_*max(p - pSat(), p0_), mvCoeff_*min(p - pSat(), p0_) ); } -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject("p"); volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - return Pair > + return Pair> ( mcCoeff_*(1.0 - limitedAlpha1)*pos(p - pSat()), (-mvCoeff_)*limitedAlpha1*neg(p - pSat()) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H index 0152b2d18a..1de1263e5c 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,11 +99,11 @@ public: //- Return the mass condensation and vaporisation rates as a // coefficient to multiply (1 - alphal) for the condensation rate // and a coefficient to multiply alphal for the vaporisation rate - virtual Pair > mDotAlphal() const; + virtual Pair> mDotAlphal() const; //- Return the mass condensation and vaporisation rates as coefficients // to multiply (p - pSat) - virtual Pair > mDotP() const; + virtual Pair> mDotP() const; //- Correct the Merkle phaseChange model virtual void correct(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 189c7bae06..3be86e0f51 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,7 +108,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::pCoeff } -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const { const volScalarField& p = alpha1_.db().lookupObject("p"); @@ -116,7 +116,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - return Pair > + return Pair> ( Cc_*limitedAlpha1*pCoeff*max(p - pSat(), p0_), @@ -125,7 +125,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const } -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject("p"); @@ -134,7 +134,7 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); volScalarField apCoeff(limitedAlpha1*pCoeff); - return Pair > + return Pair> ( Cc_*(1.0 - limitedAlpha1)*pos(p - pSat())*apCoeff, diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H index 67eb0dd5ba..c3b8f86a46 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,11 +112,11 @@ public: //- Return the mass condensation and vaporisation rates as a // coefficient to multiply (1 - alphal) for the condensation rate // and a coefficient to multiply alphal for the vaporisation rate - virtual Pair > mDotAlphal() const; + virtual Pair> mDotAlphal() const; //- Return the mass condensation and vaporisation rates as coefficients // to multiply (p - pSat) - virtual Pair > mDotP() const; + virtual Pair> mDotP() const; //- Correct the SchnerrSauer phaseChange model virtual void correct(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index 5575253888..b9a5e69bf8 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,26 +50,26 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixture::vDotAlphal() const { volScalarField alphalCoeff(1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2())); - Pair > mDotAlphal = this->mDotAlphal(); + Pair> mDotAlphal = this->mDotAlphal(); - return Pair > + return Pair> ( alphalCoeff*mDotAlphal[0], alphalCoeff*mDotAlphal[1] ); } -Foam::Pair > +Foam::Pair> Foam::phaseChangeTwoPhaseMixture::vDotP() const { dimensionedScalar pCoeff(1.0/rho1() - 1.0/rho2()); - Pair > mDotP = this->mDotP(); + Pair> mDotP = this->mDotP(); - return Pair >(pCoeff*mDotP[0], pCoeff*mDotP[1]); + return Pair>(pCoeff*mDotP[0], pCoeff*mDotP[1]); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H index 227768ac8d..dedc97a9e9 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,20 +134,20 @@ public: //- Return the mass condensation and vaporisation rates as a // coefficient to multiply (1 - alphal) for the condensation rate // and a coefficient to multiply alphal for the vaporisation rate - virtual Pair > mDotAlphal() const = 0; + virtual Pair> mDotAlphal() const = 0; //- Return the mass condensation and vaporisation rates as coefficients // to multiply (p - pSat) - virtual Pair > mDotP() const = 0; + virtual Pair> mDotP() const = 0; //- Return the volumetric condensation and vaporisation rates as a // coefficient to multiply (1 - alphal) for the condensation rate // and a coefficient to multiply alphal for the vaporisation rate - Pair > vDotAlphal() const; + Pair> vDotAlphal() const; //- Return the volumetric condensation and vaporisation rates as // coefficients to multiply (p - pSat) - Pair > vDotP() const; + Pair> vDotP() const; //- Correct the phaseChange model virtual void correct() = 0; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean index a75382c13c..6d174c19d9 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso multiphaseSystem wclean libso interfacialModels wclean -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake index 84a99b7200..6f95f807ac 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake @@ -1,10 +1,14 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x wmakeLnInclude interfacialModels -wmake libso multiphaseSystem -wmake libso interfacialModels +wmake $targetType multiphaseSystem +wmake $targetType interfacialModels wmake -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/createFields.H b/applications/solvers/multiphase/multiphaseEulerFoam/createFields.H index 0747583599..212160b83e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/createFields.H @@ -23,7 +23,7 @@ volVectorField U IOobject::AUTO_WRITE ), mesh, - dimensionedVector("U", dimVelocity, vector::zero) + dimensionedVector("U", dimVelocity, Zero) ); surfaceScalarField phi diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam.C index 2ec41b40f8..84f2e159f9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,6 @@ Description #include "pimpleControl.H" #include "IOMRFZoneList.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index d0cd5c9b18..3f514904ec 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,8 +54,6 @@ void Foam::multiphaseSystem::calcAlphas() alphas_ += level*iter(); level += 1.0; } - - alphas_.correctBoundaryConditions(); } @@ -374,7 +372,7 @@ Foam::tmp Foam::multiphaseSystem::K { tmp tnHatfv = nHatfv(phase1, phase2); - correctContactAngle(phase1, phase2, tnHatfv().boundaryField()); + correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryField()); // Simple expression for curvature return -fvc::div(tnHatfv & mesh_.Sf()); @@ -417,8 +415,7 @@ Foam::multiphaseSystem::multiphaseSystem IOobject::AUTO_WRITE ), mesh_, - dimensionedScalar("alphas", dimless, 0.0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar("alphas", dimless, 0.0) ), sigmas_(lookup("sigmas")), @@ -496,10 +493,11 @@ Foam::tmp Foam::multiphaseSystem::rho() const PtrDictionary::const_iterator iter = phases_.begin(); tmp trho = iter()*iter().rho(); + volScalarField& rho = trho.ref(); for (++iter; iter != phases_.end(); ++iter) { - trho() += iter()*iter().rho(); + rho += iter()*iter().rho(); } return trho; @@ -512,10 +510,11 @@ Foam::multiphaseSystem::rho(const label patchi) const PtrDictionary::const_iterator iter = phases_.begin(); tmp trho = iter().boundaryField()[patchi]*iter().rho().value(); + scalarField& rho = trho.ref(); for (++iter; iter != phases_.end(); ++iter) { - trho() += iter().boundaryField()[patchi]*iter().rho().value(); + rho += iter().boundaryField()[patchi]*iter().rho().value(); } return trho; @@ -527,10 +526,11 @@ Foam::tmp Foam::multiphaseSystem::nu() const PtrDictionary::const_iterator iter = phases_.begin(); tmp tmu = iter()*(iter().rho()*iter().nu()); + volScalarField& mu = tmu.ref(); for (++iter; iter != phases_.end(); ++iter) { - tmu() += iter()*(iter().rho()*iter().nu()); + mu += iter()*(iter().rho()*iter().nu()); } return tmu/rho(); @@ -545,10 +545,11 @@ Foam::multiphaseSystem::nu(const label patchi) const tmp tmu = iter().boundaryField()[patchi] *(iter().rho().value()*iter().nu().value()); + scalarField& mu = tmu.ref(); for (++iter; iter != phases_.end(); ++iter) { - tmu() += + mu += iter().boundaryField()[patchi] *(iter().rho().value()*iter().nu().value()); } @@ -595,7 +596,7 @@ Foam::tmp Foam::multiphaseSystem::Cvm if (Cvm != Cvms_.end()) { - tCvm() += Cvm()*phase2.rho()*phase2; + tCvm.ref() += Cvm()*phase2.rho()*phase2; } else { @@ -603,7 +604,7 @@ Foam::tmp Foam::multiphaseSystem::Cvm if (Cvm != Cvms_.end()) { - tCvm() += Cvm()*phase.rho()*phase2; + tCvm.ref() += Cvm()*phase.rho()*phase2; } } } @@ -633,7 +634,7 @@ Foam::tmp Foam::multiphaseSystem::Svm ( "Svm", dimensionSet(1, -2, -2, 0, 0), - vector::zero + Zero ) ) ); @@ -651,7 +652,7 @@ Foam::tmp Foam::multiphaseSystem::Svm if (Cvm != Cvms_.end()) { - tSvm() += Cvm()*phase2.rho()*phase2*phase2.DDtU(); + tSvm.ref() += Cvm()*phase2.rho()*phase2*phase2.DDtU(); } else { @@ -659,7 +660,7 @@ Foam::tmp Foam::multiphaseSystem::Svm if (Cvm != Cvms_.end()) { - tSvm() += Cvm()*phase.rho()*phase2*phase2.DDtU(); + tSvm.ref() += Cvm()*phase.rho()*phase2*phase2.DDtU(); } } } @@ -676,7 +677,7 @@ Foam::tmp Foam::multiphaseSystem::Svm ) ) { - tSvm().boundaryField()[patchi] = vector::zero; + tSvm.ref().boundaryField()[patchi] = Zero; } } @@ -775,7 +776,7 @@ Foam::tmp Foam::multiphaseSystem::dragCoeff || &phase == &dmIter()->phase2() ) { - tdragCoeff() += *dcIter(); + tdragCoeff.ref() += *dcIter(); } } @@ -821,7 +822,7 @@ Foam::tmp Foam::multiphaseSystem::surfaceTension if (sigma != sigmas_.end()) { - tSurfaceTension() += + tSurfaceTension.ref() += dimensionedScalar("sigma", dimSigma_, sigma()) *fvc::interpolate(K(phase1, phase2))* ( @@ -856,7 +857,7 @@ Foam::multiphaseSystem::nearInterface() const forAllConstIter(PtrDictionary, phases_, iter) { - tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter())); + tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter())); } return tnearInt; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C index 10dd3e0a56..40269012f6 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,6 +29,7 @@ License #include "slipFvPatchFields.H" #include "partialSlipFvPatchFields.H" #include "surfaceInterpolate.H" +#include "fvcFlux.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -98,7 +99,7 @@ Foam::phaseModel::phaseModel mesh ), mesh, - dimensionedVector("0", dimVelocity/dimTime, vector::zero) + dimensionedVector("0", dimVelocity/dimTime, Zero) ), alphaPhi_ ( @@ -177,7 +178,7 @@ Foam::phaseModel::phaseModel IOobject::NO_READ, IOobject::AUTO_WRITE ), - fvc::interpolate(U_) & mesh.Sf(), + fvc::flux(U_), phiTypes ) ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index d2616fc556..bbcc36f4e7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -97,7 +97,7 @@ phiHbyAs[phasei] = ( - (fvc::interpolate(HbyAs[phasei]) & mesh.Sf()) + fvc::flux(HbyAs[phasei]) + rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi()) ); MRF.makeRelative(phiHbyAs[phasei]); @@ -264,7 +264,7 @@ mSfGradp = pEqnIncomp.flux()/rAUf; - U = dimensionedVector("U", dimVelocity, vector::zero); + U = dimensionedVector("U", dimVelocity, Zero); phasei = 0; forAllIter(PtrDictionary, fluid.phases(), iter) diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean index 02819df96f..75d8939d31 100755 --- a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean +++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso multiphaseMixture wclean wclean multiphaseInterDyMFoam -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake index 745347676b..4d2775a8b8 100755 --- a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake @@ -1,9 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso multiphaseMixture +wmake $targetType multiphaseMixture wmake wmake multiphaseInterDyMFoam -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterDyMFoam/multiphaseInterDyMFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterDyMFoam/multiphaseInterDyMFoam.C index a4413f6295..73d3672c12 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterDyMFoam/multiphaseInterDyMFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterDyMFoam/multiphaseInterDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Description #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C index 130c9f1cb6..f2f229ec9d 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,6 @@ Description #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 1bbd3177af..ea08ba2986 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,8 +52,6 @@ void Foam::multiphaseMixture::calcAlphas() alphas_ += level*iter(); level += 1.0; } - - alphas_.correctBoundaryConditions(); } @@ -108,8 +106,7 @@ Foam::multiphaseMixture::multiphaseMixture IOobject::AUTO_WRITE ), mesh_, - dimensionedScalar("alphas", dimless, 0.0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar("alphas", dimless, 0.0) ), nu_ @@ -144,10 +141,11 @@ Foam::multiphaseMixture::rho() const PtrDictionary::const_iterator iter = phases_.begin(); tmp trho = iter()*iter().rho(); + volScalarField& rho = trho.ref(); for (++iter; iter != phases_.end(); ++iter) { - trho() += iter()*iter().rho(); + rho += iter()*iter().rho(); } return trho; @@ -160,10 +158,11 @@ Foam::multiphaseMixture::rho(const label patchi) const PtrDictionary::const_iterator iter = phases_.begin(); tmp trho = iter().boundaryField()[patchi]*iter().rho().value(); + scalarField& rho = trho.ref(); for (++iter; iter != phases_.end(); ++iter) { - trho() += iter().boundaryField()[patchi]*iter().rho().value(); + rho += iter().boundaryField()[patchi]*iter().rho().value(); } return trho; @@ -176,10 +175,11 @@ Foam::multiphaseMixture::mu() const PtrDictionary::const_iterator iter = phases_.begin(); tmp tmu = iter()*iter().rho()*iter().nu(); + volScalarField& mu = tmu.ref(); for (++iter; iter != phases_.end(); ++iter) { - tmu() += iter()*iter().rho()*iter().nu(); + mu += iter()*iter().rho()*iter().nu(); } return tmu; @@ -195,10 +195,11 @@ Foam::multiphaseMixture::mu(const label patchi) const iter().boundaryField()[patchi] *iter().rho().value() *iter().nu(patchi); + scalarField& mu = tmu.ref(); for (++iter; iter != phases_.end(); ++iter) { - tmu() += + mu += iter().boundaryField()[patchi] *iter().rho().value() *iter().nu(patchi); @@ -215,10 +216,11 @@ Foam::multiphaseMixture::muf() const tmp tmuf = fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); + surfaceScalarField& muf = tmuf.ref(); for (++iter; iter != phases_.end(); ++iter) { - tmuf() += + muf += fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); } @@ -270,7 +272,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const ) ); - surfaceScalarField& stf = tstf(); + surfaceScalarField& stf = tstf.ref(); forAllConstIter(PtrDictionary, phases_, iter1) { @@ -521,7 +523,7 @@ Foam::tmp Foam::multiphaseMixture::K { tmp tnHatfv = nHatfv(alpha1, alpha2); - correctContactAngle(alpha1, alpha2, tnHatfv().boundaryField()); + correctContactAngle(alpha1, alpha2, tnHatfv.ref().boundaryField()); // Simple expression for curvature return -fvc::div(tnHatfv & mesh_.Sf()); @@ -548,7 +550,7 @@ Foam::multiphaseMixture::nearInterface() const forAllConstIter(PtrDictionary, phases_, iter) { - tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter())); + tnearInt.ref() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter())); } return tnearInt; diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/UEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/UEqn.H index 794c0aca52..421e45ae7d 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/UEqn.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/UEqn.H @@ -1,6 +1,6 @@ MRF.correctBoundaryVelocity(U); -tmp UEqn +tmp tUEqn ( fvm::ddt(U) + fvm::div(phi, U) + MRF.DDt(U) @@ -8,14 +8,15 @@ tmp UEqn == fvOptions(U) ); +fvVectorMatrix& UEqn = tUEqn.ref(); -UEqn().relax(); +UEqn.relax(); -fvOptions.constrain(UEqn()); +fvOptions.constrain(UEqn); if (pimple.momentumPredictor()) { - solve(UEqn() == -fvc::grad(p_gh)); + solve(UEqn == -fvc::grad(p_gh)); fvOptions.correct(U); } diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/createFields.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/createFields.H index 40ba336dad..23845a4f75 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/createFields.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/createFields.H @@ -49,7 +49,7 @@ volVectorField zeta IOobject::AUTO_WRITE ), mesh, - dimensionedVector("zero", dimLength, vector::zero) + dimensionedVector("zero", dimLength, Zero) ); Info<< "Creating field p_gh\n" << endl; diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H index 6a65b215b2..76a44bd134 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H @@ -1,33 +1,24 @@ -volScalarField rAU(1.0/UEqn().A()); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_gh)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rAUf*fvc::ddtCorr(U, phi) ); MRF.makeRelative(phiHbyA); adjustPhi(phiHbyA, U, p_gh); -// Update the fixedFluxPressure BCs to ensure flux consistency -setSnGrad -( - p_gh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) -); +// Update the pressure BCs to ensure flux consistency +constrainPressure(p_gh, U, phiHbyA, rAUf); // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H index 01f548ad16..dac95a1974 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H @@ -1,19 +1,17 @@ { - rAU = 1.0/UEqn().A(); + rAU = 1.0/UEqn.A(); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn().H(); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_gh)); if (pimple.nCorrPISO() <= 1) { - UEqn.clear(); + tUEqn.clear(); } surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + rAUf*fvc::ddtCorr(U, Uf) ); @@ -26,15 +24,8 @@ fvc::makeAbsolute(phiHbyA, U); } - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_gh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_gh, U, phiHbyA, rAUf); // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C index 7687ba6aab..9191bb5bf1 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/potentialFreeSurfaceDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,6 @@ Description #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C index 0bbb2c1807..90113fe526 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Description #include "turbulentTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/Allwclean index 618570ccbb..5474c3349a 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwclean @@ -8,4 +8,4 @@ wclean libso interfacialCompositionModels reactingTwoPhaseEulerFoam/Allwclean reactingMultiphaseEulerFoam/Allwclean -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake index 91c6cd9491..0757f76b3f 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake @@ -1,13 +1,17 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x wmakeLnInclude interfacialModels wmakeLnInclude interfacialCompositionModels -wmake libso phaseSystems -wmake libso interfacialModels -wmake libso interfacialCompositionModels -reactingTwoPhaseEulerFoam/Allwmake -reactingMultiphaseEulerFoam/Allwmake +wmake $targetType phaseSystems +wmake $targetType interfacialModels +wmake $targetType interfacialCompositionModels +reactingTwoPhaseEulerFoam/Allwmake $* +reactingMultiphaseEulerFoam/Allwmake $* -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H index 8d9c6a73fa..60303766fc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -119,7 +119,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "Henry.C" + #include "Henry.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C index 5fd646c5ce..ff5d3e5a6e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -153,7 +153,7 @@ Foam::InterfaceCompositionModel::D ) ); - volScalarField& D(tmpD()); + volScalarField& D(tmpD.ref()); forAll(p, cellI) { @@ -207,7 +207,7 @@ Foam::InterfaceCompositionModel::L ) ); - volScalarField& L(tmpL()); + volScalarField& L(tmpL.ref()); forAll(p, cellI) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H index 4c2c4ad3de..6aeea6e097 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,8 +45,8 @@ namespace Foam class phaseModel; class phasePair; -template class pureMixture; -template class multiComponentMixture; +template class pureMixture; +template class multiComponentMixture; /*---------------------------------------------------------------------------*\ Class InterfaceCompositionModel Declaration @@ -150,10 +150,10 @@ public: // Instantiation for multi-component-multi-component pairs #define makeInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\ \ - typedef Thermo > > \ + typedef Thermo>> \ Type##Thermo##Comp##Mix##Phys; \ \ - typedef OtherThermo > \ + typedef OtherThermo> \ Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \ \ addInterfaceCompositionToRunTimeSelectionTable \ @@ -166,10 +166,10 @@ public: // Instantiation for multi-component-single-component pairs #define makeSpecieInterfaceCompositionType(Type, Thermo, Comp, Mix, Phys, OtherThermo, OtherComp, OtherMix, OtherPhys)\ \ - typedef Thermo > > \ + typedef Thermo>> \ Type##Thermo##Comp##Mix##Phys; \ \ - typedef OtherThermo > > \ + typedef OtherThermo>> \ Type##Other##OtherThermo##OtherComp##OtherMix##OtherPhys; \ \ addInterfaceCompositionToRunTimeSelectionTable \ @@ -206,7 +206,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "InterfaceCompositionModel.C" + #include "InterfaceCompositionModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H index f0197e77f7..601806164a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -157,7 +157,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "NonRandomTwoLiquid.C" + #include "NonRandomTwoLiquid.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C index e8f16ee9ae..0cc976c042 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -95,7 +95,7 @@ void Foam::interfaceCompositionModels::Raoult::update forAllIter ( - HashTable >, + HashTable>, speciesModels_, iter ) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H index 103c8d048c..2844539222 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,7 +69,7 @@ private: volScalarField YNonVapourPrime_; //- Species' individual composition models - HashTable > speciesModels_; + HashTable> speciesModels_; public: @@ -120,7 +120,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "Raoult.C" + #include "Raoult.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H index 758bd3a0ad..a585447a1e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,7 +127,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "Saturated.C" + #include "Saturated.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C index 90f1c989c5..b5b0629df1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C @@ -95,7 +95,9 @@ Foam::saturationModels::Antoine::Tsat const volScalarField& p ) const { - return B_/(log(p) - A_) - C_; + return + B_/(log(p*dimensionedScalar("one", dimless/dimPressure, 1)) - A_) + - C_; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C index 886fefe8e8..a2fbcd0bbc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,7 +111,7 @@ Foam::saturationModels::polynomial::Tsat ) ); - volScalarField& Tsat = tTsat(); + volScalarField& Tsat = tTsat.ref(); forAll(Tsat,celli) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files index 1293886cde..aff39a6ded 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files @@ -10,6 +10,7 @@ dragModels/SchillerNaumann/SchillerNaumann.C dragModels/SyamlalOBrien/SyamlalOBrien.C dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C +dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C dragModels/WenYu/WenYu.C dragModels/IshiiZuber/IshiiZuber.C diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C new file mode 100644 index 0000000000..6e3db4231f --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "TomiyamaKataokaZunSakaguchi.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(TomiyamaKataokaZunSakaguchi, 0); + addToRunTimeSelectionTable + ( + dragModel, + TomiyamaKataokaZunSakaguchi, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::TomiyamaKataokaZunSakaguchi::TomiyamaKataokaZunSakaguchi +( + const dictionary& dict, + const phasePair& pair, + const bool registerObject +) +: + dragModel(dict, pair, registerObject), + residualRe_("residualRe", dimless, dict), + residualEo_("residualEo", dimless, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::TomiyamaKataokaZunSakaguchi::~TomiyamaKataokaZunSakaguchi() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::dragModels::TomiyamaKataokaZunSakaguchi::CdRe() const +{ + volScalarField Re(pair_.Re()); + volScalarField Eo(max(pair_.Eo(), residualEo_)); + + return + max + ( + 24.0*(1.0 + 0.15*pow(Re, 0.687))/max(Re, residualRe_), + 8.0*Eo/(3.0*(Eo + 4.0)) + ) + *max(pair_.Re(), residualRe_); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H new file mode 100644 index 0000000000..fb0ba6768f --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::dragModels::TomiyamaKataokaZunSakaguchi + +Description + Drag model for gas-liquid system of Tomiyama et al. + + Reference: + \verbatim + "Drag coefficients of single bubbles under normal and microgravity + conditions" + Tomiyama, A., Kataoka, I., Zun, I., Sakaguchi, T. + JSME International Series B, Fluids and Thermal Engineering, + Vol. 41, 1998, pp. 472-479 + \endverbatim + +SourceFiles + TomiyamaKataokaZunSakaguchi.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TomiyamaKataokaZunSakaguchi_H +#define TomiyamaKataokaZunSakaguchi_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class TomiyamaKataokaZunSakaguchi Declaration +\*---------------------------------------------------------------------------*/ + +class TomiyamaKataokaZunSakaguchi +: + public dragModel +{ + // Private data + + //- Residual Reynolds Number + const dimensionedScalar residualRe_; + + //- Residual Eotvos number + const dimensionedScalar residualEo_; + + +public: + + //- Runtime type information + TypeName("TomiyamaKataokaZunSakaguchi"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + TomiyamaKataokaZunSakaguchi + ( + const dictionary& dict, + const phasePair& pair, + const bool registerObject + ); + + + //- Destructor + virtual ~TomiyamaKataokaZunSakaguchi(); + + + // Member Functions + + //- Drag coefficient + virtual tmp CdRe() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C index 00ca3d49ee..ed45643189 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "phasePair.H" #include "fvcGrad.H" #include "surfaceInterpolate.H" +#include "zeroGradientFvPatchFields.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C index 79e52a2856..7c0bf86c94 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "liftModel.H" #include "phasePair.H" #include "fvcCurl.H" +#include "fvcFlux.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -78,11 +79,7 @@ Foam::tmp Foam::liftModel::F() const Foam::tmp Foam::liftModel::Ff() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return - fvc::interpolate(pair_.dispersed()) - *(fvc::interpolate(Fi()) & mesh.Sf()); + return fvc::interpolate(pair_.dispersed())*fvc::flux(Fi()); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C index d4e13d5c7f..f8480dc69b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/liftModels/noLift/noLift.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -101,7 +101,7 @@ Foam::tmp Foam::liftModels::noLift::F() const false ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C index 5845e3569a..2a65c1e1c6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,7 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::F() const mesh ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C index 0b2c7b5012..80cdae42c7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,7 +72,8 @@ Foam::tmp Foam::wallLubricationModels::Antal::Fi() const const volVectorField& n(nWall()); - return + return zeroGradWalls + ( max ( dimensionedScalar("zero", dimless/dimLength, 0), @@ -80,7 +81,8 @@ Foam::tmp Foam::wallLubricationModels::Antal::Fi() const ) *pair_.continuous().rho() *magSqr(Ur - (Ur & n)*n) - *n; + *n + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C index 0b9065a1a9..6fc1940165 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,7 +77,8 @@ Foam::tmp Foam::wallLubricationModels::Frank::Fi() const volScalarField Eo(pair_.Eo()); volScalarField yTilde(y/(Cwc_*pair_.dispersed().d())); - return + return zeroGradWalls + ( ( pos(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179) + pos(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187) @@ -90,7 +91,8 @@ Foam::tmp Foam::wallLubricationModels::Frank::Fi() const ) *pair_.continuous().rho() *magSqr(Ur - (Ur & n)*n) - *n; + *n + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C index 9209c5108c..f6a1492900 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,7 +75,8 @@ Foam::wallLubricationModels::TomiyamaWallLubrication::Fi() const volScalarField Eo(pair_.Eo()); - return + return zeroGradWalls + ( ( pos(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179) + pos(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187) @@ -89,7 +90,8 @@ Foam::wallLubricationModels::TomiyamaWallLubrication::Fi() const ) *pair_.continuous().rho() *magSqr(Ur - (Ur & n)*n) - *n; + *n + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C index 8de7e30260..b35bd0ef8f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ Foam::wallLubricationModels::noWallLubrication::Fi() const false ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } @@ -108,7 +108,7 @@ Foam::wallLubricationModels::noWallLubrication::F() const false ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C index 2f3cb1aaa0..a2a95cce05 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,9 @@ License #include "wallLubricationModel.H" #include "phasePair.H" +#include "fvcFlux.H" #include "surfaceInterpolate.H" +#include "wallFvPatch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -38,6 +40,29 @@ namespace Foam const Foam::dimensionSet Foam::wallLubricationModel::dimF(1, -2, -2, 0, 0); +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::tmp Foam::wallLubricationModel::zeroGradWalls +( + tmp tFi +) const +{ + volVectorField& Fi = tFi.ref(); + const fvPatchList& patches = Fi.mesh().boundary(); + + forAll(patches, patchi) + { + if (isA(patches[patchi])) + { + fvPatchVectorField& Fiw = Fi.boundaryField()[patchi]; + Fiw = Fiw.patchInternalField(); + } + } + + return tFi; +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::wallLubricationModel::wallLubricationModel @@ -67,11 +92,7 @@ Foam::tmp Foam::wallLubricationModel::F() const Foam::tmp Foam::wallLubricationModel::Ff() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return - fvc::interpolate(pair_.dispersed()) - *(fvc::interpolate(Fi()) & mesh.Sf()); + return fvc::interpolate(pair_.dispersed())*fvc::flux(Fi()); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H index b55415aeb6..53e8a916b6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,6 +63,12 @@ protected: const phasePair& pair_; + // Protected member functions + + //- Zero-gradient wall-lubrication force at walls + tmp zeroGradWalls(tmp) const; + + public: //- Runtime type information diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C index 36e31630a4..abff13475e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,18 +36,18 @@ void Foam::BlendedInterfacialModel::correctFixedFluxBCs GeometricField& field ) const { - forAll(phase1_.phi()->boundaryField(), patchI) + forAll(phase1_.phi()().boundaryField(), patchI) { if ( isA ( - phase1_.phi()->boundaryField()[patchI] + phase1_.phi()().boundaryField()[patchI] ) ) { field.boundaryField()[patchI] - = pTraits::zero; + = Zero; } } } @@ -199,15 +199,15 @@ Foam::BlendedInterfacialModel::K() const if (model_.valid()) { - x() += model_->K()*(scalar(1) - f1() - f2()); + x.ref() += model_->K()*(scalar(1) - f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->K()*f1; + x.ref() += model1In2_->K()*f1; } if (model2In1_.valid()) { - x() += model2In1_->K()*f2; + x.ref() += model2In1_->K()*f2; } if @@ -216,7 +216,7 @@ Foam::BlendedInterfacialModel::K() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -259,15 +259,15 @@ Foam::BlendedInterfacialModel::K(const scalar residualAlpha) const if (model_.valid()) { - x() += model_->K(residualAlpha)*(scalar(1) - f1() - f2()); + x.ref() += model_->K(residualAlpha)*(scalar(1) - f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->K(residualAlpha)*f1; + x.ref() += model1In2_->K(residualAlpha)*f1; } if (model2In1_.valid()) { - x() += model2In1_->K(residualAlpha)*f2; + x.ref() += model2In1_->K(residualAlpha)*f2; } if @@ -276,7 +276,7 @@ Foam::BlendedInterfacialModel::K(const scalar residualAlpha) const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -325,17 +325,17 @@ Foam::BlendedInterfacialModel::Kf() const if (model_.valid()) { - x() += model_->Kf()*(scalar(1) - f1() - f2()); + x.ref() += model_->Kf()*(scalar(1) - f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->Kf()*f1; + x.ref() += model1In2_->Kf()*f1; } if (model2In1_.valid()) { - x() += model2In1_->Kf()*f2; + x.ref() += model2In1_->Kf()*f2; } if @@ -344,7 +344,7 @@ Foam::BlendedInterfacialModel::Kf() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -353,7 +353,7 @@ Foam::BlendedInterfacialModel::Kf() const template template -Foam::tmp > +Foam::tmp> Foam::BlendedInterfacialModel::F() const { tmp f1, f2; @@ -368,7 +368,7 @@ Foam::BlendedInterfacialModel::F() const f2 = blending_.f2(phase1_, phase2_); } - tmp > x + tmp> x ( new GeometricField ( @@ -382,23 +382,23 @@ Foam::BlendedInterfacialModel::F() const false ), phase1_.mesh(), - dimensioned("zero", ModelType::dimF, pTraits::zero) + dimensioned("zero", ModelType::dimF, Zero) ) ); if (model_.valid()) { - x() += model_->F()*(scalar(1) - f1() - f2()); + x.ref() += model_->F()*(scalar(1) - f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->F()*f1; + x.ref() += model1In2_->F()*f1; } if (model2In1_.valid()) { - x() -= model2In1_->F()*f2; // note : subtraction + x.ref() -= model2In1_->F()*f2; // note : subtraction } if @@ -407,7 +407,7 @@ Foam::BlendedInterfacialModel::F() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -456,17 +456,17 @@ Foam::BlendedInterfacialModel::Ff() const if (model_.valid()) { - x() += model_->Ff()*(scalar(1) - f1() - f2()); + x.ref() += model_->Ff()*(scalar(1) - f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->Ff()*f1; + x.ref() += model1In2_->Ff()*f1; } if (model2In1_.valid()) { - x() -= model2In1_->Ff()*f2; // note : subtraction + x.ref() -= model2In1_->Ff()*f2; // note : subtraction } if @@ -475,7 +475,7 @@ Foam::BlendedInterfacialModel::Ff() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -518,15 +518,15 @@ Foam::BlendedInterfacialModel::D() const if (model_.valid()) { - x() += model_->D()*(scalar(1) - f1() - f2()); + x.ref() += model_->D()*(scalar(1) - f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->D()*f1; + x.ref() += model1In2_->D()*f1; } if (model2In1_.valid()) { - x() += model2In1_->D()*f2; + x.ref() += model2In1_->D()*f2; } if @@ -535,7 +535,7 @@ Foam::BlendedInterfacialModel::D() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H index 4be8f0b347..c51599d58c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -144,7 +144,7 @@ public: //- Return the blended force template - tmp > F() const; + tmp> F() const; //- Return the face blended force tmp Ff() const; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C index 3db07ef804..c63f6bfd44 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,7 @@ License #include "fvcDiv.H" #include "fvmSup.H" #include "fvMatrix.H" +#include "zeroGradientFvPatchFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -217,7 +218,7 @@ Foam::HeatAndMassTransferPhaseSystem::dmdt { if (phase1 == &phase) { - tdmdt() += this->dmdt(pair); + tdmdt.ref() += this->dmdt(pair); } Swap(phase1, phase2); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.H index 3a0cbd4ba2..550c0d1043 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ SourceFiles namespace Foam { -template +template class BlendedInterfacialModel; class blendingMethod; @@ -67,7 +67,7 @@ protected: < HashTable < - autoPtr > + autoPtr> >, phasePairKey, phasePairKey::hash @@ -77,7 +77,7 @@ protected: < HashTable < - autoPtr > + autoPtr> >, phasePairKey, phasePairKey::hash @@ -156,7 +156,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "HeatAndMassTransferPhaseSystem.C" + #include "HeatAndMassTransferPhaseSystem.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H index 0c908239fd..d313aa7e65 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ namespace Foam { class blendingMethod; -template class BlendedInterfacialModel; +template class BlendedInterfacialModel; class heatTransferModel; /*---------------------------------------------------------------------------*\ @@ -61,7 +61,7 @@ protected: typedef HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash > heatTransferModelTable; @@ -121,7 +121,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "HeatTransferPhaseSystem.C" + #include "HeatTransferPhaseSystem.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H index b87c5a709d..0052008abc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,7 +110,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "InterfaceCompositionPhaseChangePhaseSystem.C" + #include "InterfaceCompositionPhaseChangePhaseSystem.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C index f50bd61f9e..b9859eb41d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,7 +201,7 @@ Foam::MomentumTransferPhaseSystem::Kd { if (phase1 == &phase) { - tKd() += K; + tKd.ref() += K; } Swap(phase1, phase2); @@ -317,7 +317,7 @@ Foam::MomentumTransferPhaseSystem::F false ), this->mesh_, - dimensionedVector("zero", liftModel::dimF, vector::zero) + dimensionedVector("zero", liftModel::dimF, Zero) ) ); } @@ -533,7 +533,7 @@ Foam::volVectorField& Foam::MomentumTransferPhaseSystem::setF false ), this->mesh_, - dimensionedVector("zero", liftModel::dimF, vector::zero) + dimensionedVector("zero", liftModel::dimF, Zero) ) ); } @@ -543,10 +543,10 @@ Foam::volVectorField& Foam::MomentumTransferPhaseSystem::setF template -Foam::autoPtr > +Foam::autoPtr> Foam::MomentumTransferPhaseSystem::Fs() const { - autoPtr > tFs + autoPtr> tFs ( new PtrList(this->phases().size()) ); @@ -628,13 +628,13 @@ Foam::MomentumTransferPhaseSystem::setPhiD template -Foam::autoPtr > +Foam::autoPtr> Foam::MomentumTransferPhaseSystem::phiDs ( const PtrList& rAUs ) const { - autoPtr > tphiDs + autoPtr> tphiDs ( new PtrList(this->phases().size()) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H index 2f787ed004..e6a3209f1c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ SourceFiles namespace Foam { -template +template class BlendedInterfacialModel; class blendingMethod; @@ -72,35 +72,35 @@ protected: typedef HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash > dragModelTable; typedef HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash > virtualMassModelTable; typedef HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash > liftModelTable; typedef HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash > wallLubricationModelTable; typedef HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash > turbulentDispersionModelTable; @@ -187,10 +187,10 @@ public: virtual tmp F(const phasePairKey& key) const; //- Return the combined force (lift + wall-lubrication) - virtual autoPtr > Fs() const; + virtual autoPtr> Fs() const; //- Return the turbulent dispersion force on faces for phase pair - virtual autoPtr > phiDs + virtual autoPtr> phiDs ( const PtrList& rAUs ) const; @@ -218,7 +218,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "MomentumTransferPhaseSystem.C" + #include "MomentumTransferPhaseSystem.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H index b54c183150..c1ab9e7c9c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -116,7 +116,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "ThermalPhaseChangePhaseSystem.C" + #include "ThermalPhaseChangePhaseSystem.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C index b737cd0322..6ca75c6ed4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,13 +112,13 @@ Foam::AnisothermalPhaseModel::heEqn() // Add the appropriate pressure-work term if (he.name() == this->thermo_->phasePropertyName("e")) { - tEEqn() += + tEEqn.ref() += fvc::ddt(alpha)*this->thermo().p() + fvc::div(alphaPhi, this->thermo().p()); } else if (this->thermo_->dpdt()) { - tEEqn() -= alpha*this->fluid().dpdt(); + tEEqn.ref() -= alpha*this->fluid().dpdt(); } return tEEqn; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H index 1b7ec2f615..7a9cbd51bf 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,7 +103,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "AnisothermalPhaseModel.C" + #include "AnisothermalPhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C index ba5e90459b..bd4dda226f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,8 +78,7 @@ Foam::InertPhaseModel::Sh() const this->mesh() ), this->mesh(), - dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0) ) ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H index 77823d4491..26c9661ab7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/InertPhaseModel/InertPhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,7 +90,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "InertPhaseModel.C" + #include "InertPhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H index bdf1a14aed..85a31f8807 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,7 +86,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "IsothermalPhaseModel.C" + #include "IsothermalPhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C index 0b87f228ff..2f7bfcc108 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ License #include "fvmSup.H" #include "fvcDdt.H" #include "fvcDiv.H" +#include "fvcFlux.H" #include "surfaceInterpolate.H" #include "fvMatrix.H" @@ -109,7 +110,7 @@ Foam::MovingPhaseModel::phi(const volVectorField& U) const IOobject::NO_READ, IOobject::AUTO_WRITE ), - fvc::interpolate(U) & U.mesh().Sf(), + fvc::flux(U), phiTypes ) ); @@ -172,7 +173,7 @@ Foam::MovingPhaseModel::MovingPhaseModel fluid.mesh() ), fluid.mesh(), - dimensionedVector("0", dimAcceleration, vector::zero) + dimensionedVector("0", dimAcceleration, Zero) ), divU_(NULL), turbulence_ diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H index 6c5da0bde9..864a6b4259 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -196,7 +196,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "MovingPhaseModel.C" + #include "MovingPhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H index 862f75646e..d869907a33 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ Description namespace Foam { - typedef ThermalDiffusivity > + typedef ThermalDiffusivity> phaseCompressibleTurbulenceModel; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H index 9600f6ef9b..417c6cea6d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/phaseCompressibleTurbulenceModelFwd.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ namespace Foam template class ThermalDiffusivity; - typedef ThermalDiffusivity > + typedef ThermalDiffusivity> phaseCompressibleTurbulenceModel; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H index 94ca80582c..6bbab1cf56 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,7 +108,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "MultiComponentPhaseModel.C" + #include "MultiComponentPhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H index 2aa8034ede..ff42fbe714 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/PurePhaseModel/PurePhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,7 +99,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "PurePhaseModel.C" + #include "PurePhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H index 305b62590a..e05c71b44a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,7 +99,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "ReactingPhaseModel.C" + #include "ReactingPhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H index 960d2c1ba6..56289cbf78 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -161,7 +161,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "ThermoPhaseModel.C" + #include "ThermoPhaseModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C index 4efd86189b..b9abe549a0 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 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ Foam::tmp Foam::phaseSystem::calcPhi for (label phasei=1; phasei Foam::phaseSystem::rho() const for (label phasei=1; phasei Foam::phaseSystem::U() const for (label phasei=1; phasei class BlendedInterfacialModel; +template class BlendedInterfacialModel; class surfaceTensionModel; class aspectRatioModel; @@ -176,9 +176,6 @@ protected: //- Optional MRF zones IOMRFZoneList MRF_; - //- Optional FV-options - mutable fv::options fvOptions_; - //- Blending methods blendingMethodTable blendingMethods_; @@ -239,7 +236,7 @@ protected: const word& modelName, HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash >& models @@ -252,7 +249,7 @@ protected: const word& modelName, HashTable < - HashTable >, + HashTable>, phasePairKey, phasePairKey::hash >& models @@ -323,11 +320,11 @@ public: inline fv::options& fvOptions() const; //- Access a sub model between a phase pair - template + template const modelType& lookupSubModel(const phasePair& key) const; //- Access a sub model between two phases - template + template const modelType& lookupSubModel ( const phaseModel& dispersed, @@ -368,7 +365,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "phaseSystemTemplates.C" + #include "phaseSystemTemplates.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H index 125d286d9d..7f0e73be56 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemI.H @@ -84,7 +84,7 @@ inline const Foam::IOMRFZoneList& Foam::phaseSystem::MRF() const inline Foam::fv::options& Foam::phaseSystem::fvOptions() const { - return fvOptions_; + return fv::options::New(mesh_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C index eee3fcd3b3..3ab4a91ec5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystemTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,7 +82,7 @@ void Foam::phaseSystem::generatePairsAndSubModels const word& modelName, HashTable < - autoPtr >, + autoPtr>, phasePairKey, phasePairKey::hash >& models @@ -118,7 +118,7 @@ void Foam::phaseSystem::generatePairsAndSubModels models.insert ( key, - autoPtr > + autoPtr> ( new BlendedInterfacialModel ( @@ -141,7 +141,7 @@ void Foam::phaseSystem::generatePairsAndSubModels const word& modelName, HashTable < - HashTable >, + HashTable>, phasePairKey, phasePairKey::hash >& models @@ -169,7 +169,7 @@ void Foam::phaseSystem::generatePairsAndSubModels models.insert ( key, - HashTable >() + HashTable>() ); } @@ -182,7 +182,7 @@ void Foam::phaseSystem::generatePairsAndSubModels } } -template +template const modelType& Foam::phaseSystem::lookupSubModel(const phasePair& key) const { return @@ -193,7 +193,7 @@ const modelType& Foam::phaseSystem::lookupSubModel(const phasePair& key) const } -template +template const modelType& Foam::phaseSystem::lookupSubModel ( const phaseModel& dispersed, diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean index 93ee94face..983c20bdc1 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso multiphaseSystem wclean libso multiphaseCompressibleTurbulenceModels wclean -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake index c60b665df4..42f430bf17 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/Allwmake @@ -1,9 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso multiphaseSystem -wmake libso multiphaseCompressibleTurbulenceModels +wmake $targetType multiphaseSystem +wmake $targetType multiphaseCompressibleTurbulenceModels wmake -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H index 422f6324b1..0130a872c9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H @@ -29,13 +29,14 @@ for (int Ecorr=0; Ecorrrelax(); - fvOptions.constrain(EEqn()); + fvOptions.constrain(EEqn.ref()); EEqn->solve(); } } + + fluid.correctThermo(); } -fluid.correctThermo(); forAll(phases, phasei) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 2b06f1a7f4..b81e174db8 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,13 +64,13 @@ void Foam::multiphaseSystem::calcAlphas() alphas_ += level*phases()[i]; level += 1.0; } - - alphas_.correctBoundaryConditions(); } void Foam::multiphaseSystem::solveAlphas() { + bool LTS = fv::localEulerDdt::enabled(mesh_); + PtrList alphaPhiCorrs(phases().size()); forAll(phases(), phasei) { @@ -155,14 +155,11 @@ void Foam::multiphaseSystem::solveAlphas() } } - if (fv::localEulerDdt::enabled(mesh_)) + if (LTS) { - const volScalarField& rDeltaT = - fv::localEulerDdt::localRDeltaT(mesh_); - MULES::limit ( - rDeltaT, + fv::localEulerDdt::localRDeltaT(mesh_), geometricOneField(), phase, phi_, @@ -480,7 +477,7 @@ Foam::tmp Foam::multiphaseSystem::K { tmp tnHatfv = nHatfv(phase1, phase2); - correctContactAngle(phase1, phase2, tnHatfv().boundaryField()); + correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryField()); // Simple expression for curvature return -fvc::div(tnHatfv & mesh_.Sf()); @@ -507,8 +504,7 @@ Foam::multiphaseSystem::multiphaseSystem IOobject::AUTO_WRITE ), mesh, - dimensionedScalar("alphas", dimless, 0.0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar("alphas", dimless, 0.0) ), cAlphas_(lookup("interfaceCompression")), @@ -572,7 +568,7 @@ Foam::tmp Foam::multiphaseSystem::surfaceTension if (cAlpha != cAlphas_.end()) { - tSurfaceTension() += + tSurfaceTension.ref() += fvc::interpolate(sigma(key12)*K(phase1, phase2)) *( fvc::interpolate(phase2)*fvc::snGrad(phase1) @@ -606,7 +602,7 @@ Foam::multiphaseSystem::nearInterface() const forAll(phases(), phasei) { - tnearInt() = max + tnearInt.ref() = max ( tnearInt(), pos(phases()[phasei] - 0.01)*pos(0.99 - phases()[phasei]) @@ -636,8 +632,6 @@ void Foam::multiphaseSystem::solve() fv::localEulerDdt::localRSubDeltaT(mesh_, nAlphaSubCycles); } - dimensionedScalar totalDeltaT = runTime.deltaT(); - PtrList alpha0s(phases().size()); PtrList alphaPhiSums(phases().size()); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H index e33bf8c487..bf6d3e0d2e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -167,10 +167,10 @@ public: virtual tmp Kd(const phaseModel& phase) const = 0; //- Return the combined force (lift + wall-lubrication) for phase pair - virtual autoPtr > Fs() const = 0; + virtual autoPtr> Fs() const = 0; //- Return the turbulent dispersion force on faces for phase pair - virtual autoPtr > phiDs + virtual autoPtr> phiDs ( const PtrList& rAUs ) const = 0; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H index 2703d75ef1..05a049b4c6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H @@ -37,7 +37,7 @@ forAll(phases, phasei) // Lift, wall-lubrication and turbulent diffusion fluxes PtrList phiFs(phases.size()); { - autoPtr > Fs = fluid.Fs(); + autoPtr> Fs = fluid.Fs(); forAll(phases, phasei) { @@ -51,14 +51,14 @@ PtrList phiFs(phases.size()); new surfaceScalarField ( IOobject::groupName("phiF", phase.name()), - (fvc::interpolate(rAUs[phasei]*Fs()[phasei]) & mesh.Sf()) + fvc::flux(rAUs[phasei]*Fs()[phasei]) ) ); } } } { - autoPtr > phiDs = fluid.phiDs(rAUs); + autoPtr> phiDs = fluid.phiDs(rAUs); forAll(phases, phasei) { @@ -201,7 +201,7 @@ while (pimple.correct()) new surfaceScalarField ( IOobject::groupName("phiHbyA", phase.name()), - (fvc::interpolate(HbyAs[phasei]) & mesh.Sf()) + fvc::flux(HbyAs[phasei]) + phiCorrCoeff *fvc::interpolate ( @@ -209,7 +209,7 @@ while (pimple.correct()) ) *( MRF.absolute(phase.phi().oldTime()) - - (fvc::interpolate(phase.U().oldTime()) & mesh.Sf()) + - fvc::flux(phase.U().oldTime()) )/runTime.deltaT() - phigFs[phasei] ) @@ -318,11 +318,14 @@ while (pimple.correct()) rho ) )/rho - + (alpha/rho)*correction + + correction ( - phase.thermo().psi()*fvm::ddt(p_rgh) - + fvm::div(phid, p_rgh) - - fvm::Sp(fvc::div(phid), p_rgh) + (alpha/rho)* + ( + phase.thermo().psi()*fvm::ddt(p_rgh) + + fvm::div(phid, p_rgh) + - fvm::Sp(fvc::div(phid), p_rgh) + ) ) ).ptr() ); @@ -454,7 +457,7 @@ while (pimple.correct()) forAll(phases, phasei) { phaseModel& phase = phases[phasei]; - phase.rho()() += phase.thermo().psi()*(p_rgh - p_rgh_0); + phase.thermo().rho() += phase.thermo().psi()*(p_rgh - p_rgh_0); } // Correct p_rgh for consistency with p and the updated densities diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C index f23b5649fc..dfcfee9de9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,6 @@ Description #include "fvCFD.H" #include "multiphaseSystem.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "pimpleControl.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/setRDeltaT.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/setRDeltaT.H index 9e9ca54230..fec017ea30 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/setRDeltaT.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/setRDeltaT.H @@ -1,13 +1,21 @@ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); + + const dictionary& pimpleDict = pimple.dict(); + + scalar maxCo + ( + pimpleDict.lookupOrDefault("maxCo", 0.2) + ); + + scalar maxDeltaT + ( + pimpleDict.lookupOrDefault("maxDeltaT", GREAT) + ); scalar rDeltaTSmoothingCoeff ( - runTime.controlDict().lookupOrDefault - ( - "rDeltaTSmoothingCoeff", - 0.02 - ) + pimpleDict.lookupOrDefault("rDeltaTSmoothingCoeff", 0.02) ); surfaceScalarField maxPhi("maxPhi", phi); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean index 87e030a14a..59ec72ff10 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwclean @@ -6,4 +6,4 @@ wclean libso twoPhaseSystem wclean libso twoPhaseCompressibleTurbulenceModels wclean -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake index d0e2fc63c7..a0ff46153a 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/Allwmake @@ -1,9 +1,13 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake libso twoPhaseSystem -wmake libso twoPhaseCompressibleTurbulenceModels +wmake $targetType twoPhaseSystem +wmake $targetType twoPhaseCompressibleTurbulenceModels wmake -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H index 3060c444de..0cdbfba8b9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H @@ -23,7 +23,7 @@ for (int Ecorr=0; Ecorrrelax(); - fvOptions.constrain(E1Eqn()); + fvOptions.constrain(E1Eqn.ref()); E1Eqn->solve(); } } @@ -43,13 +43,13 @@ for (int Ecorr=0; Ecorrrelax(); - fvOptions.constrain(E2eqn()); + fvOptions.constrain(E2eqn.ref()); E2eqn->solve(); } } -} -fluid.correctThermo(); + fluid.correctThermo(); +} Info<< phase1.name() << " min/max T " << min(phase1.thermo().T()).value() diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H index f269a79760..ba312ab248 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H @@ -65,18 +65,10 @@ tmp phiF2; surfaceScalarField snGradAlpha1(fvc::snGrad(alpha1)*mesh.magSf()); // Phase-1 dispersion, lift and wall-lubrication flux - phiF1 = - ( - DbyA1()*snGradAlpha1 - + (fvc::interpolate(rAU1*F) & mesh.Sf()) - ); + phiF1 = DbyA1()*snGradAlpha1 + fvc::flux(rAU1*F); // Phase-2 dispersion, lift and wall-lubrication flux - phiF2 = - ( - - DbyA2()*snGradAlpha1 - - (fvc::interpolate(rAU2*F) & mesh.Sf()) - ); + phiF2 = - DbyA2()*snGradAlpha1 - fvc::flux(rAU2*F); // Cache the phase diffusivities for implicit treatment in the // phase-fraction equation @@ -175,11 +167,11 @@ while (pimple.correct()) surfaceScalarField phiHbyA1 ( IOobject::groupName("phiHbyA", phase1.name()), - (fvc::interpolate(HbyA1) & mesh.Sf()) + fvc::flux(HbyA1) + phiCorrCoeff1*fvc::interpolate(alpha1.oldTime()*rho1.oldTime()*rAU1) *( MRF.absolute(phi1.oldTime()) - - (fvc::interpolate(U1.oldTime()) & mesh.Sf()) + - fvc::flux(U1.oldTime()) )/runTime.deltaT() - phiF1() - phig1 @@ -189,11 +181,11 @@ while (pimple.correct()) surfaceScalarField phiHbyA2 ( IOobject::groupName("phiHbyA", phase2.name()), - (fvc::interpolate(HbyA2) & mesh.Sf()) + fvc::flux(HbyA2) + phiCorrCoeff2*fvc::interpolate(alpha2.oldTime()*rho2.oldTime()*rAU2) *( MRF.absolute(phi2.oldTime()) - - (fvc::interpolate(U2.oldTime()) & mesh.Sf()) + - fvc::flux(U2.oldTime()) )/runTime.deltaT() - phiF2() - phig2 @@ -252,14 +244,17 @@ while (pimple.correct()) phase1.continuityError() - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 - + (alpha1/rho1)*correction + + correction ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + (alpha1/rho1)* + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr()); - pEqnComp1().relax(); + deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); + pEqnComp1.ref().relax(); } if (phase2.compressible()) @@ -275,13 +270,16 @@ while (pimple.correct()) phase2.continuityError() - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 - + (alpha2/rho2)*correction + + correction ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + (alpha2/rho2)* + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr()); - pEqnComp2().relax(); + deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); + pEqnComp2.ref().relax(); } } else @@ -311,7 +309,7 @@ while (pimple.correct()) { if (pEqnComp1.valid()) { - pEqnComp1() -= fluid.dmdt()/rho1; + pEqnComp1.ref() -= fluid.dmdt()/rho1; } else { @@ -320,7 +318,7 @@ while (pimple.correct()) if (pEqnComp2.valid()) { - pEqnComp2() += fluid.dmdt()/rho2; + pEqnComp2.ref() += fluid.dmdt()/rho2; } else { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H index 83c3a9ce7f..00a0fb8cfe 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/UEqns.H @@ -25,7 +25,7 @@ fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime); U1Eqn = ( fvm::div(alphaRhoPhi1, U1) - fvm::Sp(fvc::div(alphaRhoPhi1), U1) - + fvm::Sp(dmdt12, U1) + dmdt21*U2 + + fvm::Sp(dmdt12, U1) - dmdt12*U2 + MRF.DDt(alpha1*rho1, U1) + phase1.turbulence().divDevRhoReff(U1) + Vm*(UgradU1 - (UgradU2 & U2)) @@ -40,7 +40,7 @@ fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime); U2Eqn = ( fvm::div(alphaRhoPhi2, U2) - fvm::Sp(fvc::div(alphaRhoPhi2), U2) - - fvm::Sp(dmdt21, U2) - dmdt12*U1 + - fvm::Sp(dmdt21, U2) + dmdt21*U1 + MRF.DDt(alpha2*rho2, U2) + phase2.turbulence().divDevRhoReff(U2) + Vm*(UgradU2 - (UgradU1 & U1)) diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H index e2edf14bed..444f2de81f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H @@ -157,7 +157,7 @@ while (pimple.correct()) *( (alphaRhof10 + Vmf) *MRF.absolute(phi1.oldTime())/runTime.deltaT() - + (fvc::interpolate(U1Eqn.H()) & mesh.Sf()) + + fvc::flux(U1Eqn.H()) + Vmf*ddtPhi2 + Kdf*MRF.absolute(phi2) - Ff1() @@ -175,7 +175,7 @@ while (pimple.correct()) *( (alphaRhof20 + Vmf) *MRF.absolute(phi2.oldTime())/runTime.deltaT() - + (fvc::interpolate(U2Eqn.H()) & mesh.Sf()) + + fvc::flux(U2Eqn.H()) + Vmf*ddtPhi1 + Kdf*MRF.absolute(phi1) - Ff2() @@ -234,13 +234,16 @@ while (pimple.correct()) phase1.continuityError() - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 - + (alpha1/rho1)*correction + + correction ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + (alpha1/rho1)* + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr()); - pEqnComp1().relax(); + deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); + pEqnComp1.ref().relax(); } if (phase2.compressible()) @@ -250,13 +253,16 @@ while (pimple.correct()) phase2.continuityError() - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 - + (alpha2/rho2)*correction + + correction ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + (alpha2/rho2)* + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr()); - pEqnComp2().relax(); + deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); + pEqnComp2.ref().relax(); } } else @@ -286,7 +292,7 @@ while (pimple.correct()) { if (pEqnComp1.valid()) { - pEqnComp1() -= fluid.dmdt()/rho1; + pEqnComp1.ref() -= fluid.dmdt()/rho1; } else { @@ -295,7 +301,7 @@ while (pimple.correct()) if (pEqnComp2.valid()) { - pEqnComp2() += fluid.dmdt()/rho2; + pEqnComp2.ref() += fluid.dmdt()/rho2; } else { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C index 04c3d2e206..5111ae79d6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,6 @@ Description #include "fvCFD.H" #include "twoPhaseSystem.H" #include "phaseCompressibleTurbulenceModel.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "pimpleControl.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaT.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaT.H index f9f736f788..4bef17a6bb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaT.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/setRDeltaT.H @@ -1,13 +1,21 @@ { - volScalarField& rDeltaT = trDeltaT(); + volScalarField& rDeltaT = trDeltaT.ref(); + + const dictionary& pimpleDict = pimple.dict(); + + scalar maxCo + ( + pimpleDict.lookupOrDefault("maxCo", 0.2) + ); + + scalar maxDeltaT + ( + pimpleDict.lookupOrDefault("maxDeltaT", GREAT) + ); scalar rDeltaTSmoothingCoeff ( - runTime.controlDict().lookupOrDefault - ( - "rDeltaTSmoothingCoeff", - 0.02 - ) + pimpleDict.lookupOrDefault("rDeltaTSmoothingCoeff", 0.02) ); // Set the reciprocal time-step from the local Courant number diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C index 0d4a1128c0..996f96cecf 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm ) const { tmp typsf(new scalarField(this->size())); - scalarField& ypsf = typsf(); + scalarField& ypsf = typsf.ref(); forAll(ypsf, faceI) { @@ -197,7 +197,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat scalarField yPlusTherm(this->yPlusTherm(P, Prat)); tmp talphatConv(new scalarField(this->size())); - scalarField& alphatConv = talphatConv(); + scalarField& alphatConv = talphatConv.ref(); // Populate boundary values forAll(alphatConv, faceI) 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 924f8209a4..4aac384117 100755 --- 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 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -299,7 +299,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() const scalarField liquidw(liquid.boundaryField()[patchi]); // Damp boiling at high void fractions. - const scalarField W(min(liquidw/0.2, scalar(0.1))); + const scalarField W(min(liquidw/0.2, scalar(1))); const scalarField A2(W*min(M_PI*sqr(Ddep)*N*Al/4, scalar(1))); const scalarField A1(max(1 - A2, scalar(1e-4))); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index c3d306738d..4aa484cb5f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField ) : partialSlipFvPatchVectorField(p, iF), - specularityCoefficient_(p.size()) + specularityCoefficient_("specularityCoefficient", dimless, 0) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index f4d7dd4ee9..220c4c05eb 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,8 +48,8 @@ JohnsonJacksonParticleThetaFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - restitutionCoefficient_(p.size()), - specularityCoefficient_(p.size()) + restitutionCoefficient_("restitutionCoefficient", dimless, 0), + specularityCoefficient_("specularityCoefficient", dimless, 0) {} diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index 4a0d2290d1..b88ec0923a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,7 +132,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu ) ); - volScalarField& nuf = tnu(); + volScalarField& nuf = tnu.ref(); forAll(D, celli) { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 83017e1557..f3b7d5da14 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "kineticTheoryModel.H" #include "mathematicalConstants.H" #include "twoPhaseSystem.H" +#include "fvOptions.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -43,7 +44,7 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel : eddyViscosity < - RASModel > + RASModel> > ( type, @@ -186,7 +187,7 @@ bool Foam::RASModels::kineticTheoryModel::read() ( eddyViscosity < - RASModel > + RASModel> >::read() ) { @@ -272,7 +273,8 @@ Foam::RASModels::kineticTheoryModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -417,6 +419,8 @@ void Foam::RASModels::kineticTheoryModel::correct() // 'thermal' conductivity (Table 3.3, p. 49) kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rho, da, e_); + fv::options& fvOptions(fv::options::New(mesh_)); + // Construct the granular temperature equation (Eq. 3.20, p. 44) // NB. note that there are two typos in Eq. 3.20: // Ps should be without grad @@ -431,15 +435,18 @@ void Foam::RASModels::kineticTheoryModel::correct() ) - fvm::laplacian(kappa_, Theta_, "laplacian(kappa,Theta)") == - fvm::SuSp(-((PsCoeff*I) && gradU), Theta_) + - fvm::SuSp((PsCoeff*I) && gradU, Theta_) + (tau && gradU) + fvm::Sp(-gammaCoeff, Theta_) + fvm::Sp(-J1, Theta_) + fvm::Sp(J2/(Theta_ + ThetaSmall), Theta_) + + fvOptions(alpha, rho, Theta_) ); ThetaEqn.relax(); + fvOptions.constrain(ThetaEqn); ThetaEqn.solve(); + fvOptions.correct(Theta_); } else { diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index e18d41fb40..d648de7bc1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,7 +73,7 @@ class kineticTheoryModel : public eddyViscosity < - RASModel > + RASModel> > { // Private data diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 79df9e4922..9d3b53c782 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ Foam::RASModels::phasePressureModel::phasePressureModel : eddyViscosity < - RASModel > + RASModel> > ( type, @@ -90,7 +90,7 @@ bool Foam::RASModels::phasePressureModel::read() ( eddyViscosity < - RASModel > + RASModel> >::read() ) { @@ -144,7 +144,7 @@ Foam::RASModels::phasePressureModel::R() const ( "R", dimensionSet(0, 2, -2, 0, 0), - symmTensor::zero + Zero ) ) ); @@ -164,7 +164,8 @@ Foam::RASModels::phasePressureModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -192,7 +193,7 @@ Foam::RASModels::phasePressureModel::pPrimef() const ); surfaceScalarField::GeometricBoundaryField& bpPrime = - tpPrime().boundaryField(); + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -226,7 +227,7 @@ Foam::RASModels::phasePressureModel::devRhoReff() const ( "R", rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), - symmTensor::zero + Zero ) ) ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index c7e9842f37..ab5e38effe 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,7 +72,7 @@ class phasePressureModel : public eddyViscosity < - RASModel > + RASModel> > { // Private data diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index 7b7ddee6f4..597d15e7ff 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -186,18 +186,17 @@ Foam::twoPhaseSystem::dmdt() const void Foam::twoPhaseSystem::solve() { - const fvMesh& mesh = this->mesh(); - const Time& runTime = mesh.time(); + const Time& runTime = mesh_.time(); volScalarField& alpha1 = phase1_; volScalarField& alpha2 = phase2_; - const dictionary& alphaControls = mesh.solverDict(alpha1.name()); + const dictionary& alphaControls = mesh_.solverDict(alpha1.name()); label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles"))); label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr"))); - bool LTS = fv::localEulerDdt::enabled(mesh); + bool LTS = fv::localEulerDdt::enabled(mesh_); word alphaScheme("div(phi," + alpha1.name() + ')'); word alpharScheme("div(phir," + alpha1.name() + ')'); @@ -264,9 +263,9 @@ void Foam::twoPhaseSystem::solve() ( "Sp", runTime.timeName(), - mesh + mesh_ ), - mesh, + mesh_, dimensionedScalar("Sp", dimless/dimTime, 0.0) ); @@ -276,7 +275,7 @@ void Foam::twoPhaseSystem::solve() ( "Su", runTime.timeName(), - mesh + mesh_ ), // Divergence term is handled explicitly to be // consistent with the explicit transport solution @@ -285,7 +284,7 @@ void Foam::twoPhaseSystem::solve() if (tdgdt.valid()) { - scalarField& dgdt = tdgdt(); + scalarField& dgdt = tdgdt.ref(); forAll(dgdt, celli) { @@ -345,7 +344,7 @@ void Foam::twoPhaseSystem::solve() if (LTS) { trSubDeltaT = - fv::localEulerDdt::localRSubDeltaT(mesh, nAlphaSubCycles); + fv::localEulerDdt::localRSubDeltaT(mesh_, nAlphaSubCycles); } for @@ -420,7 +419,7 @@ void Foam::twoPhaseSystem::solve() fvc::interpolate(phase2_.rho())*phase2_.alphaPhi(); Info<< alpha1.name() << " volume fraction = " - << alpha1.weightedAverage(mesh.V()).value() + << alpha1.weightedAverage(mesh_.V()).value() << " Min(alpha1) = " << min(alpha1).value() << " Max(alpha1) = " << max(alpha1).value() << endl; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index 4a89f67d8f..d801fb8fa5 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -1,14 +1,11 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - - volVectorField HbyA("HbyA", U); - HbyA = rAU*UEqn.H(); - + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::flux(HbyA) + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); @@ -20,15 +17,8 @@ phiHbyA += phig; - // Update the fixedFluxPressure BCs to ensure flux consistency - setSnGrad - ( - p_rgh.boundaryField(), - ( - phiHbyA.boundaryField() - - (mesh.Sf().boundaryField() & U.boundaryField()) - )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) - ); + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 02b05c03d6..eee5c2a4cb 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,6 @@ Description #include "incompressibleTwoPhaseMixture.H" #include "turbulentTransportModel.H" #include "pimpleControl.H" -#include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean index 8103dc7201..aec9873881 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean @@ -7,4 +7,4 @@ wclean libso interfacialModels wclean libso phaseCompressibleTurbulenceModels wclean -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake index a4a7a60bd4..16e2ad39ab 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake @@ -1,11 +1,15 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x wmakeLnInclude interfacialModels -wmake libso twoPhaseSystem -wmake libso interfacialModels -wmake libso phaseCompressibleTurbulenceModels +wmake $targetType twoPhaseSystem +wmake $targetType interfacialModels +wmake $targetType phaseCompressibleTurbulenceModels wmake -# ----------------------------------------------------------------- end-of-file +#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C index ca0a145f5b..079b5d187b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "phasePair.H" #include "fvcGrad.H" #include "surfaceInterpolate.H" +#include "zeroGradientFvPatchFields.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C index 79e52a2856..7c0bf86c94 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "liftModel.H" #include "phasePair.H" #include "fvcCurl.H" +#include "fvcFlux.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -78,11 +79,7 @@ Foam::tmp Foam::liftModel::F() const Foam::tmp Foam::liftModel::Ff() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return - fvc::interpolate(pair_.dispersed()) - *(fvc::interpolate(Fi()) & mesh.Sf()); + return fvc::interpolate(pair_.dispersed())*fvc::flux(Fi()); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C index d4e13d5c7f..f8480dc69b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -101,7 +101,7 @@ Foam::tmp Foam::liftModels::noLift::F() const false ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C index 5845e3569a..2a65c1e1c6 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,7 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::F() const mesh ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C index 8de7e30260..b35bd0ef8f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ Foam::wallLubricationModels::noWallLubrication::Fi() const false ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } @@ -108,7 +108,7 @@ Foam::wallLubricationModels::noWallLubrication::F() const false ), mesh, - dimensionedVector("zero", dimF, vector::zero) + dimensionedVector("zero", dimF, Zero) ) ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C index 2f3cb1aaa0..d148d2cefd 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "wallLubricationModel.H" #include "phasePair.H" +#include "fvcFlux.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -67,11 +68,7 @@ Foam::tmp Foam::wallLubricationModel::F() const Foam::tmp Foam::wallLubricationModel::Ff() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return - fvc::interpolate(pair_.dispersed()) - *(fvc::interpolate(Fi()) & mesh.Sf()); + return fvc::interpolate(pair_.dispersed())*fvc::flux(Fi()); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H index 994f07d672..b418877743 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H @@ -70,18 +70,10 @@ tmp phiF2; surfaceScalarField snGradAlpha1(fvc::snGrad(alpha1)*mesh.magSf()); // Phase-1 dispersion, lift and wall-lubrication flux - phiF1 = - ( - Df1*snGradAlpha1 - + (fvc::interpolate(rAU1*F) & mesh.Sf()) - ); + phiF1 = Df1*snGradAlpha1 + fvc::flux(rAU1*F); // Phase-1 dispersion, lift and wall-lubrication flux - phiF2 = - ( - - Df2*snGradAlpha1 - - (fvc::interpolate(rAU2*F) & mesh.Sf()) - ); + phiF2 = - Df2*snGradAlpha1 - fvc::flux(rAU2*F); } @@ -172,11 +164,11 @@ while (pimple.correct()) surfaceScalarField phiHbyA1 ( IOobject::groupName("phiHbyA", phase1.name()), - (fvc::interpolate(HbyA1) & mesh.Sf()) + fvc::flux(HbyA1) + phiCorrCoeff1*fvc::interpolate(alpha1.oldTime()*rho1.oldTime()*rAU1) *( MRF.absolute(phi1.oldTime()) - - (fvc::interpolate(U1.oldTime()) & mesh.Sf()) + - fvc::flux(U1.oldTime()) )/runTime.deltaT() - phiF1() - phig1 @@ -186,11 +178,11 @@ while (pimple.correct()) surfaceScalarField phiHbyA2 ( IOobject::groupName("phiHbyA", phase2.name()), - (fvc::interpolate(HbyA2) & mesh.Sf()) + fvc::flux(HbyA2) + phiCorrCoeff2*fvc::interpolate(alpha2.oldTime()*rho2.oldTime()*rAU2) *( MRF.absolute(phi2.oldTime()) - - (fvc::interpolate(U2.oldTime()) & mesh.Sf()) + - fvc::flux(U2.oldTime()) )/runTime.deltaT() - phiF2() - phig2 @@ -252,26 +244,32 @@ while (pimple.correct()) contErr1 - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 - + (alpha1/rho1)*correction + + correction ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + (alpha1/rho1)* + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr()); - pEqnComp1().relax(); + deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); + pEqnComp1.ref().relax(); pEqnComp2 = ( contErr2 - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 - + (alpha2/rho2)*correction + + correction ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + (alpha2/rho2)* + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr()); - pEqnComp2().relax(); + deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); + pEqnComp2.ref().relax(); } else { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H index ab9a23197c..6855b6fb96 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H @@ -156,7 +156,7 @@ while (pimple.correct()) *( (alphaRhof10 + Vmf) *MRF.absolute(phi1.oldTime())/runTime.deltaT() - + (fvc::interpolate(U1Eqn.H()) & mesh.Sf()) + + fvc::flux(U1Eqn.H()) + Vmf*ddtPhi2 + Kdf*MRF.absolute(phi2) - Ff1() @@ -174,7 +174,7 @@ while (pimple.correct()) *( (alphaRhof20 + Vmf) *MRF.absolute(phi2.oldTime())/runTime.deltaT() - + (fvc::interpolate(U2Eqn.H()) & mesh.Sf()) + + fvc::flux(U2Eqn.H()) + Vmf*ddtPhi1 + Kdf*MRF.absolute(phi1) - Ff2() @@ -231,26 +231,32 @@ while (pimple.correct()) contErr1 - fvc::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), rho1) )/rho1 - + (alpha1/rho1)*correction + + correction ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + (alpha1/rho1)* + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr()); - pEqnComp1().relax(); + deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); + pEqnComp1.ref().relax(); pEqnComp2 = ( contErr2 - fvc::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), rho2) )/rho2 - + (alpha2/rho2)*correction + + correction ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + (alpha2/rho2)* + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ) ); - deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr()); - pEqnComp2().relax(); + deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); + pEqnComp2.ref().relax(); } else { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index c3d306738d..4aa484cb5f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ JohnsonJacksonParticleSlipFvPatchVectorField ) : partialSlipFvPatchVectorField(p, iF), - specularityCoefficient_(p.size()) + specularityCoefficient_("specularityCoefficient", dimless, 0) {} diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index f4d7dd4ee9..95fc5b41bf 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,8 +48,8 @@ JohnsonJacksonParticleThetaFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - restitutionCoefficient_(p.size()), - specularityCoefficient_(p.size()) + restitutionCoefficient_("restitutionCoefficient", dimless, 0), + specularityCoefficient_("specularityCoefficient", dimless, 0) {} @@ -65,8 +65,7 @@ JohnsonJacksonParticleThetaFvPatchScalarField mixedFvPatchScalarField(ptf, p, iF, mapper), restitutionCoefficient_(ptf.restitutionCoefficient_), specularityCoefficient_(ptf.specularityCoefficient_) -{ -} +{} Foam::JohnsonJacksonParticleThetaFvPatchScalarField:: diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index 4a0d2290d1..b88ec0923a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,7 +132,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu ) ); - volScalarField& nuf = tnu(); + volScalarField& nuf = tnu.ref(); forAll(D, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 99879c41d5..6a5a474b34 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel RASModel - > > > + >>> > ( type, @@ -192,7 +192,7 @@ bool Foam::RASModels::kineticTheoryModel::read() RASModel - > > > + >>> >::read() ) { @@ -278,7 +278,8 @@ Foam::RASModels::kineticTheoryModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -437,7 +438,7 @@ void Foam::RASModels::kineticTheoryModel::correct() ) - fvm::laplacian(kappa_, Theta_, "laplacian(kappa,Theta)") == - fvm::SuSp(-((PsCoeff*I) && gradU), Theta_) + - fvm::SuSp((PsCoeff*I) && gradU, Theta_) + (tau && gradU) + fvm::Sp(-gammaCoeff, Theta_) + fvm::Sp(-J1, Theta_) diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index 9aadb83d12..91f58d3449 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,7 +77,7 @@ class kineticTheoryModel RASModel - > > > + >>> > { // Private data diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 2eba4bdab7..0c5906d905 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ Foam::RASModels::phasePressureModel::phasePressureModel RASModel - > > > + >>> > ( type, @@ -96,7 +96,7 @@ bool Foam::RASModels::phasePressureModel::read() RASModel - > > > + >>> >::read() ) { @@ -150,7 +150,7 @@ Foam::RASModels::phasePressureModel::R() const ( "R", dimensionSet(0, 2, -2, 0, 0), - symmTensor::zero + Zero ) ) ); @@ -170,7 +170,8 @@ Foam::RASModels::phasePressureModel::pPrime() const ) ); - volScalarField::GeometricBoundaryField& bpPrime = tpPrime().boundaryField(); + volScalarField::GeometricBoundaryField& bpPrime = + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -198,7 +199,7 @@ Foam::RASModels::phasePressureModel::pPrimef() const ); surfaceScalarField::GeometricBoundaryField& bpPrime = - tpPrime().boundaryField(); + tpPrime.ref().boundaryField(); forAll(bpPrime, patchi) { @@ -232,7 +233,7 @@ Foam::RASModels::phasePressureModel::devRhoReff() const ( "R", rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), - symmTensor::zero + Zero ) ) ); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index 68734e5b4f..c148e3c40a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,7 +76,7 @@ class phasePressureModel RASModel - > > > + >>> > { // Private data diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C index b367381a84..6dae772c48 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,6 @@ Description #include "PhaseCompressibleTurbulenceModel.H" #include "pimpleControl.H" #include "fvOptions.H" -#include "fixedFluxPressureFvPatchScalarField.H" #include "fixedValueFvsPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C index 090ffd1bcc..0d78e02ac8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ void Foam::BlendedInterfacialModel::correctFixedFluxBCs ) { field.boundaryField()[patchI] - = pTraits::zero; + = Zero; } } } @@ -155,17 +155,17 @@ Foam::BlendedInterfacialModel::K() const if (model_.valid()) { - x() += model_->K()*(f1() - f2()); + x.ref() += model_->K()*(f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->K()*(1 - f1); + x.ref() += model1In2_->K()*(1 - f1); } if (model2In1_.valid()) { - x() += model2In1_->K()*f2; + x.ref() += model2In1_->K()*f2; } if @@ -174,7 +174,7 @@ Foam::BlendedInterfacialModel::K() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -223,17 +223,17 @@ Foam::BlendedInterfacialModel::Kf() const if (model_.valid()) { - x() += model_->Kf()*(f1() - f2()); + x.ref() += model_->Kf()*(f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->Kf()*(1 - f1); + x.ref() += model1In2_->Kf()*(1 - f1); } if (model2In1_.valid()) { - x() += model2In1_->Kf()*f2; + x.ref() += model2In1_->Kf()*f2; } if @@ -242,7 +242,7 @@ Foam::BlendedInterfacialModel::Kf() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -251,7 +251,7 @@ Foam::BlendedInterfacialModel::Kf() const template template -Foam::tmp > +Foam::tmp> Foam::BlendedInterfacialModel::F() const { tmp f1, f2; @@ -266,7 +266,7 @@ Foam::BlendedInterfacialModel::F() const f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); } - tmp > x + tmp> x ( new GeometricField ( @@ -280,23 +280,23 @@ Foam::BlendedInterfacialModel::F() const false ), pair_.phase1().mesh(), - dimensioned("zero", modelType::dimF, pTraits::zero) + dimensioned("zero", modelType::dimF, Zero) ) ); if (model_.valid()) { - x() += model_->F()*(f1() - f2()); + x.ref() += model_->F()*(f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->F()*(1 - f1); + x.ref() += model1In2_->F()*(1 - f1); } if (model2In1_.valid()) { - x() -= model2In1_->F()*f2; // note : subtraction + x.ref() -= model2In1_->F()*f2; // note : subtraction } if @@ -305,7 +305,7 @@ Foam::BlendedInterfacialModel::F() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -354,17 +354,17 @@ Foam::BlendedInterfacialModel::Ff() const if (model_.valid()) { - x() += model_->Ff()*(f1() - f2()); + x.ref() += model_->Ff()*(f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->Ff()*(1 - f1); + x.ref() += model1In2_->Ff()*(1 - f1); } if (model2In1_.valid()) { - x() -= model2In1_->Ff()*f2; // note : subtraction + x.ref() -= model2In1_->Ff()*f2; // note : subtraction } if @@ -373,7 +373,7 @@ Foam::BlendedInterfacialModel::Ff() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; @@ -416,17 +416,17 @@ Foam::BlendedInterfacialModel::D() const if (model_.valid()) { - x() += model_->D()*(f1() - f2()); + x.ref() += model_->D()*(f1() - f2()); } if (model1In2_.valid()) { - x() += model1In2_->D()*(1 - f1); + x.ref() += model1In2_->D()*(1 - f1); } if (model2In1_.valid()) { - x() += model2In1_->D()*f2; + x.ref() += model2In1_->D()*f2; } if @@ -435,7 +435,7 @@ Foam::BlendedInterfacialModel::D() const && (model_.valid() || model1In2_.valid() || model2In1_.valid()) ) { - correctFixedFluxBCs(x()); + correctFixedFluxBCs(x.ref()); } return x; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H index e6493fa1cf..c53894f45c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,7 +128,7 @@ public: //- Return the blended force template - tmp > F() const; + tmp> F() const; //- Return the face blended force tmp Ff() const; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C index a9fa972e11..eedb89cc55 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,7 @@ License #include "fixedValueFvPatchFields.H" #include "slipFvPatchFields.H" #include "partialSlipFvPatchFields.H" +#include "fvcFlux.H" #include "surfaceInterpolate.H" @@ -175,7 +176,7 @@ Foam::phaseModel::phaseModel IOobject::NO_READ, IOobject::AUTO_WRITE ), - fvc::interpolate(U_) & fluid_.mesh().Sf(), + fvc::flux(U_), phiTypes ) ); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H index 3f91a8bd25..5fb0245513 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,7 +97,7 @@ class phaseModel autoPtr dPtr_; //- Turbulence model - autoPtr > turbulence_; + autoPtr> turbulence_; public: diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H index 18928c7cc7..225bf34f62 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ class wallLubricationModel; class turbulentDispersionModel; class blendingMethod; -template class BlendedInterfacialModel; +template class BlendedInterfacialModel; /*---------------------------------------------------------------------------*\ Class twoPhaseSystem Declaration @@ -97,23 +97,23 @@ class twoPhaseSystem HashTable, word, word::hash> blendingMethods_; //- Drag model - autoPtr > drag_; + autoPtr> drag_; //- Virtual mass model - autoPtr > virtualMass_; + autoPtr> virtualMass_; //- Heat transfer model - autoPtr > heatTransfer_; + autoPtr> heatTransfer_; //- Lift model - autoPtr > lift_; + autoPtr> lift_; //- Wall lubrication model - autoPtr > + autoPtr> wallLubrication_; //- Wall lubrication model - autoPtr > + autoPtr> turbulentDispersion_; diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H index eca43adbf7..a912d80e07 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H @@ -41,8 +41,7 @@ "rho", dimMass/dimVolume, rhoValue - ), - zeroGradientFvPatchField::typeName + ) ) ); } @@ -97,8 +96,7 @@ "Erho", dimMass/dimLength/sqr(dimTime), rhoEValue - ), - zeroGradientFvPatchField::typeName + ) ) ); } @@ -152,8 +150,7 @@ "nu", dimless, nuValue - ), - zeroGradientFvPatchField::typeName + ) ) ); } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H index 45327c2b4b..0c90a88532 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H @@ -75,8 +75,7 @@ if (thermalStress) "C", dimensionSet(0, 2, -2 , -1, 0), CValue - ), - zeroGradientFvPatchField::typeName + ) ) ); @@ -131,8 +130,7 @@ if (thermalStress) "rhoK", dimensionSet(1, 1, -3 , -1, 0), rhoKValue - ), - zeroGradientFvPatchField::typeName + ) ) ); @@ -188,8 +186,7 @@ if (thermalStress) "alpha", inv(dimTemperature), alphaValue - ), - zeroGradientFvPatchField::typeName + ) ) ); } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index 57f4e68589..49d62b804e 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,11 +42,11 @@ tractionDisplacementFvPatchVectorField ) : fixedGradientFvPatchVectorField(p, iF), - traction_(p.size(), vector::zero), + traction_(p.size(), Zero), pressure_(p.size(), 0.0) { fvPatchVectorField::operator=(patchInternalField()); - gradient() = vector::zero; + gradient() = Zero; } @@ -78,7 +78,7 @@ tractionDisplacementFvPatchVectorField pressure_("pressure", dict, p.size()) { fvPatchVectorField::operator=(patchInternalField()); - gradient() = vector::zero; + gradient() = Zero; } diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H index 169c7f229f..589566e3a1 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H @@ -14,6 +14,6 @@ if (!(runTime.timeIndex() % 5)) if (smi < -SMALL) { Info<< "Resetting Dcorr to 0" << endl; - Dcorr == dimensionedVector("0", Dcorr.dimensions(), vector::zero); + Dcorr == dimensionedVector("0", Dcorr.dimensions(), Zero); } } diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C index debf1ee9a3..33c1e8a8c6 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,11 +42,11 @@ tractionDisplacementCorrectionFvPatchVectorField ) : fixedGradientFvPatchVectorField(p, iF), - traction_(p.size(), vector::zero), + traction_(p.size(), Zero), pressure_(p.size(), 0.0) { fvPatchVectorField::operator=(patchInternalField()); - gradient() = vector::zero; + gradient() = Zero; } @@ -78,7 +78,7 @@ tractionDisplacementCorrectionFvPatchVectorField pressure_("pressure", dict, p.size()) { fvPatchVectorField::operator=(patchInternalField()); - gradient() = vector::zero; + gradient() = Zero; } diff --git a/applications/test/CompactListList/Test-CompactListList.C b/applications/test/CompactListList/Test-CompactListList.C index 13a73cde7b..9baf498faf 100644 --- a/applications/test/CompactListList/Test-CompactListList.C +++ b/applications/test/CompactListList/Test-CompactListList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,8 +56,8 @@ int main(int argc, char *argv[]) rowSizes[1] = row1.size(); cll1.resize(rowSizes); - cll1[0].assign(row0); //note: operator= will not work since UList - cll1[1].assign(row1); + cll1[0].deepCopy(row0); + cll1[1].deepCopy(row1); Info<< "cll1:" << cll1 << endl; forAll(cll1.m(), i) @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) } } - List > lll(5); + List> lll(5); lll[0].setSize(3, 0); lll[1].setSize(2, 1); lll[2].setSize(6, 2); @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) cll2(2, 3) = 999; Info<< "cll2(2, 3) = " << cll2(2, 3) << nl << endl; - Info<< "cll2 as List > " << cll2() + Info<< "cll2 as List> " << cll2() << endl; cll2.setSize(3); diff --git a/applications/test/Distribution/Test-Distribution.C b/applications/test/Distribution/Test-Distribution.C index 209f46a36c..f893e1e4bc 100644 --- a/applications/test/Distribution/Test-Distribution.C +++ b/applications/test/Distribution/Test-Distribution.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) << "Median " << dS.median() << endl; - reduce(dS, sumOp< Distribution >()); + reduce(dS, sumOp>()); if (Pstream::master()) { diff --git a/applications/test/DynamicList/Test-DynamicList.C b/applications/test/DynamicList/Test-DynamicList.C index 63f995d9a0..7b73a214c9 100644 --- a/applications/test/DynamicList/Test-DynamicList.C +++ b/applications/test/DynamicList/Test-DynamicList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,7 +71,7 @@ void printInfo int main(int argc, char *argv[]) { - List > ldl(2); + List> ldl(2); ldl[0](0) = 0; ldl[0](2) = 2; @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) } Info<< endl; - List > ll(2); + List> ll(2); ll[0].transfer(ldl[0]); ll[1].transfer(ldl[1].shrink()); diff --git a/applications/test/Function1/Make/files b/applications/test/Function1/Make/files new file mode 100644 index 0000000000..6647a7cbbe --- /dev/null +++ b/applications/test/Function1/Make/files @@ -0,0 +1,3 @@ +Test-Function1.C + +EXE = $(FOAM_USER_APPBIN)/Test-Function1 diff --git a/applications/test/dataEntry/Make/options b/applications/test/Function1/Make/options similarity index 100% rename from applications/test/dataEntry/Make/options rename to applications/test/Function1/Make/options diff --git a/applications/test/dataEntry/Test-DataEntry.C b/applications/test/Function1/Test-Function1.C similarity index 80% rename from applications/test/dataEntry/Test-DataEntry.C rename to applications/test/Function1/Test-Function1.C index 6223b2c6a7..ab4baee150 100644 --- a/applications/test/dataEntry/Test-DataEntry.C +++ b/applications/test/Function1/Test-Function1.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,15 +22,15 @@ License along with OpenFOAM. If not, see . Application - testDataEntry + Test-Function1 Description - Tests DataEntry + Tests Function1 \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "DataEntry.H" +#include "Function1.H" #include "IOdictionary.H" #include "linearInterpolationWeights.H" #include "splineInterpolationWeights.H" @@ -54,8 +54,8 @@ int main(int argc, char *argv[]) //values[0] = 0.0; //values[1] = 1.0; - //linearInterpolationWeights interpolator - splineInterpolationWeights interpolator + linearInterpolationWeights interpolator + //splineInterpolationWeights interpolator ( samples ); @@ -98,11 +98,11 @@ int main(int argc, char *argv[]) return 1; } - IOdictionary dataEntryProperties + IOdictionary function1Properties ( IOobject ( - "dataEntryProperties", + "function1Properties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, @@ -110,19 +110,19 @@ int main(int argc, char *argv[]) ) ); - autoPtr > dataEntry + autoPtr> function1 ( - DataEntry::New + Function1::New ( - "dataEntry", - dataEntryProperties + "function1", + function1Properties ) ); - scalar x0 = readScalar(dataEntryProperties.lookup("x0")); - scalar x1 = readScalar(dataEntryProperties.lookup("x1")); + scalar x0 = readScalar(function1Properties.lookup("x0")); + scalar x1 = readScalar(function1Properties.lookup("x1")); - Info<< "Data entry type: " << dataEntry().type() << nl << endl; + Info<< "Data entry type: " << function1().type() << nl << endl; Info<< "Inputs" << nl << " x0 = " << x0 << nl @@ -130,12 +130,12 @@ int main(int argc, char *argv[]) << endl; Info<< "Interpolation" << nl - << " f(x0) = " << dataEntry().value(x0) << nl - << " f(x1) = " << dataEntry().value(x1) << nl + << " f(x0) = " << function1().value(x0) << nl + << " f(x1) = " << function1().value(x1) << nl << endl; Info<< "Integration" << nl - << " int(f(x)) lim(x0->x1) = " << dataEntry().integrate(x0, x1) << nl + << " int(f(x)) lim(x0->x1) = " << function1().integrate(x0, x1) << nl << endl; return 0; diff --git a/applications/test/dataEntry/dataEntryProperties b/applications/test/Function1/function1Properties similarity index 92% rename from applications/test/dataEntry/dataEntryProperties rename to applications/test/Function1/function1Properties index faf14cc894..6023015c9c 100644 --- a/applications/test/dataEntry/dataEntryProperties +++ b/applications/test/Function1/function1Properties @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object dataEntryProperties; + object function1Properties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -19,7 +19,7 @@ x0 0.5; x1 1; -dataEntry table ((0 0)(10 1)); +function1 table ((0 0)(10 1)); // ************************************************************************* // diff --git a/applications/test/HashTable2/Test-HashTable2.C b/applications/test/HashTable2/Test-HashTable2.C index 79ff10de4c..0fb7b3a942 100644 --- a/applications/test/HashTable2/Test-HashTable2.C +++ b/applications/test/HashTable2/Test-HashTable2.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) Info<< "table1: " << table1 << nl << "toc: " << table1.toc() << endl; - HashTable > table2(10); + HashTable> table2(10); table2.insert(3, 10); table2.insert(5, 12); diff --git a/applications/test/HashTable3/Test-HashTable3.C b/applications/test/HashTable3/Test-HashTable3.C index 82e6ce3b9f..7184d30574 100644 --- a/applications/test/HashTable3/Test-HashTable3.C +++ b/applications/test/HashTable3/Test-HashTable3.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,9 +48,9 @@ int main(int argc, char *argv[]) // ie, a // Map