0% found this document useful (0 votes)
173 views

XML v4.0 GUIDE

The document describes the input and output file formats used in DualSPHysics simulations. It discusses XML and binary file formats. XML files use text to structure information with labels and can be edited in any text editor. Binary files consume less memory than text but require special code to read. The document outlines the structure of XML files, including the CASEDEF and EXECUTION sections that define simulation parameters and geometry. It provides examples of constants defined in the CASEDEF section like gravity, speed of sound, kernel size, and time step.

Uploaded by

Rishabh Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
173 views

XML v4.0 GUIDE

The document describes the input and output file formats used in DualSPHysics simulations. It discusses XML and binary file formats. XML files use text to structure information with labels and can be edited in any text editor. Binary files consume less memory than text but require special code to read. The document outlines the structure of XML files, including the CASEDEF and EXECUTION sections that define simulation parameters and geometry. It provides examples of constants defined in the CASEDEF section like gravity, speed of sound, kernel size, and time step.

Uploaded by

Rishabh Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 95

Create your own case using the XML file

April 2016

DualSPHysics team
1
Post-Processing Pre-Processing
Input & output files

2
Input & output files: Format files

XML File
Case_Def.xml
• The eXtensible Markup Language is textual data format compatible
Case.xml with any hardware and software.
• Information is structured and organised by using labels.
• They can be easily edited using any text editor.

BINARY File
Case.bi4 • Binary format consumes six times less memory than text format.
• Reading or writing is several times faster using a binary format.
Part_xxxx.bi4
PartOut.obi4 • A special code is required to read the data (JPartDataBi4.cpp/.h).
• “.bi4” is the new binary format that also includes double precision.
• The user can also define new arrays that post-processing tools can
automatic manage.

3
Input & output files
Constants and configuration
parameters for simulation

Created by GenCase BUT it can


Created by the user also be created by the user

Data for moving


Binary file with
boundaries
particle data at
Data of forces exerted
initial instant
on fluid

Binary file with particle


data at output time

Binary file with excluded


particles during simulation Text file with
execution log
4
object.ply
object.vtk
XML file Case_Def.xml object.stl GENCASE mov.dat Case.xml
object.ply
forces.csv
Case_All.vtk Case.bi2
Case.xml Case_Bound.vtk
GENCASE mov.dat
Case_Fluid.vtk
forces.csv
Case_All.vtk Case.bi2 DUALSPHYSICS
Case__Actual.vtk
mov.dat Case.xml Case_Bound.vtk Case__Dp.vtk
Case_Fluid.vtk
forces.csv Case.bi2 DUALSPHYSICS
Case__Actual.vtk Part_xxxx.bi2 Run.out
Case__Dp.vtk PartOut.bi2

DUALSPHYSICS Part_xxxx.bi2 Run.out


PartOut.bi2 PointsPos.csv
Points.txt
Part_xxxx.bi2 Run.out
PartOut.bi2
PARTVTK BOUNDARYVTK ISOSURFACE
PointsPos.csv MEASURETOOL
Points.txt
PartFluid.vtk Fixed.vtk Surface_xxxx.vtk Pressure.csv
K BOUNDARYVTK
PartBound.vtk
ISOSURFACE MEASURETOOL Velocity.csv
Moving_xxxx.vtk
PartMoving.vtk Floating_xxxx.vtk Height_xxxx.vtk
PartFloating.vtk Surface_xxxx.vtk
Fixed.vtk Pressure.csv Acceleration.ascii
k Moving_xxxx.vtk Velocity.csv
tk Floating_xxxx.vtk Height_xxxx.vtk
vtk Acceleration.ascii

5
STRUCTURE OF THE XML FILE

Divided in two sections:

“casedef”

Definition of the case with initial geometry and


configuration.
Created by the user and used by GenCase

“execution”

Information required to execute the case.


Created by the user, modified by GenCase
and only used by DualSPHysics

6
STRUCTURE OF THE XML FILE
• “casedef” :
- constantsdef constants needed in SPH

