diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index bebae9978c..e4475e5d1b 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + Info<< "Creating reaction model\n" << endl; autoPtr reaction diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index be1245708f..a06eef279c 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -52,7 +52,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFieldRefs.H" diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H index 02e1e65b5c..a4b328f367 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + Info<< "Creating reaction model\n" << endl; autoPtr reaction diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C index 006fc6708c..ae94c219a1 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C @@ -53,7 +53,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFieldRefs.H" diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H index c5d3bf6a67..fbd45dd20c 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + Info<< "Creating reaction model\n" << endl; autoPtr reaction diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C index 6b625b638d..55de274d83 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C @@ -53,7 +53,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFieldRefs.H" diff --git a/applications/solvers/compressible/rhoCentralFoam/createFields.H b/applications/solvers/compressible/rhoCentralFoam/createFields.H index d425593810..b7cbdd067f 100644 --- a/applications/solvers/compressible/rhoCentralFoam/createFields.H +++ b/applications/solvers/compressible/rhoCentralFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + Info<< "Reading thermophysical properties\n" << endl; autoPtr pThermo diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C index 972fb96cb9..96413e0201 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C @@ -39,6 +39,8 @@ Description #include "turbulentFluidThermoModel.H" #include "fixedRhoFvPatchScalarField.H" #include "directionInterpolate.H" +#include "localEulerDdtScheme.H" +#include "fvcSmooth.H" #include "motionSolver.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 12af38d9d3..65ab9d2db3 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -54,7 +54,6 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "createFieldRefs.H" #include "createTimeControls.H" - #include "createRDeltaT.H" turbulence->validate(); diff --git a/applications/solvers/compressible/rhoPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPimpleFoam/createFields.H index 8d1ccb82fd..a7ee3eca45 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPimpleFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + Info<< "Reading thermophysical properties\n" << endl; autoPtr pThermo diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C index 9613b4a9a6..c7046bb9b4 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/rhoPimpleDyMFoam.C @@ -57,7 +57,6 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createDynamicFvMesh.H" #include "createControl.H" - #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFieldRefs.H" diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 1bd67653d8..1a74933ea8 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -56,7 +56,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFieldRefs.H" diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H index bf831e93c2..f768c3c8b8 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Global - setInitialDeltaT + setInitialMultiRegionDeltaT Description Set the initial timestep for the CHT MultiRegion solver. @@ -48,7 +48,7 @@ if (adjustTimeStep) min ( min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(), - maxDeltaT + min(runTime.deltaTValue(), maxDeltaT) ) ); Info<< "deltaT = " << runTime.deltaT().value() << endl; diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C index c15fde7078..c9f03a373c 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,13 +63,8 @@ adjointOutletPressureFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF) -{ - fvPatchField::operator= - ( - scalarField("value", dict, p.size()) - ); -} + fixedValueFvPatchScalarField(p, iF, dict) +{} Foam::adjointOutletPressureFvPatchScalarField:: diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C index 31134c955b..7b00d66277 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,10 +50,8 @@ adjointOutletVelocityFvPatchVectorField const dictionary& dict ) : - fixedValueFvPatchVectorField(p, iF) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} + fixedValueFvPatchVectorField(p, iF, dict) +{} Foam::adjointOutletVelocityFvPatchVectorField:: diff --git a/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/DPMTurbulenceModels.C b/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/DPMTurbulenceModels.C index 66b480df0e..ae345c2066 100644 --- a/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/DPMTurbulenceModels.C +++ b/applications/solvers/lagrangian/DPMFoam/DPMTurbulenceModels/DPMTurbulenceModels.C @@ -28,8 +28,8 @@ License #include "addToRunTimeSelectionTable.H" #include "makeTurbulenceModel.H" -#include "laminar.H" -#include "turbulentTransportModel.H" +#include "laminarModel.H" +#include "RASModel.H" #include "LESModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,6 +52,10 @@ makeBaseTurbulenceModel singlePhaseTransportModel ); +#define makeLaminarModel(Type) \ + makeTemplatedTurbulenceModel \ + (singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, laminar, Type) + #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ (singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, RAS, Type) @@ -60,6 +64,9 @@ makeBaseTurbulenceModel makeTemplatedTurbulenceModel \ (singlePhaseTransportModelPhaseIncompressibleTurbulenceModel, LES, Type) +#include "Stokes.H" +makeLaminarModel(Stokes); + #include "kEpsilon.H" makeRASModel(kEpsilon); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index 89d8637462..544cccdae2 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -56,7 +56,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "createFields.H" #include "createFieldRefs.H" #include "createFvOptions.H" diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 33313ca070..d3daf7265c 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + #include "readGravitationalAcceleration.H" Info<< "Creating combustion model\n" << endl; diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options index 8b2729e8c0..014cd4e356 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I. \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I${LIB_SRC}/sampling/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ @@ -25,7 +26,6 @@ EXE_INC = \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(FOAM_SOLVERS)/combustion/reactingFoam - EXE_LIBS = \ -lfiniteVolume \ -lfvOptions \ diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFieldRefs.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFieldRefs.H index 4748421aa4..14914688ca 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFieldRefs.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFieldRefs.H @@ -1 +1,5 @@ const label inertIndex(composition.species()[inertSpecie]); + +const volScalarField& T = thermo.T(); +const volScalarField& psi = thermo.psi(); +filmModelType& surfaceFilm = tsurfaceFilm(); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 313c82d0e2..8ec3c94169 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -37,8 +37,6 @@ volScalarField rho ); volScalarField& p = thermo.p(); -const volScalarField& T = thermo.T(); -const volScalarField& psi = thermo.psi(); Info<< "\nReading field U\n" << endl; volVectorField U diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createSurfaceFilmModel.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createSurfaceFilmModel.H index 1db870f0aa..ffdbcbf6a9 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createSurfaceFilmModel.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createSurfaceFilmModel.H @@ -3,5 +3,3 @@ Info<< "\nConstructing surface film model" << endl; typedef regionModels::surfaceFilmModels::surfaceFilmModel filmModelType; autoPtr tsurfaceFilm(filmModelType::New(mesh, g)); -filmModelType& surfaceFilm = tsurfaceFilm(); - diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index c04c242f45..e5ed566eba 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + #include "readGravitationalAcceleration.H" Info<< "Creating combustion model\n" << endl; diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index 364ab41ece..93768896b3 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -55,7 +55,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "createFields.H" #include "createFieldRefs.H" #include "createFvOptions.H" diff --git a/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C b/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C index 86eabba39e..21f8dfda33 100644 --- a/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C +++ b/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C @@ -28,7 +28,6 @@ License #include "addToRunTimeSelectionTable.H" #include "makeTurbulenceModel.H" -#include "laminar.H" #include "turbulentTransportModel.H" #include "LESModel.H" @@ -50,13 +49,32 @@ makeBaseTurbulenceModel immiscibleIncompressibleTwoPhaseMixture ); +#define makeLaminarModel(Type) \ + makeTemplatedTurbulenceModel \ + ( \ + immiscibleIncompressibleTwoPhaseMixturePhaseCompressibleTurbulenceModel,\ + laminar, \ + Type \ + ) + #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ - (immiscibleIncompressibleTwoPhaseMixturePhaseCompressibleTurbulenceModel, RAS, Type) + ( \ + immiscibleIncompressibleTwoPhaseMixturePhaseCompressibleTurbulenceModel,\ + RAS, \ + Type \ + ) #define makeLESModel(Type) \ makeTemplatedTurbulenceModel \ - (immiscibleIncompressibleTwoPhaseMixturePhaseCompressibleTurbulenceModel, LES, Type) + ( \ + immiscibleIncompressibleTwoPhaseMixturePhaseCompressibleTurbulenceModel,\ + LES, \ + Type \ + ) + +#include "Stokes.H" +makeLaminarModel(Stokes); #include "kEpsilon.H" makeRASModel(kEpsilon); @@ -70,4 +88,5 @@ makeLESModel(kEqn); #include "kOmega.H" makeRASModel(kOmega); + // ************************************************************************* // diff --git a/applications/solvers/multiphase/driftFluxFoam/compressibleTurbulenceModels.C b/applications/solvers/multiphase/driftFluxFoam/compressibleTurbulenceModels.C index 4cb722f5f4..abf89c1500 100644 --- a/applications/solvers/multiphase/driftFluxFoam/compressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/driftFluxFoam/compressibleTurbulenceModels.C @@ -28,7 +28,7 @@ License #include "addToRunTimeSelectionTable.H" #include "makeTurbulenceModel.H" -#include "laminar.H" +#include "laminarModel.H" #include "RASModel.H" #include "LESModel.H" @@ -52,6 +52,14 @@ makeBaseTurbulenceModel incompressibleTwoPhaseInteractingMixture ); +#define makeLaminarModel(Type) \ + makeTemplatedTurbulenceModel \ + ( \ + incompressibleTwoPhaseInteractingMixtureCompressibleTurbulenceModel, \ + laminar, \ + Type \ + ) + #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ ( \ @@ -68,6 +76,9 @@ makeBaseTurbulenceModel Type \ ) +#include "Stokes.H" +makeLaminarModel(Stokes); + #include "kEpsilon.H" makeRASModel(kEpsilon); diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index 77cabdc4c1..4a82afbd29 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + Info<< "Reading field p_rgh\n" << endl; volScalarField p_rgh ( diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index bc4d90fcc5..e53c0395ff 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -63,7 +63,6 @@ int main(int argc, char *argv[]) #include "createControl.H" #include "createTimeControls.H" #include "createDyMControls.H" - #include "createRDeltaT.H" #include "createFields.H" #include "createFvOptions.H" diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 88e31149dd..5f16dfa18d 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -65,7 +65,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFvOptions.H" diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H index 07e174717b..5b152b78a7 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H @@ -1,3 +1,5 @@ +#include "createRDeltaT.H" + Info<< "Reading field p_rgh\n" << endl; volScalarField p_rgh ( diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C index a22a49998c..aa0e55626e 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/interMixingFoam.C @@ -55,7 +55,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" #include "createFvOptions.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C old mode 100755 new mode 100644 diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H old mode 100755 new mode 100644 diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C old mode 100755 new mode 100644 diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H old mode 100755 new mode 100644 index 3003dbc594..bc1601e976 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H @@ -58,6 +58,7 @@ namespace dragModels { class SchillerNaumann; + /*---------------------------------------------------------------------------*\ Class Tenneti Declaration \*---------------------------------------------------------------------------*/ @@ -68,7 +69,7 @@ class Tenneti { // Private data - //- Ergun drag model + //- SchillerNaumann drag model autoPtr SchillerNaumann_; //- Residual Reynolds Number diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H index 8eafafb2fd..1fc5b19ca7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/createFields.H @@ -1,3 +1,4 @@ +#include "createRDeltaT.H" #include "readGravitationalAcceleration.H" #include "readhRef.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C index 083c2567f3..92089901d6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C @@ -27,7 +27,7 @@ License #include "addToRunTimeSelectionTable.H" #include "makeTurbulenceModel.H" -#include "laminar.H" +#include "laminarModel.H" #include "RASModel.H" #include "LESModel.H" @@ -53,6 +53,10 @@ makeBaseTurbulenceModel phaseModel ); +#define makeLaminarModel(Type) \ + makeTemplatedLaminarModel \ + (phaseModelPhaseCompressibleTurbulenceModel, laminar, Type) + #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, RAS, Type) @@ -61,6 +65,9 @@ makeBaseTurbulenceModel makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, LES, Type) +#include "Stokes.H" +makeLaminarModel(Stokes); + #include "kEpsilon.H" makeRASModel(kEpsilon); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C index dcb1a5b112..9807a0ae20 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.C @@ -53,7 +53,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "createFields.H" #include "createFieldRefs.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H index 932c05cb0d..697269ff40 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/createFields.H @@ -1,3 +1,4 @@ +#include "createRDeltaT.H" #include "readGravitationalAcceleration.H" #include "readhRef.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C index cc29d74ad4..40bcc365a0 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/reactingTwoPhaseEulerFoam.C @@ -54,7 +54,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" - #include "createRDeltaT.H" #include "createFields.H" #include "createFieldRefs.H" diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C index bd04977f2b..bcf7911619 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C @@ -27,7 +27,7 @@ License #include "addToRunTimeSelectionTable.H" #include "makeTurbulenceModel.H" -#include "laminar.H" +#include "laminarModel.H" #include "RASModel.H" #include "LESModel.H" @@ -53,6 +53,10 @@ makeBaseTurbulenceModel phaseModel ); +#define makeLaminarModel(Type) \ + makeTemplatedLaminarModel \ + (phaseModelPhaseCompressibleTurbulenceModel, laminar, Type) + #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, RAS, Type) @@ -61,6 +65,9 @@ makeBaseTurbulenceModel makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, LES, Type) +#include "Stokes.H" +makeLaminarModel(Stokes); + #include "kEpsilon.H" makeRASModel(kEpsilon); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C index c60dea0f77..6871136560 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C @@ -32,7 +32,7 @@ License #include "ThermalDiffusivity.H" #include "EddyDiffusivity.H" -#include "laminar.H" +#include "laminarModel.H" #include "RASModel.H" #include "LESModel.H" @@ -58,6 +58,10 @@ makeBaseTurbulenceModel phaseModel ); +#define makeLaminarModel(Type) \ + makeTemplatedLaminarModel \ + (phaseModelPhaseCompressibleTurbulenceModel, laminar, Type) + #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, RAS, Type) @@ -66,6 +70,9 @@ makeBaseTurbulenceModel makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, LES, Type) +#include "Stokes.H" +makeLaminarModel(Stokes); + #include "kEpsilon.H" makeRASModel(kEpsilon); diff --git a/applications/test/NamedEnum/Make/files b/applications/test/NamedEnum/Make/files index 755b72ba5e..a1a7086041 100644 --- a/applications/test/NamedEnum/Make/files +++ b/applications/test/NamedEnum/Make/files @@ -1,3 +1,3 @@ -Test-namedEnum.C +Test-NamedEnum.C EXE = $(FOAM_USER_APPBIN)/Test-NamedEnum diff --git a/applications/test/NamedEnum/Test-NamedEnum.C b/applications/test/NamedEnum/Test-NamedEnum.C new file mode 100644 index 0000000000..63386ed79e --- /dev/null +++ b/applications/test/NamedEnum/Test-NamedEnum.C @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 . + +Description + +\*---------------------------------------------------------------------------*/ + +#include "NamedEnum.H" +#include "IOstreams.H" + +using namespace Foam; + +class namedEnumTest +{ +public: + + enum option + { + a, + b, + c, + d + }; + + static const Foam::NamedEnum namedEnum; +}; + + +template<> +const char* Foam::NamedEnum::names[] = +{ + "a", + "b", + "c", + "d" +}; + +const Foam::NamedEnum namedEnumTest::namedEnum; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + const List options + = namedEnumTest::namedEnum.enums(); + + Info<< "enums: " << options << nl; + + Info<< "loop over enums (as list):" << nl; + forAll(options, i) + { + const namedEnumTest::option& opt = options[i]; + + Info<< "option[" << opt + << "] = '" << namedEnumTest::namedEnum[opt] << "'" << nl; + } + +#if __cplusplus > 201100L + // C++11 + Info<< "loop over enums (C++11 for range):" << nl; + for (auto const& opt : options) + { + Info<< "option[" << opt + << "] = '" << namedEnumTest::namedEnum[opt] << "'" << nl; + } +#else + Info<< "loop over enums (via iterator):" << nl; + forAllConstIter(List, options, iter) + { + const namedEnumTest::option& opt = *iter; + + Info<< "option[" << opt + << "] = '" << namedEnumTest::namedEnum[opt] << "'" << nl; + } +#endif + + Info<< nl + << namedEnumTest::namedEnum["a"] << nl + << namedEnumTest::namedEnum[namedEnumTest::a] << nl; + + Info<< "--- test read construction ---" << endl; + + namedEnumTest::option dummy(namedEnumTest::namedEnum.read(Sin)); + Info<< namedEnumTest::namedEnum[dummy] << endl; + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/dictionary/Test-dictionary.C b/applications/test/dictionary/Test-dictionary.C index 287c63db21..dc55b9902f 100644 --- a/applications/test/dictionary/Test-dictionary.C +++ b/applications/test/dictionary/Test-dictionary.C @@ -48,14 +48,13 @@ int main(int argc, char *argv[]) { dictionary dict; - dict.add("aaOPENMPIcc", 1); + dict.add(word("aa" + getEnv("WM_MPLIB") + "cc"), 16); string s("DDD${aa${WM_MPLIB}cc}EEE"); stringOps::inplaceExpand(s, dict, true, false); Info<< "variable expansion:" << s << endl; } - Info<< nl << "FOAM_CASE=" << getEnv("FOAM_CASE") << nl << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl @@ -65,7 +64,9 @@ int main(int argc, char *argv[]) { { dictionary dict1(IFstream("testDict")()); - Info<< "dict1: " << dict1 << nl + dict1.writeEntry("dict1", Info); + + Info<< nl << "toc: " << dict1.toc() << nl << "keys: " << dict1.keys() << nl << "patterns: " << dict1.keys(true) << endl; @@ -89,14 +90,14 @@ int main(int argc, char *argv[]) << "no = " << dict4.name() << " " << dict4.toc() << endl; } - IOobject::writeDivider(Info); { dictionary dict(IFstream("testDictRegex")()); dict.add(keyType("fooba[rz]", true), "anything"); - Info<< "dict:" << dict << nl + dict.writeEntry("testDictRegex", Info); + Info<< nl << "toc: " << dict.toc() << nl << "keys: " << dict.keys() << nl << "patterns: " << dict.keys(true) << endl; diff --git a/applications/test/fvc2D/Make/files b/applications/test/fvc2D/Make/files new file mode 100644 index 0000000000..ffd2664354 --- /dev/null +++ b/applications/test/fvc2D/Make/files @@ -0,0 +1,3 @@ +Test-fvc2D.C + +EXE = $(FOAM_USER_APPBIN)/Test-fvc2D diff --git a/applications/test/fvc2D/Make/options b/applications/test/fvc2D/Make/options new file mode 100644 index 0000000000..d27c95d033 --- /dev/null +++ b/applications/test/fvc2D/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/test/NamedEnum/Test-namedEnum.C b/applications/test/fvc2D/Test-fvc2D.C similarity index 60% rename from applications/test/NamedEnum/Test-namedEnum.C rename to applications/test/fvc2D/Test-fvc2D.C index 22f3596932..527cfbd3cc 100644 --- a/applications/test/NamedEnum/Test-namedEnum.C +++ b/applications/test/fvc2D/Test-fvc2D.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) 2016 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,55 +21,51 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . +Application + test + Description + Finite volume method test code for 2-D space. \*---------------------------------------------------------------------------*/ -#include "NamedEnum.H" -#include "IOstreams.H" - -using namespace Foam; - -class namedEnumTest -{ -public: - - enum options - { - a, - b, - c - }; - - static const Foam::NamedEnum namedEnum; -}; - - -template<> -const char* Foam::NamedEnum::names[] = -{ - "a", - "b", - "c" -}; - -const Foam::NamedEnum namedEnumTest::namedEnum; - +#include "fvCFD.H" +#include "vector2D.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: +namespace Foam +{ + typedef GeometricField volVector2DField; + + defineTemplate2TypeNameAndDebug(volVector2DField::Internal, 0); + defineTemplateTypeNameAndDebug(volVector2DField, 0); + + typedef fvPatchField fvPatchVector2DField; + makeFvPatchField(fvPatchVector2DField) +} + int main(int argc, char *argv[]) { - Info<< namedEnumTest::namedEnum["a"] << endl; - Info<< namedEnumTest::namedEnum[namedEnumTest::a] << endl; + #include "setRootCase.H" - namedEnumTest::options hmm(namedEnumTest::namedEnum.read(Sin)); - Info<< namedEnumTest::namedEnum[hmm] << endl; + #include "createTime.H" + #include "createMesh.H" - Info<< "End\n" << endl; + GeometricField fld + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); - return 0; + Info<< "end" << endl; } diff --git a/applications/test/string/Test-string.C b/applications/test/string/Test-string.C index f39be8c206..a8276c2926 100644 --- a/applications/test/string/Test-string.C +++ b/applications/test/string/Test-string.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,6 +31,10 @@ Description #include "dictionary.H" #include "IOstreams.H" +#include "int.H" +#include "uint.H" +#include "scalar.H" + using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -118,6 +122,8 @@ int main(int argc, char *argv[]) Info<< "after replace: " << test2 << endl; } + cout<< "\nEnter some string to test:\n"; + string s; Sin.getLine(s); @@ -126,7 +132,39 @@ int main(int argc, char *argv[]) cout<< "output string with " << s2.length() << " characters\n"; cout<< "ostream<< >" << s2 << "<\n"; Info<< "Ostream<< >" << s2 << "<\n"; - Info<< "hash:" << hex << string::hash()(s2) << endl; + Info<< "hash:" << hex << string::hash()(s2) << dec << endl; + + cout<< "\ntest Foam::name()\n"; + + Info<< "hash: = " << Foam::name("0x%012X", string::hash()(s2)) << endl; + + // test formatting on int + { + label val = 25; + Info<<"val: " << val << "\n"; + + Info<< "int " << val << " as word >" + << Foam::name(val) << "< or " + << Foam::name("formatted >%08d<", val) << "\n"; + } + + // test formatting on scalar + { + scalar val = 3.1415926535897931; + Info<< "scalar " << val << " as word >" + << Foam::name(val) << "< or " + << Foam::name("formatted >%.9f<", val) << "\n"; + } + + // test formatting on uint + { + uint64_t val = 25000000ul; + Info<<"val: " << val << "\n"; + + Info<< "uint64 " << val << " as word >" + << Foam::name(val) << "< or " + << Foam::name("formatted >%08d<", val) << "\n"; + } Info<< "\nEnd\n" << endl; return 0; diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C index 245f1175af..65cb4d01b7 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C +++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C @@ -31,7 +31,7 @@ Description Converts a Star-CD (v4) pro-STAR mesh into OpenFOAM format. Usage - \b star4ToFoam [OPTION] ccmMesh + \b star4ToFoam [OPTION] prostarMesh Options: - \par -ascii diff --git a/applications/utilities/mesh/generation/Allwmake b/applications/utilities/mesh/generation/Allwmake index 0869795ef8..4abbf97bc2 100755 --- a/applications/utilities/mesh/generation/Allwmake +++ b/applications/utilities/mesh/generation/Allwmake @@ -8,10 +8,6 @@ wmake -all $targetType extrude wmake -all $targetType extrude2DMesh wmake -all $targetType snappyHexMesh -if [ -n "$FOAMY_HEX_MESH" ] -then - foamyMesh/Allwmake $targetType $* -fi - +foamyMesh/Allwmake $targetType $* #------------------------------------------------------------------------------ diff --git a/applications/utilities/mesh/generation/blockMesh/blockMesh.C b/applications/utilities/mesh/generation/blockMesh/blockMesh.C index 72ca0b1b2a..31761f4009 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMesh.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMesh.C @@ -86,6 +86,27 @@ int main(int argc, char *argv[]) "specify alternative dictionary for the blockMesh description" ); + argList::addNote + ( + "Block description\n" + "\n" + " For a given block, the correspondence between the ordering of\n" + " vertex labels and face labels is shown below.\n" + " For vertex numbering in the sequence 0 to 7 (block, centre):\n" + " faces 0 (f0) and 1 are left and right, respectively;\n" + " faces 2 and 3 are bottom and top;\n" + " and faces 4 and 5 are front the back:\n" + "\n" + " 4 ---- 5\n" + " f3 |\\ |\\ f5\n" + " | | 7 ---- 6 \\\n" + " | 0 |--- 1 | \\\n" + " | \\| \\| f4\n" + " f2 3 ---- 2\n" + "\n" + " f0 ----- f1\n" + ); + #include "addRegionOption.H" #include "setRootCase.H" #include "createTime.H" diff --git a/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options b/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options index f9a4d17aaf..aa1ba3b9bb 100644 --- a/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options @@ -25,8 +25,6 @@ EXE_INC = \ EXE_LIBS = \ $(CGAL_LIBS) \ - -lmpfr \ - -lboost_thread \ -lconformalVoronoiMesh \ -lfiniteVolume \ -lmeshTools \ diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C index 4283fb7c35..343ba46a6e 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C @@ -97,7 +97,7 @@ Foam::scalarField Foam::cellShapeControl::cellSize Foam::scalar Foam::cellShapeControl::cellSize(const point& pt) const { - scalarList bary; + FixedList bary; cellShapeControlMesh::Cell_handle ch; shapeControlMesh_.barycentricCoords(pt, bary, ch); @@ -172,7 +172,7 @@ Foam::scalar Foam::cellShapeControl::cellSize(const point& pt) const Foam::tensor Foam::cellShapeControl::cellAlignment(const point& pt) const { - scalarList bary; + FixedList bary; cellShapeControlMesh::Cell_handle ch; shapeControlMesh_.barycentricCoords(pt, bary, ch); @@ -244,7 +244,7 @@ void Foam::cellShapeControl::cellSizeAndAlignment tensor& alignment ) const { - scalarList bary; + FixedList bary; cellShapeControlMesh::Cell_handle ch; shapeControlMesh_.barycentricCoords(pt, bary, ch); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C index 32afeaa491..965a89996e 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C @@ -450,7 +450,7 @@ Foam::cellShapeControlMesh::~cellShapeControlMesh() void Foam::cellShapeControlMesh::barycentricCoords ( const Foam::point& pt, - scalarList& bary, + FixedList& bary, Cell_handle& ch ) const { diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H index 3546c03d9e..7e4bc9041c 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,7 +122,7 @@ public: void barycentricCoords ( const Foam::point& pt, - scalarList& bary, + FixedList& bary, Cell_handle& ch ) const; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/fileControl/fileControl.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/fileControl/fileControl.C index b2ed90169f..a644134066 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/fileControl/fileControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/fileControl/fileControl.C @@ -94,7 +94,7 @@ Foam::fileControl::~fileControl() // //Foam::scalar Foam::fileControl::cellSize(const point& pt) const //{ -// scalarList bary; +// FixedList bary; // Cell_handle ch; // // triangulatedMesh_.barycentricCoords(pt, bary, ch); @@ -112,7 +112,7 @@ Foam::fileControl::~fileControl() ////- Return the cell alignment at the given location //Foam::tensor Foam::fileControl::cellAlignment(const point& pt) const //{ -// scalarList bary; +// FixedList bary; // Cell_handle ch; // // triangulatedMesh_.barycentricCoords(pt, bary, ch); @@ -144,7 +144,7 @@ Foam::fileControl::~fileControl() // tensor& alignment //) const //{ -// scalarList bary; +// FixedList bary; // Cell_handle ch; // // triangulatedMesh_.barycentricCoords(pt, bary, ch); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.C index 5288541538..a478f9e513 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,8 +118,7 @@ Foam::scalar Foam::nonUniformField::interpolate pts[faceHitByPt[2]] ); - scalarList bary(3, 0.0); - + FixedList bary; tri.barycentric(pt, bary); // return pointCellSize_[pMap[faceHitByPt[0]]]*bary[0] diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options index c7c5ebdb07..625763f597 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options @@ -22,9 +22,6 @@ EXE_INC = \ EXE_LIBS = \ $(CGAL_LIBS) \ - -lboost_thread \ - -lmpfr \ - -lgmp \ -lconformalVoronoiMesh \ -ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \ -ldecompose \ diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C index f7e561f43d..5e009ea114 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -640,11 +640,14 @@ int main(int argc, char *argv[]) geometry, surfaces ); + // Patch fields + volScalarField::Boundary& cellDistanceBf = + cellDistance.boundaryFieldRef(); forAll(fvm.C().boundaryField(), patchi) { const pointField& cc = fvm.C().boundaryField()[patchi]; - fvPatchScalarField& fld = cellDistance.boundaryField()[patchi]; + fvPatchScalarField& fld = cellDistanceBf[patchi]; scalarField patchDistSqr ( fld.patch().patchInternalField(distSqr) diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options index 5cb1f8676d..1a24c89f70 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options @@ -16,8 +16,6 @@ EXE_INC = \ EXE_LIBS = \ $(CGAL_LIBS) \ - -lboost_thread \ - -lmpfr \ -L$(FASTDUALOCTREE_SRC_PATH) -lperf_main \ -lGL \ -lconformalVoronoiMesh \ diff --git a/applications/utilities/miscellaneous/foamList/Make/options b/applications/utilities/miscellaneous/foamList/Make/options index 441805c465..84027a1c28 100644 --- a/applications/utilities/miscellaneous/foamList/Make/options +++ b/applications/utilities/miscellaneous/foamList/Make/options @@ -6,7 +6,8 @@ EXE_INC = \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lbarotropicCompressibilityModel \ diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index cab70e7076..62723280b3 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -39,34 +39,34 @@ Usage Write the cell distribution as a labelList, for use with 'manual' decomposition method or as a volScalarField for post-processing. - - \par -region \ \n + - \par -region \ Decompose named region. Does not check for existence of processor*. - - \par -allRegions \n + - \par -allRegions Decompose all regions in regionProperties. Does not check for existence of processor*. - - \par -copyUniform \n + - \par -copyUniform Copy any \a uniform directories too. - \par -constant - - \par -time xxx:yyy \n + - \par -time xxx:yyy Override controlDict settings and decompose selected times. Does not re-decompose the mesh i.e. does not handle moving mesh or changing mesh cases. - - \par -fields \n + - \par -fields Use existing geometry decomposition and convert fields only. - - \par -noSets \n + - \par -noSets Skip decomposing cellSets, faceSets, pointSets. - - \par -force \n + - \par -force Remove any existing \a processor subdirectories before decomposing the geometry. - - \par -ifRequired \n + - \par -ifRequired Only decompose the geometry if the number of domains has changed from a previous decomposition. No \a processor subdirectories will be removed unless the \a -force option is also specified. This option can be used diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C index 274e3a51a3..efb7dd2a23 100644 --- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C +++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C @@ -42,7 +42,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer ) : procMesh_(procMesh), - positions_(procMesh, cloudName, false), + positions_(procMesh, cloudName, IDLList()), particleIndices_(lagrangianPositions.size()) { label pi = 0; diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H index 6e0280398d..aca0672296 100644 --- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H +++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H @@ -101,7 +101,6 @@ public: const label cloudI, const IOobjectList& lagrangianObjects, PtrList>>& lagrangianFields -// PtrList>& lagrangianFields ); template @@ -113,7 +112,6 @@ public: < PtrList, Type>> >& lagrangianFields -// PtrList, Type >>& lagrangianFields ); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files index 44c513a079..421e8392b8 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files @@ -1,6 +1,5 @@ -itoa.C ensightMesh.C -ensightParticlePositions.C +ensightCloud.C foamToEnsight.C EXE = $(FOAM_APPBIN)/foamToEnsight diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options index 2a683c0529..e2fc5311ff 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/options @@ -4,11 +4,13 @@ EXE_INC = \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/conversion/lnInclude EXE_LIBS = \ -ldynamicMesh \ -lfileFormats \ -lsampling \ -lgenericPatchFields \ - -llagrangian + -llagrangian \ + -lconversion diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H index 47a3540da7..50e78e781c 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H @@ -1,21 +1,33 @@ -// ignore special fields or fields that we don't handle -// -bool variableGood = true; -for (label n1=0; n1 2 && fieldName(fieldName.size() - 2, 2) == "_0") + bool variableGood = false; + + forAll(timeDirs, n1) { - variableGood = false; - } - else - { - variableGood = IOobject + variableGood = ( - fieldName, - Times[n1].name(), - mesh, - IOobject::NO_READ - ).typeHeaderOk(false); + fieldName.size() > 2 && fieldName(fieldName.size()-2, 2) == "_0" + ? false + : IOobject + ( + fieldName, + timeDirs[n1].name(), + mesh, + IOobject::NO_READ + ).typeHeaderOk(false) + ); + + if (variableGood) + { + break; + } } + + reduce(variableGood, andOp()); + fieldsToUse.set(fieldName, variableGood); } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H index d4027ad1c5..bda9220acb 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H @@ -1,27 +1,50 @@ // check for "points" in any of the result directories bool meshMoving = false; -if (Times.size() > 1) + +if (timeDirs.size() > 1 && Pstream::master()) { - // We already loaded a mesh (usually from constant). See if any other - // points files - forAll(Times, timeI) + // We already loaded a mesh (usually from constant). + // See if any other "polyMesh/points" files exist too. + + const fileName& baseDir = mesh.time().path(); + + Info<< "Search for moving mesh ... " << flush; + forAll(timeDirs, timeI) { - if (Times[timeI].name() != mesh.pointsInstance()) - { - IOobject io + const word& timeName = timeDirs[timeI].name(); + + meshMoving = + ( + timeName != mesh.pointsInstance() + && isDir(baseDir/timeName/polyMesh::meshSubDir) + && IOobject ( "points", - Times[timeI].name(), + timeName, polyMesh::meshSubDir, mesh, - IOobject::NO_READ - ); - if (io.typeHeaderOk(true)) - { - meshMoving = true; - break; - } + IOobject::NO_READ, + IOobject::NO_WRITE, + false // no register + ).typeHeaderOk(true) + ); + + if (meshMoving) + { + break; } } + + if (meshMoving) + { + Info<< "found." << nl + << " Writing meshes for every timestep." << endl; + } + else + { + Info<< "none detected." << endl; + } } + +reduce(meshMoving, orOp()); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H index 68eb88e158..ceccc987ae 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,17 +52,17 @@ class ensightAsciiStream { // Private data - //- Description of data_ + //- Output file stream OFstream str_; // Private Member Functions //- Disallow default bitwise copy construct - ensightAsciiStream(const ensightAsciiStream&); + ensightAsciiStream(const ensightAsciiStream&) = delete; //- Disallow default bitwise assignment - void operator=(const ensightAsciiStream&); + void operator=(const ensightAsciiStream&) = delete; public: @@ -70,14 +70,14 @@ public: // Constructors //- Construct from components - ensightAsciiStream(const fileName& f, const Time& runTime) + ensightAsciiStream(const fileName& f) : ensightStream(f), str_ ( f, - runTime.writeFormat(), - runTime.writeVersion(), + IOstream::ASCII, + IOstream::currentVersion, IOstream::UNCOMPRESSED ) { @@ -139,14 +139,6 @@ public: << setw(10) << partI << nl; } - // Member Operators - - // Friend Functions - - // Friend Operators - - // IOstream Operators - }; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H index d343567722..d1c3d6e3b3 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H @@ -51,17 +51,17 @@ class ensightBinaryStream { // Private data - //- Description of data_ + //- Output file stream autoPtr str_; // Private Member Functions //- Disallow default bitwise copy construct - ensightBinaryStream(const ensightBinaryStream&); + ensightBinaryStream(const ensightBinaryStream&) = delete; //- Disallow default bitwise assignment - void operator=(const ensightBinaryStream&); + void operator=(const ensightBinaryStream&) = delete; public: @@ -69,7 +69,7 @@ public: // Constructors //- Construct from components - ensightBinaryStream(const fileName& f, const Time&) + ensightBinaryStream(const fileName& f) : ensightStream(f), str_ @@ -90,11 +90,6 @@ public: // Member Functions - virtual bool ascii() const - { - return false; - } - virtual void write(const char* val) { char buffer[80]; @@ -141,14 +136,6 @@ public: write(partI); } - // Member Operators - - // Friend Functions - - // Friend Operators - - // IOstream Operators - }; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H index 6ec8373fcf..5a18a953c7 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H @@ -1,5 +1,8 @@ if (Pstream::master()) { + ensightCaseFile.setf(ios_base::scientific, ios_base::floatfield); + ensightCaseFile.precision(5); + ensightCaseFile << nl << "TIME" << nl << "time set: " << 1 << nl << "number of steps: " << nTimeSteps << nl @@ -8,20 +11,17 @@ if (Pstream::master()) ensightCaseFile << "time values:" << nl; - ensightCaseFile.setf(ios_base::scientific, ios_base::floatfield); - ensightCaseFile.precision(5); - label count = 0; scalar Tcorr = 0.0; - if (Times[0].value() < 0) + if (timeDirs[0].value() < 0) { - Tcorr = - Times[0].value(); + Tcorr = -timeDirs[0].value(); Info<< "Correcting time values. Adding " << Tcorr << endl; } - forAll(Times, n) + forAll(timeDirs, n) { - ensightCaseFile << setw(12) << Times[n].value() + Tcorr << " "; + ensightCaseFile << setw(12) << timeDirs[n].value() + Tcorr << " "; if (++count % 6 == 0) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloud.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloud.C new file mode 100644 index 0000000000..08779ff0a8 --- /dev/null +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCloud.C @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. +------------------------------------------------------------------------------- +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 "ensightCloud.H" +#include "ensightFile.H" +#include "fvMesh.H" +#include "passiveParticle.H" +#include "Cloud.H" +#include "pointList.H" + +// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // + +void Foam::ensightParticlePositions +( + const fvMesh& mesh, + const fileName& dataDir, + const label timeIndex, + const word& cloudName, + const bool dataExists, + IOstream::streamFormat format +) +{ + if (dataExists) + { + Info<< " positions"; + } + else + { + Info<< " positions{0}"; + } + + // Total number of parcels on all processes + label nTotParcels = 0; + autoPtr> cloudPtr; + + if (dataExists) + { + cloudPtr.reset(new Cloud(mesh, cloudName, false)); + nTotParcels = cloudPtr().size(); + } + reduce(nTotParcels, sumOp