File size: 9,673 Bytes
a692475 987c563 a692475 987c563 9d1cfab 987c563 9d1cfab 987c563 9d1cfab 987c563 9d1cfab 987c563 9d1cfab 987c563 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
---
license: mit
viewer: false
---
# Description
This dataset contains a set of example simulations using [diffSPH](https://github.com/tum-pbs/diffSPH). A dataloader and further information is available as part of _diffSPH_.
# Simulation Setup
The general simulation setup:
- Domain Size: $1[m]\times 1[m]$ ($[-0.5, 0.5]^2$)
- Particle Count: $128 \times 128 = 16384$
- Particle size: $1/ (128\times 128) = 0.000061035[m^2]$
- Neighborhood Size: $45.228$ neighbors per particle
- Rest Density: $1 [kg/m^2]$
- Timestepping: Fixed $\Delta t = 1 [ms]$
- Integration Scheme: Symplectic Euler for WCSPH, RK2 for compressible SPH
- SPH Formulation: $\delta^+$-SPH for WCSPH, CRKSPH for compressible SPH
- Shifting Scheme: $\delta^+$-SPH for WCSPH only
- Boundary Handling Scheme: MDBC
- Viscosity: $\delta^+$-SPH, $\operatorname{Re}=2000$
# Data Layout:
Each simulation is stored as a single hdf5 file with meta information available about the simulation configuration and parameters. Each timestep is a seperate group under the simulationData group. For more information on how to process the data, see _diffSPH_. To load the data using diffSPH you can simply:
```py
import torch
import matplotlib.pyplot as plt
import warnings
from tqdm import TqdmExperimentalWarning
warnings.filterwarnings("ignore", category=TqdmExperimentalWarning)
from tqdm.autonotebook import tqdm
from diffSPH.plotting import visualizeParticles, updatePlot
from diffSPH.operations import sph_op
from diffSPH.kernels import getSPHKernelv2
from diffSPH.dataLoader import *
from BasisConvolution.convLayerv3 import BasisConvLayer
configuration = DataConfiguration(
frameDistance=1,
frameSpacing=1,
maxRollout=1,
historyLength=1,
skipInitialFrames=0,
cutoff=0
)
folder = './data/compressible/circleCase'
processed = processFolder(folder, configuration)
for file in processed:
print(f'File: {file["fileName"]}, FrameCount: {len(file["frames"])}, Samples: {len(file["samples"])}, Style: {file["style"]}, Number of samples: {len(processed[0]["samples"])}, first sample: {processed[0]["samples"][0]}, last sample: {processed[0]["samples"][-1]}')
dataset, datasetLoader = getDataLoader(processed, 4, shuffle = True)
datasetIter = iter(datasetLoader)
nextData = next(datasetIter)
priorStates, currentState, trajectoryStates, domains, rotMats, configs, neighborhoods = loadAugmentedBatch(
dataset, nextData, configuration, device = 'cuda', dtype = torch.float32,
augmentAngle = False,
)
fig, axis = plt.subplots(1, len(nextData), figsize=(len(nextData) * 4, 5), squeeze = False)
plots = []
axes = axis.flatten()
for b in range(len(domains)):
plot = visualizeParticles(fig, axes[b],
particles = currentState,
domain = domains[b],
quantity = currentState.densities,
which = 'both',
mapping = 'L2',
cmap = 'viridis',
visualizeBoth=True,
kernel = kernelNameToKernel(configs[b]['kernel']),
plotDomain = True,
gridVisualization=False, markerSize=2,
batch = b, streamLines = False)
axes[b].set_title(f'Batch {b} {nextData[b]} - t={currentState.time[b]:.2f}s,')
plots.append(plot)
fig.tight_layout()
```
_diffSPH_ contains more examples on how to then use this data for training with both CConv networks and GNNs.
# Dataset Overview
## Compressible SPH
All simulations have 12 initial conditions available to them. For region cases the density and pressure are randomized per region, for the other cases there is a uniform octave noise across the domain to sample the density and pressure field, and the velocity field as divergence free
## Circular Regions
Initial | Final
---|---
|
|
## Dual Regions
Initial | Final
---|---
|
|
## Quad Regions
Initial | Final
---|---
|
|
## Density Pressure Noise
Initial | Final
---|---
|
|
## Random Velocity Field
Initial | Final
---|---
|
|
## Weakly Compressible SPH
Each simulaiton has 16 initial conditions available, except for the Taylor Green Vortex like initial conditions which are initialized for 2 and 4 vortices only.
### Periodic Domains
BC | Initial | Final
---|---|---
NoSlip |  | 
FreeSlip |  | 
### With an Obstacle
BC | Initial | Final
---|---|---
NoSlip |  | 
FreeSlip |  | 
### Bounded Domain
BC | Initial | Final
---|---|---
NoSlip |  | 
FreeSlip |  | 
### Both
BC | Initial | Final
---|---|---
NoSlip |  | 
FreeSlip |  | 
### Taylor Green Vortex
x | Obstacle ? | Domain ?
---|---|---
-| | 
-||
|