diff --git a/applications/solvers/compressible/sonicDyMFoam/createFields.H b/applications/solvers/compressible/sonicDyMFoam/createFields.H index 93dac20e07..4344a4f5e4 100644 --- a/applications/solvers/compressible/sonicDyMFoam/createFields.H +++ b/applications/solvers/compressible/sonicDyMFoam/createFields.H @@ -7,7 +7,7 @@ basicPsiThermo& thermo = pThermo(); volScalarField& p = thermo.p(); - volScalarField& e = thermo.h(); + volScalarField& e = thermo.e(); const volScalarField& psi = thermo.psi(); volScalarField rho diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C index a124288dc5..ea10d9129f 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H index 8289d014b0..b94745d9df 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H @@ -14,5 +14,5 @@ IOdictionary mdEquilibrationDict scalar targetTemperature = readScalar ( - mdEquilibrationDict.lookup("equilibrationTargetTemperature") + mdEquilibrationDict.lookup("targetTemperature") ); diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C index 287065754e..9fafafe1c9 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options index a53061a93c..041d2e0605 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I../buoyantBoussinesqSimpleFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \ diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H index e2a89d1441..ece4b8ffe5 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H @@ -2,7 +2,7 @@ volScalarField kappaEff ( "kappaEff", - turbulence->nu() + turbulence->nut()/Prt + turbulence->nu()/Pr + turbulence->nut()/Prt ); fvScalarMatrix TEqn @@ -15,4 +15,6 @@ TEqn.relax(); TEqn.solve(); + + rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H index 3b5b5be249..35387f4ff4 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H @@ -1,23 +1,26 @@ // Solve the momentum equation - tmp UEqn + fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) ); - UEqn().relax(); + UEqn.relax(); - solve - ( - UEqn() - == - -fvc::reconstruct + if (momentumPredictor) + { + solve ( + UEqn + == + fvc::reconstruct ( - fvc::snGrad(pd) - - betaghf*fvc::snGrad(T) - ) * mesh.magSf() - ) - ); + ( + fvc::interpolate(rhok)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() + ) + ) + ); + } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C index 067ae6a992..a8ff183742 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C @@ -30,18 +30,18 @@ Description Uses the Boussinesq approximation: \f[ - rho_{eff} = 1 - beta(T - T_{ref}) + rho_{k} = 1 - beta(T - T_{ref}) \f] where: - \f$ rho_{eff} \f$ = the effective (driving) density + \f$ rho_{k} \f$ = the effective (driving) kinematic density beta = thermal expansion coefficient [1/K] T = temperature [K] \f$ T_{ref} \f$ = reference temperature [K] Valid when: \f[ - rho_{eff} << 1 + rho_{k} << 1 \f] \*---------------------------------------------------------------------------*/ @@ -78,20 +78,17 @@ int main(int argc, char *argv[]) #include "setDeltaT.H" #include "UEqn.H" + #include "TEqn.H" // --- PISO loop for (int corr=0; corrcorrect(); - if (runTime.write()) - { - #include "writeAdditionalFields.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H index 5f3f13626d..dde0e38b33 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H @@ -14,13 +14,12 @@ mesh ); - // kinematic pd - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -53,15 +52,25 @@ incompressible::RASModel::New(U, phi, laminarTransport) ); - Info<< "Calculating field beta*(g.h)\n" << endl; - surfaceScalarField betaghf("betagh", beta*(g & mesh.Cf())); - - label pdRefCell = 0; - scalar pdRefValue = 0.0; + label pRefCell = 0; + scalar pRefValue = 0.0; setRefCell ( - pd, - mesh.solutionDict().subDict("SIMPLE"), - pdRefCell, - pdRefValue + p, + mesh.solutionDict().subDict("PISO"), + pRefCell, + pRefValue + ); + + + // Kinematic density for buoyancy force + volScalarField rhok + ( + IOobject + ( + "rhok", + runTime.timeName(), + mesh + ), + 1.0 - beta*(T - TRef) ); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pEqn.H similarity index 55% rename from applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pEqn.H index 25e2a9817f..ff0c26f058 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pEqn.H @@ -1,9 +1,8 @@ { - volScalarField rUA("rUA", 1.0/UEqn().A()); + volScalarField rUA("rUA", 1.0/UEqn.A()); surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA)); - U = rUA*UEqn().H(); - UEqn.clear(); + U = rUA*UEqn.H(); surfaceScalarField phiU ( @@ -11,31 +10,31 @@ + fvc::ddtPhiCorr(rUA, U, phi) ); - phi = phiU + betaghf*fvc::snGrad(T)*rUAf*mesh.magSf(); + phi = phiU + rUAf*fvc::interpolate(rhok)*(g & mesh.Sf()); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rUAf, pd) == fvc::div(phi) + fvm::laplacian(rUAf, p) == fvc::div(phi) ); if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi += pdEqn.flux(); + phi -= pEqn.flux(); } } - U -= rUA*fvc::reconstruct((phi - phiU)/rUAf); + U += rUA*fvc::reconstruct((phi - phiU)/rUAf); U.correctBoundaryConditions(); #include "continuityErrs.H" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H deleted file mode 100644 index 585128dfde..0000000000 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H +++ /dev/null @@ -1,13 +0,0 @@ - singlePhaseTransportModel laminarTransport(U, phi); - - // thermal expansion coefficient [1/K] - dimensionedScalar beta(laminarTransport.lookup("beta")); - - // reference temperature [K] - dimensionedScalar TRef(laminarTransport.lookup("TRef")); - - // reference kinematic pressure [m2/s2] - dimensionedScalar pRef(laminarTransport.lookup("pRef")); - - // turbulent Prandtl number - dimensionedScalar Prt(laminarTransport.lookup("Prt")); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H deleted file mode 100644 index 20f7c6ae1d..0000000000 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H +++ /dev/null @@ -1,29 +0,0 @@ -{ - volScalarField rhoEff - ( - IOobject - ( - "rhoEff", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - 1.0 - beta*(T - TRef) - ); - rhoEff.write(); - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rhoEff*(g & mesh.C()) + pRef - ); - p.write(); -} diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H index d00f0877ea..7452a0495a 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H @@ -2,7 +2,7 @@ volScalarField kappaEff ( "kappaEff", - turbulence->nu() + turbulence->nut()/Prt + turbulence->nu()/Pr + turbulence->nut()/Prt ); fvScalarMatrix TEqn @@ -16,4 +16,6 @@ eqnResidual = TEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); + + rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H index cf5c4a1978..a813a2d8b7 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H @@ -13,12 +13,12 @@ ( UEqn() == - -fvc::reconstruct + fvc::reconstruct ( ( - fvc::snGrad(pd) - - betaghf*fvc::snGrad(T) - ) * mesh.magSf() + fvc::interpolate(rhok)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() + ) ) ).initialResidual(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index 58947fe295..63b938fa36 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -72,21 +72,18 @@ int main(int argc, char *argv[]) #include "readSIMPLEControls.H" #include "initConvergenceCheck.H" - pd.storePrevIter(); + p.storePrevIter(); // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "TEqn.H" - #include "pdEqn.H" + #include "pEqn.H" } turbulence->correct(); - if (runTime.write()) - { - #include "writeAdditionalFields.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H index 5f3f13626d..0e668e9d98 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H @@ -14,13 +14,12 @@ mesh ); - // kinematic pd - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -56,12 +55,25 @@ Info<< "Calculating field beta*(g.h)\n" << endl; surfaceScalarField betaghf("betagh", beta*(g & mesh.Cf())); - label pdRefCell = 0; - scalar pdRefValue = 0.0; + label pRefCell = 0; + scalar pRefValue = 0.0; setRefCell ( - pd, + p, mesh.solutionDict().subDict("SIMPLE"), - pdRefCell, - pdRefValue + pRefCell, + pRefValue + ); + + + // Kinematic density for buoyancy force + volScalarField rhok + ( + IOobject + ( + "rhok", + runTime.timeName(), + mesh + ), + 1.0 - beta*(T - TRef) ); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pdEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H similarity index 64% rename from applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pdEqn.H rename to applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H index e782d26c8d..e1d42d738e 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pdEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H @@ -6,41 +6,42 @@ UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); - adjustPhi(phi, U, pd); - surfaceScalarField buoyancyPhi = -betaghf*fvc::snGrad(T)*rUAf*mesh.magSf(); - phi -= buoyancyPhi; + adjustPhi(phi, U, p); + surfaceScalarField buoyancyPhi = + rUAf*fvc::interpolate(rhok)*(g & mesh.Sf()); + phi += buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rUAf, pd) == fvc::div(phi) + fvm::laplacian(rUAf, p) == fvc::div(phi) ); - pdEqn.setReference(pdRefCell, pdRefValue); + pEqn.setReference(pRefCell, pRefValue); // retain the residual from the first iteration if (nonOrth == 0) { - eqnResidual = pdEqn.solve().initialResidual(); + eqnResidual = pEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); } else { - pdEqn.solve(); + pEqn.solve(); } if (nonOrth == nNonOrthCorr) { // Calculate the conservative fluxes - phi -= pdEqn.flux(); + phi -= pEqn.flux(); // Explicitly relax pressure for momentum corrector - pd.relax(); + p.relax(); // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure - U -= rUA*fvc::reconstruct((buoyancyPhi + pdEqn.flux())/rUAf); + U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf); U.correctBoundaryConditions(); } } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H index 585128dfde..82d101d8c1 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H @@ -1,13 +1,13 @@ singlePhaseTransportModel laminarTransport(U, phi); - // thermal expansion coefficient [1/K] + // Thermal expansion coefficient [1/K] dimensionedScalar beta(laminarTransport.lookup("beta")); - // reference temperature [K] + // Reference temperature [K] dimensionedScalar TRef(laminarTransport.lookup("TRef")); - // reference kinematic pressure [m2/s2] - dimensionedScalar pRef(laminarTransport.lookup("pRef")); + // Laminar Prandtl number + dimensionedScalar Pr(laminarTransport.lookup("Pr")); - // turbulent Prandtl number + // Turbulent Prandtl number dimensionedScalar Prt(laminarTransport.lookup("Prt")); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/writeAdditionalFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/writeAdditionalFields.H deleted file mode 100644 index 20f7c6ae1d..0000000000 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/writeAdditionalFields.H +++ /dev/null @@ -1,29 +0,0 @@ -{ - volScalarField rhoEff - ( - IOobject - ( - "rhoEff", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - 1.0 - beta*(T - TRef) - ); - rhoEff.write(); - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rhoEff*(g & mesh.C()) + pRef - ); - p.write(); -} diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H index b5c84e435e..b8ac5595e4 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H @@ -65,4 +65,3 @@ dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar totalVolume = sum(mesh.V()); - diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C index 0862d20bb2..c869eff899 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C @@ -41,16 +41,15 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "createRadiationModel.H" + #include "initContinuityErrs.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "createRadiationModel.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -58,17 +57,17 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readSIMPLEControls.H" -# include "initConvergenceCheck.H" + #include "readSIMPLEControls.H" + #include "initConvergenceCheck.H" p.storePrevIter(); rho.storePrevIter(); // Pressure-velocity SIMPLE corrector { -# include "UEqn.H" -# include "hEqn.H" -# include "pEqn.H" + #include "UEqn.H" + #include "hEqn.H" + #include "pEqn.H" } turbulence->correct(); @@ -79,7 +78,7 @@ int main(int argc, char *argv[]) << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; -# include "convergenceCheck.H" + #include "convergenceCheck.H" } Info<< "End\n" << endl; diff --git a/applications/solvers/incompressible/channelFoam/readTransportProperties.H b/applications/solvers/incompressible/channelFoam/readTransportProperties.H index c99d0ae4b5..87c93c9195 100644 --- a/applications/solvers/incompressible/channelFoam/readTransportProperties.H +++ b/applications/solvers/incompressible/channelFoam/readTransportProperties.H @@ -7,7 +7,8 @@ runTime.constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) ); diff --git a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H index 3347db180b..aeb3137adf 100644 --- a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H +++ b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H @@ -1,7 +1,7 @@ - Info<< "Creating merge patch pairs" << nl << endl; - if (mergePatchPairs.size()) { + Info<< "Creating merge patch pairs" << nl << endl; + // Create and add point and face zones and mesh modifiers List pz(mergePatchPairs.size()); List fz(3*mergePatchPairs.size()); diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSetDict b/applications/utilities/mesh/manipulation/cellSet/cellSetDict index 95465d8f54..fd11ab871d 100644 --- a/applications/utilities/mesh/manipulation/cellSet/cellSetDict +++ b/applications/utilities/mesh/manipulation/cellSet/cellSetDict @@ -26,12 +26,31 @@ action new; topoSetSources ( + // Select by explicitly providing cell labels + labelToCell + { + value (12 13 56); // labels of cells + } + // Copy elements from cellSet cellToCell { set c1; } + // Cells in cell zone + zoneToCell + { + name ".*Zone"; // Name of cellZone, regular expressions allowed + } + + // Cells on master or slave side of faceZone + faceZoneToCell + { + name ".*Zone"; // Name of faceZone, regular expressions allowed + option master; // master/slave + } + // Select based on faceSet faceToCell { @@ -51,12 +70,6 @@ topoSetSources //option all; // cell with all points in pointSet } - // Select by explicitly providing cell labels - labelToCell - { - value (12 13 56); // labels of cells - } - // Select based on cellShape shapeToCell { @@ -87,7 +100,6 @@ topoSetSources radius 5.0; } - // Cells with centre within sphere sphereToCell { @@ -95,20 +107,6 @@ topoSetSources radius 5.0; } - // Cells in cell zone - zoneToCell - { - name ".*Zone"; // Name of cellZone, regular expressions allowed - } - - // values of field within certain range - fieldToCell - { - fieldName U; // Note: uses mag(U) since volVectorField - min 0.1; - max 0.5; - } - // Cells with cellCentre nearest to coordinates nearestToCell { @@ -129,6 +127,22 @@ topoSetSources // and near surf curvature // (set to -100 if not used) } + + // values of field within certain range + fieldToCell + { + fieldName U; // Note: uses mag(U) since volVectorField + min 0.1; + max 0.5; + } + + // Mesh region (non-face connected part of (subset of)mesh) + regionToCell + { + set c0; // name of cellSet giving mesh subset + insidePoint (1 2 3); // point inside region to select + } + ); diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 14f5704836..9ce34cda1c 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -7,6 +7,31 @@ #include "pointSet.H" #include "IOmanip.H" +bool Foam::checkSync(const wordList& names) +{ + List allNames(Pstream::nProcs()); + allNames[Pstream::myProcNo()] = names; + Pstream::gatherList(allNames); + + bool hasError = false; + + for (label procI = 1; procI < allNames.size(); procI++) + { + if (allNames[procI] != allNames[0]) + { + hasError = true; + + Info<< " ***Inconsistent zones across processors, " + "processor 0 has zones:" << allNames[0] + << ", processor " << procI << " has zones:" + << allNames[procI] + << endl; + } + } + return hasError; +} + + Foam::label Foam::checkTopology ( const polyMesh& mesh, @@ -24,6 +49,31 @@ Foam::label Foam::checkTopology // Check if the boundary processor patches are correct mesh.boundaryMesh().checkParallelSync(true); + // Check names of zones are equal + if (checkSync(mesh.cellZones().names())) + { + noFailedChecks++; + } + if (checkSync(mesh.faceZones().names())) + { + noFailedChecks++; + } + if (checkSync(mesh.pointZones().names())) + { + noFailedChecks++; + } + + // Check contents of faceZones consistent + { + forAll(mesh.faceZones(), zoneI) + { + if (mesh.faceZones()[zoneI].checkParallelSync(true)) + { + noFailedChecks++; + } + } + } + { pointSet points(mesh, "unusedPoints", mesh.nPoints()/100); if (mesh.checkPoints(true, &points)) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H index 787aa4318d..4790765d16 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H @@ -1,8 +1,11 @@ #include "label.H" +#include "wordList.H" namespace Foam { class polyMesh; + bool checkSync(const wordList& names); + label checkTopology(const polyMesh&, const bool, const bool); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C b/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C index 9a2c9396af..269656594c 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C +++ b/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C @@ -69,13 +69,13 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology) << " cells: " << returnReduce(mesh.cells().size(), sumOp