- mkconfig label configuration

- geometry system geometry (boundaries and fluid)


- definition
- commands (list & mainlist)

- initials special features for fluid particles

- floatings description of floating objects

- motion description of boundary movement

• “execution”
- special automatic wave generation and external forces
- wavepaddles (piston & piston_spectrum)
- accinputs

- parameters execution parameters in DualSPHysics


7
XML file CASEDEF-CONSTANTSDEF

8
XML file CASEDEF-CONSTANTSDEF
Lattice

lattice: indicates the type of mesh


to create particles:
• 1: one particle per point
• 2: two particles per point

9
XML file CASEDEF-CONSTANTSDEF
Gravity

d va  Pb  Pa 
  mb    ab   a Wab  g
dt b  b   a 
10
XML file CASEDEF-CONSTANTSDEF
Speed of sound

𝑠𝑝𝑒𝑒𝑑𝑠𝑦𝑠𝑡𝑒𝑚 = 𝑔 ∙ ℎ𝑠𝑤𝑙

cs2  w     
P    1
   w  
 

11
XML file CASEDEF-CONSTANTSDEF
Speed of sound

𝑠𝑝𝑒𝑒𝑑𝑠𝑦𝑠𝑡𝑒𝑚 = 𝑔 ∙ ℎ𝑠𝑤𝑙

cs2  w     
P    1
   w  
 

12
XML file CASEDEF-CONSTANTSDEF
Speed of sound

𝑠𝑝𝑒𝑒𝑑𝑠𝑦𝑠𝑡𝑒𝑚 = 𝑔 ∙ ℎ𝑠𝑤𝑙

cs2  w     
P    1
   w  
 

13
XML file CASEDEF-CONSTANTSDEF
Kernel size

ℎ = 𝑐𝑜𝑒𝑓ℎ ∙ 𝑑𝑥 2 + 𝑑𝑦 2 + 𝑑𝑧 2
coefh=1 typical value
ℎ = 𝑐𝑜𝑒𝑓ℎ ∙ 3 ∙ 𝑑𝑝2
coefh=1.2, 1.5 better for wave propagation
ℎ = 𝑐𝑜𝑒𝑓ℎ ∙ 3 ∙ 𝑑𝑝
Other option is to define:

ℎ𝑑𝑝 = ℎ/𝑑𝑝 14
XML file CASEDEF-CONSTANTSDEF
Time-step

15
CASEDEF-MKCONFIG

mk: label used to


- defines the order objects are created
- applies specific features to the different set of
points such as movement, rigid motion…
240 labels for boundary particles and
10 labels for fluid particles

mkorientfluid = “xyz”

mkorientation: determines the order of particles


when creating one object (useful for
visualization with the variable idp)
mkorientfluid = “xyz”
mkorientfluid = “yzX”
mkorientfluid = “ZYx”

16
XML file CASEDEF-GEOMETRY-DEFINITION

dp defines the distance between particles


WHEN CHANGING THIS PARAMETER, THE TOTAL NUMBER OF PARTICLES IS MODIFIED
pointmin & pointmax defines the dimensions of the domain where particles can be created
pointmax

NOTE that particles are only created within this domain.


Once particles have been created the dimensions of the
domain for simulation are calculated again starting from
pointmin
minimum and maximum positions of the created particles.
XML file CASEDEF-GEOMETRY-DEFINITION

A 2-D configuration can be generated by imposing the same values along Y-direction
<pointmin> = <pointmax>

18
XML file CASEDEF-GEOMETRY-COMMANDS-MAINLIST

Volume of fluid: setmkfluid mk=0,


solid to create particles within the specified volume
drawbox to plot a rectangular box defining a corner
and its size in the 3 directions

Boundary Tank: setmkbound mk=0,


specify box faces on which particles are
created (top is not used in this example)

19
CASEDEF-GEOMETRY-COMMANDS-MAINLIST

This command indicates the mode to create points where particles will be generated

wire face

