for merging

This commit is contained in:
omid.khs 2023-02-26 15:48:07 +03:30
commit d46e0b208b
9 changed files with 62 additions and 13 deletions

View File

@ -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 . . ."<<endREPORT;
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;
interaction_ = interaction::create(
Control(),

View File

@ -82,7 +82,7 @@ protected:
return interaction_();
}
void loop();
bool loop();
public:

View File

@ -24,7 +24,7 @@ sphereParticles sphParticles(Control, proprties);
//
REPORT(0)<<"\nCreating particle insertion object . . ."<<endREPORT;
auto& sphInsertion =
/*auto& sphInsertion =
Control.caseSetup().emplaceObject<sphereInsertion>(
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 . . ."<<endREPORT;
auto interactionPtr = interaction::create(

View File

@ -68,11 +68,9 @@ bool pFlow::Insertion<ShapeType>::writeInsertionDict
}
template<typename ShapeType>
pFlow::Insertion<ShapeType>::Insertion
(
pFlow::Insertion<ShapeType>::Insertion(
particles& prtcl,
const ShapeType& shapes
)
const ShapeType& shapes)
:
insertion(prtcl),
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>
bool pFlow::Insertion<ShapeType>::insertParticles

View File

@ -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);

View File

@ -74,6 +74,7 @@ pFlow::Insertion<ShapeType>::Insertion
const ShapeType& shapes
)
:
<<<<<<< HEAD
insertion(prtcl),
shapes_(shapes)
{
@ -201,4 +202,8 @@ bool pFlow::Insertion<ShapeType>::write
}
return true;
}
}
=======
particles_(prtcl)
{}
>>>>>>> 3bcfc31fd23a197b71377b16e95f41c1c0da2593

View File

@ -52,7 +52,18 @@ public:
TypeInfoTemplateNV("Insertion",ShapeType);
<<<<<<< HEAD
Insertion(particles& prtcl, const ShapeType& shapes);
=======
insertion(particles& prtcl);
virtual ~insertion() = default;
bool isActive()const {
return active_();
}
>>>>>>> 3bcfc31fd23a197b71377b16e95f41c1c0da2593
bool insertParticles(real currentTime, real dt);

View File

@ -248,7 +248,6 @@ bool pFlow::systemControl::operator ++(int)
}
else if( time().finalTime() )
{
output<<"****************************************************************"<<endl;
if( !time().write() )
{
fatalErrorInFunction;

View File

@ -5,7 +5,7 @@ The problem is to simulate a Rotating Drum with **6** Baffles with the diameter
<html>
<body>
<img src="https://github.com/omid-khosravi/DEMphasicFlow/blob/Pictures/Pictures/MixedparticlesRDB.png", width: 400px>
<img src="https://github.com/PhasicFlow/phasicFlow/blob/media/media/MixedparticlesRDB.png", width: 400px>
</body>
</html>