change in particle insertion ctor and addition to DEMSystem
This commit is contained in:
parent
aa4ac3372c
commit
360eda7c6c
|
@ -20,13 +20,22 @@ Licence:
|
||||||
|
|
||||||
#include "sphereDEMSystem.hpp"
|
#include "sphereDEMSystem.hpp"
|
||||||
|
|
||||||
void pFlow::sphereDEMSystem::loop()
|
bool pFlow::sphereDEMSystem::loop()
|
||||||
{
|
{
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Control().timers().start();
|
Control().timers().start();
|
||||||
|
|
||||||
|
if(! insertion_().insertParticles(
|
||||||
|
Control().time().currentTime(),
|
||||||
|
Control().time().dt() ) )
|
||||||
|
{
|
||||||
|
fatalError<<
|
||||||
|
"particle insertion failed in sphereDFlow solver.\n";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
geometry_->beforeIteration();
|
geometry_->beforeIteration();
|
||||||
|
|
||||||
interaction_->beforeIteration();
|
interaction_->beforeIteration();
|
||||||
|
@ -70,7 +79,11 @@ pFlow::sphereDEMSystem::sphereDEMSystem(
|
||||||
REPORT(0)<<"\nReading sphere particles . . ."<<endREPORT;
|
REPORT(0)<<"\nReading sphere particles . . ."<<endREPORT;
|
||||||
particles_ = makeUnique<sphereFluidParticles>(Control(), Property());
|
particles_ = makeUnique<sphereFluidParticles>(Control(), Property());
|
||||||
|
|
||||||
|
insertion_ = makeUnique<sphereInsertion>(
|
||||||
|
Control().caseSetup().path()+insertionFile__,
|
||||||
|
particles_(),
|
||||||
|
particles_().shapes());
|
||||||
|
|
||||||
REPORT(0)<<"\nCreating interaction model for sphere-sphere contact and sphere-wall contact . . ."<<endREPORT;
|
REPORT(0)<<"\nCreating interaction model for sphere-sphere contact and sphere-wall contact . . ."<<endREPORT;
|
||||||
interaction_ = interaction::create(
|
interaction_ = interaction::create(
|
||||||
Control(),
|
Control(),
|
||||||
|
|
|
@ -82,7 +82,7 @@ protected:
|
||||||
return interaction_();
|
return interaction_();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop();
|
bool loop();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ sphereParticles sphParticles(Control, proprties);
|
||||||
|
|
||||||
//
|
//
|
||||||
REPORT(0)<<"\nCreating particle insertion object . . ."<<endREPORT;
|
REPORT(0)<<"\nCreating particle insertion object . . ."<<endREPORT;
|
||||||
auto& sphInsertion =
|
/*auto& sphInsertion =
|
||||||
Control.caseSetup().emplaceObject<sphereInsertion>(
|
Control.caseSetup().emplaceObject<sphereInsertion>(
|
||||||
objectFile(
|
objectFile(
|
||||||
insertionFile__,
|
insertionFile__,
|
||||||
|
@ -34,9 +34,12 @@ auto& sphInsertion =
|
||||||
),
|
),
|
||||||
sphParticles,
|
sphParticles,
|
||||||
sphParticles.shapes()
|
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 . . ."<<endREPORT;
|
REPORT(0)<<"\nCreating interaction model for sphere-sphere contact and sphere-wall contact . . ."<<endREPORT;
|
||||||
auto interactionPtr = interaction::create(
|
auto interactionPtr = interaction::create(
|
||||||
|
|
|
@ -68,11 +68,9 @@ bool pFlow::Insertion<ShapeType>::writeInsertionDict
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ShapeType>
|
template<typename ShapeType>
|
||||||
pFlow::Insertion<ShapeType>::Insertion
|
pFlow::Insertion<ShapeType>::Insertion(
|
||||||
(
|
|
||||||
particles& prtcl,
|
particles& prtcl,
|
||||||
const ShapeType& shapes
|
const ShapeType& shapes)
|
||||||
)
|
|
||||||
:
|
:
|
||||||
insertion(prtcl),
|
insertion(prtcl),
|
||||||
shapes_(shapes)
|
shapes_(shapes)
|
||||||
|
@ -81,6 +79,24 @@ pFlow::Insertion<ShapeType>::Insertion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename ShapeType>
|
||||||
|
pFlow::Insertion<ShapeType>::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<<endl;
|
||||||
|
fatalExit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename ShapeType>
|
template<typename ShapeType>
|
||||||
bool pFlow::Insertion<ShapeType>::insertParticles
|
bool pFlow::Insertion<ShapeType>::insertParticles
|
||||||
|
|
|
@ -54,6 +54,8 @@ public:
|
||||||
|
|
||||||
Insertion(particles& prtcl, const ShapeType& shapes);
|
Insertion(particles& prtcl, const ShapeType& shapes);
|
||||||
|
|
||||||
|
Insertion(fileSystem file, particles& prtcl, const ShapeType& shapes);
|
||||||
|
|
||||||
|
|
||||||
bool insertParticles(real currentTime, real dt);
|
bool insertParticles(real currentTime, real dt);
|
||||||
|
|
||||||
|
|
|
@ -71,4 +71,4 @@ pFlow::insertion::insertion
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
particles_(prtcl)
|
particles_(prtcl)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -54,6 +54,7 @@ public:
|
||||||
|
|
||||||
insertion(particles& prtcl);
|
insertion(particles& prtcl);
|
||||||
|
|
||||||
|
|
||||||
virtual ~insertion() = default;
|
virtual ~insertion() = default;
|
||||||
|
|
||||||
bool isActive()const {
|
bool isActive()const {
|
||||||
|
|
|
@ -248,7 +248,6 @@ bool pFlow::systemControl::operator ++(int)
|
||||||
}
|
}
|
||||||
else if( time().finalTime() )
|
else if( time().finalTime() )
|
||||||
{
|
{
|
||||||
output<<"****************************************************************"<<endl;
|
|
||||||
if( !time().write() )
|
if( !time().write() )
|
||||||
{
|
{
|
||||||
fatalErrorInFunction;
|
fatalErrorInFunction;
|
||||||
|
|
Loading…
Reference in New Issue