diff --git a/applications/solvers/DNS/dnsFoam/dnsFoam.C b/applications/solvers/DNS/dnsFoam/dnsFoam.C index 08073398a76a85f0009708a015f74fb4863a41ad..c29d45109150fbcfb45728cdf3bd6ce93f619157 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-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,7 +85,8 @@ int main(int argc, char *argv[]) for (int corr=1; corr<=1; corr++) { - volScalarField rAU("Dp", 1.0/UEqn.A()); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -93,12 +94,12 @@ int main(int argc, char *argv[]) ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + Dp*fvc::ddtCorr(U, phi) ); fvScalarMatrix pEqn ( - fvm::laplacian(rAU, p) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p) == fvc::div(phiHbyA) ); pEqn.solve(); diff --git a/applications/solvers/combustion/PDRFoam/pEqn.H b/applications/solvers/combustion/PDRFoam/pEqn.H index e1c4274f3387945b31a17fa41fbd6164ea64faf9..3053d4c68c8e1da8f8add54233d7b1fb5431ff90 100644 --- a/applications/solvers/combustion/PDRFoam/pEqn.H +++ b/applications/solvers/combustion/PDRFoam/pEqn.H @@ -1,6 +1,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); + volVectorField HbyA("HbyA", U); HbyA = invA & UEqn.H(); @@ -11,9 +12,9 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); while (pimple.correctNonOrthogonal()) @@ -38,10 +39,9 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho)* ( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) ) ); diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index c1effcd60d089adeeb17c6a071da4f52f6a837b5..83a44ab7c2284f5c60dc66a6bd6714d16464dd09 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -1,6 +1,8 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -11,9 +13,9 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); @@ -24,7 +26,7 @@ if (pimple.transonic()) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == fvOptions(psi, p, rho.name()) ); @@ -44,10 +46,9 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); @@ -59,7 +60,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == fvOptions(psi, p, rho.name()) ); diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index 39939333c207c56a5739b08035f06c5e4bd40b44..a92e7285ab2cef90d59b7f9aed3f165b5b5ecfd4 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -1,6 +1,8 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -10,7 +12,13 @@ if (pimple.transonic()) ( "phid", fvc::interpolate(psi) - *((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U)) + *( + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + //***HGW + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) + - fvc::meshPhi(rho, U) + ) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); @@ -41,8 +49,11 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U)) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + //***HGW + Dp*fvc::ddtCorr(rho, U, phi) + ) + - fvc::interpolate(rho)*fvc::meshPhi(rho, U) ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 9953e83007a5c259fba22385a89a293023ddadb6..c98ac61f3b491d48df16df2c3a015e732d80c550 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -1,22 +1,22 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); -surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU)); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); phi.boundaryField() = fvc::interpolate(rho.boundaryField()*U.boundaryField()) & mesh.Sf().boundaryField(); -surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); +surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) + phig ); @@ -30,7 +30,7 @@ while (pimple.correctNonOrthogonal()) fvc::ddt(psi, rho)*gh + fvc::div(phiHbyA) + fvm::ddt(psi, p_rgh) - - fvm::laplacian(rhorAUf, p_rgh) + - fvm::laplacian(Dp, p_rgh) == parcels.Srho() + surfaceFilm.Srho() @@ -44,7 +44,7 @@ while (pimple.correctNonOrthogonal()) if (pimple.finalNonOrthogonalIter()) { phi = phiHbyA + p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf); + U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 0a8a6ce9d04a4ba13dbb1267e410787547c9bb62..0dc5d422db91a34d183d06e3a2b63afe80bcb8b8 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -1,6 +1,8 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -11,9 +13,9 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); @@ -44,10 +46,9 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H index 7f312e5030e046b5880b156987aef2db801045ef..8602725bdb47d3885b91804bf4b8768e0792202c 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/pEqn.H @@ -6,20 +6,19 @@ thermo.rho() -= psi*p; volScalarField rAU(1.0/UEqn.A()); - surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); - surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); + surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) + phig ); @@ -39,7 +38,7 @@ fvScalarMatrix p_rghEqn ( p_rghDDtEqn - - fvm::laplacian(rhorAUf, p_rgh) + - fvm::laplacian(Dp, p_rgh) ); fvOptions.constrain(p_rghEqn); @@ -56,7 +55,7 @@ // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure - U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); + U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); K = 0.5*magSqr(U); diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H index 461e1ca8fbef7cdf3b89febc784b60e302ae5832..3c92ce8119733f0aa2c6de45e86b147d2894b900 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/pEqn.H @@ -6,6 +6,8 @@ thermo.rho() -= psi*p; volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -14,8 +16,10 @@ surfaceScalarField phiHbyA ( "phiHbyA", - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(phiHbyA); @@ -35,7 +39,7 @@ fvScalarMatrix pEqn ( pDDtEqn - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == fvOptions(psi, p, rho.name()) ); @@ -55,10 +59,9 @@ surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); @@ -77,7 +80,7 @@ fvScalarMatrix pEqn ( pDDtEqn - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); fvOptions.constrain(pEqn); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index fcc40881a1deeef5d248c78d6d734af131922cd1..373bafcd3b85bedfadac2f5b0adf31dd3da761b5 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -4,6 +4,8 @@ rho = min(rho, rhoMax); rho.relax(); volScalarField rAU(1.0/UEqn().A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn().H(); @@ -19,15 +21,13 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); - volScalarField Dp("Dp", rho*rAU); - while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -54,10 +54,9 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index c1ceb88c174555758fa5f2d10ead31f1aaee7845..d2681663e634b33de6d1c6da211417b28f9a9ffc 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -4,6 +4,8 @@ rho = min(rho, rhoMax); rho.relax(); volScalarField rAU(1.0/UEqn().A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn().H(); @@ -19,15 +21,13 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phiAbs) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phiAbs) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); - volScalarField Dp("Dp", rho*rAU); - while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -54,18 +54,12 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - - fvc::meshPhi(rho, U) - + fvc::ddtPhiCorr(rAU, rho, U, phiAbs) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phiAbs) ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); - volScalarField Dp("Dp", rho*rAU); - while (pimple.correctNonOrthogonal()) { // Pressure corrector diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C index fb74f2b39a932df9184b940a085d8de1f6dde755..dac6980917aca96776c2088fb8fc953a24948602 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) #include "CourantNo.H" #include "setInitialDeltaT.H" - // Create old-time absolute flux for ddtPhiCorr + // Create old-time absolute flux for ddtCorr surfaceScalarField phiAbs("phiAbs", phi); @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) // Make the fluxes absolute before mesh-motion fvc::makeAbsolute(phi, rho, U); - // Update absolute flux for ddtPhiCorr + // Update absolute flux for ddtCorr phiAbs = phi; #include "setDeltaT.H" diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H index de09cb53e223e002b183881c42e7ea26ccbe8629..f8837f0aa4d532d742dfa5c4f211235565a76c70 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H @@ -20,9 +20,9 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); @@ -64,10 +64,9 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi) ) ); diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 364d26a50b394d0b21c4088c75675170706e3d86..444f5e996aad7b4d746f718dff10d531271590d9 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -12,7 +12,9 @@ surfaceScalarField phid ( "phid", - fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf()) + fvc::interpolate(psi) + *(fvc::interpolate(rho*HbyA) & mesh.Sf()) + /fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); @@ -47,7 +49,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) + fvc::interpolate(rho*HbyA) & mesh.Sf() ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H index 353593b7f4091db1e9f357dba3115a6a16e7afce..d61a80ffa8114e199e731494f98a1f09cb74da3a 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H @@ -13,7 +13,9 @@ if (simple.transonic()) surfaceScalarField phid ( "phid", - fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf()) + fvc::interpolate(psi) + *(fvc::interpolate(rho*HbyA) & mesh.Sf()) + /fvc::interpolate(rho) ); surfaceScalarField phic @@ -57,7 +59,7 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) + fvc::interpolate(rho*HbyA) & mesh.Sf() ); closedVolume = adjustPhi(phiHbyA, U, p); diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H index 4d700b3a41ee5a84b9e05663d46fd9a70c8d07de..2832bf421a989214922e0a9aacc2a3984a98abed 100644 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -1,22 +1,21 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); surfaceScalarField phid ( "phid", - fvc::interpolate(psi) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + fvc::interpolate(psi)* + ( + (mesh.Sf() & fvc::interpolate(rho*HbyA)) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); - -volScalarField Dp("Dp", rho*rAU); - // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/createRhoUf.H b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/createRhoUf.H new file mode 100644 index 0000000000000000000000000000000000000000..bb05d10f660b09b1dbb655fd2c3f7d4a9622f26d --- /dev/null +++ b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/createRhoUf.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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/>. + +Global + createUf + +Description + Creates and initialises the velocity velocity field Uf. + +\*---------------------------------------------------------------------------*/ + +#ifndef createUf_H +#define createUf_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Info<< "Reading/calculating face velocity rhoUf\n" << endl; + +surfaceVectorField rhoUf +( + IOobject + ( + "rhoUf", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(rho*U) +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H index 21dc48614ec948ebd3d51c6fb22556aefdf85c5b..91becd8aa16fdf5ed7203c3e6a8eb80a83ff2f7c 100644 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H @@ -1,6 +1,8 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,13 +11,14 @@ surfaceScalarField phid "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + //***HGW + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) - fvc::meshPhi(rho, U) ) ); -volScalarField Dp("Dp", rho*rAU); - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C index 2f7ac9962a0e6c485310268d11d029ebb0608b6d..11ec1de915e09c0d7c93fce3e04e9b7b652fe28b 100644 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.C +++ b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/sonicDyMFoam.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,6 +44,7 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "createFields.H" + #include "createRhoUf.H" #include "initContinuityErrs.H" pimpleControl pimple(mesh); @@ -63,6 +64,12 @@ int main(int argc, char *argv[]) mesh.movePoints(motionPtr->newPoints()); + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & rhoUf; + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, rho, U); + #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C index 1ac1ae4ae389cf45612b9364fb783212f6bc7f32..2a0b08074a31260b5e4a81e3c1b9caf8fd36a4be 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-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,6 +76,8 @@ int main(int argc, char *argv[]) while (pimple.correct()) { volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + U = rAU*UEqn.H(); surfaceScalarField phid @@ -83,13 +85,12 @@ int main(int argc, char *argv[]) "phid", psi *( - (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*U) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); phi = (rhoO/psi)*phid; - volScalarField Dp("Dp", rho*rAU); fvScalarMatrix pEqn ( diff --git a/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C b/applications/solvers/electromagnetics/mhdFoam/mhdFoam.C index 51f04820eb29daf6fc66832af225b091028569ec..945aab6ba32a60642f1c414f0e28a3df35167c67 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 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,6 +93,8 @@ int main(int argc, char *argv[]) for (int corr=0; corr<nCorr; corr++) { volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -100,14 +102,14 @@ int main(int argc, char *argv[]) ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + Dp*fvc::ddtCorr(U, phi) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( - fvm::laplacian(rAU, p) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p) == fvc::div(phiHbyA) ); pEqn.setReference(pRefCell, pRefValue); @@ -140,14 +142,15 @@ int main(int argc, char *argv[]) BEqn.solve(); - volScalarField rBA(1.0/BEqn.A()); + volScalarField rAB(1.0/BEqn.A()); + surfaceScalarField DpB("DpB", fvc::interpolate(rAB)); phiB = (fvc::interpolate(B) & mesh.Sf()) - + fvc::ddtPhiCorr(rBA, B, phiB); + + DpB*fvc::ddtCorr(B, phiB); fvScalarMatrix pBEqn ( - fvm::laplacian(rBA, pB) == fvc::div(phiB) + fvm::laplacian(DpB, pB) == fvc::div(phiB) ); pBEqn.solve(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H index 0b7ec84dfea4f8a81ea916d2babd8933c06eaa02..94299b84af182f22d17fc30b11de8581cfa40ea3 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H @@ -1,17 +1,17 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); - surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); + surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rhok)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + Dp*fvc::ddtCorr(U, phi) + phig ); @@ -19,7 +19,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -36,7 +36,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())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index cc66c5cca0996e227349c8e76209b8fdb16be8dc..ad98545b4076f89b412a0c33c992523a28c24c2c 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -6,20 +6,19 @@ thermo.rho() -= psi*p_rgh; volScalarField rAU(1.0/UEqn.A()); - surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); - surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); + surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*U) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) + phig ); @@ -39,7 +38,7 @@ fvScalarMatrix p_rghEqn ( p_rghDDtEqn - - fvm::laplacian(rhorAUf, p_rgh) + - fvm::laplacian(Dp, p_rgh) ); fvOptions.constrain(p_rghEqn); @@ -56,7 +55,7 @@ // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure - U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); + U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); K = 0.5*magSqr(U); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 482642bde81b432b4594ccfa0ed0a1e1735bdc09..41c8900dc086833f35f3344ea10ea356dde21caa 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -14,7 +14,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H index 6e14684ee6e192b207293989c6e4a5f93b030681..f42ed7e39ceaf313a3decd035ac5e1ac60dddf78 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H @@ -16,7 +16,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index d5346be47d2c784b095a600f2e2ddf1aed857811..a712250f35646fd393a0a33d02087fab66a1014f 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -6,20 +6,19 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn().A()); - surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn().H(); - surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); + surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) + phig ); @@ -42,7 +41,7 @@ fvScalarMatrix p_rghEqn ( p_rghDDtEqn - - fvm::laplacian(rhorAUf, p_rgh) + - fvm::laplacian(Dp, p_rgh) ); p_rghEqn.solve @@ -64,7 +63,7 @@ { phi = phiHbyA + p_rghEqn.flux(); U = HbyA - + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); + + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); K = 0.5*magSqr(U); diff --git a/applications/solvers/incompressible/icoFoam/icoFoam.C b/applications/solvers/incompressible/icoFoam/icoFoam.C index f37b4b9facb9884fa01c8d40e52cf8a6e07fd457..78fa851e67dff4268ccfc7e2375d55f78e6e8977 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-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p); diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C index bf12294638d314c0b7d96d241afaea4c23e0b2ce..30a73b70a6c06241884492cf3879e412cd3f0c0b 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-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p); diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H index 8aa20cd151820ef2aac265387efacce7cac58798..d5c38e72ed64736462aa9c966f4967976ab8f4eb 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H @@ -11,7 +11,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAUrel, Urel, phi) + + fvc::interpolate(rAUrel)*fvc::ddtCorr(Urel, phi) ); adjustPhi(phiHbyA, Urel, p); diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index a7f5edf1a6205cb1eb5cb052f153aeff10a25d2f..6824d8ee0c7564f543e10f8f741106e4595d87c8 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -1,3 +1,5 @@ +surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn().H(); @@ -10,7 +12,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + Dp*fvc::ddtCorr(U, phi) ); fvOptions.makeRelative(phiHbyA); @@ -23,7 +25,7 @@ while (pimple.correctNonOrthogonal()) // Pressure corrector fvScalarMatrix pEqn ( - fvm::laplacian(rAU, p) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p) == fvc::div(phiHbyA) ); pEqn.setReference(pRefCell, pRefValue); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H index e1e897c18b2dadb36de44744b6a2c69a01868290..ebc62e7e592ae319d8019c409d59b26295d4839c 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H @@ -1,27 +1,27 @@ +if (mesh.changing()) { - if (mesh.changing()) + forAll(U.boundaryField(), patchI) { - forAll(U.boundaryField(), patchI) + if (U.boundaryField()[patchI].fixesValue()) { - if (U.boundaryField()[patchI].fixesValue()) - { - U.boundaryField()[patchI].initEvaluate(); - } + U.boundaryField()[patchI].initEvaluate(); } + } - forAll(U.boundaryField(), patchI) + forAll(U.boundaryField(), patchI) + { + if (U.boundaryField()[patchI].fixesValue()) { - if (U.boundaryField()[patchI].fixesValue()) - { - U.boundaryField()[patchI].evaluate(); - - phi.boundaryField()[patchI] = - U.boundaryField()[patchI] - & mesh.Sf().boundaryField()[patchI]; - } + U.boundaryField()[patchI].evaluate(); + + phi.boundaryField()[patchI] = + U.boundaryField()[patchI] + & mesh.Sf().boundaryField()[patchI]; } } +} +{ volScalarField pcorr ( IOobject diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H deleted file mode 100644 index 082ec86ea8ef5ca8dc9ce468bddf967e3b3ce80c..0000000000000000000000000000000000000000 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H +++ /dev/null @@ -1,42 +0,0 @@ - Info<< "Reading field p\n" << endl; - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - - Info<< "Reading field U\n" << endl; - volVectorField U - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - #include "createPhi.H" - - - label pRefCell = 0; - scalar pRefValue = 0.0; - setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); - - singlePhaseTransportModel laminarTransport(U, phi); - - autoPtr<incompressible::turbulenceModel> turbulence - ( - incompressible::turbulenceModel::New(U, phi, laminarTransport) - ); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createUf.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createUf.H new file mode 100644 index 0000000000000000000000000000000000000000..aab92ce0e2aec37304bd634f72bcbee68ed80189 --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createUf.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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/>. + +Global + createUf + +Description + Creates and initialises the velocity velocity field Uf. + +\*---------------------------------------------------------------------------*/ + +#ifndef createUf_H +#define createUf_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Info<< "Reading/calculating face velocity Uf\n" << endl; + +surfaceVectorField Uf +( + IOobject + ( + "Uf", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(U) +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H index c9c0ce3c58ef1cf2315bbb7468bd197951af4b14..827daa4ce8cf5b242205b1470b5e5d6637daafbb 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H @@ -1,3 +1,5 @@ +surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn().H(); @@ -10,7 +12,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phiAbs) + + Dp*fvc::ddtCorr(U, Uf) ); if (p.needReference()) @@ -24,7 +26,7 @@ while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( - fvm::laplacian(rAU, p) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p) == fvc::div(phiHbyA) ); pEqn.setReference(pRefCell, pRefValue); @@ -42,9 +44,15 @@ while (pimple.correctNonOrthogonal()) // Explicitly relax pressure for momentum corrector p.relax(); -// Make the fluxes relative to the mesh motion -fvc::makeRelative(phi, U); - U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); fvOptions.correct(U); + +{ + Uf = fvc::interpolate(U); + surfaceVectorField n(mesh.Sf()/mesh.magSf()); + Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf()); +} + +// Make the fluxes relative to the mesh motion +fvc::makeRelative(phi, U); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C index 883a20f6cff82aeafa2386f9bbb874fdfc16e0f5..12b0b438a3fe41573c74bc93228516e311d7b518 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C @@ -51,15 +51,13 @@ int main(int argc, char *argv[]) pimpleControl pimple(mesh); #include "createFields.H" + #include "createUf.H" #include "createFvOptions.H" #include "readTimeControls.H" #include "createPcorrTypes.H" #include "CourantNo.H" #include "setInitialDeltaT.H" - // Create old-time absolute flux for ddtPhiCorr - surfaceScalarField phiAbs("phiAbs", phi); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -69,12 +67,6 @@ int main(int argc, char *argv[]) #include "readControls.H" #include "CourantNo.H" - // Make the fluxes absolute - fvc::makeAbsolute(phi, U); - - // Update absolute flux for ddtPhiCorr - phiAbs = phi; - #include "setDeltaT.H" runTime++; @@ -83,12 +75,15 @@ int main(int argc, char *argv[]) mesh.update(); + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & Uf; + if (mesh.changing() && correctPhi) { #include "correctPhi.H" } - // Make the fluxes relative to the mesh motion + // Make the flux relative to the mesh motion fvc::makeRelative(phi, U); if (mesh.changing() && checkMeshCourantNo) diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index 1e45897e75b4523c675dfdd73c1f3de813ddd02d..fc5b24ec6a6d5f062bbda2a7b3878bbf2bc265e8 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + fvc::interpolate(rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p); diff --git a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C index f279f91eec3eea8b57648d3c7958cc1ee4dedd86..536d090d04c9b980d579a68f727476c689ef1034 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-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, h, hU, phi) + + fvc::interpolate(rAU)*fvc::ddtCorr(h, hU, phi) - phih0 ); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 82f1e9ff634e793cf14f1c95ff7f932ccd546dff..200ea289d857b60c111f6d7b503c66b3fe3cf59a 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -1,6 +1,8 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -11,9 +13,9 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); @@ -24,7 +26,7 @@ if (pimple.transonic()) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == coalParcels.Srho() + fvOptions(psi, p, rho.name()) @@ -45,10 +47,9 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); @@ -60,7 +61,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == coalParcels.Srho() + fvOptions(psi, p, rho.name()) diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H index 7df99b9b94ff341ae0aa6cf5a30748478dc24220..1e504462b6a7a786d041dc2d692a733d44ff8a77 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H @@ -1,19 +1,19 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); -surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU)); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); -surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); +surfaceScalarField phig(-Dp*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) + phig ); @@ -27,7 +27,7 @@ while (pimple.correctNonOrthogonal()) fvc::ddt(psi, rho)*gh + fvc::div(phiHbyA) + fvm::ddt(psi, p_rgh) - - fvm::laplacian(rhorAUf, p_rgh) + - fvm::laplacian(Dp, p_rgh) == parcels.Srho() + surfaceFilm.Srho() @@ -41,7 +41,7 @@ while (pimple.correctNonOrthogonal()) if (pimple.finalNonOrthogonalIter()) { phi = phiHbyA + p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf); + U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C index 34aecb65b4ee3cb3ef287d6f61410e8e6e249301..7481ae79cda16cc7f2572c73fe40a506bd60ca38 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -30,9 +30,6 @@ Description parcels and porous media, including run-time selectable finitite volume options, e.g. sources, constraints - Note: ddtPhiCorr not used here when porous zones are active - - not well defined for porous calculations - \*---------------------------------------------------------------------------*/ #include "fvCFD.H" diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 6dd16f0bdb9e56eeb0ed972e2b9ca9342aba4535..420bc1ef0cb12b2ffc51ed2f51f1d83bce190b75 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -6,16 +6,17 @@ thermo.rho() -= psi*p; volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); @@ -35,7 +36,7 @@ fvScalarMatrix pEqn ( pDDtEqn - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); fvOptions.constrain(pEqn); diff --git a/applications/solvers/lagrangian/sprayFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/pEqn.H index af65d3016bb17c85464a6a2664fe81c4ca7c6607..f62a17286c2c4d52b1f6941c0fe669474e92b999 100644 --- a/applications/solvers/lagrangian/sprayFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/pEqn.H @@ -1,6 +1,8 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -11,9 +13,9 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) ); fvOptions.makeRelative(fvc::interpolate(psi), phid); @@ -24,7 +26,7 @@ if (pimple.transonic()) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == parcels.Srho() + fvOptions(psi, p, rho.name()) @@ -45,10 +47,9 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); @@ -60,7 +61,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == parcels.Srho() + fvOptions(psi, p, rho.name()) diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H index cf7acbd602e503b2e0e22627530257d02a7bb083..b7de7e2f79ec2f5eb9d5b468fab01b7972fd9c1c 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H @@ -1,6 +1,8 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); + volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -11,8 +13,11 @@ if (pimple.transonic()) "phid", fvc::interpolate(psi) *( - ((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U)) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + //***HGW + Dp*fvc::ddtCorr(rho, U, phi) + )/fvc::interpolate(rho) + - fvc::meshPhi(rho, U) ) ); @@ -24,7 +29,7 @@ if (pimple.transonic()) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == parcels.Srho() + fvOptions(psi, p, rho.name()) @@ -45,11 +50,11 @@ else surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - ((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U)) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(HbyA) & mesh.Sf()) + //***HGW + Dp*fvc::ddtCorr(rho, U, phi) ) + - fvc::interpolate(rho)*fvc::meshPhi(rho, U) ); fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA); @@ -60,7 +65,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) == parcels.Srho() + fvOptions(psi, p, rho.name()) diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H index 5ad7fdeb66c730abbeed416ea6e8e0d429bd166b..f869961a3c3161da03ec9b1915a90b9c87882948 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H @@ -12,16 +12,16 @@ surfaceScalarField rhof("rhof", fvc::interpolate(rho)); volScalarField rAU(1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", rhof*fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); phiv = (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phivAbs); + + Dp*fvc::ddtCorr(U, phivAbs); fvc::makeRelative(phiv, U); - surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p)); + surfaceScalarField phiGradp(Dp*mesh.magSf()*fvc::snGrad(p)); phiv -= phiGradp/rhof; @@ -35,7 +35,7 @@ + psi*correction(fvm::ddt(p)) + fvc::div(phiv, rho) + fvc::div(phiGradp) - - fvm::laplacian(rAUf, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index da43e67ce7bb5e2b0fcf565a86eb7d56fd8a2df9..e9d059aadbc47f951f494e7774c73f1dacd0e0f6 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -12,15 +12,15 @@ surfaceScalarField rhof("rhof", fvc::interpolate(rho)); volScalarField rAU(1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", rhof*fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); phiv = (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phiv); + + Dp*fvc::ddtCorr(U, phiv); - surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p)); + surfaceScalarField phiGradp(Dp*mesh.magSf()*fvc::snGrad(p)); phiv -= phiGradp/rhof; @@ -32,7 +32,7 @@ - (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi) + fvc::div(phiv, rho) + fvc::div(phiGradp) - - fvm::laplacian(rAUf, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 13193788219fbe0ba68353f9e4fec7cd1902d5bd..adc380978ca94f57c7176be91356662deb998504 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); phi = phiHbyA; @@ -18,7 +18,7 @@ ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() + )*Dp*mesh.magSf() ); phiHbyA += phig; @@ -70,7 +70,7 @@ fvScalarMatrix p_rghEqnIncomp ( fvc::div(phiHbyA) - - fvm::laplacian(rAUf, p_rgh) + - fvm::laplacian(Dp, p_rgh) ); solve @@ -97,7 +97,7 @@ phi = phiHbyA + p_rghEqnIncomp.flux(); U = HbyA - + rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf); + + rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/Dp); U.correctBoundaryConditions(); } } diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H index 5d2acc8b68402e5b1a9457b865dc65ecf0d7f120..be0e7234938396f9369419fa64c7a258bdc5c0bd 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); mrfZones.makeRelative(phiHbyA); @@ -20,7 +20,7 @@ ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() + )*Dp*mesh.magSf() ); phiHbyA += phig; @@ -29,7 +29,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -40,7 +40,7 @@ { phi = phiHbyA - p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H index 75560b6337fbeb5870e60a496bf1d798a40de7d9..deb4edc3881a0240c048fcf28ad308894dc4d6a9 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H @@ -1,20 +1,27 @@ +if (mesh.changing()) { - #include "continuityErrs.H" - - wordList pcorrTypes - ( - p_rgh.boundaryField().size(), - zeroGradientFvPatchScalarField::typeName - ); + forAll(U.boundaryField(), patchI) + { + if (U.boundaryField()[patchI].fixesValue()) + { + U.boundaryField()[patchI].initEvaluate(); + } + } - forAll (p_rgh.boundaryField(), i) + forAll(U.boundaryField(), patchI) { - if (p_rgh.boundaryField()[i].fixesValue()) + if (U.boundaryField()[patchI].fixesValue()) { - pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; + U.boundaryField()[patchI].evaluate(); + + phi.boundaryField()[patchI] = + U.boundaryField()[patchI] + & mesh.Sf().boundaryField()[patchI]; } } +} +{ volScalarField pcorr ( IOobject @@ -30,17 +37,13 @@ pcorrTypes ); - dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0); - - adjustPhi(phi, U, pcorr); - - fvc::makeAbsolute(phi, U); + dimensionedScalar Dp("Dp", dimTime/rho.dimensions(), 1.0); while (pimple.correctNonOrthogonal()) { fvScalarMatrix pcorrEqn ( - fvm::laplacian(rAUf, pcorr) == fvc::div(phi) + fvm::laplacian(Dp, pcorr) == fvc::div(phi) ); pcorrEqn.setReference(pRefCell, pRefValue); @@ -49,9 +52,6 @@ if (pimple.finalNonOrthogonalIter()) { phi -= pcorrEqn.flux(); - phiAbs = phi; - phiAbs.oldTime() = phi; - fvc::makeRelative(phi, U); } } } diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/createPcorrTypes.H b/applications/solvers/multiphase/interFoam/interDyMFoam/createPcorrTypes.H new file mode 100644 index 0000000000000000000000000000000000000000..dfd4afb49bb11a5546c3aa34cda8b0964b94a1a3 --- /dev/null +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/createPcorrTypes.H @@ -0,0 +1,13 @@ + wordList pcorrTypes + ( + p_rgh.boundaryField().size(), + zeroGradientFvPatchScalarField::typeName + ); + + for (label i=0; i<p_rgh.boundaryField().size(); i++) + { + if (p_rgh.boundaryField()[i].fixesValue()) + { + pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; + } + } diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/createUf.H b/applications/solvers/multiphase/interFoam/interDyMFoam/createUf.H new file mode 100644 index 0000000000000000000000000000000000000000..aab92ce0e2aec37304bd634f72bcbee68ed80189 --- /dev/null +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/createUf.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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/>. + +Global + createUf + +Description + Creates and initialises the velocity velocity field Uf. + +\*---------------------------------------------------------------------------*/ + +#ifndef createUf_H +#define createUf_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Info<< "Reading/calculating face velocity Uf\n" << endl; + +surfaceVectorField Uf +( + IOobject + ( + "Uf", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(U) +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 0c22dd01b7527fa7fb4ba8e5a39d7e861e38d093..75e4c2f8d46f69d15b73236f1d677d484c9983ce 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -50,15 +50,13 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createDynamicFvMesh.H" #include "initContinuityErrs.H" - #include "createFields.H" pimpleControl pimple(mesh); + #include "createFields.H" + #include "createUf.H" #include "readTimeControls.H" - - surfaceScalarField phiAbs("phiAbs", phi); - fvc::makeAbsolute(phiAbs, U); - + #include "createPcorrTypes.H" #include "correctPhi.H" #include "CourantNo.H" #include "setInitialDeltaT.H" @@ -80,21 +78,7 @@ int main(int argc, char *argv[]) scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - { - // Ensure old-time U exists for mapping - U.oldTime(); - - // Calculate the relative velocity used to map the relative flux phi - volVectorField Urel("Urel", U); - - if (mesh.moving()) - { - Urel -= fvc::reconstruct(fvc::meshPhi(U)); - } - - // Do any mesh changes - mesh.update(); - } + mesh.update(); if (mesh.changing()) { @@ -108,7 +92,13 @@ int main(int argc, char *argv[]) if (mesh.changing() && correctPhi) { + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & Uf; + #include "correctPhi.H" + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); } if (mesh.changing() && checkMeshCourantNo) diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H index 6fa43309975ef16e2223cd26448ea72d7b0e8eec..51190711c647047450cdfe0df0f181107953a6f9 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phiAbs) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf) ); if (p_rgh.needReference()) @@ -19,14 +19,14 @@ fvc::makeAbsolute(phiHbyA, U); } - phiAbs = phiHbyA; + surfaceScalarField phiAbs("phiAbs", phiHbyA); surfaceScalarField phig ( ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() + )*Dp*mesh.magSf() ); phiHbyA += phig; @@ -35,7 +35,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -46,7 +46,7 @@ { phi = phiHbyA - p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } @@ -54,7 +54,11 @@ #include "continuityErrs.H" - phiAbs = phi; + { + Uf = fvc::interpolate(U); + surfaceVectorField n(mesh.Sf()/mesh.magSf()); + Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf()); + } // Make the fluxes relative to the mesh motion fvc::makeRelative(phi, U); diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 0ec531f0dd31504c0f2df970bc1071cc2e35a129..d8651bfa8120b0f368035f89570d942fe7d8a86c 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); @@ -20,7 +20,7 @@ ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() + )*Dp*mesh.magSf() ); phiHbyA += phig; @@ -29,7 +29,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -40,7 +40,7 @@ { phi = phiHbyA - p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C index da11697426d97a338f8571ae159eb98961bab2d2..1246ee203d4b91ccd0330895c7c24748eab28cc8 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/interPhaseChangeDyMFoam.C @@ -60,14 +60,13 @@ int main(int argc, char *argv[]) #include "createDynamicFvMesh.H" #include "readGravitationalAcceleration.H" #include "initContinuityErrs.H" - #include "createFields.H" - #include "readTimeControls.H" pimpleControl pimple(mesh); - surfaceScalarField phiAbs("phiAbs", phi); - fvc::makeAbsolute(phiAbs, U); - + #include "createFields.H" + #include "../interFoam/interDyMFoam/createUf.H" + #include "readTimeControls.H" + #include "../interFoam/interDyMFoam/createPcorrTypes.H" #include "../interFoam/interDyMFoam/correctPhi.H" #include "CourantNo.H" #include "setInitialDeltaT.H" @@ -88,21 +87,7 @@ int main(int argc, char *argv[]) scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - { - // Ensure old-time U exists for mapping - U.oldTime(); - - // Calculate the relative velocity used to map the relative flux phi - volVectorField Urel("Urel", U); - - if (mesh.moving()) - { - Urel -= fvc::reconstruct(fvc::meshPhi(U)); - } - - // Do any mesh changes - mesh.update(); - } + mesh.update(); if (mesh.changing()) { @@ -116,7 +101,13 @@ int main(int argc, char *argv[]) if (mesh.changing() && correctPhi) { + // Calculate absolute flux from the mapped surface velocity + phi = mesh.Sf() & Uf; + #include "../interFoam/interDyMFoam/correctPhi.H" + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); } if (mesh.changing() && checkMeshCourantNo) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H index afb6478b9d70f824d8e03695eddc8a1f48cdec50..1169de5c54d90a403c51be15f9a37574a7d95fd4 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeDyMFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phiAbs) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf) ); if (p_rgh.needReference()) @@ -19,14 +19,14 @@ fvc::makeAbsolute(phiHbyA, U); } - phiAbs = phiHbyA; + surfaceScalarField phiAbs("phiAbs", phiHbyA); surfaceScalarField phig ( ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() + )*Dp*mesh.magSf() ); phiHbyA += phig; @@ -39,7 +39,7 @@ { fvScalarMatrix p_rghEqn ( - fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh) + fvc::div(phiHbyA) - fvm::laplacian(Dp, p_rgh) - (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh) ); @@ -51,13 +51,17 @@ { phi = phiHbyA + p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } } - phiAbs = phi; + { + Uf = fvc::interpolate(U); + surfaceVectorField n(mesh.Sf()/mesh.magSf()); + Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf()); + } // Make the fluxes relative to the mesh motion fvc::makeRelative(phi, U); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 7d9b71669aac7391fff95ea372b16cece7f37e41..75f06420ee7df104c07e546d74bdf6273b47015a 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); phi = phiHbyA; @@ -19,7 +19,7 @@ ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() + )*Dp*mesh.magSf() ); phiHbyA += phig; @@ -32,7 +32,7 @@ { fvScalarMatrix p_rghEqn ( - fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh) + fvc::div(phiHbyA) - fvm::laplacian(Dp, p_rgh) - (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh) ); @@ -44,7 +44,7 @@ { phi = phiHbyA + p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); fvOptions.correct(U); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 8677157de4cdf10362691dd3ba1f63f54a166fe1..00d41d3bb476672177ccb86896788bf5bcdeb6b6 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -94,7 +94,7 @@ phiHbyAs[phasei] = ( (fvc::interpolate(HbyAs[phasei]) & mesh.Sf()) - + fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi()) + + rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi()) ); mrfZones.makeRelative(phiHbyAs[phasei]); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H index e7f4c3ac8ee08800000e028e97c170a2ffbcd185..afa9d6058e7a2156535d9b5398a44ff9303c0440 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); mrfZones.makeRelative(phiHbyA); @@ -17,7 +17,7 @@ surfaceScalarField phig ( - - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf() + - ghf*fvc::snGrad(rho)*Dp*mesh.magSf() ); phiHbyA += phig; @@ -26,7 +26,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -37,7 +37,7 @@ { phi = phiHbyA - p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); } } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H index 82bf3dbd59a4dc399e59714fecc95596fc0120a2..d092aab3e2ee8cb0b6813d7dbec44b64ee2b842f 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,7 +9,7 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); phi = phiHbyA; @@ -19,7 +19,7 @@ ( mixture.surfaceTensionForce() - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf() + )*Dp*mesh.magSf() ); phiHbyA += phig; @@ -28,7 +28,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -39,7 +39,7 @@ { phi = phiHbyA - p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); } } diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H index 024598673f0cde1429247d5f96220ca5eeb11ccb..9d5f21a94d609809f88436eab024079983d6a059 100644 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H +++ b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H @@ -13,7 +13,7 @@ surfaceScalarField phiHbyA ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + rAUf*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_gh); diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index 6d61ec8730f8ef7d2f3c6b975e842a7fa69da26b..6bc6e9a6c1a7a7cfb5c9b6ccafaccbbb5afbbed9 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -1,7 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - - surfaceScalarField rAUf("Dp", fvc::interpolate(rho*rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,17 +8,16 @@ surfaceScalarField phiHbyA ( "phiHbyA", - fvc::interpolate(rho) - *( - (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + ( + (fvc::interpolate(rho*HbyA) & mesh.Sf()) + + Dp*fvc::ddtCorr(rho, U, phi) ) ); phi = phiHbyA; surfaceScalarField phig ( - - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf() + - ghf*fvc::snGrad(rho)*Dp*mesh.magSf() ); phiHbyA += phig; @@ -28,7 +26,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::ddt(rho) + fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::ddt(rho) + fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -39,7 +37,7 @@ { phi = phiHbyA - p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); } } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index e090522de6a69c7bb0429a5f9d7ac32fa5fc5984..94495f4f30cca92a1b5b5ef65febb7ed467275cb 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -1,6 +1,6 @@ { volScalarField rAU("rAU", 1.0/UEqn.A()); - surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); + surfaceScalarField Dp("Dp", fvc::interpolate(rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); @@ -9,14 +9,14 @@ ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); phi = phiHbyA; surfaceScalarField phig ( - - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf() + - ghf*fvc::snGrad(rho)*Dp*mesh.magSf() ); phiHbyA += phig; @@ -25,7 +25,7 @@ { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) + fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -36,7 +36,7 @@ { phi = phiHbyA - p_rghEqn.flux(); - U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp); U.correctBoundaryConditions(); } } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index 21a38ea5a6e5798c7d57feea1f45c599e9c390d2..6485ee032387e9995b741f69954c68bbfbe92b0b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -47,14 +47,14 @@ ( IOobject::groupName("phiHbyA", phase1.name()), (fvc::interpolate(HbyA1) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU1, alpha1, U1, phi1) + + rAlphaAU1f*fvc::ddtCorr(U1, phi1) ); surfaceScalarField phiHbyA2 ( IOobject::groupName("phiHbyA", phase2.name()), (fvc::interpolate(HbyA2) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU2, alpha2, U2, phi2) + + rAlphaAU2f*fvc::ddtCorr(U2, phi2) ); phiHbyA1 += diff --git a/applications/test/LduMatrix/LduMatrixTest3.C b/applications/test/LduMatrix/LduMatrixTest3.C index 596559e6a79eec67cb197e6bff02bce4ab4e5c21..39b8a069bb2335731043bd3437e2a55fd8656b7e 100644 --- a/applications/test/LduMatrix/LduMatrixTest3.C +++ b/applications/test/LduMatrix/LduMatrixTest3.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi); + + fvc::ddtCorr(rAU, U, phi); adjustPhi(phi, U, p); diff --git a/applications/test/PisoFoam/PisoFoam.C b/applications/test/PisoFoam/PisoFoam.C index bbd28e6f88aaa50cb5cdb5d0c0f9044389fb6dc9..d817318a8ab9aec2f0faffde7eb139340152e3d8 100644 --- a/applications/test/PisoFoam/PisoFoam.C +++ b/applications/test/PisoFoam/PisoFoam.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) ( "phiHbyA", (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, U, phi) + + fvc::ddtCorr(rAU, U, phi) ); adjustPhi(phiHbyA, U, p); diff --git a/applications/test/RhoPimpleFoam/pEqn.H b/applications/test/RhoPimpleFoam/pEqn.H index fcc40881a1deeef5d248c78d6d734af131922cd1..465e81d0e9f5343d2dc9078f2d5baa479c7bc57d 100644 --- a/applications/test/RhoPimpleFoam/pEqn.H +++ b/applications/test/RhoPimpleFoam/pEqn.H @@ -20,7 +20,7 @@ if (pimple.transonic()) fvc::interpolate(psi) *( (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::ddtCorr(rAU, rho, U, phi) ) ); @@ -57,7 +57,7 @@ else fvc::interpolate(rho) *( (fvc::interpolate(HbyA) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) + + fvc::ddtCorr(rAU, rho, U, phi) ) ); diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index 6dd0675993f1835726ab08988eb01e56afd949f0..9a22055dc90d708599b5a0573f6a2d59fdbb37aa 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -600,6 +600,19 @@ private: PackedBoolList& boundaryFacesToRemove ); + void calcNeighbourCellCentres + ( + const polyMesh& mesh, + const pointField& cellCentres, + pointField& neiCc + ) const; + + void selectSeparatedCoupledFaces + ( + const polyMesh& mesh, + boolList& selected + ) const; + //- From meshRefinementBaffles.C. Use insidePoint for a surface to // determine the cell zone. void findCellZoneInsideWalk diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index c943ca978b9e5abb538a8febb19a2040bfafc3a8..4e70aab9649b6ea57fc5c06dc494f1008e5d6cf9 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -2744,12 +2744,45 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches } else { - // internal face - faces[dualFaceI] = newDualFace; - owner[dualFaceI] = own; - neighbour[dualFaceI] = nei; +// if +// ( +// ptPairs_.isPointPair(vA, vB) +// || ftPtConformer_.featurePointPairs().isPointPair(vA, vB) +// ) +// { + patchIndex = geometryToConformTo_.findPatch(ptA, ptB); +// } + + if (patchIndex != -1) + { +// patchFaces[patchIndex].append(newDualFace); +// patchOwners[patchIndex].append(own); +// indirectPatchFace[patchIndex].append(false); +// +// if +// ( +// labelPair(vB->index(), vB->procIndex()) +// < labelPair(vA->index(), vA->procIndex()) +// ) +// { +// patchPPSlaves[patchIndex].append(vB->index()); +// } +// else +// { +// patchPPSlaves[patchIndex].append(vA->index()); +// } - dualFaceI++; +// baffleFaces[dualFaceI] = patchIndex; + } +// else + { + // internal face + faces[dualFaceI] = newDualFace; + owner[dualFaceI] = own; + neighbour[dualFaceI] = nei; + + dualFaceI++; + } } } } diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C index 07fd509e1f5e100151f2eaa9fff5cda5b26e0585..dc272a89d6f2eb8f6c4077b36d9f1ea52e164367 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C @@ -40,6 +40,7 @@ License #include "polyModifyFace.H" #include "syncTools.H" #include "regionSplit.H" +#include "OBJstream.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -111,7 +112,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance) { pointField points; - labelList boundaryPts(number_of_finite_cells(), -1); + labelList boundaryPts; faceList faces; labelList owner; labelList neighbour; @@ -407,6 +408,78 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance) } +void Foam::conformalVoronoiMesh::calcNeighbourCellCentres +( + const polyMesh& mesh, + const pointField& cellCentres, + pointField& neiCc +) const +{ + label nBoundaryFaces = mesh.nFaces() - mesh.nInternalFaces(); + + if (neiCc.size() != nBoundaryFaces) + { + FatalErrorIn("conformalVoronoiMesh::calcNeighbourCellCentres(..)") + << "nBoundaries:" << nBoundaryFaces + << " neiCc:" << neiCc.size() + << abort(FatalError); + } + + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + const labelUList& faceCells = pp.faceCells(); + + label bFaceI = pp.start() - mesh.nInternalFaces(); + + if (pp.coupled()) + { + forAll(faceCells, i) + { + neiCc[bFaceI] = cellCentres[faceCells[i]]; + bFaceI++; + } + } + } + + // Swap coupled boundaries. Apply separation to cc since is coordinate. + syncTools::swapBoundaryFacePositions(mesh, neiCc); +} + + +void Foam::conformalVoronoiMesh::selectSeparatedCoupledFaces +( + const polyMesh& mesh, + boolList& selected +) const +{ + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + forAll(patches, patchI) + { + // Check all coupled. Avoid using .coupled() so we also pick up AMI. + if (isA<coupledPolyPatch>(patches[patchI])) + { + const coupledPolyPatch& cpp = refCast<const coupledPolyPatch> + ( + patches[patchI] + ); + + if (cpp.separated() || !cpp.parallel()) + { + forAll(cpp, i) + { + selected[cpp.start()+i] = true; + } + } + } + } +} + + void Foam::conformalVoronoiMesh::findCellZoneInsideWalk ( const polyMesh& mesh, @@ -417,7 +490,7 @@ void Foam::conformalVoronoiMesh::findCellZoneInsideWalk { // Analyse regions. Reuse regionsplit boolList blockedFace(mesh.nFaces()); - //selectSeparatedCoupledFaces(blockedFace); + selectSeparatedCoupledFaces(mesh, blockedFace); forAll(faceToSurface, faceI) { @@ -630,42 +703,90 @@ void Foam::conformalVoronoiMesh::calcFaceZones const labelList& faceOwner = mesh.faceOwner(); const labelList& faceNeighbour = mesh.faceNeighbour(); + labelList neiFaceOwner(mesh.nFaces() - mesh.nInternalFaces(), -1); + + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + const labelUList& faceCells = pp.faceCells(); + + label bFaceI = pp.start() - mesh.nInternalFaces(); + + if (pp.coupled()) + { + forAll(faceCells, i) + { + neiFaceOwner[bFaceI] = cellToSurface[faceCells[i]]; + bFaceI++; + } + } + } + + syncTools::swapBoundaryFaceList(mesh, neiFaceOwner); + forAll(faces, faceI) { const label ownerSurfaceI = cellToSurface[faceOwner[faceI]]; + if (faceToSurface[faceI] >= 0) + { + continue; + } + if (mesh.isInternalFace(faceI)) { const label neiSurfaceI = cellToSurface[faceNeighbour[faceI]]; - flipMap[faceI] = - ( - ownerSurfaceI == max(ownerSurfaceI, neiSurfaceI) - ? false - : true - ); - if ( (ownerSurfaceI >= 0 || neiSurfaceI >= 0) && ownerSurfaceI != neiSurfaceI ) { - if (ownerSurfaceI > neiSurfaceI) - { - faceToSurface[faceI] = ownerSurfaceI; - } - else - { - faceToSurface[faceI] = neiSurfaceI; - } + flipMap[faceI] = + ( + ownerSurfaceI == max(ownerSurfaceI, neiSurfaceI) + ? false + : true + ); + + faceToSurface[faceI] = max(ownerSurfaceI, neiSurfaceI); } } else { - if (ownerSurfaceI >= 0) + label patchID = mesh.boundaryMesh().whichPatch(faceI); + + if (mesh.boundaryMesh()[patchID].coupled()) { - faceToSurface[faceI] = ownerSurfaceI; + const label neiSurfaceI = + neiFaceOwner[faceI - mesh.nInternalFaces()]; + + if + ( + (ownerSurfaceI >= 0 || neiSurfaceI >= 0) + && ownerSurfaceI != neiSurfaceI + ) + { + flipMap[faceI] = + ( + ownerSurfaceI == max(ownerSurfaceI, neiSurfaceI) + ? false + : true + ); + + faceToSurface[faceI] = max(ownerSurfaceI, neiSurfaceI); + } + } + else + { + if (ownerSurfaceI >= 0) + { + faceToSurface[faceI] = ownerSurfaceI; + } } } } @@ -674,104 +795,151 @@ void Foam::conformalVoronoiMesh::calcFaceZones const PtrList<surfaceZonesInfo>& surfZones = geometryToConformTo().surfZones(); - labelList insidePointNamedSurfaces + labelList unclosedSurfaces ( - surfaceZonesInfo::getInsidePointNamedSurfaces(surfZones) + surfaceZonesInfo::getUnclosedNamedSurfaces + ( + surfZones, + geometryToConformTo().geometry(), + geometryToConformTo().surfaces() + ) ); + pointField neiCc(mesh.nFaces() - mesh.nInternalFaces()); + calcNeighbourCellCentres + ( + mesh, + cellCentres, + neiCc + ); + + OBJstream intersections(time().path()/"ints.obj"); + OBJstream intersectionFaces(time().path()/"intFaces.obj"); + // Use intersection of cellCentre connections forAll(faces, faceI) { - if - ( - mesh.isInternalFace(faceI) - && faceToSurface[faceI] < 0 - ) + if (faceToSurface[faceI] >= 0) { - const label own = faceOwner[faceI]; - const label nei = faceNeighbour[faceI]; + continue; + } - pointIndexHit surfHit; - label hitSurface; + label patchID = mesh.boundaryMesh().whichPatch(faceI); - geometryToConformTo().findSurfaceAnyIntersection + const label own = faceOwner[faceI]; + + List<pointIndexHit> surfHit; + labelList hitSurface; + + if (mesh.isInternalFace(faceI)) + { + const label nei = faceNeighbour[faceI]; + + geometryToConformTo().findSurfaceAllIntersections ( cellCentres[own], cellCentres[nei], surfHit, hitSurface ); + } + else if (patchID != -1 && mesh.boundaryMesh()[patchID].coupled()) + { + geometryToConformTo().findSurfaceAllIntersections + ( + cellCentres[own], + neiCc[faceI - mesh.nInternalFaces()], + surfHit, + hitSurface + ); - if (surfHit.hit()) + if (surfHit.size() == 1 && surfHit[0].hit()) { - if (findIndex(insidePointNamedSurfaces, hitSurface) != -1) - { - faceToSurface[faceI] = hitSurface; - - vectorField norm; - geometryToConformTo().getNormal + intersections.write + ( + linePointRef ( - hitSurface, - List<pointIndexHit>(1, surfHit), - norm - ); - - const vector fN = faces[faceI].normal(mesh.points()); - - if ((norm[0] & fN/(mag(fN) + SMALL)) < 0) - { - flipMap[faceI] = true; - } - else - { - flipMap[faceI] = false; - } - } + cellCentres[own], + neiCc[faceI - mesh.nInternalFaces()] + ) + ); } } - } - - labelList neiCellSurface(mesh.nFaces()-mesh.nInternalFaces()); - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - - if (pp.coupled()) + // If there are multiple intersections then do not add to + // a faceZone + if (surfHit.size() == 1 && surfHit[0].hit()) { - forAll(pp, i) + if (findIndex(unclosedSurfaces, hitSurface[0]) != -1) { - label faceI = pp.start()+i; - label ownSurface = cellToSurface[faceOwner[faceI]]; - neiCellSurface[faceI - mesh.nInternalFaces()] = ownSurface; - } - } - } - syncTools::swapBoundaryFaceList(mesh, neiCellSurface); - - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; + vectorField norm; + geometryToConformTo().getNormal + ( + hitSurface[0], + List<pointIndexHit>(1, surfHit[0]), + norm + ); - if (pp.coupled()) - { - forAll(pp, i) - { - label faceI = pp.start()+i; - label ownSurface = cellToSurface[faceOwner[faceI]]; - label neiSurface = neiCellSurface[faceI-mesh.nInternalFaces()]; + vector fN = faces[faceI].normal(mesh.points()); + fN /= mag(fN) + SMALL; - if (faceToSurface[faceI] == -1 && (ownSurface != neiSurface)) + if ((norm[0] & fN) < 0) { - // Give face the max cell zone - faceToSurface[faceI] = max(ownSurface, neiSurface); + flipMap[faceI] = true; } + else + { + flipMap[faceI] = false; + } + + faceToSurface[faceI] = hitSurface[0]; + + intersectionFaces.write(faces[faceI], mesh.points()); } } } + +// labelList neiCellSurface(mesh.nFaces()-mesh.nInternalFaces()); +// +// forAll(patches, patchI) +// { +// const polyPatch& pp = patches[patchI]; +// +// if (pp.coupled()) +// { +// forAll(pp, i) +// { +// label faceI = pp.start()+i; +// label ownSurface = cellToSurface[faceOwner[faceI]]; +// neiCellSurface[faceI - mesh.nInternalFaces()] = ownSurface; +// } +// } +// } +// syncTools::swapBoundaryFaceList(mesh, neiCellSurface); +// +// forAll(patches, patchI) +// { +// const polyPatch& pp = patches[patchI]; +// +// if (pp.coupled()) +// { +// forAll(pp, i) +// { +// label faceI = pp.start()+i; +// label ownSurface = cellToSurface[faceOwner[faceI]]; +// label neiSurface = +// neiCellSurface[faceI-mesh.nInternalFaces()]; +// +// if (faceToSurface[faceI] == -1 && (ownSurface != neiSurface)) +// { +// // Give face the max cell zone +// faceToSurface[faceI] = max(ownSurface, neiSurface); +// } +// } +// } +// } +// // Sync syncTools::syncFaceList(mesh, faceToSurface, maxEqOp<label>()); } @@ -1049,7 +1217,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches pBufs.finishedSends(); - Info<< incrIndent << indent << " Face ordering initialised..." << endl; + Info<< incrIndent << indent << "Face ordering initialised..." << endl; // Receive and calculate ordering bool anyChanged = false; @@ -1108,7 +1276,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches } } - Info<< incrIndent << indent << " Faces matched." << endl; + Info<< incrIndent << indent << "Faces matched." << endl; reduce(anyChanged, orOp<bool>()); @@ -1145,6 +1313,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches << " faces have been reordered" << nl << indent << returnReduce(nRotated, sumOp<label>()) << " faces have been rotated" + << decrIndent << decrIndent << decrIndent << decrIndent << endl; } } @@ -1192,7 +1361,8 @@ void Foam::conformalVoronoiMesh::writeMesh ); } - Info<< " Constructing mesh" << endl; + Info<< incrIndent; + Info<< indent << "Constructing mesh" << endl; timeCheck("Before fvMesh construction"); @@ -1212,7 +1382,7 @@ void Foam::conformalVoronoiMesh::writeMesh xferMove(neighbour) ); - Info<< " Adding patches to mesh" << endl; + Info<< indent << "Adding patches to mesh" << endl; List<polyPatch*> patches(patchNames.size()); @@ -1258,11 +1428,7 @@ void Foam::conformalVoronoiMesh::writeMesh // Check that the patch is not empty on every processor reduce(totalPatchSize, sumOp<label>()); - if - ( - totalPatchSize > 0 -// && !geometryToConformTo().surfZones().set(p) - ) + if (totalPatchSize > 0) { patches[nValidPatches] = polyPatch::New ( @@ -1379,14 +1545,16 @@ void Foam::conformalVoronoiMesh::writeMesh forAll(faceToSurface, faceI) { - if (!mesh.isInternalFace(faceI)) + label surfaceI = faceToSurface[faceI]; + + if (surfaceI < 0) { continue; } - label surfaceI = faceToSurface[faceI]; + label patchID = mesh.boundaryMesh().whichPatch(faceI); - if (surfaceI >= 0) + if (mesh.isInternalFace(faceI)) { label own = faceOwner[faceI]; label nei = faceNeighbour[faceI]; @@ -1407,6 +1575,26 @@ void Foam::conformalVoronoiMesh::writeMesh ) ); } + else if (patchID != -1 && mesh.boundaryMesh()[patchID].coupled()) + { + label own = faceOwner[faceI]; + + meshMod.setAction + ( + polyModifyFace + ( + mesh.faces()[faceI], // modified face + faceI, // label of face + own, // owner + -1, // neighbour + false, // face flip + patchID, // patch for face + false, // remove from zone + surfaceToFaceZone[surfaceI], // zone for face + flipMap[faceI] // face flip in zone + ) + ); + } } // Change the mesh (no inflation, parallel sync) diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C index 351b85c952dd13a9f9875c3e6a86f3c346ea8c57..43d9c770134a330f62629b67c488b32a91a1173d 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C @@ -872,6 +872,42 @@ void Foam::conformationSurfaces::findSurfaceAnyIntersection } +void Foam::conformationSurfaces::findSurfaceAllIntersections +( + const point& start, + const point& end, + List<pointIndexHit>& surfHit, + labelList& hitSurface +) const +{ + labelListList hitSurfaces; + List<List<pointIndexHit> > hitInfo; + + searchableSurfacesQueries::findAllIntersections + ( + allGeometry_, + surfaces_, + pointField(1, start), + pointField(1, end), + hitSurfaces, + hitInfo + ); + + surfHit = hitInfo[0]; + + hitSurface.setSize(hitSurfaces[0].size()); + + forAll(hitSurfaces[0], surfI) + { + // hitSurfaces has returned the index of the entry in surfaces_ that was + // found, not the index of the surface in allGeometry_, translating this + // to allGeometry_ + + hitSurface[surfI] = surfaces_[hitSurfaces[0][surfI]]; + } +} + + void Foam::conformationSurfaces::findSurfaceNearestIntersection ( const point& start, diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H index 68c5fd28b92e93c159622fa21ca2883da222cbd0..12932255da25a69e5effc0b1bbd81c223dac35be 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H @@ -257,6 +257,14 @@ public: label& hitSurface ) const; + void findSurfaceAllIntersections + ( + const point& start, + const point& end, + List<pointIndexHit>& surfHit, + labelList& hitSurface + ) const; + //- Finding the nearestIntersection of the surface to start void findSurfaceNearestIntersection ( diff --git a/applications/utilities/mesh/generation/foamyQuadMesh/CV2D.C b/applications/utilities/mesh/generation/foamyQuadMesh/CV2D.C index deb0605aa098c83c5ff777c8b41928dd91d767a6..0ce6e785b61d8c0f63cd6caeaabddeb91f5bcaa9 100644 --- a/applications/utilities/mesh/generation/foamyQuadMesh/CV2D.C +++ b/applications/utilities/mesh/generation/foamyQuadMesh/CV2D.C @@ -542,7 +542,7 @@ void Foam::CV2D::newPoints() alignmentDirsB[0].x() ); - Field<vector2D> alignmentDirs(2); + Field<vector2D> alignmentDirs(alignmentDirsA); forAll(alignmentDirsA, aA) { diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C index 74844aea826feb5f199db842a71e227743d3916c..65fddffbbcbffcead3a73779e3c939e6d0701531 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.C +++ b/src/OpenFOAM/db/IOobject/IOobject.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -323,8 +323,8 @@ Foam::fileName Foam::IOobject::filePath() const ) { fileName parentObjectPath = - rootPath()/caseName() - /".."/instance()/db_.dbDir()/local()/name(); + rootPath()/time().globalCaseName() + /instance()/db_.dbDir()/local()/name(); if (isFile(parentObjectPath)) { diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 5c589c8f2840245c088844e046f42eab3d1df415..94c8b9cac4682b4c14ec552d69311c8a5e776663 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -129,6 +129,8 @@ void Foam::Time::adjustDeltaT() } } } + + functionObjects_.adjustTimeStep(); } @@ -384,7 +386,9 @@ Foam::Time::Time : TimePaths ( + args.parRunControl().parRun(), args.rootPath(), + args.globalCaseName(), args.caseName(), systemName, constantName @@ -700,13 +704,27 @@ Foam::instantList Foam::Time::times() const Foam::word Foam::Time::findInstancePath(const instant& t) const { - instantList timeDirs = findTimes(path(), constant()); + const fileName directory = path(); + const word& constantName = constant(); - forAllReverse(timeDirs, timeI) + // Read directory entries into a list + fileNameList dirEntries(readDir(directory, fileName::DIRECTORY)); + + forAll(dirEntries, i) { - if (timeDirs[timeI] == t) + scalar timeValue; + if (readScalar(dirEntries[i].c_str(), timeValue) && t.equal(timeValue)) { - return timeDirs[timeI].name(); + return dirEntries[i]; + } + } + + if (t.equal(0.0)) + { + // Looking for 0 or constant. 0 already checked above. + if (isDir(directory/constantName)) + { + return constantName; } } @@ -941,17 +959,25 @@ void Foam::Time::setEndTime(const scalar endTime) } -void Foam::Time::setDeltaT(const dimensionedScalar& deltaT) +void Foam::Time::setDeltaT +( + const dimensionedScalar& deltaT, + const bool bAdjustDeltaT +) { - setDeltaT(deltaT.value()); + setDeltaT(deltaT.value(), bAdjustDeltaT); } -void Foam::Time::setDeltaT(const scalar deltaT) +void Foam::Time::setDeltaT(const scalar deltaT, const bool bAdjustDeltaT) { deltaT_ = deltaT; deltaTchanged_ = true; - adjustDeltaT(); + + if (bAdjustDeltaT) + { + adjustDeltaT(); + } } diff --git a/src/OpenFOAM/db/Time/Time.H b/src/OpenFOAM/db/Time/Time.H index 695f666c2e9d08e8a5b3f84023547ef39faee052..0d7c83818f469a18336f4995b6d9eec4a5f5ed07 100644 --- a/src/OpenFOAM/db/Time/Time.H +++ b/src/OpenFOAM/db/Time/Time.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -527,10 +527,18 @@ public: virtual void setEndTime(const scalar); //- Reset time step - virtual void setDeltaT(const dimensionedScalar&); + virtual void setDeltaT + ( + const dimensionedScalar&, + const bool adjustDeltaT = true + ); //- Reset time step - virtual void setDeltaT(const scalar); + virtual void setDeltaT + ( + const scalar, + const bool adjustDeltaT = true + ); //- Set time to sub-cycle for the given number of steps virtual TimeState subCycle(const label nSubCycles); diff --git a/src/OpenFOAM/db/Time/TimePaths.C b/src/OpenFOAM/db/Time/TimePaths.C index b97398b87659898b7898aec4261d70ee4f796e1e..29f2c6967e55b38fa06147fcc368b58a04612e6b 100644 --- a/src/OpenFOAM/db/Time/TimePaths.C +++ b/src/OpenFOAM/db/Time/TimePaths.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,11 +35,41 @@ Foam::TimePaths::TimePaths const word& constantName ) : - processorCase_(caseName.find("processor") != string::npos), + processorCase_(false), rootPath_(rootPath), case_(caseName), system_(systemName), constant_(constantName) +{ + std::string::size_type pos = caseName.find("processor"); + if (pos != string::npos) + { + processorCase_ = true; + globalCaseName_ = caseName(pos-1); + } + else + { + globalCaseName_ = caseName; + } +} + + +Foam::TimePaths::TimePaths +( + const bool processorCase, + const fileName& rootPath, + const fileName& globalCaseName, + const fileName& caseName, + const word& systemName, + const word& constantName +) +: + processorCase_(processorCase), + rootPath_(rootPath), + globalCaseName_(globalCaseName), + case_(caseName), + system_(systemName), + constant_(constantName) {} diff --git a/src/OpenFOAM/db/Time/TimePaths.H b/src/OpenFOAM/db/Time/TimePaths.H index 3f261be6444d921abdddb93241d1311c38a1071e..0f5e1b11fd4384d07c4bc9865803e973bf0f11eb 100644 --- a/src/OpenFOAM/db/Time/TimePaths.H +++ b/src/OpenFOAM/db/Time/TimePaths.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,10 +52,11 @@ class TimePaths // Private data bool processorCase_; - fileName rootPath_; - fileName case_; - word system_; - word constant_; + const fileName rootPath_; + fileName globalCaseName_; + const fileName case_; + const word system_; + const word constant_; public: @@ -72,6 +73,18 @@ public: ); + //- Construct given database name, rootPath and casePath + TimePaths + ( + const bool processorCase, + const fileName& rootPath, + const fileName& globalCaseName, + const fileName& caseName, + const word& systemName, + const word& constantName + ); + + // Member functions //- Return true if this is a processor case @@ -86,6 +99,12 @@ public: return rootPath_; } + //- Return global case name + const fileName& globalCaseName() const + { + return globalCaseName_; + } + //- Return case name const fileName& caseName() const { diff --git a/src/OpenFOAM/db/Time/instant/instant.C b/src/OpenFOAM/db/Time/instant/instant.C index 46f6bb73f181dba4d467621f820e4130cdfda806..bcbe24e55db7705a76d1598a7ac9dcd7894621a9 100644 --- a/src/OpenFOAM/db/Time/instant/instant.C +++ b/src/OpenFOAM/db/Time/instant/instant.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,15 +54,19 @@ Foam::instant::instant(const word& tname) {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::instant::equal(const scalar b) const +{ + return (value_ < b + SMALL && value_ > b - SMALL); +} + + // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // bool Foam::operator==(const instant& a, const instant& b) { - return - ( - a.value_ < b.value_ + SMALL - && a.value_ > b.value_ - SMALL - ); + return a.equal(b.value_); } diff --git a/src/OpenFOAM/db/Time/instant/instant.H b/src/OpenFOAM/db/Time/instant/instant.H index 9682d8e3f7eefdf7ddad825e67e842d825dc1317..be3ea4e011362b6cf8a4c7394f8398b871a63527 100644 --- a/src/OpenFOAM/db/Time/instant/instant.H +++ b/src/OpenFOAM/db/Time/instant/instant.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,10 +99,10 @@ public: instant(const scalar, const word&); //- Construct from time value - instant(const scalar); + explicit instant(const scalar); //- Construct from word - instant(const word&); + explicit instant(const word&); // Member Functions @@ -133,6 +133,9 @@ public: return name_; } + //- Comparison used for instants to be equal + bool equal(const scalar) const; + // Friend Operators diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C index 7bb6c1c14a3dcddd7efde9b68f54958c6decfa05..bc5a1e65eaac532fa8cdc300b9612609cab62dcb 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,6 +37,14 @@ namespace functionEntries { defineTypeNameAndDebug(calcEntry, 0); + addToMemberFunctionSelectionTable + ( + functionEntry, + calcEntry, + execute, + dictionaryIstream + ); + addToMemberFunctionSelectionTable ( functionEntry, @@ -96,4 +104,48 @@ bool Foam::functionEntries::calcEntry::execute } +bool Foam::functionEntries::calcEntry::execute +( + dictionary& parentDict, + Istream& is +) +{ + Info<< "Using #calcEntry at line " << is.lineNumber() + << " in file " << parentDict.name() << endl; + + dynamicCode::checkSecurity + ( + "functionEntries::calcEntry::execute(..)", + parentDict + ); + + // Read string + string s(is); + // Make sure we stop this entry + //is.putBack(token(token::END_STATEMENT, is.lineNumber())); + + // Construct codeDict for codeStream + // must reference parent for stringOps::expand to work nicely. + dictionary codeSubDict; + codeSubDict.add("code", "os << (" + s + ");"); + dictionary codeDict(parentDict, codeSubDict); + + codeStream::streamingFunctionType function = codeStream::getFunction + ( + parentDict, + codeDict + ); + + // use function to write stream + OStringStream os(is.format()); + (*function)(os, parentDict); + + // get the entry from this stream + IStringStream resultStream(os.str()); + parentDict.read(resultStream); + + return true; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H index 9e26072c5f26d12b4cab71f4848d6f20fafc4999..e1083db42a48683f629c25e1fd9b96761404ed33 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,6 +89,9 @@ public: // Member Functions //- Execute the functionEntry in a sub-dict context + static bool execute(dictionary& parentDict, Istream&); + + //- Execute the functionEntry in a primitiveEntry context static bool execute ( const dictionary& parentDict, diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C index 7c6b95ec98034797a6651c7b4655b72af70c4177..019a4f54aab68680f9e6e279a0cd1662109a6bf6 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -40,6 +40,7 @@ void Foam::OutputFilterFunctionObject<OutputFilter>::readDict() dict_.readIfPresent("storeFilter", storeFilter_); dict_.readIfPresent("timeStart", timeStart_); dict_.readIfPresent("timeEnd", timeEnd_); + dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_); } @@ -214,6 +215,52 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::timeSet() } +template<class OutputFilter> +bool Foam::OutputFilterFunctionObject<OutputFilter>::adjustTimeStep() +{ + if + ( + active() + && outputControl_.outputControl() + == outputFilterOutputControl::ocAdjustableTime + ) + { + const label outputTimeIndex = outputControl_.outputTimeLastDump(); + const scalar writeInterval = outputControl_.writeInterval(); + + scalar timeToNextWrite = max + ( + 0.0, + (outputTimeIndex + 1)*writeInterval + - (time_.value() - time_.startTime().value()) + ); + + scalar deltaT = time_.deltaTValue(); + + scalar nSteps = timeToNextWrite/deltaT - SMALL; + + // function objects modify deltaT inside nStepsToStartTimeChange range + // NOTE: Potential problem if two function objects dump inside the same + //interval + if (nSteps < nStepsToStartTimeChange_) + { + label nStepsToNextWrite = label(nSteps) + 1; + + scalar newDeltaT = timeToNextWrite/nStepsToNextWrite; + + //Adjust time step + if (newDeltaT < deltaT) + { + deltaT = max(newDeltaT, 0.2*deltaT); + const_cast<Time&>(time_).setDeltaT(deltaT, false); + } + } + } + + return true; +} + + template<class OutputFilter> bool Foam::OutputFilterFunctionObject<OutputFilter>::read ( diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 78d1c47be72e11bd10f546f882bebe8f5130cbc2..c9cc34c8cefc6edb5a9944b5b3fe20e5f42fe490 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -90,6 +90,10 @@ class OutputFilterFunctionObject //- De-activation time - defaults to VGREAT scalar timeEnd_; + //- Number of steps before the dumping time in which the deltaT + // will start to change (valid for ocAdjustableTime) + label nStepsToStartTimeChange_; + //- Output controls outputFilterOutputControl outputControl_; @@ -204,6 +208,9 @@ public: //- Called when time was set at the end of the Time::operator++ virtual bool timeSet(); + //- Called at the end of Time::adjustDeltaT() if adjustTime is true + virtual bool adjustTimeStep(); + //- Read and set the function object if its data have changed virtual bool read(const dictionary&); diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 31e1d920628c04ffa4d1b0ead97bd721c409d699..2cb5bd0cd1916bc545e04a868a22af11a1f57945 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -126,6 +126,12 @@ bool Foam::functionObject::timeSet() } +bool Foam::functionObject::adjustTimeStep() +{ + return false; +} + + Foam::autoPtr<Foam::functionObject> Foam::functionObject::iNew::operator() ( const word& name, diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index 47438c32158da6f63fecab804121d125b31ed83b..ef4e6591fb463dd0140e361b23873f3a9ecd0e6a 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -160,6 +160,9 @@ public: //- Called when time was set at the end of the Time::operator++ virtual bool timeSet(); + //- Called at the end of Time::adjustDeltaT() if adjustTime is true + virtual bool adjustTimeStep(); + //- Read and set the function object if its data have changed virtual bool read(const dictionary&) = 0; diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 1e7553a760fa7b6badfcc12aba329638c0cfaf26..0c44dbbfbd47d478179b523bee447411e4bf67ab 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -211,6 +211,27 @@ bool Foam::functionObjectList::timeSet() } +bool Foam::functionObjectList::adjustTimeStep() +{ + bool ok = true; + + if (execution_) + { + if (!updated_) + { + read(); + } + + forAll(*this, objectI) + { + ok = operator[](objectI).adjustTimeStep() && ok; + } + } + + return ok; +} + + bool Foam::functionObjectList::read() { bool ok = true; diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index 4df2c4d263246f66bc70e6fa65b6581d8b6fda5a..126a1f18bbda131ebe08631197a1e959046fee61 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -166,6 +166,9 @@ public: //- Called when time was set at the end of the Time::operator++ virtual bool timeSet(); + //- Called at the end of Time::adjustDeltaT() if adjustTime is true + virtual bool adjustTimeStep(); + //- Read and set the function objects if their data have changed virtual bool read(); diff --git a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C index e282ff8c21575d56d3e1f40c219e1652a98380c2..6865b31fb9e1aada45639df45072efe01a7fdade 100644 --- a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C +++ b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,21 +24,26 @@ License \*---------------------------------------------------------------------------*/ #include "outputFilterOutputControl.H" +#include "PstreamReduceOps.H" // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // namespace Foam { template<> - const char* NamedEnum<outputFilterOutputControl::outputControls, 2>:: + const char* NamedEnum<outputFilterOutputControl::outputControls, 6>:: names[] = { "timeStep", - "outputTime" + "outputTime", + "adjustableTime", + "runTime", + "clockTime", + "cpuTime" }; } -const Foam::NamedEnum<Foam::outputFilterOutputControl::outputControls, 2> +const Foam::NamedEnum<Foam::outputFilterOutputControl::outputControls, 6> Foam::outputFilterOutputControl::outputControlNames_; @@ -53,7 +58,8 @@ Foam::outputFilterOutputControl::outputFilterOutputControl time_(t), outputControl_(ocTimeStep), outputInterval_(0), - outputTimeLastDump_(0) + outputTimeLastDump_(0), + writeInterval_(-1) { read(dict); } @@ -92,6 +98,15 @@ void Foam::outputFilterOutputControl::read(const dictionary& dict) break; } + case ocClockTime: + case ocRunTime: + case ocCpuTime: + case ocAdjustableTime: + { + writeInterval_ = readScalar(dict.lookup("writeInterval")); + break; + } + default: { // do nothing @@ -125,6 +140,56 @@ bool Foam::outputFilterOutputControl::output() break; } + case ocRunTime: + case ocAdjustableTime: + { + label outputIndex = label + ( + ( + (time_.value() - time_.startTime().value()) + + 0.5*time_.deltaTValue() + ) + / writeInterval_ + ); + + if (outputIndex > outputTimeLastDump_) + { + outputTimeLastDump_ = outputIndex; + return true; + } + break; + } + + case ocCpuTime: + { + label outputIndex = label + ( + returnReduce(time_.elapsedCpuTime(), maxOp<double>()) + / writeInterval_ + ); + if (outputIndex > outputTimeLastDump_) + { + outputTimeLastDump_ = outputIndex; + return true; + } + break; + } + + case ocClockTime: + { + label outputIndex = label + ( + returnReduce(label(time_.elapsedClockTime()), maxOp<label>()) + / writeInterval_ + ); + if (outputIndex > outputTimeLastDump_) + { + outputTimeLastDump_ = outputIndex; + return true; + } + break; + } + default: { // this error should not actually be possible diff --git a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.H b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.H index 4676bbd2a70a7868ad527152d1e2059da816d2bb..e27a2507d21cce6db93b38409ea7d94c1f686ecd 100644 --- a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.H +++ b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,8 +56,12 @@ public: //- The output control options enum outputControls { - ocTimeStep, /*!< execution is coupled to the time-step */ - ocOutputTime /*!< execution is coupled to the output-time */ + ocTimeStep, /*!< execution is coupled to the time-step */ + ocOutputTime, /*!< execution is coupled to the output-time */ + ocAdjustableTime, /*!< Adjust time step for dumping */ + ocRunTime, /*!< run time for dumping */ + ocClockTime, /*!< clock time for dumping */ + ocCpuTime /*!< cpu time for dumping */ }; @@ -69,7 +73,7 @@ private: const Time& time_; //- String representation of outputControls enums - static const NamedEnum<outputControls, 2> outputControlNames_; + static const NamedEnum<outputControls, 6> outputControlNames_; //- Type of output outputControls outputControl_; @@ -81,6 +85,9 @@ private: //- Dumping counter for ocOutputTime label outputTimeLastDump_; + //- Dump each deltaT (adjust Ttime) + scalar writeInterval_; + // Private Member Functions @@ -114,6 +121,24 @@ public: //- Flag to indicate whether to output bool output(); + + //- Return outputControl + outputControls outputControl() + { + return outputControl_; + } + + //- Return writeInterval + scalar writeInterval() + { + return writeInterval_; + } + + //- Return outputTimeLastDump + label outputTimeLastDump() + { + return outputTimeLastDump_; + } }; diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index b52777ffb468ba44de64d0422e208db2ddab3d9c..a83b2bf1909f9e962ac843bd95e981d290148a92 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -847,7 +847,9 @@ Foam::label Foam::globalMeshData::findTransform { FatalErrorIn("globalMeshData::findTransform(..)") << "Problem. Cannot find " << remotePoint - << " or " << localPoint << " in " << info + << " or " << localPoint << " " + << coupledPatch().localPoints()[localPoint] + << " in " << info << endl << "remoteTransformI:" << remoteTransformI << endl << "localTransformI:" << localTransformI diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C index d6ef3989cdd5d0b7ebf570d88c9e981fb109c5fb..00396d8fcbe0ae9fadb98cd51556f3622e5a4ec9 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -478,56 +478,164 @@ CoEulerDdtScheme<Type>::fvmDdt } +template<class Type> +tmp<typename CoEulerDdtScheme<Type>::fluxFieldType> +CoEulerDdtScheme<Type>::fvcDdtUfCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + IOobject ddtIOobject + ( + "ddtCorr(" + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + const surfaceScalarField rDeltaT(fvc::interpolate(CorDeltaT())); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff + ( + U.oldTime(), + (mesh().Sf() & Uf.oldTime()), + phiCorr + ) + *rDeltaT*phiCorr + ) + ); +} + + template<class Type> tmp<typename CoEulerDdtScheme<Type>::fluxFieldType> CoEulerDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { IOobject ddtIOobject ( - "ddtPhiCorr(" + rA.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - if (mesh().moving()) + const surfaceScalarField rDeltaT(fvc::interpolate(CorDeltaT())); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); +} + + +template<class Type> +tmp<typename CoEulerDdtScheme<Type>::fluxFieldType> +CoEulerDdtScheme<Type>::fvcDdtUfCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + IOobject ddtIOobject + ( + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + const surfaceScalarField rDeltaT(fvc::interpolate(CorDeltaT())); + + if + ( + U.dimensions() == dimVelocity + && Uf.dimensions() == dimDensity*dimVelocity + ) { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(rhoU0)) + ); + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> + this->fvcDdtPhiCoeff ( - "0", - rA.dimensions()*phi.dimensions()/dimTime, - pTraits<typename flux<Type>::type>::zero + rhoU0, + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); } - else + else if + ( + U.dimensions() == dimDensity*dimVelocity + && Uf.dimensions() == dimDensity*dimVelocity + ) { - const volScalarField rDeltaT(CorDeltaT()); + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* + this->fvcDdtPhiCoeff ( - fvc::interpolate(rDeltaT*rA)*phi.oldTime() - - (fvc::interpolate(rDeltaT*rA*U.oldTime()) & mesh().Sf()) + U.oldTime(), + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); } + else + { + FatalErrorIn + ( + "CoEulerDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of Uf are not correct" + << abort(FatalError); + + return fluxFieldType::null(); + } } @@ -535,122 +643,76 @@ template<class Type> tmp<typename CoEulerDdtScheme<Type>::fluxFieldType> CoEulerDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { + dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); + IOobject ddtIOobject ( - "ddtPhiCorr(" - + rA.name() + ',' + rho.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - if (mesh().moving()) + if + ( + U.dimensions() == dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(rhoU0)) + ); + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> - ( - "0", - rA.dimensions()*rho.dimensions()*phi.dimensions()/dimTime, - pTraits<typename flux<Type>::type>::zero - ) + this->fvcDdtPhiCoeff(rhoU0, phi.oldTime(), phiCorr) + *rDeltaT*phiCorr ) ); } - else + else if + ( + U.dimensions() == rho.dimensions()*dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { - const volScalarField rDeltaT(CorDeltaT()); - - if + fluxFieldType phiCorr ( - U.dimensions() == dimVelocity - && phi.dimensions() == dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) - *( - fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime() - - (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime()) - & mesh().Sf()) - ) - ) - ); - } - else if + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> ( - U.dimensions() == dimVelocity - && phi.dimensions() == dimDensity*dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> + new fluxFieldType ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - ( - U.oldTime(), - phi.oldTime()/fvc::interpolate(rho.oldTime()) - ) - *( - fvc::interpolate(rDeltaT*rA*rho.oldTime()) - *phi.oldTime()/fvc::interpolate(rho.oldTime()) - - ( - fvc::interpolate - ( - rDeltaT*rA*rho.oldTime()*U.oldTime() - ) & mesh().Sf() - ) - ) - ) - ); - } - else if + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); + } + else + { + FatalErrorIn ( - U.dimensions() == dimDensity*dimVelocity - && phi.dimensions() == dimDensity*dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - (rho.oldTime(), U.oldTime(), phi.oldTime()) - * ( - fvc::interpolate(rDeltaT*rA)*phi.oldTime() - - ( - fvc::interpolate(rDeltaT*rA*U.oldTime())&mesh().Sf() - ) - ) - ) - ); - } - else - { - FatalErrorIn - ( - "CoEulerDdtScheme<Type>::fvcDdtPhiCorr" - ) << "dimensions of phi are not correct" - << abort(FatalError); + "CoEulerDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of phi are not correct" + << abort(FatalError); - return fluxFieldType::null(); - } + return fluxFieldType::null(); } } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H index 52401609fab97c38f3aecba22b1ddb5b239df2e0..58a6d067a94b4bf61b50cd31cf193a51353ded74 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,16 +158,27 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -180,10 +191,17 @@ public: }; +template<> +tmp<surfaceScalarField> CoEulerDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> CoEulerDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -192,7 +210,6 @@ tmp<surfaceScalarField> CoEulerDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> CoEulerDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C index 53d106a75d3896cc2e2563f1fb168edf7f7a2c7b..739a5488555e1c2ddd290b0d8ae147972375e49e 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -646,7 +646,6 @@ CrankNicolsonDdtScheme<Type>::fvmDdt fvMatrix<Type>& fvm = tfvm(); scalar rDtCoef = rDtCoef_(ddt0).value(); - fvm.diag() = rDtCoef*mesh().V(); vf.oldTime().oldTime(); @@ -875,90 +874,197 @@ CrankNicolsonDdtScheme<Type>::fvmDdt } +template<class Type> +tmp<typename CrankNicolsonDdtScheme<Type>::fluxFieldType> +CrankNicolsonDdtScheme<Type>::fvcDdtUfCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& ddt0 = + ddt0_<GeometricField<Type, fvPatchField, volMesh> > + ( + "ddt0(" + U.name() + ')', + U.dimensions() + ); + + dimensionedScalar rDeltaT = rDtCoef_(ddt0); + + IOobject ddtIOobject + ( + "ddtCorr(" + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff + ( + U.oldTime(), + mesh().Sf() & Uf.oldTime(), + phiCorr + ) + *rDeltaT*phiCorr + ) + ); +} + template<class Type> tmp<typename CrankNicolsonDdtScheme<Type>::fluxFieldType> CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { - DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& dUdt0 = + DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& ddt0 = ddt0_<GeometricField<Type, fvPatchField, volMesh> > ( "ddt0(" + U.name() + ')', U.dimensions() ); - DDt0Field<fluxFieldType>& dphidt0 = - ddt0_<fluxFieldType> - ( - "ddt0(" + phi.name() + ')', - phi.dimensions() - ); + dimensionedScalar rDeltaT = rDtCoef_(ddt0); IOobject ddtIOobject ( - "ddtPhiCorr(" + rA.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - dimensionedScalar rDtCoef = rDtCoef_(dUdt0); + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); - if (mesh().moving()) + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); +} + + +template<class Type> +tmp<typename CrankNicolsonDdtScheme<Type>::fluxFieldType> +CrankNicolsonDdtScheme<Type>::fvcDdtUfCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + IOobject ddtIOobject + ( + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + if + ( + U.dimensions() == dimVelocity + && Uf.dimensions() == rho.dimensions()*dimVelocity + ) { - return tmp<fluxFieldType> + DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& ddt0 = + ddt0_<GeometricField<Type, fvPatchField, volMesh> > + ( + "ddt0(" + rho.name() + ',' + U.name() + ')', + U.dimensions() + ); + + dimensionedScalar rDeltaT = rDtCoef_(ddt0); + + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(rhoU0)) + ); + + tmp<fluxFieldType> ddtCorr ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> + this->fvcDdtPhiCoeff ( - "0", - rDtCoef.dimensions()*rA.dimensions()*phi.dimensions(), - pTraits<typename flux<Type>::type>::zero + rhoU0, + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); + + return ddtCorr; } - else + else if + ( + U.dimensions() == rho.dimensions()*dimVelocity + && Uf.dimensions() == rho.dimensions()*dimVelocity + ) { - if (evaluate(dUdt0)) - { - dUdt0 = - rDtCoef0_(dUdt0)*(U.oldTime() - U.oldTime().oldTime()) - - offCentre_(dUdt0()); - } + DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& ddt0 = + ddt0_<GeometricField<Type, fvPatchField, volMesh> > + ( + "ddt0(" + U.name() + ')', + U.dimensions() + ); - if (evaluate(dphidt0)) - { - dphidt0 = - rDtCoef0_(dphidt0)*(phi.oldTime() - phi.oldTime().oldTime()) - - offCentre_(dphidt0()); - } + dimensionedScalar rDeltaT = rDtCoef_(ddt0); - return tmp<fluxFieldType> + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); + + tmp<fluxFieldType> ddtCorr ( new fluxFieldType ( ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) - *fvc::interpolate(rA) - *( - (rDtCoef*phi.oldTime() + offCentre_(dphidt0())) - - ( - fvc::interpolate - ( - (rDtCoef*U.oldTime() + offCentre_(dUdt0())) - ) & mesh().Sf() - ) + this->fvcDdtPhiCoeff + ( + U.oldTime(), + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); + + return ddtCorr; + } + else + { + FatalErrorIn + ( + "CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of Uf are not correct" + << abort(FatalError); + + return fluxFieldType::null(); } } @@ -967,203 +1073,96 @@ template<class Type> tmp<typename CrankNicolsonDdtScheme<Type>::fluxFieldType> CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { - DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& dUdt0 = - ddt0_<GeometricField<Type, fvPatchField, volMesh> > - ( - "ddt0(" + U.name() + ')', - U.dimensions() - ); - - DDt0Field<fluxFieldType>& dphidt0 = - ddt0_<fluxFieldType> - ( - "ddt0(" + phi.name() + ')', - U.dimensions()*dimArea - ); - IOobject ddtIOobject ( - "ddtPhiCorr(" - + rA.name() + ',' + rho.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - dimensionedScalar rDtCoef = rDtCoef_(dUdt0); - - if (mesh().moving()) + if + ( + U.dimensions() == dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { - return tmp<fluxFieldType> + DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& ddt0 = + ddt0_<GeometricField<Type, fvPatchField, volMesh> > + ( + "ddt0(" + rho.name() + ',' + U.name() + ')', + U.dimensions() + ); + + dimensionedScalar rDeltaT = rDtCoef_(ddt0); + + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(rhoU0)) + ); + + tmp<fluxFieldType> ddtCorr ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> - ( - "0", - rA.dimensions()*rho.dimensions()*phi.dimensions()/dimTime, - pTraits<typename flux<Type>::type>::zero - ) + this->fvcDdtPhiCoeff(rhoU0, phi.oldTime(), phiCorr) + *rDeltaT*phiCorr ) ); + + return ddtCorr; } - else + else if + ( + U.dimensions() == rho.dimensions()*dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { - if - ( - U.dimensions() == dimVelocity - && phi.dimensions() == dimVelocity*dimArea - ) - { - if (evaluate(dUdt0)) - { - dUdt0 = rDtCoef0_(dUdt0)* - ( - U.oldTime() - U.oldTime().oldTime() - ) - offCentre_(dUdt0()); - } - - if (evaluate(dphidt0)) - { - dphidt0 = rDtCoef0_(dphidt0)* - ( - phi.oldTime() - - fvc::interpolate(rho.oldTime().oldTime()/rho.oldTime()) - *phi.oldTime().oldTime() - ) - offCentre_(dphidt0()); - } - - return tmp<fluxFieldType> + DDt0Field<GeometricField<Type, fvPatchField, volMesh> >& ddt0 = + ddt0_<GeometricField<Type, fvPatchField, volMesh> > ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* - ( - fvc::interpolate(rA*rho.oldTime()) - *(rDtCoef*phi.oldTime() + offCentre_(dphidt0())) - - ( - fvc::interpolate - ( - rA*rho.oldTime() - *(rDtCoef*U.oldTime() + offCentre_(dUdt0())) - ) & mesh().Sf() - ) - ) - ) + "ddt0(" + U.name() + ')', + U.dimensions() ); - } - else if - ( - U.dimensions() == dimVelocity - && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea - ) - { - if (evaluate(dUdt0)) - { - dUdt0 = rDtCoef0_(dUdt0)* - ( - U.oldTime() - U.oldTime().oldTime() - ) - offCentre_(dUdt0()); - } - if (evaluate(dphidt0)) - { - dphidt0 = rDtCoef0_(dphidt0)* - ( - phi.oldTime() - /fvc::interpolate(rho.oldTime()) - - phi.oldTime().oldTime() - /fvc::interpolate(rho.oldTime().oldTime()) - ) - offCentre_(dphidt0()); - } - - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - ( - U.oldTime(), - phi.oldTime()/fvc::interpolate(rho.oldTime()) - ) - *( - fvc::interpolate(rA*rho.oldTime()) - *( - rDtCoef*phi.oldTime()/fvc::interpolate(rho.oldTime()) - + offCentre_(dphidt0()) - ) - - ( - fvc::interpolate - ( - rA*rho.oldTime() - *(rDtCoef*U.oldTime() + offCentre_(dUdt0())) - ) & mesh().Sf() - ) - ) - ) - ); - } - else if - ( - U.dimensions() == rho.dimensions()*dimVelocity - && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea - ) - { - if (evaluate(dUdt0)) - { - dUdt0 = rDtCoef0_(dUdt0)* - ( - U.oldTime() - U.oldTime().oldTime() - ) - offCentre_(dUdt0()); - } + dimensionedScalar rDeltaT = rDtCoef_(ddt0); - if (evaluate(dphidt0)) - { - dphidt0 = rDtCoef0_(dphidt0)* - ( - phi.oldTime() - phi.oldTime().oldTime() - ) - offCentre_(dphidt0()); - } + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - (rho.oldTime(), U.oldTime(), phi.oldTime()) - * ( - fvc::interpolate(rA) - *(rDtCoef*phi.oldTime() + offCentre_(dphidt0())) - - ( - fvc::interpolate - ( - rA*(rDtCoef*U.oldTime() + offCentre_(dUdt0())) - ) & mesh().Sf() - ) - ) - ) - ); - } - else - { - FatalErrorIn + tmp<fluxFieldType> ddtCorr + ( + new fluxFieldType ( - "CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr" - ) << "dimensions of phi are not correct" - << abort(FatalError); + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); - return fluxFieldType::null(); - } + return ddtCorr; + } + else + { + FatalErrorIn + ( + "CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of phi are not correct" + << abort(FatalError); + + return fluxFieldType::null(); } } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H index 315072306c7c16539c405c1f4ad812f0f0354c6c..41fbbd0c28fc26d409ce9d26a0cae9bab19fb874 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -229,16 +229,27 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -252,10 +263,17 @@ public: }; +template<> +tmp<surfaceScalarField> CrankNicolsonDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> CrankNicolsonDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -264,7 +282,6 @@ tmp<surfaceScalarField> CrankNicolsonDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> CrankNicolsonDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C index d48a63449117cc972f7283b05f4c1e14ca315c18..8a98030e10b145d9097e5123bd0917c5a6e91494 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -370,34 +370,38 @@ EulerDdtScheme<Type>::fvmDdt template<class Type> tmp<typename EulerDdtScheme<Type>::fluxFieldType> -EulerDdtScheme<Type>::fvcDdtPhiCorr +EulerDdtScheme<Type>::fvcDdtUfCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, - const fluxFieldType& phiAbs + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf ) { dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); IOobject ddtIOobject ( - "ddtPhiCorr(" + rA.name() + ',' + U.name() + ',' + phiAbs.name() + ')', + "ddtCorr(" + U.name() + ',' + Uf.name() + ')', mesh().time().timeName(), mesh() ); - tmp<fluxFieldType> phiCorr = - phiAbs.oldTime() - (fvc::interpolate(U.oldTime()) & mesh().Sf()); - - phiCorr().boundaryField() = pTraits<typename flux<Type>::type>::zero; + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime(), phiCorr()) - * fvc::interpolate(rDeltaT*rA)*phiCorr + this->fvcDdtPhiCoeff + ( + U.oldTime(), + mesh().Sf() & Uf.oldTime(), + phiCorr + ) + *rDeltaT*phiCorr ) ); } @@ -407,21 +411,50 @@ template<class Type> tmp<typename EulerDdtScheme<Type>::fluxFieldType> EulerDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, + const GeometricField<Type, fvPatchField, volMesh>& U, + const fluxFieldType& phi +) +{ + dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); + + IOobject ddtIOobject + ( + "ddtCorr(" + U.name() + ',' + phi.name() + ')', + mesh().time().timeName(), + mesh() + ); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); +} + + +template<class Type> +tmp<typename EulerDdtScheme<Type>::fluxFieldType> +EulerDdtScheme<Type>::fvcDdtUfCorr +( const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, - const fluxFieldType& phiAbs + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf ) { dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); IOobject ddtIOobject ( - "ddtPhiCorr(" - + rA.name() + ',' - + rho.name() + ',' - + U.name() + ',' - + phiAbs.name() + ')', + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + Uf.name() + ')', mesh().time().timeName(), mesh() ); @@ -429,95 +462,144 @@ EulerDdtScheme<Type>::fvcDdtPhiCorr if ( U.dimensions() == dimVelocity - && phiAbs.dimensions() == dimVelocity*dimArea + && Uf.dimensions() == rho.dimensions()*dimVelocity ) { - tmp<fluxFieldType> ddtPhiCorr + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(rhoU0)) + ); + + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - rDeltaT - * this->fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime()) - * ( - fvc::interpolate(rA*rho.oldTime())*phiAbs.oldTime() - - ( - fvc::interpolate(rA*rho.oldTime()*U.oldTime()) - & mesh().Sf() - ) + this->fvcDdtPhiCoeff + ( + rhoU0, + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); - - ddtPhiCorr().boundaryField() = pTraits<typename flux<Type>::type>::zero; - - return ddtPhiCorr; } else if ( - U.dimensions() == dimVelocity - && phiAbs.dimensions() == rho.dimensions()*dimVelocity*dimArea + U.dimensions() == rho.dimensions()*dimVelocity + && Uf.dimensions() == rho.dimensions()*dimVelocity ) { - tmp<fluxFieldType> ddtPhiCorr + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - rDeltaT - * this->fvcDdtPhiCoeff + this->fvcDdtPhiCoeff ( U.oldTime(), - phiAbs.oldTime()/fvc::interpolate(rho.oldTime()) - ) - * ( - fvc::interpolate(rA*rho.oldTime()) - * phiAbs.oldTime()/fvc::interpolate(rho.oldTime()) - - ( - fvc::interpolate - ( - rA*rho.oldTime()*U.oldTime() - ) & mesh().Sf() - ) + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); + } + else + { + FatalErrorIn + ( + "EulerDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of Uf are not correct" + << abort(FatalError); + + return fluxFieldType::null(); + } +} + + +template<class Type> +tmp<typename EulerDdtScheme<Type>::fluxFieldType> +EulerDdtScheme<Type>::fvcDdtPhiCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const fluxFieldType& phi +) +{ + dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); + + IOobject ddtIOobject + ( + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + phi.name() + ')', + mesh().time().timeName(), + mesh() + ); + + if + ( + U.dimensions() == dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) + { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); - ddtPhiCorr().boundaryField() = pTraits<typename flux<Type>::type>::zero; + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(rhoU0)) + ); - return ddtPhiCorr; + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(rhoU0, phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); } else if ( U.dimensions() == rho.dimensions()*dimVelocity - && phiAbs.dimensions() == rho.dimensions()*dimVelocity*dimArea + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea ) { - tmp<fluxFieldType> ddtPhiCorr + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - rDeltaT - * this->fvcDdtPhiCoeff - (rho.oldTime(), U.oldTime(), phiAbs.oldTime()) - * ( - fvc::interpolate(rA)*phiAbs.oldTime() - - (fvc::interpolate(rA*U.oldTime()) & mesh().Sf()) - ) + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr ) ); - - ddtPhiCorr().boundaryField() = pTraits<typename flux<Type>::type>::zero; - - return ddtPhiCorr; } else { FatalErrorIn ( "EulerDdtScheme<Type>::fvcDdtPhiCorr" - ) << "dimensions of phiAbs are not correct" + ) << "dimensions of phi are not correct" << abort(FatalError); return fluxFieldType::null(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H index 27085e7dbf6b1a8bdaa7f08fd28064391bc2f552..ddaae47a872d7187accf9c975aa9153e66de22dd 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,16 +136,27 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -158,10 +169,17 @@ public: }; +template<> +tmp<surfaceScalarField> EulerDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> EulerDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -170,7 +188,6 @@ tmp<surfaceScalarField> EulerDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> EulerDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C index dd531848e63ae7563732cb16ef942a76928438e2..95a786c5acc0549a856478f09630da3296048156 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.C @@ -481,56 +481,164 @@ SLTSDdtScheme<Type>::fvmDdt } +template<class Type> +tmp<typename SLTSDdtScheme<Type>::fluxFieldType> +SLTSDdtScheme<Type>::fvcDdtUfCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + IOobject ddtIOobject + ( + "ddtCorr(" + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + const surfaceScalarField rDeltaT(fvc::interpolate(SLrDeltaT())); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff + ( + U.oldTime(), + (mesh().Sf() & Uf.oldTime()), + phiCorr + ) + *rDeltaT*phiCorr + ) + ); +} + + template<class Type> tmp<typename SLTSDdtScheme<Type>::fluxFieldType> SLTSDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { IOobject ddtIOobject ( - "ddtPhiCorr(" + rA.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - if (mesh().moving()) + const surfaceScalarField rDeltaT(fvc::interpolate(SLrDeltaT())); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); +} + + +template<class Type> +tmp<typename SLTSDdtScheme<Type>::fluxFieldType> +SLTSDdtScheme<Type>::fvcDdtUfCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + IOobject ddtIOobject + ( + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + const surfaceScalarField rDeltaT(fvc::interpolate(SLrDeltaT())); + + if + ( + U.dimensions() == dimVelocity + && Uf.dimensions() == dimDensity*dimVelocity + ) { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(rhoU0)) + ); + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> + this->fvcDdtPhiCoeff ( - "0", - rA.dimensions()*phi.dimensions()/dimTime, - pTraits<typename flux<Type>::type>::zero + rhoU0, + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); } - else + else if + ( + U.dimensions() == dimDensity*dimVelocity + && Uf.dimensions() == dimDensity*dimVelocity + ) { - const volScalarField rDeltaT(SLrDeltaT()); + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* + this->fvcDdtPhiCoeff ( - fvc::interpolate(rDeltaT*rA)*phi.oldTime() - - (fvc::interpolate(rDeltaT*rA*U.oldTime()) & mesh().Sf()) + U.oldTime(), + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); } + else + { + FatalErrorIn + ( + "SLTSDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of Uf are not correct" + << abort(FatalError); + + return fluxFieldType::null(); + } } @@ -538,122 +646,76 @@ template<class Type> tmp<typename SLTSDdtScheme<Type>::fluxFieldType> SLTSDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { + dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); + IOobject ddtIOobject ( - "ddtPhiCorr(" - + rA.name() + ',' + rho.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - if (mesh().moving()) + if + ( + U.dimensions() == dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(rhoU0)) + ); + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> - ( - "0", - rA.dimensions()*rho.dimensions()*phi.dimensions()/dimTime, - pTraits<typename flux<Type>::type>::zero - ) + this->fvcDdtPhiCoeff(rhoU0, phi.oldTime(), phiCorr) + *rDeltaT*phiCorr ) ); } - else + else if + ( + U.dimensions() == rho.dimensions()*dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { - const volScalarField rDeltaT(SLrDeltaT()); - - if + fluxFieldType phiCorr ( - U.dimensions() == dimVelocity - && phi.dimensions() == dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) - *( - fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime() - - (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime()) - & mesh().Sf()) - ) - ) - ); - } - else if + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> ( - U.dimensions() == dimVelocity - && phi.dimensions() == dimDensity*dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> + new fluxFieldType ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - ( - U.oldTime(), - phi.oldTime()/fvc::interpolate(rho.oldTime()) - ) - *( - fvc::interpolate(rDeltaT*rA*rho.oldTime()) - *phi.oldTime()/fvc::interpolate(rho.oldTime()) - - ( - fvc::interpolate - ( - rDeltaT*rA*rho.oldTime()*U.oldTime() - ) & mesh().Sf() - ) - ) - ) - ); - } - else if + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); + } + else + { + FatalErrorIn ( - U.dimensions() == dimDensity*dimVelocity - && phi.dimensions() == dimDensity*dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - (rho.oldTime(), U.oldTime(), phi.oldTime()) - * ( - fvc::interpolate(rDeltaT*rA)*phi.oldTime() - - ( - fvc::interpolate(rDeltaT*rA*U.oldTime())&mesh().Sf() - ) - ) - ) - ); - } - else - { - FatalErrorIn - ( - "SLTSDdtScheme<Type>::fvcDdtPhiCorr" - ) << "dimensions of phi are not correct" - << abort(FatalError); + "SLTSDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of phi are not correct" + << abort(FatalError); - return fluxFieldType::null(); - } + return fluxFieldType::null(); } } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H index 7e1793a75efa89812f1e0d5f541a711a4f5eee3f..8c4f0a178b3386d7e9f61bde5d85a8d7562dc765 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/SLTSDdtScheme/SLTSDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,16 +159,27 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -181,10 +192,17 @@ public: }; +template<> +tmp<surfaceScalarField> SLTSDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> SLTSDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -193,7 +211,6 @@ tmp<surfaceScalarField> SLTSDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> SLTSDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C index a4e13844cccb96cbdbe27a421e0efec2503438f7..06116eb6eddbe13226995fdfa5fa9f14830a0972 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -512,11 +512,56 @@ backwardDdtScheme<Type>::fvmDdt } +template<class Type> +tmp<typename backwardDdtScheme<Type>::fluxFieldType> +backwardDdtScheme<Type>::fvcDdtUfCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); + + IOobject ddtIOobject + ( + "ddtCorr(" + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + scalar deltaT = deltaT_(); + scalar deltaT0 = deltaT0_(U); + + scalar coefft = 1 + deltaT/(deltaT + deltaT0); + scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0)); + scalar coefft0 = coefft + coefft00; + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), (mesh().Sf() & Uf.oldTime())) + *rDeltaT + *( + mesh().Sf() + & ( + (coefft0*Uf.oldTime() - coefft00*Uf.oldTime().oldTime()) + - fvc::interpolate + ( + coefft0*U.oldTime() - coefft00*U.oldTime().oldTime() + ) + ) + ) + ) + ); +} + + template<class Type> tmp<typename backwardDdtScheme<Type>::fluxFieldType> backwardDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) @@ -525,7 +570,7 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr IOobject ddtIOobject ( - "ddtPhiCorr(" + rA.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); @@ -542,22 +587,16 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr new fluxFieldType ( ddtIOobject, - rDeltaT*this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + *rDeltaT *( - fvc::interpolate(rA) - *( - coefft0*phi.oldTime() - - coefft00*phi.oldTime().oldTime() - ) + (coefft0*phi.oldTime() - coefft00*phi.oldTime().oldTime()) - ( - fvc::interpolate + mesh().Sf() + & fvc::interpolate ( - rA* - ( - coefft0*U.oldTime() - - coefft00*U.oldTime().oldTime() - ) - ) & mesh().Sf() + coefft0*U.oldTime() - coefft00*U.oldTime().oldTime() + ) ) ) ) @@ -567,23 +606,18 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr template<class Type> tmp<typename backwardDdtScheme<Type>::fluxFieldType> -backwardDdtScheme<Type>::fvcDdtPhiCorr +backwardDdtScheme<Type>::fvcDdtUfCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, - const fluxFieldType& phiAbs + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf ) { dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); IOobject ddtIOobject ( - "ddtPhiCorr(" - + rA.name() + ',' - + rho.name() + ',' - + U.name() + ',' - + phiAbs.name() + ')', + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + Uf.name() + ')', mesh().time().timeName(), mesh() ); @@ -598,30 +632,31 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr if ( U.dimensions() == dimVelocity - && phiAbs.dimensions() == dimVelocity*dimArea + && Uf.dimensions() == rho.dimensions()*dimVelocity ) { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + GeometricField<Type, fvPatchField, volMesh> rhoU00 + ( + rho.oldTime().oldTime()*U.oldTime().oldTime() + ); + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - rDeltaT*this->fvcDdtPhiCoeff(U.oldTime(), phiAbs.oldTime()) + this->fvcDdtPhiCoeff(rhoU0, mesh().Sf() & Uf.oldTime()) + *rDeltaT *( - coefft0*fvc::interpolate(rA*rho.oldTime()) - *phiAbs.oldTime() - - coefft00*fvc::interpolate(rA*rho.oldTime().oldTime()) - *phiAbs.oldTime().oldTime() - - ( - fvc::interpolate - ( - rA* - ( - coefft0*rho.oldTime()*U.oldTime() - - coefft00*rho.oldTime().oldTime() - *U.oldTime().oldTime() - ) - ) & mesh().Sf() + mesh().Sf() + & ( + (coefft0*Uf.oldTime() - coefft00*Uf.oldTime().oldTime()) + - fvc::interpolate(coefft0*rhoU0 - coefft00*rhoU00) ) ) ) @@ -629,37 +664,97 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr } else if ( - U.dimensions() == dimVelocity - && phiAbs.dimensions() == rho.dimensions()*dimVelocity*dimArea + U.dimensions() == rho.dimensions()*dimVelocity + && Uf.dimensions() == rho.dimensions()*dimVelocity ) { + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - rDeltaT - *this->fvcDdtPhiCoeff - ( - U.oldTime(), - phiAbs.oldTime()/fvc::interpolate(rho.oldTime()) - ) + this->fvcDdtPhiCoeff(U.oldTime(), mesh().Sf() & Uf.oldTime()) + *rDeltaT *( - fvc::interpolate(rA) - *( - coefft0*phiAbs.oldTime() - - coefft00*phiAbs.oldTime().oldTime() + mesh().Sf() + & ( + (coefft0*Uf.oldTime() - coefft00*Uf.oldTime().oldTime()) + - fvc::interpolate + ( + coefft0*U.oldTime() - coefft00*U.oldTime().oldTime() + ) ) + ) + ) + ); + } + else + { + FatalErrorIn + ( + "backwardDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of phi are not correct" + << abort(FatalError); + + return fluxFieldType::null(); + } +} + + +template<class Type> +tmp<typename backwardDdtScheme<Type>::fluxFieldType> +backwardDdtScheme<Type>::fvcDdtPhiCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const fluxFieldType& phi +) +{ + dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); + + IOobject ddtIOobject + ( + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + phi.name() + ')', + mesh().time().timeName(), + mesh() + ); + + scalar deltaT = deltaT_(); + scalar deltaT0 = deltaT0_(U); + + scalar coefft = 1 + deltaT/(deltaT + deltaT0); + scalar coefft00 = deltaT*deltaT/(deltaT0*(deltaT + deltaT0)); + scalar coefft0 = coefft + coefft00; + + if + ( + U.dimensions() == dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) + { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + GeometricField<Type, fvPatchField, volMesh> rhoU00 + ( + rho.oldTime().oldTime()*U.oldTime().oldTime() + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(rhoU0, phi.oldTime()) + *rDeltaT + *( + (coefft0*phi.oldTime() - coefft00*phi.oldTime().oldTime()) - ( - fvc::interpolate - ( - rA* - ( - coefft0*rho.oldTime()*U.oldTime() - - coefft00*rho.oldTime().oldTime() - *U.oldTime().oldTime() - ) - ) & mesh().Sf() + mesh().Sf() + & fvc::interpolate(coefft0*rhoU0 - coefft00*rhoU00) ) ) ) @@ -668,32 +763,25 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr else if ( U.dimensions() == rho.dimensions()*dimVelocity - && phiAbs.dimensions() == rho.dimensions()*dimVelocity*dimArea + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea ) { + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - rDeltaT - * this->fvcDdtPhiCoeff - (rho.oldTime(), U.oldTime(), phiAbs.oldTime()) - * ( - fvc::interpolate(rA) - * ( - coefft0*phiAbs.oldTime() - - coefft00*phiAbs.oldTime().oldTime() - ) + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) + *rDeltaT + *( + (coefft0*phi.oldTime() - coefft00*phi.oldTime().oldTime()) - ( - fvc::interpolate + mesh().Sf() + & fvc::interpolate ( - rA* - ( - coefft0*U.oldTime() - - coefft00*U.oldTime().oldTime() - ) - ) & mesh().Sf() + coefft0*U.oldTime() - coefft00*U.oldTime().oldTime() + ) ) ) ) @@ -704,7 +792,7 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr FatalErrorIn ( "backwardDdtScheme<Type>::fvcDdtPhiCorr" - ) << "dimensions of phiAbs are not correct" + ) << "dimensions of phi are not correct" << abort(FatalError); return fluxFieldType::null(); diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H index 858c6b4698b6a248cf8f6803b7db0095ec28e0cb..c905f5e29a85928b61c9dda1d63eb804c5868fb3 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -147,22 +147,32 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); - tmp<surfaceScalarField> meshPhi ( const GeometricField<Type, fvPatchField, volMesh>& @@ -170,10 +180,17 @@ public: }; +template<> +tmp<surfaceScalarField> backwardDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> backwardDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -182,7 +199,6 @@ tmp<surfaceScalarField> backwardDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> backwardDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C index a89629f6db7f8c92aad3a22bffaeb53babd0575d..2edefd19b29d8a459c0d535c56940de443d6fa56 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,16 +122,40 @@ boundedDdtScheme<Type>::fvmDdt } +template<class Type> +tmp<typename boundedDdtScheme<Type>::fluxFieldType> +boundedDdtScheme<Type>::fvcDdtUfCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + return scheme_().fvcDdtUfCorr(U, Uf); +} + + template<class Type> tmp<typename boundedDdtScheme<Type>::fluxFieldType> boundedDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { - return scheme_().fvcDdtPhiCorr(rA, U, phi); + return scheme_().fvcDdtPhiCorr(U, phi); +} + + +template<class Type> +tmp<typename boundedDdtScheme<Type>::fluxFieldType> +boundedDdtScheme<Type>::fvcDdtUfCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + return scheme_().fvcDdtUfCorr(rho, U, Uf); } @@ -139,13 +163,12 @@ template<class Type> tmp<typename boundedDdtScheme<Type>::fluxFieldType> boundedDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { - return scheme_().fvcDdtPhiCorr(rA, rho, U, phi); + return scheme_().fvcDdtPhiCorr(rho, U, phi); } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.H index 0e5e0831f91140a2fe006a0ccba446289ac80a0e..2494f8dfcb38df690ef731cea619f81e241cfcae 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,16 +145,27 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -167,10 +178,17 @@ public: }; +template<> +tmp<surfaceScalarField> boundedDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> boundedDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -179,7 +197,6 @@ tmp<surfaceScalarField> boundedDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> boundedDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C index fd6103d5b237f665d67080fdbfc516bdb9619d15..ccfa56538e78e90e98f95bca4e03e5b2234e8237 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,82 +141,7 @@ tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff const fluxFieldType& phi ) { - dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); - - tmp<surfaceScalarField> tddtCouplingCoeff = scalar(1) - - min - ( - mag(phi - (mesh().Sf() & fvc::interpolate(U))) - /(mag(phi) + dimensionedScalar("small", phi.dimensions(), VSMALL)), - //(rDeltaT*mesh().magSf()/mesh().deltaCoeffs()), - scalar(1) - ); - - surfaceScalarField& ddtCouplingCoeff = tddtCouplingCoeff(); - - forAll(U.boundaryField(), patchi) - { - if (U.boundaryField()[patchi].fixesValue()) - { - ddtCouplingCoeff.boundaryField()[patchi] = 0.0; - } - } - - if (debug > 1) - { - Info<< "ddtCouplingCoeff mean max min = " - << gAverage(ddtCouplingCoeff.internalField()) - << " " << gMax(ddtCouplingCoeff.internalField()) - << " " << gMin(ddtCouplingCoeff.internalField()) - << endl; - } - - return tddtCouplingCoeff; -} - - -template<class Type> -tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff -( - const volScalarField& rho, - const GeometricField<Type, fvPatchField, volMesh>& rhoU, - const fluxFieldType& phi -) -{ - dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); - - tmp<surfaceScalarField> tddtCouplingCoeff = scalar(1) - - min - ( - mag(phi - (mesh().Sf() & fvc::interpolate(rhoU))) - /( - mag(phi) + dimensionedScalar("small", phi.dimensions(), VSMALL) - //fvc::interpolate(rho)*rDeltaT - //*mesh().magSf()/mesh().deltaCoeffs() - ), - scalar(1) - ); - - surfaceScalarField& ddtCouplingCoeff = tddtCouplingCoeff(); - - forAll(rhoU.boundaryField(), patchi) - { - if (rhoU.boundaryField()[patchi].fixesValue()) - { - ddtCouplingCoeff.boundaryField()[patchi] = 0.0; - } - } - - if (debug > 1) - { - Info<< "ddtCouplingCoeff mean max min = " - << gAverage(ddtCouplingCoeff.internalField()) - << " " << gMax(ddtCouplingCoeff.internalField()) - << " " << gMin(ddtCouplingCoeff.internalField()) - << endl; - } - - return tddtCouplingCoeff; + return fvcDdtPhiCoeff(U, phi, phi - (mesh().Sf() & fvc::interpolate(U))); } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H index 5496105e10d78a80ca1c5b7236a43ecf8e6eb8bf..ceb6b1d63ac63a833bfadf21d183db662fad40f8 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -198,29 +198,32 @@ public: const fluxFieldType& phi ); + virtual tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ) = 0; + virtual tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) = 0; - tmp<surfaceScalarField> fvcDdtPhiCoeff + virtual tmp<fluxFieldType> fvcDdtUfCorr ( const volScalarField& rho, - const GeometricField<Type, fvPatchField, volMesh>& rhoU, - const fluxFieldType& phi - ); + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ) = 0; virtual tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) = 0; - virtual tmp<surfaceScalarField> meshPhi ( const GeometricField<Type, fvPatchField, volMesh>& @@ -257,9 +260,19 @@ makeFvDdtTypeScheme(SS, symmTensor) \ makeFvDdtTypeScheme(SS, tensor) \ \ template<> \ +tmp<surfaceScalarField> SS<scalar>::fvcDdtUfCorr \ +( \ + const volScalarField& U, \ + const surfaceScalarField& Uf \ +) \ +{ \ + notImplemented(#SS"<scalar>::fvcDdtUfCorr"); \ + return surfaceScalarField::null(); \ +} \ + \ +template<> \ tmp<surfaceScalarField> SS<scalar>::fvcDdtPhiCorr \ ( \ - const volScalarField& rA, \ const volScalarField& U, \ const surfaceScalarField& phi \ ) \ @@ -269,9 +282,20 @@ tmp<surfaceScalarField> SS<scalar>::fvcDdtPhiCorr \ } \ \ template<> \ +tmp<surfaceScalarField> SS<scalar>::fvcDdtUfCorr \ +( \ + const volScalarField& rho, \ + const volScalarField& U, \ + const surfaceScalarField& Uf \ +) \ +{ \ + notImplemented(#SS"<scalar>::fvcDdtUfCorr"); \ + return surfaceScalarField::null(); \ +} \ + \ +template<> \ tmp<surfaceScalarField> SS<scalar>::fvcDdtPhiCorr \ ( \ - const volScalarField& rA, \ const volScalarField& rho, \ const volScalarField& U, \ const surfaceScalarField& phi \ diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C index 0a5dba394fd3164c74f4d5f6da758ecc7008534d..bc1b84f720f430eb82e90528fc388fe43130ba1f 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -375,56 +375,164 @@ localEulerDdtScheme<Type>::fvmDdt } +template<class Type> +tmp<typename localEulerDdtScheme<Type>::fluxFieldType> +localEulerDdtScheme<Type>::fvcDdtUfCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + IOobject ddtIOobject + ( + "ddtCorr(" + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + const surfaceScalarField rDeltaT(fvc::interpolate(localRDeltaT())); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff + ( + U.oldTime(), + (mesh().Sf() & Uf.oldTime()), + phiCorr + ) + *rDeltaT*phiCorr + ) + ); +} + + template<class Type> tmp<typename localEulerDdtScheme<Type>::fluxFieldType> localEulerDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { IOobject ddtIOobject ( - "ddtPhiCorr(" + rA.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - if (mesh().moving()) + const surfaceScalarField rDeltaT(fvc::interpolate(localRDeltaT())); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); +} + + +template<class Type> +tmp<typename localEulerDdtScheme<Type>::fluxFieldType> +localEulerDdtScheme<Type>::fvcDdtUfCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + IOobject ddtIOobject + ( + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ); + + const surfaceScalarField rDeltaT(fvc::interpolate(localRDeltaT())); + + if + ( + U.dimensions() == dimVelocity + && Uf.dimensions() == dimDensity*dimVelocity + ) { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(rhoU0)) + ); + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> + this->fvcDdtPhiCoeff ( - "0", - rA.dimensions()*phi.dimensions()/dimTime, - pTraits<typename flux<Type>::type>::zero + rhoU0, + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); } - else + else if + ( + U.dimensions() == dimDensity*dimVelocity + && Uf.dimensions() == dimDensity*dimVelocity + ) { - const volScalarField& rDeltaT = localRDeltaT(); + fluxFieldType phiCorr + ( + mesh().Sf() & (Uf.oldTime() - fvc::interpolate(U.oldTime())) + ); return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime())* + this->fvcDdtPhiCoeff ( - fvc::interpolate(rDeltaT*rA)*phi.oldTime() - - (fvc::interpolate(rDeltaT*rA*U.oldTime()) & mesh().Sf()) + U.oldTime(), + mesh().Sf() & Uf.oldTime(), + phiCorr ) + *rDeltaT*phiCorr ) ); } + else + { + FatalErrorIn + ( + "localEulerDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of Uf are not correct" + << abort(FatalError); + + return fluxFieldType::null(); + } } @@ -432,122 +540,76 @@ template<class Type> tmp<typename localEulerDdtScheme<Type>::fluxFieldType> localEulerDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) { + dimensionedScalar rDeltaT = 1.0/mesh().time().deltaT(); + IOobject ddtIOobject ( - "ddtPhiCorr(" - + rA.name() + ',' + rho.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + rho.name() + ',' + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() ); - if (mesh().moving()) + if + ( + U.dimensions() == dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { + GeometricField<Type, fvPatchField, volMesh> rhoU0 + ( + rho.oldTime()*U.oldTime() + ); + + fluxFieldType phiCorr + ( + phi.oldTime() - (mesh().Sf() & fvc::interpolate(rhoU0)) + ); + return tmp<fluxFieldType> ( new fluxFieldType ( ddtIOobject, - mesh(), - dimensioned<typename flux<Type>::type> - ( - "0", - rA.dimensions()*rho.dimensions()*phi.dimensions()/dimTime, - pTraits<typename flux<Type>::type>::zero - ) + this->fvcDdtPhiCoeff(rhoU0, phi.oldTime(), phiCorr) + *rDeltaT*phiCorr ) ); } - else + else if + ( + U.dimensions() == rho.dimensions()*dimVelocity + && phi.dimensions() == rho.dimensions()*dimVelocity*dimArea + ) { - const volScalarField& rDeltaT = localRDeltaT(); - - if + fluxFieldType phiCorr ( - U.dimensions() == dimVelocity - && phi.dimensions() == dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime()) - *( - fvc::interpolate(rDeltaT*rA*rho.oldTime())*phi.oldTime() - - (fvc::interpolate(rDeltaT*rA*rho.oldTime()*U.oldTime()) - & mesh().Sf()) - ) - ) - ); - } - else if + phi.oldTime() - (mesh().Sf() & fvc::interpolate(U.oldTime())) + ); + + return tmp<fluxFieldType> ( - U.dimensions() == dimVelocity - && phi.dimensions() == dimDensity*dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> + new fluxFieldType ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - ( - U.oldTime(), - phi.oldTime()/fvc::interpolate(rho.oldTime()) - ) - *( - fvc::interpolate(rDeltaT*rA*rho.oldTime()) - *phi.oldTime()/fvc::interpolate(rho.oldTime()) - - ( - fvc::interpolate - ( - rDeltaT*rA*rho.oldTime()*U.oldTime() - ) & mesh().Sf() - ) - ) - ) - ); - } - else if + ddtIOobject, + this->fvcDdtPhiCoeff(U.oldTime(), phi.oldTime(), phiCorr) + *rDeltaT*phiCorr + ) + ); + } + else + { + FatalErrorIn ( - U.dimensions() == dimDensity*dimVelocity - && phi.dimensions() == dimDensity*dimVelocity*dimArea - ) - { - return tmp<fluxFieldType> - ( - new fluxFieldType - ( - ddtIOobject, - this->fvcDdtPhiCoeff - (rho.oldTime(), U.oldTime(), phi.oldTime()) - * ( - fvc::interpolate(rDeltaT*rA)*phi.oldTime() - - ( - fvc::interpolate(rDeltaT*rA*U.oldTime())&mesh().Sf() - ) - ) - ) - ); - } - else - { - FatalErrorIn - ( - "localEulerDdtScheme<Type>::fvcDdtPhiCorr" - ) << "dimensions of phi are not correct" - << abort(FatalError); + "localEulerDdtScheme<Type>::fvcDdtPhiCorr" + ) << "dimensions of phi are not correct" + << abort(FatalError); - return fluxFieldType::null(); - } + return fluxFieldType::null(); } } diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H index e48fb3c19008ee16afbd5bb445e78a468939c4fa..c78f5891228c55b21c433493973a893e0a50b010 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/localEulerDdtScheme/localEulerDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -148,16 +148,27 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -170,10 +181,17 @@ public: }; +template<> +tmp<surfaceScalarField> localEulerDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> localEulerDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -182,7 +200,6 @@ tmp<surfaceScalarField> localEulerDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> localEulerDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.C index dacae6a10cf1461c8be83dd40fef6703d1792c87..f21a6a0b6f5cb85365dcfc61f73099a851edc9a5 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -219,11 +219,40 @@ steadyStateDdtScheme<Type>::fvmDdt } +template<class Type> +tmp<typename steadyStateDdtScheme<Type>::fluxFieldType> +steadyStateDdtScheme<Type>::fvcDdtUfCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + IOobject + ( + "ddtCorr(" + U.name() + ',' + Uf.name() + ')', + mesh().time().timeName(), + mesh() + ), + mesh(), + dimensioned<typename flux<Type>::type> + ( + "0", + mesh().Sf().dimensions()*Uf.dimensions()*dimArea/dimTime, + pTraits<typename flux<Type>::type>::zero + ) + ) + ); +} + + template<class Type> tmp<typename steadyStateDdtScheme<Type>::fluxFieldType> steadyStateDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ) @@ -234,8 +263,40 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr ( IOobject ( - "ddtPhiCorr(" - + rA.name() + ',' + U.name() + ',' + phi.name() + ')', + "ddtCorr(" + U.name() + ',' + phi.name() + ')', + mesh().time().timeName(), + mesh() + ), + mesh(), + dimensioned<typename flux<Type>::type> + ( + "0", + phi.dimensions()/dimTime, + pTraits<typename flux<Type>::type>::zero + ) + ) + ); +} + + +template<class Type> +tmp<typename steadyStateDdtScheme<Type>::fluxFieldType> +steadyStateDdtScheme<Type>::fvcDdtUfCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + return tmp<fluxFieldType> + ( + new fluxFieldType + ( + IOobject + ( + "ddtCorr(" + + rho.name() + + ',' + U.name() + ',' + Uf.name() + ')', mesh().time().timeName(), mesh() ), @@ -243,7 +304,7 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr dimensioned<typename flux<Type>::type> ( "0", - rA.dimensions()*phi.dimensions()/dimTime, + rho.dimensions()*Uf.dimensions()*dimArea/dimTime, pTraits<typename flux<Type>::type>::zero ) ) @@ -255,7 +316,6 @@ template<class Type> tmp<typename steadyStateDdtScheme<Type>::fluxFieldType> steadyStateDdtScheme<Type>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -267,8 +327,8 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr ( IOobject ( - "ddtPhiCorr(" - + rA.name() + ',' + rho.name() + "ddtCorr(" + + rho.name() + ',' + U.name() + ',' + phi.name() + ')', mesh().time().timeName(), mesh() @@ -277,7 +337,7 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr dimensioned<typename flux<Type>::type> ( "0", - rA.dimensions()*rho.dimensions()*phi.dimensions()/dimTime, + rho.dimensions()*phi.dimensions()/dimTime, pTraits<typename flux<Type>::type>::zero ) ) diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.H index ca2eebaefb726851dfe72d9913e56daeb761a2ba..ee2d6937a6df854cb5ac09fea8198a809c2d2775 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/steadyStateDdtScheme/steadyStateDdtScheme.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -135,16 +135,27 @@ public: typedef typename ddtScheme<Type>::fluxFieldType fluxFieldType; + tmp<fluxFieldType> fvcDdtUfCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi ); + tmp<fluxFieldType> fvcDdtUfCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + tmp<fluxFieldType> fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const fluxFieldType& phi @@ -157,10 +168,17 @@ public: }; +template<> +tmp<surfaceScalarField> steadyStateDdtScheme<scalar>::fvcDdtUfCorr +( + const GeometricField<scalar, fvPatchField, volMesh>& U, + const GeometricField<scalar, fvsPatchField, surfaceMesh>& Uf +); + + template<> tmp<surfaceScalarField> steadyStateDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& U, const surfaceScalarField& phi ); @@ -169,7 +187,6 @@ tmp<surfaceScalarField> steadyStateDdtScheme<scalar>::fvcDdtPhiCorr template<> tmp<surfaceScalarField> steadyStateDdtScheme<scalar>::fvcDdtPhiCorr ( - const volScalarField& rA, const volScalarField& rho, const volScalarField& U, const surfaceScalarField& phi diff --git a/src/finiteVolume/finiteVolume/fvc/fvcDdt.C b/src/finiteVolume/finiteVolume/fvc/fvcDdt.C index 8f36396a474af3dc358308888a5260c6ca22573f..729589f64501ff4677228e8d2821498fc91539f3 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcDdt.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcDdt.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,9 +128,24 @@ ddt template<class Type> tmp<GeometricField<typename flux<Type>::type, fvsPatchField, surfaceMesh> > -ddtPhiCorr +ddtCorr +( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + return fv::ddtScheme<Type>::New + ( + U.mesh(), + U.mesh().ddtScheme("ddt(" + U.name() + ')') + )().fvcDdtUfCorr(U, Uf); +} + + +template<class Type> +tmp<GeometricField<typename flux<Type>::type, fvsPatchField, surfaceMesh> > +ddtCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const GeometricField < @@ -144,15 +159,32 @@ ddtPhiCorr ( U.mesh(), U.mesh().ddtScheme("ddt(" + U.name() + ')') - )().fvcDdtPhiCorr(rA, U, phi); + )().fvcDdtPhiCorr(U, phi); +} + + +template<class Type> +tmp<GeometricField<typename flux<Type>::type, fvsPatchField, surfaceMesh> > +ddtCorr +( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf +) +{ + return fv::ddtScheme<Type>::New + ( + U.mesh(), + U.mesh().ddtScheme("ddt(" + U.name() + ')') + )().fvcDdtPhiCorr(rho, U, U.mesh().Sf() & Uf); + //***HGW fvcDdtUfCorr(rho, U, Uf); } template<class Type> tmp<GeometricField<typename flux<Type>::type, fvsPatchField, surfaceMesh> > -ddtPhiCorr +ddtCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const GeometricField @@ -167,7 +199,7 @@ ddtPhiCorr ( U.mesh(), U.mesh().ddtScheme("ddt(" + rho.name() + ',' + U.name() + ')') - )().fvcDdtPhiCorr(rA, rho, U, phi); + )().fvcDdtPhiCorr(rho, U, phi); } diff --git a/src/finiteVolume/finiteVolume/fvc/fvcDdt.H b/src/finiteVolume/finiteVolume/fvc/fvcDdt.H index 405b4cd65594e55c07047e8e738e09e04956d046..5aca4724690ab18e61b1f4d3905190ef787632e5 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcDdt.H +++ b/src/finiteVolume/finiteVolume/fvc/fvcDdt.H @@ -113,9 +113,24 @@ namespace fvc surfaceMesh > > - ddtPhiCorr + ddtCorr + ( + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + + template<class Type> + tmp + < + GeometricField + < + typename Foam::flux<Type>::type, + fvsPatchField, + surfaceMesh + > + > + ddtCorr ( - const volScalarField& rA, const GeometricField<Type, fvPatchField, volMesh>& U, const GeometricField < @@ -135,9 +150,25 @@ namespace fvc surfaceMesh > > - ddtPhiCorr + ddtCorr + ( + const volScalarField& rho, + const GeometricField<Type, fvPatchField, volMesh>& U, + const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf + ); + + template<class Type> + tmp + < + GeometricField + < + typename Foam::flux<Type>::type, + fvsPatchField, + surfaceMesh + > + > + ddtCorr ( - const volScalarField& rA, const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& U, const GeometricField diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.C b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.C index 5d2b1c2cfcceb84fc560bc238c6496562ebe5350..69c3f7777b95ea4b1a02a1d3d817673d55a7779b 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.C +++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.C @@ -182,7 +182,6 @@ Foam::surfaceZonesInfo::surfaceZonesInfo(const surfaceZonesInfo& surfZone) {} -// Get indices of unnamed surfaces (surfaces without faceZoneName) Foam::labelList Foam::surfaceZonesInfo::getUnnamedSurfaces ( const PtrList<surfaceZonesInfo>& surfList @@ -204,7 +203,6 @@ Foam::labelList Foam::surfaceZonesInfo::getUnnamedSurfaces } -// Get indices of named surfaces (surfaces with faceZoneName) Foam::labelList Foam::surfaceZonesInfo::getNamedSurfaces ( const PtrList<surfaceZonesInfo>& surfList @@ -230,7 +228,6 @@ Foam::labelList Foam::surfaceZonesInfo::getNamedSurfaces } -// Get indices of closed named surfaces Foam::labelList Foam::surfaceZonesInfo::getClosedNamedSurfaces ( const PtrList<surfaceZonesInfo>& surfList, @@ -263,7 +260,33 @@ Foam::labelList Foam::surfaceZonesInfo::getClosedNamedSurfaces } -// Get indices of closed named surfaces +Foam::labelList Foam::surfaceZonesInfo::getUnclosedNamedSurfaces +( + const PtrList<surfaceZonesInfo>& surfList, + const searchableSurfaces& allGeometry, + const labelList& surfaces +) +{ + labelList unclosed(surfList.size()); + + label unclosedI = 0; + forAll(surfList, surfI) + { + if + ( + surfList.set(surfI) + && !allGeometry[surfaces[surfI]].hasVolumeType() + ) + { + unclosed[unclosedI++] = surfI; + } + } + unclosed.setSize(unclosedI); + + return unclosed; +} + + Foam::labelList Foam::surfaceZonesInfo::getAllClosedNamedSurfaces ( const PtrList<surfaceZonesInfo>& surfList, @@ -292,7 +315,6 @@ Foam::labelList Foam::surfaceZonesInfo::getAllClosedNamedSurfaces } -// Get indices of named surfaces with a Foam::labelList Foam::surfaceZonesInfo::getInsidePointNamedSurfaces ( const PtrList<surfaceZonesInfo>& surfList diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.H b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.H index 39a48adcfd8c33983c21633ac439a1cbc2265cda..eb59aad34fab72539af60b17a02d55a2c05051e2 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.H +++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/surfaceZonesInfo.H @@ -199,6 +199,14 @@ public: const labelList& surfaces ); + //- Get indices of surfaces with a cellZone that are unclosed + static labelList getUnclosedNamedSurfaces + ( + const PtrList<surfaceZonesInfo>& surfList, + const searchableSurfaces& allGeometry, + const labelList& surfaces + ); + //- Get indices of surfaces with a cellZone that are closed. static labelList getAllClosedNamedSurfaces ( diff --git a/src/postProcessing/functionObjects/IO/controlDict b/src/postProcessing/functionObjects/IO/controlDict index 050086a8ebe35a26c2ca3a0ea684c4eafdcf52c2..aed0d13d014bcda4f000a120e78ae01273c4fe88 100644 --- a/src/postProcessing/functionObjects/IO/controlDict +++ b/src/postProcessing/functionObjects/IO/controlDict @@ -64,14 +64,24 @@ functions // region allowed. region wallFilmRegion; - // Execute upon outputTime + // Execute upon options: + // timeStep + // outputTime + // adjustableTime + // runTime + // clockTime + // cpuTime outputControl outputTime; // Objects (fields or lagrangian fields in any of the clouds) // to write every outputTime objectNames (p positions nParticle); + // Write as normal every writeInterval'th outputTime. - writeInterval 3; + outputInterval 1; // (timeStep, outputTime) + + // Interval of time (sec) to write down( + writeInterval 10.5 //(adjustableTime, runTime, clockTime, cpuTime) } dumpObjects @@ -84,9 +94,24 @@ functions // Where to load it from functionObjectLibs ("libIOFunctionObjects.so"); - // Execute upon outputTime + // Execute upon outputTime: + // timeStep + // outputTime + // adjustableTime + // runTime + // clockTime + // cpuTime outputControl outputTime; + // Is the object written by this function Object alone + exclusiveWriting true; + + // Interval of time (sec) to write down( + writeInterval 10.5 //(adjustableTime, runTime, clockTime, cpuTime) + + // Write as normal every writeInterval'th outputTime. + outputInterval 1; // (timeStep, outputTime) + // Objects to write objectNames (); } diff --git a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C index 6b1733ce02dc4f2b186e0d492a4899212685ce5c..c05abb5b2f4491c194f2644beaa0834dd204dba5 100644 --- a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C +++ b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C @@ -46,6 +46,7 @@ Foam::writeRegisteredObject::writeRegisteredObject ) : name_(name), + exclusiveWriting_(true), obr_(obr), objectNames_() { @@ -64,6 +65,7 @@ Foam::writeRegisteredObject::~writeRegisteredObject() void Foam::writeRegisteredObject::read(const dictionary& dict) { dict.lookup("objectNames") >> objectNames_; + dict.readIfPresent("exclusiveWriting", exclusiveWriting_); } @@ -96,12 +98,12 @@ void Foam::writeRegisteredObject::write() ( obr_.lookupObject<regIOobject>(objectNames_[i]) ); - // Switch off automatic writing to prevent double write - obj.writeOpt() = IOobject::NO_WRITE; - Info<< type() << " " << name_ << " output:" << nl - << " writing object " << obj.name() << nl - << endl; + if (exclusiveWriting_) + { + // Switch off automatic writing to prevent double write + obj.writeOpt() = IOobject::NO_WRITE; + } obj.write(); } diff --git a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H index 7159fad3fcddbe7ca124d44c4c3b0bbe90f83249..985d210dcf254221530b4208efb34765da815d63 100644 --- a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H +++ b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H @@ -28,8 +28,15 @@ Group grpIOFunctionObjects Description - This function object takes-over the writing of objects registered to the - database. + This function object allows specification of different writing frequency + of objects registered to the database. It has similar functionality + as the main time database through the outputControl setting: + timeStep + outputTime + adjustableTime + runTime + clockTime + cpuTime Example of function object specification: \verbatim @@ -37,6 +44,7 @@ Description { type writeRegisteredObject; functionObjectLibs ("libIOFunctionObjects.so"); + exclusiveWriting true; ... objectNames (obj1 obj2); } @@ -47,8 +55,12 @@ Description Property | Description | Required | Default value type | type name: writeRegisteredObject | yes | objectNames | objects to write | yes | + exclusiveWriting | Takes over object writing | no | yes \endtable + exclusiveWriting disables automatic writing (i.e through database) of the + objects to avoid duplicate writing. + SeeAlso Foam::functionObject Foam::OutputFilterFunctionObject @@ -89,6 +101,9 @@ protected: //- Name of this set of writeRegisteredObject word name_; + //- Takes over the writing from Db + bool exclusiveWriting_; + const objectRegistry& obr_; // Read from dictionary diff --git a/src/thermophysicalModels/solidChemistryModel/makeSolidChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/makeSolidChemistryModel.H index 7f24af81d6babfc994afde1d05a90ac7192d4137..f55698b4359f43d6dcd5a2d4a4feea6252847909 100644 --- a/src/thermophysicalModels/solidChemistryModel/makeSolidChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/makeSolidChemistryModel.H @@ -57,8 +57,7 @@ namespace Foam ( \ SS##Comp##SThermo##GThermo, \ (word(SS::typeName_()) + "<"#Comp"," + SThermo::typeName() + "," + \ - GThermo::typeName() + \ - ">").c_str(), \ + GThermo::typeName() + ">").c_str(), \ 0 \ ); diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H index 447020e2f7ded4490ab5b6b82d2f45d7846063eb..6eb8e9b81b5b9c5ff3a1226aeae8fe412b507981 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H @@ -52,8 +52,8 @@ namespace Foam defineTemplateTypeNameAndDebugWithName \ ( \ SS##Schem##Comp##SThermo##GThermo, \ - (#SS"<"#Schem"<"#Comp"," + SThermo::typeName() + "," \ - + GThermo::typeName() + ">>").c_str(), \ + (#SS"<" + word(Schem::typeName_()) + "<"#Comp"," + SThermo::typeName()\ + + "," + GThermo::typeName() + ">>").c_str(), \ 0 \ ); \ \ @@ -76,7 +76,6 @@ namespace Foam GThermo \ ); \ \ - \ makeSolidChemistrySolverType \ ( \ ode, \ diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H index ce1054c482eb3842869b621bbbe097075a61ee60..a0f0a31215fd74d43d939edcb4dab812d995c13e 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -70,7 +70,7 @@ SourceFiles \*---------------------------------------------------------------------------*/ #ifndef compressibleSpalartAllmaras_H -#define combressibleSpalartAllmaras_H +#define compressibleSpalartAllmaras_H #include "RASModel.H" #include "wallDist.H" diff --git a/tutorials/DNS/dnsFoam/boxTurb16/system/fvSchemes b/tutorials/DNS/dnsFoam/boxTurb16/system/fvSchemes index 21be868783efefebb220ba3e5cb6eda626c23672..a1802e439bf053265ec2af9cbfe8cbadd9f12228 100644 --- a/tutorials/DNS/dnsFoam/boxTurb16/system/fvSchemes +++ b/tutorials/DNS/dnsFoam/boxTurb16/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -35,15 +33,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/basic/potentialFoam/cylinder/system/fvSchemes b/tutorials/basic/potentialFoam/cylinder/system/fvSchemes index d91aeb9342212251d06b807573cbdd72019cc6bf..ed633c033c5861d60411a916f291e2eb1282f35e 100644 --- a/tutorials/basic/potentialFoam/cylinder/system/fvSchemes +++ b/tutorials/basic/potentialFoam/cylinder/system/fvSchemes @@ -32,8 +32,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/basic/potentialFoam/pitzDaily/system/fvSchemes b/tutorials/basic/potentialFoam/pitzDaily/system/fvSchemes index 63393b718a346a124b0708e0be19b0721350069f..076bce55b71f8d5797b4bb4d79cad9398b908181 100644 --- a/tutorials/basic/potentialFoam/pitzDaily/system/fvSchemes +++ b/tutorials/basic/potentialFoam/pitzDaily/system/fvSchemes @@ -32,8 +32,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/fvSchemes b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/fvSchemes index a3dcbfcc2e66654b9297106cde9a02c2d1ec37d7..b8943aa44f9d3c954f98a7358a47793c715b73bc 100644 --- a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/fvSchemes +++ b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/fvSchemes @@ -56,15 +56,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian((rho*inv((((1)*A(U))+tDragDcu))),p) Gauss linear limited corrected 0.333; - laplacian(Db,b) Gauss linear limited corrected 0.333; - laplacian(Db,ft) Gauss linear limited corrected 0.333; - laplacian(Db,ha) Gauss linear limited corrected 0.333; - laplacian(Db,hau) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes b/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes index 07e007d2755f959bfd312ecb009f764423c2a8b8..c23bdd6acf6dbc7fb319987d3c61a8941908b5e8 100644 --- a/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes +++ b/tutorials/combustion/XiFoam/ras/moriyoshiHomogeneous/system/fvSchemes @@ -54,16 +54,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; - laplacian(alphaEff,b) Gauss linear corrected; - laplacian(alphaEff,ft) Gauss linear corrected; - laplacian(alphaEff,ha) Gauss linear corrected; - laplacian(alphaEff,hau) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes index ce5f53c2cf9759f169675321eb09bc0b59cbb59b..2752126264917511a39b1f9255d4f5c7725309d1 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes @@ -46,14 +46,7 @@ divSchemes laplacianSchemes { - //default none; default Gauss linear corrected; - laplacian(muEff,U) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(thermo:alpha,h) Gauss linear corrected; - laplacian((((rho*(1|A(U)))*rho)*gh)) Gauss linear corrected; - laplacian(interpolate((rho*(1|A(U)))),p) Gauss linear corrected; - laplacian(gammaRad,G) Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes index afb9f402f103f655e60bcebdde33457f94302ce8..7ba1c2cc9d3e61f12a630003a6a8c55beaa363b2 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes @@ -33,6 +33,7 @@ laplacianSchemes { default none; laplacian(thermo:alpha,h) Gauss linear uncorrected; + laplacian(kappa,T) Gauss harmonic uncorrected; } interpolationSchemes diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes index 62fadfb8ca3ee3c2eca193b571f5637905547972..cec14e1fb5664e675ef48273068bdaec79d142f5 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -45,15 +44,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(mut,U) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DomegaEff,omega) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary index 0cd72ae7a4bf33c6026433acdb1aa85514555adf..2d2096ddc33a88afe285ab661e56c9d239439a44 100644 --- a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary +++ b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary @@ -22,77 +22,77 @@ FoamFile type patch; inGroups 1(inlet); nFaces 544; - startFace 244948; + startFace 245836; } outerInlet { type patch; inGroups 1(inlet); - nFaces 1396; - startFace 245492; + nFaces 1404; + startFace 246380; } innerOutlet { type patch; inGroups 1(outlet); nFaces 544; - startFace 246888; + startFace 247784; } outerOutlet { type patch; inGroups 1(outlet); - nFaces 1396; - startFace 247432; + nFaces 1404; + startFace 248328; } rotorBlades { type wall; inGroups 1(movingWalls); nFaces 540; - startFace 248828; + startFace 249732; } rotorBlades_slave { type wall; inGroups 1(movingWalls); nFaces 540; - startFace 249368; + startFace 250272; } shaft { type wall; inGroups 1(movingWalls); - nFaces 1052; - startFace 249908; + nFaces 1044; + startFace 250812; } statorBlades { type wall; inGroups 1(staticWalls); nFaces 2128; - startFace 250960; + startFace 251856; } statorBlades_slave { type wall; inGroups 1(staticWalls); nFaces 2128; - startFace 253088; + startFace 253984; } wall { type wall; inGroups 1(staticWalls); - nFaces 5808; - startFace 255216; + nFaces 6165; + startFace 256112; } AMI1 { type cyclicAMI; inGroups 1(cyclicAMI); nFaces 10944; - startFace 261024; + startFace 262277; matchTolerance 0.0001; transform noOrdering; neighbourPatch AMI2; @@ -102,7 +102,7 @@ FoamFile type cyclicAMI; inGroups 1(cyclicAMI); nFaces 10944; - startFace 271968; + startFace 273221; matchTolerance 0.0001; transform noOrdering; neighbourPatch AMI1; diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/polyMesh/boundary b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/polyMesh/boundary index 313dcceba1abd7b93d57320c4c674f1734692506..43b78ef4111bd17a26b37dd07818415f04eac737 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/polyMesh/boundary +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/polyMesh/boundary @@ -44,6 +44,7 @@ FoamFile frontAndBack { type empty; + inGroups 1(empty); nFaces 24450; startFace 24730; } diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes index de66185079e101550bf082894052c6f679fa3047..1b84b2505e498f793b10b3a9b6507df29b76de04 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes @@ -40,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DBEff,B) Gauss linear corrected; - laplacian(DmuTildaEff,muTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes index 391c95e6dc3d311d1bd639b18527b57799b74ceb..5d15eae6c0f2731cb45678ae30dbe052bab1d412 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -45,15 +44,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(mut,U) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DomegaEff,omega) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes index 0fa6ebaf3327be761be8e19e8622e7f1ffb22a20..d0a93e860b93be412bf3137da15c32fd44544d9d 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -45,15 +44,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear orthogonal; - laplacian(mut,U) Gauss linear orthogonal; - laplacian(DkEff,k) Gauss linear orthogonal; - laplacian(DepsilonEff,epsilon) Gauss linear orthogonal; - laplacian(DREff,R) Gauss linear orthogonal; - laplacian(DomegaEff,omega) Gauss linear orthogonal; - laplacian(Dp,p) Gauss linear orthogonal; - laplacian(alphaEff,h) Gauss linear orthogonal; + default Gauss linear orthogonal; } interpolationSchemes diff --git a/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/system/fvSchemes index d49880685b11175bebc06136d7a7de0372e73f8c..db6494d806a6983ce6d16d465f310d75de57098c 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/mixerVessel2D/system/fvSchemes @@ -38,18 +38,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes index 391c95e6dc3d311d1bd639b18527b57799b74ceb..5d15eae6c0f2731cb45678ae30dbe052bab1d412 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -45,15 +44,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(mut,U) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DomegaEff,omega) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes index e106336cb2dd0a748f8d4dc499995db3c8067024..f83203612eeb7cbf3a29817a1b9efa0d2b843c8c 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSchemes @@ -37,12 +37,7 @@ divSchemes laplacianSchemes { - laplacian(muEff,U) Gauss linear corrected; - laplacian(alphaEff,e) Gauss linear corrected; - laplacian((rho*rAU),p) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes index e106336cb2dd0a748f8d4dc499995db3c8067024..f83203612eeb7cbf3a29817a1b9efa0d2b843c8c 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSchemes @@ -37,12 +37,7 @@ divSchemes laplacianSchemes { - laplacian(muEff,U) Gauss linear corrected; - laplacian(alphaEff,e) Gauss linear corrected; - laplacian((rho*rAU),p) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSchemes b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSchemes index 576b46fe86e27be61a028433c302cce09643ec89..b4ca79e3c84b2e2290460c1907f0b8bfa48f60b1 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSchemes +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSchemes @@ -27,6 +27,8 @@ gradSchemes divSchemes { + default none; + div(phi,U) bounded Gauss upwind; div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,e) bounded Gauss upwind; @@ -37,11 +39,7 @@ divSchemes laplacianSchemes { - laplacian(muEff,U) Gauss linear corrected; - laplacian(alphaEff,e) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes index d58e73d6fc6d93e118d9916a9107e120752cce7d..4d56bbf40f8c91fbe7c0d4a2a2a94ec7399e31ac 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes @@ -44,6 +44,7 @@ laplacianSchemes interpolationSchemes { default linear; + hmm limitedLinear phi 1; } snGradSchemes diff --git a/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes b/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes index d1a9bb7aa1310b3bee441fbc1800724e6f19a0a3..0e2f9b22f723b9c5c125f2907059c06ef331d056 100644 --- a/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes +++ b/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -35,9 +34,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(mu,U) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/electromagnetics/mhdFoam/hartmann/system/fvSchemes b/tutorials/electromagnetics/mhdFoam/hartmann/system/fvSchemes index 34fc9a543d62ec60ad7f2b3b63268f04892d041b..26477dec7e2cb7aba6b48f0d22b12f8410e25e37 100644 --- a/tutorials/electromagnetics/mhdFoam/hartmann/system/fvSchemes +++ b/tutorials/electromagnetics/mhdFoam/hartmann/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad((DBU*magSqr(B))) Gauss linear; } divSchemes @@ -38,18 +36,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DB,B) Gauss linear corrected; - laplacian((1|A(B)),pB) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(HbyA) linear; - interpolate(B) linear; } snGradSchemes diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes index 4a18c080d1bb876fbecc64395bfd14a3f99f90d1..2ea94995ae82573e7c20c9b442a23e131f11b009 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/fvSchemes @@ -28,6 +28,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss upwind; div(phi,T) Gauss upwind; div(phi,k) Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear uncorrected; - laplacian(Dp,p_rgh) Gauss linear uncorrected; - laplacian(alphaEff,T) Gauss linear uncorrected; - laplacian(DkEff,k) Gauss linear uncorrected; - laplacian(DepsilonEff,epsilon) Gauss linear uncorrected; - laplacian(DREff,R) Gauss linear uncorrected; + default Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes index 44dc6e2a70328c5c5a4ebf5589a6a3fa580c66bc..7f51468ad721208001d1276b3872f8263a3be51e 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes @@ -28,6 +28,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss upwind; div(phi,T) bounded Gauss upwind; div(phi,k) bounded Gauss upwind; @@ -37,13 +38,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian(Dp,p_rgh) Gauss linear corrected; - laplacian(alphaEff,T) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSchemes b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSchemes index 3d626150a057254f115beff71789094347633cb8..bba4ac8e0c1ad1fc65b558695bd4fd9078df5447 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/fvSchemes @@ -28,6 +28,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss upwind; div(phi,T) bounded Gauss upwind; div(phi,k) bounded Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear limited corrected 0.333; - laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333; - laplacian(alphaEff,T) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian(DREff,R) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes index c52c053c84844fb84137797f741b112943bcd03a..ef0a3305cf88fc10ca676dcf1fd1f4c3cc882311 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss limitedLinear 0.2; div(phi,K) bounded Gauss limitedLinear 0.2; div(phi,h) bounded Gauss limitedLinear 0.2; @@ -38,13 +39,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear orthogonal; - laplacian(Dp,p_rgh) Gauss linear orthogonal; - laplacian(alphaEff,h) Gauss linear orthogonal; - laplacian(DkEff,k) Gauss linear orthogonal; - laplacian(DepsilonEff,epsilon) Gauss linear orthogonal; - laplacian(DomegaEff,omega) Gauss linear orthogonal; + default Gauss linear orthogonal; } interpolationSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSchemes index 573f34703a9caa6d446cff6e25b6aea3aa420249..2346e19d47ebb72ae1f89e3720cf9bc8d68ff5ca 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss limitedLinear 0.2; div(phi,K) bounded Gauss limitedLinear 0.2; div(phi,h) bounded Gauss limitedLinear 0.2; @@ -38,13 +39,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear uncorrected; - laplacian(Dp,p_rgh) Gauss linear uncorrected; - laplacian(alphaEff,h) Gauss linear uncorrected; - laplacian(DkEff,k) Gauss linear uncorrected; - laplacian(DepsilonEff,epsilon) Gauss linear uncorrected; - laplacian(DomegaEff,omega) Gauss linear uncorrected; + default Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes index c52c053c84844fb84137797f741b112943bcd03a..ef0a3305cf88fc10ca676dcf1fd1f4c3cc882311 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss limitedLinear 0.2; div(phi,K) bounded Gauss limitedLinear 0.2; div(phi,h) bounded Gauss limitedLinear 0.2; @@ -38,13 +39,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear orthogonal; - laplacian(Dp,p_rgh) Gauss linear orthogonal; - laplacian(alphaEff,h) Gauss linear orthogonal; - laplacian(DkEff,k) Gauss linear orthogonal; - laplacian(DepsilonEff,epsilon) Gauss linear orthogonal; - laplacian(DomegaEff,omega) Gauss linear orthogonal; + default Gauss linear orthogonal; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes index 74a1cb4a711975de201ca8ffec565f0518bc07b1..61edc1623f130e7cb1b0cd6b42c21db2957650ff 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes @@ -26,7 +26,8 @@ gradSchemes divSchemes { - default none; + default none; + div(phi,U) Gauss upwind; div(phi,K) Gauss linear; div(phi,h) Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.333; - laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333; - laplacian(alphaEff,h) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian(DREff,R) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes index 8dce282ff227254cd352e729ebea025dec7617b9..74d5623cb36bac0e4d0fbd7a33fa1a2b2c0b373b 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss upwind; div(phi,K) Gauss linear; div(phi,h) Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.333; - laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333; - laplacian(alphaEff,h) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian(DREff,R) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes index 8dce282ff227254cd352e729ebea025dec7617b9..e08f93840a7704b203c0462d445c5c44c8cc52f3 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss upwind; div(phi,K) Gauss linear; div(phi,h) Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.333; - laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333; - laplacian(alphaEff,h) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian(DREff,R) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes index 8dce282ff227254cd352e729ebea025dec7617b9..74d5623cb36bac0e4d0fbd7a33fa1a2b2c0b373b 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/topAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss upwind; div(phi,K) Gauss linear; div(phi,h) Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.333; - laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333; - laplacian(alphaEff,h) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian(DREff,R) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes index 8dce282ff227254cd352e729ebea025dec7617b9..74d5623cb36bac0e4d0fbd7a33fa1a2b2c0b373b 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss upwind; div(phi,K) Gauss linear; div(phi,h) Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.333; - laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333; - laplacian(alphaEff,h) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian(DREff,R) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes index 8dce282ff227254cd352e729ebea025dec7617b9..74d5623cb36bac0e4d0fbd7a33fa1a2b2c0b373b 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss upwind; div(phi,K) Gauss linear; div(phi,h) Gauss upwind; @@ -39,13 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.333; - laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333; - laplacian(alphaEff,h) Gauss linear limited corrected 0.333; - laplacian(DkEff,k) Gauss linear limited corrected 0.333; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333; - laplacian(DREff,R) Gauss linear limited corrected 0.333; + default Gauss linear limited corrected 0.333; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes index 2a65c2d5f05717f0c05c11ed67319e2bedc35748..c5c1935f60b6fa2abe3f518de193d7c408e580ff 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss upwind; div(phi,K) bounded Gauss upwind; div(phi,h) bounded Gauss upwind; @@ -40,13 +41,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear uncorrected; - laplacian(Dp,p_rgh) Gauss linear uncorrected; - laplacian(alphaEff,h) Gauss linear uncorrected; - laplacian(DkEff,k) Gauss linear uncorrected; - laplacian(DepsilonEff,epsilon) Gauss linear uncorrected; - laplacian(DREff,R) Gauss linear uncorrected; + default Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes index 1f8388eeb23a981e52db1780e53bd3c9c62dfc78..8acd8191b227f35b2b6ce6d7cb2eaec6fb46293f 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss upwind; div(phi,K) bounded Gauss upwind; div(phi,h) bounded Gauss upwind; @@ -40,13 +41,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear uncorrected; - laplacian(Dp,p_rgh) Gauss linear uncorrected; - laplacian(alphaEff,h) Gauss linear uncorrected; - laplacian(DkEff,k) Gauss linear uncorrected; - laplacian(DepsilonEff,epsilon) Gauss linear uncorrected; - laplacian(DREff,R) Gauss linear uncorrected; + default Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/bottomAir/fvSchemes index 02d978723c0fafff9f742bcec1a80b86c32ed6b1..127c9c965f09ae447303fa4f3c986d44faad8c1c 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/bottomAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss upwind; div(phi,K) bounded Gauss upwind; div(phi,h) bounded Gauss upwind; @@ -41,14 +42,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear uncorrected; - laplacian(Dp,p_rgh) Gauss linear uncorrected; - laplacian(alphaEff,h) Gauss linear uncorrected; - laplacian(DkEff,k) Gauss linear uncorrected; - laplacian(DepsilonEff,epsilon) Gauss linear uncorrected; - laplacian(DREff,R) Gauss linear uncorrected; - laplacian(gammaRad,G) Gauss linear uncorrected; + default Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/topAir/fvSchemes index 02d978723c0fafff9f742bcec1a80b86c32ed6b1..127c9c965f09ae447303fa4f3c986d44faad8c1c 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/topAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/topAir/fvSchemes @@ -27,6 +27,7 @@ gradSchemes divSchemes { default none; + div(phi,U) bounded Gauss upwind; div(phi,K) bounded Gauss upwind; div(phi,h) bounded Gauss upwind; @@ -41,14 +42,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear uncorrected; - laplacian(Dp,p_rgh) Gauss linear uncorrected; - laplacian(alphaEff,h) Gauss linear uncorrected; - laplacian(DkEff,k) Gauss linear uncorrected; - laplacian(DepsilonEff,epsilon) Gauss linear uncorrected; - laplacian(DREff,R) Gauss linear uncorrected; - laplacian(gammaRad,G) Gauss linear uncorrected; + default Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes index 5553c2789f4ea522536631402a3bf8a629dafe93..d930009138178fe3c31d34380127a9526a79ccc8 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/fvSchemes @@ -36,11 +36,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,Urel) Gauss linear corrected; - laplacian((1|A(Urel)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes b/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes index db947bf4a67f0327cc0727aa93622a891128aeab..bc9d3bc5971d167d4b34e69ef490be41c92587d6 100644 --- a/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes +++ b/tutorials/incompressible/SRFSimpleFoam/mixer/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(Urel) Gauss linear; } divSchemes @@ -42,14 +40,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,Urel) Gauss linear corrected; - laplacian((1|A(Urel)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DomegaEff,omega) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes b/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes index d06e77f4d583d16f16ddd54e4df7e1446fe11988..de12e1d3a84c6575e86fab044cb5339d71544506 100644 --- a/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes +++ b/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/fvSchemes @@ -23,9 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -44,21 +41,11 @@ divSchemes laplacianSchemes { default Gauss linear corrected; - - laplacian(nuEff,U) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; - laplacian(1|A(U),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - - laplacian(nuEff,Ua) Gauss linear corrected; - laplacian(1|A(Ua),pa) Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/icoFoam/cavity/system/fvSchemes b/tutorials/incompressible/icoFoam/cavity/system/fvSchemes index c311eb8961a0e5567560c8f89a87efadf31973fd..dede0a6cba11d8bd3422d7320ce5bc9cfb52a932 100644 --- a/tutorials/incompressible/icoFoam/cavity/system/fvSchemes +++ b/tutorials/incompressible/icoFoam/cavity/system/fvSchemes @@ -34,15 +34,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear orthogonal; - laplacian((1|A(U)),p) Gauss linear orthogonal; + default Gauss linear orthogonal; } interpolationSchemes { default linear; - interpolate(HbyA) linear; } snGradSchemes diff --git a/tutorials/incompressible/icoFoam/cavityClipped/system/fvSchemes b/tutorials/incompressible/icoFoam/cavityClipped/system/fvSchemes index c311eb8961a0e5567560c8f89a87efadf31973fd..dd463415d9cb2715f05f2352fcc2082e6a1e47ec 100644 --- a/tutorials/incompressible/icoFoam/cavityClipped/system/fvSchemes +++ b/tutorials/incompressible/icoFoam/cavityClipped/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -34,15 +33,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear orthogonal; - laplacian((1|A(U)),p) Gauss linear orthogonal; + default Gauss linear orthogonal; } interpolationSchemes { default linear; - interpolate(HbyA) linear; } snGradSchemes diff --git a/tutorials/incompressible/icoFoam/cavityGrade/system/fvSchemes b/tutorials/incompressible/icoFoam/cavityGrade/system/fvSchemes index b9f9c65223a75baf714478351d5dc3aae6cc3b11..ec51402ce5fb92d488c134b401a4c7e7e8a66570 100644 --- a/tutorials/incompressible/icoFoam/cavityGrade/system/fvSchemes +++ b/tutorials/incompressible/icoFoam/cavityGrade/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -34,15 +33,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(HbyA) linear; } snGradSchemes diff --git a/tutorials/incompressible/icoFoam/elbow/system/fvSchemes b/tutorials/incompressible/icoFoam/elbow/system/fvSchemes index a2b3dd2dcdaede1f322c61b9965ae531e8f26b01..2c4dcb7a1e7bbe5ba48db7506e1e404d2e7d31ff 100644 --- a/tutorials/incompressible/icoFoam/elbow/system/fvSchemes +++ b/tutorials/incompressible/icoFoam/elbow/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -34,15 +33,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(HbyA) linear; } snGradSchemes diff --git a/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/fvSchemes b/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/fvSchemes index e0b9b89cd8b402c4be0f1a93207b43a4af31258f..302740c3048d360b570170059d031b26e1f6e8ee 100644 --- a/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/fvSchemes +++ b/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/fvSchemes @@ -34,15 +34,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes index bfd86f807ade86e59da4c91215c4a31b15738f1f..14f066ebe92e9088c5e5fcf60ed9ec1a7be02d97 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes @@ -41,13 +41,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear limited corrected 0.5; - laplacian(DkEff,k) Gauss linear limited corrected 0.5; - laplacian(DREff,R) Gauss linear limited corrected 0.5; - laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.5; - laplacian((rho*(1|A(U))),p) Gauss linear limited corrected 0.5; - laplacian(alphaEff,e) Gauss linear limited corrected 0.5; + default Gauss linear limited corrected 0.5; } interpolationSchemes diff --git a/tutorials/incompressible/pimpleFoam/TJunction/system/fvSchemes b/tutorials/incompressible/pimpleFoam/TJunction/system/fvSchemes index 6a9eea83ddac00d64496b8bc5a959e22bb44e0ca..a59b75bee93cce703e32d22ec931eb2b7c68d201 100644 --- a/tutorials/incompressible/pimpleFoam/TJunction/system/fvSchemes +++ b/tutorials/incompressible/pimpleFoam/TJunction/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -41,19 +39,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict b/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict index 1ee58bdb3e6049364e4dcefdc221f66701d298fb..f70ad3e89bda2de93f8d64451856d211af71e2c9 100644 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict @@ -41,16 +41,14 @@ baffles name baffles; type wall; - XXX 9.8; patchFields { - epsilon { type epsilonWallFunction; Cmu 0.09; kappa 0.41; - E $Cmu; // XXX; //9.8; + E 9.8; value uniform 0; } k diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/system/fvSchemes b/tutorials/incompressible/pimpleFoam/TJunctionFan/system/fvSchemes index 6a9eea83ddac00d64496b8bc5a959e22bb44e0ca..a59b75bee93cce703e32d22ec931eb2b7c68d201 100644 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/system/fvSchemes +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -41,19 +39,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/pimpleFoam/channel395/system/fvSchemes b/tutorials/incompressible/pimpleFoam/channel395/system/fvSchemes index 3a969f90664b2b35cc74d00e97f4ca0edc835c9b..6d5ef5ab979d770638c5961247d7126896a71089 100644 --- a/tutorials/incompressible/pimpleFoam/channel395/system/fvSchemes +++ b/tutorials/incompressible/pimpleFoam/channel395/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -40,18 +38,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DBEff,B) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes index 5bfe52ccaee08bd833a74978f36323a867847f2e..898761e5e6b0afa29e829acbf5b34c6a2416c835 100644 --- a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes @@ -42,15 +42,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(alphaTEff,omega) Gauss linear corrected; - laplacian(alphaTEff,kt) Gauss linear corrected; - laplacian(nu,kl) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/incompressible/pisoFoam/les/pitzDaily/system/fvSchemes b/tutorials/incompressible/pisoFoam/les/pitzDaily/system/fvSchemes index ed36d4184f96df662a5c982b83124888ee909da5..45cce4ef17799b018c26509fa6705589b10b3160 100644 --- a/tutorials/incompressible/pisoFoam/les/pitzDaily/system/fvSchemes +++ b/tutorials/incompressible/pisoFoam/les/pitzDaily/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -40,18 +38,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DBEff,B) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes b/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes index c354900be1e97ef45c4cbe9d3fc323f3049287df..51df032f74ff1cad6526ba7c5f0656a220691310 100644 --- a/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes +++ b/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -40,18 +38,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DBEff,B) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/pisoFoam/ras/cavity/system/fvSchemes b/tutorials/incompressible/pisoFoam/ras/cavity/system/fvSchemes index 6a9eea83ddac00d64496b8bc5a959e22bb44e0ca..a59b75bee93cce703e32d22ec931eb2b7c68d201 100644 --- a/tutorials/incompressible/pisoFoam/ras/cavity/system/fvSchemes +++ b/tutorials/incompressible/pisoFoam/ras/cavity/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -41,19 +39,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes index 6a9eea83ddac00d64496b8bc5a959e22bb44e0ca..a59b75bee93cce703e32d22ec931eb2b7c68d201 100644 --- a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -41,19 +39,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes index fbd760de1fb64e6a56ca0b2b9a1f97f1f6a737a4..5db0abc188c7a3960414a9cf6653a00d2547317b 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes @@ -23,12 +23,12 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(U) Gauss linear; - grad(p) Gauss linear; } divSchemes { + default none; + div(phi,U) bounded Gauss upwind; div((nuEff*dev(T(grad(U))))) Gauss linear; div(phi,epsilon) bounded Gauss upwind; @@ -37,11 +37,7 @@ divSchemes laplacianSchemes { - laplacian(nuEff,U) Gauss linear corrected; - laplacian(rAU,p) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes index fbd760de1fb64e6a56ca0b2b9a1f97f1f6a737a4..9376d23004a0d33d568a61305b490b973b497eea 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes @@ -23,12 +23,12 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(U) Gauss linear; - grad(p) Gauss linear; } divSchemes { + default none; + div(phi,U) bounded Gauss upwind; div((nuEff*dev(T(grad(U))))) Gauss linear; div(phi,epsilon) bounded Gauss upwind; @@ -37,11 +37,7 @@ divSchemes laplacianSchemes { - laplacian(nuEff,U) Gauss linear corrected; - laplacian(rAU,p) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes index 036a75cf3c9a39cc390a99659f9a47b3ca2299ab..82039ee1fcf160e9aa99ea10a0a6d55a91265680 100644 --- a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes @@ -27,7 +27,7 @@ gradSchemes divSchemes { default none; - div(phiv,hU) Gauss linear; + div(phiv,hU) Gauss LUST un; } laplacianSchemes diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution index 0dac22874f9ff3aab5fadf5251e509d74bcf52d1..76309729fe2fdd3bea58e74598d972dd63a27b86 100644 --- a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution @@ -20,14 +20,14 @@ solvers { solver PCG; preconditioner DIC; - tolerance 1e-6; + tolerance 1e-10; relTol 0.01; } hFinal { $h; - tolerance 1e-8; + tolerance 1e-10; relTol 0; } @@ -35,14 +35,14 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-6; + tolerance 1e-10; relTol 0.1; } hUFinal { $hU; - tolerance 1e-6; + tolerance 1e-10; relTol 0; } } diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes b/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes index bd2f1c8952d59687b33c496bccf2f7b385e91bc8..e0aad005a353930b9ce048b48877f37b23a9b59f 100644 --- a/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/airFoil2D/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -37,17 +35,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/simpleFoam/mixerVessel2D/system/fvSchemes b/tutorials/incompressible/simpleFoam/mixerVessel2D/system/fvSchemes index d4699567a4007dba4e44ca3d318547cff6deaf25..dddcf6c24b88f94a42dfcb2a0ea104245351b5d2 100644 --- a/tutorials/incompressible/simpleFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/mixerVessel2D/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -38,17 +36,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/system/fvSchemes b/tutorials/incompressible/simpleFoam/pipeCyclic/system/fvSchemes index 51aa595facf2d12988dfdb4e53522cb150de2ee4..eb56b2a74bdb490b3b878c68fb8ede03e32f0521 100644 --- a/tutorials/incompressible/simpleFoam/pipeCyclic/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/pipeCyclic/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -41,19 +39,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/simpleFoam/pitzDaily/system/fvSchemes b/tutorials/incompressible/simpleFoam/pitzDaily/system/fvSchemes index 540ac90b64c61b981cea3dc2b7fc10f6a8293ebc..821adc7eb93b84614dfb5c52c78cdd864294077d 100644 --- a/tutorials/incompressible/simpleFoam/pitzDaily/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/pitzDaily/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -41,19 +39,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/fvSchemes b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/fvSchemes index 540ac90b64c61b981cea3dc2b7fc10f6a8293ebc..821adc7eb93b84614dfb5c52c78cdd864294077d 100644 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/fvSchemes @@ -23,8 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes @@ -41,19 +39,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nuEff,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes index 1dcd78d42c4c538da5027f9ea95421fcafd462c9..3bcfc65ff8bec34e95048127df5328590540eb11 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes @@ -23,12 +23,12 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes { default none; + div(phi,U) Gauss upwind; div(phid,p) Gauss upwind; div(phi,K) Gauss linear; @@ -43,13 +43,6 @@ divSchemes laplacianSchemes { default Gauss linear orthogonal; - laplacian(muEff,U) Gauss linear orthogonal; - laplacian(mut,U) Gauss linear orthogonal; - laplacian(DkEff,k) Gauss linear orthogonal; - laplacian(DepsilonEff,epsilon) Gauss linear orthogonal; - laplacian(DREff,R) Gauss linear orthogonal; - laplacian((rho*(1|A(U))),p) Gauss linear orthogonal; - laplacian(alphaEff,h) Gauss linear orthogonal; } interpolationSchemes diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSchemes b/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSchemes index dc13503bc633d18d9c900d4b7371c6ab0afd7d5f..cbdf8c0b4aa36c2fd55c51040dd85e55619172b3 100644 --- a/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSchemes +++ b/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSchemes @@ -23,12 +23,12 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes { default none; + div(phi,U) Gauss upwind; div(phid,p) Gauss upwind; div(phi,K) Gauss linear; @@ -43,13 +43,6 @@ divSchemes laplacianSchemes { default Gauss linear corrected; - laplacian(muEff,U) Gauss linear corrected; - laplacian(mut,U) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/system/fvSchemes b/tutorials/lagrangian/sprayFoam/aachenBomb/system/fvSchemes index 03bad8820053974072855c1ca519f75bfc2822d7..c4a6d627c3a08fdc48941a30cfb442e3cdf47860 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/system/fvSchemes +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/system/fvSchemes @@ -23,12 +23,12 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes { default none; + div(phi,U) Gauss upwind; div(phid,p) Gauss upwind; div(phi,K) Gauss linear; @@ -42,13 +42,6 @@ divSchemes laplacianSchemes { default Gauss linear orthogonal; - laplacian(muEff,U) Gauss linear orthogonal; - laplacian(mut,U) Gauss linear orthogonal; - laplacian(DkEff,k) Gauss linear orthogonal; - laplacian(DepsilonEff,epsilon) Gauss linear orthogonal; - laplacian(DREff,R) Gauss linear orthogonal; - laplacian((rho*(1|A(U))),p) Gauss linear orthogonal; - laplacian(alphaEff,h) Gauss linear orthogonal; } interpolationSchemes diff --git a/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/fvSchemes b/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/fvSchemes index efebfd591455bcc67613dc94ae6caf4baef1363f..633d26bfba972355b2f83e8e3749080c050d05c8 100644 --- a/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/fvSchemes +++ b/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/fvSchemes @@ -23,7 +23,6 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; } divSchemes @@ -34,17 +33,12 @@ divSchemes laplacianSchemes { - default none; - laplacian(nu,U) Gauss linear corrected; - laplacian((1|A(U)),p) Gauss linear corrected; - laplacian(diffusivity,cellDisplacement) Gauss linear corrected; - laplacian(diffusivity,cellMotionU) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes { default linear; - interpolate(HbyA) linear; } snGradSchemes diff --git a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary index 292f25b806357d9df75c7731f74dee0ec0aa3a40..188a0f0c58b018d912058f8471d3a283847f7b01 100644 --- a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary +++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary @@ -32,12 +32,14 @@ FoamFile front { type empty; + inGroups 1(empty); nFaces 3072; startFace 6336; } back { type empty; + inGroups 1(empty); nFaces 3072; startFace 9408; } diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes index 08a4e20e6b535bf4f6e40aa4a780238af6bbec17..6b7b46498bad6982b85af784e37593b2c66ed03d 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes @@ -41,18 +41,12 @@ gradSchemes laplacianSchemes { - default none; - laplacian(nuf,rhoU) Gauss linear corrected; - laplacian(muEff,U) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } snGradSchemes { - default none; - snGrad(p) corrected; + default corrected; } fluxRequired diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes index 08a4e20e6b535bf4f6e40aa4a780238af6bbec17..f7e2958bf698a4a9a584eacd30c53afc53c05c9c 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes @@ -28,6 +28,7 @@ interpolationSchemes divSchemes { default none; + div(phiv,rho) Gauss vanLeer; div(phi,U) Gauss LUST grad(U); div(phiv,k) Gauss LUST grad(k); @@ -41,18 +42,12 @@ gradSchemes laplacianSchemes { - default none; - laplacian(nuf,rhoU) Gauss linear corrected; - laplacian(muEff,U) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } snGradSchemes { - default none; - snGrad(p) corrected; + default corrected; } fluxRequired diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes index 32379fb2c2bd82a8a82c7ce40705b1c31dba608f..6f20de56af0d4a1c61822dd71c3446b57cab7e0f 100644 --- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes @@ -42,13 +42,7 @@ gradSchemes laplacianSchemes { - default none; - laplacian(nuf,rhoU) Gauss linear corrected; - laplacian(muEff,U) Gauss linear corrected; - laplacian(Dp,p) Gauss linear corrected; - laplacian(DomegaEff,omega) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(1,p) Gauss linear corrected; + default Gauss linear corrected; } snGradSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/dynamicMeshDict index f9baf8b3e1dc5287f42a27d4debb5a7713d609d3..6c2f78df72ac14f3681a8d56f6a0f381841f43dd 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/dynamicMeshDict +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/constant/dynamicMeshDict @@ -39,9 +39,7 @@ dynamicRefineFvMeshCoeffs // on surfaceScalarFields that do not need to be reinterpolated. correctFluxes ( - (phi Urel) - (phiAbs U) - (phiAbs_0 U_0) + (phi none) (nHatf none) (rho*phi none) (ghf none) diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/boundary index 0e7b589d2c7507133274d3bf767ccc08e80b11e5..cf4e8be38fdc128a6b6335de1c11453cdd39bcf9 100644 --- a/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/boundary +++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/constant/polyMesh/boundary @@ -38,6 +38,7 @@ FoamFile frontAndBack { type empty; + inGroups 1(empty); nFaces 16000; startFace 16420; } diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary index 41c06d5f3f4d03c47e0a53a8d3008451786eda15..1b4dbb60aaeaec2d5cfe40e3d4a35843d35b44a2 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary +++ b/tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary @@ -44,6 +44,7 @@ FoamFile defaultFaces { type empty; + inGroups 1(empty); nFaces 4536; startFace 4640; } diff --git a/tutorials/multiphase/interFoam/ras/damBreak/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/ras/damBreak/constant/polyMesh/boundary index 41c06d5f3f4d03c47e0a53a8d3008451786eda15..1b4dbb60aaeaec2d5cfe40e3d4a35843d35b44a2 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/constant/polyMesh/boundary +++ b/tutorials/multiphase/interFoam/ras/damBreak/constant/polyMesh/boundary @@ -44,6 +44,7 @@ FoamFile defaultFaces { type empty; + inGroups 1(empty); nFaces 4536; startFace 4640; } diff --git a/tutorials/multiphase/interFoam/ras/weirOverflow/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/ras/weirOverflow/constant/polyMesh/boundary index e7fe171353ef2ef89026649538494718c28d655c..4b7a214d35fe200d3c22a5077b7d707e5f2119d2 100644 --- a/tutorials/multiphase/interFoam/ras/weirOverflow/constant/polyMesh/boundary +++ b/tutorials/multiphase/interFoam/ras/weirOverflow/constant/polyMesh/boundary @@ -44,6 +44,7 @@ FoamFile defaultFaces { type empty; + inGroups 1(empty); nFaces 10160; startFace 10339; } diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean b/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean index 781018201d43b3b588ce9738c5acd428860aa827..d6094819b8ce635eb9743a2be55486289b4a8406 100755 --- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean @@ -2,6 +2,7 @@ cd ${0%/*} || exit 1 # run from this directory foamCleanTutorials cases -rm -rf 0/alpha[1-3] 0/alpha[1-3].gz +rm -rf alpha.air alpha.other alpha.water \ + alpha.air.gz alpha.other.gz alpha.water.gz # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary index b393a341aa9050a1e62b9a41d3847adca5c6db7e..8b9ef8e645041c16a8f156769cc5d6f6d74a0456 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary @@ -32,13 +32,14 @@ FoamFile walls { type symmetryPlane; + inGroups 1(symmetryPlane); nFaces 3000; startFace 1130431; } bullet { type wall; - nFaces 37743; + nFaces 37752; startFace 1133431; } ) diff --git a/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes b/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes index 026c549f6cc9e8ba363e2f68bf3632b42f9d9c95..49ebc8609b535b0a4d9a7afd86ae1e75f4928930 100644 --- a/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes +++ b/tutorials/multiphase/settlingFoam/ras/dahl/system/fvSchemes @@ -28,6 +28,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss linearUpwind grad(U); div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; @@ -37,12 +38,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(Dp,p_rgh) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(mut,Alpha) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes b/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes index ffdb15771e3f39d065b66a255d0529a0aad5a82e..4bd3ba1812ee6c8af34ec51957df0292755fc5fd 100644 --- a/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes +++ b/tutorials/multiphase/settlingFoam/ras/tank3D/system/fvSchemes @@ -28,6 +28,7 @@ gradSchemes divSchemes { default none; + div(phi,U) Gauss limitedLinearV 1; div(phi,k) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1; @@ -37,12 +38,7 @@ divSchemes laplacianSchemes { - default none; - laplacian(muEff,U) Gauss linear corrected; - laplacian(Dp,p_rgh) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(mut,Alpha) Gauss linear corrected; + default Gauss linear corrected; } interpolationSchemes