diff --git a/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp b/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp index d1af3817..22e48eeb 100644 --- a/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp +++ b/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp @@ -20,13 +20,22 @@ Licence: #include "sphereDEMSystem.hpp" -void pFlow::sphereDEMSystem::loop() +bool pFlow::sphereDEMSystem::loop() { do { Control().timers().start(); + if(! insertion_().insertParticles( + Control().time().currentTime(), + Control().time().dt() ) ) + { + fatalError<< + "particle insertion failed in sphereDFlow solver.\n"; + return false; + } + geometry_->beforeIteration(); interaction_->beforeIteration(); @@ -70,7 +79,11 @@ pFlow::sphereDEMSystem::sphereDEMSystem( REPORT(0)<<"\nReading sphere particles . . ."<(Control(), Property()); - + insertion_ = makeUnique( + Control().caseSetup().path()+insertionFile__, + particles_(), + particles_().shapes()); + REPORT(0)<<"\nCreating interaction model for sphere-sphere contact and sphere-wall contact . . ."<( objectFile( insertionFile__, @@ -34,9 +34,12 @@ auto& sphInsertion = ), sphParticles, sphParticles.shapes() - ); - + );*/ +auto sphInsertion = sphereInsertion( + Control.caseSetup().path()+insertionFile__, + sphParticles, + sphParticles.shapes()); REPORT(0)<<"\nCreating interaction model for sphere-sphere contact and sphere-wall contact . . ."<::writeInsertionDict } template -pFlow::Insertion::Insertion -( +pFlow::Insertion::Insertion( particles& prtcl, - const ShapeType& shapes -) + const ShapeType& shapes) : insertion(prtcl), shapes_(shapes) @@ -81,6 +79,24 @@ pFlow::Insertion::Insertion } +template +pFlow::Insertion::Insertion( + fileSystem file, + particles& prtcl, + const ShapeType& shapes) +: + Insertion(prtcl, shapes) +{ + dictionary inDict(file.fileName(), file); + + if(!readInsertionDict(inDict)) + { + fatalErrorInFunction<< "could not read from file "<< + file< bool pFlow::Insertion::insertParticles diff --git a/src/Particles/Insertion/Insertion/Insertion.hpp b/src/Particles/Insertion/Insertion/Insertion.hpp index c6fad5b5..cd9aff68 100644 --- a/src/Particles/Insertion/Insertion/Insertion.hpp +++ b/src/Particles/Insertion/Insertion/Insertion.hpp @@ -54,6 +54,8 @@ public: Insertion(particles& prtcl, const ShapeType& shapes); + Insertion(fileSystem file, particles& prtcl, const ShapeType& shapes); + bool insertParticles(real currentTime, real dt); diff --git a/src/Particles/Insertion/insertion/insertion.cpp b/src/Particles/Insertion/insertion/insertion.cpp index 5737d521..18b53d2c 100644 --- a/src/Particles/Insertion/insertion/insertion.cpp +++ b/src/Particles/Insertion/insertion/insertion.cpp @@ -71,4 +71,4 @@ pFlow::insertion::insertion ) : particles_(prtcl) -{} \ No newline at end of file +{} diff --git a/src/Particles/Insertion/insertion/insertion.hpp b/src/Particles/Insertion/insertion/insertion.hpp index 2a813937..7e93f4ba 100644 --- a/src/Particles/Insertion/insertion/insertion.hpp +++ b/src/Particles/Insertion/insertion/insertion.hpp @@ -54,6 +54,7 @@ public: insertion(particles& prtcl); + virtual ~insertion() = default; bool isActive()const { diff --git a/src/phasicFlow/repository/systemControl/systemControl.cpp b/src/phasicFlow/repository/systemControl/systemControl.cpp index 7b1687f7..fd4425a4 100644 --- a/src/phasicFlow/repository/systemControl/systemControl.cpp +++ b/src/phasicFlow/repository/systemControl/systemControl.cpp @@ -248,7 +248,6 @@ bool pFlow::systemControl::operator ++(int) } else if( time().finalTime() ) { - output<<"****************************************************************"<