From 578d734a3f59b09051d91ab76bf6faa4bab1bb28 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 1 May 2008 12:58:17 +0100 Subject: [PATCH 01/13] updated lagrangian and radiation libraries --- src/lagrangian/Allwmake | 1 - src/lagrangian/basic/Cloud/Cloud.C | 2 - src/lagrangian/basic/Cloud/Cloud.H | 13 +- src/lagrangian/basic/Cloud/CloudIO.C | 2 - src/lagrangian/basic/IOPosition/IOPosition.C | 2 + src/lagrangian/basic/Particle/Particle.C | 61 ++--- src/lagrangian/basic/Particle/Particle.H | 159 ++++++------ src/lagrangian/basic/Particle/ParticleI.H | 13 +- .../basic/indexedParticle/indexedParticle.H | 1 - .../indexedParticle/indexedParticleCloud.C | 2 + .../basic/lagrangianField/LagrangianField.H | 1 - .../basic/passiveParticle/passiveParticle.H | 1 - .../passiveParticle/passiveParticleCloud.C | 2 + .../basic/polyMeshInfo/polyMeshInfo.H | 2 +- .../IntegrationScheme/Analytical/Analytical.C | 65 +++++ .../IntegrationScheme/Analytical/Analytical.H | 101 ++++++++ .../IntegrationScheme/Euler/Euler.C | 65 +++++ .../IntegrationScheme/Euler/Euler.H | 101 ++++++++ .../IntegrationScheme/IntegrationScheme.C | 54 +++++ .../IntegrationScheme/IntegrationScheme.H | 169 +++++++++++++ .../IntegrationScheme/IntegrationSchemesFwd.H | 59 +++++ .../IntegrationScheme/newIntegrationScheme.C | 65 +++++ .../makeIntegrationSchemes.C | 46 ++++ src/lagrangian/intermediate/Make/files | 3 + .../Templates/KinematicCloud/KinematicCloud.C | 69 ++++-- .../Templates/KinematicCloud/KinematicCloud.H | 39 ++- .../KinematicCloud/KinematicCloudI.H | 80 ++++-- .../Templates/ReactingCloud/ReactingCloud.C | 73 ++++-- .../Templates/ReactingCloud/ReactingCloud.H | 11 +- .../Templates/ReactingCloud/ReactingCloudI.H | 14 +- .../ReactingCloud/ReactingCloudThermoTypes.H | 2 +- .../Templates/ThermoCloud/ThermoCloud.C | 182 ++++---------- .../Templates/ThermoCloud/ThermoCloud.H | 20 +- .../Templates/ThermoCloud/ThermoCloudI.H | 151 ++++++++---- .../basicReactingCloud/basicReactingCloud.H | 1 - .../basicThermoCloud/basicThermoCloud.H | 1 - .../KinematicParcel/KinematicParcel.C | 155 ++++++------ .../KinematicParcel/KinematicParcel.H | 223 +++++++++-------- .../KinematicParcel/KinematicParcelI.H | 46 ++-- .../KinematicParcel/KinematicParcelIO.C | 23 +- .../Templates/ReactingParcel/ReactingParcel.C | 227 ++++++------------ .../Templates/ReactingParcel/ReactingParcel.H | 213 ++++++++-------- .../ReactingParcel/ReactingParcelI.H | 17 +- .../ReactingParcel/ReactingParcelIO.C | 3 +- .../Templates/ThermoParcel/ThermoParcel.C | 227 ++++++------------ .../Templates/ThermoParcel/ThermoParcel.H | 183 ++++++-------- .../Templates/ThermoParcel/ThermoParcelI.H | 18 +- .../Templates/ThermoParcel/ThermoParcelIO.C | 4 +- .../derived/kinematicParcel/kinematicParcel.H | 2 +- .../derived/reactingParcel/reactingParcel.H | 2 +- .../derived/thermoParcel/thermoParcel.H | 2 +- .../DispersionModel/DispersionModel.H | 1 - .../DispersionRASModel/DispersionRASModel.H | 4 - .../GradientDispersionRAS.H | 2 +- .../StochasticDispersionRAS.C | 2 + .../StochasticDispersionRAS.H | 7 +- .../Kinematic/DragModel/DragModel/DragModel.H | 6 +- .../Kinematic/DragModel/NoDrag/NoDrag.H | 5 +- .../DragModel/SphereDrag/SphereDrag.H | 5 +- .../InjectionModel/InjectionModel.H | 1 + .../ManualInjection/ManualInjection.C | 2 +- .../ManualInjection/ManualInjection.H | 8 +- .../WallInteractionModel.H | 1 + .../CompositionModel/CompositionModel.H | 4 +- .../SingleMixtureFraction.H | 1 - .../MassTransferModel/MassTransferModel.H | 1 + .../SurfaceReactionModel.H | 1 + .../HeatTransferModel/HeatTransferModel.H | 1 + .../cloudAbsorptionEmission.C | 6 +- .../cloudAbsorptionEmission.H | 24 +- .../scatter/cloudScatter/cloudScatter.H | 2 +- src/thermophysicalModels/radiation/Make/files | 4 +- .../MarshakRadiationMixedFvPatchScalarField.C | 0 .../MarshakRadiationMixedFvPatchScalarField.H | 0 ...akRadiationFixedTMixedFvPatchScalarField.C | 0 ...akRadiationFixedTMixedFvPatchScalarField.H | 0 .../radiation/radiationModel/P1/P1.C | 29 ++- .../radiation/radiationModel/P1/P1.H | 4 +- .../radiationModel/noRadiation/noRadiation.C | 18 +- .../radiationModel/noRadiation/noRadiation.H | 4 +- .../radiationModel/newRadiationModel.C | 11 +- .../radiationModel/radiationModel.C | 25 +- .../radiationModel/radiationModel.H | 21 +- .../absorptionEmissionModel.C | 161 +++++++++++++ .../absorptionEmissionModel.H | 44 +++- .../binaryAbsorptionEmission.C | 36 ++- .../binaryAbsorptionEmission.H | 31 ++- .../constantAbsorptionEmission.C | 7 +- .../constantAbsorptionEmission.H | 25 +- .../noAbsorptionEmission.C | 71 ------ .../noAbsorptionEmission.H | 22 -- 91 files changed, 2184 insertions(+), 1391 deletions(-) create mode 100644 src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.C create mode 100644 src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.H create mode 100644 src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.C create mode 100644 src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.H create mode 100644 src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.C create mode 100644 src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.H create mode 100644 src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemesFwd.H create mode 100644 src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C create mode 100644 src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C rename src/thermophysicalModels/radiation/{boundaryConditions => derivedFvPatchFields}/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C (100%) rename src/thermophysicalModels/radiation/{boundaryConditions => derivedFvPatchFields}/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.H (100%) rename src/thermophysicalModels/radiation/{boundaryConditions => derivedFvPatchFields}/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C (100%) rename src/thermophysicalModels/radiation/{boundaryConditions => derivedFvPatchFields}/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.H (100%) diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake index 4dae508c2f..b3ab633899 100755 --- a/src/lagrangian/Allwmake +++ b/src/lagrangian/Allwmake @@ -3,6 +3,5 @@ set -x wmake libso basic wmake libso solidParticle -wmake libso basic wmake libso intermediate wmake libso dieselSpray diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index 84f4716203..fffa0506f8 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -43,7 +43,6 @@ Foam::Cloud::Cloud cloud(pMesh), IDLList(particles), polyMesh_(pMesh), - cloudName_("defaultCloud"), allFaces_(pMesh.faces()), points_(pMesh.points()), cellFaces_(pMesh.cells()), @@ -65,7 +64,6 @@ Foam::Cloud::Cloud cloud(pMesh, cloudName), IDLList(particles), polyMesh_(pMesh), - cloudName_(cloudName), allFaces_(pMesh.faces()), points_(pMesh.points()), cellFaces_(pMesh.cells()), diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index f5e70593f3..c26c592fe0 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -26,7 +26,6 @@ Class Foam::Cloud Description - Foam::Cloud SourceFiles Cloud.C @@ -74,7 +73,6 @@ class Cloud // Private data const polyMesh& polyMesh_; - const word cloudName_; const faceList& allFaces_; const vectorField& points_; const cellList& cellFaces_; @@ -152,12 +150,6 @@ public: return polyMesh_; } - //- Return the cloud name reference - const word& cloudName() const - { - return cloudName_; - } - //- Is this global face an internal face? bool internalFace(const label facei) const { @@ -213,6 +205,11 @@ public: return IDLList::end(); }; + void clear() + { + return IDLList::clear(); + }; + // Edit diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C index a6e03579aa..ef67531fca 100644 --- a/src/lagrangian/basic/Cloud/CloudIO.C +++ b/src/lagrangian/basic/Cloud/CloudIO.C @@ -60,7 +60,6 @@ Foam::Cloud::Cloud : cloud(pMesh), polyMesh_(pMesh), - cloudName_("defaultCloud"), allFaces_(pMesh.faces()), points_(pMesh.points()), cellFaces_(pMesh.cells()), @@ -83,7 +82,6 @@ Foam::Cloud::Cloud : cloud(pMesh, cloudName), polyMesh_(pMesh), - cloudName_(cloudName), allFaces_(pMesh.faces()), points_(pMesh.points()), cellFaces_(pMesh.cells()), diff --git a/src/lagrangian/basic/IOPosition/IOPosition.C b/src/lagrangian/basic/IOPosition/IOPosition.C index 89d94169d1..09cda64c36 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.C +++ b/src/lagrangian/basic/IOPosition/IOPosition.C @@ -22,6 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Description + \*---------------------------------------------------------------------------*/ #include "IOPosition.H" diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index 68266a631b..98ca9669d1 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -39,7 +39,7 @@ template Foam::labelList Foam::Particle::findFaces ( const vector& position -) +) const { const polyMesh& mesh = cloud_.polyMesh_; const labelList& faces = mesh.cells()[celli_]; @@ -69,7 +69,7 @@ Foam::labelList Foam::Particle::findFaces const vector& position, const label celli, const scalar stepFraction -) +) const { const polyMesh& mesh = cloud_.polyMesh_; const labelList& faces = mesh.cells()[celli]; @@ -94,11 +94,11 @@ Foam::labelList Foam::Particle::findFaces template -template +template void Foam::Particle::prepareForParallelTransfer ( const label patchi, - TrackingData& td + TrackData& td ) { // Convert the face index to be local to the processor patch @@ -107,11 +107,11 @@ void Foam::Particle::prepareForParallelTransfer template -template +template void Foam::Particle::correctAfterParallelTransfer ( const label patchi, - TrackingData& td + TrackData& td ) { const processorPolyPatch& ppp = @@ -156,7 +156,15 @@ void Foam::Particle::correctAfterParallelTransfer } // Reset the face index for the next tracking operation - facei_ = -1; + if (stepFraction_ > (1.0 - SMALL)) + { + stepFraction_ = 1.0; + facei_ = -1; + } + else + { + facei_ += ppp.start(); + } } @@ -181,11 +189,11 @@ Foam::Particle::Particle // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -template +template Foam::label Foam::Particle::track ( const vector& endPosition, - TrackingData& td + TrackData& td ) { facei_ = -1; @@ -200,6 +208,7 @@ Foam::label Foam::Particle::track } + template Foam::label Foam::Particle::track(const vector& endPosition) { @@ -207,13 +216,12 @@ Foam::label Foam::Particle::track(const vector& endPosition) return track(endPosition, dummyTd); } - template -template +template Foam::scalar Foam::Particle::trackToFace ( const vector& endPosition, - TrackingData& td + TrackData& td ) { const polyMesh& mesh = cloud_.polyMesh_; @@ -301,8 +309,7 @@ Foam::scalar Foam::Particle::trackToFace { FatalErrorIn ( - "Particle::trackToFace" - "(const vector&, TrackingData&)" + "Particle::trackToFace(const vector&, TrackData&)" )<< "addressing failure" << nl << abort(FatalError); } @@ -389,7 +396,6 @@ Foam::scalar Foam::Particle::trackToFace return trackFraction; } - template Foam::scalar Foam::Particle::trackToFace ( @@ -400,7 +406,6 @@ Foam::scalar Foam::Particle::trackToFace return trackToFace(endPosition, dummyTd); } - template void Foam::Particle::transformPosition(const tensor& T) { @@ -419,11 +424,11 @@ void Foam::Particle::transformProperties(const vector&) template -template +template void Foam::Particle::hitWedgePatch ( const wedgePolyPatch& wpp, - TrackingData& + TrackData& ) { vector nf = wpp.faceAreas()[wpp.whichFace(facei_)]; @@ -434,11 +439,11 @@ void Foam::Particle::hitWedgePatch template -template +template void Foam::Particle::hitSymmetryPatch ( const symmetryPolyPatch& spp, - TrackingData& + TrackData& ) { vector nf = spp.faceAreas()[spp.whichFace(facei_)]; @@ -449,11 +454,11 @@ void Foam::Particle::hitSymmetryPatch template -template +template void Foam::Particle::hitCyclicPatch ( const cyclicPolyPatch& cpp, - TrackingData& + TrackData& ) { label patchFacei_ = cpp.whichFace(facei_); @@ -481,31 +486,31 @@ void Foam::Particle::hitCyclicPatch template -template +template void Foam::Particle::hitProcessorPatch ( const processorPolyPatch& spp, - TrackingData& td + TrackData& td ) {} template -template +template void Foam::Particle::hitWallPatch ( const wallPolyPatch& spp, - TrackingData& + TrackData& ) {} template -template +template void Foam::Particle::hitPatch ( const polyPatch& spp, - TrackingData& + TrackData& ) {} diff --git a/src/lagrangian/basic/Particle/Particle.H b/src/lagrangian/basic/Particle/Particle.H index 40556a204c..2dc821710f 100644 --- a/src/lagrangian/basic/Particle/Particle.H +++ b/src/lagrangian/basic/Particle/Particle.H @@ -26,7 +26,6 @@ Class Foam::Particle Description - Foam::Particle \*---------------------------------------------------------------------------*/ @@ -79,6 +78,41 @@ class Particle public IDLList::link { +public: + + //- Class used to pass tracking data to the trackToFace function + class trackData + { + + // Private data + + //- Reference to the cloud containing this particle + Cloud& cloud_; + + + public: + + bool switchProcessor; + bool keepParticle; + + + // Constructors + + inline trackData + ( + Cloud& cloud + ); + + + // Member functions + + //- Return a reference to the cloud + inline Cloud& cloud(); + }; + + +private: + // Private data //- Reference to the particle cloud @@ -108,7 +142,7 @@ class Particle const vector& to, const label facei, const scalar stepFraction - ); + ) const; //- Return the 'lambda' value for the position, p, on the face, // where, p = from + lamda*(to - from) @@ -118,13 +152,13 @@ class Particle const vector& from, const vector& to, const label facei - ); + ) const; //- Return the faces between position and cell centre labelList findFaces ( const vector& position - ); + ) const; //- Return the faces between position and cell centre labelList findFaces @@ -132,80 +166,91 @@ class Particle const vector& position, const label celli, const scalar stepFraction - ); + ) const; protected: + // Patch interactions + //- Overridable function to handle the particle hitting a wedgePatch - template + template void hitWedgePatch ( const wedgePolyPatch&, - TrackingData& td + TrackData& td ); - //- Overridable function to handle the particle hitting a symmetryPatch - template + //- Overridable function to handle the particle hitting a + // symmetryPatch + template void hitSymmetryPatch ( const symmetryPolyPatch&, - TrackingData& td + TrackData& td ); //- Overridable function to handle the particle hitting a cyclicPatch - template + template void hitCyclicPatch ( const cyclicPolyPatch&, - TrackingData& td + TrackData& td ); - //- Overridable function to handle the particle hitting a processorPatch - template + //- Overridable function to handle the particle hitting a + // processorPatch + template void hitProcessorPatch ( const processorPolyPatch&, - TrackingData& td + TrackData& td ); //- Overridable function to handle the particle hitting a wallPatch - template + template void hitWallPatch ( const wallPolyPatch&, - TrackingData& td + TrackData& td ); - //- Overridable function to handle the particle hitting a general patch - template + //- Overridable function to handle the particle hitting a + // general patch + template void hitPatch ( const polyPatch&, - TrackingData& td + TrackData& td ); + + // Transformations + //- Transform the position the particle // according to the given transformation tensor - void transformPosition(const tensor& T); + virtual void transformPosition(const tensor& T); //- Transform the physical properties of the particle // according to the given transformation tensor - void transformProperties(const tensor& T); + virtual void transformProperties(const tensor& T); //- Transform the physical properties of the particle // according to the given separation vector - void transformProperties(const vector& separation); + virtual void transformProperties(const vector& separation); + + + // Parallel transfer //- Convert global addressing to the processor patch // local equivalents - template - void prepareForParallelTransfer(const label patchi, TrackingData& td); + template + void prepareForParallelTransfer(const label patchi, TrackData& td); //- Convert processor patch addressing to the global equivalents // and set the celli to the face-neighbour - template - void correctAfterParallelTransfer(const label patchi, TrackingData& td); + template + void correctAfterParallelTransfer(const label patchi, TrackData& td); public: @@ -217,36 +262,6 @@ public: TypeName("Particle"); - //- Class used to pass tracking data to the trackToFace function - class trackData - { - - // Private data - - //- Reference to the cloud containing this particle - Cloud& cloud_; - - - public: - - bool switchProcessor; - bool keepParticle; - - - // Constructors - - inline trackData - ( - Cloud& cloud - ); - - - // Member functions - - inline Cloud& cloud(); - }; - - // Constructors //- Construct from components @@ -265,7 +280,8 @@ public: bool readFields = true ); - //- Factory class to read-construct particles used for parallel transfer + //- Factory class to read-construct particles used for + // parallel transfer class iNew { @@ -288,7 +304,7 @@ public: }; - // Destructor + //- Destructor virtual ~Particle() {} @@ -299,7 +315,7 @@ public: // Access //- Return true if particle is in cell - inline bool inCell(); + inline bool inCell() const; //- Return true if position is in cell i inline bool inCell @@ -307,7 +323,7 @@ public: const vector& position, const label celli, const scalar stepFraction - ); + ) const; //- Return current particle position inline const vector& position() const; @@ -337,7 +353,11 @@ public: inline label patch(const label facei) const; //- Which face of this patch is this particle on - inline label patchFace(const label patchi, const label facei) const; + inline label patchFace + ( + const label patchi, + const label facei + ) const; //- The nearest distance to a wall that // the particle can be in the n direction @@ -359,14 +379,14 @@ public: // the fraction of the time-step completed. // Returns the boundary face index if the track stops at the // boundary, -1 otherwise. - template + template label track ( const vector& endPosition, - TrackingData& td + TrackData& td ); - //- Calls the templated track with dummy TrackingData + //- Calls the templated track with dummy TrackData label track(const vector& endPosition); //- Track particle to a given position and returns 1.0 if the @@ -375,17 +395,18 @@ public: // completed. // on entry 'stepFraction()' should be set to the fraction of the // time-step at which the tracking starts. - template + template scalar trackToFace ( const vector& endPosition, - TrackingData& td + TrackData& td ); - //- Calls the templated trackToFace with dummy TrackingData + //- Calls the templated trackToFace with dummy TrackData scalar trackToFace(const vector& endPosition); - //- Return the index of the face to be used in the interpolation routine + //- Return the index of the face to be used in the interpolation + // routine inline label faceInterpolation() const; diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H index e267895412..4ffc8c53f1 100644 --- a/src/lagrangian/basic/Particle/ParticleI.H +++ b/src/lagrangian/basic/Particle/ParticleI.H @@ -40,7 +40,7 @@ inline scalar Particle::lambda const vector& to, const label facei, const scalar stepFraction -) +) const { const polyMesh& mesh = cloud_.polyMesh_; bool movingMesh = mesh.moving(); @@ -71,7 +71,6 @@ inline scalar Particle::lambda // for a moving mesh we need to reconstruct the old // Sf and Cf from oldPoints (they aren't stored) - // NN. const vectorField& oldPoints = mesh.oldPoints(); @@ -100,7 +99,7 @@ inline scalar Particle::lambda // find center of rotation vector omega = Sf0 ^ Sf; scalar magOmega = mag(omega); - omega /= magOmega+SMALL; + omega /= magOmega + SMALL; vector n0 = omega ^ Sf0; scalar lam = ((Cf - Cf0) & Sf)/(n0 & Sf); vector r0 = Cf0 + lam*n0; @@ -188,7 +187,7 @@ inline scalar Particle::lambda const vector& from, const vector& to, const label facei -) +) const { const polyMesh& mesh = cloud_.polyMesh_; @@ -235,7 +234,7 @@ inline scalar Particle::lambda template -inline bool Particle::inCell() +inline bool Particle::inCell() const { labelList faces = findFaces(position_); @@ -249,7 +248,7 @@ inline bool Particle::inCell const vector& position, const label celli, const scalar stepFraction -) +) const { labelList faces = findFaces(position, celli, stepFraction); @@ -277,7 +276,6 @@ inline Cloud& Particle::trackData::cloud() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -//- Return reference to the particle cloud template inline const Cloud& Particle::cloud() const { @@ -313,7 +311,6 @@ inline label Particle::face() const } -//- Is the particle on a boundary face? template inline bool Particle::onBoundary() const { diff --git a/src/lagrangian/basic/indexedParticle/indexedParticle.H b/src/lagrangian/basic/indexedParticle/indexedParticle.H index 742f0462e4..259d77ebbe 100644 --- a/src/lagrangian/basic/indexedParticle/indexedParticle.H +++ b/src/lagrangian/basic/indexedParticle/indexedParticle.H @@ -26,7 +26,6 @@ Class Foam::indexedParticle Description - An indexed Particle SourceFiles indexedParticleI.H diff --git a/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C b/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C index 6b86a4f8de..c51fc30b19 100644 --- a/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C +++ b/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C @@ -22,6 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Description + \*---------------------------------------------------------------------------*/ #include "indexedParticle.H" diff --git a/src/lagrangian/basic/lagrangianField/LagrangianField.H b/src/lagrangian/basic/lagrangianField/LagrangianField.H index 217a31fc7e..de11b91c3d 100644 --- a/src/lagrangian/basic/lagrangianField/LagrangianField.H +++ b/src/lagrangian/basic/lagrangianField/LagrangianField.H @@ -26,7 +26,6 @@ Class Foam::LagrangianField Description - Lagrangian Field SourceFiles LagrangianFieldI.H diff --git a/src/lagrangian/basic/passiveParticle/passiveParticle.H b/src/lagrangian/basic/passiveParticle/passiveParticle.H index 27b8eef40b..f5f76036c2 100644 --- a/src/lagrangian/basic/passiveParticle/passiveParticle.H +++ b/src/lagrangian/basic/passiveParticle/passiveParticle.H @@ -26,7 +26,6 @@ Class Foam::passiveParticle Description - A passive Particle SourceFiles passiveParticleI.H diff --git a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C index 2f3c8b6557..4263d80f04 100644 --- a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C +++ b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C @@ -22,6 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Description + \*---------------------------------------------------------------------------*/ #include "passiveParticle.H" diff --git a/src/lagrangian/basic/polyMeshInfo/polyMeshInfo.H b/src/lagrangian/basic/polyMeshInfo/polyMeshInfo.H index ae16c885e8..c91ac209c2 100644 --- a/src/lagrangian/basic/polyMeshInfo/polyMeshInfo.H +++ b/src/lagrangian/basic/polyMeshInfo/polyMeshInfo.H @@ -26,7 +26,7 @@ Class Foam::polyMeshInfo Description - Foam::polyMeshInfo + SourceFiles polyMeshInfo.C diff --git a/src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.C b/src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.C new file mode 100644 index 0000000000..4150f8b78e --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Analytical.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::Analytical::Analytical +( + const word& phiName, + const dictionary& dict +) +: + IntegrationScheme(phiName, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::Analytical::~Analytical() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Type Foam::Analytical::integrate +( + const Type phi, + const scalar dt, + const Type alpha, + const scalar beta +) const +{ + return alpha + (phi - alpha)*exp(-beta*dt); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.H b/src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.H new file mode 100644 index 0000000000..4ae39f226e --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/Analytical/Analytical.H @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::Analytical + +Description + Analytical integration + +\*---------------------------------------------------------------------------*/ + +#ifndef Analytical_H +#define Analytical_H + +#include "IntegrationScheme.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class Analytical Declaration +\*---------------------------------------------------------------------------*/ + +template +class Analytical +: + public IntegrationScheme +{ + +public: + + //- Runtime type information + TypeName("Analytical"); + + + // Constructors + + //- Construct from components + Analytical + ( + const word& phiName, + const dictionary& dict + ); + + + //- Destructor + + virtual ~Analytical(); + + + // Member Functions + + //- Perform the integration + virtual Type integrate + ( + const Type phi, + const scalar dt, + const Type alpha, + const scalar beta + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "Analytical.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.C b/src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.C new file mode 100644 index 0000000000..34f3b216ee --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Euler.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::Euler::Euler +( + const word& phiName, + const dictionary& dict +) +: + IntegrationScheme(phiName, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::Euler::~Euler() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Type Foam::Euler::integrate +( + const Type phi, + const scalar dt, + const Type alpha, + const scalar beta +) const +{ + return (phi + dt*alpha)/(1.0 + dt/beta); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.H b/src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.H new file mode 100644 index 0000000000..7073c9de6c --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/Euler/Euler.H @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::Euler + +Description + Euler-implicit integration + +\*---------------------------------------------------------------------------*/ + +#ifndef Euler_H +#define Euler_H + +#include "IntegrationScheme.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class Euler Declaration +\*---------------------------------------------------------------------------*/ + +template +class Euler +: + public IntegrationScheme +{ + +public: + + //- Runtime type information + TypeName("Euler"); + + + // Constructors + + //- Construct from components + Euler + ( + const word& phiName, + const dictionary& dict + ); + + + //- Destructor + + virtual ~Euler(); + + + // Member Functions + + //- Perform the integration + virtual Type integrate + ( + const Type phi, + const scalar dt, + const Type alpha, + const scalar beta + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "Euler.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.C b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.C new file mode 100644 index 0000000000..99fb7c1a49 --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "IntegrationScheme.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::IntegrationScheme::IntegrationScheme +( + const word& phiName, + const dictionary& dict +) +: + phiName_(phiName), + dict_(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // + +template +Foam::IntegrationScheme::~IntegrationScheme() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +#include "newIntegrationScheme.C" + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.H b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.H new file mode 100644 index 0000000000..3db7f59844 --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationScheme.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Class + Foam::IntegrationScheme + +Description + Top level model for Integration schemes + +SourceFiles + IntegrationScheme.C + +\*---------------------------------------------------------------------------*/ + +#ifndef IntegrationScheme_H +#define IntegrationScheme_H + +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "dictionary.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class IntegrationScheme Declaration +\*---------------------------------------------------------------------------*/ + +template +class IntegrationScheme +{ + // Private data + + //- Name of the Integration variable + const word& phiName_; + + //- Reference to the dictionary + const dictionary& dict_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + IntegrationScheme(const IntegrationScheme&); + + //- Disallow default bitwise assignment + void operator=(const IntegrationScheme&); + + +public: + + //- Runtime type information + TypeName("IntegrationScheme"); + + + //- Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + IntegrationScheme, + dictionary, + ( + const word& phiName, + const dictionary& dict + ), + (phiName, dict) + ); + + + // Constructors + + //- Construct from components + IntegrationScheme + ( + const word& phiName, + const dictionary& dict + ); + + + // Selectors + + //- Return a reference to the selected radiation model + static autoPtr New + ( + const word& phiName, + const dictionary& dict + ); + + + //- Destructor + + virtual ~IntegrationScheme(); + + + // Member Functions + + //- Perform the Integration + virtual Type integrate + ( + const Type phi, + const scalar dt, + const Type alpha, + const scalar beta + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeIntegrationScheme(Type) \ + \ + defineNamedTemplateTypeNameAndDebug(IntegrationScheme, 0); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + IntegrationScheme, \ + dictionary \ + ); + + +#define makeIntegrationSchemeType(SS, Type) \ + \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ + \ + IntegrationScheme::adddictionaryConstructorToTable > \ + add##SS##Type##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "IntegrationScheme.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + diff --git a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemesFwd.H b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemesFwd.H new file mode 100644 index 0000000000..63e4a07997 --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/IntegrationSchemesFwd.H @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::IntegrationScheme + +Description + +SourceFiles + IntegrationScheme.C + +\*---------------------------------------------------------------------------*/ + +#ifndef IntegrationSchemesFwd_H +#define IntegrationSchemesFwd_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +class IntegrationScheme; + +typedef IntegrationScheme scalarIntegrationScheme; +typedef IntegrationScheme vectorIntegrationScheme; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C new file mode 100644 index 0000000000..5c3e7c3640 --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/IntegrationScheme/newIntegrationScheme.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "error.H" +#include "IntegrationScheme.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::autoPtr > +Foam::IntegrationScheme::New +( + const word& phiName, + const dictionary& dict +) +{ + word IntegrationSchemeTypeName; + + dict.lookup(phiName) >> IntegrationSchemeTypeName; + + Info<< "Selecting " << phiName << " IntegrationScheme " + << IntegrationSchemeTypeName << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(IntegrationSchemeTypeName); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "IntegrationScheme::New(const dictionary&)" + ) << "Unknown IntegrationScheme type " + << IntegrationSchemeTypeName << nl << nl + << "Valid IntegrationScheme types are:" << nl + << dictionaryConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr >(cstrIter()(phiName, dict)); +} + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C b/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C new file mode 100644 index 0000000000..e3b488ca54 --- /dev/null +++ b/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "IntegrationScheme.H" +#include "Euler.H" +#include "Analytical.H" + +#include "scalar.H" +#include "vector.H" + +namespace Foam +{ + makeIntegrationScheme(scalar); + makeIntegrationSchemeType(Euler, scalar); + makeIntegrationSchemeType(Analytical, scalar); + + makeIntegrationScheme(vector); + makeIntegrationSchemeType(Euler, vector); + makeIntegrationSchemeType(Analytical, vector); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 9b9869bc2c..a38943c85c 100755 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -44,5 +44,8 @@ parcels/derived/reactingParcel/makeReactingParcelWallInteractionModels.C submodels/addOns/radiation/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C +/* integration schemes */ +IntegrationScheme/makeIntegrationSchemes.C + LIB = $(FOAM_LIBBIN)/liblagrangianIntermediate diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index 84bccf17a0..de61c7aa2e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -30,6 +30,8 @@ License #include "InjectionModel.H" #include "WallInteractionModel.H" +#include "IntegrationScheme.H" + #include "interpolationCellPoint.H" // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // @@ -153,7 +155,6 @@ Foam::KinematicCloud::KinematicCloud kinematicCloud(), cloudType_(cloudType), mesh_(rho.mesh()), - runTime_(rho.time()), vpi_(vpi), particleProperties_ ( @@ -170,7 +171,7 @@ Foam::KinematicCloud::KinematicCloud parcelTypeId_(readLabel(particleProperties_.lookup("parcelTypeId"))), coupled_(particleProperties_.lookup("coupled")), rndGen_(label(0)), - time0_(runTime_.value()), + time0_(this->db().time().value()), parcelBasisType_(particleProperties_.lookup("parcelBasisType")), parcelBasis_(pbNumber), massTotal_ @@ -182,6 +183,7 @@ Foam::KinematicCloud::KinematicCloud U_(U), mu_(mu), g_(g), + interpolationSchemes_(particleProperties_.subDict("interpolationSchemes")), dispersionModel_ ( DispersionModel >::New @@ -214,6 +216,14 @@ Foam::KinematicCloud::KinematicCloud *this ) ), + UIntegrator_ + ( + vectorIntegrationScheme::New + ( + "U", + particleProperties_.subDict("integrationSchemes") + ) + ), nInjections_(0), nParcelsAdded_(0), nParcelsAddedTotal_(0), @@ -221,8 +231,8 @@ Foam::KinematicCloud::KinematicCloud ( IOobject ( - this->cloudName() + "UTrans", - runTime_.timeName(), + this->name() + "UTrans", + this->db().time().timeName(), this->db(), IOobject::NO_READ, IOobject::NO_WRITE, @@ -235,8 +245,8 @@ Foam::KinematicCloud::KinematicCloud ( IOobject ( - this->cloudName() + "UCoeff", - runTime_.timeName(), + this->name() + "UCoeff", + this->db().time().timeName(), this->db(), IOobject::NO_READ, IOobject::NO_WRITE, @@ -288,17 +298,34 @@ void Foam::KinematicCloud::resetSourceTerms() template void Foam::KinematicCloud::evolve() { - interpolationCellPoint rhoInterp(vpi_, rho_); - interpolationCellPoint UInterp(vpi_, U_); - interpolationCellPoint muInterp(vpi_, mu_); + autoPtr > rhoInterpolator = interpolation::New + ( + interpolationSchemes_, + vpi_, + rho_ + ); + + autoPtr > UInterpolator = interpolation::New + ( + interpolationSchemes_, + vpi_, + U_ + ); + + autoPtr > muInterpolator = interpolation::New + ( + interpolationSchemes_, + vpi_, + mu_ + ); typename ParcelType::trackData td ( *this, constProps_, - rhoInterp, - UInterp, - muInterp, + rhoInterpolator(), + UInterpolator(), + muInterpolator(), g_.value() ); @@ -330,7 +357,7 @@ void Foam::KinematicCloud::inject TrackingData& td ) { - scalar time = runTime_.value(); + scalar time = this->db().time().value(); scalar pRho = td.constProps().rho0(); @@ -363,7 +390,7 @@ void Foam::KinematicCloud::inject // Duration of injection period during this timestep scalar deltaT = min ( - runTime().deltaT().value(), + this->db().time().deltaT().value(), min ( time - this->injection().timeStart(), @@ -430,8 +457,8 @@ void Foam::KinematicCloud::inject scalar dt = time - timeInj; - pPtr->stepFraction() = (runTime_.deltaT().value() - dt) - /runTime_.deltaT().value(); + pPtr->stepFraction() = (this->db().time().deltaT().value() - dt) + /this->time().deltaT().value(); this->injectParcel(td, pPtr); } @@ -466,7 +493,7 @@ void Foam::KinematicCloud::postInjectCheck() { if (nParcelsAdded_) { - Pout<< "\n--> Cloud: " << this->cloudName() << nl << + Pout<< "\n--> Cloud: " << this->name() << nl << " Added " << nParcelsAdded_ << " new parcels" << nl << endl; } @@ -474,7 +501,7 @@ void Foam::KinematicCloud::postInjectCheck() nParcelsAdded_ = 0; // Set time for start of next injection - time0_ = runTime_.value(); + time0_ = this->db().time().value(); // Increment number of injections nInjections_++; @@ -484,7 +511,7 @@ void Foam::KinematicCloud::postInjectCheck() template void Foam::KinematicCloud::info() const { - Info<< "Cloud name: " << this->cloudName() << nl + Info<< "Cloud name: " << this->name() << nl << " Parcels added during this run = " << returnReduce(nParcelsAddedTotal_, sumOp