sph

package
v0.0.0-...-ddc071b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VISCOSITY_WATER = 1.3059
	CACHE_L         = 0.8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SPH

type SPH struct {
	// contains filtered or unexported fields
}

SPH Standard SPH Particle System - Implements SPHSystem Interface

func Init

func Init(scl float32, origin vector.Vec, colliders []*mesh.Mesh, n3 int, pci bool) SPH

InitSPH() Creates SPH particle grid using where n3 is the cubic root of the number of particles desired so that N = n3*n3*n3 and the kernel smoothing lengthing is taken to be the the cubic average scale vector which is defaulted to 1.0. So that h = (||s||/(N3)). To ensure that the GPU shader is well formed n3 must be a multiple of the local gpu group size which is 4. So n3 = 4 * X.

func (*SPH) CFL

func (p *SPH) CFL() float32

CFL Time Step Condition - Ensure the GPU Forumlas match this constraint

func (*SPH) CacheIncr

func (p *SPH) CacheIncr() float32

func (*SPH) Delta

func (p *SPH) Delta() float32

func (*SPH) DensityAll

func (p *SPH) DensityAll()

Computes all particle densities

func (*SPH) ExternalAll

func (p *SPH) ExternalAll(force vector.Vec)

External add an external force to all particles

func (*SPH) Field

func (p *SPH) Field() *field.SPHField

func (*SPH) GradientPressureForce

func (p *SPH) GradientPressureForce()

Computes gradient pressure force and adds to the particle

func (*SPH) MaxV

func (p *SPH) MaxV() float32

func (*SPH) N

func (p *SPH) N() int

Get the number of live particles , does not include boundary particles in the field particle list

func (*SPH) NN

func (p *SPH) NN()

Update Nearest Neighbors

func (*SPH) Particles

func (p *SPH) Particles() model.ParticleArray

Get the field particles list, note that boundary particles are appended

func (*SPH) PressureAll

func (p *SPH) PressureAll() int

Iterates over density field and calculates the particle pressures using tait EOS mapping

func (*SPH) SetViscosity

func (p *SPH) SetViscosity(x float32)

func (*SPH) Time

func (p *SPH) Time() float32

func (*SPH) Update

func (p *SPH) Update()

Update updates all particle positions -- non-blocking mutex locked

func (*SPH) Viscosity

func (p *SPH) Viscosity() float32

func (*SPH) ViscousAll

func (p *SPH) ViscousAll()

(N)Applys an artificial viscosity force by calculating the laplacian of the velocity field And maps the force to the particle force fields

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL