www.cemf.ir
grainGranFlow.cpp
Go to the documentation of this file.
1
2
/*------------------------------- phasicFlow ---------------------------------
3
O C enter of
4
O O E ngineering and
5
O O M ultiscale modeling of
6
OOOOOOO F luid flow
7
------------------------------------------------------------------------------
8
Copyright (C): www.cemf.ir
9
email: hamid.r.norouzi AT gmail.com
10
------------------------------------------------------------------------------
11
Licence:
12
This file is part of phasicFlow code. It is a free software for simulating
13
granular and multiphase flows. You can redistribute it and/or modify it under
14
the terms of GNU General Public License v3 or any other later versions.
15
16
phasicFlow is distributed to help others in their research in the field of
17
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
18
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20
-----------------------------------------------------------------------------*/
33
#include "
vocabs.hpp
"
34
#include "
phasicFlowKokkos.hpp
"
35
#include "
systemControl.hpp
"
36
#include "
commandLine.hpp
"
37
#include "
property.hpp
"
38
#include "
geometry.hpp
"
39
#include "
grainParticles.hpp
"
40
#include "
interaction.hpp
"
41
#include "
Insertions.hpp
"
42
43
44
45
//#include "readControlDict.hpp"
46
47
54
int
main
(
int
argc,
char
* argv[])
55
{
56
57
pFlow::commandLine
cmds(
58
"grainGranFlow"
,
59
"DEM solver for non-cohesive spherical grain particles with particle insertion "
60
"mechanism and moving geometry"
);
61
62
bool
isCoupling =
false
;
63
64
if
(!cmds.
parse
(argc, argv))
return
0;
65
66
// this should be palced in each main
67
pFlow::processors::initProcessors
(argc, argv);
68
pFlow::initialize_pFlowProcessors
();
69
#include "
initialize_Control.hpp
"
70
71
#include "
setProperty.hpp
"
72
#include "
setSurfaceGeometry.hpp
"
73
74
75
#include "
createDEMComponents.hpp
"
76
77
REPORT
(0)<<
"\nStart of time loop . . .\n"
<<
END_REPORT
;
78
79
do
80
{
81
82
if
(!
grnInsertion
.insertParticles(
83
Control
.time().currentIter(),
84
Control
.time().currentTime(),
85
Control
.time().dt() ) )
86
{
87
fatalError
<<
88
"particle insertion failed in grain DFlow solver.\n"
;
89
return
1;
90
}
91
92
// set force to zero
93
surfGeometry
.beforeIteration();
94
95
// set force to zero, predict, particle deletion and etc.
96
grnParticles
.
beforeIteration
();
97
98
grnInteraction
.beforeIteration();
99
100
grnInteraction
.iterate();
101
102
surfGeometry
.iterate();
103
104
grnParticles
.
iterate
();
105
106
grnInteraction
.afterIteration();
107
108
surfGeometry
.afterIteration();
109
110
grnParticles
.
afterIteration
();
111
112
113
}
while
(
Control
++);
114
115
REPORT
(0)<<
"\nEnd of time loop.\n"
<<
END_REPORT
;
116
117
// this should be palced in each main
118
#include "
finalize.hpp
"
119
pFlow::processors::finalizeProcessors
();
120
121
122
}
123
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
grnParticles
pFlow::grainParticles grnParticles(Control, proprties)
grnInsertion
auto grnInsertion
Definition:
createDEMComponents.hpp:39
Insertions.hpp
pFlow::commandLine
Definition:
commandLine.hpp:36
pFlow::grainParticles::iterate
bool iterate() override
iterate particles
Definition:
grainParticles.cpp:301
createDEMComponents.hpp
interaction.hpp
surfGeometry
auto & surfGeometry
Definition:
setSurfaceGeometry.hpp:26
grainParticles.hpp
phasicFlowKokkos.hpp
pFlow::commandLine::parse
bool parse(int argc, char **argv)
Definition:
commandLine.cpp:50
pFlow::grainParticles::beforeIteration
bool beforeIteration() override
before iteration step
Definition:
grainParticles.cpp:278
pFlow::particles::afterIteration
bool afterIteration() override
This is called in time loop, after iterate.
Definition:
particles.cpp:110
geometry.hpp
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
property.hpp
grnInteraction
auto & grnInteraction
Definition:
createDEMComponents.hpp:50
vocabs.hpp
commandLine.hpp
main
int main(int argc, char *argv[])
DEM solver for simulating granular flow of cohesion-less particles.
Definition:
grainGranFlow.cpp:54
Control
auto & Control
Definition:
initialize_Control.hpp:47
finalize.hpp
solvers
grainGranFlow
grainGranFlow.cpp
Generated by
1.8.17