diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H index 31b817bf82..39694e106c 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H @@ -3,13 +3,12 @@ tmp UEqn ( fvm::div(phi, U) + + MRF.DDt(U) + turbulence->divDevReff(U) == fvOptions(U) ); - mrfZones.addCoriolis(UEqn()); - UEqn().relax(); // Include the porous media resistance and solve the momentum equation diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createZones.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createZones.H index 25c29f024c..399db198ab 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createZones.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/createZones.H @@ -1,5 +1,5 @@ - IOMRFZoneList mrfZones(mesh); - mrfZones.correctBoundaryVelocity(U); + IOMRFZoneList MRF(mesh); + MRF.correctBoundaryVelocity(U); IOporosityModelList pZones(mesh); Switch pressureImplicitPorosity(false); diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H index 07497dccc5..b4a0f2e668 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/pEqn.H @@ -11,7 +11,7 @@ else UEqn.clear(); surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf()); -mrfZones.makeRelative(phiHbyA); +MRF.makeRelative(phiHbyA); adjustPhi(phiHbyA, U, p); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/DDtU.H b/applications/solvers/multiphase/multiphaseEulerFoam/DDtU.H index dc39b70863..04b66a307a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/DDtU.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/DDtU.H @@ -7,5 +7,5 @@ forAllIter(PtrDictionary, fluid.phases(), iter) + fvc::div(phase.phi(), phase.U()) - fvc::div(phase.phi())*phase.U(); - mrfZones.addCoriolis(phase.U(), phase.DDtU()); + MRF.addAcceleration(phase.U(), phase.DDtU()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/MRFCorrectBCs.H b/applications/solvers/multiphase/multiphaseEulerFoam/MRFCorrectBCs.H new file mode 100644 index 0000000000..e871719cd8 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/MRFCorrectBCs.H @@ -0,0 +1,6 @@ + forAllIter(PtrDictionary, fluid.phases(), iter) + { + MRF.correctBoundaryVelocity(iter().U()); + } + + MRF.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H index 1dd551f8f2..6b9174def7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H @@ -1,4 +1,4 @@ -#include "mrfZonesCorrectBCs.H" +#include "MRFCorrectBCs.H" PtrList UEqns(fluid.phases().size()); autoPtr dragCoeffs(fluid.dragCoeffs()); @@ -51,7 +51,7 @@ forAllIter(PtrDictionary, fluid.phases(), iter) ) ) ); - mrfZones.addCoriolis + MRF.addAcceleration ( alpha*(1 + (1/phase.rho())*fluid.Cvm(phase)), UEqns[phasei] diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H index f78d168a6d..ea04f3efa0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H @@ -1,8 +1,8 @@ - IOMRFZoneList mrfZones(mesh); + IOMRFZoneList MRF(mesh); forAllIter(PtrDictionary, fluid.phases(), iter) { - mrfZones.correctBoundaryVelocity(iter().U()); + MRF.correctBoundaryVelocity(iter().U()); } - mrfZones.correctBoundaryVelocity(U); + MRF.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H b/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H deleted file mode 100644 index d670aa4a41..0000000000 --- a/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H +++ /dev/null @@ -1,6 +0,0 @@ - forAllIter(PtrDictionary, fluid.phases(), iter) - { - mrfZones.correctBoundaryVelocity(iter().U()); - } - - mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 5305e7387e..d2616fc556 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -35,8 +35,8 @@ { phaseModel& phase = iter(); - mrfZones.makeAbsolute(phase.phi().oldTime()); - mrfZones.makeAbsolute(phase.phi()); + MRF.makeAbsolute(phase.phi().oldTime()); + MRF.makeAbsolute(phase.phi()); HbyAs.set(phasei, new volVectorField(phase.U())); phiHbyAs.set(phasei, new surfaceScalarField(1.0*phase.phi())); @@ -100,9 +100,9 @@ (fvc::interpolate(HbyAs[phasei]) & mesh.Sf()) + rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi()) ); - mrfZones.makeRelative(phiHbyAs[phasei]); - mrfZones.makeRelative(phase.phi().oldTime()); - mrfZones.makeRelative(phase.phi()); + MRF.makeRelative(phiHbyAs[phasei]); + MRF.makeRelative(phase.phi().oldTime()); + MRF.makeRelative(phase.phi()); phiHbyAs[phasei] += rAlphaAUfs[phasei] @@ -205,7 +205,7 @@ ( p_rgh.boundaryField(), ( - phiHbyA.boundaryField() - mrfZones.relative(phib) + phiHbyA.boundaryField() - MRF.relative(phib) )/(mesh.magSf().boundaryField()*rAUf.boundaryField()) ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createMRFZones.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createMRFZones.H index 7b875a20e0..76f7193253 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/createMRFZones.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createMRFZones.H @@ -1,4 +1,4 @@ - IOMRFZoneList mrfZones(mesh); - mrfZones.correctBoundaryVelocity(U1); - mrfZones.correctBoundaryVelocity(U2); - mrfZones.correctBoundaryVelocity(U); + IOMRFZoneList MRF(mesh); + MRF.correctBoundaryVelocity(U1); + MRF.correctBoundaryVelocity(U2); + MRF.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/DDtU.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/DDtU.H index 1685caa588..0ade723a3b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/DDtU.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/DDtU.H @@ -3,11 +3,11 @@ fvc::ddt(U1) + fvc::div(phi1, U1) - fvc::div(phi1)*U1; - mrfZones.addCoriolis(U1, DDtU1); + MRF.addAcceleration(U1, DDtU1); DDtU2 = fvc::ddt(U2) + fvc::div(phi2, U2) - fvc::div(phi2)*U2; - mrfZones.addCoriolis(U2, DDtU2); + MRF.addAcceleration(U2, DDtU2); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H index 0814a162db..8e4af08112 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/UEqns.H @@ -1,6 +1,6 @@ -mrfZones.correctBoundaryVelocity(U1); -mrfZones.correctBoundaryVelocity(U2); -mrfZones.correctBoundaryVelocity(U); +MRF.correctBoundaryVelocity(U1); +MRF.correctBoundaryVelocity(U2); +MRF.correctBoundaryVelocity(U); fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVol/dimTime); fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime); @@ -15,7 +15,7 @@ volScalarField Kd(fluid.Kd()); ( fvm::ddt(alpha1, rho1, U1) + fvm::div(alphaRhoPhi1, U1) - fvm::Sp(contErr1, U1) - + mrfZones(alpha1*rho1 + Vm, U1) + + MRF.DDt(alpha1*rho1 + Vm, U1) + phase1.turbulence().divDevRhoReff(U1) == - Vm @@ -39,7 +39,7 @@ volScalarField Kd(fluid.Kd()); ( fvm::ddt(alpha2, rho2, U2) + fvm::div(alphaRhoPhi2, U2) - fvm::Sp(contErr2, U2) - + mrfZones(alpha2*rho2 + Vm, U2) + + MRF.DDt(alpha2*rho2 + Vm, U2) + phase2.turbulence().divDevRhoReff(U2) == - Vm diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H index 13cb589dfd..e629f37d46 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H @@ -92,8 +92,8 @@ while (pimple.correct()) #include "correctContErrs.H" // Correct fixed-flux BCs to be consistent with the velocity BCs - mrfZones.correctBoundaryFlux(U1, phi1); - mrfZones.correctBoundaryFlux(U2, phi2); + MRF.correctBoundaryFlux(U1, phi1); + MRF.correctBoundaryFlux(U2, phi2); volVectorField HbyA1 ( @@ -175,7 +175,7 @@ while (pimple.correct()) (fvc::interpolate(HbyA1) & mesh.Sf()) + phiCorrCoeff1*fvc::interpolate(alpha1.oldTime()*rho1.oldTime()*rAU1) *( - mrfZones.absolute(phi1.oldTime()) + MRF.absolute(phi1.oldTime()) - (fvc::interpolate(U1.oldTime()) & mesh.Sf()) )/runTime.deltaT() - phiF1() @@ -189,7 +189,7 @@ while (pimple.correct()) (fvc::interpolate(HbyA2) & mesh.Sf()) + phiCorrCoeff2*fvc::interpolate(alpha2.oldTime()*rho2.oldTime()*rAU2) *( - mrfZones.absolute(phi2.oldTime()) + MRF.absolute(phi2.oldTime()) - (fvc::interpolate(U2.oldTime()) & mesh.Sf()) )/runTime.deltaT() - phiF2() @@ -205,10 +205,10 @@ while (pimple.correct()) surfaceScalarField phiHbyA ( "phiHbyA", - alphaf1*(phiHbyA1 + rAUKd1*mrfZones.absolute(phi2)) - + alphaf2*(phiHbyA2 + rAUKd2*mrfZones.absolute(phi1)) + alphaf1*(phiHbyA1 + rAUKd1*MRF.absolute(phi2)) + + alphaf2*(phiHbyA2 + rAUKd2*MRF.absolute(phi1)) ); - mrfZones.makeRelative(phiHbyA); + MRF.makeRelative(phiHbyA); // Construct pressure "diffusivity" surfaceScalarField rAUf diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H index 36559ade99..7fccb4098e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/UEqns.H @@ -1,6 +1,6 @@ -mrfZones.correctBoundaryVelocity(U1); -mrfZones.correctBoundaryVelocity(U2); -mrfZones.correctBoundaryVelocity(U); +MRF.correctBoundaryVelocity(U1); +MRF.correctBoundaryVelocity(U2); +MRF.correctBoundaryVelocity(U); fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVol/dimTime); fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime); @@ -11,20 +11,20 @@ fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime); fvVectorMatrix UgradU1 ( fvm::div(phi1, U1) - fvm::Sp(fvc::div(phi1), U1) - + mrfZones(U1) + + MRF.DDt(U1) ); fvVectorMatrix UgradU2 ( fvm::div(phi2, U2) - fvm::Sp(fvc::div(phi2), U2) - + mrfZones(U2) + + MRF.DDt(U2) ); { U1Eqn = ( fvm::div(alphaRhoPhi1, U1) - fvm::Sp(fvc::div(alphaRhoPhi1), U1) - + mrfZones(alpha1*rho1, U1) + + MRF.DDt(alpha1*rho1, U1) + phase1.turbulence().divDevRhoReff(U1) + Vm*(UgradU1 - (UgradU2 & U2)) ); @@ -38,7 +38,7 @@ fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime); U2Eqn = ( fvm::div(alphaRhoPhi2, U2) - fvm::Sp(fvc::div(alphaRhoPhi2), U2) - + mrfZones(alpha2*rho2, U2) + + MRF.DDt(alpha2*rho2, U2) + phase2.turbulence().divDevRhoReff(U2) + Vm*(UgradU2 - (UgradU1 & U1)) ); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H index bb0b5f528f..69eb3a7e20 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H @@ -99,8 +99,8 @@ while (pimple.correct()) surfaceScalarField rhof2(fvc::interpolate(rho2)); // Correct fixed-flux BCs to be consistent with the velocity BCs - mrfZones.correctBoundaryFlux(U1, phi1); - mrfZones.correctBoundaryFlux(U2, phi2); + MRF.correctBoundaryFlux(U1, phi1); + MRF.correctBoundaryFlux(U2, phi2); surfaceScalarField alpharAUf1 ( @@ -155,10 +155,10 @@ while (pimple.correct()) rAUf1 *( (alphaRhof10 + Vmf) - *mrfZones.absolute(phi1.oldTime())/runTime.deltaT() + *MRF.absolute(phi1.oldTime())/runTime.deltaT() + (fvc::interpolate(U1Eqn.H()) & mesh.Sf()) + Vmf*ddtPhi2 - + Kdf*mrfZones.absolute(phi2) + + Kdf*MRF.absolute(phi2) - Ff1() ); @@ -173,10 +173,10 @@ while (pimple.correct()) rAUf2 *( (alphaRhof20 + Vmf) - *mrfZones.absolute(phi2.oldTime())/runTime.deltaT() + *MRF.absolute(phi2.oldTime())/runTime.deltaT() + (fvc::interpolate(U2Eqn.H()) & mesh.Sf()) + Vmf*ddtPhi1 - + Kdf*mrfZones.absolute(phi1) + + Kdf*MRF.absolute(phi1) - Ff2() ); @@ -186,7 +186,7 @@ while (pimple.correct()) "phiHbyA", alphaf1*(phiHbyA1 - phig1) + alphaf2*(phiHbyA2 - phig2) ); - mrfZones.makeRelative(phiHbyA); + MRF.makeRelative(phiHbyA); phiHbyA1 -= phig1; phiHbyA2 -= phig2; @@ -296,14 +296,14 @@ while (pimple.correct()) ( phiHbyA1 + alpharAUf1*mSfGradp - - rAUf1*Kdf*mrfZones.absolute(phi2) + - rAUf1*Kdf*MRF.absolute(phi2) ); surfaceScalarField phi2s ( phiHbyA2 + alpharAUf2*mSfGradp - - rAUf2*Kdf*mrfZones.absolute(phi1) + - rAUf2*Kdf*MRF.absolute(phi1) ); surfaceScalarField phir @@ -315,11 +315,11 @@ while (pimple.correct()) phi1 = phi - alphaf2*phir; phi2 = phi + alphaf1*phir; - U1 = fvc::reconstruct(mrfZones.absolute(phi1)); + U1 = fvc::reconstruct(MRF.absolute(phi1)); U1.correctBoundaryConditions(); fvOptions.correct(U1); - U2 = fvc::reconstruct(mrfZones.absolute(phi2)); + U2 = fvc::reconstruct(MRF.absolute(phi2)); U2.correctBoundaryConditions(); fvOptions.correct(U2); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C index b14524a676..fc36a25f34 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C @@ -126,20 +126,20 @@ bool Foam::MRFZoneList::writeData(Ostream& os) const } -void Foam::MRFZoneList::addCoriolis +void Foam::MRFZoneList::addAcceleration ( const volVectorField& U, volVectorField& ddtU ) const { forAll(*this, i) - { + { operator[](i).addCoriolis(U, ddtU); } } -void Foam::MRFZoneList::addCoriolis(fvVectorMatrix& UEqn) const +void Foam::MRFZoneList::addAcceleration(fvVectorMatrix& UEqn) const { forAll(*this, i) { @@ -148,7 +148,7 @@ void Foam::MRFZoneList::addCoriolis(fvVectorMatrix& UEqn) const } -void Foam::MRFZoneList::addCoriolis +void Foam::MRFZoneList::addAcceleration ( const volScalarField& rho, fvVectorMatrix& UEqn @@ -161,7 +161,7 @@ void Foam::MRFZoneList::addCoriolis } -Foam::tmp Foam::MRFZoneList::operator() +Foam::tmp Foam::MRFZoneList::DDt ( const volVectorField& U ) @@ -191,13 +191,13 @@ Foam::tmp Foam::MRFZoneList::operator() } -Foam::tmp Foam::MRFZoneList::operator() +Foam::tmp Foam::MRFZoneList::DDt ( const volScalarField& rho, const volVectorField& U ) { - return rho*operator()(U); + return rho*DDt(U); } diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H index 6f33035585..252f01c043 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H @@ -93,23 +93,31 @@ public: //- Reset the source list void reset(const dictionary& dict); - //- Add the Coriolis force contribution to the acceleration field - void addCoriolis(const volVectorField& U, volVectorField& ddtU) const; + //- Add the frame acceleration + void addAcceleration + ( + const volVectorField& U, + volVectorField& ddtU + ) const; - //- Add the Coriolis force contribution to the momentum equation - void addCoriolis(fvVectorMatrix& UEqn) const; + //- Add the frame acceleration contribution to the momentum equation + void addAcceleration(fvVectorMatrix& UEqn) const; - //- Add the Coriolis force contribution to the momentum equation - void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const; + //- Add the frame acceleration contribution to the momentum equation + void addAcceleration + ( + const volScalarField& rho, + fvVectorMatrix& UEqn + ) const; //- Return the frame acceleration - tmp operator() + tmp DDt ( const volVectorField& U ); - //- Return the frame acceleration force - tmp operator() + //- Return the frame acceleration + tmp DDt ( const volScalarField& rho, const volVectorField& U