diff --git a/applications/solvers/combustion/PDRFoam/StCourantNo.H b/applications/solvers/combustion/PDRFoam/StCourantNo.H index f755bb217b..8fac05d81c 100644 --- a/applications/solvers/combustion/PDRFoam/StCourantNo.H +++ b/applications/solvers/combustion/PDRFoam/StCourantNo.H @@ -34,17 +34,14 @@ Description if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs() - *mag(phiSt/fvc::interpolate(rho)); + scalarField sumPhi = + fvc::surfaceSum(mag(phiSt))().internalField() + /rho.internalField(); - StCoNum = - max(SfUfbyDelta/mesh.magSf()).value() - *runTime.deltaTValue(); + StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); meanStCoNum = - (sum(SfUfbyDelta)/sum(mesh.magSf())).value() - *runTime.deltaTValue(); + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "St courant Number mean: " << meanStCoNum diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointContinuityErrs.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointContinuityErrs.H index 1023a26c70..d4d72cf6ef 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointContinuityErrs.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointContinuityErrs.H @@ -30,10 +30,10 @@ Description \*---------------------------------------------------------------------------*/ { - scalar sumLocalContErr = runTime.deltaT().value()* + scalar sumLocalContErr = runTime.deltaTValue()* mag(fvc::div(phia))().weightedAverage(mesh.V()).value(); - scalar globalContErr = runTime.deltaT().value()* + scalar globalContErr = runTime.deltaTValue()* fvc::div(phia)().weightedAverage(mesh.V()).value(); cumulativeContErr += globalContErr; diff --git a/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H index 65cd8e02cc..0dfa24316f 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H +++ b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H @@ -36,23 +36,23 @@ scalar waveCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs() - *mag(phi)/fvc::interpolate(h); + scalarField sumPhi = + fvc::surfaceSum(mag(phi))().internalField() + /h.internalField(); - CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaTValue(); + CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); - meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaTValue(); + meanCoNum = + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); // Gravity wave Courant number - waveCoNum = - 0.5*max + waveCoNum = 0.25*gMax + ( + fvc::surfaceSum ( - mesh.surfaceInterpolation::deltaCoeffs() - *sqrt(fvc::interpolate(h)) - ).value()*sqrt(magg).value()*runTime.deltaTValue(); + fvc::interpolate(sqrt(h))*mesh.magSf() + )().internalField()/mesh.V().field() + )*sqrt(magg).value()*runTime.deltaTValue(); } Info<< "Courant number mean: " << meanCoNum diff --git a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H index d5c5c53cc6..8b26ba033e 100644 --- a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H +++ b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H @@ -35,19 +35,21 @@ scalar acousticCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv); + scalarField sumPhi = + fvc::surfaceSum(mag(phiv))().internalField(); - CoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaTValue(); + CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); - meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaTValue(); + meanCoNum = + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); - acousticCoNum = max + acousticCoNum = 0.5*gMax ( - mesh.surfaceInterpolation::deltaCoeffs()/sqrt(fvc::interpolate(psi)) - ).value()*runTime.deltaTValue(); + fvc::surfaceSum + ( + fvc::interpolate(scalar(1)/sqrt(psi))*mesh.magSf() + )().internalField()/mesh.V().field() + )*runTime.deltaTValue(); } Info<< "phiv Courant Number mean: " << meanCoNum diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index 42543b3c37..38ea48ea25 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) << nl << endl; } - Info<< "\n end \n"; + Info<< "End\n" << endl; return 0; } diff --git a/applications/solvers/multiphase/interFoam/alphaCourantNo.H b/applications/solvers/multiphase/interFoam/alphaCourantNo.H index 12d1b933d4..e5edfc76ca 100644 --- a/applications/solvers/multiphase/interFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/interFoam/alphaCourantNo.H @@ -43,10 +43,10 @@ if (mesh.nInternalFaces()) pos(alpha1 - 0.01)*pos(0.99 - alpha1) *fvc::surfaceSum(mag(phi))().internalField(); - alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value(); + alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); meanAlphaCoNum = - 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaT().value(); + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Interface Courant Number mean: " << meanAlphaCoNum diff --git a/applications/solvers/multiphase/interFoam/setDeltaT.H b/applications/solvers/multiphase/interFoam/setDeltaT.H index b315dcd1a0..b619ed90f9 100644 --- a/applications/solvers/multiphase/interFoam/setDeltaT.H +++ b/applications/solvers/multiphase/interFoam/setDeltaT.H @@ -42,12 +42,12 @@ if (adjustTimeStep) ( min ( - deltaTFact*runTime.deltaT().value(), + deltaTFact*runTime.deltaTValue(), maxDeltaT ) ); - Info<< "deltaT = " << runTime.deltaT().value() << endl; + Info<< "deltaT = " << runTime.deltaTValue() << endl; } // ************************************************************************* // diff --git a/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H index a560a60d27..105149f87e 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H @@ -39,20 +39,16 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField alpha1f = fvc::interpolate(alpha1); - surfaceScalarField alpha2f = fvc::interpolate(alpha2); - - surfaceScalarField SfUfbyDelta = max + scalarField sumPhi = max ( - pos(alpha1f - 0.01)*pos(0.99 - alpha1f), - pos(alpha2f - 0.01)*pos(0.99 - alpha2f) - )*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi); + pos(alpha1 - 0.01)*pos(0.99 - alpha1), + pos(alpha2 - 0.01)*pos(0.99 - alpha2) + )*fvc::surfaceSum(mag(phi))().internalField(); - alphaCoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); - meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + meanAlphaCoNum = + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Interface Courant Number mean: " << meanAlphaCoNum diff --git a/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H index 50e64f5f51..a63ab62103 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H @@ -39,15 +39,14 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = - mixture.nearInterface() - *mesh.surfaceInterpolation::deltaCoeffs()*mag(phi); + scalarField sumPhi = + mixture.nearInterface()().internalField() + *fvc::surfaceSum(mag(phi))().internalField(); - alphaCoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); - meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + meanAlphaCoNum = + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Interface Courant Number mean: " << meanAlphaCoNum diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index c0582b5c13..22c45bad71 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -457,12 +457,12 @@ Foam::tmp Foam::multiphaseMixture::K } -Foam::tmp +Foam::tmp Foam::multiphaseMixture::nearInterface() const { - tmp tnearInt + tmp tnearInt ( - new surfaceScalarField + new volScalarField ( IOobject ( @@ -477,8 +477,7 @@ Foam::multiphaseMixture::nearInterface() const forAllConstIter(PtrDictionary, phases_, iter) { - surfaceScalarField alphaf = fvc::interpolate(iter()); - tnearInt() = max(tnearInt(), pos(alphaf - 0.01)*pos(0.99 - alphaf)); + tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter())); } return tnearInt; diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index 32a7f10118..6a58813e54 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -258,7 +258,7 @@ public: //- Indicator of the proximity of the interface // Field values are 1 near and 0 away for the interface. - tmp nearInterface() const; + tmp nearInterface() const; //- Solve for the mixture phase-fractions void solve(); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H b/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H index 75dcd68c7f..ae6a13feb0 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/CourantNos.H @@ -1,11 +1,10 @@ # include "CourantNo.H" { - scalar UrCoNum = max + scalar UrCoNum = 0.5*gMax ( - mesh.surfaceInterpolation::deltaCoeffs()*mag(phia - phib) - /mesh.magSf() - ).value()*runTime.deltaT().value(); + fvc::surfaceSum(mag(phia - phib))().internalField()/mesh.V().field() + )*runTime.deltaTValue(); Info<< "Max Ur Courant Number = " << UrCoNum << endl; diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index c49dc5db31..0bab423114 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -569,21 +569,31 @@ int main(int argc, char *argv[]) << "as type patch. Please reset after mesh conversion as necessary." << endl; - wordList patchTypes(patchFaces.size(), polyPatch::typeName); - wordList patchPhysicalTypes(patchFaces.size()); + 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", 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/generation/snappyHexMesh/Make/options b/applications/utilities/mesh/generation/snappyHexMesh/Make/options index 3c224d318f..b7fd6d3bd2 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/Make/options +++ b/applications/utilities/mesh/generation/snappyHexMesh/Make/options @@ -11,7 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -ldecompositionMethods \ - -L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \ + -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -lmeshTools \ -ldynamicMesh \ -lautoMesh diff --git a/applications/utilities/mesh/manipulation/createBaffles/SetPatchFields.C b/applications/utilities/mesh/manipulation/createBaffles/SetPatchFields.C new file mode 100644 index 0000000000..25de86d62f --- /dev/null +++ b/applications/utilities/mesh/manipulation/createBaffles/SetPatchFields.C @@ -0,0 +1,47 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "SetPatchFields.H" + +// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // + +template +void Foam::SetPatchFields +( + PtrList& fields, + const label patchI, + const typename GeoField::value_type& initVal +) +{ + forAll(fields, i) + { + typename GeoField::PatchFieldType& pfld = + fields[i].boundaryField()[patchI]; + pfld == initVal; + } +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/createBaffles/SetPatchFields.H b/applications/utilities/mesh/manipulation/createBaffles/SetPatchFields.H new file mode 100644 index 0000000000..1dcb1e346a --- /dev/null +++ b/applications/utilities/mesh/manipulation/createBaffles/SetPatchFields.H @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +Global + Foam::SetPatchFields + +Description + Helper routine to initialise a patch field to a constant value + +SourceFiles + SetPatchFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SetPatchFields_H +#define SetPatchFields_H + +#include "PtrList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +//- Helper routine to read fields +template +void SetPatchFields +( + PtrList& fields, + const label patchI, + const typename GeoField::value_type& initVal +); + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "SetPatchFields.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index f01c2cd602..a94dc42144 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -43,6 +43,8 @@ Description #include "volFields.H" #include "surfaceFields.H" #include "ZoneIDs.H" +#include "fvMeshMapper.H" +#include "SetPatchFields.H" using namespace Foam; @@ -241,45 +243,39 @@ 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); + Info<< "Reading geometric fields" << nl << endl; + 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 ssymtFlds; + ReadFields(mesh, objects, ssymtFlds); + + PtrList stFlds; + ReadFields(mesh, objects, stFlds); - PtrList stFlds; - ReadFields(mesh, objects, stFlds); - } - else - { - Info<< "Not updating geometric fields" << nl << endl; - } // Mesh change container polyTopoChange meshMod(mesh); @@ -484,6 +480,58 @@ int main(int argc, char *argv[]) // Update fields mesh.updateMesh(map); + // Correct boundary faces mapped-out-of-nothing. + { + fvMeshMapper mapper(mesh, map); + bool hasWarned = false; + forAll(newMasterPatches, i) + { + label patchI = newMasterPatches[i]; + const fvPatchMapper& pm = mapper.boundaryMap()[patchI]; + if (pm.sizeBeforeMapping() == 0) + { + if (!hasWarned) + { + hasWarned = true; + WarningIn(args.executable()) + << "Setting field on boundary faces to zero." << endl + << "You might have to edit these fields." << endl; + } + + SetPatchFields(vsFlds, patchI, pTraits::zero); + SetPatchFields(vvFlds, patchI, pTraits::zero); + SetPatchFields(vstFlds, patchI, pTraits::zero); + SetPatchFields(vsymtFlds, patchI, pTraits::zero); + SetPatchFields(vtFlds, patchI, pTraits::zero); + + SetPatchFields(ssFlds, patchI, pTraits::zero); + SetPatchFields(svFlds, patchI, pTraits::zero); + SetPatchFields(sstFlds, patchI, pTraits::zero); + SetPatchFields(ssymtFlds, patchI, pTraits::zero); + SetPatchFields(stFlds, patchI, pTraits::zero); + } + } + forAll(newSlavePatches, i) + { + label patchI = newSlavePatches[i]; + const fvPatchMapper& pm = mapper.boundaryMap()[patchI]; + if (pm.sizeBeforeMapping() == 0) + { + SetPatchFields(vsFlds, patchI, pTraits::zero); + SetPatchFields(vvFlds, patchI, pTraits::zero); + SetPatchFields(vstFlds, patchI, pTraits::zero); + SetPatchFields(vsymtFlds, patchI, pTraits::zero); + SetPatchFields(vtFlds, patchI, pTraits::zero); + + SetPatchFields(ssFlds, patchI, pTraits::zero); + SetPatchFields(svFlds, patchI, pTraits::zero); + SetPatchFields(sstFlds, patchI, pTraits::zero); + SetPatchFields(ssymtFlds, patchI, pTraits::zero); + SetPatchFields(stFlds, patchI, pTraits::zero); + } + } + } + // Move mesh (since morphing might not do this) if (map().hasMotionPoints()) { diff --git a/applications/utilities/parallelProcessing/decomposePar/Make/options b/applications/utilities/parallelProcessing/decomposePar/Make/options index 3ae2128234..7a9f1df3f5 100644 --- a/applications/utilities/parallelProcessing/decomposePar/Make/options +++ b/applications/utilities/parallelProcessing/decomposePar/Make/options @@ -7,6 +7,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lgenericPatchFields \ - -ldecompositionMethods -lmetisDecomp -lscotchDecomp \ + -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \ -llagrangian \ -lmeshTools diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options index 505234515d..05d603887a 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options @@ -7,6 +7,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -ldecompositionMethods \ - -L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \ + -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -lmeshTools \ -ldynamicMesh 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/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 330b912fb9..f86bfa49de 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -91,44 +91,58 @@ void Foam::cyclicPolyPatch::calcTransforms() // Half0 const cyclicPolyPatch& half0 = *this; - - const pointField& half0Ctrs = half0.faceCentres(); - - if (debug) - { - fileName casePath(boundaryMesh().mesh().time().path()); - - fileName nm0(casePath/name()+"_faces.obj"); - Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name() - << " faces to OBJ file " << nm0 << endl; - writeOBJ(nm0, half0, half0.points()); - } - vectorField half0Areas(half0.size()); - forAll(half0, facei) { half0Areas[facei] = half0[facei].normal(half0.points()); } - - // Half1 - const cyclicPolyPatch& half1 = neighbPatch(); - - const pointField& half1Ctrs = half1.faceCentres(); - - // Dump halves - if (debug) + vectorField half1Areas(half1.size()); + forAll(half1, facei) { - fileName casePath(boundaryMesh().mesh().time().path()); + half1Areas[facei] = half1[facei].normal(half1.points()); + } + calcTransforms + ( + half0, + half0.faceCentres(), + half0Areas, + half1.faceCentres(), + half1Areas + ); + } +} + + +void Foam::cyclicPolyPatch::calcTransforms +( + const primitivePatch& half0, + const UList& half0Ctrs, + const UList& half0Areas, + const UList& half1Ctrs, + const UList& half1Areas +) +{ + if (debug && owner()) + { + fileName casePath(boundaryMesh().mesh().time().path()); + { + fileName nm0(casePath/name()+"_faces.obj"); + Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name() + << " faces to OBJ file " << nm0 << endl; + writeOBJ(nm0, half0, half0.points()); + } + const cyclicPolyPatch& half1 = neighbPatch(); + { fileName nm1(casePath/half1.name()+"_faces.obj"); Pout<< "cyclicPolyPatch::calcTransforms : Writing " << half1.name() << " faces to OBJ file " << nm1 << endl; writeOBJ(nm1, half1, half1.points()); - + } + { OFstream str(casePath/name()+"_to_" + half1.name() + ".obj"); label vertI = 0; Pout<< "cyclicPolyPatch::calcTransforms :" @@ -145,35 +159,10 @@ void Foam::cyclicPolyPatch::calcTransforms() str << "l " << vertI-1 << ' ' << vertI << nl; } } - - vectorField half1Areas(half1.size()); - - forAll(half1, facei) - { - half1Areas[facei] = half1[facei].normal(half1.points()); - } - - calcTransforms - ( - half0, - half0Ctrs, - half0Areas, - half1Ctrs, - half1Areas - ); } -} -void Foam::cyclicPolyPatch::calcTransforms -( - const primitivePatch& half0, - const UList& half0Ctrs, - const UList& half0Areas, - const UList& half1Ctrs, - const UList& half1Areas -) -{ + if (half0Ctrs.size() != half1Ctrs.size()) { FatalErrorIn 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/dynamicFvMesh/include/meshCourantNo.H b/src/dynamicFvMesh/include/meshCourantNo.H index 9ac0cb482f..501611db18 100644 --- a/src/dynamicFvMesh/include/meshCourantNo.H +++ b/src/dynamicFvMesh/include/meshCourantNo.H @@ -34,14 +34,13 @@ scalar meanMeshCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField SfUfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs()*mag(mesh.phi()); + scalarField sumPhi = + fvc::surfaceSum(mag(mesh.phi()))().internalField(); - meshCoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaTValue(); + meshCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); - meanMeshCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaTValue(); + meanMeshCoNum = + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Mesh Courant Number mean: " << meanMeshCoNum diff --git a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H index 73da862406..c96ddeb22f 100644 --- a/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H +++ b/src/finiteVolume/cfdTools/compressible/compressibleCourantNo.H @@ -38,10 +38,10 @@ if (mesh.nInternalFaces()) fvc::surfaceSum(mag(phi))().internalField() /rho.internalField(); - CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value(); + CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); meanCoNum = - 0.5*(gSum(sumPhi)/sum(mesh.V().field()))*runTime.deltaT().value(); + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Courant Number mean: " << meanCoNum diff --git a/src/finiteVolume/cfdTools/incompressible/CourantNo.H b/src/finiteVolume/cfdTools/incompressible/CourantNo.H index caef48a396..8b917e1f89 100644 --- a/src/finiteVolume/cfdTools/incompressible/CourantNo.H +++ b/src/finiteVolume/cfdTools/incompressible/CourantNo.H @@ -37,10 +37,10 @@ if (mesh.nInternalFaces()) scalarField sumPhi = fvc::surfaceSum(mag(phi))().internalField(); - CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaT().value(); + CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); meanCoNum = - 0.5*(gSum(sumPhi)/sum(mesh.V().field()))*runTime.deltaT().value(); + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Courant Number mean: " << meanCoNum diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C index 2be7d3be5a..4dd232091d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFixedValue/directMappedFixedValueFvPatchField.C @@ -260,7 +260,7 @@ void directMappedFixedValueFvPatchField::updateCoeffs() allValues ); - newValues = this->patch().patchSlice(allValues); + newValues.transfer(allValues); break; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C index 17fa6f71fb..36821fe72f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C @@ -198,7 +198,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() distMap.constructMap(), allUValues ); - newUValues = patch().patchSlice(allUValues); + newUValues.transfer(allUValues); mapDistribute::distribute ( @@ -209,7 +209,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs() distMap.constructMap(), allPhiValues ); - newPhiValues = patch().patchSlice(allPhiValues); + newPhiValues.transfer(allPhiValues); break; } 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/sampling/probes/probes.C b/src/sampling/probes/probes.C index 22c352825b..6ca13f1da2 100644 --- a/src/sampling/probes/probes.C +++ b/src/sampling/probes/probes.C @@ -163,7 +163,7 @@ Foam::label Foam::probes::prepare() if (debug) { - Info<< "open probe stream: " << sPtr->name() << endl; + Info<< "open probe stream: " << sPtr->name() << endl; } probeFilePtrs_.insert(fieldName, sPtr); diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C index 4a276547b1..4b923009ff 100644 --- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C +++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/datToFoam/datToFoam.C @@ -34,14 +34,7 @@ Description #include "Time.H" #include "IFstream.H" #include "OFstream.H" -#include "meshTools.H" -#include "polyMesh.H" -#include "wallPolyPatch.H" -#include "symmetryPolyPatch.H" -#include "preservePatchTypes.H" -#include "cellShape.H" -#include "cellModeller.H" -#include "mergePoints.H" +#include "pointField.H" #include "unitConversion.H" using namespace Foam; diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/uniform/lagrangian/dsmc/particleProperties b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/uniform/lagrangian/dsmc/particleProperties deleted file mode 100644 index 5a73d67b46..0000000000 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/uniform/lagrangian/dsmc/particleProperties +++ /dev/null @@ -1,24 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "0/uniform/lagrangian/dsmc"; - object particleProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -processor0 -{ - particleCount 63978; -} - - -// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/0/uniform/lagrangian/dsmc/particleProperties b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/0/uniform/lagrangian/dsmc/particleProperties deleted file mode 100644 index 5a73d67b46..0000000000 --- a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/0/uniform/lagrangian/dsmc/particleProperties +++ /dev/null @@ -1,24 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "0/uniform/lagrangian/dsmc"; - object particleProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -processor0 -{ - particleCount 63978; -} - - -// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/Allrun b/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/Allrun deleted file mode 100755 index 5cf2386bfa..0000000000 --- a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/Allrun +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# Get application name -application=`getApplication` - -runApplication blockMesh -runApplication changeDictionary -runApplication $application - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/constant/polyMesh/blockMeshDict index 37b146f399..d01e8f86f7 100644 --- a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/constant/polyMesh/blockMeshDict +++ b/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/constant/polyMesh/blockMeshDict @@ -85,69 +85,90 @@ edges ( ); -patches +boundary ( - patch inlet - ( - (0 22 23 1) - (1 23 24 2) - (2 24 25 3) - ) - patch outlet - ( - (16 17 39 38) - (17 18 40 39) - (18 19 41 40) - (19 20 42 41) - (20 21 43 42) - ) - wall upperWall - ( - (3 25 31 9) - (9 31 37 15) - (15 37 43 21) - ) - wall lowerWall - ( - (0 6 28 22) - (6 5 27 28) - (5 4 26 27) - (4 10 32 26) - (10 16 38 32) - ) - empty frontAndBack - ( - (22 28 29 23) - (23 29 30 24) - (24 30 31 25) - (26 32 33 27) - (27 33 34 28) - (28 34 35 29) - (29 35 36 30) - (30 36 37 31) - (32 38 39 33) - (33 39 40 34) - (34 40 41 35) - (35 41 42 36) - (36 42 43 37) - (0 1 7 6) - (1 2 8 7) - (2 3 9 8) - (4 5 11 10) - (5 6 12 11) - (6 7 13 12) - (7 8 14 13) - (8 9 15 14) - (10 11 17 16) - (11 12 18 17) - (12 13 19 18) - (13 14 20 19) - (14 15 21 20) - ) -); + inlet + { + type directMappedPatch; + offset ( 0.0495 0 0 ); + sampleRegion region0; + sampleMode nearestCell; + samplePatch none; -mergePatchPairs -( + faces + ( + (0 22 23 1) + (1 23 24 2) + (2 24 25 3) + ); + } + outlet + { + type patch; + faces + ( + (16 17 39 38) + (17 18 40 39) + (18 19 41 40) + (19 20 42 41) + (20 21 43 42) + ); + } + upperWall + { + type wall; + faces + ( + (3 25 31 9) + (9 31 37 15) + (15 37 43 21) + ); + } + lowerWall + { + type wall; + faces + ( + (0 6 28 22) + (6 5 27 28) + (5 4 26 27) + (4 10 32 26) + (10 16 38 32) + ); + } + frontAndBack + { + type empty; + faces + ( + (22 28 29 23) + (23 29 30 24) + (24 30 31 25) + (26 32 33 27) + (27 33 34 28) + (28 34 35 29) + (29 35 36 30) + (30 36 37 31) + (32 38 39 33) + (33 39 40 34) + (34 40 41 35) + (35 41 42 36) + (36 42 43 37) + (0 1 7 6) + (1 2 8 7) + (2 3 9 8) + (4 5 11 10) + (5 6 12 11) + (6 7 13 12) + (7 8 14 13) + (8 9 15 14) + (10 11 17 16) + (11 12 18 17) + (12 13 19 18) + (13 14 20 19) + (14 15 21 20) + ); + } ); // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/constant/polyMesh/boundary b/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/constant/polyMesh/boundary deleted file mode 100644 index e13323f287..0000000000 --- a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/constant/polyMesh/boundary +++ /dev/null @@ -1,63 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -5 -( -inlet -{ - type directMappedPatch; - nFaces 30; - startFace 27238; - sampleMode nearestCell; - sampleRegion region0; - samplePatch none; - offset ( 0.0495 0 0 ); -} - -outlet -{ - type patch; - nFaces 57; - startFace 27268; -} - -upperWall -{ - type wall; - nFaces 275; - startFace 27325; -} - -lowerWall -{ - type wall; - nFaces 302; - startFace 27600; -} - -frontAndBack -{ - type empty; - nFaces 27570; - startFace 27902; -} - -) - - -// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/system/changeDictionaryDict b/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/system/changeDictionaryDict deleted file mode 100644 index 46b60aa514..0000000000 --- a/tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/system/changeDictionaryDict +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object changeDictionaryDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dictionaryReplacement -{ - boundary - { - inlet - { - type directMappedPatch; - offset ( 0.0495 0 0 ); - sampleRegion region0; - sampleMode nearestCell; - samplePatch none; - } - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/Allclean b/tutorials/multiphase/cavitatingFoam/les/Allclean deleted file mode 100755 index 68db65d125..0000000000 --- a/tutorials/multiphase/cavitatingFoam/les/Allclean +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory - -# Source tutorial clean functions -. $WM_PROJECT_DIR/bin/tools/CleanFunctions - -( - cd throttle || exit - - rm -rf constant/polyMesh/sets > /dev/null 2>&1 - rm -rf 0/polyMesh > /dev/null 2>&1 - rm system/topoSetDict > /dev/null 2>&1 - - cleanCase -) - - -( - cd throttle3D || exit - - rm -rf constant/polyMesh/sets > /dev/null 2>&1 - rm -rf 0 > /dev/null 2>&1 - cp -r 0.org 0 - rm system/topoSetDict > /dev/null 2>&1 - rm -rf processor[0-9] > /dev/null 2>&1 - - cleanCase -) - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/cavitatingFoam/les/Allrun b/tutorials/multiphase/cavitatingFoam/les/Allrun index 9fe67390bd..41c1dd5368 100755 --- a/tutorials/multiphase/cavitatingFoam/les/Allrun +++ b/tutorials/multiphase/cavitatingFoam/les/Allrun @@ -1,50 +1,14 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# Set application name -application="cavitatingFoam" - -refineMeshByCellSet() -{ - while [ $# -ge 1 ] - do - echo "creating cell set for primary zone - $1" - cp system/topoSetDict.$1 system/topoSetDict - topoSet > log.topoSet.$1 2>&1 - - echo "refining primary zone - $1" - refineMesh -dict -overwrite > log.refineMesh.$1 2>&1 - shift - done -} - - ( cd throttle || exit - - runApplication blockMesh - refineMeshByCellSet 1 2 3 - runApplication $application + ./Allrun ) - ( cd throttle3D || exit - - cp -r 0.org 0 - - runApplication blockMesh - refineMeshByCellSet 1 2 3 - - echo "mapping fields from 2D throttle case" - mapFields ../throttle -sourceTime latestTime > log.mapFields 2>&1 - - runApplication decomposePar - runParallel $application 4 - runApplication reconstructPar + ./Allrun ) # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/Allclean b/tutorials/multiphase/cavitatingFoam/les/throttle/Allclean new file mode 100755 index 0000000000..70b255f01d --- /dev/null +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/Allclean @@ -0,0 +1,12 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +rm -rf constant/polyMesh/sets > /dev/null 2>&1 +rm -rf 0/polyMesh > /dev/null 2>&1 +rm system/topoSetDict > /dev/null 2>&1 +cleanCase + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/Allrun b/tutorials/multiphase/cavitatingFoam/les/throttle/Allrun new file mode 100755 index 0000000000..7b19d67145 --- /dev/null +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/Allrun @@ -0,0 +1,28 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Set application name +application="cavitatingFoam" + +refineMeshByCellSet() +{ + while [ $# -ge 1 ] + do + echo "creating cell set for primary zone - $1" + cp system/topoSetDict.$1 system/topoSetDict + topoSet > log.topoSet.$1 2>&1 + + echo "refining primary zone - $1" + refineMesh -dict -overwrite > log.refineMesh.$1 2>&1 + shift + done +} + +runApplication blockMesh +refineMeshByCellSet 1 2 3 +runApplication $application + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary b/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary index 999c16bc8e..4732ca525c 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary @@ -21,25 +21,25 @@ FoamFile { type patch; nFaces 51; - startFace 15151; + startFace 35380; } outlet { type patch; nFaces 51; - startFace 15202; + startFace 35431; } walls { type wall; - nFaces 436; - startFace 15253; + nFaces 640; + startFace 35482; } frontBack { type empty; - nFaces 15420; - startFace 15689; + nFaces 35580; + startFace 36122; } ) diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allclean b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allclean new file mode 100755 index 0000000000..b5c25b61f8 --- /dev/null +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allclean @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +rm -rf constant/polyMesh/sets > /dev/null 2>&1 +rm -rf 0 > /dev/null 2>&1 +cp -r 0.org 0 +rm system/topoSetDict > /dev/null 2>&1 +rm -rf processor[0-9] > /dev/null 2>&1 +cleanCase + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun new file mode 100755 index 0000000000..e93a056053 --- /dev/null +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun @@ -0,0 +1,36 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Set application name +application="cavitatingFoam" + +refineMeshByCellSet() +{ + while [ $# -ge 1 ] + do + echo "creating cell set for primary zone - $1" + cp system/topoSetDict.$1 system/topoSetDict + topoSet > log.topoSet.$1 2>&1 + + echo "refining primary zone - $1" + refineMesh -dict -overwrite > log.refineMesh.$1 2>&1 + shift + done +} + +cp -r 0.org 0 + +runApplication blockMesh +refineMeshByCellSet 1 2 3 + +echo "mapping fields from 2D throttle case" +mapFields ../throttle -sourceTime latestTime > log.mapFields 2>&1 + +runApplication decomposePar +runParallel $application 4 +runApplication reconstructPar + +# ----------------------------------------------------------------- end-of-file diff --git a/wmake/wmakeScheduler b/wmake/wmakeScheduler index be5f4ba58b..bfff68053a 100755 --- a/wmake/wmakeScheduler +++ b/wmake/wmakeScheduler @@ -184,14 +184,14 @@ do # Set colour colour="${colourList[$colourIndex]}" - if [ "$host" = "$HOST" ]; then + if [ "$host" = "$HOSTNAME" ]; then eval $* 2>&1 | colourPipe "$colour" else ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe "$colour" fi retval=$? else - if [ "$host" = "$HOST" ]; then + if [ "$host" = "$HOSTNAME" ]; then eval $* 2>&1 else ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1