Top Banner
Pre-processing and User Friendly Interface Dr Alejandro CRESPO Universidade de Vigo SPAIN 2nd DualSPHysics User Workshop, 6-7 December 2016
57

Pre-processing and User Friendly Interface

Feb 20, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Pre-processing and User Friendly Interface

Pre-processing andUser Friendly Interface

Dr Alejandro CRESPOUniversidade de Vigo

SPAIN

2nd DualSPHysics User Workshop, 6-7 December 2016

Page 2: Pre-processing and User Friendly Interface

Outline of Presentation

Pre-processing tool: GenCase

XML input file

DesignSPHysics

Future developments

Page 3: Pre-processing and User Friendly Interface

Input (red) and output (blue) files of DualSPHysics code

PRE-PROCESSING

SPH SOLVER

POST-PROCESSING

Case.bi4

Part_xxxx.bi4PartOut.bi4

Pre-processing: GenCase

Page 4: Pre-processing and User Friendly Interface

GENCASE

Case_Def.xmlobject.vtkobject.stlobject.ply

DUALSPHYSICS

Run.outPart_xxxx.bi4PartOut.bi4

Case_All.vtkCase_Bound.vtkCase_Fluid.vtk

Case__Actual.vtkCase__Dp.vtk

Case.xml

Case.bi4

mov.dat

forces.csv

Pre-processing: GenCase

Page 5: Pre-processing and User Friendly Interface

Pre-processing: GenCase

GENCASE

Case_Def.xmlobject.vtkobject.stlobject.ply

DUALSPHYSICS

Part_xxxx.bi4PartOut.bi4

Run.out

Case_All.vtkCase_Bound.vtkCase_Fluid.vtk

Case__Actual.vtkCase__Dp.vtk

Case.xml

Case.bi4

mov.dat

forces.csv

Page 6: Pre-processing and User Friendly Interface

Draw points

• GenCase is a drawing application that creates

points that will be converted into particles.

• It employs a 3D lattice to locate points which

represents possible positions of the particles.

Pre-processing: GenCase

Page 7: Pre-processing and User Friendly Interface

Draw points

Lattice

Pre-processing: GenCase

Page 8: Pre-processing and User Friendly Interface

Draw points

Drawing

triangle

Pre-processing: GenCase

Lattice

Page 9: Pre-processing and User Friendly Interface

Draw points

Drawing

triangle

Pre-processing: GenCase

Lattice

Page 10: Pre-processing and User Friendly Interface

Draw points

Triangle to

points

Pre-processing: GenCase

Lattice

Page 11: Pre-processing and User Friendly Interface

Draw points

Triangle to

points

Pre-processing: GenCase

Lattice

Page 12: Pre-processing and User Friendly Interface

Draw points

3D model Triangles Points

Pre-processing: GenCase

Page 13: Pre-processing and User Friendly Interface

Draw points

3D model Triangles Points

Pre-processing: GenCase

Page 14: Pre-processing and User Friendly Interface

Draw points

Triangles Low resolution836 particles

Higher resolution1,836 particles

Particles are depicted as cubes

Pre-processing: GenCase

Page 15: Pre-processing and User Friendly Interface

Draw points

Triangles Low resolution836 particles

Higher resolution6,934 particles

Pre-processing: GenCase

Page 16: Pre-processing and User Friendly Interface

Draw points

Triangles Low resolution836 particles

Higher resolution27,474 particles

Pre-processing: GenCase

Page 17: Pre-processing and User Friendly Interface

Predefined objectsPredefined shapes can be added to the simulation just by setting up some configuration parameters:

BOX: a corner and the size are required

SPHERE: the centre and radius are needed

Pre-processing: GenCase

Page 18: Pre-processing and User Friendly Interface

External objects

Blender AutoCAD3D Studio Max

3DS DXF DWG GIS H5PART CSV MAX

SHP CAD PLY STL VTK

GenCase is able to load external object designed with different softwares.

Pre-processing: GenCase

Page 19: Pre-processing and User Friendly Interface

External objects

3DS DXF DWG GIS H5PART CSV MAX

