SPH
Public Member Functions | List of all members
ContinuityEquation Class Reference

Equation for evolution of density. More...

#include <EquationTerm.h>

Inheritance diagram for ContinuityEquation:
IEquationTerm Polymorphic

Public Member Functions

 ContinuityEquation (const RunSettings &settings)
 
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 ()
 

Detailed Description

Equation for evolution of density.

Provides a first-order evolutionary equation for density, computing the derivative of i-th particle using:

\[ \frac{{\rm d} \rho_i}{{\rm d} t} = -\rho_i \nabla \cdot \vec v_i \,, \]

where \(\vec v_i\) is the velocity of the particle.

Optionally, modifications of the equation are available, see enum ContinuityEnum.

Solver must use either this equation or some custom density computation, such as direct summation (see SummationSolver) or SPH formulation without solving the density (see DensityIndependentSolver).

Definition at line 192 of file EquationTerm.h.

Constructor & Destructor Documentation

◆ ContinuityEquation()

ContinuityEquation::ContinuityEquation ( const RunSettings settings)
explicit

Definition at line 262 of file EquationTerm.cpp.

Member Function Documentation

◆ create()

void ContinuityEquation::create ( Storage storage,
IMaterial material 
) const
overridevirtual

Creates all quantities needed by the term using given material.

Called once for every body in the simulation.

Implements IEquationTerm.

Definition at line 343 of file EquationTerm.cpp.

◆ finalize()

void ContinuityEquation::finalize ( IScheduler scheduler,
Storage storage,
const Float  t 
)
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 299 of file EquationTerm.cpp.

◆ initialize()

void ContinuityEquation::initialize ( IScheduler scheduler,
Storage storage,
const Float  t 
)
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 284 of file EquationTerm.cpp.

◆ setDerivatives()

void ContinuityEquation::setDerivatives ( DerivativeHolder derivatives,
const RunSettings settings 
)
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 270 of file EquationTerm.cpp.


The documentation for this class was generated from the following files: