diff --git a/applications/solvers/DNS/dnsFoam/Make/options b/applications/solvers/DNS/dnsFoam/Make/options index 34c3503a51..e0e7a30d72 100644 --- a/applications/solvers/DNS/dnsFoam/Make/options +++ b/applications/solvers/DNS/dnsFoam/Make/options @@ -1,10 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/randomProcesses/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/randomProcesses/lnInclude EXE_LIBS = \ -lfiniteVolume \ - -lrandomProcesses \ - -lsampling \ - -lmeshTools + -lrandomProcesses diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index 135659c276..b6c6398fde 100644 --- a/applications/solvers/combustion/PDRFoam/Make/options +++ b/applications/solvers/combustion/PDRFoam/Make/options @@ -5,7 +5,6 @@ EXE_INC = \ -IPDRModels/dragModels/PDRDragModel \ -IlaminarFlameSpeed/SCOPE \ -I$(LIB_SRC)/engine/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options index 0812df5e3b..3a07a7de58 100644 --- a/applications/solvers/combustion/XiFoam/Make/options +++ b/applications/solvers/combustion/XiFoam/Make/options @@ -5,7 +5,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ @@ -17,5 +17,5 @@ EXE_LIBS = \ -lreactionThermophysicalModels \ -lspecie \ -llaminarFlameSpeedModels \ - -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -lfiniteVolume diff --git a/applications/solvers/combustion/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options index 25217ab23f..2eaea744b0 100644 --- a/applications/solvers/combustion/coldEngineFoam/Make/options +++ b/applications/solvers/combustion/coldEngineFoam/Make/options @@ -20,6 +20,5 @@ EXE_LIBS = \ -lfluidThermophysicalModels \ -lspecie \ -lfiniteVolume \ - -lsampling \ -lmeshTools \ -lfieldSources diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 9f97843a96..021ed3c6f0 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -30,7 +30,6 @@ Description \*---------------------------------------------------------------------------*/ -#include "mapDistribute.H" #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingCloud.H" diff --git a/applications/solvers/incompressible/icoFoam/Make/options b/applications/solvers/incompressible/icoFoam/Make/options index fa15f12452..d38cd8b180 100644 --- a/applications/solvers/incompressible/icoFoam/Make/options +++ b/applications/solvers/incompressible/icoFoam/Make/options @@ -1,5 +1,7 @@ EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lsampling diff --git a/applications/solvers/multiphase/bubbleFoam/DDtU.H b/applications/solvers/multiphase/bubbleFoam/DDtU.H deleted file mode 100644 index 96b6a63a43..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/DDtU.H +++ /dev/null @@ -1,11 +0,0 @@ -{ - DDtU1 = - fvc::ddt(U1) - + fvc::div(phi1, U1) - - fvc::div(phi1)*U1; - - DDtU2 = - fvc::ddt(U2) - + fvc::div(phi2, U2) - - fvc::div(phi2)*U2; -} diff --git a/applications/solvers/multiphase/bubbleFoam/Make/files b/applications/solvers/multiphase/bubbleFoam/Make/files deleted file mode 100644 index 1bc79aa226..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -bubbleFoam.C - -EXE = $(FOAM_APPBIN)/bubbleFoam diff --git a/applications/solvers/multiphase/bubbleFoam/Make/options b/applications/solvers/multiphase/bubbleFoam/Make/options deleted file mode 100644 index 39da2bd6db..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/Make/options +++ /dev/null @@ -1,6 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = \ - -lfiniteVolume \ - -lmeshTools diff --git a/applications/solvers/multiphase/bubbleFoam/UEqns.H b/applications/solvers/multiphase/bubbleFoam/UEqns.H deleted file mode 100644 index 703f6b6d8d..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/UEqns.H +++ /dev/null @@ -1,74 +0,0 @@ -fvVectorMatrix U1Eqn(U1, U1.dimensions()*dimVol/dimTime); -fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); - -{ - volTensorField Rc1(-nuEff1*(T(fvc::grad(U1)))); - Rc1 = Rc1 + (2.0/3.0)*sqr(Ct)*I*k - (2.0/3.0)*I*tr(Rc1); - - surfaceScalarField phiR1 - ( - - fvc::interpolate(nuEff1) - *mesh.magSf()*fvc::snGrad(alpha1) - /fvc::interpolate(alpha1 + scalar(0.001)) - ); - - U1Eqn = - ( - (scalar(1) + Cvm*rho2*alpha2/rho1)* - ( - fvm::ddt(U1) - + fvm::div(phi1, U1, "div(phi1,U1)") - - fvm::Sp(fvc::div(phi1), U1) - ) - - - fvm::laplacian(nuEff1, U1) - + fvc::div(Rc1) - - + fvm::div(phiR1, U1, "div(phi1,U1)") - - fvm::Sp(fvc::div(phiR1), U1) - + (fvc::grad(alpha1)/(fvc::average(alpha1) + scalar(0.001)) & Rc1) - == - // g // Buoyancy term transfered to p-equation - - fvm::Sp(alpha2/rho1*dragCoef, U1) - //+ alpha2/rho1*dragCoef*U2 // Explicit drag transfered to p-equation - - alpha2/rho1*(liftCoeff - Cvm*rho2*DDtU2) - ); - - U1Eqn.relax(); - - - volTensorField Rc2(-nuEff2*T(fvc::grad(U2))); - Rc2 = Rc2 + (2.0/3.0)*I*k - (2.0/3.0)*I*tr(Rc2); - - surfaceScalarField phiR2 - ( - - fvc::interpolate(nuEff2) - *mesh.magSf()*fvc::snGrad(alpha2) - /fvc::interpolate(alpha2 + scalar(0.001)) - ); - - U2Eqn = - ( - (scalar(1) + Cvm*rho2*alpha1/rho2)* - ( - fvm::ddt(U2) - + fvm::div(phi2, U2, "div(phi2,U2)") - - fvm::Sp(fvc::div(phi2), U2) - ) - - - fvm::laplacian(nuEff2, U2) - + fvc::div(Rc2) - - + fvm::div(phiR2, U2, "div(phi2,U2)") - - fvm::Sp(fvc::div(phiR2), U2) - - + (fvc::grad(alpha2)/(fvc::average(alpha2) + scalar(0.001)) & Rc2) - == - // g // Buoyancy term transfered to p-equation - - fvm::Sp(alpha1/rho2*dragCoef, U2) - //+ alpha1/rho2*dragCoef*U1 // Explicit drag transfered to p-equation - + alpha1/rho2*(liftCoeff + Cvm*rho2*DDtU1) - ); - - U2Eqn.relax(); -} diff --git a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H b/applications/solvers/multiphase/bubbleFoam/alphaEqn.H deleted file mode 100644 index 0ecab03016..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H +++ /dev/null @@ -1,61 +0,0 @@ -{ - word scheme("div(phi,alpha1)"); - - surfaceScalarField phir(phi1 - phi2); - - Info<< "Max Ur Courant Number = " - << ( - max - ( - mesh.surfaceInterpolation::deltaCoeffs()*mag(phir) - /mesh.magSf() - )*runTime.deltaT() - ).value() - << endl; - - for (int acorr=0; acorr phi1Ptr(NULL); - - if (phi1Header.headerOk()) - { - Info<< "Reading face flux field phi1\n" << endl; - - phi1Ptr.reset - ( - new surfaceScalarField - ( - IOobject - ( - "phi1", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ) - ); - } - else - { - Info<< "Calculating face flux field phi1\n" << endl; - - wordList phiTypes - ( - U1.boundaryField().size(), - calculatedFvPatchScalarField::typeName - ); - - forAll(U1.boundaryField(), i) - { - if (isA(U1.boundaryField()[i])) - { - phiTypes[i] = fixedValueFvPatchScalarField::typeName; - } - } - - phi1Ptr.reset - ( - new surfaceScalarField - ( - IOobject - ( - "phi1", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - fvc::interpolate(U1) & mesh.Sf(), - phiTypes - ) - ); - } - - surfaceScalarField& phi1 = phi1Ptr(); diff --git a/applications/solvers/multiphase/bubbleFoam/createPhi2.H b/applications/solvers/multiphase/bubbleFoam/createPhi2.H deleted file mode 100644 index ebba6a3f6c..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/createPhi2.H +++ /dev/null @@ -1,67 +0,0 @@ - IOobject phi2Header - ( - "phi2", - runTime.timeName(), - mesh, - IOobject::NO_READ - ); - - autoPtr phi2Ptr(NULL); - - if (phi2Header.headerOk()) - { - Info<< "Reading face flux field phi2\n" << endl; - - phi2Ptr.reset - ( - new surfaceScalarField - ( - IOobject - ( - "phi2", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ) - ); - } - else - { - Info<< "Calculating face flux field phi2\n" << endl; - - wordList phiTypes - ( - U2.boundaryField().size(), - calculatedFvPatchScalarField::typeName - ); - - forAll(U2.boundaryField(), i) - { - if (isA(U2.boundaryField()[i])) - { - phiTypes[i] = fixedValueFvPatchScalarField::typeName; - } - } - - phi2Ptr.reset - ( - new surfaceScalarField - ( - IOobject - ( - "phi2", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - fvc::interpolate(U2) & mesh.Sf(), - phiTypes - ) - ); - } - - surfaceScalarField& phi2 = phi2Ptr(); diff --git a/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H b/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H deleted file mode 100644 index d2ebb75a2f..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H +++ /dev/null @@ -1,23 +0,0 @@ - volVectorField Ur(U1 - U2); - volScalarField magUr(mag(Ur)); - - volScalarField Cd1MagUr - ( - (24.0*nu2/d1)*(scalar(1) + 0.15*pow(d1*magUr/nu2, 0.687)) - ); - - volScalarField Cd2MagUr - ( - (24.0*nu1/d2)*(scalar(1) + 0.15*pow(d2*magUr/nu1, 0.687)) - ); - - volScalarField dragCoef - ( - "Cd", - 0.75*(alpha2*rho2*Cd1MagUr/d1 + alpha1*rho1*Cd2MagUr/d2) - ); - - volVectorField liftCoeff - ( - Cl*(alpha2*rho2 + alpha1*rho1)*(Ur ^ fvc::curl(U)) - ); diff --git a/applications/solvers/multiphase/bubbleFoam/pEqn.H b/applications/solvers/multiphase/bubbleFoam/pEqn.H deleted file mode 100644 index d438b1124f..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/pEqn.H +++ /dev/null @@ -1,94 +0,0 @@ -{ - surfaceScalarField alpha1f(fvc::interpolate(alpha1)); - surfaceScalarField alpha2f(scalar(1) - alpha1f); - - volScalarField rAU1(1.0/U1Eqn.A()); - volScalarField rAU2(1.0/U2Eqn.A()); - - surfaceScalarField rAU1f(fvc::interpolate(rAU1)); - surfaceScalarField rAU2f(fvc::interpolate(rAU2)); - - volVectorField HbyA1("HbyA1", U1); - HbyA1 = rAU1*U1Eqn.H(); - - volVectorField HbyA2("HbyA2", U2); - HbyA2 = rAU2*U2Eqn.H(); - - surfaceScalarField phiDrag1 - ( - fvc::interpolate(alpha2/rho1*dragCoef*rAU1)*phi2 - + rAU1f*(g & mesh.Sf()) - ); - surfaceScalarField phiDrag2 - ( - fvc::interpolate(alpha1/rho2*dragCoef*rAU2)*phi1 - + rAU2f*(g & mesh.Sf()) - ); - - forAll(p.boundaryField(), patchi) - { - if (isA(p.boundaryField()[patchi])) - { - phiDrag1.boundaryField()[patchi] = 0.0; - phiDrag2.boundaryField()[patchi] = 0.0; - } - } - - surfaceScalarField phiHbyA1 - ( - (fvc::interpolate(HbyA1) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU1, U1, phi1) - ); - - surfaceScalarField phiHbyA2 - ( - (fvc::interpolate(HbyA2) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU2, U2, phi2) - ); - - phi = alpha1f*phiHbyA1 + alpha2f*phiHbyA2; - - phiHbyA1 += phiDrag1; - phiHbyA2 += phiDrag2; - surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2); - - surfaceScalarField Dp - ( - "Dp", - alpha1f*rAU1f/rho1 + alpha2f*rAU2f/rho2 - ); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::laplacian(Dp, p) == fvc::div(phiHbyA) - ); - - pEqn.setReference(pRefCell, pRefValue); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - surfaceScalarField SfGradp(pEqn.flux()/Dp); - - phi1 = phiHbyA1 - rAU1f*SfGradp/rho1; - phi2 = phiHbyA2 - rAU2f*SfGradp/rho2; - phi = alpha1f*phi1 + alpha2f*phi2; - - p.relax(); - SfGradp = pEqn.flux()/Dp; - - U1 = HbyA1 + (fvc::reconstruct(phiDrag1 - rAU1f*SfGradp/rho1)); - U1.correctBoundaryConditions(); - - U2 = HbyA2 + (fvc::reconstruct(phiDrag2 - rAU2f*SfGradp/rho2)); - U2.correctBoundaryConditions(); - - U = alpha1*U1 + alpha2*U2; - } - } -} - -#include "continuityErrs.H" diff --git a/applications/solvers/multiphase/bubbleFoam/readBubbleFoamControls.H b/applications/solvers/multiphase/bubbleFoam/readBubbleFoamControls.H deleted file mode 100644 index 248f608f5c..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/readBubbleFoamControls.H +++ /dev/null @@ -1,4 +0,0 @@ - - int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr"))); - - Switch correctAlpha(pimple.dict().lookup("correctAlpha")); diff --git a/applications/solvers/multiphase/bubbleFoam/write.H b/applications/solvers/multiphase/bubbleFoam/write.H deleted file mode 100644 index 303661beb6..0000000000 --- a/applications/solvers/multiphase/bubbleFoam/write.H +++ /dev/null @@ -1,17 +0,0 @@ - if (runTime.outputTime()) - { - volVectorField Ur - ( - IOobject - ( - "Ur", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - U1 - U2 - ); - - runTime.write(); - } diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index 8d161edd82..9a9fdee2df 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -12,12 +12,12 @@ mesh ); - Info<< "Reading field alpha\n" << endl; - volScalarField alpha + Info<< "Reading field Alpha\n" << endl; + volScalarField Alpha ( IOobject ( - "alpha", + "Alpha", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -100,21 +100,20 @@ IOobject::NO_READ, IOobject::NO_WRITE ), - (scalar(1) - alpha)*rhoc + alpha*rhod + rhoc/(scalar(1) + (rhoc/rhod - 1.0)*Alpha) ); - volScalarField Alpha + volScalarField alpha ( IOobject ( - "Alpha", + "alpha", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), - alpha*rhod/rho, - alpha.boundaryField().types() + rho*Alpha/rhod ); #include "compressibleCreatePhi.H" diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options index 1bf97d106c..f4a6229714 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options @@ -1,5 +1,4 @@ EXE_INC = \ - -I../bubbleFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -IturbulenceModel \ diff --git a/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createRASTurbulence.H similarity index 100% rename from applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H rename to applications/solvers/multiphase/twoPhaseEulerFoam/createRASTurbulence.H diff --git a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H similarity index 100% rename from applications/solvers/multiphase/bubbleFoam/kEpsilon.H rename to applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H diff --git a/applications/solvers/multiphase/bubbleFoam/wallDissipation.H b/applications/solvers/multiphase/twoPhaseEulerFoam/wallDissipation.H similarity index 95% rename from applications/solvers/multiphase/bubbleFoam/wallDissipation.H rename to applications/solvers/multiphase/twoPhaseEulerFoam/wallDissipation.H index 14224fd646..207fb40a32 100644 --- a/applications/solvers/multiphase/bubbleFoam/wallDissipation.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/wallDissipation.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H b/applications/solvers/multiphase/twoPhaseEulerFoam/wallFunctions.H similarity index 100% rename from applications/solvers/multiphase/bubbleFoam/wallFunctions.H rename to applications/solvers/multiphase/twoPhaseEulerFoam/wallFunctions.H diff --git a/applications/solvers/multiphase/bubbleFoam/wallViscosity.H b/applications/solvers/multiphase/twoPhaseEulerFoam/wallViscosity.H similarity index 100% rename from applications/solvers/multiphase/bubbleFoam/wallViscosity.H rename to applications/solvers/multiphase/twoPhaseEulerFoam/wallViscosity.H diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/Make/options b/applications/utilities/mesh/advanced/combinePatchFaces/Make/options index 7d4e1304f0..4f26f666de 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/Make/options +++ b/applications/utilities/mesh/advanced/combinePatchFaces/Make/options @@ -5,4 +5,5 @@ EXE_INC = \ EXE_LIBS = \ -lmeshTools \ + -lsampling \ -ldynamicMesh diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index 877579fa5f..8c8be624f0 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,105 +53,19 @@ Description #include "polyMesh.H" #include "mapPolyMesh.H" #include "unitConversion.H" +#include "motionSmoother.H" using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Same check as snapMesh -void checkSnapMesh -( - const Time& runTime, - const polyMesh& mesh, - labelHashSet& wrongFaces -) -{ - IOdictionary snapDict - ( - IOobject - ( - "snapMeshDict", - runTime.system(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - // Max nonorthogonality allowed - scalar maxNonOrtho(readScalar(snapDict.lookup("maxNonOrtho"))); - // Max concaveness allowed. - scalar maxConcave(readScalar(snapDict.lookup("maxConcave"))); - // Min volume allowed (factor of minimum cellVolume) - scalar relMinVol(readScalar(snapDict.lookup("minVol"))); - const scalar minCellVol = min(mesh.cellVolumes()); - const scalar minPyrVol = relMinVol*minCellVol; - // Min area - scalar minArea(readScalar(snapDict.lookup("minArea"))); - - if (maxNonOrtho < 180.0-SMALL) - { - Pout<< "Checking non orthogonality" << endl; - - label nOldSize = wrongFaces.size(); - mesh.setNonOrthThreshold(maxNonOrtho); - mesh.checkFaceOrthogonality(false, &wrongFaces); - - Pout<< "Detected " << wrongFaces.size() - nOldSize - << " faces with non-orthogonality > " << maxNonOrtho << " degrees" - << endl; - } - - if (minPyrVol > -GREAT) - { - Pout<< "Checking face pyramids" << endl; - - label nOldSize = wrongFaces.size(); - mesh.checkFacePyramids(false, minPyrVol, &wrongFaces); - Pout<< "Detected additional " << wrongFaces.size() - nOldSize - << " faces with illegal face pyramids" << endl; - } - - if (maxConcave < 180.0-SMALL) - { - Pout<< "Checking face angles" << endl; - - label nOldSize = wrongFaces.size(); - mesh.checkFaceAngles(false, maxConcave, &wrongFaces); - Pout<< "Detected additional " << wrongFaces.size() - nOldSize - << " faces with concavity > " << maxConcave << " degrees" - << endl; - } - - if (minArea > -SMALL) - { - Pout<< "Checking face areas" << endl; - - label nOldSize = wrongFaces.size(); - - const scalarField magFaceAreas(mag(mesh.faceAreas())); - - forAll(magFaceAreas, faceI) - { - if (magFaceAreas[faceI] < minArea) - { - wrongFaces.insert(faceI); - } - } - Pout<< "Detected additional " << wrongFaces.size() - nOldSize - << " faces with area < " << minArea << " m^2" << endl; - } -} - - // Merge faces on the same patch (usually from exposing refinement) // Can undo merges if these cause problems. label mergePatchFaces ( const scalar minCos, const scalar concaveSin, - const bool snapMeshDict, + const autoPtr& qualDictPtr, const Time& runTime, polyMesh& mesh ) @@ -212,9 +126,9 @@ label mergePatchFaces // Faces in error. labelHashSet errorFaces; - if (snapMeshDict) + if (qualDictPtr.valid()) { - checkSnapMesh(runTime, mesh, errorFaces); + motionSmoother::checkMesh(false, mesh, qualDictPtr(), errorFaces); } else { @@ -437,8 +351,8 @@ int main(int argc, char *argv[]) ); argList::addBoolOption ( - "snapMesh", - "use system/snapMeshDict" + "meshQuality", + "read user-defined mesh quality criterions from system/meshQualityDict" ); # include "setRootCase.H" @@ -455,8 +369,8 @@ int main(int argc, char *argv[]) scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0); scalar concaveSin = Foam::sin(degToRad(concaveAngle)); - const bool snapMeshDict = args.optionFound("snapMesh"); const bool overwrite = args.optionFound("overwrite"); + const bool meshQuality = args.optionFound("meshQuality"); Info<< "Merging all faces of a cell" << nl << " - which are on the same patch" << nl @@ -468,23 +382,47 @@ int main(int argc, char *argv[]) << " (sin:" << concaveSin << ')' << nl << endl; + autoPtr qualDict; + if (meshQuality) + { + Info<< "Enabling user-defined geometry checks." << nl << endl; + + qualDict.reset + ( + new IOdictionary + ( + IOobject + ( + "meshQualityDict", + mesh.time().system(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ); + } + + if (!overwrite) { runTime++; } + + // Merge faces on same patch label nChanged = mergePatchFaces ( minCos, concaveSin, - snapMeshDict, + qualDict, runTime, mesh ); // Merge points on straight edges and remove unused points - if (snapMeshDict) + if (qualDict.valid()) { Info<< "Merging all 'loose' points on surface edges, " << "regardless of the angle they make." << endl; diff --git a/applications/utilities/mesh/generation/cvMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/Make/options index 2255a9a271..27241b2965 100644 --- a/applications/utilities/mesh/generation/cvMesh/Make/options +++ b/applications/utilities/mesh/generation/cvMesh/Make/options @@ -17,6 +17,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude @@ -29,5 +30,6 @@ EXE_LIBS = \ -ldecompositionMethods \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -ledgeMesh \ + -lfileFormats \ -ltriSurface \ -ldynamicMesh diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options index 97e045f305..2082f88ff0 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/Make/options @@ -17,6 +17,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I../vectorTools @@ -24,5 +25,6 @@ EXE_INC = \ EXE_LIBS = \ -lmeshTools \ -ledgeMesh \ + -lfileFormats \ -ltriSurface \ -ldynamicMesh diff --git a/applications/utilities/mesh/generation/cvMesh/cvMesh.C b/applications/utilities/mesh/generation/cvMesh/cvMesh.C index ecd7f102ba..f15ebea29a 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMesh.C +++ b/applications/utilities/mesh/generation/cvMesh/cvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,7 @@ Description #include "argList.H" #include "conformalVoronoiMesh.H" +#include "vtkSetWriter.H" using namespace Foam; @@ -48,6 +49,11 @@ int main(int argc, char *argv[]) "noFilter", "Do not filter the mesh" ); + Foam::argList::addBoolOption + ( + "checkGeometry", + "check all surface geometry for quality" + ); #include "setRootCase.H" #include "createTime.H" @@ -55,6 +61,7 @@ int main(int argc, char *argv[]) runTime.functionObjects().off(); const bool noFilter = !args.optionFound("noFilter"); + const bool checkGeometry = args.optionFound("checkGeometry"); Info<< "Mesh filtering is " << (noFilter ? "on" : "off") << endl; @@ -74,6 +81,29 @@ int main(int argc, char *argv[]) conformalVoronoiMesh mesh(runTime, cvMeshDict); + + if (checkGeometry) + { + const searchableSurfaces& allGeometry = mesh.allGeometry(); + + // Write some stats + allGeometry.writeStats(List(0), Info); + // Check topology + allGeometry.checkTopology(true); + // Check geometry + allGeometry.checkGeometry + ( + 100.0, // max size ratio + 1e-9, // intersection tolerance + autoPtr >(new vtkSetWriter()), + 0.01, // min triangle quality + true + ); + + return 0; + } + + while (runTime.loop()) { Info<< nl << "Time = " << runTime.timeName() << endl; diff --git a/applications/utilities/mesh/generation/cvMesh/cvMeshBackgroundMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/cvMeshBackgroundMesh/Make/options index 2d1ad7bfda..ed71a80029 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMeshBackgroundMesh/Make/options +++ b/applications/utilities/mesh/generation/cvMesh/cvMeshBackgroundMesh/Make/options @@ -11,10 +11,11 @@ EXE_INC = \ -I../conformalVoronoiMesh/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ @@ -24,8 +25,9 @@ EXE_LIBS = \ -lconformalVoronoiMesh \ -ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \ -ledgeMesh \ - -lsampling \ -ltriSurface \ -lmeshTools \ + -lfileFormats \ + -lsampling \ -ldynamicMesh \ -lfiniteVolume diff --git a/applications/utilities/mesh/generation/cvMesh/cvMeshSurfaceSimplify/Make/options b/applications/utilities/mesh/generation/cvMesh/cvMeshSurfaceSimplify/Make/options index c7c073ab17..7bd92a24ab 100644 --- a/applications/utilities/mesh/generation/cvMesh/cvMeshSurfaceSimplify/Make/options +++ b/applications/utilities/mesh/generation/cvMesh/cvMeshSurfaceSimplify/Make/options @@ -9,6 +9,7 @@ EXE_INC = \ -I$(FASTDUALOCTREE_SRC_PATH) \ -I../conformalVoronoiMesh/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude @@ -21,6 +22,7 @@ EXE_LIBS = \ -lconformalVoronoiMesh \ -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lscotchDecomp \ -ledgeMesh \ + -lfileFormats \ -ltriSurface \ -lmeshTools \ -ldynamicMesh diff --git a/applications/utilities/mesh/generation/snappyHexMesh/Make/options b/applications/utilities/mesh/generation/snappyHexMesh/Make/options index b7fd6d3bd2..af056ec7cb 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/Make/options +++ b/applications/utilities/mesh/generation/snappyHexMesh/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/mesh/autoMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ @@ -13,5 +14,6 @@ EXE_LIBS = \ -ldecompositionMethods \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ -lmeshTools \ + -lfileFormats \ -ldynamicMesh \ -lautoMesh diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 2372b144ec..6b63430918 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -46,7 +46,7 @@ Description #include "refinementParameters.H" #include "snapParameters.H" #include "layerParameters.H" - +#include "vtkSetWriter.H" using namespace Foam; @@ -122,6 +122,12 @@ void writeMesh int main(int argc, char *argv[]) { # include "addOverwriteOption.H" + Foam::argList::addBoolOption + ( + "checkGeometry", + "check all surface geometry for quality" + ); + # include "setRootCase.H" # include "createTime.H" runTime.functionObjects().off(); @@ -131,6 +137,7 @@ int main(int argc, char *argv[]) << runTime.cpuTimeIncrement() << " s" << endl; const bool overwrite = args.optionFound("overwrite"); + const bool checkGeometry = args.optionFound("checkGeometry"); // Check patches and faceZones are synchronised mesh.boundaryMesh().checkParallelSync(true); @@ -244,6 +251,56 @@ int main(int argc, char *argv[]) << mesh.time().cpuTimeIncrement() << " s" << nl << endl; + // Checking only? + + if (checkGeometry) + { + // Extract patchInfo + List patchTypes(allGeometry.size()); + + const PtrList& patchInfo = surfaces.patchInfo(); + const labelList& surfaceGeometry = surfaces.surfaces(); + forAll(surfaceGeometry, surfI) + { + label geomI = surfaceGeometry[surfI]; + const wordList& regNames = allGeometry.regionNames()[geomI]; + + patchTypes[geomI].setSize(regNames.size()); + forAll(regNames, regionI) + { + label globalRegionI = surfaces.globalRegion(surfI, regionI); + + if (patchInfo.set(globalRegionI)) + { + patchTypes[geomI][regionI] = + word(patchInfo[globalRegionI].lookup("type")); + } + else + { + patchTypes[geomI][regionI] = wallPolyPatch::typeName; + } + } + } + + // Write some stats + allGeometry.writeStats(patchTypes, Info); + // Check topology + allGeometry.checkTopology(true); + // Check geometry + allGeometry.checkGeometry + ( + 100.0, // max size ratio + 1e-9, // intersection tolerance + autoPtr >(new vtkSetWriter()), + 0.01, // min triangle quality + true + ); + + return 0; + } + + + // Read refinement shells // ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/applications/utilities/mesh/manipulation/setsToZones/Make/options b/applications/utilities/mesh/manipulation/setsToZones/Make/options index 54c035b8f5..ec38e1cbdb 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/Make/options +++ b/applications/utilities/mesh/manipulation/setsToZones/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ - -lmeshTools + -lmeshTools \ + -lsampling diff --git a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C index 2f56bb5693..c3d3d6297a 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C +++ b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,6 +48,7 @@ Description #include "IFstream.H" #include "IOobjectList.H" #include "SortableList.H" +#include "timeSelector.H" using namespace Foam; @@ -57,6 +58,7 @@ using namespace Foam; int main(int argc, char *argv[]) { + timeSelector::addOptions(true, false); argList::addNote ( "add point/face/cell Zones from similar named point/face/cell Sets" @@ -76,15 +78,7 @@ int main(int argc, char *argv[]) const bool noFlipMap = args.optionFound("noFlipMap"); // Get times list - instantList Times = runTime.times(); - - label startTime = Times.size()-1; - label endTime = Times.size(); - - // check -time and -latestTime options - #include "checkTimeOption.H" - - runTime.setTime(Times[startTime], startTime); + (void)timeSelector::selectIfPresent(runTime, args); #include "createNamedPolyMesh.H" diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options b/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options index 5c515d8f95..87b4324810 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options @@ -1,15 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ - -I$(LIB_SRC)/lagrangian/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/browser/lnInclude \ - -I$(LIB_SRC)/foam/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude EXE_LIBS = \ diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H index 397dc7ecc2..363f09d7f3 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H @@ -446,13 +446,6 @@ class vtkPV3Foam template vtkPolyData* patchVTKMesh(const word& name, const PatchType&); - //- Add face zone mesh - vtkPolyData* faceZoneVTKMesh - ( - const fvMesh&, - const labelList& faceLabels - ); - //- Add point zone vtkPolyData* pointZoneVTKMesh ( diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C index b229da9479..b80acb4949 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C @@ -450,7 +450,8 @@ void Foam::vtkPV3Foam::convertMeshFaceZones << zoneName << endl; } - vtkPolyData* vtkmesh = faceZoneVTKMesh(mesh, zMesh[zoneId]); + vtkPolyData* vtkmesh = patchVTKMesh(zoneName, zMesh[zoneId]()); + if (vtkmesh) { AddToBlock(output, vtkmesh, range, datasetNo, zoneName); diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C index 28a1fd4c5f..bfa3e1acc9 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,78 +35,6 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -vtkPolyData* Foam::vtkPV3Foam::faceZoneVTKMesh -( - const fvMesh& mesh, - const labelList& faceLabels -) -{ - vtkPolyData* vtkmesh = vtkPolyData::New(); - - if (debug) - { - Info<< " Foam::vtkPV3Foam::faceZoneVTKMesh" << endl; - printMemory(); - } - - // Construct primitivePatch of faces in faceZone - - const faceList& meshFaces = mesh.faces(); - faceList patchFaces(faceLabels.size()); - forAll(faceLabels, faceI) - { - patchFaces[faceI] = meshFaces[faceLabels[faceI]]; - } - primitiveFacePatch p(patchFaces, mesh.points()); - - - // The balance of this routine should be identical to patchVTKMesh - - // Convert OpenFOAM mesh vertices to VTK - const pointField& points = p.localPoints(); - - vtkPoints* vtkpoints = vtkPoints::New(); - vtkpoints->Allocate(points.size()); - forAll(points, i) - { - vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]); - } - - vtkmesh->SetPoints(vtkpoints); - vtkpoints->Delete(); - - - // Add faces as polygons - const faceList& faces = p.localFaces(); - - vtkCellArray* vtkcells = vtkCellArray::New(); - vtkcells->Allocate(faces.size()); - - forAll(faces, faceI) - { - const face& f = faces[faceI]; - vtkIdType nodeIds[f.size()]; - - forAll(f, fp) - { - nodeIds[fp] = f[fp]; - } - vtkcells->InsertNextCell(f.size(), nodeIds); - } - - vtkmesh->SetPolys(vtkcells); - vtkcells->Delete(); - - if (debug) - { - Info<< " Foam::vtkPV3Foam::faceZoneVTKMesh" << endl; - printMemory(); - } - - return vtkmesh; -} - - vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh ( const fvMesh& mesh, diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H index 78582fe7e3..e74937cd2f 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,6 +129,42 @@ void Foam::vtkPV3Foam::convertPointFields datasetNo ); } + + // + // Convert faceZones - if activated + // + for + ( + int partId = arrayRangeFaceZones_.start(); + partId < arrayRangeFaceZones_.end(); + ++partId + ) + { + const word zoneName = getPartName(partId); + const label datasetNo = partDataset_[partId]; + const label zoneId = mesh.faceZones().findZoneID(zoneName); + + if (!partStatus_[partId] || datasetNo < 0 || zoneId < 0) + { + continue; + } + + // Extract the field on the zone + Field fld + ( + ptf.internalField(), + mesh.faceZones()[zoneId]().meshPoints() + ); + + convertPatchPointField + ( + fieldName, + fld, + output, + arrayRangeFaceZones_, + datasetNo + ); + } } } diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options index 3bcea78b3b..b653926f93 100644 --- a/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options @@ -1,12 +1,12 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ - -lsampling \ + -lfileFormats \ -lgenericPatchFields \ -llagrangian diff --git a/applications/utilities/postProcessing/sampling/sample/Make/options b/applications/utilities/postProcessing/sampling/sample/Make/options index 88c6039b4e..4de726a20f 100644 --- a/applications/utilities/postProcessing/sampling/sample/Make/options +++ b/applications/utilities/postProcessing/sampling/sample/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude @@ -9,6 +10,7 @@ EXE_LIBS = \ -lfiniteVolume \ -lgenericPatchFields \ -lmeshTools \ + -lfileFormats \ -lsampling \ -lsurfMesh \ -llagrangian diff --git a/applications/utilities/postProcessing/velocityField/Pe/Make/options b/applications/utilities/postProcessing/velocityField/Pe/Make/options index 29d9b4d8c3..1d984aa9b5 100644 --- a/applications/utilities/postProcessing/velocityField/Pe/Make/options +++ b/applications/utilities/postProcessing/velocityField/Pe/Make/options @@ -5,8 +5,7 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ $(FOAM_LIBBIN)/postCalc.o \ diff --git a/applications/utilities/preProcessing/boxTurb/Make/options b/applications/utilities/preProcessing/boxTurb/Make/options index 749a3d5124..e24cee9cb9 100644 --- a/applications/utilities/preProcessing/boxTurb/Make/options +++ b/applications/utilities/preProcessing/boxTurb/Make/options @@ -1,10 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/randomProcesses/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -lrandomProcesses \ - -lsampling \ - -lmeshTools \ -lfiniteVolume diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions index 758627a29a..8a6301a545 100644 --- a/bin/tools/CleanFunctions +++ b/bin/tools/CleanFunctions @@ -101,7 +101,7 @@ cleanCase() rm -rf constant/tetDualMesh > /dev/null 2>&1 rm -rf VTK > /dev/null 2>&1 - rm -f 0/cellLevel 0/pointLevel + rm -f 0/cellLevel 0/pointLevel 0/cellDist constant/cellDecomposition if [ -e constant/polyMesh/blockMeshDict.m4 ] then diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 2fb7c7dfe2..d1061458e8 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -526,7 +526,7 @@ $(Fields)/symmTensorField/symmTensorField.C $(Fields)/tensorField/tensorField.C $(Fields)/complexFields/complexFields.C -$(Fields)/labelField/labelIOField. +$(Fields)/labelField/labelIOField.C $(Fields)/labelField/labelFieldIOField.C $(Fields)/scalarField/scalarIOField.C $(Fields)/scalarField/scalarFieldIOField.C diff --git a/src/OpenFOAM/algorithms/subCycle/subCycle.H b/src/OpenFOAM/algorithms/subCycle/subCycle.H index a4a1ea1844..f0c8958dd0 100644 --- a/src/OpenFOAM/algorithms/subCycle/subCycle.H +++ b/src/OpenFOAM/algorithms/subCycle/subCycle.H @@ -51,8 +51,13 @@ class subCycleField //- Reference to the field being sub-cycled GeometricField& gf_; + //- Reference to the field old-time field being sub-cycled + // Needed to avoid calls to oldTime() which may cause + // unexpected updates of the old-time field + GeometricField& gf0_; + //- Copy of the "real" old-time value of the field - GeometricField gf0_; + GeometricField gf_0_; public: @@ -63,19 +68,33 @@ public: subCycleField(GeometricField& gf) : gf_(gf), - gf0_(gf.oldTime()) + gf0_(gf.oldTime()), + gf_0_(gf0_.name() + "_", gf0_) {} //- Destructor ~subCycleField() { + // Reset the old-time field + gf0_ = gf_0_; + // Correct the time index of the field to correspond to the global time gf_.timeIndex() = gf_.time().timeIndex(); + gf0_.timeIndex() = gf_.time().timeIndex(); + } - // Reset the old-time field value - gf_.oldTime() = gf0_; - gf_.oldTime().timeIndex() = gf0_.timeIndex(); + + //- Correct the time index of the field to correspond to + // the sub-cycling time. + // + // The time index is incremented to protect the old-time value from + // being updated at the beginning of the time-loop in the case of + // outer iteration + void updateTimeIndex() + { + gf_.timeIndex() = gf_.time().timeIndex() + 1; + gf0_.timeIndex() = gf_.time().timeIndex() + 1; } }; @@ -106,16 +125,18 @@ public: //- Construct field and number of sub-cycles subCycle(GeometricField& gf, const label nSubCycles) : - subCycleField(gf), subCycleTime(const_cast(gf.time()), nSubCycles) - {} + { + // Update the field time index to correspond to the sub-cycle time + this->updateTimeIndex(); + } //- Destructor + // End the subCycleTime, which restores the time state ~subCycle() { - // End the subCycleTime, which restores the time state endSubCycle(); } }; diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 155c4c2eb4..8619e2da91 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -324,6 +324,7 @@ Foam::Time::Time secondaryWriteControl_(wcTimeStep), secondaryWriteInterval_(labelMax/10.0), // bit less to allow calculations purgeWrite_(0), + secondaryPurgeWrite_(0), writeOnce_(false), subCycling_(false), sigWriteNow_(true, *this), @@ -416,6 +417,7 @@ Foam::Time::Time secondaryWriteControl_(wcTimeStep), secondaryWriteInterval_(labelMax/10.0), purgeWrite_(0), + secondaryPurgeWrite_(0), writeOnce_(false), subCycling_(false), sigWriteNow_(true, *this), @@ -511,6 +513,7 @@ Foam::Time::Time secondaryWriteControl_(wcTimeStep), secondaryWriteInterval_(labelMax/10.0), purgeWrite_(0), + secondaryPurgeWrite_(0), writeOnce_(false), subCycling_(false), sigWriteNow_(true, *this), @@ -608,6 +611,7 @@ Foam::Time::Time secondaryWriteControl_(wcTimeStep), secondaryWriteInterval_(labelMax/10.0), purgeWrite_(0), + secondaryPurgeWrite_(0), writeOnce_(false), subCycling_(false), @@ -1070,11 +1074,13 @@ Foam::Time& Foam::Time::operator++() outputTime_ = false; + primaryOutputTime_ = false; + secondaryOutputTime_ = false; switch (writeControl_) { case wcTimeStep: - outputTime_ = !(timeIndex_ % label(writeInterval_)); + primaryOutputTime_ = !(timeIndex_ % label(writeInterval_)); break; case wcRunTime: @@ -1088,7 +1094,7 @@ Foam::Time& Foam::Time::operator++() if (outputIndex > outputTimeIndex_) { - outputTime_ = true; + primaryOutputTime_ = true; outputTimeIndex_ = outputIndex; } } @@ -1103,7 +1109,7 @@ Foam::Time& Foam::Time::operator++() ); if (outputIndex > outputTimeIndex_) { - outputTime_ = true; + primaryOutputTime_ = true; outputTimeIndex_ = outputIndex; } } @@ -1118,7 +1124,7 @@ Foam::Time& Foam::Time::operator++() ); if (outputIndex > outputTimeIndex_) { - outputTime_ = true; + primaryOutputTime_ = true; outputTimeIndex_ = outputIndex; } } @@ -1130,9 +1136,8 @@ Foam::Time& Foam::Time::operator++() switch (secondaryWriteControl_) { case wcTimeStep: - outputTime_ = - outputTime_ - || !(timeIndex_ % label(secondaryWriteInterval_)); + secondaryOutputTime_ = + !(timeIndex_ % label(secondaryWriteInterval_)); break; case wcRunTime: @@ -1146,7 +1151,7 @@ Foam::Time& Foam::Time::operator++() if (outputIndex > secondaryOutputTimeIndex_) { - outputTime_ = true; + secondaryOutputTime_ = true; secondaryOutputTimeIndex_ = outputIndex; } } @@ -1161,7 +1166,7 @@ Foam::Time& Foam::Time::operator++() ); if (outputIndex > secondaryOutputTimeIndex_) { - outputTime_ = true; + secondaryOutputTime_ = true; secondaryOutputTimeIndex_ = outputIndex; } } @@ -1176,7 +1181,7 @@ Foam::Time& Foam::Time::operator++() ); if (outputIndex > secondaryOutputTimeIndex_) { - outputTime_ = true; + secondaryOutputTime_ = true; secondaryOutputTimeIndex_ = outputIndex; } } @@ -1184,6 +1189,9 @@ Foam::Time& Foam::Time::operator++() } + outputTime_ = primaryOutputTime_ || secondaryOutputTime_; + + // see if endTime needs adjustment to stop at the next run()/end() check if (!end()) { @@ -1195,6 +1203,7 @@ Foam::Time& Foam::Time::operator++() { endTime_ = value(); outputTime_ = true; + primaryOutputTime_ = true; } else if (stopAt_ == saNextWrite && outputTime_ == true) { @@ -1205,6 +1214,7 @@ Foam::Time& Foam::Time::operator++() // Override outputTime if one-shot writing if (writeOnce_) { + primaryOutputTime_ = true; outputTime_ = true; writeOnce_ = false; } diff --git a/src/OpenFOAM/db/Time/Time.H b/src/OpenFOAM/db/Time/Time.H index 26e6b21bc7..1e761cd73e 100644 --- a/src/OpenFOAM/db/Time/Time.H +++ b/src/OpenFOAM/db/Time/Time.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,10 +138,15 @@ protected: scalar secondaryWriteInterval_; - label purgeWrite_; mutable FIFOStack previousOutputTimes_; + // Additional purging + + label secondaryPurgeWrite_; + mutable FIFOStack previousSecondaryOutputTimes_; + + // One-shot writing bool writeOnce_; diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index 6a80618404..1637d35bfc 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -160,6 +160,20 @@ void Foam::Time::readDict() } } + if (controlDict_.readIfPresent("secondaryPurgeWrite", secondaryPurgeWrite_)) + { + if (secondaryPurgeWrite_ < 0) + { + WarningIn("Time::readDict()") + << "invalid value for secondaryPurgeWrite " + << secondaryPurgeWrite_ + << ", should be >= 0, setting to 0" + << endl; + + secondaryPurgeWrite_ = 0; + } + } + if (controlDict_.found("timeFormat")) { const word formatName(controlDict_.lookup("timeFormat")); @@ -347,13 +361,45 @@ bool Foam::Time::writeObject timeDict.regIOobject::writeObject(fmt, ver, cmp); bool writeOK = objectRegistry::writeObject(fmt, ver, cmp); - if (writeOK && purgeWrite_) + if (writeOK) { - previousOutputTimes_.push(tmName); - - while (previousOutputTimes_.size() > purgeWrite_) + // Does primary or secondary time trigger purging? + // Note that primary times can only be purged by primary + // purging. Secondary times can be purged by either primary + // or secondary purging. + if (primaryOutputTime_ && purgeWrite_) { - rmDir(objectRegistry::path(previousOutputTimes_.pop())); + previousOutputTimes_.push(tmName); + + while (previousOutputTimes_.size() > purgeWrite_) + { + rmDir(objectRegistry::path(previousOutputTimes_.pop())); + } + } + if + ( + !primaryOutputTime_ + && secondaryOutputTime_ + && secondaryPurgeWrite_ + ) + { + // Writing due to secondary + previousSecondaryOutputTimes_.push(tmName); + + while + ( + previousSecondaryOutputTimes_.size() + > secondaryPurgeWrite_ + ) + { + rmDir + ( + objectRegistry::path + ( + previousSecondaryOutputTimes_.pop() + ) + ); + } } } @@ -368,6 +414,7 @@ bool Foam::Time::writeObject bool Foam::Time::writeNow() { + primaryOutputTime_ = true; outputTime_ = true; return write(); } diff --git a/src/OpenFOAM/db/Time/TimeState.C b/src/OpenFOAM/db/Time/TimeState.C index 500ca47d43..f3e3740107 100644 --- a/src/OpenFOAM/db/Time/TimeState.C +++ b/src/OpenFOAM/db/Time/TimeState.C @@ -37,7 +37,9 @@ Foam::TimeState::TimeState() deltaT0_(0), deltaTchanged_(false), outputTimeIndex_(0), + primaryOutputTime_(false), secondaryOutputTimeIndex_(0), + secondaryOutputTime_(false), outputTime_(false) {} diff --git a/src/OpenFOAM/db/Time/TimeState.H b/src/OpenFOAM/db/Time/TimeState.H index d721529480..b055d439f0 100644 --- a/src/OpenFOAM/db/Time/TimeState.H +++ b/src/OpenFOAM/db/Time/TimeState.H @@ -61,8 +61,14 @@ protected: bool deltaTchanged_; label outputTimeIndex_; + //- Is outputTime because of primary? + bool primaryOutputTime_; + label secondaryOutputTimeIndex_; - bool outputTime_; + //- Is outputTime because of secondary? + bool secondaryOutputTime_; + + bool outputTime_; public: @@ -112,7 +118,7 @@ public: // Check - //- Return true if this is an output time + //- Return true if this is an output time (primary or secondary) bool outputTime() const; }; diff --git a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C index 34b9da0da1..e282ff8c21 100644 --- a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C +++ b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,11 +30,8 @@ License namespace Foam { template<> - const char* Foam::NamedEnum - < - Foam::outputFilterOutputControl::outputControls, - 2 - >::names[] = + const char* NamedEnum:: + names[] = { "timeStep", "outputTime" diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.C b/src/OpenFOAM/dimensionSet/dimensionSet.C index c0da41236e..64396290eb 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.C +++ b/src/OpenFOAM/dimensionSet/dimensionSet.C @@ -372,6 +372,12 @@ Foam::dimensionSet Foam::sqrt(const dimensionSet& ds) } +Foam::dimensionSet Foam::cbrt(const dimensionSet& ds) +{ + return pow(ds, 1.0/3.0); +} + + Foam::dimensionSet Foam::magSqr(const dimensionSet& ds) { return pow(ds, 2); diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.H b/src/OpenFOAM/dimensionSet/dimensionSet.H index ca4c3ed2d1..6dc1219562 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.H +++ b/src/OpenFOAM/dimensionSet/dimensionSet.H @@ -76,6 +76,7 @@ dimensionSet pow6(const dimensionSet&); dimensionSet pow025(const dimensionSet&); dimensionSet sqrt(const dimensionSet&); +dimensionSet cbrt(const dimensionSet&); dimensionSet magSqr(const dimensionSet&); dimensionSet mag(const dimensionSet&); dimensionSet sign(const dimensionSet&); diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C index 14e1030b4b..a4296ff91b 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -377,6 +377,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5) UNARY_FUNCTION(scalar, scalar, pow6, pow6) UNARY_FUNCTION(scalar, scalar, pow025, pow025) UNARY_FUNCTION(scalar, scalar, sqrt, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt, cbrt) UNARY_FUNCTION(scalar, scalar, sign, sign) UNARY_FUNCTION(scalar, scalar, pos, pos) UNARY_FUNCTION(scalar, scalar, neg, neg) diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.H index 5c4a2b217a..b6e76631e0 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.H +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,6 +85,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5) UNARY_FUNCTION(scalar, scalar, pow6, pow6) UNARY_FUNCTION(scalar, scalar, pow025, pow025) UNARY_FUNCTION(scalar, scalar, sqrt, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt, cbrt) UNARY_FUNCTION(scalar, scalar, sign, sign) UNARY_FUNCTION(scalar, scalar, pos, pos) UNARY_FUNCTION(scalar, scalar, neg, neg) diff --git a/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.C b/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.C index bf58529828..4132ba79f3 100644 --- a/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.C +++ b/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,6 +105,7 @@ UNARY_FUNCTION(scalar, scalar, pow5) UNARY_FUNCTION(scalar, scalar, pow6) UNARY_FUNCTION(scalar, scalar, pow025) UNARY_FUNCTION(scalar, scalar, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt) UNARY_FUNCTION(scalar, scalar, sign) UNARY_FUNCTION(scalar, scalar, pos) UNARY_FUNCTION(scalar, scalar, neg) diff --git a/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.H b/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.H index f2c851c0cd..f6fcc4c901 100644 --- a/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.H +++ b/src/OpenFOAM/fields/FieldFields/scalarFieldField/scalarFieldField.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -98,6 +98,7 @@ UNARY_FUNCTION(scalar, scalar, pow5) UNARY_FUNCTION(scalar, scalar, pow6) UNARY_FUNCTION(scalar, scalar, pow025) UNARY_FUNCTION(scalar, scalar, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt) UNARY_FUNCTION(scalar, scalar, sign) UNARY_FUNCTION(scalar, scalar, pos) UNARY_FUNCTION(scalar, scalar, neg) diff --git a/src/OpenFOAM/fields/Fields/scalarField/scalarField.C b/src/OpenFOAM/fields/Fields/scalarField/scalarField.C index cd18592265..96e41d9571 100644 --- a/src/OpenFOAM/fields/Fields/scalarField/scalarField.C +++ b/src/OpenFOAM/fields/Fields/scalarField/scalarField.C @@ -128,6 +128,7 @@ UNARY_FUNCTION(scalar, scalar, pow5) UNARY_FUNCTION(scalar, scalar, pow6) UNARY_FUNCTION(scalar, scalar, pow025) UNARY_FUNCTION(scalar, scalar, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt) UNARY_FUNCTION(scalar, scalar, sign) UNARY_FUNCTION(scalar, scalar, pos) UNARY_FUNCTION(scalar, scalar, neg) diff --git a/src/OpenFOAM/fields/Fields/scalarField/scalarField.H b/src/OpenFOAM/fields/Fields/scalarField/scalarField.H index d5a3b7659b..ff322d3fe4 100644 --- a/src/OpenFOAM/fields/Fields/scalarField/scalarField.H +++ b/src/OpenFOAM/fields/Fields/scalarField/scalarField.H @@ -103,6 +103,7 @@ UNARY_FUNCTION(scalar, scalar, pow5) UNARY_FUNCTION(scalar, scalar, pow6) UNARY_FUNCTION(scalar, scalar, pow025) UNARY_FUNCTION(scalar, scalar, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt) UNARY_FUNCTION(scalar, scalar, sign) UNARY_FUNCTION(scalar, scalar, pos) UNARY_FUNCTION(scalar, scalar, neg) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 5117f8cb23..20d15fbe81 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -47,7 +47,7 @@ GeometricBoundaryField Info<< "GeometricField::" "GeometricBoundaryField::" "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const word&)" + "const DimensionedField&, const word&)" << endl; } @@ -84,8 +84,13 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const wordList&, const wordList&)" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const wordList&, " + "const wordList&" + ")" << endl; } @@ -99,8 +104,13 @@ GeometricBoundaryField ( "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const wordList&, const wordList&)" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const wordList&, " + "const wordList&" + ")" ) << "Incorrect number of patch type specifications given" << nl << " Number of patches in mesh = " << bmesh.size() << " number of patch type specifications = " @@ -160,8 +170,12 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const PatchFieldList&)" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const PtrLIst >&" + ")" << endl; } @@ -188,8 +202,12 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const GeometricBoundaryField&)" + "GeometricBoundaryField" + "(" + "const DimensionedField&, " + "const typename GeometricField::" + "GeometricBoundaryField&" + ")" << endl; } @@ -220,8 +238,11 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const GeometricBoundaryField&)" + "GeometricBoundaryField" + "(" + "const GeometricField::" + "GeometricBoundaryField&" + ")" << endl; } } @@ -244,7 +265,11 @@ GeometricBoundaryField Info<< "GeometricField::" "GeometricBoundaryField::" "GeometricBoundaryField" - "(const BoundaryMesh&, const Field&, const dictionary&)" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const dictionary&" + ")" << endl; } @@ -326,12 +351,13 @@ GeometricBoundaryField { FatalIOErrorIn ( - "GeometricField::\n" - "GeometricBoundaryField::GeometricBoundaryField\n" - "(\n" - " const BoundaryMesh&,\n" - " const DimensionedField&,\n" - " const dictionary&\n" + "GeometricField::" + "GeometricBoundaryField::" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const dictionary&" ")", dict ) << "Cannot find patchField entry for cyclic " @@ -344,12 +370,13 @@ GeometricBoundaryField { FatalIOErrorIn ( - "GeometricField::\n" - "GeometricBoundaryField::GeometricBoundaryField\n" - "(\n" - " const BoundaryMesh&,\n" - " const DimensionedField&,\n" - " const dictionary&\n" + "GeometricField::" + "GeometricBoundaryField::" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const dictionary&" ")", dict ) << "Cannot find patchField entry for " diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C index 43b2f1c7f5..ce78313efb 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -448,6 +448,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5) UNARY_FUNCTION(scalar, scalar, pow6, pow6) UNARY_FUNCTION(scalar, scalar, pow025, pow025) UNARY_FUNCTION(scalar, scalar, sqrt, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt, cbrt) UNARY_FUNCTION(scalar, scalar, sign, sign) UNARY_FUNCTION(scalar, scalar, pos, pos) UNARY_FUNCTION(scalar, scalar, neg, neg) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.H b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.H index fa3280ce74..fd20e171c9 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,6 +93,7 @@ UNARY_FUNCTION(scalar, scalar, pow5, pow5) UNARY_FUNCTION(scalar, scalar, pow6, pow6) UNARY_FUNCTION(scalar, scalar, pow025, pow025) UNARY_FUNCTION(scalar, scalar, sqrt, sqrt) +UNARY_FUNCTION(scalar, scalar, cbrt, cbrt) UNARY_FUNCTION(scalar, scalar, sign, sign) UNARY_FUNCTION(scalar, scalar, pos, pos) UNARY_FUNCTION(scalar, scalar, neg, neg) diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C index 43d14a5740..1ea9ae6e11 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "SlicedGeometricField.H" +#include "processorFvPatch.H" // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // @@ -40,7 +41,8 @@ slicedBoundaryField ( const Mesh& mesh, const Field& completeField, - const bool preserveCouples + const bool preserveCouples, + const bool preserveProcessorOnly ) { tmp > tbf @@ -52,7 +54,15 @@ slicedBoundaryField forAll(mesh.boundary(), patchi) { - if (preserveCouples && mesh.boundary()[patchi].coupled()) + if + ( + preserveCouples + && mesh.boundary()[patchi].coupled() + && ( + !preserveProcessorOnly + || isA(mesh.boundary()[patchi]) + ) + ) { // For coupled patched construct the correct patch field type bf.set @@ -243,7 +253,8 @@ SlicedGeometricField const dimensionSet& ds, const Field& completeIField, const Field& completeBField, - const bool preserveCouples + const bool preserveCouples, + const bool preserveProcessorOnly ) : GeometricField @@ -252,7 +263,13 @@ SlicedGeometricField mesh, ds, Field(), - slicedBoundaryField(mesh, completeBField, preserveCouples) + slicedBoundaryField + ( + mesh, + completeBField, + preserveCouples, + preserveProcessorOnly + ) ) { // Set the internalField to the slice of the complete field diff --git a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H index e04690e042..dd23712e67 100644 --- a/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/SlicedGeometricField/SlicedGeometricField.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,8 @@ private: ( const Mesh& mesh, const Field& completeField, - const bool preserveCouples + const bool preserveCouples, + const bool preserveProcessorOnly = false ); //- Slice the given field and a create a PtrList of SlicedPatchField @@ -133,7 +134,8 @@ public: const dimensionSet&, const Field& completeIField, const Field& completeBField, - const bool preserveCouples=true + const bool preserveCouples=true, + const bool preserveProcessorOnly = false ); //- Construct from GeometricField. Reuses full internal and diff --git a/src/conversion/meshReader/createPolyBoundary.C b/src/conversion/meshReader/createPolyBoundary.C index e0c898156a..47fb2008f7 100644 --- a/src/conversion/meshReader/createPolyBoundary.C +++ b/src/conversion/meshReader/createPolyBoundary.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -303,14 +303,12 @@ void Foam::meshReader::createPolyBoundary() Info<< "Added " << nMissingFaces << " unmatched faces" << endl; + // Add missing faces to last patch ('Default_Empty' etc.) if (nMissingFaces > 0) { patchSizes_.last() = nMissingFaces; } - else - { - patchStarts_.setSize(patchStarts_.size() - 1); - } + // reset the size of the face list meshFaces_.setSize(nCreatedFaces); diff --git a/src/engine/Make/options b/src/engine/Make/options index 6862a106f6..0929e2bc8f 100644 --- a/src/engine/Make/options +++ b/src/engine/Make/options @@ -2,12 +2,10 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/fvMotionSolver/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/fvMotionSolver/lnInclude LIB_LIBS = \ -lfiniteVolume \ -lmeshTools \ -ldynamicMesh \ - -lfvMotionSolvers \ - -lsampling + -lfvMotionSolvers diff --git a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C index bef68f3c4e..34db0a7e3e 100644 --- a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C +++ b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C @@ -41,8 +41,18 @@ namespace Foam fixedTemperatureSource, dictionary ); + + template<> + const char* NamedEnum::names[] = + { + "constant", + "lookup" + }; } +const Foam::NamedEnum + Foam::fixedTemperatureSource::temperatureModeNames_; + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -55,8 +65,29 @@ Foam::fixedTemperatureSource::fixedTemperatureSource ) : basicSource(name, modelType, dict, mesh), - T_(readScalar(coeffs_.lookup("temperature"))) + mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))), + Tconstant_(0.0), + TName_("T") { + switch (mode_) + { + case tmConstant: + { + coeffs_.lookup("temperature") >> Tconstant_; + break; + } + case tmLookup: + { + TName_ = coeffs_.lookupOrDefault("TName", "T"); + break; + } + default: + { + // error handling done by NamedEnum + } + } + + fieldNames_.setSize(1, "energy"); applied_.setSize(1, false); } @@ -81,8 +112,31 @@ void Foam::fixedTemperatureSource::setValue if (eqn.psi().name() == thermo.he().name()) { - const scalarField Tfield(cells_.size(), T_); - eqn.setValues(cells_, thermo.he(thermo.p(), Tfield, cells_)); + switch (mode_) + { + case tmConstant: + { + scalarField Tconst(cells_.size(), Tconstant_); + eqn.setValues(cells_, thermo.he(thermo.p(), Tconst, cells_)); + + break; + } + case tmLookup: + { + const volScalarField& T = + mesh().lookupObject(TName_); + + scalarField Tlookup(T, cells_); + eqn.setValues(cells_, thermo.he(thermo.p(), Tlookup, cells_)); + + break; + } + default: + { + // error handling done by NamedEnum + } + } + } } @@ -98,7 +152,8 @@ bool Foam::fixedTemperatureSource::read(const dictionary& dict) { if (basicSource::read(dict)) { - coeffs_.readIfPresent("T", T_); + coeffs_.readIfPresent("temperature", Tconstant_); + coeffs_.readIfPresent("TName", TName_); return true; } diff --git a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H index 4281a38e2c..3aefdb5645 100644 --- a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H +++ b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H @@ -33,7 +33,13 @@ Description fixedTemperatureSourceCoeffs { fieldNames (h e hs); // names of fields to apply source + mode constant; // constant or lookup + + // constant option temperature 500; // fixed temperature [K] + + // loolup option + // TName T; // optional temperature field name } @@ -46,6 +52,7 @@ SourceFiles #define fixedTemperatureSource_H #include "basicSource.H" +#include "NamedEnum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -61,12 +68,32 @@ class fixedTemperatureSource public basicSource { +public: + + //- Temperature mode + enum temperatureMode + { + tmConstant, + tmLookup + }; + + + //- String representation of temperatureMode enums + static const NamedEnum temperatureModeNames_; + + protected: // Protected data - //- Fixed temperature [K] - scalar T_; + //- Operation mode + temperatureMode mode_; + + //- Constant temperature [K] + scalar Tconstant_; + + //- Temperature field name + word TName_; private: diff --git a/src/fileFormats/Make/files b/src/fileFormats/Make/files index 7845ac9312..37f3bc0098 100644 --- a/src/fileFormats/Make/files +++ b/src/fileFormats/Make/files @@ -2,4 +2,17 @@ vtk/vtkUnstructuredReader.C nas/NASCore.C starcd/STARCDCore.C +coordSet/coordSet.C + +setWriters = sampledSetWriters + +$(setWriters)/writers.C +$(setWriters)/ensight/ensightSetWriterRunTime.C +$(setWriters)/gnuplot/gnuplotSetWriterRunTime.C +$(setWriters)/jplot/jplotSetWriterRunTime.C +$(setWriters)/raw/rawSetWriterRunTime.C +$(setWriters)/vtk/vtkSetWriterRunTime.C +$(setWriters)/xmgrace/xmgraceSetWriterRunTime.C +$(setWriters)/csv/csvSetWriterRunTime.C + LIB = $(FOAM_LIBBIN)/libfileFormats diff --git a/src/sampling/sampledSet/coordSet/coordSet.C b/src/fileFormats/coordSet/coordSet.C similarity index 97% rename from src/sampling/sampledSet/coordSet/coordSet.C rename to src/fileFormats/coordSet/coordSet.C index fed58fc86f..d8b37c5fdd 100644 --- a/src/sampling/sampledSet/coordSet/coordSet.C +++ b/src/fileFormats/coordSet/coordSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/coordSet/coordSet.H b/src/fileFormats/coordSet/coordSet.H similarity index 97% rename from src/sampling/sampledSet/coordSet/coordSet.H rename to src/fileFormats/coordSet/coordSet.H index 8629f78bbe..5492f37b43 100644 --- a/src/sampling/sampledSet/coordSet/coordSet.H +++ b/src/fileFormats/coordSet/coordSet.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/csv/csvSetWriter.C b/src/fileFormats/sampledSetWriters/csv/csvSetWriter.C similarity index 98% rename from src/sampling/sampledSet/writers/csv/csvSetWriter.C rename to src/fileFormats/sampledSetWriters/csv/csvSetWriter.C index 4cbb51a597..c1ed54b1cd 100644 --- a/src/sampling/sampledSet/writers/csv/csvSetWriter.C +++ b/src/fileFormats/sampledSetWriters/csv/csvSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/csv/csvSetWriter.H b/src/fileFormats/sampledSetWriters/csv/csvSetWriter.H similarity index 97% rename from src/sampling/sampledSet/writers/csv/csvSetWriter.H rename to src/fileFormats/sampledSetWriters/csv/csvSetWriter.H index 9c494320cb..8e4b9c7d70 100644 --- a/src/sampling/sampledSet/writers/csv/csvSetWriter.H +++ b/src/fileFormats/sampledSetWriters/csv/csvSetWriter.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/csv/csvSetWriterRunTime.C b/src/fileFormats/sampledSetWriters/csv/csvSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/csv/csvSetWriterRunTime.C rename to src/fileFormats/sampledSetWriters/csv/csvSetWriterRunTime.C index 2d326f8efa..ac588e3957 100644 --- a/src/sampling/sampledSet/writers/csv/csvSetWriterRunTime.C +++ b/src/fileFormats/sampledSetWriters/csv/csvSetWriterRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/ensight/ensightSetWriter.C b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.C similarity index 99% rename from src/sampling/sampledSet/writers/ensight/ensightSetWriter.C rename to src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.C index d481a41532..4b874e201d 100644 --- a/src/sampling/sampledSet/writers/ensight/ensightSetWriter.C +++ b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/ensight/ensightSetWriter.H b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.H similarity index 97% rename from src/sampling/sampledSet/writers/ensight/ensightSetWriter.H rename to src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.H index 5118c85faa..14a735b2ed 100644 --- a/src/sampling/sampledSet/writers/ensight/ensightSetWriter.H +++ b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriter.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/ensight/ensightSetWriterRunTime.C b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/ensight/ensightSetWriterRunTime.C rename to src/fileFormats/sampledSetWriters/ensight/ensightSetWriterRunTime.C index b987035b33..c529cb02e4 100644 --- a/src/sampling/sampledSet/writers/ensight/ensightSetWriterRunTime.C +++ b/src/fileFormats/sampledSetWriters/ensight/ensightSetWriterRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C b/src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriter.C similarity index 97% rename from src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C rename to src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriter.C index f6198d3f5a..2679e1e702 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.C +++ b/src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "gnuplotSetWriter.H" -#include "clock.H" #include "coordSet.H" #include "fileName.H" #include "OFstream.H" diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H b/src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriter.H similarity index 97% rename from src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H rename to src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriter.H index 88e9414c85..74688771e8 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriter.H +++ b/src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriter.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriterRunTime.C b/src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriterRunTime.C rename to src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriterRunTime.C index 90ee219888..4e57426359 100644 --- a/src/sampling/sampledSet/writers/gnuplot/gnuplotSetWriterRunTime.C +++ b/src/fileFormats/sampledSetWriters/gnuplot/gnuplotSetWriterRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C b/src/fileFormats/sampledSetWriters/jplot/jplotSetWriter.C similarity index 97% rename from src/sampling/sampledSet/writers/jplot/jplotSetWriter.C rename to src/fileFormats/sampledSetWriters/jplot/jplotSetWriter.C index 98dc34bad9..d71d860a26 100644 --- a/src/sampling/sampledSet/writers/jplot/jplotSetWriter.C +++ b/src/fileFormats/sampledSetWriters/jplot/jplotSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/jplot/jplotSetWriter.H b/src/fileFormats/sampledSetWriters/jplot/jplotSetWriter.H similarity index 97% rename from src/sampling/sampledSet/writers/jplot/jplotSetWriter.H rename to src/fileFormats/sampledSetWriters/jplot/jplotSetWriter.H index bd7bc8c783..5b09456642 100644 --- a/src/sampling/sampledSet/writers/jplot/jplotSetWriter.H +++ b/src/fileFormats/sampledSetWriters/jplot/jplotSetWriter.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/jplot/jplotSetWriterRunTime.C b/src/fileFormats/sampledSetWriters/jplot/jplotSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/jplot/jplotSetWriterRunTime.C rename to src/fileFormats/sampledSetWriters/jplot/jplotSetWriterRunTime.C index e0e9ac2b52..7e54146fe7 100644 --- a/src/sampling/sampledSet/writers/jplot/jplotSetWriterRunTime.C +++ b/src/fileFormats/sampledSetWriters/jplot/jplotSetWriterRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/raw/rawSetWriter.C b/src/fileFormats/sampledSetWriters/raw/rawSetWriter.C similarity index 97% rename from src/sampling/sampledSet/writers/raw/rawSetWriter.C rename to src/fileFormats/sampledSetWriters/raw/rawSetWriter.C index e259c78eaa..403b9e7111 100644 --- a/src/sampling/sampledSet/writers/raw/rawSetWriter.C +++ b/src/fileFormats/sampledSetWriters/raw/rawSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/raw/rawSetWriter.H b/src/fileFormats/sampledSetWriters/raw/rawSetWriter.H similarity index 97% rename from src/sampling/sampledSet/writers/raw/rawSetWriter.H rename to src/fileFormats/sampledSetWriters/raw/rawSetWriter.H index 418549d01b..89c857d779 100644 --- a/src/sampling/sampledSet/writers/raw/rawSetWriter.H +++ b/src/fileFormats/sampledSetWriters/raw/rawSetWriter.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/raw/rawSetWriterRunTime.C b/src/fileFormats/sampledSetWriters/raw/rawSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/raw/rawSetWriterRunTime.C rename to src/fileFormats/sampledSetWriters/raw/rawSetWriterRunTime.C index c4376c9140..92a8a83354 100644 --- a/src/sampling/sampledSet/writers/raw/rawSetWriterRunTime.C +++ b/src/fileFormats/sampledSetWriters/raw/rawSetWriterRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/vtk/vtkSetWriter.C b/src/fileFormats/sampledSetWriters/vtk/vtkSetWriter.C similarity index 98% rename from src/sampling/sampledSet/writers/vtk/vtkSetWriter.C rename to src/fileFormats/sampledSetWriters/vtk/vtkSetWriter.C index b865e704d4..3ab2736175 100644 --- a/src/sampling/sampledSet/writers/vtk/vtkSetWriter.C +++ b/src/fileFormats/sampledSetWriters/vtk/vtkSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/vtk/vtkSetWriter.H b/src/fileFormats/sampledSetWriters/vtk/vtkSetWriter.H similarity index 97% rename from src/sampling/sampledSet/writers/vtk/vtkSetWriter.H rename to src/fileFormats/sampledSetWriters/vtk/vtkSetWriter.H index 9507fd1dc7..21bd80ef1e 100644 --- a/src/sampling/sampledSet/writers/vtk/vtkSetWriter.H +++ b/src/fileFormats/sampledSetWriters/vtk/vtkSetWriter.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/vtk/vtkSetWriterRunTime.C b/src/fileFormats/sampledSetWriters/vtk/vtkSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/vtk/vtkSetWriterRunTime.C rename to src/fileFormats/sampledSetWriters/vtk/vtkSetWriterRunTime.C index 3c30764d86..e9320e5b55 100644 --- a/src/sampling/sampledSet/writers/vtk/vtkSetWriterRunTime.C +++ b/src/fileFormats/sampledSetWriters/vtk/vtkSetWriterRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/writer.C b/src/fileFormats/sampledSetWriters/writer.C similarity index 99% rename from src/sampling/sampledSet/writers/writer.C rename to src/fileFormats/sampledSetWriters/writer.C index 69dbdec6fe..e031615ff6 100644 --- a/src/sampling/sampledSet/writers/writer.C +++ b/src/fileFormats/sampledSetWriters/writer.C @@ -166,7 +166,6 @@ void Foam::writer::write { valueSetPtrs[i] = &valueSets[i]; } - write(points, valueSetNames, valueSetPtrs, os); } diff --git a/src/sampling/sampledSet/writers/writer.H b/src/fileFormats/sampledSetWriters/writer.H similarity index 100% rename from src/sampling/sampledSet/writers/writer.H rename to src/fileFormats/sampledSetWriters/writer.H diff --git a/src/sampling/sampledSet/writers/writers.C b/src/fileFormats/sampledSetWriters/writers.C similarity index 96% rename from src/sampling/sampledSet/writers/writers.C rename to src/fileFormats/sampledSetWriters/writers.C index 2815bcda03..4bcc1b39b2 100644 --- a/src/sampling/sampledSet/writers/writers.C +++ b/src/fileFormats/sampledSetWriters/writers.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/writers.H b/src/fileFormats/sampledSetWriters/writers.H similarity index 97% rename from src/sampling/sampledSet/writers/writers.H rename to src/fileFormats/sampledSetWriters/writers.H index 3adaab13fa..601e7bcd16 100644 --- a/src/sampling/sampledSet/writers/writers.H +++ b/src/fileFormats/sampledSetWriters/writers.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C b/src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriter.C similarity index 98% rename from src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C rename to src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriter.C index 9cc44a10c3..3825868196 100644 --- a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.C +++ b/src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.H b/src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriter.H similarity index 97% rename from src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.H rename to src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriter.H index 8e8dc67ead..47c3628936 100644 --- a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriter.H +++ b/src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriter.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriterRunTime.C b/src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriterRunTime.C similarity index 94% rename from src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriterRunTime.C rename to src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriterRunTime.C index 8e7ab61c8e..583855fc83 100644 --- a/src/sampling/sampledSet/writers/xmgrace/xmgraceSetWriterRunTime.C +++ b/src/fileFormats/sampledSetWriters/xmgrace/xmgraceSetWriterRunTime.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index d56bf6421a..f09f38d4ee 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -296,6 +296,12 @@ Foam::MRFZone::MRFZone // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +Foam::vector Foam::MRFZone::Omega() const +{ + return omega_->value(mesh_.time().timeOutputValue())*axis_; +} + + void Foam::MRFZone::addCoriolis ( const volVectorField& U, @@ -312,7 +318,7 @@ void Foam::MRFZone::addCoriolis vectorField& ddtUc = ddtU.internalField(); const vectorField& Uc = U.internalField(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); forAll(cells, i) { @@ -334,7 +340,7 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const vectorField& Usource = UEqn.source(); const vectorField& U = UEqn.psi(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); forAll(cells, i) { @@ -360,7 +366,7 @@ void Foam::MRFZone::addCoriolis vectorField& Usource = UEqn.source(); const vectorField& U = UEqn.psi(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); forAll(cells, i) { @@ -374,7 +380,7 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const { const volVectorField& C = mesh_.C(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); const labelList& cells = mesh_.cellZones()[cellZoneID_]; @@ -412,7 +418,7 @@ void Foam::MRFZone::absoluteVelocity(volVectorField& U) const { const volVectorField& C = mesh_.C(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); const labelList& cells = mesh_.cellZones()[cellZoneID_]; @@ -480,7 +486,7 @@ void Foam::MRFZone::absoluteFlux void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const { - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); // Included patches diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index 74160cf39b..5c6e05e2d3 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -47,7 +47,7 @@ SourceFiles #include "volFieldsFwd.H" #include "surfaceFieldsFwd.H" #include "fvMatricesFwd.H" -#include "fvMatrices.H" +#include "mapPolyMesh.H" #include "DataEntry.H" #include "autoPtr.H" @@ -164,6 +164,9 @@ public: //- Return const access to the MRF active flag inline bool active() const; + //- Return the current Omega vector + vector Omega() const; + // Evaluation diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C index 872bf53a82..bc0087826c 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C @@ -27,6 +27,7 @@ License #include "fvMesh.H" #include "volFields.H" #include "surfaceFields.H" +#include "fvMatrices.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index 9ef4be21a4..f3a7615b4a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -63,7 +63,19 @@ Foam::fixedJumpFvPatchField::fixedJumpFvPatchField : jumpCyclicFvPatchField(p, iF), jump_("jump", dict, p.size()) -{} +{ + if (dict.found("value")) + { + fvPatchField::operator= + ( + Field("value", dict, p.size()) + ); + } + else + { + this->evaluate(Pstream::blocking); + } +} template diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C index 4c3290cf2d..ad6fb925ae 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -63,7 +63,19 @@ Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField : jumpCyclicAMIFvPatchField(p, iF), jump_("jump", dict, p.size()) -{} +{ + if (dict.found("value")) + { + fvPatchField::operator= + ( + Field("value", dict, p.size()) + ); + } + else + { + this->evaluate(Pstream::blocking); + } +} template diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C index fbfc5eb96a..29590cc051 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C @@ -53,7 +53,7 @@ timeVaryingMappedFixedValueFvPatchField endSampleTime_(-1), endSampledValues_(0), endAverage_(pTraits::zero), - offSet_() + offset_() {} @@ -79,7 +79,7 @@ timeVaryingMappedFixedValueFvPatchField endSampleTime_(-1), endSampledValues_(0), endAverage_(pTraits::zero), - offSet_() + offset_() {} @@ -104,7 +104,7 @@ timeVaryingMappedFixedValueFvPatchField endSampleTime_(-1), endSampledValues_(0), endAverage_(pTraits::zero), - offSet_(DataEntry::New("offSet", dict)) + offset_(DataEntry::New("offset", dict)) { dict.readIfPresent("fieldTableName", fieldTableName_); @@ -138,7 +138,7 @@ timeVaryingMappedFixedValueFvPatchField endSampleTime_(ptf.endSampleTime_), endSampledValues_(ptf.endSampledValues_), endAverage_(ptf.endAverage_), - offSet_(ptf.offSet_().clone().ptr()) + offset_(ptf.offset_().clone().ptr()) {} @@ -163,7 +163,7 @@ timeVaryingMappedFixedValueFvPatchField endSampleTime_(ptf.endSampleTime_), endSampledValues_(ptf.endSampledValues_), endAverage_(ptf.endAverage_), - offSet_(ptf.offSet_().clone().ptr()) + offset_(ptf.offset_().clone().ptr()) {} @@ -487,7 +487,7 @@ void timeVaryingMappedFixedValueFvPatchField::updateCoeffs() // apply offset to mapped values const scalar t = this->db().time().timeOutputValue(); - this->operator==(*this + offSet_->value(t)); + this->operator==(*this + offset_->value(t)); if (debug) { @@ -512,7 +512,7 @@ void timeVaryingMappedFixedValueFvPatchField::write(Ostream& os) const << token::END_STATEMENT << nl; } - offSet_->writeData(os); + offset_->writeData(os); this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H index 01e61301eb..aec6c322b9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H @@ -132,7 +132,7 @@ class timeVaryingMappedFixedValueFvPatchField Type endAverage_; //- Time varying offset values to interpolated data - autoPtr > offSet_; + autoPtr > offset_; public: diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C index 06f4e3c134..0670119ab0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C @@ -73,6 +73,10 @@ Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField { fvPatchField::operator=(Field("value", dict, p.size())); } + else + { + this->evaluate(Pstream::blocking); + } } diff --git a/src/finiteVolume/fvMesh/fvMeshGeometry.C b/src/finiteVolume/fvMesh/fvMeshGeometry.C index 0a06ef7364..5abdb45d11 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -133,6 +133,8 @@ void fvMesh::makeC() const << abort(FatalError); } + // Construct as slices. Only preserve processor (not e.g. cyclic) + CPtr_ = new slicedVolVectorField ( IOobject @@ -148,33 +150,10 @@ void fvMesh::makeC() const *this, dimLength, cellCentres(), - faceCentres() + faceCentres(), + true, //preserveCouples + true //preserveProcOnly ); - - - // Need to correct for cyclics transformation since absolute quantity. - // Ok on processor patches since hold opposite cell centre (no - // transformation) - slicedVolVectorField& C = *CPtr_; - - forAll(C.boundaryField(), patchi) - { - if - ( - isA(C.boundaryField()[patchi]) - || isA(C.boundaryField()[patchi]) - ) - { - // Note: cyclic is not slice but proper field - C.boundaryField()[patchi] == static_cast - ( - static_cast&> - ( - boundary_[patchi].patchSlice(faceCentres()) - ) - ); - } - } } diff --git a/src/fvMotionSolver/Make/options b/src/fvMotionSolver/Make/options index 7c440dd78f..29e4469610 100644 --- a/src/fvMotionSolver/Make/options +++ b/src/fvMotionSolver/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/postProcessing/functionObjects/forces/lnInclude \ LIB_LIBS = \ @@ -10,4 +11,5 @@ LIB_LIBS = \ -lmeshTools \ -ldynamicMesh \ -lfiniteVolume \ + -lfileFormats /*-lforces include in controlDict if needed */ diff --git a/src/lagrangian/coalCombustion/Make/options b/src/lagrangian/coalCombustion/Make/options index 34a2babd73..0d7eb0e13b 100644 --- a/src/lagrangian/coalCombustion/Make/options +++ b/src/lagrangian/coalCombustion/Make/options @@ -17,8 +17,7 @@ EXE_INC = \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/dynamicFvMesh/lnInclude LIB_LIBS = \ -lfiniteVolume \ @@ -42,5 +41,4 @@ LIB_LIBS = \ -lincompressibleTransportModels \ -lregionModels \ -lsurfaceFilmModels \ - -ldynamicFvMesh \ - -lsampling + -ldynamicFvMesh diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index 58217adbf5..7ec52b1ee8 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -326,7 +326,7 @@ bool Foam::KinematicParcel::move p.age() += dt; - td.cloud().functions().postMove(p, cellI, dt); + td.cloud().functions().postMove(p, cellI, dt, td.keepParticle); } return td.keepParticle; @@ -340,7 +340,7 @@ void Foam::KinematicParcel::hitFace(TrackData& td) typename TrackData::cloudType::parcelType& p = static_cast(*this); - td.cloud().functions().postFace(p, p.face()); + td.cloud().functions().postFace(p, p.face(), td.keepParticle); } @@ -364,7 +364,14 @@ bool Foam::KinematicParcel::hitPatch static_cast(*this); // Invoke post-processing model - td.cloud().functions().postPatch(p, pp, trackFraction, tetIs); + td.cloud().functions().postPatch + ( + p, + pp, + trackFraction, + tetIs, + td.keepParticle + ); // Invoke surface film model if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle)) diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H index 9e19beae34..783878f480 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,6 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "FacePostProcessing.H" +#include "ParticleCollector.H" #include "ParticleErosion.H" #include "ParticleTracks.H" #include "ParticleTrap.H" @@ -42,6 +43,7 @@ License makeCloudFunctionObject(CloudType); \ \ makeCloudFunctionObjectType(FacePostProcessing, CloudType); \ + makeCloudFunctionObjectType(ParticleCollector, CloudType); \ makeCloudFunctionObjectType(ParticleErosion, CloudType); \ makeCloudFunctionObjectType(ParticleTracks, CloudType); \ makeCloudFunctionObjectType(ParticleTrap, CloudType); \ diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C index dbc359ae9a..5a208a4ca8 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C @@ -96,7 +96,8 @@ void Foam::CloudFunctionObject::postMove ( const typename CloudType::parcelType&, const label, - const scalar + const scalar, + bool& ) { // do nothing @@ -109,7 +110,8 @@ void Foam::CloudFunctionObject::postPatch const typename CloudType::parcelType&, const polyPatch&, const scalar, - const tetIndices& + const tetIndices&, + bool& ) { // do nothing @@ -120,7 +122,8 @@ template void Foam::CloudFunctionObject::postFace ( const typename CloudType::parcelType&, - const label + const label, + bool& ) { // do nothing diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H index 5baf0f7ae9..976fd3867f 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H @@ -46,6 +46,9 @@ SourceFiles namespace Foam { +class polyPatch; +class tetIndices; + /*---------------------------------------------------------------------------*\ Class CloudFunctionObject Declaration \*---------------------------------------------------------------------------*/ @@ -134,7 +137,8 @@ public: ( const typename CloudType::parcelType& p, const label cellI, - const scalar dt + const scalar dt, + bool& keepParticle ); //- Post-patch hook @@ -143,14 +147,16 @@ public: const typename CloudType::parcelType& p, const polyPatch& pp, const scalar trackFraction, - const tetIndices& testIs + const tetIndices& testIs, + bool& keepParticle ); //- Post-face hook virtual void postFace ( const typename CloudType::parcelType& p, - const label faceI + const label faceI, + bool& keepParticle ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C index 2f97468e36..e0d57b6057 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C @@ -132,12 +132,18 @@ void Foam::CloudFunctionObjectList::postMove ( const typename CloudType::parcelType& p, const label cellI, - const scalar dt + const scalar dt, + bool& keepParticle ) { forAll(*this, i) { - this->operator[](i).postMove(p, cellI, dt); + this->operator[](i).postMove(p, cellI, dt, keepParticle); + + if (!keepParticle) + { + return; + } } } @@ -148,12 +154,25 @@ void Foam::CloudFunctionObjectList::postPatch const typename CloudType::parcelType& p, const polyPatch& pp, const scalar trackFraction, - const tetIndices& tetIs + const tetIndices& tetIs, + bool& keepParticle ) { forAll(*this, i) { - this->operator[](i).postPatch(p, pp, trackFraction, tetIs); + this->operator[](i).postPatch + ( + p, + pp, + trackFraction, + tetIs, + keepParticle + ); + + if (!keepParticle) + { + return; + } } } @@ -162,12 +181,18 @@ template void Foam::CloudFunctionObjectList::postFace ( const typename CloudType::parcelType& p, - const label faceI + const label faceI, + bool& keepParticle ) { forAll(*this, i) { - this->operator[](i).postFace(p, faceI); + this->operator[](i).postFace(p, faceI, keepParticle); + + if (!keepParticle) + { + return; + } } } diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H index 5daeab9f29..de9c3afc02 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H @@ -114,7 +114,8 @@ public: ( const typename CloudType::parcelType& p, const label cellI, - const scalar dt + const scalar dt, + bool& keepParticle ); //- Post-patch hook @@ -123,14 +124,16 @@ public: const typename CloudType::parcelType& p, const polyPatch& pp, const scalar trackFraction, - const tetIndices& tetIs + const tetIndices& tetIs, + bool& keepParticle ); //- Post-face hook virtual void postFace ( const typename CloudType::parcelType& p, - const label faceI + const label faceI, + bool& keepParticle ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C index ae02927bbd..8c64e1b62f 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,7 +133,7 @@ void Foam::FacePostProcessing::write() { OFstream& os = outputFilePtr_[zoneI]; os << time.timeName() << token::TAB << sumMassTotal << token::TAB - << sumMassFlowRate<< endl; + << sumMassFlowRate<< endl; } } @@ -376,7 +376,8 @@ template void Foam::FacePostProcessing::postFace ( const parcelType& p, - const label faceI + const label faceI, + bool& ) { if diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H index 06387d234b..3195b9fc57 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H @@ -160,7 +160,8 @@ public: virtual void postFace ( const parcelType& p, - const label faceI + const label faceI, + bool& keepParticle ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C new file mode 100644 index 0000000000..06f836a3d5 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C @@ -0,0 +1,677 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "ParticleCollector.H" +#include "Pstream.H" +#include "surfaceWriter.H" +#include "unitConversion.H" +#include "Random.H" +#include "triangle.H" +#include "cloud.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::ParticleCollector::makeLogFile +( + const faceList& faces, + const Field& points, + const Field& area +) +{ + // Create the output file if not already created + if (log_) + { + if (debug) + { + Info<< "Creating output file" << endl; + } + + if (Pstream::master()) + { + const fileName logDir = outputDir_/this->owner().time().timeName(); + + // Create directory if does not exist + mkDir(logDir); + + // Open new file at start up + outputFilePtr_.reset + ( + new OFstream(logDir/(type() + ".dat")) + ); + + outputFilePtr_() + << "# Source : " << type() << nl + << "# Total area : " << sum(area) << nl + << "# Time"; + + forAll(faces, i) + { + word id = Foam::name(i); + + outputFilePtr_() + << tab << "area[" << id << "]" + << tab << "mass[" << id << "]" + << tab << "massFlowRate[" << id << "]" + << endl; + } + } + } +} + + +template +void Foam::ParticleCollector::initPolygons() +{ + mode_ = mtPolygon; + + List > polygons(this->coeffDict().lookup("polygons")); + label nPoints = 0; + forAll(polygons, polyI) + { + label np = polygons[polyI].size(); + if (np < 3) + { + FatalIOErrorIn + ( + "Foam::ParticleCollector::initPolygons()", + this->coeffDict() + ) + << "polygons must consist of at least 3 points" + << exit(FatalIOError); + } + + nPoints += np; + } + + label pointOffset = 0; + points_.setSize(nPoints); + faces_.setSize(polygons.size()); + faceTris_.setSize(polygons.size()); + area_.setSize(polygons.size()); + forAll(faces_, faceI) + { + const Field& polyPoints = polygons[faceI]; + face f(identity(polyPoints.size()) + pointOffset); + UIndirectList(points_, f) = polyPoints; + area_[faceI] = f.mag(points_); + + DynamicList tris; + f.triangles(points_, tris); + faceTris_[faceI].transfer(tris); + + faces_[faceI].transfer(f); + + pointOffset += polyPoints.size(); + } +} + + +template +void Foam::ParticleCollector::initConcentricCircles() +{ + mode_ = mtConcentricCircle; + + vector origin(this->coeffDict().lookup("origin")); + + radius_ = this->coeffDict().lookup("radius"); + nSector_ = readLabel(this->coeffDict().lookup("nSector")); + + label nS = nSector_; + + vector refDir; + if (nSector_ > 1) + { + refDir = this->coeffDict().lookup("refDir"); + refDir -= normal_*(normal_ & refDir); + refDir /= mag(refDir); + } + else + { + // set 4 quadrants for single sector cases + nS = 4; + + vector tangent = vector::zero; + scalar magTangent = 0.0; + + Random rnd(1234); + while (magTangent < SMALL) + { + vector v = rnd.vector01(); + + tangent = v - (v & normal_)*normal_; + magTangent = mag(tangent); + } + + refDir = tangent/magTangent; + } + + scalar dTheta = 5.0; + scalar dThetaSector = 360.0/scalar(nS); + label intervalPerSector = max(1, ceil(dThetaSector/dTheta)); + dTheta = dThetaSector/scalar(intervalPerSector); + + label nPointPerSector = intervalPerSector + 1; + + label nPointPerRadius = nS*(nPointPerSector - 1); + label nPoint = radius_.size()*nPointPerRadius; + label nFace = radius_.size()*nS; + + // add origin + nPoint++; + + points_.setSize(nPoint); + faces_.setSize(nFace); + area_.setSize(nFace); + + coordSys_ = cylindricalCS("coordSys", origin, normal_, refDir, false); + + List