# PhasicFlow: solvers/sphereGranFlow/sphereGranFlow.cpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

sphereGranFlow.cpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "vocabs.hpp"
#include "phasicFlowKokkos.hpp"
#include "systemControl.hpp"
#include "commandLine.hpp"
#include "property.hpp"
#include "geometry.hpp"
#include "sphereParticles.hpp"
#include "interaction.hpp"
#include "Insertions.hpp"
//#include "readControlDict.hpp"
int main( int argc, char* argv[])
{
pFlow::commandLine cmds(
"sphereGranFlow",
"DEM solver for non-cohesive spherical particles with particle insertion "
"mechanism and moving geometry");
bool isCoupling = false;
if(!cmds.parse(argc, argv)) return 0;
// this should be palced in each main
pFlow::processors::initProcessors(argc, argv);
pFlow::initialize_pFlowProcessors();
#include "initialize_Control.hpp"
#include "setProperty.hpp"
#include "setSurfaceGeometry.hpp"
#include "createDEMComponents.hpp"
REPORT(0)<<"\nStart of time loop . . .\n"<<END_REPORT;
do
{
if(! sphInsertion.insertParticles(
Control.time().currentIter(),
Control.time().currentTime(),
Control.time().dt() ) )
{
fatalError<<
"particle insertion failed in sphereDFlow solver.\n";
return 1;
}
// set force to zero
surfGeometry.beforeIteration();
// set force to zero, predict, particle deletion and etc.
sphParticles.beforeIteration();
sphInteraction.beforeIteration();
sphInteraction.iterate();
surfGeometry.iterate();
sphParticles.iterate();
sphInteraction.afterIteration();
surfGeometry.afterIteration();
sphParticles.afterIteration();
}while(Control++);
REPORT(0)<<"\nEnd of time loop.\n"<<END_REPORT;
// this should be palced in each main
#include "finalize.hpp"
pFlow::processors::finalizeProcessors();
}
initialize_Control.hpp
pFlow::processors::initProcessors
static void initProcessors(int argc, char *argv[])
Initialize MPI processors.
Definition: processors.cpp:42
setProperty.hpp
REPORT
#define REPORT(n)
Definition: streams.hpp:39
setSurfaceGeometry.hpp
pFlow::processors::finalizeProcessors
static void finalizeProcessors()
Finalize MPI processors.
Definition: processors.cpp:88
systemControl.hpp
Insertions.hpp
main
int main(int argc, char *argv[])
DEM solver for simulating granular flow of cohesion-less particles.
Definition: sphereGranFlow.cpp:51
pFlow::commandLine
Definition: commandLine.hpp:36
createDEMComponents.hpp
interaction.hpp
surfGeometry
auto & surfGeometry
Definition: setSurfaceGeometry.hpp:26
sphInsertion
auto sphInsertion
Definition: createDEMComponents.hpp:39
phasicFlowKokkos.hpp
pFlow::commandLine::parse
bool parse(int argc, char **argv)
Definition: commandLine.cpp:50
pFlow::particles::afterIteration
bool afterIteration() override
This is called in time loop, after iterate.
Definition: particles.cpp:110
geometry.hpp
pFlow::sphereParticles::iterate
bool iterate() override
iterate particles
Definition: sphereParticles.cpp:537
pFlow::initialize_pFlowProcessors
void initialize_pFlowProcessors()
Definition: pFlowProcessors.cpp:10
END_REPORT
#define END_REPORT
Definition: streams.hpp:40
fatalError
#define fatalError
Report a fatal error and exit the applicaiton.
Definition: error.hpp:70
sphInteraction
auto & sphInteraction
Definition: createDEMComponents.hpp:50
pFlow::sphereParticles::beforeIteration
bool beforeIteration() override
before iteration step
Definition: sphereParticles.cpp:515
sphereParticles.hpp
property.hpp
vocabs.hpp
sphParticles
pFlow::sphereParticles sphParticles(Control, proprties)
commandLine.hpp
Control
auto & Control
Definition: initialize_Control.hpp:47
finalize.hpp