SHP CAD PLY STL VTK

PLY -> exportable using BLENDER

STL -> exportable using 3DSTUDIO

VTK -> PARAVIEW

PLY, STL, VTK can be loaded by GenCase

Pre-processing: GenCase

Page 20: Pre-processing and User Friendly Interface

External objects

PLY, STL, VTK can be loaded by GenCase

CAD files

Pre-processing: GenCase

Page 21: Pre-processing and User Friendly Interface

External objects

PLY, STL, VTK can be loaded by GenCase

Pre-processing: GenCase

3D Studio objects

Page 22: Pre-processing and User Friendly Interface

External objects

PLY, STL, VTK can be loaded by GenCase

3D Studio objects

Pre-processing: GenCase

Page 23: Pre-processing and User Friendly Interface

Outline of Presentation

Pre-processing tool: GenCase

XML input file

DesignSPHysics

Future developments

Page 24: Pre-processing and User Friendly Interface

XML file

DUALSPHYSICS

Run.outPart_xxxx.bi2PartOut.bi2

Case.xml

Case.bi2

mov.dat

forces.csv

GENCASE

Case_Def.xml

object.vtkobject.stlobject.ply

DUALSPHYSICS

Run.outPart_xxxx.bi2PartOut.bi2

Case_All.vtkCase_Bound.vtkCase_Fluid.vtk

Case__Actual.vtkCase__Dp.vtk

Case.xml

Case.bi2

mov.dat

forces.csv

BOUNDARYVTKPARTVTK MEASURETOOL

Points.txt

Fixed.vtkMoving_xxxx.vtkFloating_xxxx.vtk

PartFluid.vtkPartBound.vtkPartMoving.vtkPartFloating.vtk

Pressure.csvVelocity.csvHeight_xxxx.vtkAcceleration.ascii

ISOSURFACE

Surface_xxxx.vtk

PointsPos.csv

GENCASE

Case_Def.xml

object.vtkobject.stlobject.ply

DUALSPHYSICS

Run.outPart_xxxx.bi2PartOut.bi2

Case_All.vtkCase_Bound.vtkCase_Fluid.vtk

Case__Actual.vtkCase__Dp.vtk

Case.xml

Case.bi2

mov.dat

forces.csv

BOUNDARYVTKPARTVTK MEASURETOOL

Points.txt

Fixed.vtkMoving_xxxx.vtkFloating_xxxx.vtk

PartFluid.vtkPartBound.vtkPartMoving.vtkPartFloating.vtk

Pressure.csvVelocity.csvHeight_xxxx.vtkAcceleration.ascii

ISOSURFACE

Surface_xxxx.vtk

PointsPos.csv

Page 25: Pre-processing and User Friendly Interface

STRUCTURE OF THE XML FILE

http://dual.sphysics.org/index.php/downloads/

- DUALSPHYSICS DOCUMENTATION:

o DualSPHysics_v4.0_GUIDE.pdf

oXML_GUIDE_v4.0.pdfo ExternalModelsConversion_GUIDE.pdf

o PostprocessingCalculations.pdf

- DUALSPHYSICS PACKAGE:

o DualSPHysics_v4.0_Linux_x64.zip

o DualSPHysics_v4.0_Windows_x64.zip

Page 26: Pre-processing and User Friendly Interface

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

Page 27: Pre-processing and User Friendly Interface

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

Page 28: Pre-processing and User Friendly Interface

XML file CASEDEF-CONSTANTSDEF

Page 29: Pre-processing and User Friendly Interface

CASEDEF-MKCONFIG

mkorientation: determines the order of particles

when creating one object (useful for

visualization with the variable idp)

mkorientfluid = “xyz”

mkorientfluid = “xyz”

mkorientfluid = “yzX”

mkorientfluid = “ZYx”

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

XML file

Page 30: Pre-processing and User Friendly Interface

XML file

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

CASEDEF-GEOMETRY-DEFINITION

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

minimum and maximum positions of the created particles.pointmin

Page 31: Pre-processing and User Friendly Interface

XML file