<setdrawmode>:
– “wire”: wire mode
– “face”: draw faces
– “solid”: draw inside
– “full”: combines face and solid

solid full

20
CASEDEF-GEOMETRY-COMMANDS-MAINLIST

<setshapemode>: defines the draw operations to create VTK files (polygons)

• “real”: using the real coordinates


• “dp”: adjusting coordinates to dp

• “fluid”: operations with mk-fluid


• “bound”: operations with mk-bound
• “void”: operations with mk-void

21
CASEDEF-GEOMETRY-COMMANDS-MAINLIST

<setshapemode>: defines the draw operations to create a VTK files (polygons)

shapeout: creates VTK files (polygons) shapeout: creates VTK files (polygons)
of only some bound objects of all the bound objects
Case_Box_Dp.vtk Case__Real.vtk
Case_Building_Dp.vtk Case__Dp.vtk

reset=“true” objects created after this command will be saved on a different VTK file
22
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
These commands indicate the type of particles to be generated

<setmkvoid>, <setmkfluid>, <setmkbound>: defines the label mk to draw points of type:


void (empty), fluid, bound

<setmknextfluid>, <setmknextbound>: increases (decreases) the value of mk with next=true (=false)


<setmknextauto>: after each draw command mk is increased automatically

23
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
Transformation utilities

<move>: a displacement is applied to the transformation matrix

<scale>: scaling is applied to matrix

<rotate>:a starting vector and angle are given for object rotation

<matrixreset>: the modified matrix is replaced by the original one (identity matrix)
24
CASEDEF-GEOMETRY-COMMANDS-MAINLIST

<move x="0.5" y="0" z="0"/>


<drawbox …>
<drawbox …>

<scale x="2" y="1.5" z="0.5"/> <rotate x="0" y="0" z="1" ang="45"/>


<drawbox …> <drawbox …>
25
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
LINES

<setlinebegin>: sets the begining of the line with <drawlineto>

<drawlineto>: draws a line to a given point

<drawline>: draws a line between two points

<drawlines>: draws lines between several points

26
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
TRIANGLES

<drawtriangle>: draws a triangle with tree points (points


must always go counterclockwise)

<drawquadri>: draws the quadrilateral described by four


points (points may not be in the same plane)

27
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
TRIANGLES

<drawtrianglesstrip>: draws a series of chained triangles

0 2
4
6
8

1
3
5
7
28
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
TRIANGLES

<drawtrianglesfan>: draws a range of triangles

4
3
5

0 1
5
6

0
4
7

3
8

2
9
1/10
29
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
TRIANGLES

<drawtriangles>: draws a series of triangles defined by


a set of points or a set of triangles

7
6

1
30
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
FIGURE

<drawfigure>: draws a solid figure consisting of all the interior


points to the planes formed by the given triangles

DrawFigure DrawTriangles or
(drawmode=solid) DrawFigure (drawmode=face)

31
CASEDEF-GEOMETRY-COMMANDS-MAINLIST

<drawpyramid>: draws a pyramid with the top point and


other points of the base (minimum 3)

mask indicates the faces to be hidden with bits


the first bit always corresponds to the base and the rest to
the faces following the order

Pyramid1 Pyramid2
(mask=0) (mask=2=0010)

32
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
PRISM

<drawprism>: draws a prism with a minimum of 6 points


The first half of points are the base and the second half the top
(the number of points must be even)

mask indicates the faces to be hidden with bits


The first bit corresponds to the base, the second to the top and
the rest to the faces following the order

Prism1 (mask=0) Prism2 (mask=2=00010)

33
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
PRISM

<drawprism>: draws a prism with a minimum of 6 points


The first half of points are the base and the second half the top
(the number of points must be even)

mask indicates the faces to be hidden with bits


The first bit corresponds to the base, the second to the top and
the rest to the faces following the order

34
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
PRISM

35
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
MASK

mask indicates the faces to be hidden


Initially this is defined using BITS

