novaphy.FluidBlockDef¶
Defines a sampled fluid block. Used together with
generate_fluid_block() and
ModelBuilder.add_particles.
Attributes¶
| Attribute | Description |
|---|---|
lower |
Block lower corner [x0, y0, z0] [m]. |
upper |
Block upper corner [x1, y1, z1] [m]. |
particle_spacing |
Initial particle spacing [m]. |
rest_density |
Target rest density [kg / m^3]. |
initial_velocity |
Initial velocity for sampled particles [m/s]. |
Example¶
import numpy as np
import novaphy
block = novaphy.FluidBlockDef()
block.lower = np.array([0.0, 0.0, 0.0])
block.upper = np.array([1.0, 1.0, 1.0])
block.particle_spacing = 0.05
positions = novaphy.generate_fluid_block(block)