-

+
+
+## **PhasicFlow: High-Performance Discrete Element Method Simulations**
-**PhasicFlow** is a parallel C++ code for performing DEM simulations. It can run on shared-memory multi-core computational units such as multi-core CPUs or GPUs (for now it works on CUDA-enabled GPUs). The parallelization method mainly relies on loop-level parallelization on a shared-memory computational unit. You can build and run PhasicFlow in serial mode on regular PCs, in parallel mode for multi-core CPUs, or build it for a GPU device to off-load computations to a GPU. In its current statues you can simulate millions of particles (up to 80M particles tested) on a single desktop computer. You can see the [performance tests of PhasicFlow](https://github.com/PhasicFlow/phasicFlow/wiki/Performance-of-phasicFlow) in the wiki page.
+PhasicFlow is a robust, open-source C++ framework designed for the efficient simulation of granular materials using the Discrete Element Method (DEM). Leveraging parallel computing paradigms, PhasicFlow is capable of executing simulations on shared-memory multi-core architectures, including CPUs and NVIDIA GPUs (CUDA-enabled). The core parallelization strategy focuses on loop-level parallelism, enabling significant performance gains on modern hardware. Users can seamlessly transition between serial execution on standard PCs, parallel execution on multi-core CPUs (OpenMP), and accelerated simulations on GPUs. Currently, PhasicFlow supports simulations involving up to 80 million particles on a single desktop workstation. Detailed performance benchmarks are available on the [PhasicFlow Wiki](https://github.com/PhasicFlow/phasicFlow/wiki/Performance-of-phasicFlow).
-**MPI** parallelization with dynamic load balancing is under development. With this level of parallelization, PhasicFlow can leverage the computational power of **multi-gpu** workstations or clusters with distributed memory CPUs.
-In summary PhasicFlow can have 6 execution modes:
-1. Serial on a single CPU core,
-2. Parallel on a multi-core computer/node (using OpenMP),
-3. Parallel on an nvidia-GPU (using Cuda),
-4. Parallel on distributed memory workstation (Using MPI)
-5. Parallel on distributed memory workstations with multi-core nodes (using MPI+OpenMP)
-6. Parallel on workstations with multiple GPUs (using MPI+Cuda).
-## How to build?
-You can build PhasicFlow for CPU and GPU executions. The latest release of PhasicFlow is v-0.1. [Here is a complete step-by-step procedure for building phasicFlow-v-0.1.](https://github.com/PhasicFlow/phasicFlow/wiki/How-to-Build-PhasicFlow).
+**Scalable Parallelism: MPI Integration**
-## Online code documentation
-You can find a full documentation of the code, its features, and other related materials on [online documentation of the code](https://phasicflow.github.io/phasicFlow/)
+Ongoing development includes the integration of MPI-based parallelization with dynamic load balancing. This enhancement will extend PhasicFlow's capabilities to distributed memory environments, such as multi-GPU workstations and high-performance computing clusters. Upon completion, PhasicFlow will offer six distinct execution modes:
-## How to use PhasicFlow?
-You can navigate into [tutorials folder](./tutorials) in the phasicFlow folder to see some simulation case setups. If you need more detailed discription, visit our [wiki page tutorials](https://github.com/PhasicFlow/phasicFlow/wiki/Tutorials).
+1. **Serial Execution:** Single-core CPU.
+2. **Shared-Memory Parallelism:** Multi-core CPU (OpenMP).
+3. **GPU Acceleration:** NVIDIA GPU (CUDA).
+4. **Distributed-Memory Parallelism:** MPI.
+5. **Hybrid Parallelism:** MPI + OpenMP.
+6. **Multi-GPU Parallelism:** MPI + CUDA.
-## [PhasicFlowPlus](https://github.com/PhasicFlow/PhasicFlowPlus)
-PhasicFlowPlus is and extension to PhasicFlow for simulating particle-fluid systems using resolved and unresolved CFD-DEM. [See the repository of this package.](https://github.com/PhasicFlow/PhasicFlowPlus)
+## **Build and Installation**
+PhasicFlow can be compiled for both CPU and GPU execution.
-## Supporting packages
-* [Kokkos](https://github.com/kokkos/kokkos) from National Technology & Engineering Solutions of Sandia, LLC (NTESS)
-* [CLI11 1.8](https://github.com/CLIUtils/CLI11) from University of Cincinnati.
+* **Current Development (v-1.0):** Comprehensive build instructions are available [here](https://github.com/PhasicFlow/phasicFlow/wiki/How-to-build-PhasicFlow%E2%80%90v%E2%80%901.0).
+* **Latest Release (v-0.1):** Detailed build instructions are available [here](https://github.com/PhasicFlow/phasicFlow/wiki/How-to-Build-PhasicFlow).
+
+## **Comprehensive Documentation**
+
+In-depth documentation, including code structure, features, and usage guidelines, is accessible via the [online documentation portal](https://phasicflow.github.io/phasicFlow/).
+
+### **Tutorials and Examples**
+
+Practical examples and simulation setups are provided in the [tutorials directory](./tutorials). For detailed explanations and step-by-step guides, please refer to the [tutorial section on the PhasicFlow Wiki](https://github.com/PhasicFlow/phasicFlow/wiki/Tutorials).
+
+## Contributing to PhasicFlow
+We welcome contributions to PhasicFlow! Whether you're a developer or a new user, there are many ways to get involved. Here's how you can help:
+1. Bug Reports
+2. Suggestions for better user experience
+3. Feature request and algorithm improvements
+4. Tutorials, Simulation Case Setups and documentation
+5. Direct Code Contributions
+
+For more details on how you can contribute to PhasicFlow see [this page](https://github.com/PhasicFlow/phasicFlow/wiki/How-to-contribute-to-PhasicFlow).
+
+## **PhasicFlowPlus: Coupled CFD-DEM Simulations**
+
+PhasicFlowPlus is an extension of PhasicFlow that facilitates the simulation of particle-fluid systems using resolved and unresolved CFD-DEM methods. The repository for PhasicFlowPlus can be found [here](https://github.com/PhasicFlow/PhasicFlowPlus).
+
+## How to cite PhasicFlow?
-## How to cite PhasicFlow
If you are using PhasicFlow in your research or industrial work, cite the following [article](https://www.sciencedirect.com/science/article/pii/S0010465523001662):
+
```
-@article{NOROUZI2023108821,
-title = {PhasicFlow: A parallel, multi-architecture open-source code for DEM simulations},
-journal = {Computer Physics Communications},
-volume = {291},
-pages = {108821},
-year = {2023},
-issn = {0010-4655},
-doi = {https://doi.org/10.1016/j.cpc.2023.108821},
-url = {https://www.sciencedirect.com/science/article/pii/S0010465523001662},
-author = {H.R. Norouzi},
-keywords = {Discrete element method, Parallel computing, CUDA, GPU, OpenMP, Granular flow}
+@article
+{
+ NOROUZI2023108821,
+ title = {PhasicFlow: A parallel, multi-architecture open-source code for DEM simulations},
+ journal = {Computer Physics Communications},
+ volume = {291},
+ pages = {108821},
+ year = {2023},
+ issn = {0010-4655},
+ doi = {https://doi.org/10.1016/j.cpc.2023.108821},
+ url = {https://www.sciencedirect.com/science/article/pii/S0010465523001662},
+ author = {H.R. Norouzi},
+ keywords = {Discrete element method, Parallel computing, CUDA, GPU, OpenMP, Granular flow}
}
```
+
+
+## **Dependencies**
+
+PhasicFlow relies on the following external libraries:
+
+* **Kokkos:** A community-led performance portability ecosystem within the Linux Foundation's High-Performance Software Foundation (HPSF). ([https://github.com/kokkos/kokkos](https://github.com/kokkos/kokkos))
+* **CLI11 1.8:** A command-line interface parser developed by the University of Cincinnati. ([https://github.com/CLIUtils/CLI11](https://github.com/CLIUtils/CLI11))
diff --git a/benchmarks/helicalMixer_4MParticles/caseSetup/interaction b/benchmarks/helicalMixer/caseSetup/interaction
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/caseSetup/interaction
rename to benchmarks/helicalMixer/caseSetup/interaction
diff --git a/benchmarks/helicalMixer_4MParticles/caseSetup/particleInsertion b/benchmarks/helicalMixer/caseSetup/particleInsertion
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/caseSetup/particleInsertion
rename to benchmarks/helicalMixer/caseSetup/particleInsertion
diff --git a/benchmarks/helicalMixer_4MParticles/caseSetup/sphereShape b/benchmarks/helicalMixer/caseSetup/sphereShape
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/caseSetup/sphereShape
rename to benchmarks/helicalMixer/caseSetup/sphereShape
diff --git a/benchmarks/helicalMixer_4MParticles/cleanThisCase b/benchmarks/helicalMixer/cleanThisCase
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/cleanThisCase
rename to benchmarks/helicalMixer/cleanThisCase
diff --git a/benchmarks/helicalMixer/readme.md b/benchmarks/helicalMixer/readme.md
new file mode 100644
index 00000000..57bec363
--- /dev/null
+++ b/benchmarks/helicalMixer/readme.md
@@ -0,0 +1 @@
+# Helical Mixer Benchmark (phasicFlow v-1.0)
diff --git a/benchmarks/helicalMixer_4MParticles/runThisCase b/benchmarks/helicalMixer/runThisCase
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/runThisCase
rename to benchmarks/helicalMixer/runThisCase
diff --git a/benchmarks/helicalMixer_4MParticles/settings/geometryDict b/benchmarks/helicalMixer/settings/geometryDict
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/settings/geometryDict
rename to benchmarks/helicalMixer/settings/geometryDict
diff --git a/benchmarks/helicalMixer_4MParticles/settings/particlesDict b/benchmarks/helicalMixer/settings/particlesDict
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/settings/particlesDict
rename to benchmarks/helicalMixer/settings/particlesDict
diff --git a/benchmarks/helicalMixer_4MParticles/settings/settingsDict b/benchmarks/helicalMixer/settings/settingsDict
similarity index 100%
rename from benchmarks/helicalMixer_4MParticles/settings/settingsDict
rename to benchmarks/helicalMixer/settings/settingsDict
diff --git a/benchmarks/readme.md b/benchmarks/readme.md
new file mode 100644
index 00000000..888bab60
--- /dev/null
+++ b/benchmarks/readme.md
@@ -0,0 +1,7 @@
+
+# Benchmarks
+
+Benchmakrs has been done on two different simulations: a simulation with simple geometry (rotating drum) and a simulation with complex geometry (helical mixer).
+
+- [rotating drum](./rotatingDrum/readme.md)
+- [helical mixer](./helicalMixer/readme.md)
\ No newline at end of file
diff --git a/benchmarks/rotatingDrum/images/commericalDEMsnapshot.png b/benchmarks/rotatingDrum/images/commericalDEMsnapshot.png
new file mode 100644
index 00000000..3dd8e08f
Binary files /dev/null and b/benchmarks/rotatingDrum/images/commericalDEMsnapshot.png differ
diff --git a/benchmarks/rotatingDrum/images/performance1.png b/benchmarks/rotatingDrum/images/performance1.png
new file mode 100644
index 00000000..ce9828ff
Binary files /dev/null and b/benchmarks/rotatingDrum/images/performance1.png differ
diff --git a/benchmarks/rotatingDrum/images/phasicFlow_snapshot.png b/benchmarks/rotatingDrum/images/phasicFlow_snapshot.png
new file mode 100644
index 00000000..33b2999d
Binary files /dev/null and b/benchmarks/rotatingDrum/images/phasicFlow_snapshot.png differ
diff --git a/benchmarks/rotatingDrum/readme.md b/benchmarks/rotatingDrum/readme.md
new file mode 100644
index 00000000..ad3d8121
--- /dev/null
+++ b/benchmarks/rotatingDrum/readme.md
@@ -0,0 +1,96 @@
+# Rotating Drum Benchmark (phasicFlow v-1.0)
+
+## Overview
+
+This benchmark compares the performance of phasicFlow with a well-stablished commercial DEM software for simulating a rotating drum with varying particle counts (250k to 8M particles). The benchmark measures both computational efficiency and memory usage across different hardware configurations.
+
+## Simulation Setup
+
+
+

+
+
Figure 1. Commercial DEM simulation snapshot
+
+
+
+
+

+
+
Figure 2. phasicFlow simulation snapshot and visualized using Paraview
+
+
+
+### Hardware Specifications
+
+
+ Table 1. Hardware specifications used for benchmarking.
+
+
+| System | CPU | GPU | Operating System |
+| :---------: | :----------------------: | :--------------------------: | :--------------: |
+| Laptop | Intel i9-13900HX 2.2 GHz | NVIDIA GeForce RTX 4050Ti 6G | Windows 11 24H2 |
+| Workstation | Intel Xeon 4210 2.2 GHz | NVIDIA RTX A4000 16G | Ubuntu 22.04 |
+
+### Simulation Parameters
+
+
+ Table 2. Parameters for rotating drum simulations.
+
+
+| Case | Particle Diameter | Particle Count | Drum Length | Drum Radius |
+| :-------: | :---------------: | :--------------: | :------------------: | :------------------: |
+| 250k | 6 mm | 250,000 | 0.8 m | 0.2 m |
+| 500k | 5 mm | 500,000 | 0.8 m | 0.2 m |
+| 1M | 4 mm | 1,000,000 | 0.8 m | 0.2 m |
+| 2M | 3 mm | 2,000,000 | 1.2 m | 0.2 m |
+| 4M | 3 mm | 4,000,000 | 1.6 m | 0.2 m |
+| 8M | 2 mm | 8,000,000 | 1.6 m | 0.2 m |
+
+The time step for all simulations was set to 1.0e-5 seconds and the simulation ran for 4 seconds.
+
+## Performance Comparison
+
+### Execution Time
+
+
+ Table 3. Total calculation time (minutes) for different configurations.
+
+
+| Software | 250k | 500k | 1M | 2M | 4M | 8M |
+| :---------------: | :----: | :-----: | :-----: | :-----: | :-----: | :------: |
+| phasicFlow-4050Ti | 54 min | 111 min | 216 min | 432 min | - | - |
+| Commercial DEM-4050Ti | 68 min | 136 min | 275 min | 570 min | - | - |
+| phasicFlow-A4000 | 38 min | 73 min | 146 min | 293 min | 589 min | 1188 min |
+
+The execution time scales linearly with particle count. phasicFlow demonstrates approximately:
+
+- 20% faster calculation than the well-established commercial DEM software on the same hardware
+- 30% performance improvement when using the NVIDIA RTX A4000 compared to the RTX 4050Ti
+
+
+

+
Figure 3. Calculation time comparison between phasicFlow and the well-established commercial DEM software.
+
+
+### Memory Usage
+
+
+ Table 4. Memory consumption for different configurations.
+
+
+| Software | 250k | 500k | 1M | 2M | 4M | 8M |
+| :---------------: | :-----: | :-----: | :-----: | :-----: | :-----: | :-----: |
+| phasicFlow-4050Ti | 252 MB | 412 MB | 710 MB | 1292 MB | - | - |
+| Commercial DEM-4050Ti | 485 MB | 897 MB | 1525 MB | 2724 MB | - | - |
+| phasicFlow-A4000 | 344 MB | 480 MB | 802 MB | 1386 MB | 2590 MB | 4966 MB |
+
+Memory efficiency comparison:
+
+- phasicFlow uses approximately 0.7 GB of memory per million particles
+- Commercial DEM software uses approximately 1.2 GB of memory per million particles
+- phasicFlow shows ~42% lower memory consumption compared to the commercial alternative
+- The memory usage scales linearly with particle count in both software packages. But due to memory limitations on GPUs, it is possible to run larger simulation on GPUs with phasicFlow.
+
+## Run Your Own Benchmarks
+
+The simulation case setup files are available in this folder for users interested in performing similar benchmarks on their own hardware. These files can be used to reproduce the tests and compare performance across different systems.
diff --git a/benchmarks/rotatingDrum/rotatingDrum_1mParticles/caseSetup/interaction b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/caseSetup/interaction
new file mode 100644
index 00000000..4ef2c32f
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/caseSetup/interaction
@@ -0,0 +1,60 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName interaction;
+objectType dictionary;
+fileFormat ASCII;
+
+/*---------------------------------------------------------------------------*/
+
+materials (glassMat wallMat); // a list of materials names
+
+densities (2500.0 2500); // density of materials [kg/m3]
+
+contactListType sortedContactList;
+
+contactSearch
+{
+ method NBS;
+
+ updateInterval 20;
+
+ sizeRatio 1.1;
+
+ cellExtent 0.55;
+
+ adjustableBox Yes;
+}
+
+model
+{
+ contactForceModel nonLinearLimited;
+
+ rollingFrictionModel normal;
+
+ /*
+ Property (glassMat-glassMat glassMat-wallMat
+ wallMat-wallMat);
+ */
+
+ Yeff (1.0e6 1.0e6
+ 1.0e6); // Young modulus [Pa]
+
+ Geff (0.8e6 0.8e6
+ 0.8e6); // Shear modulus [Pa]
+
+ nu (0.25 0.25
+ 0.25); // Poisson's ratio [-]
+
+ en (0.97 0.85
+ 1.00); // coefficient of normal restitution
+
+ mu (0.65 0.65
+ 0.65); // dynamic friction
+
+ mur (0.1 0.1
+ 0.1); // rolling friction
+}
+
diff --git a/benchmarks/rotatingDrum/rotatingDrum_1mParticles/caseSetup/shapes b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/caseSetup/shapes
new file mode 100644
index 00000000..c2302c64
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/caseSetup/shapes
@@ -0,0 +1,15 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName shapes;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+
+names (glassBead); // names of shapes
+
+diameters (0.004); // diameter of shapes
+
+materials (glassMat); // material names for shapes
diff --git a/benchmarks/rotatingDrum_4MParticles/cleanThisCase b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/cleanThisCase
similarity index 100%
rename from benchmarks/rotatingDrum_4MParticles/cleanThisCase
rename to benchmarks/rotatingDrum/rotatingDrum_1mParticles/cleanThisCase
diff --git a/benchmarks/rotatingDrum_4MParticles/runThisCase b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/runThisCase
similarity index 100%
rename from benchmarks/rotatingDrum_4MParticles/runThisCase
rename to benchmarks/rotatingDrum/rotatingDrum_1mParticles/runThisCase
diff --git a/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/domainDict b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/domainDict
new file mode 100644
index 00000000..ec704467
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/domainDict
@@ -0,0 +1,50 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName domainDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+globalBox // Simulation domain: every particles that goes outside this domain will be deleted
+{
+ min (-0.2 -0.2 0.0);
+ max ( 0.2 0.2 0.8);
+}
+
+boundaries
+{
+ neighborListUpdateInterval 200;
+
+ updateInterval 20;
+
+ left
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ right
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ bottom
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ top
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ rear
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ front
+ {
+ type exit; // other options: periodic, reflective
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/geometryDict b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/geometryDict
new file mode 100644
index 00000000..e2a0c797
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/geometryDict
@@ -0,0 +1,86 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName geometryDict;
+objectType dictionary;
+fileFormat ASCII;
+
+motionModel rotatingAxis; // motion model: rotating object around an axis
+
+rotatingAxisInfo // information for rotatingAxisMotion motion model
+{
+ rotAxis
+ {
+ p1 (0.0 0.0 0.0); // first point for the axis of rotation
+
+ p2 (0.0 0.0 1.0); // second point for the axis of rotation
+
+ omega 1.256; // rotation speed (rad/s) => 12 rpm
+ }
+}
+
+surfaces
+{
+ cylinder
+ {
+ type cylinderWall; // type of the wall
+
+ p1 (0.0 0.0 0.0); // begin point of cylinder axis
+
+ p2 (0.0 0.0 0.8); // end point of cylinder axis
+
+ radius1 0.2; // radius at p1
+
+ radius2 0.2; // radius at p2
+
+ resolution 60; // number of divisions
+
+ material wallMat; // material name of this wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the rear end of cylinder
+ */
+
+ wall1
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.0); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.0); // second point
+
+ p3 ( 0.2 0.2 0.0); // third point
+
+ p4 (-0.2 0.2 0.0); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the front end of cylinder
+ */
+
+ wall2
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.8); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.8); // second point
+
+ p3 ( 0.2 0.2 0.8); // third point
+
+ p4 (-0.2 0.2 0.8); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/particlesDict b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/particlesDict
new file mode 100644
index 00000000..f395b571
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/particlesDict
@@ -0,0 +1,47 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName particlesDict;
+objectType dictionary;
+fileFormat ASCII;
+
+setFields
+{
+ defaultValue
+ {
+ velocity realx3 (0 0 0); // linear velocity (m/s)
+ acceleration realx3 (0 0 0); // linear acceleration (m/s2)
+ rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
+ shapeName word glassBead; // name of the particle shape
+ }
+
+ selectors
+ {}
+}
+
+positionParticles
+{
+ method ordered;
+
+ orderedInfo
+ {
+ distance 0.004; // minimum space between centers of particles
+
+ numPoints 1000000; // number of particles in the simulation
+
+ axisOrder (z x y); // axis order for filling the space with particles
+ }
+
+ regionType cylinder; // other options: box and sphere
+
+ cylinderInfo // cylinder for positioning particles
+ {
+ p1 (0.0 0.0 0.01); // lower corner point of the box
+
+ p2 (0.0 0.0 0.79); // upper corner point of the box
+
+ radius 0.195; // radius of cylinder
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/settingsDict b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/settingsDict
new file mode 100644
index 00000000..e98fa06a
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_1mParticles/settings/settingsDict
@@ -0,0 +1,34 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName settingsDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+run rotatingDrum_1mParticles;
+
+dt 0.00001; // time step for integration (s)
+
+startTime 0; // start time for simulation
+
+endTime 4; // end time for simulation
+
+saveInterval 0.2; // time interval for saving the simulation
+
+timePrecision 5; // maximum number of digits for time folder
+
+g (0 -9.8 0); // gravity vector (m/s2)
+
+includeObjects (diameter); // save necessary (i.e., required) data on disk
+
+// exclude unnecessary data from saving on disk
+excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
+
+integrationMethod AdamsBashforth2; // integration method
+
+writeFormat binary; // data writting format (ascii or binary)
+
+timersReport Yes;
+
+timersReportInterval 0.01;
diff --git a/benchmarks/rotatingDrum/rotatingDrum_250kParticles/caseSetup/interaction b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/caseSetup/interaction
new file mode 100644
index 00000000..4ef2c32f
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/caseSetup/interaction
@@ -0,0 +1,60 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName interaction;
+objectType dictionary;
+fileFormat ASCII;
+
+/*---------------------------------------------------------------------------*/
+
+materials (glassMat wallMat); // a list of materials names
+
+densities (2500.0 2500); // density of materials [kg/m3]
+
+contactListType sortedContactList;
+
+contactSearch
+{
+ method NBS;
+
+ updateInterval 20;
+
+ sizeRatio 1.1;
+
+ cellExtent 0.55;
+
+ adjustableBox Yes;
+}
+
+model
+{
+ contactForceModel nonLinearLimited;
+
+ rollingFrictionModel normal;
+
+ /*
+ Property (glassMat-glassMat glassMat-wallMat
+ wallMat-wallMat);
+ */
+
+ Yeff (1.0e6 1.0e6
+ 1.0e6); // Young modulus [Pa]
+
+ Geff (0.8e6 0.8e6
+ 0.8e6); // Shear modulus [Pa]
+
+ nu (0.25 0.25
+ 0.25); // Poisson's ratio [-]
+
+ en (0.97 0.85
+ 1.00); // coefficient of normal restitution
+
+ mu (0.65 0.65
+ 0.65); // dynamic friction
+
+ mur (0.1 0.1
+ 0.1); // rolling friction
+}
+
diff --git a/benchmarks/rotatingDrum/rotatingDrum_250kParticles/caseSetup/shapes b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/caseSetup/shapes
new file mode 100644
index 00000000..b8aadc13
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/caseSetup/shapes
@@ -0,0 +1,15 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName shapes;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+
+names (glassBead); // names of shapes
+
+diameters (0.006); // diameter of shapes
+
+materials (glassMat); // material names for shapes
diff --git a/tutorials/sphereGranFlow/toteblender/cleanThisCase b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/cleanThisCase
old mode 100644
new mode 100755
similarity index 100%
rename from tutorials/sphereGranFlow/toteblender/cleanThisCase
rename to benchmarks/rotatingDrum/rotatingDrum_250kParticles/cleanThisCase
diff --git a/tutorials/sphereGranFlow/toteblender/runThisCase b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/runThisCase
old mode 100644
new mode 100755
similarity index 100%
rename from tutorials/sphereGranFlow/toteblender/runThisCase
rename to benchmarks/rotatingDrum/rotatingDrum_250kParticles/runThisCase
diff --git a/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/domainDict b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/domainDict
new file mode 100644
index 00000000..ec704467
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/domainDict
@@ -0,0 +1,50 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName domainDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+globalBox // Simulation domain: every particles that goes outside this domain will be deleted
+{
+ min (-0.2 -0.2 0.0);
+ max ( 0.2 0.2 0.8);
+}
+
+boundaries
+{
+ neighborListUpdateInterval 200;
+
+ updateInterval 20;
+
+ left
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ right
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ bottom
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ top
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ rear
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ front
+ {
+ type exit; // other options: periodic, reflective
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/geometryDict b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/geometryDict
new file mode 100644
index 00000000..e2a0c797
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/geometryDict
@@ -0,0 +1,86 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName geometryDict;
+objectType dictionary;
+fileFormat ASCII;
+
+motionModel rotatingAxis; // motion model: rotating object around an axis
+
+rotatingAxisInfo // information for rotatingAxisMotion motion model
+{
+ rotAxis
+ {
+ p1 (0.0 0.0 0.0); // first point for the axis of rotation
+
+ p2 (0.0 0.0 1.0); // second point for the axis of rotation
+
+ omega 1.256; // rotation speed (rad/s) => 12 rpm
+ }
+}
+
+surfaces
+{
+ cylinder
+ {
+ type cylinderWall; // type of the wall
+
+ p1 (0.0 0.0 0.0); // begin point of cylinder axis
+
+ p2 (0.0 0.0 0.8); // end point of cylinder axis
+
+ radius1 0.2; // radius at p1
+
+ radius2 0.2; // radius at p2
+
+ resolution 60; // number of divisions
+
+ material wallMat; // material name of this wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the rear end of cylinder
+ */
+
+ wall1
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.0); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.0); // second point
+
+ p3 ( 0.2 0.2 0.0); // third point
+
+ p4 (-0.2 0.2 0.0); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the front end of cylinder
+ */
+
+ wall2
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.8); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.8); // second point
+
+ p3 ( 0.2 0.2 0.8); // third point
+
+ p4 (-0.2 0.2 0.8); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/particlesDict b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/particlesDict
new file mode 100644
index 00000000..b096c0cc
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/particlesDict
@@ -0,0 +1,47 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName particlesDict;
+objectType dictionary;
+fileFormat ASCII;
+
+setFields
+{
+ defaultValue
+ {
+ velocity realx3 (0 0 0); // linear velocity (m/s)
+ acceleration realx3 (0 0 0); // linear acceleration (m/s2)
+ rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
+ shapeName word glassBead; // name of the particle shape
+ }
+
+ selectors
+ {}
+}
+
+positionParticles
+{
+ method ordered;
+
+ orderedInfo
+ {
+ distance 0.006; // minimum space between centers of particles
+
+ numPoints 250000; // number of particles in the simulation
+
+ axisOrder (z x y); // axis order for filling the space with particles
+ }
+
+ regionType cylinder; // other options: box and sphere
+
+ cylinderInfo // cylinder for positioning particles
+ {
+ p1 (0.0 0.0 0.01); // lower corner point of the box
+
+ p2 (0.0 0.0 0.79); // upper corner point of the box
+
+ radius 0.195; // radius of cylinder
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/settingsDict b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/settingsDict
new file mode 100644
index 00000000..6f971c6f
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_250kParticles/settings/settingsDict
@@ -0,0 +1,34 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName settingsDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+run rotatingDrum_250KParticles;
+
+dt 0.00001; // time step for integration (s)
+
+startTime 0; // start time for simulation
+
+endTime 4; // end time for simulation
+
+saveInterval 0.2; // time interval for saving the simulation
+
+timePrecision 5; // maximum number of digits for time folder
+
+g (0 -9.8 0); // gravity vector (m/s2)
+
+includeObjects (diameter); // save necessary (i.e., required) data on disk
+
+// exclude unnecessary data from saving on disk
+excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
+
+integrationMethod AdamsBashforth2; // integration method
+
+writeFormat binary; // data writting format (ascii or binary)
+
+timersReport Yes;
+
+timersReportInterval 0.01;
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/caseSetup/interaction b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/caseSetup/interaction
new file mode 100644
index 00000000..4ef2c32f
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/caseSetup/interaction
@@ -0,0 +1,60 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName interaction;
+objectType dictionary;
+fileFormat ASCII;
+
+/*---------------------------------------------------------------------------*/
+
+materials (glassMat wallMat); // a list of materials names
+
+densities (2500.0 2500); // density of materials [kg/m3]
+
+contactListType sortedContactList;
+
+contactSearch
+{
+ method NBS;
+
+ updateInterval 20;
+
+ sizeRatio 1.1;
+
+ cellExtent 0.55;
+
+ adjustableBox Yes;
+}
+
+model
+{
+ contactForceModel nonLinearLimited;
+
+ rollingFrictionModel normal;
+
+ /*
+ Property (glassMat-glassMat glassMat-wallMat
+ wallMat-wallMat);
+ */
+
+ Yeff (1.0e6 1.0e6
+ 1.0e6); // Young modulus [Pa]
+
+ Geff (0.8e6 0.8e6
+ 0.8e6); // Shear modulus [Pa]
+
+ nu (0.25 0.25
+ 0.25); // Poisson's ratio [-]
+
+ en (0.97 0.85
+ 1.00); // coefficient of normal restitution
+
+ mu (0.65 0.65
+ 0.65); // dynamic friction
+
+ mur (0.1 0.1
+ 0.1); // rolling friction
+}
+
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/caseSetup/shapes b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/caseSetup/shapes
new file mode 100644
index 00000000..d08fdf86
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/caseSetup/shapes
@@ -0,0 +1,15 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName shapes;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+
+names (glassBead); // names of shapes
+
+diameters (0.003); // diameter of shapes
+
+materials (glassMat); // material names for shapes
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/cleanThisCase b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/cleanThisCase
new file mode 100755
index 00000000..8a0ab919
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/cleanThisCase
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+
+ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
+rm -rf VTK
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/runThisCase b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/runThisCase
new file mode 100755
index 00000000..c48d71fe
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/runThisCase
@@ -0,0 +1,21 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+echo "\n<--------------------------------------------------------------------->"
+echo "1) Creating particles"
+echo "<--------------------------------------------------------------------->\n"
+particlesPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "2) Creating geometry"
+echo "<--------------------------------------------------------------------->\n"
+geometryPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "3) Running the case"
+echo "<--------------------------------------------------------------------->\n"
+sphereGranFlow
+
+
+
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/domainDict b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/domainDict
new file mode 100644
index 00000000..1b4718fd
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/domainDict
@@ -0,0 +1,50 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName domainDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+globalBox // Simulation domain: every particles that goes outside this domain will be deleted
+{
+ min (-0.2 -0.2 0.0);
+ max ( 0.2 0.2 1.2);
+}
+
+boundaries
+{
+ neighborListUpdateInterval 200;
+
+ updateInterval 20;
+
+ left
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ right
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ bottom
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ top
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ rear
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ front
+ {
+ type exit; // other options: periodic, reflective
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/geometryDict b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/geometryDict
new file mode 100644
index 00000000..2b92233c
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/geometryDict
@@ -0,0 +1,86 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName geometryDict;
+objectType dictionary;
+fileFormat ASCII;
+
+motionModel rotatingAxis; // motion model: rotating object around an axis
+
+rotatingAxisInfo // information for rotatingAxisMotion motion model
+{
+ rotAxis
+ {
+ p1 (0.0 0.0 0.0); // first point for the axis of rotation
+
+ p2 (0.0 0.0 1.0); // second point for the axis of rotation
+
+ omega 1.256; // rotation speed (rad/s) => 12 rpm
+ }
+}
+
+surfaces
+{
+ cylinder
+ {
+ type cylinderWall; // type of the wall
+
+ p1 (0.0 0.0 0.0); // begin point of cylinder axis
+
+ p2 (0.0 0.0 1.2); // end point of cylinder axis
+
+ radius1 0.2; // radius at p1
+
+ radius2 0.2; // radius at p2
+
+ resolution 60; // number of divisions
+
+ material wallMat; // material name of this wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the rear end of cylinder
+ */
+
+ wall1
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.0); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.0); // second point
+
+ p3 ( 0.2 0.2 0.0); // third point
+
+ p4 (-0.2 0.2 0.0); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the front end of cylinder
+ */
+
+ wall2
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 1.2); // first point of the wall
+
+ p2 ( 0.2 -0.2 1.2); // second point
+
+ p3 ( 0.2 0.2 1.2); // third point
+
+ p4 (-0.2 0.2 1.2); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/particlesDict b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/particlesDict
new file mode 100644
index 00000000..ca61762a
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/particlesDict
@@ -0,0 +1,47 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName particlesDict;
+objectType dictionary;
+fileFormat ASCII;
+
+setFields
+{
+ defaultValue
+ {
+ velocity realx3 (0 0 0); // linear velocity (m/s)
+ acceleration realx3 (0 0 0); // linear acceleration (m/s2)
+ rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
+ shapeName word glassBead; // name of the particle shape
+ }
+
+ selectors
+ {}
+}
+
+positionParticles
+{
+ method ordered;
+
+ orderedInfo
+ {
+ distance 0.003; // minimum space between centers of particles
+
+ numPoints 2000000; // number of particles in the simulation
+
+ axisOrder (z x y); // axis order for filling the space with particles
+ }
+
+ regionType cylinder; // other options: box and sphere
+
+ cylinderInfo // cylinder for positioning particles
+ {
+ p1 (0.0 0.0 0.01); // lower corner point of the box
+
+ p2 (0.0 0.0 1.19); // upper corner point of the box
+
+ radius 0.195; // radius of cylinder
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/settingsDict b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/settingsDict
new file mode 100644
index 00000000..b53afca8
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_2mParticles/settings/settingsDict
@@ -0,0 +1,34 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName settingsDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+run rotatingDrum_2mParticles;
+
+dt 0.00001; // time step for integration (s)
+
+startTime 0; // start time for simulation
+
+endTime 4; // end time for simulation
+
+saveInterval 0.2; // time interval for saving the simulation
+
+timePrecision 5; // maximum number of digits for time folder
+
+g (0 -9.8 0); // gravity vector (m/s2)
+
+includeObjects (diameter); // save necessary (i.e., required) data on disk
+
+// exclude unnecessary data from saving on disk
+excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
+
+integrationMethod AdamsBashforth2; // integration method
+
+writeFormat binary; // data writting format (ascii or binary)
+
+timersReport Yes;
+
+timersReportInterval 0.01;
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/caseSetup/interaction b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/caseSetup/interaction
new file mode 100644
index 00000000..4ef2c32f
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/caseSetup/interaction
@@ -0,0 +1,60 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName interaction;
+objectType dictionary;
+fileFormat ASCII;
+
+/*---------------------------------------------------------------------------*/
+
+materials (glassMat wallMat); // a list of materials names
+
+densities (2500.0 2500); // density of materials [kg/m3]
+
+contactListType sortedContactList;
+
+contactSearch
+{
+ method NBS;
+
+ updateInterval 20;
+
+ sizeRatio 1.1;
+
+ cellExtent 0.55;
+
+ adjustableBox Yes;
+}
+
+model
+{
+ contactForceModel nonLinearLimited;
+
+ rollingFrictionModel normal;
+
+ /*
+ Property (glassMat-glassMat glassMat-wallMat
+ wallMat-wallMat);
+ */
+
+ Yeff (1.0e6 1.0e6
+ 1.0e6); // Young modulus [Pa]
+
+ Geff (0.8e6 0.8e6
+ 0.8e6); // Shear modulus [Pa]
+
+ nu (0.25 0.25
+ 0.25); // Poisson's ratio [-]
+
+ en (0.97 0.85
+ 1.00); // coefficient of normal restitution
+
+ mu (0.65 0.65
+ 0.65); // dynamic friction
+
+ mur (0.1 0.1
+ 0.1); // rolling friction
+}
+
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/caseSetup/shapes b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/caseSetup/shapes
new file mode 100644
index 00000000..d08fdf86
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/caseSetup/shapes
@@ -0,0 +1,15 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName shapes;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+
+names (glassBead); // names of shapes
+
+diameters (0.003); // diameter of shapes
+
+materials (glassMat); // material names for shapes
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/cleanThisCase b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/cleanThisCase
new file mode 100755
index 00000000..8a0ab919
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/cleanThisCase
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+
+ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
+rm -rf VTK
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/runThisCase b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/runThisCase
new file mode 100755
index 00000000..c48d71fe
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/runThisCase
@@ -0,0 +1,21 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+echo "\n<--------------------------------------------------------------------->"
+echo "1) Creating particles"
+echo "<--------------------------------------------------------------------->\n"
+particlesPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "2) Creating geometry"
+echo "<--------------------------------------------------------------------->\n"
+geometryPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "3) Running the case"
+echo "<--------------------------------------------------------------------->\n"
+sphereGranFlow
+
+
+
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/domainDict b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/domainDict
new file mode 100644
index 00000000..b92756a2
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/domainDict
@@ -0,0 +1,50 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName domainDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+globalBox // Simulation domain: every particles that goes outside this domain will be deleted
+{
+ min (-0.2 -0.2 0.0);
+ max ( 0.2 0.2 1.6);
+}
+
+boundaries
+{
+ neighborListUpdateInterval 200;
+
+ updateInterval 20;
+
+ left
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ right
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ bottom
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ top
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ rear
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ front
+ {
+ type exit; // other options: periodic, reflective
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/geometryDict b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/geometryDict
new file mode 100644
index 00000000..dae67a91
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/geometryDict
@@ -0,0 +1,86 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName geometryDict;
+objectType dictionary;
+fileFormat ASCII;
+
+motionModel rotatingAxis; // motion model: rotating object around an axis
+
+rotatingAxisInfo // information for rotatingAxisMotion motion model
+{
+ rotAxis
+ {
+ p1 (0.0 0.0 0.0); // first point for the axis of rotation
+
+ p2 (0.0 0.0 1.0); // second point for the axis of rotation
+
+ omega 1.256; // rotation speed (rad/s) => 12 rpm
+ }
+}
+
+surfaces
+{
+ cylinder
+ {
+ type cylinderWall; // type of the wall
+
+ p1 (0.0 0.0 0.0); // begin point of cylinder axis
+
+ p2 (0.0 0.0 1.6); // end point of cylinder axis
+
+ radius1 0.2; // radius at p1
+
+ radius2 0.2; // radius at p2
+
+ resolution 60; // number of divisions
+
+ material wallMat; // material name of this wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the rear end of cylinder
+ */
+
+ wall1
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.0); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.0); // second point
+
+ p3 ( 0.2 0.2 0.0); // third point
+
+ p4 (-0.2 0.2 0.0); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the front end of cylinder
+ */
+
+ wall2
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 1.6); // first point of the wall
+
+ p2 ( 0.2 -0.2 1.6); // second point
+
+ p3 ( 0.2 0.2 1.6); // third point
+
+ p4 (-0.2 0.2 1.6); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/particlesDict b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/particlesDict
new file mode 100644
index 00000000..fa4c3396
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/particlesDict
@@ -0,0 +1,47 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName particlesDict;
+objectType dictionary;
+fileFormat ASCII;
+
+setFields
+{
+ defaultValue
+ {
+ velocity realx3 (0 0 0); // linear velocity (m/s)
+ acceleration realx3 (0 0 0); // linear acceleration (m/s2)
+ rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
+ shapeName word glassBead; // name of the particle shape
+ }
+
+ selectors
+ {}
+}
+
+positionParticles
+{
+ method ordered;
+
+ orderedInfo
+ {
+ distance 0.003; // minimum space between centers of particles
+
+ numPoints 4000000; // number of particles in the simulation
+
+ axisOrder (z x y); // axis order for filling the space with particles
+ }
+
+ regionType cylinder; // other options: box and sphere
+
+ cylinderInfo // cylinder for positioning particles
+ {
+ p1 (0.0 0.0 0.01); // lower corner point of the box
+
+ p2 (0.0 0.0 1.59); // upper corner point of the box
+
+ radius 0.195; // radius of cylinder
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/settingsDict b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/settingsDict
new file mode 100644
index 00000000..67cbee31
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_4mParticles/settings/settingsDict
@@ -0,0 +1,34 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName settingsDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+run rotatingDrum_4mParticles;
+
+dt 0.00001; // time step for integration (s)
+
+startTime 0; // start time for simulation
+
+endTime 4; // end time for simulation
+
+saveInterval 0.2; // time interval for saving the simulation
+
+timePrecision 5; // maximum number of digits for time folder
+
+g (0 -9.8 0); // gravity vector (m/s2)
+
+includeObjects (diameter); // save necessary (i.e., required) data on disk
+
+// exclude unnecessary data from saving on disk
+excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
+
+integrationMethod AdamsBashforth2; // integration method
+
+writeFormat binary; // data writting format (ascii or binary)
+
+timersReport Yes;
+
+timersReportInterval 0.01;
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/caseSetup/interaction b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/caseSetup/interaction
new file mode 100644
index 00000000..4ef2c32f
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/caseSetup/interaction
@@ -0,0 +1,60 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName interaction;
+objectType dictionary;
+fileFormat ASCII;
+
+/*---------------------------------------------------------------------------*/
+
+materials (glassMat wallMat); // a list of materials names
+
+densities (2500.0 2500); // density of materials [kg/m3]
+
+contactListType sortedContactList;
+
+contactSearch
+{
+ method NBS;
+
+ updateInterval 20;
+
+ sizeRatio 1.1;
+
+ cellExtent 0.55;
+
+ adjustableBox Yes;
+}
+
+model
+{
+ contactForceModel nonLinearLimited;
+
+ rollingFrictionModel normal;
+
+ /*
+ Property (glassMat-glassMat glassMat-wallMat
+ wallMat-wallMat);
+ */
+
+ Yeff (1.0e6 1.0e6
+ 1.0e6); // Young modulus [Pa]
+
+ Geff (0.8e6 0.8e6
+ 0.8e6); // Shear modulus [Pa]
+
+ nu (0.25 0.25
+ 0.25); // Poisson's ratio [-]
+
+ en (0.97 0.85
+ 1.00); // coefficient of normal restitution
+
+ mu (0.65 0.65
+ 0.65); // dynamic friction
+
+ mur (0.1 0.1
+ 0.1); // rolling friction
+}
+
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/caseSetup/shapes b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/caseSetup/shapes
new file mode 100644
index 00000000..962433e2
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/caseSetup/shapes
@@ -0,0 +1,15 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName shapes;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+
+names (glassBead); // names of shapes
+
+diameters (0.005); // diameter of shapes
+
+materials (glassMat); // material names for shapes
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/cleanThisCase b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/cleanThisCase
new file mode 100755
index 00000000..8a0ab919
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/cleanThisCase
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+
+ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
+rm -rf VTK
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/runThisCase b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/runThisCase
new file mode 100755
index 00000000..c48d71fe
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/runThisCase
@@ -0,0 +1,21 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+echo "\n<--------------------------------------------------------------------->"
+echo "1) Creating particles"
+echo "<--------------------------------------------------------------------->\n"
+particlesPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "2) Creating geometry"
+echo "<--------------------------------------------------------------------->\n"
+geometryPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "3) Running the case"
+echo "<--------------------------------------------------------------------->\n"
+sphereGranFlow
+
+
+
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/domainDict b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/domainDict
new file mode 100644
index 00000000..ec704467
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/domainDict
@@ -0,0 +1,50 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName domainDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+globalBox // Simulation domain: every particles that goes outside this domain will be deleted
+{
+ min (-0.2 -0.2 0.0);
+ max ( 0.2 0.2 0.8);
+}
+
+boundaries
+{
+ neighborListUpdateInterval 200;
+
+ updateInterval 20;
+
+ left
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ right
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ bottom
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ top
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ rear
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ front
+ {
+ type exit; // other options: periodic, reflective
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/geometryDict b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/geometryDict
new file mode 100644
index 00000000..e2a0c797
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/geometryDict
@@ -0,0 +1,86 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName geometryDict;
+objectType dictionary;
+fileFormat ASCII;
+
+motionModel rotatingAxis; // motion model: rotating object around an axis
+
+rotatingAxisInfo // information for rotatingAxisMotion motion model
+{
+ rotAxis
+ {
+ p1 (0.0 0.0 0.0); // first point for the axis of rotation
+
+ p2 (0.0 0.0 1.0); // second point for the axis of rotation
+
+ omega 1.256; // rotation speed (rad/s) => 12 rpm
+ }
+}
+
+surfaces
+{
+ cylinder
+ {
+ type cylinderWall; // type of the wall
+
+ p1 (0.0 0.0 0.0); // begin point of cylinder axis
+
+ p2 (0.0 0.0 0.8); // end point of cylinder axis
+
+ radius1 0.2; // radius at p1
+
+ radius2 0.2; // radius at p2
+
+ resolution 60; // number of divisions
+
+ material wallMat; // material name of this wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the rear end of cylinder
+ */
+
+ wall1
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.0); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.0); // second point
+
+ p3 ( 0.2 0.2 0.0); // third point
+
+ p4 (-0.2 0.2 0.0); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the front end of cylinder
+ */
+
+ wall2
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.8); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.8); // second point
+
+ p3 ( 0.2 0.2 0.8); // third point
+
+ p4 (-0.2 0.2 0.8); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/particlesDict b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/particlesDict
new file mode 100644
index 00000000..e0ef3e91
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/particlesDict
@@ -0,0 +1,47 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName particlesDict;
+objectType dictionary;
+fileFormat ASCII;
+
+setFields
+{
+ defaultValue
+ {
+ velocity realx3 (0 0 0); // linear velocity (m/s)
+ acceleration realx3 (0 0 0); // linear acceleration (m/s2)
+ rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
+ shapeName word glassBead; // name of the particle shape
+ }
+
+ selectors
+ {}
+}
+
+positionParticles
+{
+ method ordered;
+
+ orderedInfo
+ {
+ distance 0.005; // minimum space between centers of particles
+
+ numPoints 500000; // number of particles in the simulation
+
+ axisOrder (z x y); // axis order for filling the space with particles
+ }
+
+ regionType cylinder; // other options: box and sphere
+
+ cylinderInfo // cylinder for positioning particles
+ {
+ p1 (0.0 0.0 0.01); // lower corner point of the box
+
+ p2 (0.0 0.0 0.79); // upper corner point of the box
+
+ radius 0.195; // radius of cylinder
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/settingsDict b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/settingsDict
new file mode 100644
index 00000000..f42eacc5
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_500kParticles/settings/settingsDict
@@ -0,0 +1,34 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName settingsDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+run rotatingDrum_500KParticles;
+
+dt 0.00001; // time step for integration (s)
+
+startTime 0; // start time for simulation
+
+endTime 4; // end time for simulation
+
+saveInterval 0.2; // time interval for saving the simulation
+
+timePrecision 5; // maximum number of digits for time folder
+
+g (0 -9.8 0); // gravity vector (m/s2)
+
+includeObjects (diameter); // save necessary (i.e., required) data on disk
+
+// exclude unnecessary data from saving on disk
+excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
+
+integrationMethod AdamsBashforth2; // integration method
+
+writeFormat binary; // data writting format (ascii or binary)
+
+timersReport Yes;
+
+timersReportInterval 0.01;
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/caseSetup/interaction b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/caseSetup/interaction
new file mode 100644
index 00000000..4ef2c32f
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/caseSetup/interaction
@@ -0,0 +1,60 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName interaction;
+objectType dictionary;
+fileFormat ASCII;
+
+/*---------------------------------------------------------------------------*/
+
+materials (glassMat wallMat); // a list of materials names
+
+densities (2500.0 2500); // density of materials [kg/m3]
+
+contactListType sortedContactList;
+
+contactSearch
+{
+ method NBS;
+
+ updateInterval 20;
+
+ sizeRatio 1.1;
+
+ cellExtent 0.55;
+
+ adjustableBox Yes;
+}
+
+model
+{
+ contactForceModel nonLinearLimited;
+
+ rollingFrictionModel normal;
+
+ /*
+ Property (glassMat-glassMat glassMat-wallMat
+ wallMat-wallMat);
+ */
+
+ Yeff (1.0e6 1.0e6
+ 1.0e6); // Young modulus [Pa]
+
+ Geff (0.8e6 0.8e6
+ 0.8e6); // Shear modulus [Pa]
+
+ nu (0.25 0.25
+ 0.25); // Poisson's ratio [-]
+
+ en (0.97 0.85
+ 1.00); // coefficient of normal restitution
+
+ mu (0.65 0.65
+ 0.65); // dynamic friction
+
+ mur (0.1 0.1
+ 0.1); // rolling friction
+}
+
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/caseSetup/shapes b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/caseSetup/shapes
new file mode 100644
index 00000000..0c0b3443
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/caseSetup/shapes
@@ -0,0 +1,15 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName shapes;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+
+names (glassBead); // names of shapes
+
+diameters (0.002); // diameter of shapes
+
+materials (glassMat); // material names for shapes
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/cleanThisCase b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/cleanThisCase
new file mode 100755
index 00000000..8a0ab919
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/cleanThisCase
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+
+ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
+rm -rf VTK
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/runThisCase b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/runThisCase
new file mode 100755
index 00000000..c48d71fe
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/runThisCase
@@ -0,0 +1,21 @@
+#!/bin/sh
+cd ${0%/*} || exit 1 # Run from this directory
+echo "\n<--------------------------------------------------------------------->"
+echo "1) Creating particles"
+echo "<--------------------------------------------------------------------->\n"
+particlesPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "2) Creating geometry"
+echo "<--------------------------------------------------------------------->\n"
+geometryPhasicFlow
+
+echo "\n<--------------------------------------------------------------------->"
+echo "3) Running the case"
+echo "<--------------------------------------------------------------------->\n"
+sphereGranFlow
+
+
+
+
+#------------------------------------------------------------------------------
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/domainDict b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/domainDict
new file mode 100644
index 00000000..b92756a2
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/domainDict
@@ -0,0 +1,50 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName domainDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+globalBox // Simulation domain: every particles that goes outside this domain will be deleted
+{
+ min (-0.2 -0.2 0.0);
+ max ( 0.2 0.2 1.6);
+}
+
+boundaries
+{
+ neighborListUpdateInterval 200;
+
+ updateInterval 20;
+
+ left
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ right
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ bottom
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ top
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ rear
+ {
+ type exit; // other options: periodic, reflective
+ }
+
+ front
+ {
+ type exit; // other options: periodic, reflective
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/geometryDict b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/geometryDict
new file mode 100644
index 00000000..dae67a91
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/geometryDict
@@ -0,0 +1,86 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName geometryDict;
+objectType dictionary;
+fileFormat ASCII;
+
+motionModel rotatingAxis; // motion model: rotating object around an axis
+
+rotatingAxisInfo // information for rotatingAxisMotion motion model
+{
+ rotAxis
+ {
+ p1 (0.0 0.0 0.0); // first point for the axis of rotation
+
+ p2 (0.0 0.0 1.0); // second point for the axis of rotation
+
+ omega 1.256; // rotation speed (rad/s) => 12 rpm
+ }
+}
+
+surfaces
+{
+ cylinder
+ {
+ type cylinderWall; // type of the wall
+
+ p1 (0.0 0.0 0.0); // begin point of cylinder axis
+
+ p2 (0.0 0.0 1.6); // end point of cylinder axis
+
+ radius1 0.2; // radius at p1
+
+ radius2 0.2; // radius at p2
+
+ resolution 60; // number of divisions
+
+ material wallMat; // material name of this wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the rear end of cylinder
+ */
+
+ wall1
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 0.0); // first point of the wall
+
+ p2 ( 0.2 -0.2 0.0); // second point
+
+ p3 ( 0.2 0.2 0.0); // third point
+
+ p4 (-0.2 0.2 0.0); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+
+ /*
+ This is a plane wall at the front end of cylinder
+ */
+
+ wall2
+ {
+ type planeWall; // type of the wall
+
+ p1 (-0.2 -0.2 1.6); // first point of the wall
+
+ p2 ( 0.2 -0.2 1.6); // second point
+
+ p3 ( 0.2 0.2 1.6); // third point
+
+ p4 (-0.2 0.2 1.6); // fourth point
+
+ material wallMat; // material name of the wall
+
+ motion rotAxis; // motion component name
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/particlesDict b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/particlesDict
new file mode 100644
index 00000000..362efa72
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/particlesDict
@@ -0,0 +1,47 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+
+objectName particlesDict;
+objectType dictionary;
+fileFormat ASCII;
+
+setFields
+{
+ defaultValue
+ {
+ velocity realx3 (0 0 0); // linear velocity (m/s)
+ acceleration realx3 (0 0 0); // linear acceleration (m/s2)
+ rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
+ shapeName word glassBead; // name of the particle shape
+ }
+
+ selectors
+ {}
+}
+
+positionParticles
+{
+ method ordered;
+
+ orderedInfo
+ {
+ distance 0.003; // minimum space between centers of particles
+
+ numPoints 6000000; // number of particles in the simulation
+
+ axisOrder (z x y); // axis order for filling the space with particles
+ }
+
+ regionType cylinder; // other options: box and sphere
+
+ cylinderInfo // cylinder for positioning particles
+ {
+ p1 (0.0 0.0 0.01); // lower corner point of the box
+
+ p2 (0.0 0.0 1.59); // upper corner point of the box
+
+ radius 0.195; // radius of cylinder
+ }
+}
diff --git a/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/settingsDict b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/settingsDict
new file mode 100644
index 00000000..67cbee31
--- /dev/null
+++ b/benchmarks/rotatingDrum/rotatingDrum_8mParticles/settings/settingsDict
@@ -0,0 +1,34 @@
+/* -------------------------------*- C++ -*--------------------------------- *\
+| phasicFlow File |
+| copyright: www.cemf.ir |
+\* ------------------------------------------------------------------------- */
+objectName settingsDict;
+objectType dictionary;
+fileFormat ASCII;
+/*---------------------------------------------------------------------------*/
+run rotatingDrum_4mParticles;
+
+dt 0.00001; // time step for integration (s)
+
+startTime 0; // start time for simulation
+
+endTime 4; // end time for simulation
+
+saveInterval 0.2; // time interval for saving the simulation
+
+timePrecision 5; // maximum number of digits for time folder
+
+g (0 -9.8 0); // gravity vector (m/s2)
+
+includeObjects (diameter); // save necessary (i.e., required) data on disk
+
+// exclude unnecessary data from saving on disk
+excludeObjects (rVelocity.dy1 pStructPosition.dy1 pStructVelocity.dy1);
+
+integrationMethod AdamsBashforth2; // integration method
+
+writeFormat binary; // data writting format (ascii or binary)
+
+timersReport Yes;
+
+timersReportInterval 0.01;
diff --git a/benchmarks/rotatingDrum_4MParticles/caseSetup/interaction b/benchmarks/rotatingDrum_4MParticles/caseSetup/interaction
deleted file mode 100755
index 0477966f..00000000
--- a/benchmarks/rotatingDrum_4MParticles/caseSetup/interaction
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -------------------------------*- C++ -*--------------------------------- *\
-| phasicFlow File |
-| copyright: www.cemf.ir |
-\* ------------------------------------------------------------------------- */
-
-objectName interaction;
-objectType dicrionary;
-
-materials (glassMat wallMat); // a list of materials names
-densities (2500.0 2500); // density of materials [kg/m3]
-
-contactListType sortedContactList;
-
-model
-{
- contactForceModel nonLinearLimited;
- rollingFrictionModel normal;
-
- Yeff (1.0e6 1.0e6 // Young modulus [Pa]
- 1.0e6);
-
- Geff (0.8e6 0.8e6 // Shear modulus [Pa]
- 0.8e6);
-
- nu (0.25 0.25 // Poisson's ratio [-]
- 0.25);
-
- en (0.97 0.85 // coefficient of normal restitution
- 1.00);
-
- et (1.0 1.0 // coefficient of tangential restitution
- 1.0);
-
- mu (0.65 0.65 // dynamic friction
- 0.65);
-
- mur (0.1 0.1 // rolling friction
- 0.1);
-
-}
-
-contactSearch
-{
- method NBS;
- wallMapping cellMapping;
-
- NBSInfo
- {
- updateFrequency 10; // each 20 timesteps, update neighbor list
- sizeRatio 1.05; // bounding box size to particle diameter (max)
- }
-
- cellMappingInfo
- {
- updateFrequency 10; // each 20 timesteps, update neighbor list
- cellExtent 0.6; // bounding box for particle-wall search (> 0.5)
- }
-
-}
\ No newline at end of file
diff --git a/benchmarks/rotatingDrum_4MParticles/caseSetup/particleInsertion b/benchmarks/rotatingDrum_4MParticles/caseSetup/particleInsertion
deleted file mode 100755
index eec7b7f9..00000000
--- a/benchmarks/rotatingDrum_4MParticles/caseSetup/particleInsertion
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -------------------------------*- C++ -*--------------------------------- *\
-| phasicFlow File |
-| copyright: www.cemf.ir |
-\* ------------------------------------------------------------------------- */
-
-objectName particleInsertion;
-objectType dicrionary;
-
-
-active no; // is insertion active?
-
-collisionCheck No; // not implemented for yes
-
-
diff --git a/benchmarks/rotatingDrum_4MParticles/caseSetup/sphereShape b/benchmarks/rotatingDrum_4MParticles/caseSetup/sphereShape
deleted file mode 100755
index eab9b617..00000000
--- a/benchmarks/rotatingDrum_4MParticles/caseSetup/sphereShape
+++ /dev/null
@@ -1,11 +0,0 @@
-/* -------------------------------*- C++ -*--------------------------------- *\
-| phasicFlow File |
-| copyright: www.cemf.ir |
-\* ------------------------------------------------------------------------- */
-
-objectName sphereDict;
-objectType sphereShape;
-
-names (glassBead); // names of shapes
-diameters (0.003); // diameter of shapes
-materials (glassMat); // material names for shapes
diff --git a/benchmarks/rotatingDrum_4MParticles/settings/geometryDict b/benchmarks/rotatingDrum_4MParticles/settings/geometryDict
deleted file mode 100644
index 64702fd8..00000000
--- a/benchmarks/rotatingDrum_4MParticles/settings/geometryDict
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -------------------------------*- C++ -*--------------------------------- *\
-| phasicFlow File |
-| copyright: www.cemf.ir |
-\* ------------------------------------------------------------------------- */
-
-objectName geometryDict;
-objectType dictionary;
-
-motionModel rotatingAxisMotion;
-
-surfaces
-{
-
- cylinder
- {
- type cylinderWall;
- p1 (0.0 0.0 0.0);
- p2 (0.0 0.0 1.6);
- radius1 0.2;
- radius2 0.2;
- resolution 24;
- material wallMat;
- motion rotAxis;
- }
-
-
- wall1
- {
- type planeWall;
- p1 (-0.2 -0.2 0.0);
- p2 ( 0.2 -0.2 0.0);
- p3 ( 0.2 0.2 0.0);
- p4 (-0.2 0.2 0.0);
- material wallMat;
- motion rotAxis;
- }
-
- /*
- This is a plane wall at the front end of cylinder
- */
- wall2
- {
- type planeWall;
- p1 (-0.2 -0.2 1.6);
- p2 ( 0.2 -0.2 1.6);
- p3 ( 0.2 0.2 1.6);
- p4 (-0.2 0.2 1.6);
- material wallMat;
- motion rotAxis;
- }
-
-}
-
-// information for rotatingAxisMotion motion model
-rotatingAxisMotionInfo
-{
- rotAxis
- {
- p1 (0.0 0.0 0.0);
- p2 (0.0 0.0 1.0);
- omega 1.256; // rotation speed (rad/s) => 12 rpm
- }
-}
\ No newline at end of file
diff --git a/benchmarks/rotatingDrum_4MParticles/settings/particlesDict b/benchmarks/rotatingDrum_4MParticles/settings/particlesDict
deleted file mode 100644
index 7ae00511..00000000
--- a/benchmarks/rotatingDrum_4MParticles/settings/particlesDict
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -------------------------------*- C++ -*--------------------------------- *\
-| phasicFlow File |
-| copyright: www.cemf.ir |
-\* ------------------------------------------------------------------------- */
-
-objectName particlesDict;
-objectType dictionary;
-
-setFields
-{
-
- defaultValue
- {
- velocity realx3 (0 0 0); // linear velocity (m/s)
- acceleration realx3 (0 0 0); // linear acceleration (m/s2)
- rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)
- shapeName word glassBead; // name of the particle shape
- }
-
- selectors
- {}
-}
-
-positionParticles
-{
- method positionOrdered;
-
- maxNumberOfParticles 4000001;
- mortonSorting Yes;
-
- cylinder // box for positioning particles
- {
- p1 ( 0.0 0.0 0.01); // lower corner point of the box
- p2 ( 0.0 0.0 1.59); // upper corner point of the box
- radius 0.195;
- }
-
- positionOrderedInfo
- {
- diameter 0.003; // minimum space between centers of particles
- numPoints 4000000; // number of particles in the simulation
- axisOrder (z x y); // axis order for filling the space with particles
- }
-}
diff --git a/benchmarks/rotatingDrum_4MParticles/settings/settingsDict b/benchmarks/rotatingDrum_4MParticles/settings/settingsDict
deleted file mode 100644
index 8a881847..00000000
--- a/benchmarks/rotatingDrum_4MParticles/settings/settingsDict
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -------------------------------*- C++ -*--------------------------------- *\
-| phasicFlow File |
-| copyright: www.cemf.ir |
-\* ------------------------------------------------------------------------- */
-objectName settingsDict;
-objectType dictionary;;
-
-run rotatingDrum_1;
-
-dt 0.00001; // time step for integration (s)
-
-startTime 0; // start time for simulation
-
-endTime 10; // end time for simulation
-
-saveInterval 0.2; // time interval for saving the simulation
-
-timePrecision 5; // maximum number of digits for time folder
-
-g (0 -9.8 0); // gravity vector (m/s2)
-
-domain
-{
- min (-0.2 -0.2 -0.0);
- max ( 0.2 0.2 1.6);
-}
-
-integrationMethod AdamsBashforth3; // integration method
-
-timersReport Yes;
-
-timersReportInterval 0.01;
diff --git a/cmake/autoComplete b/cmake/autoComplete
new file mode 100644
index 00000000..babf3843
--- /dev/null
+++ b/cmake/autoComplete
@@ -0,0 +1,112 @@
+PF_cFlags="--description --help --version"
+AllTimeFolders=
+__getAllTime(){
+ # Initialize empty array for time folders
+ local time_folders=()
+
+ # Loop through all directories in current folder
+ for dir in */; do
+ # Remove trailing slash
+ dir=${dir%/}
+
+ # Check if directory name is a valid floating point number
+ # This pattern matches integers and floating point numbers
+ if [[ $dir =~ ^[0-9]+(\.[0-9]+)?$ ]]; then
+ time_folders+=("$dir")
+ fi
+ done
+
+ # Set completion reply to the time folders
+ COMPREPLY=("${time_folders[@]}")
+ AllTimeFolders="${time_folders[@]}"
+}
+
+__getFields(){
+ __getAllTime
+ local -A unique_files=()
+ # Files to exclude from suggestions
+ local exclude_files=("shapeHash" "pStructure" "particleInsertion" "p" "alpha" "U" "Sp" "Su" "phi")
+ declare -A exclude_dict
+
+ # Build exclude dictionary for faster lookups
+ for file in "${exclude_files[@]}"; do
+ exclude_dict["$file"]=1
+ done
+
+ for dir in $AllTimeFolders; do
+ # Skip if not a directory
+ [ ! -d "$dir" ] && continue
+
+ # Find all files in this time directory
+ while IFS= read -r filename; do
+ # Skip empty lines and excluded files
+ [ -z "$filename" ] || [ "${exclude_dict[$filename]+exists}" ] && continue
+
+ # Add to unique files
+ unique_files["$filename"]=1
+ done < <(find "$dir" -maxdepth 1 -type f -printf '%f\n')
+ done
+
+ # Set completion reply to the unique filenames
+ COMPREPLY=(${!unique_files[@]})
+
+ # Clear global variable
+ AllTimeFolders=
+}
+
+_pFlowToVTK(){
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ local prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ # Check if we're completing a field
+ local is_field=0
+ for ((i=1; i
(
+ objectFile(
+ insertionFile__,
+ "",
+ objectFile::READ_ALWAYS,
+ objectFile::WRITE_ALWAYS
+ ),
+ sphParticles,
+ sphParticles.shapes()
+ );*/
+
+auto grnInsertion = pFlow::grainInsertion(
+ grnParticles,
+ grnParticles.grains());
+
+REPORT(0)<<"\nCreating interaction model for sphere-sphere contact and sphere-wall contact . . ."<
bool pFlow::geometryMotion::findMotionIndex()
{
-
if(motionComponentName().size() != numSurfaces() )
{
fatalErrorInFunction<<
diff --git a/src/Geometry/geometryMotion/geometryMotions.cpp b/src/Geometry/geometryMotion/geometryMotions.cpp
index 8b1d1d55..8636c1f7 100644
--- a/src/Geometry/geometryMotion/geometryMotions.cpp
+++ b/src/Geometry/geometryMotion/geometryMotions.cpp
@@ -26,4 +26,6 @@ template class pFlow::geometryMotion;
template class pFlow::geometryMotion;
-//template class pFlow::geometryMotion;
+template class pFlow::geometryMotion;
+
+template class pFlow::geometryMotion;
diff --git a/src/Geometry/geometryMotion/geometryMotions.hpp b/src/Geometry/geometryMotion/geometryMotions.hpp
index 1bb078d8..4a916b6e 100644
--- a/src/Geometry/geometryMotion/geometryMotions.hpp
+++ b/src/Geometry/geometryMotion/geometryMotions.hpp
@@ -24,7 +24,8 @@ Licence:
#include "geometryMotion.hpp"
#include "stationaryWall.hpp"
#include "rotatingAxisMotion.hpp"
-//#include "multiRotatingAxisMotion.hpp"
+#include "conveyorBeltMotion.hpp"
+#include "multiRotatingAxisMotion.hpp"
#include "vibratingMotion.hpp"
@@ -37,10 +38,9 @@ using rotationAxisMotionGeometry = geometryMotion;
using stationaryGeometry = geometryMotion;
-//typedef geometryMotion multiRotationAxisMotionGeometry;
-
-
+using conveyorBeltMotionGeometry = geometryMotion;
+using multiRotationAxisMotionGeometry = geometryMotion;
}
diff --git a/src/Integration/AdamsBashforth2/AdamsBashforth2.cpp b/src/Integration/AdamsBashforth2/AdamsBashforth2.cpp
index c6bb54a6..9f457fe8 100644
--- a/src/Integration/AdamsBashforth2/AdamsBashforth2.cpp
+++ b/src/Integration/AdamsBashforth2/AdamsBashforth2.cpp
@@ -37,7 +37,8 @@ bool intAllActive(
real dt,
realx3Field_D& y,
realx3PointField_D& dy,
- realx3PointField_D& dy1)
+ realx3PointField_D& dy1,
+ real damping = 1.0)
{
auto d_dy = dy.deviceView();
@@ -49,7 +50,7 @@ bool intAllActive(
"AdamsBashforth2::correct",
rpIntegration (activeRng.start(), activeRng.end()),
LAMBDA_HD(uint32 i){
- d_y[i] += dt*(static_cast(1.5) * d_dy[i] - static_cast(0.5) * d_dy1[i]);
+ d_y[i] += damping * dt*(static_cast(1.5) * d_dy[i] - static_cast(0.5) * d_dy1[i]);
d_dy1[i] = d_dy[i];
});
Kokkos::fence();
@@ -62,7 +63,8 @@ bool intScattered
real dt,
realx3Field_D& y,
realx3PointField_D& dy,
- realx3PointField_D& dy1
+ realx3PointField_D& dy1,
+ real damping = 1.0
)
{
@@ -78,7 +80,7 @@ bool intScattered
LAMBDA_HD(uint32 i){
if( activeP(i))
{
- d_y[i] += dt*(static_cast(1.5) * d_dy[i] - static_cast(0.5) * d_dy1[i]);
+ d_y[i] += damping * dt*(static_cast(1.5) * d_dy[i] - static_cast(0.5) * d_dy1[i]);
d_dy1[i] = d_dy[i];
}
});
@@ -90,17 +92,16 @@ bool intScattered
}
-
-
pFlow::AdamsBashforth2::AdamsBashforth2
(
const word& baseName,
pointStructure& pStruct,
const word& method,
- const realx3Field_D& initialValField
+ const realx3Field_D& initialValField,
+ bool keepHistory
)
:
- integration(baseName, pStruct, method, initialValField),
+ integration(baseName, pStruct, method, initialValField, keepHistory),
realx3PointField_D
(
objectFile
@@ -108,20 +109,27 @@ pFlow::AdamsBashforth2::AdamsBashforth2
groupNames(baseName,"dy1"),
pStruct.time().integrationFolder(),
objectFile::READ_IF_PRESENT,
- objectFile::WRITE_ALWAYS
+ keepHistory?objectFile::WRITE_ALWAYS:objectFile::WRITE_NEVER
),
pStruct,
zero3,
zero3
- )
-{}
+ ),
+ initialValField_(initialValField),
+ boundaryList_(pStruct, method, *this)
+{
+ realx3PointField_D::addEvent(message::ITEMS_INSERT);
+}
-bool pFlow::AdamsBashforth2::predict
-(
- real UNUSED(dt),
- realx3PointField_D& UNUSED(y),
- realx3PointField_D& UNUSED(dy)
-)
+void pFlow::AdamsBashforth2::updateBoundariesSlaveToMasterIfRequested()
+{
+ realx3PointField_D::updateBoundariesSlaveToMasterIfRequested();
+}
+
+bool pFlow::AdamsBashforth2::predict(
+ real UNUSED(dt),
+ realx3PointField_D &UNUSED(y),
+ realx3PointField_D &UNUSED(dy))
{
return true;
}
@@ -140,31 +148,63 @@ bool pFlow::AdamsBashforth2::correct
(
real dt,
realx3PointField_D& y,
- realx3PointField_D& dy
+ realx3PointField_D& dy,
+ real damping
)
-{
- return correct(dt, y.field(), dy);
-}
-
-bool pFlow::AdamsBashforth2::correct(real dt, realx3Field_D &y, realx3PointField_D &dy)
{
auto& dy1l = dy1();
-
+ bool success = false;
if(dy1l.isAllActive())
{
- return intAllActive(dt, y, dy, dy1l);
+ success = intAllActive(dt, y.field(), dy, dy1(), damping);
}
else
{
- return intScattered(dt, y, dy, dy1l);
+ success = intScattered(dt, y.field(), dy, dy1(), damping);
}
- return false;
+
+ success = success && boundaryList_.correct(dt, y, dy);
+
+ return success;
+
}
-bool pFlow::AdamsBashforth2::setInitialVals(
- const int32IndexContainer& newIndices,
- const realx3Vector& y)
+bool pFlow::AdamsBashforth2::correctPStruct(
+ real dt,
+ pointStructure &pStruct,
+ realx3PointField_D &vel)
{
- return true;
+ auto& dy1l = dy1();
+ bool success = false;
+ if(dy1l.isAllActive())
+ {
+ success = intAllActive(dt, pStruct.pointPosition(), vel, dy1());
+ }
+ else
+ {
+ success = intScattered(dt, pStruct.pointPosition(), vel, dy1());
+ }
+
+ success = success && boundaryList_.correctPStruct(dt, pStruct, vel);
+
+ return success;
}
+/*bool pFlow::AdamsBashforth2::hearChanges
+(
+ const timeInfo &ti,
+ const message &msg,
+ const anyList &varList
+)
+{
+ if(msg.equivalentTo(message::ITEMS_INSERT))
+ {
+
+ return insertValues(varList, initialValField_.deviceViewAll(), dy1());
+ }
+ else
+ {
+ return realx3PointField_D::hearChanges(ti, msg, varList);
+ }
+
+}*/
diff --git a/src/Integration/AdamsBashforth2/AdamsBashforth2.hpp b/src/Integration/AdamsBashforth2/AdamsBashforth2.hpp
index 13685bab..0241bb8e 100644
--- a/src/Integration/AdamsBashforth2/AdamsBashforth2.hpp
+++ b/src/Integration/AdamsBashforth2/AdamsBashforth2.hpp
@@ -17,13 +17,13 @@ Licence:
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
-
#ifndef __AdamsBashforth2_hpp__
#define __AdamsBashforth2_hpp__
#include "integration.hpp"
#include "pointFields.hpp"
+#include "boundaryIntegrationList.hpp"
namespace pFlow
{
@@ -41,10 +41,33 @@ class AdamsBashforth2
{
private:
+ const realx3Field_D& initialValField_;
+
+ boundaryIntegrationList boundaryList_;
+
+ friend class processorAB2BoundaryIntegration;
+
+protected:
+
+ const auto& dy1()const
+ {
+ return static_cast(*this);
+ }
+
auto& dy1()
{
return static_cast(*this);
}
+
+ auto& initialValField()
+ {
+ return initialValField_;
+ }
+
+ boundaryIntegrationList& boundaryList()
+ {
+ return boundaryList_;
+ }
public:
@@ -58,10 +81,11 @@ public:
const word& baseName,
pointStructure& pStruct,
const word& method,
- const realx3Field_D& initialValField);
+ const realx3Field_D& initialValField,
+ bool keepHistory);
/// Destructor
- ~AdamsBashforth2()final = default;
+ ~AdamsBashforth2()override = default;
/// Add this to the virtual constructor table
add_vCtor(
@@ -71,6 +95,9 @@ public:
// - Methods
+
+ void updateBoundariesSlaveToMasterIfRequested()override;
+
/// return integration method
word method()const override
{
@@ -90,31 +117,21 @@ public:
bool correct(
real dt,
realx3PointField_D& y,
- realx3PointField_D& dy) final;
+ realx3PointField_D& dy,
+ real damping = 1.0) override;
- bool correct(
+ bool correctPStruct(
real dt,
- realx3Field_D& y,
- realx3PointField_D& dy) final;
+ pointStructure& pStruct,
+ realx3PointField_D& vel) override;
/*bool hearChanges
(
- real t,
- real dt,
- uint32 iter,
+ const timeInfo& ti,
const message& msg,
const anyList& varList
) override;*/
- bool setInitialVals(
- const int32IndexContainer& newIndices,
- const realx3Vector& y) final;
-
- bool needSetInitialVals()const final
- {
- return false;
- }
-
};
diff --git a/src/Integration/AdamsBashforth3/AdamsBashforth3.cpp b/src/Integration/AdamsBashforth3/AdamsBashforth3.cpp
index f8ec6b5a..c15b5ff2 100644
--- a/src/Integration/AdamsBashforth3/AdamsBashforth3.cpp
+++ b/src/Integration/AdamsBashforth3/AdamsBashforth3.cpp
@@ -20,90 +20,185 @@ Licence:
#include "AdamsBashforth3.hpp"
+namespace pFlow
+{
+
+/// Range policy for integration kernel (alias)
+using rpIntegration = Kokkos::RangePolicy<
+ DefaultExecutionSpace,
+ Kokkos::Schedule,
+ Kokkos::IndexType
+ >;
+
+bool intAllActive(
+ real dt,
+ realx3Field_D& y,
+ realx3PointField_D& dy,
+ realx3PointField_D& dy1,
+ realx3PointField_D& dy2,
+ real damping = 1.0)
+{
+
+ auto d_dy = dy.deviceView();
+ auto d_y = y.deviceView();
+ auto d_dy1= dy1.deviceView();
+ auto d_dy2= dy2.deviceView();
+ auto activeRng = dy1.activeRange();
+
+ Kokkos::parallel_for(
+ "AdamsBashforth3::correct",
+ rpIntegration (activeRng.start(), activeRng.end()),
+ LAMBDA_HD(uint32 i){
+ d_y[i] += damping* dt*( static_cast(23.0 / 12.0) * d_dy[i]
+ - static_cast(16.0 / 12.0) * d_dy1[i]
+ + static_cast(5.0 / 12.0) * d_dy2[i]) ;
+
+ d_dy2[i] = d_dy1[i];
+ d_dy1[i] = d_dy[i];
+
+ });
+ Kokkos::fence();
+
+ return true;
+}
+
+bool intScattered
+(
+ real dt,
+ realx3Field_D& y,
+ realx3PointField_D& dy,
+ realx3PointField_D& dy1,
+ realx3PointField_D& dy2,
+ real damping = 1.0
+)
+{
+
+ auto d_dy = dy.deviceView();
+ auto d_y = y.deviceView();
+ auto d_dy1 = dy1.deviceView();
+ auto d_dy2 = dy2.deviceView();
+ auto activeRng = dy1.activeRange();
+ const auto& activeP = dy1.activePointsMaskDevice();
+
+ Kokkos::parallel_for(
+ "AdamsBashforth3::correct",
+ rpIntegration (activeRng.start(), activeRng.end()),
+ LAMBDA_HD(uint32 i){
+ if( activeP(i))
+ {
+ d_y[i] += damping * dt*( static_cast(23.0 / 12.0) * d_dy[i]
+ - static_cast(16.0 / 12.0) * d_dy1[i]
+ + static_cast(5.0 / 12.0) * d_dy2[i]);
+
+ d_dy2[i] = d_dy1[i];
+ d_dy1[i] = d_dy[i];
+ }
+ });
+ Kokkos::fence();
+
+
+ return true;
+}
+
+}
+
//const real AB3_coef[] = { 23.0 / 12.0, 16.0 / 12.0, 5.0 / 12.0 };
pFlow::AdamsBashforth3::AdamsBashforth3
(
const word& baseName,
- repository& owner,
- const pointStructure& pStruct,
- const word& method
+ pointStructure& pStruct,
+ const word& method,
+ const realx3Field_D& initialValField,
+ bool keepHistory
)
:
- integration(baseName, owner, pStruct, method),
- history_(
- owner.emplaceObject>(
- objectFile(
- groupNames(baseName,"AB3History"),
- "",
- objectFile::READ_IF_PRESENT,
- objectFile::WRITE_ALWAYS),
- pStruct,
- AB3History({zero3,zero3})))
+ AdamsBashforth2(baseName, pStruct, method, initialValField, keepHistory),
+ dy2_
+ (
+ objectFile
+ (
+ groupNames(baseName,"dy2"),
+ pStruct.time().integrationFolder(),
+ objectFile::READ_IF_PRESENT,
+ keepHistory ? objectFile::WRITE_ALWAYS : objectFile::WRITE_NEVER
+ ),
+ pStruct,
+ zero3,
+ zero3
+ )
{
}
-bool pFlow::AdamsBashforth3::predict
-(
- real UNUSED(dt),
- realx3Vector_D& UNUSED(y),
- realx3Vector_D& UNUSED(dy)
-)
+void pFlow::AdamsBashforth3::updateBoundariesSlaveToMasterIfRequested()
{
-
- return true;
+ AdamsBashforth2::updateBoundariesSlaveToMasterIfRequested();
+ dy2_.updateBoundariesSlaveToMasterIfRequested();
}
+
+
bool pFlow::AdamsBashforth3::correct
(
- real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy
+ real dt,
+ realx3PointField_D& y,
+ realx3PointField_D& dy,
+ real damping
)
{
- if(this->pStruct().allActive())
+ bool success = false;
+ if(y.isAllActive())
{
- return intAll(dt, y, dy, this->pStruct().activeRange());
+ success = intAllActive(dt, y.field(), dy, dy1(), dy2(), damping);
}
else
{
- return intRange(dt, y, dy, this->pStruct().activePointsMaskD());
+ success = intScattered(dt, y.field(), dy, dy1(), dy2(), damping);
}
- return true;
+ success = success && boundaryList().correct(dt, y, dy);
+
+ return success;
}
-bool pFlow::AdamsBashforth3::setInitialVals(
- const int32IndexContainer& newIndices,
- const realx3Vector& y)
-{
- return true;
-}
-
-bool pFlow::AdamsBashforth3::intAll(
+bool pFlow::AdamsBashforth3::correctPStruct(
real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- range activeRng)
+ pointStructure &pStruct,
+ realx3PointField_D &vel)
{
- auto d_dy = dy.deviceViewAll();
- auto d_y = y.deviceViewAll();
- auto d_history = history_.deviceViewAll();
+
+ bool success = false;
+ if(dy2().isAllActive())
+ {
+ success = intAllActive(dt, pStruct.pointPosition(), vel, dy1(), dy2());
+ }
+ else
+ {
+ success = intScattered(dt, pStruct.pointPosition(), vel, dy1(), dy2());
+ }
- Kokkos::parallel_for(
- "AdamsBashforth3::correct",
- rpIntegration (activeRng.first, activeRng.second),
- LAMBDA_HD(int32 i){
- auto ldy = d_dy[i];
- d_y[i] += dt*( static_cast(23.0 / 12.0) * ldy
- - static_cast(16.0 / 12.0) * d_history[i].dy1_
- + static_cast(5.0 / 12.0) * d_history[i].dy2_);
- d_history[i] = {ldy ,d_history[i].dy1_};
- });
- Kokkos::fence();
+ success = success && boundaryList().correctPStruct(dt, pStruct, vel);
- return true;
-}
\ No newline at end of file
+ return success;
+}
+
+/*bool pFlow::AdamsBashforth3::hearChanges
+(
+ const timeInfo &ti,
+ const message &msg,
+ const anyList &varList
+)
+{
+ if(msg.equivalentTo(message::ITEMS_INSERT))
+ {
+ return insertValues(varList, initialValField().deviceViewAll(), dy1()) &&
+ insertValues(varList, initialValField().deviceViewAll(), dy2());
+ }
+ else
+ {
+ return realx3PointField_D::hearChanges(ti, msg, varList);
+ }
+}*/
diff --git a/src/Integration/AdamsBashforth3/AdamsBashforth3.hpp b/src/Integration/AdamsBashforth3/AdamsBashforth3.hpp
index 279fdcda..50a23c39 100644
--- a/src/Integration/AdamsBashforth3/AdamsBashforth3.hpp
+++ b/src/Integration/AdamsBashforth3/AdamsBashforth3.hpp
@@ -22,48 +22,14 @@ Licence:
#define __AdamsBashforth3_hpp__
-#include "integration.hpp"
+#include "AdamsBashforth2.hpp"
#include "pointFields.hpp"
+#include "boundaryIntegrationList.hpp"
+
namespace pFlow
{
-struct AB3History
-{
- TypeInfoNV("AB3History");
-
- realx3 dy1_={0,0,0};
- realx3 dy2_={0,0,0};
-};
-
-
-INLINE_FUNCTION
-iIstream& operator>>(iIstream& str, AB3History& ab3)
-{
- str.readBegin("AB3History");
-
- str >> ab3.dy1_;
- str >> ab3.dy2_;
-
- str.readEnd("AB3History");
-
- str.check(FUNCTION_NAME);
-
- return str;
-
-}
-
-INLINE_FUNCTION
-iOstream& operator<<(iOstream& str, const AB3History& ab3)
-{
- str << token::BEGIN_LIST << ab3.dy1_
- << token::SPACE << ab3.dy2_
- << token::END_LIST;
-
- str.check(FUNCTION_NAME);
-
- return str;
-}
/**
* Third order Adams-Bashforth integration method for solving ODE
@@ -72,19 +38,26 @@ iOstream& operator<<(iOstream& str, const AB3History& ab3)
*/
class AdamsBashforth3
:
- public integration
+ public AdamsBashforth2
{
-protected:
+private:
- /// Integration history
- pointField& history_;
+ friend class processorAB3BoundaryIntegration;
- /// Range policy for integration kernel
- using rpIntegration = Kokkos::RangePolicy<
- DefaultExecutionSpace,
- Kokkos::Schedule,
- Kokkos::IndexType
- >;
+ realx3PointField_D dy2_;
+
+protected:
+
+ const auto& dy2()const
+ {
+ return dy2_;
+ }
+
+ auto& dy2()
+ {
+ return dy2_;
+ }
+
public:
@@ -96,17 +69,14 @@ public:
/// Construct from components
AdamsBashforth3(
const word& baseName,
- repository& owner,
- const pointStructure& pStruct,
- const word& method);
+ pointStructure& pStruct,
+ const word& method,
+ const realx3Field_D& initialValField,
+ bool keepHistory);
- uniquePtr clone()const override
- {
- return makeUnique(*this);
- }
/// Destructor
- virtual ~AdamsBashforth3()=default;
+ ~AdamsBashforth3() override =default;
/// Add this to the virtual constructor table
add_vCtor(
@@ -117,43 +87,39 @@ public:
// - Methods
- bool predict(
- real UNUSED(dt),
- realx3Vector_D & UNUSED(y),
- realx3Vector_D& UNUSED(dy)) override;
+ void updateBoundariesSlaveToMasterIfRequested()override;
- bool correct(real dt,
- realx3Vector_D & y,
- realx3Vector_D& dy) override;
-
- bool setInitialVals(
- const int32IndexContainer& newIndices,
- const realx3Vector& y) override;
-
- bool needSetInitialVals()const override
+ /// return integration method
+ word method()const override
{
- return false;
+ return "AdamsBashforth3";
}
- /// Integrate on all points in the active range
- bool intAll(
- real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- range activeRng);
+
- /// Integrate on active points in the active range
- template
- bool intRange(
- real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- activeFunctor activeP );
+ bool correct(
+ real dt,
+ realx3PointField_D& y,
+ realx3PointField_D& dy,
+ real damping = 1.0) override;
+
+ bool correctPStruct(
+ real dt,
+ pointStructure& pStruct,
+ realx3PointField_D& vel) override;
+
+
+ /*bool hearChanges
+ (
+ const timeInfo& ti,
+ const message& msg,
+ const anyList& varList
+ ) override;*/
};
-template
+/*template
bool pFlow::AdamsBashforth3::intRange(
real dt,
realx3Vector_D& y,
@@ -181,7 +147,7 @@ bool pFlow::AdamsBashforth3::intRange(
Kokkos::fence();
return true;
-}
+}*/
} // pFlow
diff --git a/src/Integration/AdamsBashforth4/AdamsBashforth4.cpp b/src/Integration/AdamsBashforth4/AdamsBashforth4.cpp
index 23bad29b..24461282 100644
--- a/src/Integration/AdamsBashforth4/AdamsBashforth4.cpp
+++ b/src/Integration/AdamsBashforth4/AdamsBashforth4.cpp
@@ -20,96 +20,187 @@ Licence:
#include "AdamsBashforth4.hpp"
-
-
-pFlow::AdamsBashforth4::AdamsBashforth4
-(
- const word& baseName,
- repository& owner,
- const pointStructure& pStruct,
- const word& method
-)
-:
- integration(baseName, owner, pStruct, method),
- history_(
- owner.emplaceObject>(
- objectFile(
- groupNames(baseName,"AB4History"),
- "",
- objectFile::READ_IF_PRESENT,
- objectFile::WRITE_ALWAYS),
- pStruct,
- AB4History({zero3,zero3, zero3})))
-
+namespace pFlow
{
-}
+/// Range policy for integration kernel (alias)
+using rpIntegration = Kokkos::RangePolicy<
+ DefaultExecutionSpace,
+ Kokkos::Schedule,
+ Kokkos::IndexType
+ >;
-bool pFlow::AdamsBashforth4::predict
-(
- real UNUSED(dt),
- realx3Vector_D& UNUSED(y),
- realx3Vector_D& UNUSED(dy)
-)
-{
-
- return true;
-}
-
-bool pFlow::AdamsBashforth4::correct
-(
- real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy
-)
-{
-
- if(this->pStruct().allActive())
- {
- return intAll(dt, y, dy, this->pStruct().activeRange());
- }
- else
- {
- return intRange(dt, y, dy, this->pStruct().activePointsMaskD());
- }
-
- return true;
-}
-
-bool pFlow::AdamsBashforth4::setInitialVals(
- const int32IndexContainer& newIndices,
- const realx3Vector& y)
-{
- return true;
-}
-
-bool pFlow::AdamsBashforth4::intAll(
+bool intAllActive(
real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- range activeRng)
+ realx3Field_D& y,
+ realx3PointField_D& dy,
+ realx3PointField_D& dy1,
+ realx3PointField_D& dy2,
+ realx3PointField_D& dy3,
+ real damping = 1.0)
{
- auto d_dy = dy.deviceViewAll();
- auto d_y = y.deviceViewAll();
- auto d_history = history_.deviceViewAll();
+
+ auto d_dy = dy.deviceView();
+ auto d_y = y.deviceView();
+ auto d_dy1= dy1.deviceView();
+ auto d_dy2= dy2.deviceView();
+ auto d_dy3= dy3.deviceView();
+ auto activeRng = dy1.activeRange();
Kokkos::parallel_for(
"AdamsBashforth4::correct",
- rpIntegration (activeRng.first, activeRng.second),
- LAMBDA_HD(int32 i){
- d_y[i] += dt*(
- static_cast(55.0 / 24.0) * d_dy[i]
- - static_cast(59.0 / 24.0) * d_history[i].dy1_
- + static_cast(37.0 / 24.0) * d_history[i].dy2_
- - static_cast( 9.0 / 24.0) * d_history[i].dy3_
- );
- d_history[i].dy3_ = d_history[i].dy2_;
- d_history[i].dy2_ = d_history[i].dy1_;
- d_history[i].dy1_ = d_dy[i];
-
+ rpIntegration (activeRng.start(), activeRng.end()),
+ LAMBDA_HD(uint32 i){
+ d_y[i] += damping * dt*(
+ static_cast(55.0 / 24.0) * d_dy[i]
+ - static_cast(59.0 / 24.0) * d_dy1[i]
+ + static_cast(37.0 / 24.0) * d_dy2[i]
+ - static_cast( 9.0 / 24.0) * d_dy3[i]);
+ d_dy3[i] = d_dy2[i];
+ d_dy2[i] = d_dy1[i];
+ d_dy1[i] = d_dy[i];
});
Kokkos::fence();
return true;
-}
\ No newline at end of file
+}
+
+bool intScattered
+(
+ real dt,
+ realx3Field_D& y,
+ realx3PointField_D& dy,
+ realx3PointField_D& dy1,
+ realx3PointField_D& dy2,
+ realx3PointField_D& dy3,
+ real damping = 1.0
+)
+{
+
+ auto d_dy = dy.deviceView();
+ auto d_y = y.deviceView();
+ auto d_dy1 = dy1.deviceView();
+ auto d_dy2 = dy2.deviceView();
+ auto d_dy3 = dy3.deviceView();
+ auto activeRng = dy1.activeRange();
+ const auto& activeP = dy1.activePointsMaskDevice();
+
+ Kokkos::parallel_for(
+ "AdamsBashforth4::correct",
+ rpIntegration (activeRng.start(), activeRng.end()),
+ LAMBDA_HD(uint32 i){
+ if( activeP(i))
+ {
+ d_y[i] += damping* dt*(
+ static_cast(55.0 / 24.0) * d_dy[i]
+ - static_cast(59.0 / 24.0) * d_dy1[i]
+ + static_cast(37.0 / 24.0) * d_dy2[i]
+ - static_cast( 9.0 / 24.0) * d_dy3[i] );
+ d_dy3[i] = d_dy2[i];
+ d_dy2[i] = d_dy1[i];
+ d_dy1[i] = d_dy[i];
+ }
+ });
+ Kokkos::fence();
+
+
+ return true;
+}
+
+}
+
+pFlow::AdamsBashforth4::AdamsBashforth4
+(
+ const word& baseName,
+ pointStructure& pStruct,
+ const word& method,
+ const realx3Field_D& initialValField,
+ bool keepHistory
+)
+:
+ AdamsBashforth3(baseName, pStruct, method, initialValField, keepHistory),
+ dy3_
+ (
+ objectFile
+ (
+ groupNames(baseName,"dy3"),
+ pStruct.time().integrationFolder(),
+ objectFile::READ_IF_PRESENT,
+ keepHistory?objectFile::WRITE_ALWAYS:objectFile::WRITE_NEVER
+ ),
+ pStruct,
+ zero3,
+ zero3
+ )
+{}
+
+void pFlow::AdamsBashforth4::updateBoundariesSlaveToMasterIfRequested()
+{
+ AdamsBashforth3::updateBoundariesSlaveToMasterIfRequested();
+ dy3_.updateBoundariesSlaveToMasterIfRequested();
+}
+
+bool pFlow::AdamsBashforth4::correct
+(
+ real dt,
+ realx3PointField_D& y,
+ realx3PointField_D& dy,
+ real damping
+)
+{
+
+ bool success = false;
+ if(y.isAllActive())
+ {
+ success = intAllActive(dt, y.field(), dy, dy1(), dy2(), dy3(), damping);
+ }
+ else
+ {
+ success = intScattered(dt, y.field(), dy, dy1(), dy2(), dy3(), damping);
+ }
+
+ success = success && boundaryList().correct(dt, y, dy);
+
+ return success;
+}
+
+bool pFlow::AdamsBashforth4::correctPStruct(
+ real dt,
+ pointStructure &pStruct,
+ realx3PointField_D &vel)
+{
+
+ bool success = false;
+ if(dy2().isAllActive())
+ {
+ success = intAllActive(dt, pStruct.pointPosition(), vel, dy1(), dy2(), dy3());
+ }
+ else
+ {
+ success = intScattered(dt, pStruct.pointPosition(), vel, dy1(), dy2(), dy3());
+ }
+
+ success = success && boundaryList().correctPStruct(dt, pStruct, vel);
+
+ return success;
+}
+
+/*bool pFlow::AdamsBashforth4::hearChanges
+(
+ const timeInfo &ti,
+ const message &msg,
+ const anyList &varList
+)
+{
+ if(msg.equivalentTo(message::ITEMS_INSERT))
+ {
+ return insertValues(varList, initialValField().deviceViewAll(), dy1()) &&
+ insertValues(varList, initialValField().deviceViewAll(), dy2()) &&
+ insertValues(varList, initialValField().deviceViewAll(), dy3());
+ }
+ else
+ {
+ return realx3PointField_D::hearChanges(ti, msg, varList);
+ }
+}*/
diff --git a/src/Integration/AdamsBashforth4/AdamsBashforth4.hpp b/src/Integration/AdamsBashforth4/AdamsBashforth4.hpp
index cf1f50d8..a9bb9a43 100644
--- a/src/Integration/AdamsBashforth4/AdamsBashforth4.hpp
+++ b/src/Integration/AdamsBashforth4/AdamsBashforth4.hpp
@@ -22,53 +22,14 @@ Licence:
#define __AdamsBashforth4_hpp__
-#include "integration.hpp"
+#include "AdamsBashforth3.hpp"
#include "pointFields.hpp"
+#include "boundaryIntegrationList.hpp"
+
namespace pFlow
{
-struct AB4History
-{
- TypeInfoNV("AB4History");
-
- realx3 dy1_={0,0,0};
- realx3 dy2_={0,0,0};
- realx3 dy3_={0,0,0};
-
-};
-
-
-INLINE_FUNCTION
-iIstream& operator>>(iIstream& str, AB4History& ab4)
-{
- str.readBegin("AB4History");
-
- str >> ab4.dy1_;
- str >> ab4.dy2_;
- str >> ab4.dy3_;
-
- str.readEnd("AB4History");
-
- str.check(FUNCTION_NAME);
-
- return str;
-
-}
-
-INLINE_FUNCTION
-iOstream& operator<<(iOstream& str, const AB4History& ab4)
-{
- str << token::BEGIN_LIST << ab4.dy1_
- << token::SPACE << ab4.dy2_
- << token::SPACE << ab4.dy3_
- << token::END_LIST;
-
- str.check(FUNCTION_NAME);
-
- return str;
-}
-
/**
* Fourth order Adams-Bashforth integration method for solving ODE
*
@@ -76,19 +37,25 @@ iOstream& operator<<(iOstream& str, const AB4History& ab4)
*/
class AdamsBashforth4
:
- public integration
+ public AdamsBashforth3
{
+private:
+
+ friend class processorAB4BoundaryIntegration;
+
+ realx3PointField_D dy3_;
+
protected:
- /// Integration history
- pointField& history_;
+ const auto& dy3()const
+ {
+ return dy3_;
+ }
- /// Range policy for integration kernel
- using rpIntegration = Kokkos::RangePolicy<
- DefaultExecutionSpace,
- Kokkos::Schedule,
- Kokkos::IndexType
- >;
+ auto& dy3()
+ {
+ return dy3_;
+ }
public:
@@ -100,17 +67,15 @@ public:
/// Construct from components
AdamsBashforth4(
const word& baseName,
- repository& owner,
- const pointStructure& pStruct,
- const word& method);
+ pointStructure& pStruct,
+ const word& method,
+ const realx3Field_D& initialValField,
+ bool keepHistory);
+
- uniquePtr clone()const override
- {
- return makeUnique(*this);
- }
/// Destructor
- virtual ~AdamsBashforth4()=default;
+ ~AdamsBashforth4() override =default;
/// Add a this to the virtual constructor table
add_vCtor(
@@ -121,77 +86,36 @@ public:
// - Methods
- bool predict(
- real UNUSED(dt),
- realx3Vector_D & UNUSED(y),
- realx3Vector_D& UNUSED(dy)) override;
+ void updateBoundariesSlaveToMasterIfRequested()override;
+
+ /// return integration method
+ word method()const override
+ {
+ return "AdamsBashforth4";
+ }
bool correct(
real dt,
- realx3Vector_D & y,
- realx3Vector_D& dy) override;
+ realx3PointField_D& y,
+ realx3PointField_D& dy,
+ real damping = 1.0) override;
- bool setInitialVals(
- const int32IndexContainer& newIndices,
- const realx3Vector& y) override;
-
- bool needSetInitialVals()const override
- {
- return false;
- }
-
- /// Integrate on all points in the active range
- bool intAll(
+ bool correctPStruct(
real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- range activeRng);
-
- /// Integrate on active points in the active range
- template
- bool intRange(
- real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- activeFunctor activeP );
+ pointStructure& pStruct,
+ realx3PointField_D& vel) override;
+
+ /*bool hearChanges
+ (
+ const timeInfo& ti,
+ const message& msg,
+ const anyList& varList
+ ) override;*/
};
-template
-bool pFlow::AdamsBashforth4::intRange(
- real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- activeFunctor activeP )
-{
- auto d_dy = dy.deviceViewAll();
- auto d_y = y.deviceViewAll();
- auto d_history = history_.deviceViewAll();
- auto activeRng = activeP.activeRange();
- Kokkos::parallel_for(
- "AdamsBashforth4::correct",
- rpIntegration (activeRng.first, activeRng.second),
- LAMBDA_HD(int32 i){
- if( activeP(i))
- {
-
- d_y[i] += dt*(
- static_cast(55.0 / 24.0) * d_dy[i]
- - static_cast(59.0 / 24.0) * d_history[i].dy1_
- + static_cast(37.0 / 24.0) * d_history[i].dy2_
- - static_cast( 9.0 / 24.0) * d_history[i].dy3_
- );
- d_history[i].dy3_ = d_history[i].dy2_;
- d_history[i].dy2_ = d_history[i].dy1_;
- d_history[i].dy1_ = d_dy[i];
- }
- });
- Kokkos::fence();
-
- return true;
-}
} // pFlow
diff --git a/src/Integration/AdamsBashforth5/AdamsBashforth5.cpp b/src/Integration/AdamsBashforth5/AdamsBashforth5.cpp
index 7b87a4a3..dd1503e2 100644
--- a/src/Integration/AdamsBashforth5/AdamsBashforth5.cpp
+++ b/src/Integration/AdamsBashforth5/AdamsBashforth5.cpp
@@ -20,93 +20,179 @@ Licence:
#include "AdamsBashforth5.hpp"
-
-
-pFlow::AdamsBashforth5::AdamsBashforth5
-(
- const word& baseName,
- repository& owner,
- const pointStructure& pStruct,
- const word& method
-)
-:
- integration(baseName, owner, pStruct, method),
- history_(
- owner.emplaceObject>(
- objectFile(
- groupNames(baseName,"AB5History"),
- "",
- objectFile::READ_IF_PRESENT,
- objectFile::WRITE_ALWAYS),
- pStruct,
- AB5History({zero3,zero3, zero3})))
-
+namespace pFlow
{
-}
+/// Range policy for integration kernel (alias)
+using rpIntegration = Kokkos::RangePolicy<
+ DefaultExecutionSpace,
+ Kokkos::Schedule,
+ Kokkos::IndexType
+ >;
-bool pFlow::AdamsBashforth5::predict
-(
- real UNUSED(dt),
- realx3Vector_D& UNUSED(y),
- realx3Vector_D& UNUSED(dy)
-)
-{
-
- return true;
-}
-
-bool pFlow::AdamsBashforth5::correct
-(
- real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy
-)
-{
-
- if(this->pStruct().allActive())
- {
- return intAll(dt, y, dy, this->pStruct().activeRange());
- }
- else
- {
- return intRange(dt, y, dy, this->pStruct().activePointsMaskD());
- }
-
- return true;
-}
-
-bool pFlow::AdamsBashforth5::setInitialVals(
- const int32IndexContainer& newIndices,
- const realx3Vector& y)
-{
- return true;
-}
-
-bool pFlow::AdamsBashforth5::intAll(
+bool intAllActive(
real dt,
- realx3Vector_D& y,
- realx3Vector_D& dy,
- range activeRng)
+ realx3Field_D& y,
+ realx3PointField_D& dy,
+ realx3PointField_D& dy1,
+ realx3PointField_D& dy2,
+ realx3PointField_D& dy3,
+ realx3PointField_D& dy4,
+ real damping = 1.0)
{
- auto d_dy = dy.deviceViewAll();
- auto d_y = y.deviceViewAll();
- auto d_history = history_.deviceViewAll();
+
+ auto d_dy = dy.deviceView();
+ auto d_y = y.deviceView();
+ auto d_dy1= dy1.deviceView();
+ auto d_dy2= dy2.deviceView();
+ auto d_dy3= dy3.deviceView();
+ auto d_dy4= dy4.deviceView();
+ auto activeRng = dy1.activeRange();
Kokkos::parallel_for(
"AdamsBashforth5::correct",
- rpIntegration (activeRng.first, activeRng.second),
- LAMBDA_HD(int32 i){
- d_y[i] += dt*(
+ rpIntegration (activeRng.start(), activeRng.end()),
+ LAMBDA_HD(uint32 i){
+ d_y[i] += damping* dt*(
static_cast(1901.0 / 720.0) * d_dy[i]
- - static_cast(2774.0 / 720.0) * d_history[i].dy1_
- + static_cast(2616.0 / 720.0) * d_history[i].dy2_
- - static_cast(1274.0 / 720.0) * d_history[i].dy3_
- + static_cast( 251.0 / 720.0) * d_history[i].dy4_
- );
- d_history[i] = {d_dy[i] ,d_history[i].dy1_, d_history[i].dy2_, d_history[i].dy3_};
+ - static_cast