diff --git a/src/lagrangian/basic/particle/particle.H b/src/lagrangian/basic/particle/particle.H index 8ab17472d0..51f008e2d1 100644 --- a/src/lagrangian/basic/particle/particle.H +++ b/src/lagrangian/basic/particle/particle.H @@ -41,6 +41,7 @@ Description #include "tetrahedron.H" #include "FixedList.H" #include "polyMeshTetDecomposition.H" +#include "particleMacros.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -284,7 +285,7 @@ public: TypeName("particle"); //- String representation of properties - static string propHeader; + DefinePropertyList("(Px Py Pz) cellI tetFaceI tetPtI origProc origId"); //- Cumulative particle counter - used to provode unique ID static label particleCount_; @@ -554,13 +555,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "particleI.H" -/* -#define defineParticleTypeNameAndDebug(Type, DebugSwitch) \ - template<> \ - const Foam::word Particle::typeName(#Type); \ - template<> \ - int Particle::debug(Foam::debug::debugSwitch(#Type, DebugSwitch)); -*/ + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/basic/particle/particleIO.C b/src/lagrangian/basic/particle/particleIO.C index 4361b20933..6484cf07a0 100644 --- a/src/lagrangian/basic/particle/particleIO.C +++ b/src/lagrangian/basic/particle/particleIO.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 @@ -29,8 +29,7 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -Foam::string Foam::particle::propHeader = - "(Px Py Pz) cellI tetFaceI tetPtI origProc origId"; +Foam::string Foam::particle::propertyList_ = Foam::particle::propertyList(); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/basic/particle/particleMacros.H b/src/lagrangian/basic/particle/particleMacros.H new file mode 100644 index 0000000000..2e46f2a747 --- /dev/null +++ b/src/lagrangian/basic/particle/particleMacros.H @@ -0,0 +1,68 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +InClass + Foam::particle + +Description + Macros for adding to particle property lists + +\*---------------------------------------------------------------------------*/ + +#ifndef particleMacros_H +#define particleMacros_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define DefinePropertyList(str) \ + \ + static string propertyList_; \ + \ + static string propertyList() \ + { \ + return str; \ + } + + +#define AddToPropertyList(ParcelType, str) \ + \ + static string propertyList_; \ + \ + static string propertyList() \ + { \ + return ParcelType::propertyList() + str; \ + } + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H b/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H index fdee6e6280..5d6f6ca3e0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.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 @@ -66,7 +66,7 @@ Ostream& operator<< ); /*---------------------------------------------------------------------------*\ - Class CollidingParcel Declaration + Class CollidingParcel Declaration \*---------------------------------------------------------------------------*/ template @@ -86,12 +86,22 @@ public: // Static data members - //- String representation of properties - static string propHeader; - //- Runtime type information TypeName("CollidingParcel"); + //- String representation of properties + AddToPropertyList + ( + ParcelType, + " collisionRecordsPairAccessed" + + " collisionRecordsPairOrigProcOfOther" + + " collisionRecordsPairOrigIdOfOther" + + " (collisionRecordsPairData)" + + " collisionRecordsWallAccessed" + + " collisionRecordsWallPRel" + + " (collisionRecordsWallData)" + ); + // Constructors diff --git a/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcelIO.C index ec94fd3759..90846259e8 100644 --- a/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcelIO.C @@ -30,15 +30,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -Foam::string Foam::CollidingParcel::propHeader = - ParcelType::propHeader - + " collisionRecordsPairAccessed" - + " collisionRecordsPairOrigProcOfOther" - + " collisionRecordsPairOrigIdOfOther" - + " (collisionRecordsPairData)" - + " collisionRecordsWallAccessed" - + " collisionRecordsWallPRel" - + " (collisionRecordsWallData)"; +Foam::string Foam::CollidingParcel::propertyList_ = + Foam::CollidingParcel::propertyList(); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index c4ef66572f..4d7af077d4 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.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 @@ -319,12 +319,28 @@ public: // Static data members - //- String representation of properties - static string propHeader; - //- Runtime type information TypeName("KinematicParcel"); + //- String representation of properties + AddToPropertyList + ( + ParcelType, + " active" + + " typeId" + + " nParticle" + + " d" + + " dTarget " + + " (Ux Uy Uz)" + + " (fx fy fz)" + + " (angularMomentumx angularMomentumy angularMomentumz)" + + " (torquex torquey torquez)" + + " rho" + + " age" + + " tTurb" + + " (UTurbx UTurby UTurbz)" + ); + // Constructors diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C index add7b1b78f..6dee6a42be 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.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 @@ -31,21 +31,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -Foam::string Foam::KinematicParcel::propHeader = - ParcelType::propHeader - + " active" - + " typeId" - + " nParticle" - + " d" - + " dTarget " - + " (Ux Uy Uz)" - + " (fx fy fz)" - + " (angularMomentumx angularMomentumy angularMomentumz)" - + " (torquex torquey torquez)" - + " rho" - + " age" - + " tTurb" - + " (UTurbx UTurby UTurbz)"; +Foam::string Foam::KinematicParcel::propertyList_ = + Foam::KinematicParcel::propertyList(); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index 749b31c1a4..6707b2a52d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.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 @@ -239,12 +239,18 @@ public: // Static data members - //- String representation of properties - static string propHeader; - //- Runtime type information TypeName("ReactingMultiphaseParcel"); + //- String representation of properties + AddToPropertyList + ( + ParcelType, + " nGas(Y1..YN)" + + " nLiquid(Y1..YN)" + + " nSolid(Y1..YN)" + ); + // Constructors diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C index 66d6095ae4..fa1e6e0428 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.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 @@ -29,11 +29,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -Foam::string Foam::ReactingMultiphaseParcel::propHeader = - ParcelType::propHeader - + " nGas(Y1..YN)" - + " nLiquid(Y1..YN)" - + " nSolid(Y1..YN)"; +Foam::string Foam::ReactingMultiphaseParcel::propertyList_ = + Foam::ReactingMultiphaseParcel::propertyList(); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index 4c79461587..230a4c1cd3 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.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 @@ -239,12 +239,17 @@ public: // Static data members - //- String representation of properties - static string propHeader; - //- Runtime type information TypeName("ReactingParcel"); + //- String representation of properties + AddToPropertyList + ( + ParcelType, + " mass0" + + " nPhases(Y1..YN)" + ); + // Constructors diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C index 159b70c082..918ebdde6a 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.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 @@ -29,10 +29,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -Foam::string Foam::ReactingParcel::propHeader = - ParcelType::propHeader - + " mass0" - + " nPhases(Y1..YN)"; +Foam::string Foam::ReactingParcel::propertyList_ = + Foam::ReactingParcel::propertyList(); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H index a5b6af68f2..e7b5a14a49 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.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 @@ -264,12 +264,17 @@ public: // Static data members - //- String representation of properties - static string propHeader; - //- Runtime type information TypeName("ThermoParcel"); + //- String representation of properties + AddToPropertyList + ( + ParcelType, + " T" + + " Cp" + ); + // Constructors diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C index 08422c3a9d..7009e577ec 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.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 @@ -29,10 +29,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -Foam::string Foam::ThermoParcel::propHeader = - ParcelType::propHeader - + " T" - + " Cp"; +Foam::string Foam::ThermoParcel::propertyList_ = + Foam::ThermoParcel::propertyList(); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C index b2e878055c..afbd9bfbd9 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C @@ -115,7 +115,7 @@ void Foam::PatchPostProcessing::write() labelList indices; sortedOrder(globalTimes, indices); - string header("# Time currentProc " + parcelType::propHeader); + string header("# Time currentProc " + parcelType::propertyList_); patchOutFile<< header.c_str() << nl; forAll(globalTimes, i)