FOR EXAMPLE: OBJECT WITH 4 FACES:

mask=“0” decimal 0 is 0000 in binary no faces are hidden


mask=“1” decimal 1 is 0001 in binary first face is hidden
mask=“2” decimal 2 is 0010 in binary second face is hidden
mask=“4” decimal 4 is 0100 in binary third face is hidden
mask=“8” decimal 8 is 1000 in binary fourth face is hidden

mask=“12” decimal 12 is 1100 in binary third and fourth face are hidden

36
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
PRISM
There is a second and easiest system to use mask
mask can be also defined using the index of the faces instead of bits
In this example, faces 1, 2, 6 and 7 are not created, only 3,4 and 5
It is important to use symbol “|” to detect this system!!!

EXAMPLE: CaseWavemaker_Def.xml
2 3

7 4
1 6
5
3

37
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
BOX
<drawbox>: draws a box with an initial point and the size
<boxfill> indicates if solid or face and the faces to be hidden
back
top
right
left

bottom
front
BoxSolid (solid) BoxA (all)

BoxB (all^top) BoxC (bottom|left|right)


means means only
all faces excluding top bottom+left+right
38
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
BEACH

BeachFace

BeachFace
(mask=“128”)

<drawbeach>: draws a beach with the lateral points that formed the profile of the beach
mask indicates the faces to be hidden .

mask=“128” decimal 128 is 10000000 in binary eighth face is hidden

39
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
SPHERE

<drawsphere>: draws a sphere with the center point and the radius

Sphere Sphere
(drawmode=solid) (drawmode=face)

when face:
ctesphere indicates the width of the sphere
ctespherenumsides indicates the number of triangles used
to create the VTK of polygons

40
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
CYLINDER
<drawcylinder>: draws a cylinder with two points and radius
mask indicates the faces to be hide

Cylinder Cylinder
(drawmode=solid) (drawmode=face)

when face:
ctecylindertube indicates the width of the tube
ctecylindercover indicates the width of the covers
ctespherenumsides indicates the number of triangles used
to create the VTK of polygons
41
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
IMPORTING EXTERNAL GEOMETRIES

<drawfilevtk>: load a VTK file to be converted into points

<drawfileply>: load a PLY file to be converted into points

<drawfilestl>: load a STL file to be converted into points

Some modifications can be applied to the VTK, PLY or STL


drawmove a displacement is applied to the external object
drawrotate a rotation is applied to the external object
drawscale scaling is applied to the external object

42
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
IMPORTING EXTERNAL GEOMETRIES

from VTK to points

43
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
FILLING DOMAINS

<fillpoint>: fills with points starting from the seed

<fillbox>: fills with points starting from the seed


within the limits defined by a box

<fillfigure>: fills with points starting from the seed


within the limits defined by a figure

<fillprism>: fills with points starting from the seed


within the limits defined by a prism

<modefill> indicates what type of points can be filled


with void, fluid, bound, it fills with that type of points
inside the specified limits or the presence of a given
type of point using border

44
CASEDEF-GEOMETRY-COMMANDS-MAINLIST
FILLING DOMAINS

seed point

limits of the
domain to fill

filling with fluid while void and


before the limits defined by a box
45
CASEDEF-INITIALS
INITIAL VELOCITIES

<initials>: special behaviours can be imposed to a set of


fluid particles labeled with a mk, such as:

<velocity> initial velocity defined by a vector


<velwave> a solitary wave defined by depth and amplitude

46
CASEDEF-INITIALS
INITIAL VELOCITIES

different initial velocities are imposed to two


volumes of fluid mk=1 (sphere) and mk=2 (box)

vbox = (-0.875,0,5.886)
vsphere = (1.05,0,4.905)

47
CASEDEF-INITIALS
INITIAL VELOCITIES

colour represents velocity

48
CASEDEF-FLOATINGS
DEFINING FLOATINGS

<floatings>: indicates that a set of particles labelled with


the same mk constitutes a floating object

Only one of these values can be defined:


