From 0af509c22ded00e0d140f34adece08b68e4156f3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 28 Jan 2016 09:00:04 +0000 Subject: [PATCH] BUG: injectors: positions are a global quantity. --- .../porosityModel/porosityModel.H | 21 +++++++++++++++++++ .../FieldActivatedInjection.H | 5 +++-- .../kinematicParcelInjectionDataIOList.C | 8 +++++-- .../kinematicParcelInjectionDataIOList.H | 4 ++-- .../ManualInjection/ManualInjection.H | 5 +++-- .../reactingParcelInjectionDataIOList.C | 8 +++++-- .../reactingParcelInjectionDataIOList.H | 6 +++--- ...ctingMultiphaseParcelInjectionDataIOList.C | 4 ++-- ...ctingMultiphaseParcelInjectionDataIOList.H | 4 ++-- .../thermoParcelInjectionDataIOList.C | 4 ++-- .../thermoParcelInjectionDataIOList.H | 4 ++-- .../searchableSurface/searchableSurface.H | 21 +++++++++++++++++++ .../distributedTriSurfaceMesh.H | 3 ++- 13 files changed, 75 insertions(+), 22 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H index c3f5b838dd..dc5a684593 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H @@ -262,11 +262,32 @@ public: //- Inherit read from regIOobject using regIOobject::read; + //- Is object global + virtual bool global() const + { + return true; + } + + //- Return complete path + object name if the file exists + // either in the case/processor or case otherwise null + virtual fileName filePath() const + { + return globalFilePath(); + } + //- Read porosity dictionary virtual bool read(const dictionary& dict); }; +//- Template function for obtaining global status +template<> +inline bool typeGlobal() +{ + return true; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H index 8e7c7d682d..4c40292998 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,6 +50,7 @@ SourceFiles #include "InjectionModel.H" #include "distributionModel.H" #include "volFieldsFwd.H" +#include "globalIOFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -85,7 +86,7 @@ class FieldActivatedInjection const word positionsFile_; //- Field of injector (x,y,z) positions - vectorIOField positions_; + vectorGlobalIOField positions_; //- List of cell labels corresponding to injector positions labelList injectorCells_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.C index 33aa902898..1abd1feca8 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.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-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,11 @@ License namespace Foam { - defineTemplateTypeNameAndDebug(IOList, 0); + defineTemplateTypeNameAndDebug + ( + GlobalIOList, + 0 + ); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.H index 6d2b964c88..79d2e727a5 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.H @@ -34,14 +34,14 @@ SourceFiles #ifndef kinematicParcelInjectionDataIOList_H #define kinematicParcelInjectionDataIOList_H -#include "IOList.H" +#include "GlobalIOList.H" #include "kinematicParcelInjectionData.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IOList + typedef GlobalIOList kinematicParcelInjectionDataIOList; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H index c9a91e8be6..0169381c6d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,6 +47,7 @@ SourceFiles #include "InjectionModel.H" #include "distributionModel.H" #include "Switch.H" +#include "globalIOFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -68,7 +69,7 @@ class ManualInjection const word positionsFile_; //- Field of parcel positions - vectorIOField positions_; + vectorGlobalIOField positions_; //- Field of parcel diameters scalarList diameters_; diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.C b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.C index a57798c246..d9cf629d5e 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.C +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.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-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,11 @@ License namespace Foam { - defineTemplateTypeNameAndDebug(IOList, 0); + defineTemplateTypeNameAndDebug + ( + GlobalIOList, + 0 + ); } diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.H b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.H index b32453f2a2..f9bbfd2ba9 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.H +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,14 +34,14 @@ SourceFiles #ifndef reactingParcelInjectionDataIOList_H #define reactingParcelInjectionDataIOList_H -#include "IOList.H" +#include "GlobalIOList.H" #include "reactingParcelInjectionData.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IOList + typedef GlobalIOList reactingParcelInjectionDataIOList; } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.C index 4ae1489bf4..cb2ced7321 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.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-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ namespace Foam { defineTemplateTypeNameAndDebug ( - IOList, + GlobalIOList, 0 ); } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.H index a5378cb4bd..b256a84662 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.H @@ -34,14 +34,14 @@ SourceFiles #ifndef reactingMultiphaseParcelInjectionDataIOList_H #define reactingMultiphaseParcelInjectionDataIOList_H -#include "IOList.H" +#include "GlobalIOList.H" #include "reactingMultiphaseParcelInjectionData.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IOList + typedef GlobalIOList reactingMultiphaseParcelInjectionDataIOList; } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.C b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.C index 3ee254ea47..d53c9eb747 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.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-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ License namespace Foam { - defineTemplateTypeNameAndDebug(IOList, 0); + defineTemplateTypeNameAndDebug(GlobalIOList, 0); } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.H b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.H index f38e6ef3ca..93fc9790de 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.H @@ -34,14 +34,14 @@ SourceFiles #ifndef thermoParcelInjectionDataIOList_H #define thermoParcelInjectionDataIOList_H -#include "IOList.H" +#include "GlobalIOList.H" #include "thermoParcelInjectionData.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IOList + typedef GlobalIOList thermoParcelInjectionDataIOList; } diff --git a/src/meshTools/searchableSurface/searchableSurface.H b/src/meshTools/searchableSurface/searchableSurface.H index 32fad48b09..e13751e58f 100644 --- a/src/meshTools/searchableSurface/searchableSurface.H +++ b/src/meshTools/searchableSurface/searchableSurface.H @@ -159,6 +159,19 @@ public: // Member Functions + //- Is object global + virtual bool global() const + { + return true; + } + + //- Return complete path + object name if the file exists + // either in the case/processor or case otherwise null + virtual fileName filePath() const + { + return globalFilePath(); + } + //- Return const reference to boundBox const boundBox& bounds() const { @@ -371,6 +384,14 @@ public: }; +//- Template function for obtaining global status +template<> +inline bool typeGlobal() +{ + return true; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.H b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.H index 05d3c1948a..de1ac18617 100644 --- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.H +++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.H @@ -49,6 +49,7 @@ SourceFiles #define distributedTriSurfaceMesh_H #include "triSurfaceMesh.H" +#include "localIOdictionary.H" #include "IOdictionary.H" #include "Pair.H" #include "globalIndex.H" @@ -101,7 +102,7 @@ private: autoPtr decomposer_; //- Bounding box settings - IOdictionary dict_; + localIOdictionary dict_; //- Bounding boxes of all processors List > procBb_;