From e8e108134599ec98c5d025268548a9cef2d6b3bf Mon Sep 17 00:00:00 2001 From: wanqing0421 Date: Wed, 26 Feb 2025 23:31:52 +0800 Subject: [PATCH 1/4] update rotatingDrumSmall tutorial --- .../rotatingDrumSmall/README.md | 337 ++++++++++++------ 1 file changed, 236 insertions(+), 101 deletions(-) diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md index 60d0ad55..9bb6813e 100644 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md @@ -1,9 +1,8 @@ # Simulating a small rotating drum {#rotatingDrumSmall} -## Problem definition +## Problem definition (v-1.0) 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.
a view of rotating drum - ![](https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-s.png)
@@ -12,36 +11,41 @@ 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`). - + ### 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 `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 +positionParticles // positions particles { - method positionOrdered; // ordered positioning - maxNumberOfParticles 40000; // maximum number of particles in the simulation - mortonSorting Yes; // perform initial sorting based on morton code? + method ordered; // other options: random and empty - box // box 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 - } + mortonSorting Yes; // perform initial sorting based on morton code? - positionOrderedInfo - { - 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 - } + orderedInfo + { + 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`). @@ -51,44 +55,64 @@ in settings/particlesDict file ```C++ -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 - } - selectors - {} -} + defaultValue + { + velocity realx3 (0 0 0); // linear velocity (m/s) + + acceleration realx3 (0 0 0); // linear acceleration (m/s2) + + rVelocity 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 + + end ; // 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 + } + } + } ``` Enter the following command in the terminal to create the particles and store them in `0` folder. `> 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; -. -. -. -rotatingAxisMotionInfo +motionModel rotatingAxis; + +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.214; // rotation speed (rad/s) - } + 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) + } } ``` In the dictionary `surfaces` you can define all the surfaces (walls) in the simulation. Two main options are available: built-in geometries in PhasicFlow, and providing surfaces with stl file. Here we use built-in geometries. In `cylinder` dictionary, a cylindrical shell with end radii, `radius1` and `radius2`, axis end points `p1` and `p2`, `material` name `prop1`, `motion` component `rotAxis` is defined. `resolution` sets number of division for the cylinder shell. `wall1` and `wall2` define two plane walls at two ends of cylindrical shell with coplanar corner points `p1`, `p2`, `p3`, and `p4`, `material` name `prop1` and `motion` component `rotAxis`. @@ -100,37 +124,70 @@ in settings/geometryDict file ```C++ 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.1); // end point of cylinder axis - radius1 0.12; // radius at p1 - radius2 0.12; // radius at p2 - resolution 24; // number of divisions - material prop1; // material name of this wall - motion rotAxis; // motion component name - } - wall1 - { - type planeWall; // type of the wall - p1 (-0.12 -0.12 0.0); // first point of the wall - p2 ( 0.12 -0.12 0.0); // second point - p3 ( 0.12 0.12 0.0); // third point - p4 (-0.12 0.12 0.0); // fourth point - material prop1; // material name of the wall - motion rotAxis; // motion component name - } - wall2 - { - type planeWall; - p1 (-0.12 -0.12 0.1); - p2 ( 0.12 -0.12 0.1); - p3 ( 0.12 0.12 0.1); - p4 (-0.12 0.12 0.1); - material prop1; - motion rotAxis; - } + /* + A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1) + */ + + 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.1); // end point of cylinder axis + + radius1 0.12; // radius at p1 + + radius2 0.12; // radius at p2 + + resolution 24; // number of divisions + + material prop1; // 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.12 -0.12 0.0); // first point of the wall + + p2 ( 0.12 -0.12 0.0); // second point + + p3 ( 0.12 0.12 0.0); // third point + + p4 (-0.12 0.12 0.0); // fourth point + + material prop1; // 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.12 -0.12 0.1); // first point of the wall + + p2 ( 0.12 -0.12 0.1); // second point + + p3 ( 0.12 0.12 0.1); // third point + + p4 (-0.12 0.12 0.1); // fourth point + + material prop1; // material name of the wall + + motion rotAxis; // motion component name + } } ``` Enter the following command in the terminal to create the geometry and store it in `0/geometry` folder. @@ -172,24 +229,22 @@ in caseSetup/interaction file ```C++ +contactListType sortedContactList; + 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. @@ -204,27 +259,107 @@ 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); -} -integrationMethod AdamsBashforth2; // integration method +run rotatingDrumSmall; + +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 ``` +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. + +
+in settings/domainDict file +
+ +```C++ +globalBox // Simulation domain: every particles that goes outside this domain will be deleted +{ + min (-0.12 -0.12 0.00); // lower corner point of the box + + max (0.12 0.12 0.11); // upper corner point of the box +} + +decomposition +{ + direction z; +} + +boundaries +{ + + + neighborListUpdateInterval 50; /* Determines how often (how many iterations) do you want to + + rebuild the list of particles in the neighbor list + + of all boundaries in the simulation domain */ + + updateInterval 10; // Determines how often do you want to update the new changes in the boundary + + neighborLength 0.004; // The distance from the boundary plane within which particles are marked to be in the boundary list + + left + { + type exit; // other options: periodict, reflective + } + + right + { + type exit; // other options: periodict, reflective + } + + bottom + { + type exit; // other options: periodict, reflective + } + + top + { + type exit; // other options: periodict, reflective + } + + rear + { + type exit; // other options: periodict, reflective + } + + front + { + type exit; // other options: periodict, reflective + } +} +``` + + ## 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. From cfd188587cd5f1c6e4865a8da2f32084d57eb5f8 Mon Sep 17 00:00:00 2001 From: wanqing0421 Date: Thu, 27 Feb 2025 23:18:01 +0800 Subject: [PATCH 2/4] revise the readme and domainDict --- .../rotatingDrumSmall/README.md | 293 +++++++++--------- .../rotatingDrumSmall/settings/domainDict | 28 +- 2 files changed, 148 insertions(+), 173 deletions(-) diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md index 9bb6813e..ca5907e9 100644 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md @@ -1,5 +1,4 @@ -# Simulating a small rotating drum {#rotatingDrumSmall} -## Problem definition (v-1.0) +# Problem definition (v-1.0) 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.
a view of rotating drum @@ -25,27 +24,27 @@ in settings/particlesDict file ```C++ positionParticles // positions particles { - method ordered; // other options: random and empty + method ordered; // other options: random and empty - mortonSorting Yes; // perform initial sorting based on morton code? + mortonSorting Yes; // perform initial sorting based on morton code? - orderedInfo - { - diameter 0.004; // minimum space between centers of particles + orderedInfo + { + diameter 0.004; // minimum space between centers of particles - numPoints 30000; // number of particles in the simulation + numPoints 30000; // number of particles in the simulation - axisOrder (z y x); // axis order for filling the space with particles - } + axisOrder (z y x); // axis order for filling the space with particles + } - regionType box; // other options: cylinder and sphere + 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 + 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 - } + 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,38 +54,38 @@ in settings/particlesDict file
```C++ - defaultValue - { - velocity realx3 (0 0 0); // linear velocity (m/s) + defaultValue + { + velocity realx3 (0 0 0); // linear velocity (m/s) - acceleration realx3 (0 0 0); // linear acceleration (m/s2) + acceleration realx3 (0 0 0); // linear acceleration (m/s2) - rVelocity realx3 (0 0 0); // rotational velocity (rad/s) + rVelocity realx3 (0 0 0); // rotational velocity (rad/s) - shapeName word sphere1; // name of the particle shape - } + shapeName word sphere1; // name of the particle shape + } - selectors - { - shapeAssigne - { - selector stridedRange; // other options: box, cylinder, sphere, randomPoints + selectors + { + shapeAssigne + { + selector stridedRange; // other options: box, cylinder, sphere, randomPoints - stridedRangeInfo - { - begin 0; // begin index of points + stridedRangeInfo + { + begin 0; // begin index of points - end ; // end index of points + end ; // end index of points - stride 3; // stride for selector - } + stride 3; // stride for selector + } - fieldValue // fields that the selector is applied to - { - shapeName word sphere1; // sets shapeName of the selected points to largeSphere - } - } - } + fieldValue // fields that the selector is applied to + { + shapeName word sphere1; // sets shapeName of the selected points to largeSphere + } + } + } ``` Enter the following command in the terminal to create the particles and store them in `0` folder. @@ -105,14 +104,14 @@ motionModel rotatingAxis; rotatingAxisInfo // information for rotatingAxisMotion motion model { - rotAxis - { - p1 (0.0 0.0 0.0); // first point for the axis of rotation + 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 + p2 (0.0 0.0 1.0); // second point for the axis of rotation - omega 1.214; // rotation speed (rad/s) - } + omega 1.214; // rotation speed (rad/s) + } } ``` In the dictionary `surfaces` you can define all the surfaces (walls) in the simulation. Two main options are available: built-in geometries in PhasicFlow, and providing surfaces with stl file. Here we use built-in geometries. In `cylinder` dictionary, a cylindrical shell with end radii, `radius1` and `radius2`, axis end points `p1` and `p2`, `material` name `prop1`, `motion` component `rotAxis` is defined. `resolution` sets number of division for the cylinder shell. `wall1` and `wall2` define two plane walls at two ends of cylindrical shell with coplanar corner points `p1`, `p2`, `p3`, and `p4`, `material` name `prop1` and `motion` component `rotAxis`. @@ -124,70 +123,70 @@ in settings/geometryDict file ```C++ surfaces { - /* - A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1) - */ + /* + A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1) + */ - cylinder - { - type cylinderWall; // type of the wall + cylinder + { + type cylinderWall; // type of the wall - p1 (0.0 0.0 0.0); // begin point of cylinder axis + p1 (0.0 0.0 0.0); // begin point of cylinder axis - p2 (0.0 0.0 0.1); // end point of cylinder axis + p2 (0.0 0.0 0.1); // end point of cylinder axis - radius1 0.12; // radius at p1 + radius1 0.12; // radius at p1 - radius2 0.12; // radius at p2 + radius2 0.12; // radius at p2 - resolution 24; // number of divisions + resolution 24; // number of divisions - material prop1; // material name of this wall + material prop1; // material name of this wall - motion rotAxis; // motion component name - } + motion rotAxis; // motion component name + } - /* - This is a plane wall at the rear end of cylinder - */ + /* + This is a plane wall at the rear end of cylinder + */ - wall1 - { - type planeWall; // type of the wall + wall1 + { + type planeWall; // type of the wall - p1 (-0.12 -0.12 0.0); // first point of the wall + p1 (-0.12 -0.12 0.0); // first point of the wall - p2 ( 0.12 -0.12 0.0); // second point + p2 ( 0.12 -0.12 0.0); // second point - p3 ( 0.12 0.12 0.0); // third point + p3 ( 0.12 0.12 0.0); // third point - p4 (-0.12 0.12 0.0); // fourth point + p4 (-0.12 0.12 0.0); // fourth point - material prop1; // material name of the wall + material prop1; // material name of the wall - motion rotAxis; // motion component name - } + motion rotAxis; // motion component name + } - /* - This is a plane wall at the front end of cylinder - */ + /* + This is a plane wall at the front end of cylinder + */ - wall2 - { - type planeWall; // type of the wall + wall2 + { + type planeWall; // type of the wall - p1 (-0.12 -0.12 0.1); // first point of the wall + p1 (-0.12 -0.12 0.1); // first point of the wall - p2 ( 0.12 -0.12 0.1); // second point + p2 ( 0.12 -0.12 0.1); // second point - p3 ( 0.12 0.12 0.1); // third point + p3 ( 0.12 0.12 0.1); // third point - p4 (-0.12 0.12 0.1); // fourth point + p4 (-0.12 0.12 0.1); // fourth point - material prop1; // material name of the wall + material prop1; // material name of the wall - motion rotAxis; // motion component name - } + motion rotAxis; // motion component name + } } ``` Enter the following command in the terminal to create the geometry and store it in `0/geometry` folder. @@ -209,16 +208,16 @@ densities (1000.0); // density of materials [kg/m3] . model { - contactForceModel nonLinearNonLimited; - rollingFrictionModel normal; + contactForceModel nonLinearNonLimited; + rollingFrictionModel normal; - Yeff (1.0e6); // Young modulus [Pa] - Geff (0.8e6); // Shear modulus [Pa] - nu (0.25); // Poisson's ratio [-] - en (0.7); // coefficient of normal restitution - et (1.0); // coefficient of tangential restitution - mu (0.3); // dynamic friction - mur (0.1); // rolling friction + Yeff (1.0e6); // Young modulus [Pa] + Geff (0.8e6); // Shear modulus [Pa] + nu (0.25); // Poisson's ratio [-] + en (0.7); // coefficient of normal restitution + et (1.0); // coefficient of tangential restitution + mu (0.3); // dynamic friction + mur (0.1); // rolling friction } ``` @@ -234,15 +233,15 @@ contactListType sortedContactList; contactSearch { - method NBS; // method for broad search + method NBS; // method for broad search - updateInterval 10; + updateInterval 10; - sizeRatio 1.1; + sizeRatio 1.1; - cellExtent 0.55; + cellExtent 0.55; - adjustableBox Yes; + adjustableBox Yes; } ``` @@ -254,9 +253,9 @@ in caseSetup/sphereShape 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`. @@ -268,30 +267,30 @@ in settings/settingsDict file ```C++ run rotatingDrumSmall; -dt 0.00001; // time step for integration (s) +dt 0.00001; // time step for integration (s) -startTime 0; // start time for simulation +startTime 0; // start time for simulation -endTime 10; // end time for simulation +endTime 10; // end time for simulation -saveInterval 0.1; // time interval for saving the simulation +saveInterval 0.1; // time interval for saving the simulation -timePrecision 6; // maximum number of digits for time folder +timePrecision 6; // maximum number of digits for time folder -g (0 -9.8 0); // gravity vector (m/s2) +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 +integrationMethod AdamsBashforth2; // integration method -writeFormat ascii; // data writting format (ascii or binary) +writeFormat ascii; // data writting format (ascii or binary) -timersReport Yes; // report timers (Yes or No) +timersReport Yes; // report timers (Yes or No) -timersReportInterval 0.01; // time interval for reporting timers +timersReportInterval 0.01; // time interval for reporting timers ``` 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. @@ -303,59 +302,47 @@ in settings/domainDict file ```C++ globalBox // Simulation domain: every particles that goes outside this domain will be deleted { - min (-0.12 -0.12 0.00); // lower corner point of the box + min (-0.12 -0.12 0.00); // lower corner point of the box - max (0.12 0.12 0.11); // upper corner point of the box + max (0.12 0.12 0.11); // upper corner point of the box } decomposition { - direction z; + direction z; } boundaries { - + left + { + type exit; // other options: periodic, reflective + } - neighborListUpdateInterval 50; /* Determines how often (how many iterations) do you want to + right + { + type exit; // other options: periodic, reflective + } - rebuild the list of particles in the neighbor list + bottom + { + type exit; // other options: periodic, reflective + } - of all boundaries in the simulation domain */ + top + { + type exit; // other options: periodic, reflective + } - updateInterval 10; // Determines how often do you want to update the new changes in the boundary + rear + { + type exit; // other options: periodic, reflective + } - neighborLength 0.004; // The distance from the boundary plane within which particles are marked to be in the boundary list - - left - { - type exit; // other options: periodict, reflective - } - - right - { - type exit; // other options: periodict, reflective - } - - bottom - { - type exit; // other options: periodict, reflective - } - - top - { - type exit; // other options: periodict, reflective - } - - rear - { - type exit; // other options: periodict, reflective - } - - front - { - type exit; // other options: periodict, reflective - } + front + { + type exit; // other options: periodic, reflective + } } ``` @@ -368,4 +355,4 @@ The solver for this simulation is `sphereGranFlow`. Enter the following command ## 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/`. -`> pFlowToVTK` +`> pFlowToVTK --binary` diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict b/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict index a9f3e185..a1b70f71 100755 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict @@ -8,9 +8,9 @@ fileFormat ASCII; /*---------------------------------------------------------------------------*/ globalBox // Simulation domain: every particles that goes outside this domain will be deleted { - min (-0.12 -0.12 0.00); // lower corner point of the box + min (-0.12 -0.12 0.00); // lower corner point of the box - max (0.12 0.12 0.11); // upper corner point of the box + max (0.12 0.12 0.11); // upper corner point of the box } decomposition @@ -20,45 +20,33 @@ decomposition boundaries { - - - neighborListUpdateInterval 50; /* Determines how often (how many iterations) do you want to - - rebuild the list of particles in the neighbor list - - of all boundaries in the simulation domain */ - - updateInterval 10; // Determines how often do you want to update the new changes in the boundary - - neighborLength 0.004; // The distance from the boundary plane within which particles are marked to be in the boundary list - left { - type exit; // other options: periodict, reflective + type exit; // other options: periodict, reflective } right { - type exit; // other options: periodict, reflective + type exit; // other options: periodict, reflective } bottom { - type exit; // other options: periodict, reflective + type exit; // other options: periodict, reflective } top { - type exit; // other options: periodict, reflective + type exit; // other options: periodict, reflective } rear { - type exit; // other options: periodict, reflective + type exit; // other options: periodict, reflective } front { - type exit; // other options: periodict, reflective + type exit; // other options: periodict, reflective } } From 282d9733fc29c4853d3e69e7360d0f4f1dbe05c3 Mon Sep 17 00:00:00 2001 From: wanqing0421 Date: Fri, 28 Feb 2025 00:43:03 +0800 Subject: [PATCH 3/4] correctiont for rotatingDrumSmall --- .../rotatingDrumSmall/README.md | 36 +++++-------------- .../rotatingDrumSmall/caseSetup/interaction | 2 -- .../rotatingDrumSmall/caseSetup/sphereShape | 12 ------- .../rotatingDrumSmall/settings/domainDict | 5 --- .../rotatingDrumSmall/settings/particlesDict | 18 +--------- 5 files changed, 9 insertions(+), 64 deletions(-) delete mode 100755 tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/sphereShape diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md index ca5907e9..7ce3d126 100644 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md @@ -1,4 +1,4 @@ -# Problem definition (v-1.0) +## Problem definition (v-1.0) 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.
a view of rotating drum @@ -54,6 +54,8 @@ in settings/particlesDict file
```C++ +setFields +{ defaultValue { velocity realx3 (0 0 0); // linear velocity (m/s) @@ -67,25 +69,9 @@ in settings/particlesDict file selectors { - shapeAssigne - { - selector stridedRange; // other options: box, cylinder, sphere, randomPoints - - stridedRangeInfo - { - begin 0; // begin index of points - end ; // 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 - } - } } +} ``` Enter the following command in the terminal to create the particles and store them in `0` folder. @@ -215,7 +201,6 @@ model Geff (0.8e6); // Shear modulus [Pa] nu (0.25); // Poisson's ratio [-] en (0.7); // coefficient of normal restitution - et (1.0); // coefficient of tangential restitution mu (0.3); // dynamic friction mur (0.1); // rolling friction } @@ -246,10 +231,10 @@ contactSearch ``` -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/shape`, 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/shape file
```C++ @@ -302,14 +287,9 @@ in settings/domainDict file ```C++ globalBox // Simulation domain: every particles that goes outside this domain will be deleted { - min (-0.12 -0.12 0.00); // lower corner point of the box + min (-0.12 -0.12 0.00); // lower corner point of the box - max (0.12 0.12 0.11); // upper corner point of the box -} - -decomposition -{ - direction z; + max (0.12 0.12 0.11); // upper corner point of the box } boundaries diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/interaction b/tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/interaction index 3923f1d4..2713ed01 100755 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/interaction +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/interaction @@ -40,8 +40,6 @@ model en (0.7); // coefficient of normal restitution - et (1.0); // coefficient of tangential restitution - mu (0.3); // dynamic friction mur (0.1); // rolling friction diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/sphereShape b/tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/sphereShape deleted file mode 100755 index 7a87b7ad..00000000 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/caseSetup/sphereShape +++ /dev/null @@ -1,12 +0,0 @@ -/* -------------------------------*- C++ -*--------------------------------- *\ -| phasicFlow File | -| copyright: www.cemf.ir | -\* ------------------------------------------------------------------------- */ -objectName sphereDict; -objectType sphereShape; -fileFormat ASCII; -/*---------------------------------------------------------------------------*/ - -names (sphere1); // names of shapes -diameters (0.004); // diameter of shapes -materials (prop1); // material names for shapes diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict b/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict index a1b70f71..730402bc 100755 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/settings/domainDict @@ -13,11 +13,6 @@ globalBox // Simulation domain: every par max (0.12 0.12 0.11); // upper corner point of the box } -decomposition -{ - direction z; -} - boundaries { left diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/settings/particlesDict b/tutorials/sphereGranFlow/rotatingDrumSmall/settings/particlesDict index 21403626..23d4af07 100644 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/settings/particlesDict +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/settings/particlesDict @@ -29,24 +29,8 @@ setFields selectors { - shapeAssigne - { - selector stridedRange; // other options: box, cylinder, sphere, randomPoints - - stridedRangeInfo - { - begin 0; // begin index of points - 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 - } - } + } } positionParticles // positions particles From c87c9716efc0d21e035b9c4d6f5aff121e6b26fe Mon Sep 17 00:00:00 2001 From: PhasicFlow <113092888+PhasicFlow@users.noreply.github.com> Date: Thu, 27 Feb 2025 20:28:21 +0330 Subject: [PATCH 4/4] Update README.md --- .../rotatingDrumSmall/README.md | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md index 7ce3d126..d8955de3 100644 --- a/tutorials/sphereGranFlow/rotatingDrumSmall/README.md +++ b/tutorials/sphereGranFlow/rotatingDrumSmall/README.md @@ -1,8 +1,15 @@ -## Problem definition (v-1.0) +# Simularing a rotating drum (v-1.0) +## 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. -
-a view of rotating drum +
+ + +A view of rotating drum + + + ![](https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-s.png) +
*** @@ -206,7 +213,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. `method` specifies the algorithm for finding neighbor list for particle-particle contacts. `updateInterval` sets the number of iterations between each occurance of 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.
in caseSetup/interaction file @@ -278,14 +285,15 @@ timersReport Yes; // report timers (Yes or No) timersReportInterval 0.01; // time interval for reporting timers ``` -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. +The dictionary `settings/domainDict` 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.
in settings/domainDict file
```C++ -globalBox // Simulation domain: every particles that goes outside this domain will be deleted +// Simulation domain: every particles that goes outside this domain will be deleted +globalBox { min (-0.12 -0.12 0.00); // lower corner point of the box