From 140ec381edf56fac5726b20c156c7db74cb3d85e Mon Sep 17 00:00:00 2001 From: ramin1728 Date: Wed, 1 Jan 2025 12:42:38 +0330 Subject: [PATCH 1/3] Readme.md is updated. --- .../binarySystemOfParticles/README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tutorials/sphereGranFlow/binarySystemOfParticles/README.md b/tutorials/sphereGranFlow/binarySystemOfParticles/README.md index 299245d9..8ebb7de0 100644 --- a/tutorials/sphereGranFlow/binarySystemOfParticles/README.md +++ b/tutorials/sphereGranFlow/binarySystemOfParticles/README.md @@ -14,13 +14,10 @@ a view of the rotating drum with small and large particles after 7 seconds of ro *** # Case setup - -In the file `caseSetup/sphereShape` two particle types with the names `smallSphere` and `largeSphere` and the diameters 3 and 5 mm are defined. - [Simulation case setup files can be found in tutorials/sphereGranFlow folder.](https://github.com/PhasicFlow/phasicFlow/tree/main/tutorials/sphereGranFlow/binarySystemOfParticles) ### Shape definition -In the file `caseSetup/sphereShape` two particle types with the names `smallSphere` and `largeSphere` and the diameters 3 and 5 mm are defined. +In the file `caseSetup/shapes` two particle types with the names `smallSphere` and `largeSphere` and the diameters 3 and 5 mm are defined.
in caseSetup/sphereShape file @@ -41,8 +38,8 @@ in settings/particlesDict file ```C++ -// positions particles -positionParticles + +positionParticles // positions particles { method ordered; // other options: random or empty @@ -55,7 +52,7 @@ positionParticles regionType cylinder; // other options: box and sphere - cylinder // cylinder region for positioning particles + cylinder // cylinder region for positioning particles { p1 (0.0 0.0 0.003); // begin point of cylinder axis (m m m) p2 (0.0 0.0 0.097); // end point of cylinder axis (m m m) @@ -92,7 +89,7 @@ setFields { shapeAssigne { - selector stridedRange; // other options: box, cylinder, sphere, randomPoints + selector stridedRange; // other options: box, cylinder, sphere, randomPoints stridedRangeInfo { @@ -139,4 +136,4 @@ Options: --setFields-only Exectue the setFields part only. Read the pointStructure from time folder and setFields and save the result in the same time folder. ``` -so, with flag `--setFields-only`, you can execute the `setFields` part of `particlesDict`. Now suppose that you have a simulation case which proceeded up to 2 seconds and for any reason you want to change some field value at time 3 s and continue the simulation from 3 s. To this end, you need to change `startTime` in settings dictionary to 3, execute `particlesPhasicFlow --setFields-only`, and start the simulation. +so, with flag `--setFields-only`, you can execute the `setFields` part of `particlesDict`. Now suppose that you have a simulation case which proceeded up to 2 seconds and for any reason you want to change some field value at time 3 s and continue the simulation from 3 s. To this end, you need to change `startTime` in settings dictionary to 3, execute `particlesPhasicFlow --setFields-only`, and start the simulation. \ No newline at end of file From 8299a3120c1d83f82341edccd023a35627d8ae38 Mon Sep 17 00:00:00 2001 From: ramin1728 Date: Wed, 1 Jan 2025 13:40:14 +0330 Subject: [PATCH 2/3] Readme.md is updated. --- .../RotaryAirLockValve/ReadMe.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tutorials/sphereGranFlow/RotaryAirLockValve/ReadMe.md b/tutorials/sphereGranFlow/RotaryAirLockValve/ReadMe.md index eb7fbbbe..cf7a29a7 100644 --- a/tutorials/sphereGranFlow/RotaryAirLockValve/ReadMe.md +++ b/tutorials/sphereGranFlow/RotaryAirLockValve/ReadMe.md @@ -1,5 +1,5 @@ # Problem Definition -The problem is to simulate a Rotary Air-Lock Valve. The external diameter of rotor is about 21 cm. There is one type of particle in this simulation. Particles are inserted into the inlet of the valve from t=**0** s. +The problem is to simulate a RotaryAirLockValve. The external diameter of the rotor is about 21 cm. There is one type of particle in this simulation. Particles are inserted into the inlet of the valve from t=**0** s. * **28000** particles with **5 mm** diameter are inserted into the valve with the rate of **4000 particles/s**. * The rotor starts its ortation at t = 1.25 s at the rate of 2.1 rad/s. @@ -19,7 +19,7 @@ The problem is to simulate a Rotary Air-Lock Valve. The external diameter of rot # Setting up the Case -As it has been explained in the previous simulations, the simulation case setup is based on text-based scripts. Here, the simulation case setup files are stored into three folders: `caseSetup`, `setting`, and `stl` (see the above folders). See next the section for more information on how we can setup the geometry and its rotation. +As explained in the previous simulations, the simulation case setup is based on text-based scripts. Here, the simulation case setup files are stored in three folders: `caseSetup`, `setting`, and `stl` (see the folders above). See the next section for more information on how we can set up the geometry and its rotation. ## Geometry @@ -87,7 +87,7 @@ surfaces ``` ## Defining particles ### Diameter and material of spheres -In the `caseSetup/sphereShape` the diameter and the material name of the particles are defined. +In the `caseSetup/shapes` the diameter and the material name of the particles are defined.
in caseSetup/sphereShape file @@ -104,10 +104,10 @@ diameters (0.005); materials (sphereMat); ``` ### Insertion of Particles -Insertion of particles starts from t = 0 s and ends at t = 7 s. A box is defined for the port from which particles are being inderted. The rate of insertion is 4000 particles per second. +Particle insertion starts at t = 0 s and ends at t = 7 s. A box is defined for the port from which particles are inserted. The insertion rate is 4000 particles per second.
-in settings/particleInsertion file +in caseSetup/particleInsertion file
```C++ @@ -200,10 +200,10 @@ model 0.1); } ``` -# Performing simulation and seeing the results +# Performing simulation and viewing simulation results To perform simulations, enter the following commands one after another in the terminal. -Enter `$ particlesPhasicFlow` command to create the initial fields for particles (here the simulaiton has no particle at the beginning). +Enter `$ particlesPhasicFlow` command to create the initial fields for particles (here the simulation has no particle at the beginning). Enter `$ geometryPhasicFlow` command to create the geometry. -At last, enter `$ sphereGranFlow` command to start the simulation. -After finishing the simulation, you can use `$ pFlowtoVTK` to convert the results into vtk format stored in ./VTK folder. +Finally, type `$ sphereGranFlow` command to start the simulation. +After the simulation is finished, you can type `$ pFlowtoVTK` to convert the results to vtk format, which can be found in the ./VTK folder. \ No newline at end of file From 6a151253768a2d14618fd44d998350cd015dbf25 Mon Sep 17 00:00:00 2001 From: ramin1728 Date: Wed, 1 Jan 2025 14:26:27 +0330 Subject: [PATCH 3/3] Readme.md is updated. --- .../rotatingDrumSmall/README.md | 160 +++++++++++------- 1 file changed, 99 insertions(+), 61 deletions(-) diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md index 60d0ad55..47a13ffe 100644 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md @@ -1,6 +1,6 @@ # Simulating a small rotating drum {#rotatingDrumSmall} ## Problem definition -The problem is to simulate a rotating drum with the diameter 0.24 m and the length 0.1 m rotating at 11.6 rpm. It is filled with 30,000 4-mm spherical particles. The timestep for integration is 0.00001 s. +The problem is to simulate a rotating drum with a diameter of 0.24 m and a length of 0.1 m, rotating at 11.6 rpm. It is filled with 30,000 spherical particles with a diameter of 4 mm. The time step for integration is 0.00001 s.
a view of rotating drum @@ -10,38 +10,79 @@ a view of rotating drum *** ## Setting up the case -PhasicFlow simulation case setup is based on the text-based scripts that we provide in two folders located in the simulation case folder: `settings` and `caseSetup` (You can find the case setup files in the above folders. -All the commands should be entered in the terminal while the current working directory is the simulation case folder (at the top of the `caseSetup` and `settings`). +The PhasicFlow simulation case setup is based on the text-based scripts that we provide in two folders located in the simulation case folder: `settings` and `caseSetup` (You can find the case setup files in the above mentioned folders. +All commands should be entered in the terminal with the current working directory being the simulation case folder (at the top of the `caseSetup` and `settings` folders). ### Creating particles Open the file `settings/particlesDict`. Two dictionaries, `positionParticles` and `setFields` position particles and set the field values for the particles. -In dictionary `positionParticles`, the positioning `method` is `positionOrdered`, which position particles in order in the space defined by `box`. `box` space is defined by two corner points `min` and `max`. In dictionary `positionOrderedInfo`, `numPoints` defines number of particles; `diameter`, the distance between two adjacent particles, and `axisOrder` defines the axis order for filling the space by particles. +In dictionary `setFields`, dictionary `defaultValue` defines the initial value for particle fields (here, `velocity`, `acceleration`, `rotVelocity`, and `shapeName`). Note that `shapeName` field should be consistent with the name of shape that you later set for shapes (here one shape with name `sphere1`).
in settings/particlesDict file
```C++ -positionParticles +setFields { - method positionOrdered; // ordered positioning - maxNumberOfParticles 40000; // maximum number of particles in the simulation - mortonSorting Yes; // perform initial sorting based on morton code? - - box // box for positioning particles + defaultValue { - min (-0.08 -0.08 0.015); // lower corner point of the box - max ( 0.08 0.08 0.098); // upper corner point of the box + 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 sphere1; // name of the particle shape } + selectors + { + shapeAssigne + { + selector stridedRange; // other options: box, cylinder, sphere, randomPoints + + stridedRangeInfo + { + begin 0; // begin index of points - positionOrderedInfo + end 30000; // end index of points + + stride 3; // stride for selector + } + + fieldValue // fields that the selector is applied to + { + shapeName word sphere1; // sets shapeName of the selected points to largeSphere + } + } + } +} +In dictionary `positionParticles`, the positioning `method` is `ordered`, which position particles in order in the space defined by `box`. `box` space is defined by two corner points `min` and `max`. In dictionary `orderedInfo`, `numPoints` defines number of particles; `diameter`, the distance between two adjacent particles, and `axisOrder` defines the axis order for filling the space by particles. + +
+in settings/particlesDict file +
+ +```C++ +positionParticles +{ + method ordered; // other options: random and empty + mortonSorting Yes; // perform initial sorting based on morton code + + orderedInfo { - diameter 0.004; // minimum space between centers of particles - numPoints 30000; // number of particles in the simulation + diameter 0.004; // minimum space between centers of particles + numPoints 30000; // number of particles in the simulation axisOrder (z y x); // axis order for filling the space with particles - } + } + + regionType box; // other options: cylinder and sphere + + boxInfo // box information for positioning particles + { + min (-0.08 -0.08 0.015); // lower corner point of the box + + max ( 0.08 0.08 0.098); // upper corner point of the box + + } ``` In dictionary `setFields`, dictionary `defaultValue` defines the initial value for particle fields (here, `velocity`, `acceleration`, `rotVelocity`, and `shapeName`). Note that `shapeName` field should be consistent with the name of shape that you later set for shapes (here one shape with name `sphere1`). @@ -55,10 +96,10 @@ 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 sphere1; // name of the particle shape + 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 sphere1; // name of the particle shape } selectors {} @@ -70,24 +111,24 @@ Enter the following command in the terminal to create the particles and store th `> particlesPhasicFlow` ### Creating geometry -In file `settings/geometryDict` , you can provide information for creating geometry. Each simulation should have a `motionModel` that defines a model for moving the surfaces in the simulation. `rotatingAxisMotion` model defines a fixed axis which rotates around itself. The dictionary `rotAxis` defines an motion component with `p1` and `p2` as the end points of the axis and `omega` as the rotation speed in rad/s. You can define more than one motion component in a simulation. +In file `settings/geometryDict` , you can provide information for creating geometry. Each simulation should have a `motionModel` that defines a model for moving the surfaces in the simulation. `rotatingAxis` model defines a fixed axis which rotates around itself. The dictionary `rotAxis` defines an motion component with `p1` and `p2` as the end points of the axis and `omega` as the rotation speed in rad/s. You can define more than one motion component in a simulation.
in settings/geometryDict file
```C++ -motionModel rotatingAxisMotion; +motionModel rotatingAxis; . . . -rotatingAxisMotionInfo +rotatingAxisInfo { 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.214; // rotation speed (rad/s) + 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.214; // rotation speed (rad/s) } } ``` @@ -138,7 +179,7 @@ Enter the following command in the terminal to create the geometry and store it `> geometryPhasicFlow` ### Defining properties and interactions -In the file `caseSetup/interaction` , you find properties of materials. `materials` defines a list of material names in the simulation and `densities` sets the corresponding density of each material name. model dictionary defines the interaction model for particle-particle and particle-wall interactions. `contactForceModel` selects the model for mechanical contacts (here nonlinear model with limited tangential displacement) and `rollingFrictionModel` selects the model for calculating rolling friction. Other required prosperities should be defined in this dictionary. +In the file `caseSetup/interaction` , you find properties of materials. `materials` defines a list of material names in the simulation and `densities` sets the corresponding density of each material name. model dictionary defines the interaction model for particle-particle and particle-wall interactions. `contactForceModel` selects the model for mechanical contacts (here nonlinear model with limited tangential displacement) and `rollingFrictionModel` selects the model for calculating rolling friction. Other required Properties should be defined in this dictionary.
in caseSetup/interaction file @@ -165,7 +206,7 @@ model } ``` -Dictionary `contactSearch` sets the methods for particle-particle and particle-wall contact search. `method` specifies the algorithm for finding neighbor list for particle-particle contacts and `wallMapping` shows how particles are mapped onto walls for finding neighbor list for particle-wall contacts. `updateFrequency` sets the frequency for updating neighbor list and `sizeRatio` sets the size of enlarged cells (with respect to particle diameter) for finding neighbor list. Larger `sizeRatio` include more particles in the neighbor list and you require to update it less frequent. +Dictionary `contactSearch` sets the methods for particle-particle and particle-wall contact search. Larger `sizeRatio` include more particles in the neighbor list and you require to update it less frequent.
in caseSetup/interaction file @@ -174,63 +215,60 @@ in caseSetup/interaction file ```C++ contactSearch { - method NBS; // method for broad search particle-particle - wallMapping cellsSimple; // method for broad search particle-wall + + method NBS; // method for broad search + + updateInterval 10; - NBSInfo - { - updateFrequency 20; // each 20 timesteps, update neighbor list - sizeRatio 1.1; // bounding box size to particle diameter (max) - } + sizeRatio 1.1; - cellsSimpleInfo - { - updateFrequency 20; // each 20 timesteps, update neighbor list - cellExtent 0.7; // bounding box for particle-wall search (> 0.5) - } + cellExtent 0.55; -} + adjustableBox Yes; +} ``` -In the file `caseSetup/sphereShape`, you can define a list of `names` for shapes (`shapeName` in particle field), a list of diameters for shapes and their `properties` names. +In the file `caseSetup/shapes`, you can define a list of `names` for shapes (`shapeName` in particle field), a list of diameters for shapes and their `properties` names.
-in caseSetup/sphereShape file +in caseSetup/shapes file
```C++ -names (sphere1); // names of shapes -diameters (0.004); // diameter of shapes -materials (prop1); // material names for shapes +names (sphere1); // names of shapes +diameters (0.004); // diameter of shapes +materials (prop1); // material names for shapes ``` -Other settings for the simulation can be set in file `settings/settingsDict`. The dictionary `domain` defines the a rectangular bounding box with two corner points for the simulation. Each particle that gets out of this box, will be deleted automatically. +Other settings for the simulation can be set in file `settings/settingsDict`.
in settings/settingsDict file
```C++ -dt 0.00001; // time step for integration (s) -startTime 0; // start time for simulation -endTime 10; // end time for simulation -saveInterval 0.1; // time interval for saving the simulation -timePrecision 6; // maximum number of digits for time folder -g (0 -9.8 0); // gravity vector (m/s2) -domain -{ - min (-0.12 -0.12 0); - max (0.12 0.12 0.11); -} +dt 0.00001; // time step for integration (s) +startTime 0; // start time for simulation +endTime 10; // end time for simulation +saveInterval 0.1; // time interval for saving the simulation +timePrecision 6; // 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 ascii; // data writting format (ascii or binary) +timersReport Yes; // report timers (Yes or No) +timersReportInterval 0.01; // time interval for reporting timers ``` ## Running the case -The solver for this simulation is `sphereGranFlow`. Enter the following command in the terminal. Depending on the computational power, it may take a few minutes to a few hours to complete. +The solver for this simulation is `sphereGranFlow`. Type the following command in a terminal. Depending on your computer's computation power, it may take from a few minutes to a few hours to complete. `> sphereGranFlow` ## Post processing -After finishing the simulation, you can render the results in Paraview. To convert the results to VTK format, just enter the following command in the terminal. This will converts all the results (particles and geometry) to VTK format and store them in folder `VTK/`. +When the simulation is finished, you can render the results in Paraview. To convert the results to VTK format, just type the following command in a terminal. This will convert all results (particles and geometry) to VTK format and save them in the folder `VTK/`. -`> pFlowToVTK` +`> pFlowToVTK` \ No newline at end of file