Go to the documentation of this file.
7 #ifndef INCLUDE_JET_SPH_SOLVER2_H_
8 #define INCLUDE_JET_SPH_SOLVER2_H_
43 double relativeKernelRadius);
126 double timeIntervalInSeconds)
const override;
164 double _eosExponent = 7.0;
168 double _negativePressureScale = 0.0;
171 double _viscosityCoefficient = 0.01;
176 double _pseudoViscosityCoefficient = 10.0;
181 double _speedOfSound = 100.0;
184 double _timeStepLimitScale = 1.0;
194 template <
typename DerivedBuilder>
212 template <
typename T>
214 _targetDensity = targetDensity;
215 return static_cast<T&
>(*this);
218 template <
typename T>
220 _targetSpacing = targetSpacing;
221 return static_cast<T&
>(*this);
224 template <
typename T>
226 double relativeKernelRadius) {
227 _relativeKernelRadius = relativeKernelRadius;
228 return static_cast<T&
>(*this);
246 #endif // INCLUDE_JET_SPH_SOLVER2_H_
void setTimeStepLimitScale(double newScale)
Sets the multiplier that scales the max allowed time-step.
double negativePressureScale() const
Returns the negative pressure scale.
double viscosityCoefficient() const
Returns the viscosity coefficient.
void accumulatePressureForce(const ConstArrayAccessor1< Vector2D > &positions, const ConstArrayAccessor1< double > &densities, const ConstArrayAccessor1< double > &pressures, ArrayAccessor1< Vector2D > pressureForces)
Accumulates the pressure force to the given pressureForces array.
void onEndAdvanceTimeStep(double timeStepInSeconds) override
Performs post-processing step before the simulation.
void setNegativePressureScale(double newNegativePressureScale)
Sets the negative pressure scale.
SphSolver2()
Constructs a solver with empty particle set.
1-D read-only array accessor class.
Definition: array_accessor1.h:184
double timeStepLimitScale() const
Multiplier that scales the max allowed time-step.
static Builder builder()
Returns builder fox SphSolver2.
double _relativeKernelRadius
Definition: sph_solver2.h:209
DerivedBuilder & withTargetSpacing(double targetSpacing)
Returns builder with target spacing.
Definition: sph_solver2.h:219
double speedOfSound() const
Returns the speed of sound.
double _targetSpacing
Definition: sph_solver2.h:208
SphSolver2(double targetDensity, double targetSpacing, double relativeKernelRadius)
void accumulateForces(double timeStepInSeconds) override
Accumulates the force to the forces array in the particle system.
Base class for SPH-based fluid solver builder.
Definition: sph_solver2.h:195
SphSolver2 build() const
Builds SphSolver2.
void computePressure()
Computes the pressure.
double pseudoViscosityCoefficient() const
Returns the pseudo viscosity coefficient.
Definition: advection_solver2.h:18
void onBeginAdvanceTimeStep(double timeStepInSeconds) override
Performs pre-processing step before the simulation.
void computePseudoViscosity(double timeStepInSeconds)
Computes pseudo viscosity.
void accumulateViscosityForce()
DerivedBuilder & withRelativeKernelRadius(double relativeKernelRadius)
Returns builder with relative kernel radius.
Definition: sph_solver2.h:225
std::shared_ptr< SphSystemData2 > SphSystemData2Ptr
Shared pointer for the SphSystemData2 type.
Definition: sph_system_data2.h:224
std::shared_ptr< SphSolver2 > SphSolver2Ptr
Shared pointer type for the SphSolver2.
Definition: sph_solver2.h:188
double _targetDensity
Definition: sph_solver2.h:207
DerivedBuilder & withTargetDensity(double targetDensity)
Returns builder with target density.
Definition: sph_solver2.h:213
void setEosExponent(double newEosExponent)
Sets the exponent part of the equation-of-state.
void setPseudoViscosityCoefficient(double newPseudoViscosityCoefficient)
Sets the pseudo viscosity coefficient.
SphSystemData2Ptr sphSystemData() const
Returns the SPH system data.
Front-end to create SphSolver2 objects step by step.
Definition: sph_solver2.h:235
SphSolver2Ptr makeShared() const
Builds shared pointer of SphSolver2 instance.
void setSpeedOfSound(double newSpeedOfSound)
Sets the speed of sound.
unsigned int numberOfSubTimeSteps(double timeIntervalInSeconds) const override
Returns the number of sub-time-steps.
virtual void accumulateNonPressureForces(double timeStepInSeconds)
constexpr double kWaterDensity
Water density.
Definition: constants.h:304
Basic 2-D particle system solver.
Definition: particle_system_solver2.h:31
double eosExponent() const
Returns the exponent part of the equation-of-state.
void setViscosityCoefficient(double newViscosityCoefficient)
Sets the viscosity coefficient.
1-D array accessor class.
Definition: array_accessor1.h:27
virtual void accumulatePressureForce(double timeStepInSeconds)
2-D SPH solver.
Definition: sph_solver2.h:29