SPH
|
Evolutionary equation for the (scalar) smoothing length. More...
#include <EquationTerm.h>
Public Member Functions | |
AdaptiveSmoothingLength (const RunSettings &settings, const Size dimensions=DIMENSIONS) | |
virtual void | setDerivatives (DerivativeHolder &derivatives, const RunSettings &settings) override |
Sets derivatives required by this term. More... | |
virtual void | initialize (IScheduler &scheduler, Storage &storage, const Float t) override |
Initialize all the derivatives and/or quantity values before derivatives are computed. More... | |
virtual void | finalize (IScheduler &scheduler, Storage &storage, const Float t) override |
Computes all the derivatives and/or quantity values based on accumulated derivatives. More... | |
virtual void | create (Storage &storage, IMaterial &material) const override |
Creates all quantities needed by the term using given material. More... | |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Protected Attributes | |
Size | dimensions |
Number of spatial dimensions of the simulation. This should match the dimensions of the SPH kernel. More... | |
Float | minimal |
Minimal allowed value of the smoothing length. More... | |
struct { | |
Float strength | |
Interval range | |
} | enforcing |
Evolutionary equation for the (scalar) smoothing length.
The smoothing length is evolved using first-order equation, 'mirroring' changes in density in order to keep the particle concentration approximately constant. The derivative of smoothing length \(h\) of i-th particle computed using:
\[ \frac{{\rm d} h_i}{{\rm d} t} = \frac{h_i}{D} \nabla \cdot \vec v_i \,, \]
where \(D\) is the number of spatial dimensions (3 unless specified otherwise) and \(\vec v_i\) is the velocity of the particle.
It is possible to add additional term into the equation that increases/decreases the smoothing length when number of neighbours is too low/high. This is done by setting flag SmoothingLengthEnum::SOUND_SPEED_ENFORCING to settings entry RunSettingsId::ADAPTIVE_SMOOTHING_LENGTH. The allowed range of neighbours is then controlled by RunSettingsId::SPH_NEIGHBOUR_RANGE. Note that the number of neighbours is not guaranteed to be in the given range, the actual number of neighbours cannot be precisely controlled.
Definition at line 65 of file EquationTerm.h.
|
explicit |
Definition at line 369 of file EquationTerm.cpp.
|
overridevirtual |
Creates all quantities needed by the term using given material.
Called once for every body in the simulation.
Implements IEquationTerm.
Definition at line 419 of file EquationTerm.cpp.
|
overridevirtual |
Computes all the derivatives and/or quantity values based on accumulated derivatives.
Called every time step after derivatives are evaluated and saved to storage.
Implements IEquationTerm.
Definition at line 396 of file EquationTerm.cpp.
|
overridevirtual |
Initialize all the derivatives and/or quantity values before derivatives are computed.
Called at the beginning of every time step. Note that derivatives need not be zeroed out manually, this is already done by timestepping (for derivatives of quantities) and solver (for accumulated values).
Implements IEquationTerm.
Definition at line 386 of file EquationTerm.cpp.
|
overridevirtual |
Sets derivatives required by this term.
The derivatives are then automatically evaluated by the solver, the equation term can access the result in finalize function. This function is called once for each thread at the beginning of the run.
Implements IEquationTerm.
Definition at line 382 of file EquationTerm.cpp.
|
protected |
Number of spatial dimensions of the simulation. This should match the dimensions of the SPH kernel.
Definition at line 68 of file EquationTerm.h.
struct { ... } AdaptiveSmoothingLength::enforcing |
|
protected |
Minimal allowed value of the smoothing length.
Definition at line 71 of file EquationTerm.h.
Interval AdaptiveSmoothingLength::range |
Definition at line 75 of file EquationTerm.h.
Float AdaptiveSmoothingLength::strength |
Definition at line 74 of file EquationTerm.h.