A 2-D configuration can be generated by imposing the same values along Y-direction

<pointmin> = <pointmax>

CASEDEF-GEOMETRY-DEFINITION

Page 32: Pre-processing and User Friendly Interface

CASEDEF-GEOMETRY-COMMANDS-MAINLIST

<setdrawmode>:

– “wire”: wire mode

– “face”: draw faces

– “solid”: draw inside

– “full”: combines face and solid

wire face

solid full

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

Page 33: Pre-processing and User Friendly Interface

CASEDEF-GEOMETRY-COMMANDS-MAINLIST

<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

IMPORTING EXTERNAL GEOMETRIES

Page 34: Pre-processing and User Friendly Interface

CASEDEF-GEOMETRY-COMMANDS-MAINLIST

from VTK to points

36

IMPORTING EXTERNAL GEOMETRIES

Page 35: Pre-processing and User Friendly Interface

CASEDEF-GEOMETRY-COMMANDS-MAINLIST

<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

FILLING DOMAINS

Page 36: Pre-processing and User Friendly Interface

CASEDEF-GEOMETRY-COMMANDS-MAINLIST

limits of the

domain to fill

seed point

filling with fluid while void and

before the limits defined by a box

FILLING DOMAINS

Page 37: Pre-processing and User Friendly Interface

CASEDEF-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

DEFINING FLOATINGS

XML file

Page 38: Pre-processing and User Friendly Interface

CASEDEF-MOTION

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

<mvrect>: uniform rectilinear movement

vel indicates the constant velocity vector

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…

XML file

Page 39: Pre-processing and User Friendly Interface

•Motion07: sinusoidal movement (<mvrectsinu />, <mvrotsinu />, <mvcirsinu />)

CASEDEF-MOTION

<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

XML file

Page 40: Pre-processing and User Friendly Interface

•Motion07: sinusoidal movement (<mvrectsinu />, <mvrotsinu />, <mvcirsinu />)

CASEDEF-MOTION

42

XML file

Page 41: Pre-processing and User Friendly Interface

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

CASEDEF-MOTION

<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"

XML file

Page 42: Pre-processing and User Friendly Interface

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

CASEDEF-MOTION

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

name name of the file

axisp1 & axisp2 two points to define the axis of rotation

XML file

Page 43: Pre-processing and User Friendly Interface

•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)

XML file EXECUTION-SPECIAL-WAVEPADDLES-PISTON

Generation of regular waves

Page 44: Pre-processing and User Friendly Interface

Generation of irregular waves

EXECUTION-SPECIAL-WAVEPADDLES-PISTON_SPECTRUM

Page 45: Pre-processing and User Friendly Interface

XML file EXECUTION-PARAMETERS

Parameters for execution in DualSPHysics

Page 46: Pre-processing and User Friendly Interface

XML file

DUALSPHYSICS

Run.outPart_xxxx.bi2PartOut.bi2

Case.xml

Case.bi2

mov.dat

forces.csv

GENCASE

Case_Def.xml

object.vtkobject.stlobject.ply

DUALSPHYSICS

Run.outPart_xxxx.bi2PartOut.bi2

Case_All.vtkCase_Bound.vtkCase_Fluid.vtk

Case__Actual.vtkCase__Dp.vtk

Case.xml

Case.bi2

mov.dat

forces.csv

BOUNDARYVTKPARTVTK MEASURETOOL

Points.txt

Fixed.vtkMoving_xxxx.vtkFloating_xxxx.vtk

PartFluid.vtkPartBound.vtkPartMoving.vtkPartFloating.vtk

Pressure.csvVelocity.csvHeight_xxxx.vtkAcceleration.ascii

ISOSURFACE

Surface_xxxx.vtk

PointsPos.csv

GENCASE

Case_Def.xml

object.vtkobject.stlobject.ply

DUALSPHYSICS

Run.outPart_xxxx.bi2PartOut.bi2

Case_All.vtkCase_Bound.vtkCase_Fluid.vtk

Case__Actual.vtkCase__Dp.vtk

Case.xml

Case.bi2

mov.dat

