diff --git a/applications/solvers/DNS/dnsFoam/dnsFoam.C b/applications/solvers/DNS/dnsFoam/dnsFoam.C index eb1e69c41b..34f212bc4d 100644 --- a/applications/solvers/DNS/dnsFoam/dnsFoam.C +++ b/applications/solvers/DNS/dnsFoam/dnsFoam.C @@ -85,15 +85,15 @@ int main(int argc, char *argv[]) for (int corr=1; corr<=1; corr++) { - volScalarField rUA = 1.0/UEqn.A(); + volScalarField rAU = 1.0/UEqn.A(); - U = rUA*UEqn.H(); + U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, U, phi); + + fvc::ddtPhiCorr(rAU, U, phi); fvScalarMatrix pEqn ( - fvm::laplacian(rUA, p) == fvc::div(phi) + fvm::laplacian(rAU, p) == fvc::div(phi) ); pEqn.solve(); @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) #include "continuityErrs.H" - U -= rUA*fvc::grad(p); + U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); } diff --git a/applications/solvers/combustion/PDRFoam/pEqn.H b/applications/solvers/combustion/PDRFoam/pEqn.H index 524c8eac74..9042837f54 100644 --- a/applications/solvers/combustion/PDRFoam/pEqn.H +++ b/applications/solvers/combustion/PDRFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn.A(); +volScalarField rAU = 1.0/UEqn.A(); U = invA & UEqn.H(); if (transonic) @@ -11,7 +11,7 @@ if (transonic) fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); @@ -38,7 +38,7 @@ else fvc::interpolate(rho)* ( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index 9443f909a3..3d414f4af6 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn.A(); -U = rUA*UEqn.H(); +volScalarField rAU = 1.0/UEqn.A(); +U = rAU*UEqn.H(); if (transonic) { @@ -11,7 +11,7 @@ if (transonic) fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); @@ -21,7 +21,7 @@ if (transonic) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve(); @@ -38,7 +38,7 @@ else fvc::interpolate(rho) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) @@ -47,7 +47,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve(); @@ -62,7 +62,7 @@ else #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/combustion/dieselFoam/pEqn.H b/applications/solvers/combustion/dieselFoam/pEqn.H index d74947fe53..f1b66877a0 100644 --- a/applications/solvers/combustion/dieselFoam/pEqn.H +++ b/applications/solvers/combustion/dieselFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn.A(); -U = rUA*UEqn.H(); +volScalarField rAU = 1.0/UEqn.A(); +U = rAU*UEqn.H(); if (transonic) { @@ -11,7 +11,7 @@ if (transonic) fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); @@ -21,7 +21,7 @@ if (transonic) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) == Sevap ); @@ -40,7 +40,7 @@ else fvc::interpolate(rho) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) @@ -49,7 +49,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) == Sevap ); @@ -66,7 +66,7 @@ else #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index 39b4967312..913180f794 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn.A(); -U = rUA*UEqn.H(); +volScalarField rAU = 1.0/UEqn.A(); +U = rAU*UEqn.H(); if (transonic) { @@ -18,7 +18,7 @@ if (transonic) ( fvm::ddt(psi, p) + fvm::div(phid, p, "div(phid,p)") - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve(); @@ -40,7 +40,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve(); @@ -55,7 +55,7 @@ else #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index b31a7c6636..135b55d879 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -1,29 +1,29 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn.A(); -surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); -U = rUA*UEqn.H(); +volScalarField rAU = 1.0/UEqn.A(); +surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); +U = rAU*UEqn.H(); surfaceScalarField phiU ( fvc::interpolate(rho) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); -phi = phiU - rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf(); +phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - surfaceScalarField rhorUAf = fvc::interpolate(rho*rUA); + surfaceScalarField rhorAUf = fvc::interpolate(rho*rAU); fvScalarMatrix p_rghEqn ( fvm::ddt(psi, p_rgh) + fvc::ddt(psi, rho)*gh + fvc::div(phi) - - fvm::laplacian(rhorUAf, p_rgh) + - fvm::laplacian(rhorAUf, p_rgh) ); p_rghEqn.solve @@ -52,7 +52,7 @@ p = p_rgh + rho*gh; #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf); +U += rAU*fvc::reconstruct((phi - phiU)/rhorAUf); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 9443f909a3..3d414f4af6 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn.A(); -U = rUA*UEqn.H(); +volScalarField rAU = 1.0/UEqn.A(); +U = rAU*UEqn.H(); if (transonic) { @@ -11,7 +11,7 @@ if (transonic) fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); @@ -21,7 +21,7 @@ if (transonic) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve(); @@ -38,7 +38,7 @@ else fvc::interpolate(rho) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) @@ -47,7 +47,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve(); @@ -62,7 +62,7 @@ else #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H index c76ab5110b..45ae3c1e5f 100644 --- a/applications/solvers/combustion/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -5,14 +5,14 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rUA = 1.0/UEqn.A(); - U = rUA*UEqn.H(); + volScalarField rAU = 1.0/UEqn.A(); + U = rAU*UEqn.H(); if (transonic) { surfaceScalarField phiv = (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi); + + fvc::ddtPhiCorr(rAU, rho, U, phi); phi = fvc::interpolate(rho)*phiv; @@ -28,7 +28,7 @@ ( fvc::ddt(rho) + fvc::div(phi) + correction(fvm::ddt(psi, p) + fvm::div(phid, p)) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve @@ -58,7 +58,7 @@ fvc::interpolate(rho) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) @@ -67,7 +67,7 @@ ( fvc::ddt(rho) + psi*correction(fvm::ddt(p)) + fvc::div(phi) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve @@ -98,7 +98,7 @@ #include "rhoEqn.H" #include "compressibleContinuityErrs.H" - U -= rUA*fvc::grad(p); + U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H index 954907d203..45aa8f7790 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H @@ -9,7 +9,7 @@ tmp UEqn UEqn().relax(); -volScalarField rUA = 1.0/UEqn().A(); +volScalarField rAU = 1.0/UEqn().A(); if (momentumPredictor) { @@ -17,6 +17,6 @@ if (momentumPredictor) } else { - U = rUA*(UEqn().H() - fvc::grad(p)); + U = rAU*(UEqn().H() - fvc::grad(p)); U.correctBoundaryConditions(); } diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index c0dba194e7..84e6451890 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -U = rUA*UEqn().H(); +U = rAU*UEqn().H(); if (nCorr <= 1) { @@ -15,7 +15,7 @@ if (transonic) fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); @@ -25,7 +25,7 @@ if (transonic) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve @@ -55,7 +55,7 @@ else fvc::interpolate(rho)* ( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) @@ -65,7 +65,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve @@ -101,7 +101,7 @@ rho = thermo.rho(); Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H index a331d7dbb8..0b0364b706 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H @@ -12,7 +12,7 @@ UEqn().relax(); mrfZones.addCoriolis(rho, UEqn()); pZones.addResistance(UEqn()); -volScalarField rUA = 1.0/UEqn().A(); +volScalarField rAU = 1.0/UEqn().A(); if (momentumPredictor) { @@ -20,6 +20,6 @@ if (momentumPredictor) } else { - U = rUA*(UEqn().H() - fvc::grad(p)); + U = rAU*(UEqn().H() - fvc::grad(p)); U.correctBoundaryConditions(); } diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H index 6be6584202..590a3c1950 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn().A(); -U = rUA*UEqn().H(); +volScalarField rAU = 1.0/UEqn().A(); +U = rAU*UEqn().H(); if (nCorr <= 1) { @@ -16,7 +16,7 @@ if (transonic) fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); mrfZones.relativeFlux(fvc::interpolate(psi), phid); @@ -27,7 +27,7 @@ if (transonic) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve @@ -57,7 +57,7 @@ else fvc::interpolate(rho)* ( (fvc::interpolate(U) & mesh.Sf()) - //+ fvc::ddtPhiCorr(rUA, rho, U, phi) + //+ fvc::ddtPhiCorr(rAU, rho, U, phi) ); mrfZones.relativeFlux(fvc::interpolate(rho), phi); @@ -68,7 +68,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve @@ -109,7 +109,7 @@ else << " " << min(rho).value() << endl; } -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 96d8280559..a082cac880 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -3,8 +3,8 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField rUA = 1.0/UEqn().A(); -U = rUA*UEqn().H(); +volScalarField rAU = 1.0/UEqn().A(); +U = rAU*UEqn().H(); UEqn.clear(); bool closedVolume = false; @@ -22,7 +22,7 @@ if (transonic) fvScalarMatrix pEqn ( fvm::div(phid, p) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); // Relax the pressure equation to ensure diagonal-dominance @@ -47,7 +47,7 @@ else { fvScalarMatrix pEqn ( - fvm::laplacian(rho*rUA, p) == fvc::div(phi) + fvm::laplacian(rho*rAU, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); @@ -67,7 +67,7 @@ else // Explicitly relax pressure for momentum corrector p.relax(); -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); // For closed-volume cases adjust the pressure and density levels diff --git a/applications/solvers/compressible/rhoSonicFoam/Make/files b/applications/solvers/compressible/rhoSonicFoam/Make/files deleted file mode 100644 index 96e7916887..0000000000 --- a/applications/solvers/compressible/rhoSonicFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -rhoSonicFoam.C - -EXE = $(FOAM_APPBIN)/rhoSonicFoam diff --git a/applications/solvers/compressible/rhoSonicFoam/Make/options b/applications/solvers/compressible/rhoSonicFoam/Make/options deleted file mode 100644 index 725122ea1d..0000000000 --- a/applications/solvers/compressible/rhoSonicFoam/Make/options +++ /dev/null @@ -1,4 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = -lfiniteVolume diff --git a/applications/solvers/compressible/rhoSonicFoam/compressibleContinuityErrs.H b/applications/solvers/compressible/rhoSonicFoam/compressibleContinuityErrs.H deleted file mode 100644 index 128d99c946..0000000000 --- a/applications/solvers/compressible/rhoSonicFoam/compressibleContinuityErrs.H +++ /dev/null @@ -1,12 +0,0 @@ -{ -# include "rhoEqn.H" -} -{ - scalar sumLocalContErr = (sum(mag(rho - psi*p))/sum(rho)).value(); - scalar globalContErr = (sum(rho - psi*p)/sum(rho)).value(); - cumulativeContErr += globalContErr; - - Info<< "time step continuity errors : sum local = " << sumLocalContErr - << ", global = " << globalContErr - << ", cumulative = " << cumulativeContErr << endl; -} diff --git a/applications/solvers/compressible/rhoSonicFoam/createFields.H b/applications/solvers/compressible/rhoSonicFoam/createFields.H deleted file mode 100644 index f0c0e4a22a..0000000000 --- a/applications/solvers/compressible/rhoSonicFoam/createFields.H +++ /dev/null @@ -1,96 +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 T\n" << endl; - volScalarField T - ( - IOobject - ( - "T", - 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 - ); - - volScalarField psi - ( - IOobject - ( - "psi", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - 1.0/(R*T) - ); - psi.oldTime(); - - volScalarField rho - ( - IOobject - ( - "rho", - runTime.timeName(), - mesh - ), - psi*p, - p.boundaryField().types() - ); - - volVectorField rhoU - ( - IOobject - ( - "rhoU", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - rho*U, - U.boundaryField().types() - ); - - volScalarField rhoE - ( - IOobject - ( - "rhoE", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - rho*Cv*T + 0.5*rho*magSqr(rhoU/rho), - T.boundaryField().types() - ); diff --git a/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H b/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H deleted file mode 100644 index 4e19adaae4..0000000000 --- a/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H +++ /dev/null @@ -1,23 +0,0 @@ - Info<< "Reading thermodynamicProperties\n" << endl; - - IOdictionary thermodynamicProperties - ( - IOobject - ( - "thermodynamicProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar R - ( - thermodynamicProperties.lookup("R") - ); - - dimensionedScalar Cv - ( - thermodynamicProperties.lookup("Cv") - ); diff --git a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C b/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C deleted file mode 100644 index 23936fc2c4..0000000000 --- a/applications/solvers/compressible/rhoSonicFoam/rhoSonicFoam.C +++ /dev/null @@ -1,129 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ 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 . - -Application - rhoSonicFoam - -Description - Density-based compressible flow solver. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readThermodynamicProperties.H" -# include "createFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - surfaceScalarField phiv - ( - IOobject - ( - "phiv", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - fvc::interpolate(rhoU)/fvc::interpolate(rho) & mesh.Sf() - ); - - scalar CoNum = max - ( - mesh.surfaceInterpolation::deltaCoeffs() - *mag(phiv)/mesh.magSf() - ).value()*runTime.deltaTValue(); - - Info<< "\nMax Courant Number = " << CoNum << endl; - - solve - ( - fvm::ddt(rho) - + fvm::div(phiv, rho) - ); - - p = rho/psi; - - solve - ( - fvm::ddt(rhoU) - + fvm::div(phiv, rhoU) - == - - fvc::grad(p) - ); - - U == rhoU/rho; - - surfaceScalarField phiv2 - ( - IOobject - ( - "phiv2", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - fvc::interpolate(rhoU)/fvc::interpolate(rho) & mesh.Sf() - ); - - solve - ( - fvm::ddt(rhoE) - + fvm::div(phiv, rhoE) - == - - fvc::div(phiv2, p) - ); - - T = (rhoE - 0.5*rho*magSqr(rhoU/rho))/Cv/rho; - psi = 1.0/(R*T); - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/Allwmake b/applications/solvers/compressible/rhopSonicFoam/Allwmake deleted file mode 100755 index 5f01d96a75..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/Allwmake +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake libso BCs -wmake - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/Make/files b/applications/solvers/compressible/rhopSonicFoam/BCs/Make/files deleted file mode 100644 index 3931413eae..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/Make/files +++ /dev/null @@ -1,8 +0,0 @@ -rho/fixedRhoFvPatchScalarField.C -rho/gradientRhoFvPatchScalarField.C -rhoE/fixedRhoEFvPatchScalarField.C -rhoE/mixedRhoEFvPatchScalarField.C -rhoU/fixedRhoUFvPatchVectorField.C -p/inviscidWallPFvPatchScalarField.C - -LIB = $(FOAM_LIBBIN)/librhopSonicFoam diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/Make/options b/applications/solvers/compressible/rhopSonicFoam/BCs/Make/options deleted file mode 100644 index 9c87caea6e..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/Make/options +++ /dev/null @@ -1,6 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -LIB_LIBS = \ - -lfiniteVolume \ - -L$(FOAM_LIBBIN) diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.C deleted file mode 100644 index 8702d0aba4..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.C +++ /dev/null @@ -1,163 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "inviscidWallPFvPatchScalarField.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "surfaceFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -inviscidWallPFvPatchScalarField::inviscidWallPFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - fluxFraction_(1) -{} - - -inviscidWallPFvPatchScalarField::inviscidWallPFvPatchScalarField -( - const inviscidWallPFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - fluxFraction_(ptf.fluxFraction_) -{} - - -inviscidWallPFvPatchScalarField::inviscidWallPFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF), - fluxFraction_(readScalar(dict.lookup("fluxFraction"))) -{ - if (dict.found("gradient")) - { - gradient() = scalarField("gradient", dict, p.size()); - fixedGradientFvPatchScalarField::updateCoeffs(); - fixedGradientFvPatchScalarField::evaluate(); - } - else - { - fvPatchField::operator=(patchInternalField()); - gradient() = 0.0; - } - - if (fluxFraction_<0.0 || fluxFraction_ > 1.0) - { - FatalIOErrorIn - ( - "inviscidWallPFvPatchScalarField::" - "supersonicFreeStreamFvPatchVectorField" - "(const fvPatch&, const scalarField&, const dictionary&)", - dict - ) << " unphysical fluxFraction specified (< 0.0 or > 1.0)" - << exit(FatalIOError); - } - -} - - -inviscidWallPFvPatchScalarField::inviscidWallPFvPatchScalarField -( - const inviscidWallPFvPatchScalarField& wbppsf -) -: - fixedGradientFvPatchScalarField(wbppsf), - fluxFraction_(wbppsf.fluxFraction_) -{} - - -inviscidWallPFvPatchScalarField::inviscidWallPFvPatchScalarField -( - const inviscidWallPFvPatchScalarField& wbppsf, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(wbppsf, iF), - fluxFraction_(wbppsf.fluxFraction_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void inviscidWallPFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField& rhoUp = - patch().lookupPatchField("rhoU"); - - const fvsPatchField& phip = - patch().lookupPatchField("phi"); - - const fvsPatchField& rAp = - patch().lookupPatchField("rrhoUAf"); - - gradient() = (fluxFraction_*phip - (patch().Sf() & rhoUp))/ - (rAp*patch().magSf()); - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void inviscidWallPFvPatchScalarField::write(Ostream& os) const -{ - fixedGradientFvPatchScalarField::write(os); - os.writeKeyword("fluxFraction") - << fluxFraction_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, inviscidWallPFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.H b/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.H deleted file mode 100644 index c88ec2e714..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/p/inviscidWallPFvPatchScalarField.H +++ /dev/null @@ -1,136 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef inviscidWallPFvPatchScalarFields_H -#define inviscidWallPFvPatchScalarFields_H - -#include "fvPatchFields.H" -#include "fixedGradientFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class inviscidWallPFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class inviscidWallPFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - -public: - - // Private data - - scalar fluxFraction_; - - //- Runtime type information - TypeName("inviscidWallP"); - - - // Constructors - - //- Construct from patch and internal field - inviscidWallPFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - inviscidWallPFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given inviscidWallPFvPatchScalarField onto - // a new patch - inviscidWallPFvPatchScalarField - ( - const inviscidWallPFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - inviscidWallPFvPatchScalarField - ( - const inviscidWallPFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new inviscidWallPFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - inviscidWallPFvPatchScalarField - ( - const inviscidWallPFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new inviscidWallPFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/fixedRhoFvPatchScalarField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/rho/fixedRhoFvPatchScalarField.C deleted file mode 100644 index b715ac05bc..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/fixedRhoFvPatchScalarField.C +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "fixedRhoFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(p, iF) -{} - - -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField -( - const fixedRhoFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper) -{} - - -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF) -{} - - -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField -( - const fixedRhoFvPatchScalarField& tppsf -) -: - fixedValueFvPatchScalarField(tppsf) -{} - - -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField -( - const fixedRhoFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(tppsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void fixedRhoFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField& psip = - patch().lookupPatchField("psi"); - - const fvPatchField& pp = - patch().lookupPatchField("p"); - - operator==(psip*pp); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - -void fixedRhoFvPatchScalarField::write(Ostream& os) const -{ - fvPatchScalarField::write(os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, fixedRhoFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/fixedRhoFvPatchScalarField.H b/applications/solvers/compressible/rhopSonicFoam/BCs/rho/fixedRhoFvPatchScalarField.H deleted file mode 100644 index 4c2519f3b1..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/fixedRhoFvPatchScalarField.H +++ /dev/null @@ -1,135 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef fixedRhoFvPatchScalarField_H -#define fixedRhoFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class fixedRhoFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class fixedRhoFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - -public: - - //- Runtime type information - TypeName("fixedRho"); - - - // Constructors - - //- Construct from patch and internal field - fixedRhoFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - fixedRhoFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given fixedRhoFvPatchScalarField - // onto a new patch - fixedRhoFvPatchScalarField - ( - const fixedRhoFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - fixedRhoFvPatchScalarField - ( - const fixedRhoFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new fixedRhoFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - fixedRhoFvPatchScalarField - ( - const fixedRhoFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new fixedRhoFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Access - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/gradientRhoFvPatchScalarField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/rho/gradientRhoFvPatchScalarField.C deleted file mode 100644 index f874f86df4..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/gradientRhoFvPatchScalarField.C +++ /dev/null @@ -1,139 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "gradientRhoFvPatchScalarField.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "surfaceFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -gradientRhoFvPatchScalarField::gradientRhoFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(p, iF) -{} - - -gradientRhoFvPatchScalarField::gradientRhoFvPatchScalarField -( - const gradientRhoFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper) -{} - - -gradientRhoFvPatchScalarField::gradientRhoFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF) -{ - if (dict.found("gradient")) - { - gradient() = scalarField("gradient", dict, p.size()); - fixedGradientFvPatchScalarField::updateCoeffs(); - fixedGradientFvPatchScalarField::evaluate(); - } - else - { - fvPatchField::operator=(patchInternalField()); - gradient() = 0.0; - } -} - - -gradientRhoFvPatchScalarField::gradientRhoFvPatchScalarField -( - const gradientRhoFvPatchScalarField& wbppsf -) -: - fixedGradientFvPatchScalarField(wbppsf) -{} - - -gradientRhoFvPatchScalarField::gradientRhoFvPatchScalarField -( - const gradientRhoFvPatchScalarField& wbppsf, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(wbppsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void gradientRhoFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField& psip = - patch().lookupPatchField("psi"); - - const fvPatchField& pp = - patch().lookupPatchField("p"); - - gradient() = psip*pp.snGrad() + psip.snGrad()*pp; - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void gradientRhoFvPatchScalarField::write(Ostream& os) const -{ - fixedGradientFvPatchScalarField::write(os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, gradientRhoFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/gradientRhoFvPatchScalarField.H b/applications/solvers/compressible/rhopSonicFoam/BCs/rho/gradientRhoFvPatchScalarField.H deleted file mode 100644 index 5795fbc3d4..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rho/gradientRhoFvPatchScalarField.H +++ /dev/null @@ -1,132 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef gradientRhoFvPatchScalarFields_H -#define gradientRhoFvPatchScalarFields_H - -#include "fvPatchFields.H" -#include "fixedGradientFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class gradientRhoFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class gradientRhoFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - -public: - - //- Runtime type information - TypeName("gradientRho"); - - - // Constructors - - //- Construct from patch and internal field - gradientRhoFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - gradientRhoFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given gradientRhoFvPatchScalarField onto - // a new patch - gradientRhoFvPatchScalarField - ( - const gradientRhoFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - gradientRhoFvPatchScalarField - ( - const gradientRhoFvPatchScalarField&x - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new gradientRhoFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - gradientRhoFvPatchScalarField - ( - const gradientRhoFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new gradientRhoFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/fixedRhoEFvPatchScalarField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/fixedRhoEFvPatchScalarField.C deleted file mode 100644 index 9bf4a4c1a8..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/fixedRhoEFvPatchScalarField.C +++ /dev/null @@ -1,136 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "fixedRhoEFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -fixedRhoEFvPatchScalarField::fixedRhoEFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(p, iF) -{} - - -fixedRhoEFvPatchScalarField::fixedRhoEFvPatchScalarField -( - const fixedRhoEFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper) -{} - - -fixedRhoEFvPatchScalarField::fixedRhoEFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF) -{} - - -fixedRhoEFvPatchScalarField::fixedRhoEFvPatchScalarField -( - const fixedRhoEFvPatchScalarField& tppsf -) -: - fixedValueFvPatchScalarField(tppsf) -{} - - -fixedRhoEFvPatchScalarField::fixedRhoEFvPatchScalarField -( - const fixedRhoEFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(tppsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void fixedRhoEFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const dictionary& thermodynamicProperties = db().lookupObject - ( - "thermodynamicProperties" - ); - - dimensionedScalar Cv(thermodynamicProperties.lookup("Cv")); - - const fvPatchScalarField& rhop = - patch().lookupPatchField("rho"); - - const fvPatchVectorField& rhoUp = - patch().lookupPatchField("rhoU"); - - const fvPatchScalarField& Tp = - patch().lookupPatchField("T"); - - operator==(rhop*(Cv.value()*Tp + 0.5*magSqr(rhoUp/rhop))); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - -void fixedRhoEFvPatchScalarField::write(Ostream& os) const -{ - fvPatchScalarField::write(os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, fixedRhoEFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/fixedRhoEFvPatchScalarField.H b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/fixedRhoEFvPatchScalarField.H deleted file mode 100644 index 8f40703be0..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/fixedRhoEFvPatchScalarField.H +++ /dev/null @@ -1,135 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef fixedRhoEFvPatchScalarField_H -#define fixedRhoEFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class fixedRhoEFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class fixedRhoEFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - -public: - - //- Runtime type information - TypeName("fixedRhoE"); - - - // Constructors - - //- Construct from patch and internal field - fixedRhoEFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - fixedRhoEFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given fixedRhoEFvPatchScalarField - // onto a new patch - fixedRhoEFvPatchScalarField - ( - const fixedRhoEFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - fixedRhoEFvPatchScalarField - ( - const fixedRhoEFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new fixedRhoEFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - fixedRhoEFvPatchScalarField - ( - const fixedRhoEFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new fixedRhoEFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Access - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.C deleted file mode 100644 index 08e001240c..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.C +++ /dev/null @@ -1,194 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "mixedRhoEFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -mixedRhoEFvPatchScalarField::mixedRhoEFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(p, iF) -{ - refValue() = 0.0; - refGrad() = 0.0; - valueFraction() = 0.0; -} - - -mixedRhoEFvPatchScalarField::mixedRhoEFvPatchScalarField -( - const mixedRhoEFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - mixedFvPatchScalarField(ptf, p, iF, mapper) -{} - - -mixedRhoEFvPatchScalarField::mixedRhoEFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - mixedFvPatchScalarField(p, iF) -{ - if (dict.found("value")) - { - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); - } - else - { - fvPatchField::operator=(patchInternalField()); - } - - refValue() = *this; - refGrad() = 0.0; - valueFraction() = 0.0; -} - - -mixedRhoEFvPatchScalarField::mixedRhoEFvPatchScalarField -( - const mixedRhoEFvPatchScalarField& ptpsf -) -: - mixedFvPatchScalarField(ptpsf) -{} - - -mixedRhoEFvPatchScalarField::mixedRhoEFvPatchScalarField -( - const mixedRhoEFvPatchScalarField& ptpsf, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(ptpsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void mixedRhoEFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - mixedFvPatchScalarField::autoMap(m); -} - - -void mixedRhoEFvPatchScalarField::rmap -( - const fvPatchField& ptf, - const labelList& addr -) -{ - mixedFvPatchField::rmap(ptf, addr); -} - - -void mixedRhoEFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField& rhop = - patch().lookupPatchField("rho"); - const fvPatchField& rhoUp = - patch().lookupPatchField("rhoU"); -// fvPatchField& Tp = -// patch().lookupPatchField("T"); - - const volScalarField& T = db().lookupObject("T"); - const label patchi = patch().index(); - fvPatchScalarField& Tp = - const_cast(T.boundaryField()[patchi]); - - Tp.evaluate(); - - const dictionary& thermodynamicProperties = db().lookupObject - ( - "thermodynamicProperties" - ); - - dimensionedScalar Cv(thermodynamicProperties.lookup("Cv")); - - valueFraction() = rhop.snGrad()/ - (rhop.snGrad() - rhop*this->patch().deltaCoeffs()); - - refValue() = 0.5*rhop*magSqr(rhoUp/rhop); - refGrad() = - rhop*Cv.value()*Tp.snGrad() - + ( - refValue() - - (0.5*rhop.patchInternalField()* - magSqr(rhoUp.patchInternalField()/rhop.patchInternalField())) - )*patch().deltaCoeffs(); - - mixedFvPatchScalarField::updateCoeffs(); -} - - -void mixedRhoEFvPatchScalarField::write(Ostream& os) const -{ - fvPatchScalarField::write(os); - os.writeKeyword("valueFraction") << valueFraction() - << token::END_STATEMENT << endl; - os.writeKeyword("refValue") << refValue() << token::END_STATEMENT << endl; - os.writeKeyword("refGrad") << refGrad() << token::END_STATEMENT << endl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, mixedRhoEFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.H b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.H deleted file mode 100644 index 19fc700411..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoE/mixedRhoEFvPatchScalarField.H +++ /dev/null @@ -1,155 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::mixedRhoEFvPatchScalarField - -Description - -SourceFiles - mixedRhoEFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef mixedRhoEFvPatchScalarFields_H -#define mixedRhoEFvPatchScalarFields_H - -#include "mixedFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class mixedRhoEFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class mixedRhoEFvPatchScalarField -: - public mixedFvPatchScalarField -{ - -public: - - //- Runtime type information - TypeName("mixedRhoE"); - - - // Constructors - - //- Construct from patch and internal field - mixedRhoEFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - mixedRhoEFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given mixedRhoEFvPatchScalarField - // onto a new patch - mixedRhoEFvPatchScalarField - ( - const mixedRhoEFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - mixedRhoEFvPatchScalarField - ( - const mixedRhoEFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new mixedRhoEFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - mixedRhoEFvPatchScalarField - ( - const mixedRhoEFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new mixedRhoEFvPatchScalarField(*this, iF) - ); - } - - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchField&, - const labelList& - ); - - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.C b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.C deleted file mode 100644 index 0daa0dd2d5..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.C +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "fixedRhoUFvPatchVectorField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -fixedRhoUFvPatchVectorField::fixedRhoUFvPatchVectorField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedValueFvPatchVectorField(p, iF) -{} - - -fixedRhoUFvPatchVectorField::fixedRhoUFvPatchVectorField -( - const fixedRhoUFvPatchVectorField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchVectorField(ptf, p, iF, mapper) -{} - - -fixedRhoUFvPatchVectorField::fixedRhoUFvPatchVectorField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchVectorField(p, iF) -{} - - -fixedRhoUFvPatchVectorField::fixedRhoUFvPatchVectorField -( - const fixedRhoUFvPatchVectorField& tppsf -) -: - fixedValueFvPatchVectorField(tppsf) -{} - - -fixedRhoUFvPatchVectorField::fixedRhoUFvPatchVectorField -( - const fixedRhoUFvPatchVectorField& tppsf, - const DimensionedField& iF -) -: - fixedValueFvPatchVectorField(tppsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void fixedRhoUFvPatchVectorField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchScalarField& rhop = - patch().lookupPatchField("rho"); - - const fvPatchVectorField& Up = - patch().lookupPatchField("U"); - - operator==(rhop*Up); - - fixedValueFvPatchVectorField::updateCoeffs(); -} - - -void fixedRhoUFvPatchVectorField::write(Ostream& os) const -{ - fvPatchVectorField::write(os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchVectorField, fixedRhoUFvPatchVectorField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.H b/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.H deleted file mode 100644 index f548b7c3da..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/BCs/rhoU/fixedRhoUFvPatchVectorField.H +++ /dev/null @@ -1,135 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef fixedRhoUFvPatchVectorField_H -#define fixedRhoUFvPatchVectorField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class fixedRhoUFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class fixedRhoUFvPatchVectorField -: - public fixedValueFvPatchVectorField -{ - -public: - - //- Runtime type information - TypeName("fixedRhoU"); - - - // Constructors - - //- Construct from patch and internal field - fixedRhoUFvPatchVectorField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - fixedRhoUFvPatchVectorField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given fixedRhoUFvPatchVectorField - // onto a new patch - fixedRhoUFvPatchVectorField - ( - const fixedRhoUFvPatchVectorField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - fixedRhoUFvPatchVectorField - ( - const fixedRhoUFvPatchVectorField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new fixedRhoUFvPatchVectorField(*this) - ); - } - - //- Construct as copy setting internal field reference - fixedRhoUFvPatchVectorField - ( - const fixedRhoUFvPatchVectorField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new fixedRhoUFvPatchVectorField(*this, iF) - ); - } - - - // Member functions - - // Access - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/compressible/rhopSonicFoam/Make/files b/applications/solvers/compressible/rhopSonicFoam/Make/files deleted file mode 100644 index e751786c41..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -rhopSonicFoam.C - -EXE = $(FOAM_APPBIN)/rhopSonicFoam diff --git a/applications/solvers/compressible/rhopSonicFoam/Make/options b/applications/solvers/compressible/rhopSonicFoam/Make/options deleted file mode 100644 index 31374b9af4..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/Make/options +++ /dev/null @@ -1,7 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -IBCs/lnInclude - -EXE_LIBS = \ - -lfiniteVolume \ - -lrhopSonicFoam diff --git a/applications/solvers/compressible/rhopSonicFoam/boundaryTypes.H b/applications/solvers/compressible/rhopSonicFoam/boundaryTypes.H deleted file mode 100644 index 7d314cd110..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/boundaryTypes.H +++ /dev/null @@ -1,7 +0,0 @@ -#include "fixedGradientFvPatchFields.H" -#include "zeroGradientFvPatchFields.H" -#include "fixedRhoFvPatchScalarField.H" -#include "gradientRhoFvPatchScalarField.H" -#include "fixedRhoEFvPatchScalarField.H" -#include "mixedRhoEFvPatchScalarField.H" -#include "fixedRhoUFvPatchVectorField.H" diff --git a/applications/solvers/compressible/rhopSonicFoam/compressibleCreatePhi.H b/applications/solvers/compressible/rhopSonicFoam/compressibleCreatePhi.H deleted file mode 100644 index 262ceebc05..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/compressibleCreatePhi.H +++ /dev/null @@ -1,54 +0,0 @@ - IOobject phiHeader - ( - "phi", - runTime.timeName(), - mesh, - IOobject::NO_READ - ); - - - surfaceScalarField* phiPtr; - - if (phiHeader.headerOk()) - { - Info<< "Reading face flux field phi\n" << endl; - - phiPtr = new surfaceScalarField - ( - IOobject - ( - "phi", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - } - else - { - Info<< "Calculating face flux field phi\n" << endl; - - wordList phiTypes - ( - rhoU.boundaryField().size(), - calculatedFvPatchScalarField::typeName - ); - - phiPtr = new surfaceScalarField - ( - IOobject - ( - "phi", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - linearInterpolate(rhoU) & mesh.Sf(), - phiTypes - ); - } - - surfaceScalarField& phi = *phiPtr; diff --git a/applications/solvers/compressible/rhopSonicFoam/createFields.H b/applications/solvers/compressible/rhopSonicFoam/createFields.H deleted file mode 100644 index fed8432711..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/createFields.H +++ /dev/null @@ -1,129 +0,0 @@ - Info<< "Reading field p\n" << endl; - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - p.oldTime(); - - Info<< "Reading field T\n" << endl; - volScalarField T - ( - IOobject - ( - "T", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - T.correctBoundaryConditions(); - - volScalarField psi - ( - IOobject - ( - "psi", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - 1.0/(R*T) - ); - psi.oldTime(); - -# include "rhoBoundaryTypes.H" - volScalarField rho - ( - IOobject - ( - "rho", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - p*psi, - rhoBoundaryTypes - ); - - Info<< "Reading field U\n" << endl; - volVectorField U - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - -# include "rhoUboundaryTypes.H" - volVectorField rhoU - ( - IOobject - ( - "rhoU", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - rho*U, - rhoUboundaryTypes - ); - -# include "rhoEboundaryTypes.H" - volScalarField rhoE - ( - IOobject - ( - "rhoE", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - rho*Cv*T + 0.5*rho*magSqr(rhoU/rho), - rhoEboundaryTypes - ); - -# include "compressibleCreatePhi.H" - phi.oldTime(); - - surfaceScalarField phiv - ( - IOobject - ( - "phiv", - runTime.timeName(), - mesh - ), - phi/linearInterpolate(rho), - phi.boundaryField().types() - ); - - rhoU.correctBoundaryConditions(); - - multivariateSurfaceInterpolationScheme::fieldTable fields; - - volScalarField magRhoU = mag(rhoU); - volScalarField H("H", (rhoE + p)/rho); - - fields.add(rho); - fields.add(magRhoU); - fields.add(H); - diff --git a/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H b/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H deleted file mode 100644 index 2064187a2f..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H +++ /dev/null @@ -1,38 +0,0 @@ - Info<< "Reading thermodynamicProperties\n" << endl; - - IOdictionary thermodynamicProperties - ( - IOobject - ( - "thermodynamicProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar R - ( - thermodynamicProperties.lookup("R") - ); - - dimensionedScalar Cv - ( - thermodynamicProperties.lookup("Cv") - ); - - dimensionedScalar Cp = Cv + R; - - dimensionedScalar gamma = Cp/Cv; - - dimensionedScalar Pr - ( - dimensionedScalar::lookupOrDefault - ( - "Pr", - thermodynamicProperties, - 1.0 - ) - ); - diff --git a/applications/solvers/compressible/rhopSonicFoam/resetPhiPatches.H b/applications/solvers/compressible/rhopSonicFoam/resetPhiPatches.H deleted file mode 100644 index 2a8496ef4c..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/resetPhiPatches.H +++ /dev/null @@ -1,19 +0,0 @@ -surfaceScalarField::GeometricBoundaryField& phiPatches = - phi.boundaryField(); - -const volVectorField::GeometricBoundaryField& rhoUpatches = - rhoU.boundaryField(); - -const surfaceVectorField::GeometricBoundaryField& SfPatches = - mesh.Sf().boundaryField(); - -forAll(phiPatches, patchI) -{ - if (phi.boundaryField().types()[patchI] == "calculated") - { - calculatedFvsPatchScalarField& phiPatch = - refCast(phiPatches[patchI]); - - phiPatch == (rhoUpatches[patchI] & SfPatches[patchI]); - } -} diff --git a/applications/solvers/compressible/rhopSonicFoam/rhoBoundaryTypes.H b/applications/solvers/compressible/rhopSonicFoam/rhoBoundaryTypes.H deleted file mode 100644 index f54d066311..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/rhoBoundaryTypes.H +++ /dev/null @@ -1,21 +0,0 @@ -const volScalarField::GeometricBoundaryField& pbf = p.boundaryField(); -wordList rhoBoundaryTypes = pbf.types(); - -forAll(rhoBoundaryTypes, patchi) -{ - if - ( - rhoBoundaryTypes[patchi] == "pressureTransmissive" - ) - { - rhoBoundaryTypes[patchi] = zeroGradientFvPatchScalarField::typeName; - } - else if (pbf[patchi].fixesValue()) - { - rhoBoundaryTypes[patchi] = fixedRhoFvPatchScalarField::typeName; - } - else - { - rhoBoundaryTypes[patchi] = gradientRhoFvPatchScalarField::typeName; - } -} diff --git a/applications/solvers/compressible/rhopSonicFoam/rhoEboundaryTypes.H b/applications/solvers/compressible/rhopSonicFoam/rhoEboundaryTypes.H deleted file mode 100644 index 84e08b29ed..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/rhoEboundaryTypes.H +++ /dev/null @@ -1,14 +0,0 @@ -const volScalarField::GeometricBoundaryField& Tbf = T.boundaryField(); -wordList rhoEboundaryTypes = Tbf.types(); - -forAll(rhoEboundaryTypes, patchi) -{ - if (Tbf[patchi].fixesValue()) - { - rhoEboundaryTypes[patchi] = fixedRhoEFvPatchScalarField::typeName; - } - else - { - rhoEboundaryTypes[patchi] = mixedRhoEFvPatchScalarField::typeName; - } -} diff --git a/applications/solvers/compressible/rhopSonicFoam/rhoUboundaryTypes.H b/applications/solvers/compressible/rhopSonicFoam/rhoUboundaryTypes.H deleted file mode 100644 index c03b959d26..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/rhoUboundaryTypes.H +++ /dev/null @@ -1,10 +0,0 @@ -const volVectorField::GeometricBoundaryField& Ubf = U.boundaryField(); -wordList rhoUboundaryTypes = Ubf.types(); - -forAll(rhoUboundaryTypes, patchi) -{ - if (Ubf[patchi].fixesValue()) - { - rhoUboundaryTypes[patchi] = fixedRhoUFvPatchVectorField::typeName; - } -} diff --git a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C b/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C deleted file mode 100644 index 1f561e0709..0000000000 --- a/applications/solvers/compressible/rhopSonicFoam/rhopSonicFoam.C +++ /dev/null @@ -1,191 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. - \\/ 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 . - -Application - rhopSonicFoam - -Description - Pressure-density-based compressible flow solver. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "weighted.H" -#include "gaussConvectionScheme.H" -#include "multivariateGaussConvectionScheme.H" -#include "MUSCL.H" -#include "LimitedScheme.H" -#include "boundaryTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "readThermodynamicProperties.H" - #include "createFields.H" - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.value() << nl << endl; - - #include "readPISOControls.H" - scalar HbyAblend = readScalar(piso.lookup("HbyAblend")); - - #include "readTimeControls.H" - - scalar CoNum = max - ( - mesh.surfaceInterpolation::deltaCoeffs() - *mag(phiv)/mesh.magSf() - ).value()*runTime.deltaTValue(); - - Info<< "Max Courant Number = " << CoNum << endl; - - #include "setDeltaT.H" - - for (int outerCorr=0; outerCorr mvConvection - ( - mesh, - fields, - phiv, - mesh.divScheme("div(phiv,rhoUH)") - ); - - solve - ( - fvm::ddt(rho) - + mvConvection.fvmDiv(phiv, rho) - ); - - surfaceScalarField rhoUWeights = - mvConvection.interpolationScheme()()(magRhoU)() - .weights(magRhoU); - - weighted rhoUScheme(rhoUWeights); - - fvVectorMatrix rhoUEqn - ( - fvm::ddt(rhoU) - + fv::gaussConvectionScheme(mesh, phiv, rhoUScheme) - .fvmDiv(phiv, rhoU) - ); - - solve(rhoUEqn == -fvc::grad(p)); - - solve - ( - fvm::ddt(rhoE) - + mvConvection.fvmDiv(phiv, rhoE) - == - - mvConvection.fvcDiv(phiv, p) - ); - - T = (rhoE - 0.5*rho*magSqr(rhoU/rho))/Cv/rho; - psi = 1.0/(R*T); - p = rho/psi; - - for (int corr=0; corr, limitFuncs::magSqr> - (mesh, phi, IStringStream("HbyA")()).weights(HbyA); - - phi = - ( - surfaceInterpolationScheme::interpolate - (HbyA, HbyAWeights) & mesh.Sf() - ) - + HbyAblend*fvc::ddtPhiCorr(rrhoUA, rho, rhoU, phi); - - p.boundaryField().updateCoeffs(); - - surfaceScalarField phiGradp = - rrhoUAf*mesh.magSf()*fvc::snGrad(p); - - phi -= phiGradp; - - #include "resetPhiPatches.H" - - surfaceScalarField rhof = - mvConvection.interpolationScheme()()(rho)() - .interpolate(rho); - - phiv = phi/rhof; - - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + mvConvection.fvcDiv(phiv, rho) - + fvc::div(phiGradp) - - fvm::laplacian(rrhoUAf, p) - ); - - pEqn.solve(); - - phi += phiGradp + pEqn.flux(); - rho = psi*p; - rhof = - mvConvection.interpolationScheme()()(rho)() - .interpolate(rho); - phiv = phi/rhof; - - rhoU = HbyA - rrhoUA*fvc::grad(p); - rhoU.correctBoundaryConditions(); - } - } - - U = rhoU/rho; - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H index 96a500d4c2..8d6040b530 100644 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -1,7 +1,7 @@ rho = thermo.rho(); -volScalarField rUA = 1.0/UEqn.A(); -U = rUA*UEqn.H(); +volScalarField rAU = 1.0/UEqn.A(); +U = rAU*UEqn.H(); surfaceScalarField phid ( @@ -9,7 +9,7 @@ surfaceScalarField phid fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); @@ -19,7 +19,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rUA, p) + - fvm::laplacian(rho*rAU, p) ); pEqn.solve(); @@ -33,5 +33,5 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); diff --git a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C index c785343af7..c92f3d82f9 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C +++ b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C @@ -71,8 +71,8 @@ int main(int argc, char *argv[]) for (int corr=0; corr UEqn UEqn().relax(); -volScalarField rUA = 1.0/UEqn().A(); +volScalarField rAU = 1.0/UEqn().A(); if (momentumPredictor) { @@ -17,6 +17,6 @@ if (momentumPredictor) } else { - U = rUA*(UEqn().H() - fvc::grad(p)); + U = rAU*(UEqn().H() - fvc::grad(p)); U.correctBoundaryConditions(); } diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index b5dc23a58c..acd86ed4b0 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -1,4 +1,4 @@ -U = rUA*UEqn().H(); +U = rAU*UEqn().H(); if (nCorr <= 1) { @@ -6,7 +6,7 @@ if (nCorr <= 1) } phi = (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, U, phi); + + fvc::ddtPhiCorr(rAU, U, phi); adjustPhi(phi, U, p); @@ -16,7 +16,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) // Pressure corrector fvScalarMatrix pEqn ( - fvm::laplacian(rUA, p) == fvc::div(phi) + fvm::laplacian(rAU, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); @@ -47,5 +47,5 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) // Explicitly relax pressure for momentum corrector p.relax(); -U -= rUA*fvc::grad(p); +U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H new file mode 100644 index 0000000000..652773fea7 --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/UEqn.H @@ -0,0 +1,22 @@ +// Solve the Momentum equation + +tmp UEqn +( + fvm::ddt(U) + + fvm::div(phi, U) + + turbulence->divDevReff(U) +); + +UEqn().relax(); + +rAU = 1.0/UEqn().A(); + +if (momentumPredictor) +{ + solve(UEqn() == -fvc::grad(p)); +} +else +{ + U = rAU*(UEqn().H() - fvc::grad(p)); + U.correctBoundaryConditions(); +} diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H index bc798ba988..16b3bd977d 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H @@ -27,7 +27,7 @@ mesh ); -# include "createPhi.H" + #include "createPhi.H" label pRefCell = 0; diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H index 155f43a632..74045cabb7 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H @@ -46,6 +46,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) #include "continuityErrs.H" +// Explicitly relax pressure for momentum corrector p.relax(); // Make the fluxes relative to the mesh motion diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index 5f7e6dd8e0..47414bf173 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -79,11 +79,11 @@ int main(int argc, char *argv[]) for (int corr=0; corr p_rghEqnComp; @@ -24,27 +24,27 @@ } - U = rUA*UEqn.H(); + U = rAU*UEqn.H(); surfaceScalarField phiU ( "phiU", (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); phi = phiU + ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + )*rAUf*mesh.magSf(); for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix p_rghEqnIncomp ( fvc::div(phi) - - fvm::laplacian(rUAf, p_rgh) + - fvm::laplacian(rAUf, p_rgh) ); solve @@ -75,7 +75,7 @@ } } - U += rUA*fvc::reconstruct((phi - phiU)/rUAf); + U += rAU*fvc::reconstruct((phi - phiU)/rAUf); U.correctBoundaryConditions(); p = max diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index eefe6bec08..7054fe1d44 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rUA = 1.0/UEqn.A(); - surfaceScalarField rUAf = fvc::interpolate(rUA); + volScalarField rAU = 1.0/UEqn.A(); + surfaceScalarField rAUf = fvc::interpolate(rAU); tmp p_rghEqnComp; @@ -24,27 +24,27 @@ } - U = rUA*UEqn.H(); + U = rAU*UEqn.H(); surfaceScalarField phiU ( "phiU", (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); phi = phiU + ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + )*rAUf*mesh.magSf(); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix p_rghEqnIncomp ( fvc::div(phi) - - fvm::laplacian(rUAf, p_rgh) + - fvm::laplacian(rAUf, p_rgh) ); solve @@ -75,7 +75,7 @@ } } - U += rUA*fvc::reconstruct((phi - phiU)/rUAf); + U += rAU*fvc::reconstruct((phi - phiU)/rAUf); U.correctBoundaryConditions(); p = max diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index cb42a4474a..4f4e68cb59 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -1,14 +1,14 @@ { - volScalarField rUA = 1.0/UEqn.A(); - surfaceScalarField rUAf = fvc::interpolate(rUA); + volScalarField rAU = 1.0/UEqn.A(); + surfaceScalarField rAUf = fvc::interpolate(rAU); - U = rUA*UEqn.H(); + U = rAU*UEqn.H(); surfaceScalarField phiU ( "phiU", (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); adjustPhi(phiU, U, p_rgh); @@ -17,7 +17,7 @@ ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + )*rAUf*mesh.magSf(); Pair > vDotP = twoPhaseProperties->vDotP(); const volScalarField& vDotcP = vDotP[0](); @@ -27,7 +27,7 @@ { fvScalarMatrix p_rghEqn ( - fvc::div(phi) - fvm::laplacian(rUAf, p_rgh) + fvc::div(phi) - fvm::laplacian(rAUf, p_rgh) - (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh) ); @@ -52,7 +52,7 @@ } } - U += rUA*fvc::reconstruct((phi - phiU)/rUAf); + U += rAU*fvc::reconstruct((phi - phiU)/rAUf); U.correctBoundaryConditions(); #include "continuityErrs.H" diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index 3d1e6816d7..806909ffe7 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -1,27 +1,27 @@ -volScalarField rUA = 1.0/UEqn.A(); +volScalarField rAU = 1.0/UEqn.A(); -surfaceScalarField rUAf +surfaceScalarField rAUf ( "(rho*(1|A(U)))", - fvc::interpolate(rho)*fvc::interpolate(rUA) + fvc::interpolate(rho)*fvc::interpolate(rAU) ); -U = rUA*UEqn.H(); +U = rAU*UEqn.H(); phi = fvc::interpolate(rho) *( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rUA, rho, U, phi) + + fvc::ddtPhiCorr(rAU, rho, U, phi) ); surfaceScalarField phiU("phiU", phi); -phi -= ghf*fvc::snGrad(rho)*rUAf*mesh.magSf(); +phi -= ghf*fvc::snGrad(rho)*rAUf*mesh.magSf(); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix p_rghEqn ( - fvm::laplacian(rUAf, p_rgh) == fvc::ddt(rho) + fvc::div(phi) + fvm::laplacian(rAUf, p_rgh) == fvc::ddt(rho) + fvc::div(phi) ); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); @@ -49,5 +49,5 @@ if (p_rgh.needReference()) #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -U += rUA*fvc::reconstruct((phi - phiU)/rUAf); +U += rAU*fvc::reconstruct((phi - phiU)/rAUf); U.correctBoundaryConditions(); diff --git a/applications/test/LduMatrix/LduMatrixTest3.C b/applications/test/LduMatrix/LduMatrixTest3.C index 741e07d990..35e8a4ab85 100644 --- a/applications/test/LduMatrix/LduMatrixTest3.C +++ b/applications/test/LduMatrix/LduMatrixTest3.C @@ -102,11 +102,11 @@ int main(int argc, char *argv[]) for (int corr=0; corr patchDicts; preservePatchTypes ( runTime, runTime.constant(), - polyMesh::defaultRegion, + polyMesh::meshSubDir, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); + // Add information to dictionary + forAll(patchNames, patchI) + { + if (!patchDicts.set(patchI)) + { + patchDicts.set(patchI, new dictionary()); + } + // Add but not overwrite + patchDicts[patchI].add("type", polyPatch::typeName, false); + } + + polyMesh pShapeMesh ( IOobject @@ -596,10 +606,9 @@ int main(int argc, char *argv[]) cellShapes, patchFaces, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C index 2de1b840e9..ff0f80df53 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C @@ -578,7 +578,6 @@ int main(int argc, char *argv[]) wordList patchTypes(npatch); word defaultFacesName = "defaultFaces"; word defaultFacesType = wallPolyPatch::typeName; - wordList patchPhysicalTypes(npatch); label nCreatedPatches = 0; @@ -707,18 +706,30 @@ int main(int argc, char *argv[]) patchTypes.setSize(nCreatedPatches); patchNames.setSize(nCreatedPatches); + PtrList patchDicts; + preservePatchTypes ( runTime, runTime.constant(), - polyMesh::defaultRegion, + polyMesh::meshSubDir, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); + // Add information to dictionary + forAll(patchNames, patchI) + { + if (!patchDicts.set(patchI)) + { + patchDicts.set(patchI, new dictionary()); + } + // Add but not overwrite + patchDicts[patchI].add("type", patchTypes[patchI], false); + } + polyMesh pShapeMesh ( IOobject @@ -731,10 +742,9 @@ int main(int argc, char *argv[]) cellShapes, boundary, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); // Set the precision of the points data to 10 diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L index 619374396f..51d3cd97ea 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L @@ -45,7 +45,6 @@ Description #include "emptyPolyPatch.H" #include "wallPolyPatch.H" #include "symmetryPolyPatch.H" -#include "preservePatchTypes.H" #include "cellShape.H" #include "faceSet.H" #include "cellSet.H" @@ -1542,17 +1541,6 @@ int main(int argc, char *argv[]) } repatcher.repatch(); - preservePatchTypes - ( - runTime, - runTime.constant(), - polyMesh::defaultRegion, - patchNames, - patchTypes, - defaultFacesName, - defaultFacesType, - patchPhysicalTypes - ); // Set the precision of the points data to 10 IOstream::defaultPrecision(10); diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L index c1d2b44e82..bdb3a38c84 100644 --- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L +++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L @@ -818,24 +818,32 @@ int main(int argc, char *argv[]) // Scale points points *= scaleFactor; - wordList patchTypes(boundary.size(), polyPatch::typeName); + PtrList patchDicts(boundary.size()); word defaultFacesName = "defaultFaces"; word defaultFacesType = emptyPolyPatch::typeName; - wordList patchPhysicalTypes(boundary.size()); preservePatchTypes ( runTime, runTime.constant(), - polyMesh::defaultRegion, + polyMesh::meshSubDir, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); - // Mesh will auto-write on construction + // Add information to dictionary + forAll(patchNames, patchI) + { + if (!patchDicts.set(patchI)) + { + patchDicts.set(patchI, new dictionary()); + } + // Add but not overwrite + patchDicts[patchI].add("type", polyPatch::typeName, false); + } + polyMesh pShapeMesh ( IOobject @@ -848,10 +856,9 @@ int main(int argc, char *argv[]) cells, boundary, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); // Set the precision of the points data to 10 diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index d4356c2cdc..04b36020ea 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -459,7 +459,6 @@ wordList patchNames(nPatches); wordList patchTypes(nPatches); word defaultFacesName = "defaultFaces"; word defaultFacesType = emptyPolyPatch::typeName; -wordList patchPhysicalTypes(nPatches); label nAddedPatches = 0; @@ -535,17 +534,27 @@ forAll(boundary, patchi) } } +PtrList patchDicts; preservePatchTypes ( runTime, runTime.constant(), - polyMesh::defaultRegion, + polyMesh::meshSubDir, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); +// Add information to dictionary +forAll(patchNames, patchI) +{ + if (!patchDicts.set(patchI)) + { + patchDicts.set(patchI, new dictionary()); + } + // Add but not overwrite + patchDicts[patchI].add("type", patchTypes[patchI], false); +} // Build the mesh and write it out polyMesh pShapeMesh @@ -560,10 +569,9 @@ polyMesh pShapeMesh cellShapes, boundary, patchNames, - patchTypes, + patchDicts, defaultFacesName, - defaultFacesType, - patchPhysicalTypes + defaultFacesType ); Info << "Writing polyMesh" << endl; diff --git a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C index 40db7f47b5..806b4fdfcc 100644 --- a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C +++ b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C @@ -43,7 +43,6 @@ Description #include "polyMesh.H" #include "wallPolyPatch.H" #include "symmetryPolyPatch.H" -#include "preservePatchTypes.H" #include "cellShape.H" #include "cellModeller.H" #include "mergePoints.H" diff --git a/applications/utilities/mesh/conversion/sammToFoam/readBoundary.C b/applications/utilities/mesh/conversion/sammToFoam/readBoundary.C index b1ec1b772e..53dffd39c6 100644 --- a/applications/utilities/mesh/conversion/sammToFoam/readBoundary.C +++ b/applications/utilities/mesh/conversion/sammToFoam/readBoundary.C @@ -230,17 +230,28 @@ void sammMesh::readBoundary() patchPhysicalTypes_.setSize(patchTypes_.size()); + PtrList patchDicts; + preservePatchTypes ( runTime_, runTime_.constant(), - polyMesh::defaultRegion, + polyMesh::meshSubDir, patchNames_, - patchTypes_, + patchDicts, defaultFacesName_, - defaultFacesType_, - patchPhysicalTypes_ + defaultFacesType_ ); + + forAll(patchDicts, patchI) + { + if (patchDicts.set(patchI)) + { + const dictionary& dict = patchDicts[patchI]; + dict.readIfPresent("type", patchTypes_[patchI]); + dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]); + } + } } diff --git a/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C b/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C index be29c36cd1..a96ee6e96b 100644 --- a/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/readBoundary.C @@ -228,17 +228,28 @@ void starMesh::readBoundary() patchPhysicalTypes_.setSize(patchTypes_.size()); + PtrList patchDicts; + preservePatchTypes ( runTime_, runTime_.constant(), - polyMesh::defaultRegion, + polyMesh::meshSubDir, patchNames_, - patchTypes_, + patchDicts, defaultFacesName_, - defaultFacesType_, - patchPhysicalTypes_ + defaultFacesType_ ); + + forAll(patchDicts, patchI) + { + if (patchDicts.set(patchI)) + { + const dictionary& dict = patchDicts[patchI]; + dict.readIfPresent("type", patchTypes_[patchI]); + dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]); + } + } } diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index a0baebaae7..a85a4e417f 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -52,7 +52,6 @@ Usage #include "blockMesh.H" #include "attachPolyTopoChanger.H" -#include "preservePatchTypes.H" #include "emptyPolyPatch.H" #include "cellSet.H" @@ -219,6 +218,7 @@ int main(int argc, char *argv[]) xferCopy(blocks.points()), // could we re-use space? blocks.cells(), blocks.patches(), + blocks.patchNames(), blocks.patchDicts(), defaultFacesName, defaultFacesType diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index b3c4ca35e7..f01c2cd602 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -153,6 +153,12 @@ int main(int argc, char *argv[]) "internalFacesOnly", "do not convert boundary faces" ); + argList::addBoolOption + ( + "updateFields", + "update fields to include new patches:" + " NOTE: updated field values may need to be edited" + ); #include "setRootCase.H" #include "createTime.H" @@ -235,39 +241,45 @@ int main(int argc, char *argv[]) IOobjectList objects(mesh, runTime.timeName()); // Read vol fields. + if (args.optionFound("updateFields")) + { + Info<< "Reading geometric fields" << nl << endl; + PtrList vsFlds; + ReadFields(mesh, objects, vsFlds); - PtrList vsFlds; - ReadFields(mesh, objects, vsFlds); + PtrList vvFlds; + ReadFields(mesh, objects, vvFlds); - PtrList vvFlds; - ReadFields(mesh, objects, vvFlds); + PtrList vstFlds; + ReadFields(mesh, objects, vstFlds); - PtrList vstFlds; - ReadFields(mesh, objects, vstFlds); + PtrList vsymtFlds; + ReadFields(mesh, objects, vsymtFlds); - PtrList vsymtFlds; - ReadFields(mesh, objects, vsymtFlds); + PtrList vtFlds; + ReadFields(mesh, objects, vtFlds); - PtrList vtFlds; - ReadFields(mesh, objects, vtFlds); + // Read surface fields. - // Read surface fields. + PtrList ssFlds; + ReadFields(mesh, objects, ssFlds); - PtrList ssFlds; - ReadFields(mesh, objects, ssFlds); + PtrList svFlds; + ReadFields(mesh, objects, svFlds); - PtrList svFlds; - ReadFields(mesh, objects, svFlds); + PtrList sstFlds; + ReadFields(mesh, objects, sstFlds); - PtrList sstFlds; - ReadFields(mesh, objects, sstFlds); - - PtrList ssymtFlds; - ReadFields(mesh, objects, ssymtFlds); - - PtrList stFlds; - ReadFields(mesh, objects, stFlds); + PtrList ssymtFlds; + ReadFields(mesh, objects, ssymtFlds); + PtrList stFlds; + ReadFields(mesh, objects, stFlds); + } + else + { + Info<< "Not updating geometric fields" << nl << endl; + } // Mesh change container polyTopoChange meshMod(mesh); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 06aeb3291a..6216228961 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -163,6 +163,7 @@ void Foam::ensightMesh::correct() prisms.setSize(nPrisms); wedges.setSize(nWedges); hexes.setSize(nHexes); + hexesWedges.setSize(nHexesWedges); polys.setSize(nPolys); meshCellSets_.nTets = nTets; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H index 62df97511c..74fd718da3 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H @@ -280,6 +280,7 @@ public: const Xfer& points, const cellShapeList& shapes, const faceListList& boundaryFaces, + const wordList& boundaryPatchNames, const PtrList& boundaryDicts, const word& defaultBoundaryPatchName, const word& defaultBoundaryPatchType, diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C index 73434502f4..f7b1052bfe 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C @@ -698,6 +698,7 @@ Foam::polyMesh::polyMesh const Xfer& points, const cellShapeList& cellsAsShapes, const faceListList& boundaryFaces, + const wordList& boundaryPatchNames, const PtrList& boundaryDicts, const word& defaultBoundaryPatchName, const word& defaultBoundaryPatchType, @@ -832,12 +833,6 @@ Foam::polyMesh::polyMesh // Remove all of the old mesh files if they exist removeFiles(instance()); - wordList boundaryPatchNames(boundaryDicts.size()); - forAll(boundaryDicts, patchI) - { - boundaryDicts[patchI].lookup("name") >> boundaryPatchNames[patchI]; - } - // Calculate faces and cells labelList patchSizes; labelList patchStarts; @@ -858,7 +853,7 @@ Foam::polyMesh::polyMesh // Warning: Patches can only be added once the face list is // completed, as they hold a subList of the face list - forAll(boundaryFaces, patchI) + forAll(boundaryDicts, patchI) { dictionary patchDict(boundaryDicts[patchI]); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C index 8f29b9e934..4187da2d93 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C @@ -27,7 +27,10 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const Foam::scalar Foam::polyMeshTetDecomposition::minTetQuality = 1e-12; +// Note: the use of this tolerance is ad-hoc, there may be extreme +// cases where the resulting tetrahedra still have particle tracking +// problems. +const Foam::scalar Foam::polyMeshTetDecomposition::minTetQuality = SMALL; // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.C b/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.C index 384e718d07..c040e777ae 100644 --- a/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.C +++ b/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.C @@ -25,7 +25,6 @@ License #include "preservePatchTypes.H" #include "polyBoundaryMeshEntries.H" -#include "dictionary.H" // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // @@ -35,14 +34,16 @@ void Foam::preservePatchTypes const word& meshInstance, const fileName& meshDir, const wordList& patchNames, - wordList& patchTypes, + PtrList& patchDicts, const word& defaultFacesName, - word& defaultFacesType, - wordList& patchPhysicalTypes + word& defaultFacesType ) { + patchDicts.setSize(patchNames.size()); + dictionary patchDictionary; + // Read boundary file as single dictionary { IOobject patchEntriesHeader ( @@ -67,35 +68,27 @@ void Foam::preservePatchTypes } } - if (patchDictionary.size()) + forAll(patchNames, patchi) { - forAll(patchNames, patchi) - { - if (patchDictionary.found(patchNames[patchi])) - { - const dictionary& patchDict = - patchDictionary.subDict(patchNames[patchi]); - - patchDict.lookup("type") >> patchTypes[patchi]; - - patchDict.readIfPresent("geometricType", patchTypes[patchi]); - patchDict.readIfPresent - ( - "physicalType", - patchPhysicalTypes[patchi] - ); - } - } - - if (patchDictionary.found(defaultFacesName)) + if (patchDictionary.found(patchNames[patchi])) { const dictionary& patchDict = - patchDictionary.subDict(defaultFacesName); + patchDictionary.subDict(patchNames[patchi]); - patchDict.readIfPresent("geometricType", defaultFacesType); + patchDicts.set(patchi, patchDict.clone()); + patchDicts[patchi].remove("nFaces"); + patchDicts[patchi].remove("startFace"); } } + if (patchDictionary.found(defaultFacesName)) + { + const dictionary& patchDict = + patchDictionary.subDict(defaultFacesName); + + patchDict.readIfPresent("geometricType", defaultFacesType); + } + Info<< nl << "Default patch type set to " << defaultFacesType << endl; } diff --git a/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.H b/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.H index 5ecf1b34ee..59375fac79 100644 --- a/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.H +++ b/src/OpenFOAM/meshes/preservePatchTypes/preservePatchTypes.H @@ -37,6 +37,7 @@ SourceFiles #include "fileName.H" #include "wordList.H" +#include "dictionary.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,10 +53,9 @@ void preservePatchTypes const word& meshInstance, const fileName& meshDir, const wordList& patchNames, - wordList& patchTypes, + PtrList& patchDicts, const word& defaultFacesName, - word& defaultFacesType, - wordList& patchPhysicalTypes + word& defaultFacesType ); } // End namespace Foam diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C index d4407a7d68..8ced550982 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C @@ -272,10 +272,10 @@ const Foam::point& Foam::plane::refPoint() const } -// Return coefficcients for plane equation: ax + by + cz + d = 0 -Foam::scalarList Foam::plane::planeCoeffs() const +// Return coefficients for plane equation: ax + by + cz + d = 0 +Foam::FixedList Foam::plane::planeCoeffs() const { - scalarList C(4); + FixedList C(4); scalar magX = mag(unitVector_.x()); scalar magY = mag(unitVector_.y()); @@ -291,8 +291,8 @@ Foam::scalarList Foam::plane::planeCoeffs() const } else { - C[0] = 0; - C[1] = 0; + C[0] = unitVector_.x()/unitVector_.z(); + C[1] = unitVector_.y()/unitVector_.z(); C[2] = 1; } } @@ -300,14 +300,14 @@ Foam::scalarList Foam::plane::planeCoeffs() const { if (magY > magZ) { - C[0] = 0; + C[0] = unitVector_.x()/unitVector_.y(); C[1] = 1; C[2] = unitVector_.z()/unitVector_.y(); } else { - C[0] = 0; - C[1] = 0; + C[0] = unitVector_.x()/unitVector_.z(); + C[1] = unitVector_.y()/unitVector_.z(); C[2] = 1; } } @@ -422,19 +422,18 @@ Foam::point Foam::plane::planePlaneIntersect const plane& plane3 ) const { - List pcs(3); - pcs[0]= planeCoeffs(); - pcs[1]= plane2.planeCoeffs(); - pcs[2]= plane3.planeCoeffs(); + FixedList coeffs1(planeCoeffs()); + FixedList coeffs2(plane2.planeCoeffs()); + FixedList coeffs3(plane3.planeCoeffs()); tensor a ( - pcs[0][0],pcs[0][1],pcs[0][2], - pcs[1][0],pcs[1][1],pcs[1][2], - pcs[2][0],pcs[2][1],pcs[2][2] + coeffs1[0],coeffs1[1],coeffs1[2], + coeffs2[0],coeffs2[1],coeffs2[2], + coeffs3[0],coeffs3[1],coeffs3[2] ); - vector b(pcs[0][3],pcs[1][3],pcs[2][3]); + vector b(coeffs1[3],coeffs2[3],coeffs3[3]); return (inv(a) & (-b)); } diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H index 44eb20cbc0..89fb6afd28 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H @@ -149,7 +149,7 @@ public: //- Return coefficients for the // plane equation: ax + by + cz + d = 0 - scalarList planeCoeffs() const; + FixedList planeCoeffs() const; //- Return nearest point in the plane for the given point point nearestPoint(const point& p) const; diff --git a/src/conversion/meshReader/createPolyBoundary.C b/src/conversion/meshReader/createPolyBoundary.C index 16a7e7a31d..16ea5d2a98 100644 --- a/src/conversion/meshReader/createPolyBoundary.C +++ b/src/conversion/meshReader/createPolyBoundary.C @@ -412,6 +412,8 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh) List p(nPatches); + // All patch dictionaries + PtrList patchDicts(patchNames_.size()); // Default boundary patch types word defaultFacesType(emptyPolyPatch::typeName); @@ -422,20 +424,37 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh) mesh.instance(), mesh.meshDir(), patchNames_, - patchTypes_, + patchDicts, "defaultFaces", - defaultFacesType, - patchPhysicalTypes_ + defaultFacesType ); + forAll(patchDicts, patchI) + { + if (!patchDicts.set(patchI)) + { + patchDicts.set(patchI, new dictionary()); + } + dictionary& patchDict = patchDicts[patchI]; + + // add but not overwrite type + patchDict.add("type", patchTypes_[patchI], false); + if (patchPhysicalTypes_.size() && patchPhysicalTypes_[patchI].size()) + { + patchDict.add("startFace", patchPhysicalTypes_[patchI], false); + } + + // overwrite sizes and start + patchDict.add("nFaces", patchSizes_[patchI], true); + patchDict.add("startFace", patchStarts_[patchI], true); + } + forAll(patchStarts_, patchI) { p[patchI] = polyPatch::New ( - patchTypes_[patchI], patchNames_[patchI], - patchSizes_[patchI], - patchStarts_[patchI], + patchDicts[patchI], patchI, mesh.boundaryMesh() ).ptr(); diff --git a/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C index c08ded14a2..fd0ed25b2c 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C @@ -161,13 +161,13 @@ Foam::pressureGradientExplicitSource::Su() const void Foam::pressureGradientExplicitSource::update() { - const volScalarField& rUA = + const volScalarField& rAU = mesh_.lookupObject("(1|A(" + U_.name() + "))"); // Integrate flow variables over cell set scalar volTot = 0.0; scalar magUbarAve = 0.0; - scalar rUAave = 0.0; + scalar rAUave = 0.0; forAllConstIter(cellSet, selectedCellSet_, iter) { label cellI = iter.key(); @@ -176,27 +176,27 @@ void Foam::pressureGradientExplicitSource::update() volTot += volCell; magUbarAve += (flowDir_ & U_[cellI])*volCell; - rUAave += rUA[cellI]*volCell; + rAUave += rAU[cellI]*volCell; } // Collect across all processors reduce(volTot, sumOp()); reduce(magUbarAve, sumOp()); - reduce(rUAave, sumOp()); + reduce(rAUave, sumOp()); // Volume averages magUbarAve /= volTot; - rUAave /= volTot; + rAUave /= volTot; // Calculate the pressure gradient increment needed to adjust the average // flow-rate to the desired value - scalar gradPplus = (mag(Ubar_) - magUbarAve)/rUAave; + scalar gradPplus = (mag(Ubar_) - magUbarAve)/rAUave; // Apply correction to velocity field forAllConstIter(cellSet, selectedCellSet_, iter) { label cellI = iter.key(); - U_[cellI] += flowDir_*rUA[cellI]*gradPplus; + U_[cellI] += flowDir_*rAU[cellI]*gradPplus; } // Update pressure gradient diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.C b/src/mesh/blockMesh/blockMesh/blockMesh.C index c0c6041f4c..9a6b97b087 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.C +++ b/src/mesh/blockMesh/blockMesh/blockMesh.C @@ -89,7 +89,6 @@ Foam::PtrList Foam::blockMesh::patchDicts() const patchTopologies[patchI].write(os); IStringStream is(os.str()); patchDicts.set(patchI, new dictionary(is)); - patchDicts[patchI].set("name", patchTopologies[patchI].name()); } return patchDicts; } @@ -134,12 +133,12 @@ const Foam::faceListList& Foam::blockMesh::patches() const } -//Foam::wordList Foam::blockMesh::patchNames() const -//{ -// return topology().boundaryMesh().names(); -//} -// -// +Foam::wordList Foam::blockMesh::patchNames() const +{ + return topology().boundaryMesh().names(); +} + + //Foam::wordList Foam::blockMesh::patchTypes() const //{ // return topology().boundaryMesh().types(); diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.H b/src/mesh/blockMesh/blockMesh/blockMesh.H index eb43c80d83..9b989f5356 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.H +++ b/src/mesh/blockMesh/blockMesh/blockMesh.H @@ -121,6 +121,7 @@ class blockMesh bool readBoundary ( const dictionary& meshDescription, + wordList& patchNames, faceListList& tmpBlocksPatches, PtrList& patchDicts ); @@ -185,8 +186,8 @@ public: //- Get patch information from the topology mesh PtrList patchDicts() const; -// wordList patchNames() const; -// + wordList patchNames() const; + // wordList patchTypes() const; // // wordList patchPhysicalTypes() const; diff --git a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C index d1fe81c2f1..b82752c947 100644 --- a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C +++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C @@ -189,6 +189,7 @@ bool Foam::blockMesh::readPatches bool Foam::blockMesh::readBoundary ( const dictionary& meshDescription, + wordList& patchNames, faceListList& tmpBlocksPatches, PtrList& patchDicts ) @@ -201,6 +202,7 @@ bool Foam::blockMesh::readBoundary meshDescription.lookup("boundary") ); + patchNames.setSize(patchesInfo.size()); tmpBlocksPatches.setSize(patchesInfo.size()); patchDicts.setSize(patchesInfo.size()); @@ -215,9 +217,9 @@ bool Foam::blockMesh::readBoundary << " valid dictionary." << exit(FatalIOError); } - // Construct dictionary and add name + patchNames[patchI] = patchInfo.keyword(); + // Construct dictionary patchDicts.set(patchI, new dictionary(patchInfo.dict())); - patchDicts[patchI].set("name", patchInfo.keyword()); // Read block faces patchDicts[patchI].lookup("faces") >> tmpBlocksPatches[patchI]; @@ -472,7 +474,8 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription) Info<< nl << "Reading physicalType from existing boundary file" << endl; - wordList patchPhysicalTypes(tmpBlocksPatches.size()); + PtrList patchDicts(patchNames.size()); + word defaultFacesType; preservePatchTypes ( @@ -480,31 +483,29 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription) meshDescription.time().constant(), polyMesh::meshSubDir, patchNames, - patchTypes, + patchDicts, defaultPatchName, - defaultPatchType, - patchPhysicalTypes + defaultPatchType ); - // Convert into dictionary - PtrList patchDicts(patchNames.size()); + // Add cyclic info (might not be present from older file) forAll(patchDicts, patchI) { - patchDicts.set(patchI, new dictionary()); - patchDicts[patchI].set("name", patchNames[patchI]); - patchDicts[patchI].set("type", patchTypes[patchI]); + if (!patchDicts.set(patchI)) + { + patchDicts.set(patchI, new dictionary()); + } + + dictionary& dict = patchDicts[patchI]; + + // Add but not override type + dict.add("type", patchTypes[patchI], false); + + // Override neighbourpatch name if (nbrPatchNames[patchI] != word::null) { - patchDicts[patchI].set("neighbourPatch", nbrPatchNames[patchI]); - } - if (patchPhysicalTypes[patchI] != word::null) - { - patchDicts[patchI].set - ( - "physicalType", - patchPhysicalTypes[patchI] - ); + dict.set("neighbourPatch", nbrPatchNames[patchI]); } } @@ -523,6 +524,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription) xferCopy(blockPointField_), // copy these points, do NOT move tmpBlockCells, tmpBlocksPatches, + patchNames, patchDicts, defaultPatchName, defaultPatchType @@ -530,12 +532,14 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription) } else if (meshDescription.found("boundary")) { + wordList patchNames; faceListList tmpBlocksPatches; PtrList patchDicts; topologyOK = topologyOK && readBoundary ( meshDescription, + patchNames, tmpBlocksPatches, patchDicts ); @@ -553,6 +557,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription) cellShapeList tmpBlockCells(blocks.size()); createCellShapes(tmpBlockCells); + // Extract blockMeshPtr = new polyMesh ( @@ -568,6 +573,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription) xferCopy(blockPointField_), // copy these points, do NOT move tmpBlockCells, tmpBlocksPatches, + patchNames, patchDicts, defaultPatchName, defaultPatchType diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C index 5655c4b6e9..5c81e24cc3 100644 --- a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C +++ b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C @@ -1,1253 +1,1253 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "kinematicSingleLayer.H" -#include "fvm.H" -#include "fvcDiv.H" -#include "fvcLaplacian.H" -#include "fvcSnGrad.H" -#include "fvcReconstruct.H" -#include "fvcVolumeIntegrate.H" -#include "addToRunTimeSelectionTable.H" -#include "directMappedWallPolyPatch.H" - -// Sub-models -#include "injectionModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(kinematicSingleLayer, 0); - addToRunTimeSelectionTable - ( - surfaceFilmModel, - kinematicSingleLayer, - mesh - ); - } -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -bool Foam::surfaceFilmModels::kinematicSingleLayer::read() -{ - if (surfaceFilmModel::read()) - { - solution().lookup("momentumPredictor") >> momentumPredictor_; - solution().lookup("nOuterCorr") >> nOuterCorr_; - solution().lookup("nCorr") >> nCorr_; - solution().lookup("nNonOrthCorr") >> nNonOrthCorr_; - - coeffs_.lookup("Cf") >> Cf_; - - return true; - } - else - { - return false; - } -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::initialise() -{ - if (debug) - { - Pout<< "kinematicSingleLayer::initialise()" << endl; - } - - label nBoundaryFaces = 0; - DynamicList