rhopbody density of the object
relativeweight in relation to the reference density
massbody total mass of the object

So that, the mass of a floating particles is:


masspart = massbody / nfloat or
masspart = relativeweight * rhop0 * dp^3 or
masspart = rhopbody * dp^3

These variables are computed by GenCase or


can be also specified in advance:
center gravity center of the rigid object
inertia momentum of inertia of the rigid object
velini initial linear velocity of the object
omegaini initial angular velocity of the object
49
CASEDEF-FLOATINGS
DEFINING FLOATINGS

When the interaction of solids (boundaries or floatings) is computed using Discrete Element Method (DEM)
some extra properties with parameters used in DEM are loaded from “Floating_Materials.xml”:

50
CASEDEF-PROPERTIES
DEFINING OTHER VARIABLES

Using section properties, users can define variables to be assigned to one or more mk.

Each label of property has a name and can group several values
that can be text (other) or a number (weight)

or other subvalues (massbody and center)

51
CASEDEF-PROPERTIES
These properties can be loaded from an external file using propertyfile.
In this case, users have to indicate file name and path to access section with properties.

Example of file “ftdata_ext.xml”:

Section links assigns one or more property to one or several values of mk:
- Values of material_1 are assigned to fluid particles with mk=0

- Values of material_2 and data_x are assigned to boundary particles with mk=1,3,4,5,6

It is also possible to indicate one property directly in the definition of the floatings:

52
CASEDEF-PROPERTIES
GenCase reads the information from case.casedef.properties and writes in case.execution.particles.properties.

Thus, DualSPHysics can access to assigned values to each mk.


The object of type JSpaceParts is used to obtain the assigned properties to each block of particles

53
CASEDEF-MOTION
•Motion01: uniform rectilinear motion (<mvrect />) that also includes pauses (<wait />)

movement defined for the


set of particles with mk=1

first mov=1 during 0.6s,


then wait=2 for 0.3s,
then mov=3 during 0.6s,
then wait=4 for 0.3s,
then mov=5 during 0.6s…

<mvrect>: uniform rectilinear movement

vel indicates the constant velocity vector

54
CASEDEF-MOTION
•Motion01: uniform rectilinear motion (<mvrect />) that also includes pauses (<wait />)

55
CASEDEF-MOTION
•Motion02: combination of two uniform rectilinear motions (<mvrect />)

<mvrect>: uniform rectilinear movement

vel indicates the constant velocity vector

56
CASEDEF-MOTION
•Motion02: combination of two uniform rectilinear motions (<mvrect />)

57
CASEDEF-MOTION
•Motion03: movement of an object depending on the
movement of another (hierarchy of objects)

movement defined for the


set of particles with mk=2
that also moves according to the
movement defined for mk=1

58
CASEDEF-MOTION
•Motion03: movement of an object depending on the movement of another (hierarchy of objects)

59
CASEDEF-MOTION
•Motion04: accelerated rectilinear motion (<mvrectace />)

<mvrectace>: accelerated rectilinear movement

velini indicates the initial velocity vector


ace indicates the acceleration vector

60
CASEDEF-MOTION
•Motion04: accelerated rectilinear motion (<mvrectace />)

61
CASEDEF-MOTION
•Motion05: rotational motion (<mvrot />)

<mvrot>: rotational movement

vel indicates the angular velocity


axisp1 first point of the rotation axis
axisp2 second point of the rotation axis

62
CASEDEF-MOTION
•Motion05: rotational motion (<mvrot />)

63
CASEDEF-MOTION
•Motion06: accelerated rotation motion (<mvrotace />) and accelerated circular motion (<mvcirace />).

<mvrotace>: accelerated rotational movement

ace indicates the angular acceleration


velini indicates the initial angular velocity
axisp1 first point of the rotation axis
axisp2 second point of the rotation axis

<mvcirace>: accelerated circular movement

ace indicates the angular acceleration


