LPT-VOF coupling in OF 7
-
大家好, 现在在做LPT和VOF耦合, 既把solidParticle植入到interFoam中。 我现在有的参考还是chamlers根据openFoam 3.0 做的, 但是他在OF7 中并不匹配
void Foam::solidParticleCloud::inject(solidParticle::trackingData &td) { label cellI=1; label tetFaceI=1; label tetPtI=1; mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI); solidParticle* ptr1 = new solidParticle(mesh_, td.cloud().posP1_, cellI, tetFaceI, tetPtI,td.cloud().dP1_, td.cloud().UP1_); Cloud<solidParticle>::addParticle(ptr1); mesh_.findCellFacePt(td.cloud().posP2_, cellI, tetFaceI, tetPtI); solidParticle* ptr2 = new solidParticle(mesh_, td.cloud().posP2_, cellI, tetFaceI, tetPtI, td.cloud().dP2_, td.cloud().UP2_); Cloud<solidParticle>::addParticle(ptr2); }
这个是加入到solidParticleCloud.H 的代码, 然后显示member function cloud 不存在,然后我去看了particle.H 中的代码,
class particle : public IDLList<particle>::link { // Private member data //- Size in bytes of the position data static const std::size_t sizeofPosition_; //- Size in bytes of the fields static const std::size_t sizeofFields_; //- The factor by which the displacement is increased when passing // through negative space. This should be slightly bigger than one. // This is needed as a straight trajectory can form a closed loop // through regions of overlapping positive and negative space, leading // to a track which never ends. By increasing the rate of displacement // through negative regions, the change in track fraction over this // part of the loop no longer exactly cancels the change over the // positive part, and the track therefore terminates. static const scalar negativeSpaceDisplacementFactor; public: class trackingData { public: // Public data //- Flag to switch processor bool switchProcessor; //- Flag to indicate whether to keep particle (false = delete) bool keepParticle; // Constructor template <class TrackCloudType> trackingData(const TrackCloudType& cloud) {} };
发现trackingData已经没有private成员和member function了,OF5中还是有的, 如下
class particle : public IDLList<particle>::link { // Private member data //- Size in bytes of the position data static const std::size_t sizeofPosition_; //- Size in bytes of the fields static const std::size_t sizeofFields_; //- The factor by which the displacement is increased when passing // through negative space. This should be slightly bigger than one. // This is needed as a straight trajectory can form a closed loop // through regions of overlapping positive and negative space, leading // to a track which never ends. By increasing the rate of displacement // through negative regions, the change in track fraction over this // part of the loop no longer exactly cancels the change over the // positive part, and the track therefore terminates. static const scalar negativeSpaceDisplacementFactor; public: template<class CloudType> class TrackingData { // Private data //- Reference to the cloud containing (this) particle CloudType& cloud_; public: // Public data typedef CloudType cloudType; //- Flag to switch processor bool switchProcessor; //- Flag to indicate whether to keep particle (false = delete) bool keepParticle; // Constructor TrackingData(CloudType& cloud) : cloud_(cloud) {} // Member functions //- Return a reference to the cloud CloudType& cloud() { return cloud_; } };
我看官方貌似对particle和injection做了挺多改变的。请问一下有大神对这个有所涉及或者可以给个hint吗?
-
@东岳 但是那个貌似是在v1906这种版本,我现在用的是OpenFoam 7, 貌似没有MPPICInterFoam