diff --git a/applications/solvers/combustion/XiFoam/XiEngineFoam/pEqn.H b/applications/solvers/combustion/XiFoam/XiEngineFoam/pEqn.H index aca8c2c11a3660eca549c64d4cafbf7eba14f878..fedaea7106779c6da777cc654fb3fe3770d2f547 100644 --- a/applications/solvers/combustion/XiFoam/XiEngineFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/XiEngineFoam/pEqn.H @@ -13,7 +13,10 @@ if (pimple.transonic()) *( ( fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) + + MRF.zeroFilter + ( + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) + ) ) ) ); @@ -47,7 +50,7 @@ else "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, rhoUf) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf)) ) ); diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 0d42787fff0b25313dbaad47fedb0e5a8356e5d3..19cafee7cea7b22e998dc92130bbd48f287864f1 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -11,7 +11,7 @@ surfaceScalarField phiHbyA "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)) ) + phig ); diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 36f3e777530b11439c4fda6bc1c2730a32d1f19c..f4ff96931bdd8df2e8fd2553c03bfe8213c9059d 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -17,7 +17,10 @@ if (pimple.transonic()) fvc::interpolate(psi) *( fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + + MRF.zeroFilter + ( + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + ) ) ); @@ -49,7 +52,7 @@ else "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)) ) ); diff --git a/applications/solvers/combustion/reactingFoam/pcEqn.H b/applications/solvers/combustion/reactingFoam/pcEqn.H index a1564b0f204ce1d212ae69aa039b29a38ef6676f..5ca9b4adca1f940f1ef1167a2336e5117a62d229 100644 --- a/applications/solvers/combustion/reactingFoam/pcEqn.H +++ b/applications/solvers/combustion/reactingFoam/pcEqn.H @@ -17,8 +17,11 @@ if (pimple.transonic()) fvc::interpolate(psi) *( fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) - /fvc::interpolate(rho) + + MRF.zeroFilter + ( + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) + /fvc::interpolate(rho) + ) ) ); @@ -61,7 +64,7 @@ else "phiHbyA", ( fvc::flux(rho*HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)) ) ); diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H index 04296ddfc2c53d13dd5fa4f5433e91f6bcb7557f..d5feab6e538b07d0f5b487346004604390c8dd76 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H @@ -15,7 +15,7 @@ surfaceScalarField phiHbyA "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)) ) + phig ); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index f54376ffadf69e78fdfb52063e48baf4af8fe7ae..f2f2c5c71c72a3866a2e1b0ef295a3d32ef42c0d 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -20,7 +20,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", fvc::interpolate(rho)*fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf)) ); fvc::makeRelative(phiHbyA, rho, U); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H index 7ac95a9c5bf099db2a5b0fc2f278782a1c631fc9..868124655382da67cd0b9841ff355a6f76ad9e84 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H @@ -21,7 +21,10 @@ surfaceScalarField phiHbyA "phiHbyA", ( fvc::interpolate(rho)*fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi, rhoUf) + + MRF.zeroFilter + ( + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi, rhoUf) + ) ) ); diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H index bd553928b16db9d153091432a2ec9f8c046e0443..50a9ff240dcf77c3289fc161592381eda2275f29 100644 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -9,7 +9,7 @@ surfaceScalarField phid fvc::interpolate(psi) *( fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)) ) ); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H index 51d9461c87c7c76797c51198594a4b787de8d3d5..0eeb6e15a3fce7c00c2f4c33854c6e625d016ad3 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H @@ -9,7 +9,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + rAUf*fvc::ddtCorr(U, phi) + + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, phi)) + phig ); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 677fabffd5614bef92210a9a51b9585bbcbfacc1..9a2553a7e9809e5e40beb0f3ef230cf38f818f53 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -19,7 +19,7 @@ surfaceScalarField phiHbyA "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)) ) + phig ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index dc67ab09e20d88a3f05242417bed3905a4a4c439..9bc978b2540c6fa397f9aa2db12eb9ba7f8b3a48 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -19,7 +19,7 @@ surfaceScalarField phiHbyA "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)) ) + phig ); diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index df19741c508640f2030b476f2abc04f2b6c93569..e3c61fe37da88f90ab2907b813b55dd81eed85ad 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -4,7 +4,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf) + + MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi, Uf)) ); MRF.makeRelative(phiHbyA); diff --git a/applications/solvers/incompressible/pisoFoam/pEqn.H b/applications/solvers/incompressible/pisoFoam/pEqn.H index 05c34376ece0c21e97e8558f46daaa64b17c7ff0..866d84e94571f60e8a1621e7676775d08908da99 100644 --- a/applications/solvers/incompressible/pisoFoam/pEqn.H +++ b/applications/solvers/incompressible/pisoFoam/pEqn.H @@ -4,7 +4,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) + + MRF.zeroFilter(fvc::interpolate(rAU)*fvc::ddtCorr(U, phi)) ); MRF.makeRelative(phiHbyA); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 4f6eaf3550cc92ec09f807e6b067b37819b7b6e9..0182e453ba1324cfc1ab28b5ec9322c62e837208 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -12,7 +12,10 @@ if (pimple.transonic()) fvc::interpolate(psi) *( fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + + MRF.zeroFilter + ( + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + ) ) ); @@ -45,7 +48,7 @@ else "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)) ) ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 588273cf54393ae2cd8ad7fbd1ce4cbf76e39e10..b6854000777335e3126e72438844a73836ede8f0 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -18,7 +18,7 @@ surfaceScalarField phiHbyA "phiHbyA", ( fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi)) ) + phig ); diff --git a/applications/solvers/lagrangian/sprayFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/pEqn.H index b15fb81e13b3a26efa12c6b113109134f0f65af2..10c49d18117a0a31d4d149b61f4aa16446111897 100644 --- a/applications/solvers/lagrangian/sprayFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/pEqn.H @@ -20,7 +20,10 @@ if (pimple.transonic()) fvc::interpolate(psi) *( fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + + MRF.zeroFilter + ( + rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) + ) ) ); diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H index 90033814d33112aa720d016d1f901077ebd095a2..a08bcf9fd10f3bb3e927bbccac2a9927b771270b 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/pEqn.H @@ -20,7 +20,10 @@ if (pimple.transonic()) fvc::interpolate(psi) *( fvc::flux(HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) + + MRF.zeroFilter + ( + rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho) + ) ) ); @@ -53,7 +56,7 @@ else ( "phiHbyA", fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, rhoUf) + + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf)) ); fvc::makeRelative(phiHbyA, rho, U); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H index c34676157a86becb8bb99843c43490f1e691b10a..d4c0f41aab897174f9f69176c9aa8c6bff0ae5c2 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H @@ -6,7 +6,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf) + + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf)) ); MRF.makeRelative(phiHbyA); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H index 7867727f869ef8d870401536120e41bd0ee8b8c4..5cdd9737d0cdc4caf1158a2fdb48455e3108b676 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H @@ -6,7 +6,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) + + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)) ); MRF.makeRelative(phiHbyA); diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index e7f00b91a1a5282eeb77e7151d22ca0d04e827fc..5854748e99b83398c49cc52a2fce4c0666c80eb7 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -6,7 +6,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) + + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)) ); MRF.makeRelative(phiHbyA); diff --git a/applications/solvers/multiphase/driftFluxFoam/pEqn.H b/applications/solvers/multiphase/driftFluxFoam/pEqn.H index 6797c44ccb6d6200e7be67f0197cf032d803379e..7a2be2efd05b733fd97bf3624c139a2933a8b739 100644 --- a/applications/solvers/multiphase/driftFluxFoam/pEqn.H +++ b/applications/solvers/multiphase/driftFluxFoam/pEqn.H @@ -6,7 +6,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) + + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)) ); MRF.makeRelative(phiHbyA); adjustPhi(phiHbyA, U, p_rgh); diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 5aecb2df273d5ef0ad296ee7b0da2e1355ea9e97..e443f269848af443a24bff674a839ac86e245ad3 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -14,7 +14,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + fvc::interpolate(rho*rAU())*fvc::ddtCorr(U, phi, Uf) + + MRF.zeroFilter(fvc::interpolate(rho*rAU())*fvc::ddtCorr(U, phi, Uf)) ); MRF.makeRelative(phiHbyA); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index ad92a797183a0bbf22249a7b7334dba20339f2c7..6c2612b2319db79fb245bae76e3705a925962acf 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -98,7 +98,10 @@ phiHbyAs[phasei] = ( fvc::flux(HbyAs[phasei]) - + rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi()) + + MRF.zeroFilter + ( + rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi()) + ) ); MRF.makeRelative(phiHbyAs[phasei]); MRF.makeRelative(phase.phi().oldTime()); diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H index 76a44bd13489c348aa5720e00f7c2ea67eddc180..0e259d880925f241db007f841548d2e2ef9ed1c0 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H @@ -11,7 +11,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", fvc::flux(HbyA) - + rAUf*fvc::ddtCorr(U, phi) + + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, phi)) ); MRF.makeRelative(phiHbyA); diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H index dac95a197465195446a47e6148ad796c5a969f14..9f7da03a11c28a750ec91642f0460e8f5e07a94f 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceDyMFoam/pEqn.H @@ -12,7 +12,7 @@ ( "phiHbyA", fvc::flux(HbyA) - + rAUf*fvc::ddtCorr(U, Uf) + + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, Uf)) ); MRF.makeRelative(phiHbyA); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index 2a1f0a867862388088301f9154dc033fe0914bfa..a50733afcc9466e3c8216fecad13a4100ae5fb09 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -257,6 +257,10 @@ public: //- Correct the boundary velocity for the rotation of the MRF region void correctBoundaryVelocity(volVectorField& U) const; + //- Zero the MRF region of the given field + template<class Type> + void zero(GeometricField<Type, fvsPatchField, surfaceMesh>& phi) const; + //- Update MRFZone faces if the mesh topology changes void update(); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H index 4c0fffbe2f8d895dc5d411ab544dc72ef77965a3..7d9866261e222fd54a698929e0d4cf051e968172 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -184,6 +184,14 @@ public: surfaceScalarField& phi ) const; + //- Filter-out the MRF region contribution from the given field + // setting the corresponding values to zero + template<class Type> + tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> zeroFilter + ( + const tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>& tphi + ) const; + //- Update MRFZone faces if the mesh topology changes void update(); @@ -210,6 +218,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "MRFZoneListTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneListTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneListTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..28a7662ed5a55a5431f84c0fe87654691aab145c --- /dev/null +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneListTemplates.C @@ -0,0 +1,64 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2018 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "MRFZoneList.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>> +Foam::MRFZoneList::zeroFilter +( + const tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>& tphi +) const +{ + if (size()) + { + tmp<surfaceScalarField> zphi + ( + New + ( + tphi, + "zeroFilter(" + tphi().name() + ')', + tphi().dimensions(), + true + ) + ); + + forAll(*this, i) + { + operator[](i).zero(zphi.ref()); + } + + return zphi; + } + else + { + return tmp<surfaceScalarField>(tphi, true); + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C index 0a591035d6d3305a5bd8af6486006470a93fcff7..30df24cf8f59199c96a8b31a65bc1a298e2bac15 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -207,4 +207,43 @@ void Foam::MRFZone::makeAbsoluteRhoFlux } +template<class Type> +void Foam::MRFZone::zero +( + GeometricField<Type, fvsPatchField, surfaceMesh>& phi +) const +{ + if (!active_) + { + return; + } + + Field<Type>& phii = phi.primitiveFieldRef(); + + forAll(internalFaces_, i) + { + phii[internalFaces_[i]] = Zero; + } + + typename GeometricField<Type, fvsPatchField, surfaceMesh>::Boundary& phibf = + phi.boundaryFieldRef(); + + forAll(includedFaces_, patchi) + { + forAll(includedFaces_[patchi], i) + { + phibf[patchi][includedFaces_[patchi][i]] = Zero; + } + } + + forAll(excludedFaces_, patchi) + { + forAll(excludedFaces_[patchi], i) + { + phibf[patchi][excludedFaces_[patchi][i]] = Zero; + } + } +} + + // ************************************************************************* //