ref indicates the point of the object that rotates
with the axis
velini indicates the initial angular velocity
axisp1 first point of the rotation axis
axisp2 second point of the rotation axis

64
CASEDEF-MOTION
•Motion06: accelerated rotation motion (<mvrotace />) and accelerated circular motion (<mvcirace />).

65
CASEDEF-MOTION
•Motion07: sinusoidal movement (<mvrectsinu />, <mvrotsinu />, <mvcirsinu />)

<mvrectsinu>: sinusoidal rectilinear


movement

<mvrotsinu>: sinusoidal rotational


movement

<mvcirsinu>: sinusoidal circular


movement

axisp1 first point of the rotation axis


axisp2 second point of the axis
freq frequency
ampl amplitude
phase phase

66
CASEDEF-MOTION
•Motion07: sinusoidal movement (<mvrectsinu />, <mvrotsinu />, <mvcirsinu />)

67
CASEDEF-MOTION
•Motion08: predefined movement with data from an external file (<mvpredef /> or <mvfile />)

<mvpredef /> or <mvfile />:


prescribed motion loaded from a file

name name of the file


fields number of columns of the file
fieldtime column with time
fieldx column with X-position
fieldy column with Y-position
filedz column with Z-position

first field (or column) has reference "0"


second field (or column) has reference "1"

68
CASEDEF-MOTION
•Motion08: predefined movement with data from an external file (<mvpredef /> or <mvfile />)

69
CASEDEF-MOTION
•Motion09: predefined movement with data from an external file (<mvrotfile />)

<mvrotfile />: prescribed motion loaded from a file with degrees

name name of the file


axisp1 & axisp2 two points to define the axis of rotation

70
CASEDEF-MOTION
•Motion09: predefined movement with data from an external file (<mvrotfile />)

71
XML file EXECUTION-SPECIAL-WAVEPADDLES-PISTON

Generation of regular waves

•waveorder: order of wave generation (1st order or 2nd order)


•depth: depth at front of the piston
•waveheight: wave height H
•waveperiod: wave period T
•ramp: number of periods to smooth the movement of the piston
•savemotion: saves theoretical results of elevation and orbital velocities at xpos and zpos
(being zpos=-depth of the measuring point) 72
XML file EXECUTION-SPECIAL-WAVEPADDLES-PISTON

Generation of regular waves


•waveorder: order of wave generation (1st order or 2nd order)
•depth: depth at front of the piston
•waveheight: wave height H
•waveperiod: wave period T
•ramp: number of periods to smooth the movement of the piston (being zpos=-depth of the measuring point)

•savemotion: saves theoretical results of elevation and orbital velocities at xpos and zpos

73
EXECUTION-SPECIAL-WAVEPADDLES-PISTON_SPECTRUM
Generation of irregular waves

74
EXECUTION-SPECIAL-WAVEPADDLES-PISTON_SPECTRUM
Generation of irregular waves
•waveorder: order of wave generation (1st order or 2nd order)
•spectrum: type of spectrum (Jonswap or Pierson-Moskowitz)
•waveheight: significant wave height Hs
•waveperiod: peak wave period Tp
•serieini: initial series of the irregular train is chosen from “WavePaddle_mkb0010_Serie.csv”
•ramptime: time to slowly start a smoothed movement of the piston (being zpos=-depth of the measuring point)

•savemotion: saves theoretical results of elevation and orbital velocities at xpos and zpos

75
XML file EXECUTION-PARAMETERS

Parameters for execution in


DualSPHysics

76
XML file EXECUTION-PARAMETERS
Double precision

DualSPHysics v4.0 includes now implementation with double precision.


Precision in particle interaction (the most time consuming part) can be:

0: particle interaction is performed using simple precision for variables of position

Necessary when “dp” is much smaller than size of the domain:


1: particle interaction is performed using double precision for variables of position but final position is stored
using simple precision
2: particle interaction is performed using double precision for variables of position and final position is stored
using double precision

depth: hSWL=0.18 m

