Go to the documentation of this file.
7 #ifndef INCLUDE_JET_SPH_SOLVER3_H_
8 #define INCLUDE_JET_SPH_SOLVER3_H_
41 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_SOLVER3_H_
double speedOfSound() const
Returns the speed of sound.
Base class for SPH-based fluid solver builder.
Definition: sph_solver3.h:195
SphSolver3()
Constructs a solver with empty particle set.
std::shared_ptr< SphSystemData3 > SphSystemData3Ptr
Shared pointer for the SphSystemData3 type.
Definition: sph_system_data3.h:195
void onBeginAdvanceTimeStep(double timeStepInSeconds) override
Performs pre-processing step before the simulation.
SphSolver3Ptr makeShared() const
Builds shared pointer of SphSolver3 instance.
DerivedBuilder & withRelativeKernelRadius(double relativeKernelRadius)
Returns builder with relative kernel radius.
Definition: sph_solver3.h:225
double viscosityCoefficient() const
Returns the viscosity coefficient.
static Builder builder()
Returns builder fox SphSolver3.
void computePseudoViscosity(double timeStepInSeconds)
Computes pseudo viscosity.
void setNegativePressureScale(double newNegativePressureScale)
Sets the negative pressure scale.
void setTimeStepLimitScale(double newScale)
Sets the multiplier that scales the max allowed time-step.
1-D read-only array accessor class.
Definition: array_accessor1.h:184
void accumulatePressureForce(const ConstArrayAccessor1< Vector3D > &positions, const ConstArrayAccessor1< double > &densities, const ConstArrayAccessor1< double > &pressures, ArrayAccessor1< Vector3D > pressureForces)
Accumulates the pressure force to the given pressureForces array.
void accumulateForces(double timeStepInSeconds) override
Accumulates the force to the forces array in the particle system.
double timeStepLimitScale() const
Multiplier that scales the max allowed time-step.
virtual void accumulatePressureForce(double timeStepInSeconds)
SphSolver3 build() const
Builds SphSolver3.
void setPseudoViscosityCoefficient(double newPseudoViscosityCoefficient)
Sets the pseudo viscosity coefficient.
void setViscosityCoefficient(double newViscosityCoefficient)
Sets the viscosity coefficient.
void onEndAdvanceTimeStep(double timeStepInSeconds) override
Performs post-processing step before the simulation.
double _targetDensity
Definition: sph_solver3.h:207
Definition: advection_solver2.h:18
SphSystemData3Ptr sphSystemData() const
Returns the SPH system data.
3-D SPH solver.
Definition: sph_solver3.h:29
Basic 3-D particle system solver.
Definition: particle_system_solver3.h:31
double negativePressureScale() const
Returns the negative pressure scale.
std::shared_ptr< SphSolver3 > SphSolver3Ptr
Shared pointer type for the SphSolver3.
Definition: sph_solver3.h:188
double _relativeKernelRadius
Definition: sph_solver3.h:209
DerivedBuilder & withTargetDensity(double targetDensity)
Returns builder with target density.
Definition: sph_solver3.h:213
double _targetSpacing
Definition: sph_solver3.h:208
void setSpeedOfSound(double newSpeedOfSound)
Sets the speed of sound.
DerivedBuilder & withTargetSpacing(double targetSpacing)
Returns builder with target spacing.
Definition: sph_solver3.h:219
double eosExponent() const
Returns the exponent part of the equation-of-state.
Front-end to create SphSolver3 objects step by step.
Definition: sph_solver3.h:235
void accumulateViscosityForce()
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
void setEosExponent(double newEosExponent)
Sets the exponent part of the equation-of-state.
SphSolver3(double targetDensity, double targetSpacing, double relativeKernelRadius)
1-D array accessor class.
Definition: array_accessor1.h:27
double pseudoViscosityCoefficient() const
Returns the pseudo viscosity coefficient.
void computePressure()
Computes the pressure.