Viscosity

Viscosity is a NearBehavior that adds a a viscous drag effect on a particle. Viscosity applies an impulse opposing movement determined by the relative speed between particles and a set of drag coefficients. Tis is intended to be used in conjunction with the Pressure behavior and both are position-based paradigms of SPH simulations.

Note: this behavior can become unstable at high coefficient values. It is important to keep the relative velocity between particles low and avoid rapid impulses.

Constructor

new Viscosity(radius, linearCoeff, QuadraticCoeff, maxU)

Instantiates new Viscosity object

Parameters:
NameTypeDescription
radiusNumber
linearCoeffNumber

the coefficient of linear drag, dominant at lower speeds (recommend [0, 1])

QuadraticCoeffNumber

the coefficient of quadratic drag, dominant at higher speeds (recommend [0, 1])

maxUNumber

maximum impulse correction value, constraining it can increase stability

Extends

Methods

applyBehavior(particle, particles, timeStep)

Apply behavior on particle and/or particles

Parameters:
NameTypeDescription
particleParticle
particlesArray.<Particle>
timeStepNumber

applyCorrection(particle, particles)

This class does not require final position corrections

Parameters:
NameTypeDescription
particleParticle
particlesArray.<Particle>

range() → {null}

Returns the effective range / defines the size of the nearby range

Returns:
Type: 
null