length=18 m
length>depth>>dp
77
XML file EXECUTION-PARAMETERS
Time integrator scheme

Verlet algorithm once every M time steps

van1  van1  2tFan van1  van  tFan


ran1  ran  tVan  0.5t 2 Fan ran1  ran  tVan  0.5t 2 Fan
 an1   an1  2tDan an1   an  tDan

t n t n 2
1 1 1
n n
n 1
ra  r  2
a
n
va v  va 
a
2
Fa
Symplectic algorithm 2 2
t n1
1
t n n
1
n n 1
a 2  an  Da ra  ra 2  va
2 2
Predictor Corrector 78
XML file EXECUTION-PARAMETERS
Kernel function

d va  Pb  Pa 
  mb    ab   a Wab  g
dt b  b   a 

Cubic Spline  3 2 3 3
1  2 q  4 q 0  q  1

 1
W r,h  α D  2  q 3 1  q  2
 4
 0 q2


where 𝛼𝐷 is equal to 10/7πh2 in 2-D and 1/πh3 in 3-D

Wendland 4
 q
W r,h   αD 1   2q  1 0 q 2
 2

where 𝛼𝐷 is equal to 7 4𝜋ℎ2 in 2-D and 21 16𝜋ℎ3 in 3-D 79


XML file EXECUTION-PARAMETERS
Viscosity treatment

d va  Pb  Pa 
  mb 
   ab   a Wab  g
dt b  b   a 
  α cab μab
 v ab  rab  0
Π ab   ρab
 v ab  rab  0
 0
α=0.01 for wave tanks
higher values of α for dam-break (depends on dp)

80
XML file EXECUTION-PARAMETERS
Viscosity treatment

d va  Pb  Pa 
  mb 
   ab   a Wab  g
dt b  b   a 
  α cab μab
 v ab  rab  0
Π ab   ρab
 0 v ab  rab  0

αFF for interaction fluid-fluid


αFB for interaction fluid-boundary
αFB= ViscoBoundFactor ∙ αFF

81
XML file EXECUTION-PARAMETERS
Viscosity treatment

dv a P P 
  mb  b2  a2   aWab  g
dt b  ρb ρa 
P P   4υ0 rab   aWab 
  mb  b2  a2   aWab  g mb 
dv a v 
2  ab
 (ρa  ρb )( rab  η ) 
2
dt b  ρb ρa  b
 
dv a  Pb Pa   4υ0 rab   aWab   τ ijb τ ija 
  mb  2  2   aWab  g   mb  v   mb  2  2   aWab
2  ab ρ 
 ρb ρa   (ρa  ρb )( rab  η )   b ρa 
