Documente Academic
Documente Profesional
Documente Cultură
April 2019
DualSPHysics team
http://dual.sphysics.org
INDEX 3
GENCASE
Case_All.vtk
Case_Bound.vtk
mov.dat Case.xml Case_Fluid.vtk
forces.csv Case.bi4 Case__Actual.vtk
Case__Dp.vtk
DUALSPHYSICS
Points.txt
Post-Processing
object.vtk
Case_Def.xml object.stl
object.ply
XML File
• The eXtensible Markup Language is textual data format compatible
Case_Def.xml
with any hardware and software.
Case.xml • 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_Head.ibi4 • A special code is required to read the data (JPartDataBi4.cpp/.h).
Part_xxxx.bi4 • “.bi4” is the new binary format that also includes double precision.
PartOut.obi4 • The user can also define new arrays that post-processing tools can
PartFloat.fbi4 automatic manage.
VTK File
Particles_xxxx.vtk • VTK (Visualization ToolKit) files are used for final visualization
• These files are generated as a pre-processing step by GenCase or as
Velocity_xxxx.vtk
output by DualSPHysics and post-processing tools.
Height_xxxx.vtk
• VTK files of POLYDATA type with legacy-binary format is used.
Surface_xxxx.vtk • VTK format is supported for many visualization applications, such as
Slices_xxxx.vtk ParaView that is open-source and multi-platform .
Case_Def.xml
object.ply
2. XML file object.vtk 8
“casedef”
“execution”
• “casedef” :
- constantsdef constants needed in SPH
• “execution”
- special automatic wave generation and external forces
- wavepaddles (piston & piston_spectrum)
- accinputs
Lattice
Gravity
d va Pb Pa
mb ab a Wab g
dt b b a
2.2. XML file: Casedef-ConstantsDef 14
Speed of sound
𝑠𝑝𝑒𝑒𝑑𝑠𝑦𝑠𝑡𝑒𝑚 = 𝑔 ∙ ℎ𝑠𝑤𝑙
cs2 w
P 1
w
2.2. XML file: Casedef-ConstantsDef 15
Speed of sound
𝑠𝑝𝑒𝑒𝑑𝑠𝑦𝑠𝑡𝑒𝑚 = 𝑔 ∙ ℎ𝑠𝑤𝑙
cs2 w
P 1
w
2.2. XML file: Casedef-ConstantsDef 16
Speed of sound
𝑠𝑝𝑒𝑒𝑑𝑠𝑦𝑠𝑡𝑒𝑚 = 𝑔 ∙ ℎ𝑠𝑤𝑙
cs2 w
P 1
w
2.2. XML file: Casedef-ConstantsDef 17
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:
ℎ𝑑𝑝 = ℎ/𝑑𝑝
2.2. XML file: Casedef-ConstantsDef 18
Time-step
2.2. XML file: Casedef-ConstantsDef 19
Other values
MK CONFIGURATION
A 2-D configuration can be generated by imposing the same values along Y-direction
<pointmin> = <pointmax>
2.4.2. XML file: Casedef-Geometry-Commands 23
COMMAND LISTS
<mainlist>
StructureList
BoxList
CylinderList
2.4.2. XML file: Casedef-Geometry-Commands 25
DRAWING SETTINGS
<setdrawmode>: 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
2.4.2. XML file: Casedef-Geometry-Commands 26
VTK OUTPUT
VTK OUTPUT
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__Actual.vtk
Case_Building_Dp.vtk Case__Dp.vtk
reset=“true” objects created after this command will be saved on a different VTK file
2.4.2. XML file: Casedef-Geometry-Commands 28
MK SELECTION
TRANSFORMATIONS
Transformation utilities
TRANSFORMATIONS
LINES
TRIANGLES
TRIANGLES
0 2
4
6
8
1
3
5
7
2.4.2. XML file: Casedef-Geometry-Commands 34
TRIANGLES
4
3
5
0 1
5
6
0
4
7
3
8
2
9
1/10
2.4.2. XML file: Casedef-Geometry-Commands 35
TRIANGLES
7
6
1
2.4.2. XML file: Casedef-Geometry-Commands 36
BOXES
bottom
front
BoxSolid (solid) BoxA (all)
POLYHEDRONS: PYRAMID
Pyramid1 Pyramid2
(mask=0) (mask=2=0010)
2.4.2. XML file: Casedef-Geometry-Commands 38
POLYHEDRONS: PRISM
POLYHEDRONS: PRISM
POLYHEDRONS: PRISM
2.4.2. XML file: Casedef-Geometry-Commands 41
POLYHEDRONS: MASK
mask=“12” decimal 12 is 1100 in binary third and fourth face are hidden
2.4.2. XML file: Casedef-Geometry-Commands 42
POLYHEDRONS: MASK
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
5
2.4.2. XML file: Casedef-Geometry-Commands 43
POLYHEDRONS: 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 .
POLYHEDRONS: FIGURE
DrawFigure DrawTriangles or
(drawmode=solid) DrawFigure (drawmode=face)
2.4.2. XML file: Casedef-Geometry-Commands 45
<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
2.4.2. XML file: Casedef-Geometry-Commands 46
Ellipsoid Ellipsoid
(drawmode=solid) (drawmode=face)
when face:
cteellipsoid indicates the width of the ellipsoid
2.4.2. XML file: Casedef-Geometry-Commands 47
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
2.4.2. XML file: Casedef-Geometry-Commands 48
EXTERNAL GEOMETRIES
EXTERNAL GEOMETRIES
FILLING DOMAINS
FILLING DOMAINS
seed point
limits of the
domain to fill
REDRAW
GenCase employs a 3-D Cartesian lattice to locate particles. These particles are created at the nodes
of that lattice. A value of “mk” is assigned to each node according to the type of particle (boundary,
fluid or void) and to define a special behaviour during the simulation.
<redrawnear> allows to indicate the nodes that will be modified if there is a neighbouring node that
follows some given condition.
REDRAW
Example A:
defines the “mk” for the nodes starting from here
changes all previous nodes with mkfluid=1
B C
2.4.2. XML file: Casedef-Geometry-Commands 54
REDRAW
Example B: modifies all nodes of fluid (targettp="fluid") that have a neighbouring node of type
boundary (bordertp="bound")
B C
2.4.2. XML file: Casedef-Geometry-Commands 55
REDRAW
Example C: modifies all nodes of type void (targettp="void") that have a neighbouring node of type
boundary (bordertp="bound") and with mk=2 (bordermk="2")
B C
2.4.2. XML file: Casedef-Geometry-Commands 56
REDRAW
Redraw commands can be used to close the holes in complex boundary geometries before filling
areas with fluid particles.
2.5. XML file: Casedef-Initials 57
INITIAL VELOCITIES
INITIAL VELOCITIES
vbox = (-0.875,0,5.886)
vsphere = (1.05,0,4.905)
2.5. XML file: Casedef-Initials 59
INITIAL VELOCITIES
colour represents velocity
2.5. XML file: Casedef-Initials 60
INITIAL DISPLACEMENT
Displacements (<move>) and rotations (<rotateaxis>) applied to final position of particles can be
defined in <initials> section. It allows to change the position of particles without the limitations of
the lattice.
A A. Creates a simple box.
Particle size
2.5. XML file: Casedef-Initials 62
INITIAL DISPLACEMENT
Displacements (<move>) and rotations (<rotateaxis>) applied to final position of particles can be
defined in <initials> section. It allows to change the position of particles without the limitations of
the lattice.
A C. Applies rotation after creating the particles.
It is useful to avoid the effects of the lattice
when the resolution is low.
Particle size
2.6. XML file: Casedef-Floatings 63
DEFINING FLOATINGS
DEFINING FLOATINGS
<translation> and <rotation> can be used to restrain some of the six degrees of freedom (DOF)
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”:
2.7. XML file: Casedef-Properties 66
Each label of property has a name and can group several values
that can be text (other) or a number (weight)
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:
2.7. XML file: Casedef-Properties 68
The section <special> defines the configuration of different features used in DualSPHysics simulation.
3.1.1. XML file: Special-WavePaddles 88
Automatic wave generation for Regular & Irregular waves using a Piston or Flap and
Solitary waves using a Piston.
Piston or Flap is made of moving boundary particles with a MkBound value. These particles are
moved according wave parameters.
3.1.1. XML file: Special-WavePaddles 89
GENERATION OF REGULAR WAVES: PISTON
waveorder: order of wave generation,1st order or 2nd order (i.e. subharmonics or bound long waves)
spectrum: type of spectrum (Jonswap or Pierson-Moskowitz)
waveheight: significant wave height Hs
waveperiod: peak wave period Tp
waves: number of wave components to discretize the wave spectrum
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
savemotion: saves theoretical results of elevation and orbital velocities at xpos and zpos
swl: z-coordinate of still water level with respect to the reference system
gaugex: position from piston to measure free-surface elevation
– value: expressed in [m]
– valueh: expressed as multiple of the smoothing length, h.
– valuedp: expressed as multiple of the dp.
limitace: factor to limit maximum value of acceleration of the avoid modes of vibration of very high
frequencies
correction: compensation of piston drift if the displacement is bigger than coefstroke times the piston
stroke applied during a time equal to coefperiod*T
3.1.2. XML file: Special-WavePaddles-AWAS 101
ACTIVE WAVE ABSORPTION
3.1.3. XML file: Special-Damping 102
PASSIVE ABSORPTION
Multi-Layer Pistons using external velocity data (for one-way offline coupling)
filevelx: .csv file containing the information of horizontal velocity to be applied to the boundary
particles forming the multi-layered piston. It contains time, z-position of each layer and velocity
of each layer
incz: offset to apply to the z-coordinate contained in the .csv file. Usually it is the difference in z
between the coordinate of the still water level from the wave propagation model and the one in
DualSPHysics.
smooth: number of neighbor particles considered to apply a smoothing average on the velocity
along the z-axis and avoid solution of continuity in the multi-layered piston.
3.1.5. XML file: Special-RelaxationZones 106
REGULAR WAVES
Relaxation zone to generate regular waves (DualSPHysics stand alone)
depth: water depth at wave generation location (i.e. relaxation zone location)
swl: z-coordinate of the still water level
filesvel: name of the .csv files (SgWave4i3L_corr_velz_xNN_yMM) generated by the wave
propagation model and containing the horizontal velocity information. If SWASH model
(http://swash.sourceforge.net/) is used as wave propagation model, the .csv files can be generated using
ReadSwash2_win64.exe
filesvelX: index of the first velocity file to use and total number of files to be considered
3.1.5. XML file: Special-RelaxationZones 110
UNIFORM VELOCITY
Relaxation zone to impose uniform velocity profiles
Gauges section configures multiple measurements (fluid velocity, free surface limit,
maximum elevation, force exerted by the fluid) that are performed during the simulation
and their results can be used in the simulation itself.
3.1.6. XML file: Special-Gauges 112
Configuration applied by default to all gauges. Each gauge can modify these parameters.
3.1.6. XML file: Special-Gauges 113
VELOCITY
Velocity: Measures the fluid velocity in a position (x, y, z). Each gauge is identified by a
unique name.
3.1.6. XML file: Special-Gauges 114
SWL
Swl: Calculates the Free Surface Limit along a line (between point0 and point1).
3.1.6. XML file: Special-Gauges 115
MAXZ
Maxz: Obtains maximum z of fluid particles in a zone defined by the position point0 and
a search distance according Dp, Coefh or guiven value.
3.1.6. XML file: Special-Gauges 116
FORCE
Force: Obtains the force summation exerted by fluid on fixed or moving particles
according the MkBound value.
3.1.7. XML file: Special-Accinputs 117
Imposed acceleration to fluid particles. Linear and angular acceleration according time is
obtained from an external CSV file. Imposed acceleration is applied according to MkFluid.
3.1.8. XML file: Special-SaveDt 118
Defines a variable frequency to save results (binary files with particle data) of the
simulation
XML file EXECUTION-PARAMETERS 121
Double precision
depth: hSWL=0.18 m
length=18 m
length>depth>>dp
XML file EXECUTION-PARAMETERS 123
t n t n 2
1 1 1
n n
n 1
ra 2
r
a
n
va v a va 2
Fa
Symplectic algorithm 2 2
t n1
1
t n
1 n
n n 1
a 2
an Da ra ra 2
va
2 2
Predictor Corrector
XML file EXECUTION-PARAMETERS 124
Kernel function
d va P P
mb b a 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 q2
where 𝛼𝐷 is equal to 10/7πh2 in 2-D and 1/πh3 in 3-D
4
q
W r,h αD 1 2q 1
Wendland 0 q 2
2
Gaussian
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)
XML file EXECUTION-PARAMETERS 126
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
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 mb aW-6ab 2
2 ab
a ρ 2
υ η
is kinematic
ρ(typically
viscosity 2 10 m s for water
b ρa
(ρ )( r ) 2
b b ab o b
τ ijb τ ija
mb 2 2 aWab
ρ
b b ρa
XML file EXECUTION-PARAMETERS 128
DeltaSPH formulation
dρa ρa 1
mb v ab aWab 2 h mb cab 1 2 aWab
ρb rab η
2
dt b b
XML file EXECUTION-PARAMETERS 129
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 130
DEM is recommended
ℎ
∆𝑡𝑚𝑖𝑛𝑖𝑚𝑢𝑚 = 0.05 ∙
𝑐𝑠
ℎ
∆𝑡𝑖𝑛𝑖𝑡 =
𝑐𝑠
0: b ϵ fluid/floating
OR
1: b ϵ fluid/floating + boundaries
XML file EXECUTION-PARAMETERS 132
Periodicity
Δz=0.3 m
Δz=0 m
XML file EXECUTION-PARAMETERS 135
Simulationdomain
NOTE that once particles have been created the dimensions of the domain for simulation are
calculated again starting from minimum and maximum positions of the created particles.
mass=rhop0*dp*dp*dp in 3D
mass=rhop0*dp*dp in 2D
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
Case__Dp.vtk
Input & output files
PHYSICS
139
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
Case__Dp.vtk
Input & output files
PHYSICS
140
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
Post-Processing Pre-Processing
Input & output files
141