forces.csv

BOUNDARYVTKPARTVTK MEASURETOOL

Points.txt

Fixed.vtkMoving_xxxx.vtkFloating_xxxx.vtk

PartFluid.vtkPartBound.vtkPartMoving.vtkPartFloating.vtk

Pressure.csvVelocity.csvHeight_xxxx.vtkAcceleration.ascii

ISOSURFACE

Surface_xxxx.vtk

PointsPos.csv

Page 47: Pre-processing and User Friendly Interface

XML file

np=total number of particlesnb=boundary particlesnbf=fixed boundary particlesand final mk of the objects

YOU SHOULD ALWAYS CHECK Case_All.vtk, Case_Bound.vtk, Case_Fluid.vtk

NOTE value of final “mk”mk=mkbound+11mk=mkfluid+1

Summary of the number of createdparticles and computed constants

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

Page 48: Pre-processing and User Friendly Interface

Outline of Presentation

Pre-processing tool: GenCase

XML input file

DesignSPHysics: new GUI !!!

Future developments

Page 49: Pre-processing and User Friendly Interface

Andrés Vieira

DesignSPHysicsA simple user interface for DualSPHysics

Page 50: Pre-processing and User Friendly Interface

DesignSPHysicsA simple user interface for DualSPHysics

Modular: Integrates with FreeCAD, it is simple and easy to use.

Configurable: No need to edit external files or work with messy code.

Not only case design: It can run a simulation clicking on a button.

Coherent GUI: Easy to use, easy to learn.

Page 51: Pre-processing and User Friendly Interface

Let us try DesignSPHysics

Page 52: Pre-processing and User Friendly Interface

STEPS in DesignSPHysics

Install FreeCAD version 0.16 or higher (https://sourceforge.net/projects/free-cad/)

Download DesignSPHysics beta-version-> Installer.exe

Open FreeCAD

Opens a dialog to let you execute a recorded macro: Use DSPH.py at %appdata%/FreeCAD/Macro

New Case: DSPH_Case (CaseWine)

o Case_Limits

Base/Placement/Position: x=-0.5m, y=-0.5m, z=-0.5m

Box: Length=1m, Width=1m, Height=1.5m

o Cube

Base/Placement/Position: x=-0.25m, y=-0.25m, z=0m

Box: Length=0.5m, Width=0.5m, Height=0.5m

o ADD TO DSPH SIMULATION

MKBound=0, Type of object=Bound, Fill mode=Wire

o Cylinder

Base/Placement/Position: x=0.015m, y=0m, z=0.3m

Cylinder: Radius=0.01m, Height=0.4m, Angle=360º

o ADD TO DSPH SIMULATION

MKFluid=1, Type of object=Fluid, Fill mode=Full

o Import: cup.stl (reads assuming units in mm)

o ADD TO DSPH SIMULATION

MKBound=1, Type of object=Bound, Fill mode=Face

o Inter-particle distance=0.001 meters

o Define Constants

o Execution Parameters

Time of simulation=1 seconds

Time out data=0.005 seconds

o Setup Plugin: path of GenCase4, DualSPHyics4, PartVTK4

o Save Case: Executes GenCase4 (creates .XML and initial .BI4)

o Simulate Case: Executes DualSPHysics4 (CPU or GPU)

o Export data to VTK: Executes PartVTK4 (VTK of all particles)

Page 53: Pre-processing and User Friendly Interface

Visualisation in Paraview loading VTK files

Page 54: Pre-processing and User Friendly Interface

Outline of Presentation

Pre-processing tool: GenCase

XML input file

DesignSPHysics: new GUI !!!

Future developments

Page 55: Pre-processing and User Friendly Interface

Future developments

FreePoints

Page 56: Pre-processing and User Friendly Interface

Future developments

FreePoints

Computation of normals (new BCs)

Release of DesignSPHysics

Page 57: Pre-processing and User Friendly Interface

Thank you

Acknowledgements

• DualSPHysics team: all developers and contributors

• Andrés Vieira

Website

Free open-source DualSPHysics code:

http://www.dual.sphysics.org