2
dt b b b
 
 4υ0 rab   aWab   τ ijb τ ija 
  mb  v ab    mb     aW-6ab 2
 a  ρ 2 υ is2 kinematic
 η   ρ(typically
viscosity 2  10 m s for water
 b ρa 
b (ρ b )( rab o ) b
2

 
 τ ijb τ ija 
  mb  2  2   aWab
ρ 
b  b ρa 

82
XML file EXECUTION-PARAMETERS
DeltaSPH formulation

dρa  ρa  1
  mb v ab aWab  2 h mb cab   1 2 aWab
 ρb  rab  η
2
dt b b

83
XML file EXECUTION-PARAMETERS
Shifting algorithm

r  D  Ci No Shifting

mj
D  As h u i t  Ci   Wij
j j
Shifting update Concentration gradient
Shifting that ignores fixed boundaries
SHIFTING
SHIFTING IN THE NORMAL DIRECTION
IS NOT APPLIED FOR PARTICLES
AT THE FREE SURFACE
  r  1.5  r  
mj
rij   iWij
Particle divergence j ρj
XML file EXECUTION-PARAMETERS
Interaction between solids

DEM is recommended

Interaction between floatings


SPH or DEM

Interaction between floating and bottom


SPH or DEM
85
XML file EXECUTION-PARAMETERS
Time step computation


∆𝑡𝑚𝑖𝑛𝑖𝑚𝑢𝑚 = 0.05 ∙
𝑐𝑠

∆𝑡𝑖𝑛𝑖𝑡 =
𝑐𝑠

0: b ϵ fluid/floating
OR
1: b ϵ fluid/floating + boundaries
86
XML file EXECUTION-PARAMETERS
Physical time and frequency to store data

Number of output files = TimeMax / TimeOut


= 10 / 0.1 = 100 files

87
XML file EXECUTION-PARAMETERS

Excluding particles by position Incz=25%

Excluding particles by density 𝟕𝟎𝟎 < 𝝆𝟎 < 𝟏𝟑𝟎𝟎


88
XML file EXECUTION-PARAMETERS
Periodicity

Δz=0.3 m

Δz=0 m

89
object.ply
object.vtk
XML file Case_Def.xml object.stl GENCASE mov.dat Case.xml
object.ply
forces.csv
Case_All.vtk Case.bi2
Case.xml Case_Bound.vtk
GENCASE mov.dat
Case_Fluid.vtk
forces.csv
Case_All.vtk Case.bi2 DUALSPHYSICS
Case__Actual.vtk
mov.dat Case.xml Case_Bound.vtk Case__Dp.vtk
Case_Fluid.vtk
forces.csv Case.bi2 DUALSPHYSICS
Case__Actual.vtk Part_xxxx.bi2 Run.out
Case__Dp.vtk PartOut.bi2

DUALSPHYSICS Part_xxxx.bi2 Run.out


PartOut.bi2 PointsPos.csv
Points.txt
Part_xxxx.bi2 Run.out
PartOut.bi2
PARTVTK BOUNDARYVTK ISOSURFACE
PointsPos.csv MEASURETOOL
Points.txt
PartFluid.vtk Fixed.vtk Surface_xxxx.vtk Pressure.csv
K BOUNDARYVTK
PartBound.vtk
ISOSURFACE MEASURETOOL Velocity.csv
Moving_xxxx.vtk
PartMoving.vtk Floating_xxxx.vtk Height_xxxx.vtk
PartFloating.vtk Surface_xxxx.vtk
Fixed.vtk Pressure.csv Acceleration.ascii
k Moving_xxxx.vtk Velocity.csv
tk Floating_xxxx.vtk Height_xxxx.vtk
vtk Acceleration.ascii

90
XML file Summary of the number of created
particles and computed constants

np=total number of particles


nb=boundary particles
nbf=fixed boundary particles
and final mk of the objects

NOTE value of final “mk”


mk=mkbound+11
mk=mkfluid+1

mass=rhop0*dp*dp*dp in 3D
mass=rhop0*dp*dp in 2D

YOU SHOULD ALWAYS CHECK


Case_All.vtk, Case_Bound.vtk, Case_Fluid.vtk
91
Case__Dp.vtk
Input & output files
PHYSICS

xx.bi2 Run.out
.bi2 PointsPos.csv
Text file with execution log
Points.txt

ISOSURFACE MEASURETOOL

Surface_xxxx.vtk Pressure.csv
Velocity.csv
Height_xxxx.vtk
Acceleration.ascii

Domain dimensions
computed starting from
minimum and maximum
positions of the particles
created initially

92
Case__Dp.vtk
Input & output files
PHYSICS

xx.bi2 Run.out
.bi2 PointsPos.csv
Text file with execution log
Points.txt

ISOSURFACE MEASURETOOL

Surface_xxxx.vtk Pressure.csv
Velocity.csv
Height_xxxx.vtk
Acceleration.ascii

93
Case__Dp.vtk
Input & output files
PHYSICS

xx.bi2 Run.out
.bi2 PointsPos.csv
Text file with execution log
Points.txt

ISOSURFACE MEASURETOOL

Surface_xxxx.vtk Pressure.csv
Velocity.csv
Height_xxxx.vtk
Acceleration.ascii

94
Post-Processing Pre-Processing
Input & output files

95

You might also like