diff --git a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H index 02a6c86db7..a5bae74528 100644 --- a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H +++ b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,7 @@ if (mesh.nInternalFaces()) { scalarField sumPhi ( - fvc::surfaceSum(mag(phiv))().internalField() + fvc::surfaceSum(mag(phi))().internalField() ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); @@ -54,7 +54,7 @@ if (mesh.nInternalFaces()) )*runTime.deltaTValue(); } -Info<< "phiv Courant Number mean: " << meanCoNum +Info<< "phi Courant Number mean: " << meanCoNum << " max: " << CoNum << " acoustic max: " << acousticCoNum << endl; diff --git a/applications/solvers/multiphase/cavitatingFoam/UEqn.H b/applications/solvers/multiphase/cavitatingFoam/UEqn.H index 1ca0b9f0a5..8edf0d3934 100644 --- a/applications/solvers/multiphase/cavitatingFoam/UEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/UEqn.H @@ -1,7 +1,7 @@ fvVectorMatrix UEqn ( fvm::ddt(rho, U) - + fvm::div(phi, U) + + fvm::div(rhoPhi, U) + turbulence->divDevRhoReff(rho, U) ); diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C index c3fde6b3a1..284ca97bd4 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/cavitatingDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "createUf.H" #include "createPcorrTypes.H" - #include "compressibleCourantNo.H" + #include "CourantNo.H" #include "setInitialDeltaT.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -86,12 +86,12 @@ int main(int argc, char *argv[]) if (correctPhi) { // Calculate absolute flux from the mapped surface velocity - phiv = mesh.Sf() & Uf; + phi = mesh.Sf() & Uf; #include "correctPhi.H" // Make the flux relative to the mesh motion - fvc::makeRelative(phiv, U); + fvc::makeRelative(phi, U); } } diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/correctPhi.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/correctPhi.H index c05d664838..4bb1ce9d0d 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/correctPhi.H @@ -14,7 +14,7 @@ if (mesh.changing()) { U.boundaryField()[patchI].evaluate(); - phiv.boundaryField()[patchI] = + phi.boundaryField()[patchI] = U.boundaryField()[patchI] & mesh.Sf().boundaryField()[patchI]; } @@ -37,21 +37,21 @@ if (mesh.changing()) pcorrTypes ); - surfaceScalarField rhof(fvc::interpolate(rho, "div(phiv,rho)")); + surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)")); dimensionedScalar rAUf("rAUf", dimTime, 1.0); while (pimple.correctNonOrthogonal()) { fvScalarMatrix pcorrEqn ( - fvm::laplacian(rAUf, pcorr) == fvc::ddt(rho) + fvc::div(phiv*rhof) + fvm::laplacian(rAUf, pcorr) == fvc::ddt(rho) + fvc::div(phi*rhof) ); pcorrEqn.solve(); if (pimple.finalNonOrthogonalIter()) { - phiv -= pcorrEqn.flux()/rhof; + phi -= pcorrEqn.flux()/rhof; } } } diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H index a0e0e6c74d..b07846b6de 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingDyMFoam/pEqn.H @@ -17,13 +17,13 @@ volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); - phiv = (fvc::interpolate(HbyA) & mesh.Sf()) + phi = (fvc::interpolate(HbyA) & mesh.Sf()) + rhorAUf*fvc::ddtCorr(U, Uf); - fvc::makeRelative(phiv, U); + fvc::makeRelative(phi, U); surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p)); - phiv -= phiGradp/rhof; + phi -= phiGradp/rhof; volScalarField rho0(rho - psi*p); @@ -33,7 +33,7 @@ ( fvc::ddt(rho) + psi*correction(fvm::ddt(p)) - + fvc::div(phiv, rho) + + fvc::div(phi, rho) + fvc::div(phiGradp) - fvm::laplacian(rhorAUf, p) ); @@ -42,7 +42,7 @@ if (pimple.finalNonOrthogonalIter()) { - phiv += (phiGradp + pEqn.flux())/rhof; + phi += (phiGradp + pEqn.flux())/rhof; } } @@ -85,6 +85,6 @@ { Uf = fvc::interpolate(U); surfaceVectorField n(mesh.Sf()/mesh.magSf()); - Uf += n*(phiv/mesh.magSf() - (n & Uf)); + Uf += n*(phi/mesh.magSf() - (n & Uf)); } } diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index c4453df391..2b04d58fb5 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) #include "readControls.H" #include "createFields.H" #include "initContinuityErrs.H" - #include "compressibleCourantNo.H" + #include "CourantNo.H" #include "setInitialDeltaT.H" pimpleControl pimple(mesh); diff --git a/applications/solvers/multiphase/cavitatingFoam/createFields.H b/applications/solvers/multiphase/cavitatingFoam/createFields.H index 605c0deece..2c834dc511 100644 --- a/applications/solvers/multiphase/cavitatingFoam/createFields.H +++ b/applications/solvers/multiphase/cavitatingFoam/createFields.H @@ -39,12 +39,25 @@ mesh ); - #include "createPhiv.H" - #include "compressibleCreatePhi.H" + #include "createPhi.H" + + // Mass flux (corrected by rhoEqn.H) + surfaceScalarField rhoPhi + ( + IOobject + ( + "rhoPhi", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + fvc::interpolate(rho)*phi + ); Info<< "Reading transportProperties\n" << endl; - incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv); + incompressibleTwoPhaseMixture twoPhaseProperties(U, phi); volScalarField& alphav(twoPhaseProperties.alpha1()); alphav.oldTime(); @@ -72,5 +85,5 @@ // Create incompressible turbulence model autoPtr turbulence ( - incompressible::turbulenceModel::New(U, phiv, twoPhaseProperties) + incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) ); diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index 210a30fd14..da8047914c 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -17,12 +17,12 @@ volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); - phiv = (fvc::interpolate(HbyA) & mesh.Sf()) - + rhorAUf*fvc::ddtCorr(U, phiv); + phi = (fvc::interpolate(HbyA) & mesh.Sf()) + + rhorAUf*fvc::ddtCorr(U, phi); surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p)); - phiv -= phiGradp/rhof; + phi -= phiGradp/rhof; while (pimple.correctNonOrthogonal()) { @@ -30,7 +30,7 @@ ( fvm::ddt(psi, p) - (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi) - + fvc::div(phiv, rho) + + fvc::div(phi, rho) + fvc::div(phiGradp) - fvm::laplacian(rhorAUf, p) ); @@ -39,7 +39,7 @@ if (pimple.finalNonOrthogonalIter()) { - phiv += (phiGradp + pEqn.flux())/rhof; + phi += (phiGradp + pEqn.flux())/rhof; } } diff --git a/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H b/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H index d0bd6e1dad..a01823ad49 100644 --- a/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H @@ -2,12 +2,12 @@ fvScalarMatrix rhoEqn ( fvm::ddt(rho) - + fvm::div(phiv, rho) + + fvm::div(phi, rho) ); rhoEqn.solve(); - phi = rhoEqn.flux(); + rhoPhi = rhoEqn.flux(); Info<< "max-min rho: " << max(rho).value() << " " << min(rho).value() << endl; diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 66df09e5e9..49958bb34f 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -256,7 +256,8 @@ castellatedMeshControls // Whether any faceZones (as specified in the refinementSurfaces) // are only on the boundary of corresponding cellZones or also allow - // free-standing zone faces. Not used if there are no faceZones. + // free-standing zone faces and zone faces on boundaries. Not used if + // there are no faceZones. allowFreeStandingZoneFaces true; diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 666293c558..9db171db69 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anispulation | ------------------------------------------------------------------------------- License @@ -46,6 +46,9 @@ Description #include "zeroGradientFvPatchFields.H" #include "CuthillMcKeeRenumber.H" #include "fvMeshSubset.H" +#include "cellSet.H" +#include "faceSet.H" +#include "pointSet.H" #ifdef FOAM_USE_ZOLTAN # include "zoltanRenumber.H" @@ -703,6 +706,7 @@ int main(int argc, char *argv[]) bool writeMaps = false; bool orderPoints = false; label blockSize = 0; + bool renumberSets = true; // Construct renumberMethod autoPtr renumberDictPtr; @@ -720,7 +724,6 @@ int main(int argc, char *argv[]) renumberPtr = renumberMethod::New(renumberDict); - sortCoupledFaceCells = renumberDict.lookupOrDefault ( "sortCoupledFaceCells", @@ -763,6 +766,8 @@ int main(int argc, char *argv[]) Info<< "Writing renumber maps (new to old) to polyMesh." << nl << endl; } + + renumberSets = renumberDict.lookupOrDefault("renumberSets", true); } else { @@ -864,6 +869,54 @@ int main(int argc, char *argv[]) PtrList stFlds; ReadFields(mesh, objects, stFlds); + // Read sets + PtrList cellSets; + PtrList faceSets; + PtrList pointSets; + if (renumberSets) + { + // Read sets + IOobjectList objects(mesh, mesh.facesInstance(), "polyMesh/sets"); + { + IOobjectList cSets(objects.lookupClass(cellSet::typeName)); + if (cSets.size()) + { + Info<< "Reading cellSets:" << endl; + forAllConstIter(IOobjectList, cSets, iter) + { + cellSets.append(new cellSet(*iter())); + Info<< " " << cellSets.last().name() << endl; + } + } + } + { + IOobjectList fSets(objects.lookupClass(faceSet::typeName)); + if (fSets.size()) + { + Info<< "Reading faceSets:" << endl; + forAllConstIter(IOobjectList, fSets, iter) + { + faceSets.append(new faceSet(*iter())); + Info<< " " << faceSets.last().name() << endl; + } + } + } + { + IOobjectList pSets(objects.lookupClass(pointSet::typeName)); + if (pSets.size()) + { + Info<< "Reading pointSets:" << endl; + forAllConstIter(IOobjectList, pSets, iter) + { + pointSets.append(new pointSet(*iter())); + Info<< " " << pointSets.last().name() << endl; + } + } + } + } + + + Info<< endl; // From renumbering: @@ -1058,7 +1111,6 @@ int main(int argc, char *argv[]) mesh.updateMesh(map); // Update proc maps - if (cellProcAddressing.headerOk()) if ( cellProcAddressing.headerOk() @@ -1073,7 +1125,6 @@ int main(int argc, char *argv[]) UIndirectList