Jet  v1.3.3
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
jet::GridSmokeSolver3 Class Reference

3-D grid-based smoke solver. More...

#include <jet/grid_smoke_solver3.h>

Inheritance diagram for jet::GridSmokeSolver3:
jet::GridFluidSolver3 jet::PhysicsAnimation jet::Animation

Classes

class  Builder
 Front-end to create GridSmokeSolver3 objects step by step. More...
 

Public Member Functions

 GridSmokeSolver3 ()
 Default constructor. More...
 
 GridSmokeSolver3 (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
 Constructs solver with initial grid size. More...
 
virtual ~GridSmokeSolver3 ()
 Destructor. More...
 
double smokeDiffusionCoefficient () const
 Returns smoke diffusion coefficient. More...
 
void setSmokeDiffusionCoefficient (double newValue)
 Sets smoke diffusion coefficient. More...
 
double temperatureDiffusionCoefficient () const
 Returns temperature diffusion coefficient. More...
 
void setTemperatureDiffusionCoefficient (double newValue)
 Sets temperature diffusion coefficient. More...
 
double buoyancySmokeDensityFactor () const
 Returns the buoyancy factor which will be multiplied to the smoke density. More...
 
void setBuoyancySmokeDensityFactor (double newValue)
 Sets the buoyancy factor which will be multiplied to the smoke density. More...
 
double buoyancyTemperatureFactor () const
 Returns the buoyancy factor which will be multiplied to the temperature. More...
 
void setBuoyancyTemperatureFactor (double newValue)
 Sets the buoyancy factor which will be multiplied to the temperature. More...
 
double smokeDecayFactor () const
 Returns smoke decay factor. More...
 
void setSmokeDecayFactor (double newValue)
 Sets the smoke decay factor. More...
 
double smokeTemperatureDecayFactor () const
 Returns temperature decay factor. More...
 
void setTemperatureDecayFactor (double newValue)
 Sets the temperature decay factor. More...
 
ScalarGrid3Ptr smokeDensity () const
 Returns smoke density field. More...
 
ScalarGrid3Ptr temperature () const
 Returns temperature field. More...
 
- Public Member Functions inherited from jet::GridFluidSolver3
 GridFluidSolver3 ()
 Default constructor. More...
 
 GridFluidSolver3 (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
 Constructs solver with initial grid size. More...
 
virtual ~GridFluidSolver3 ()
 Default destructor. More...
 
const Vector3Dgravity () const
 Returns the gravity vector of the system. More...
 
void setGravity (const Vector3D &newGravity)
 Sets the gravity of the system. More...
 
double viscosityCoefficient () const
 Returns the viscosity coefficient. More...
 
void setViscosityCoefficient (double newValue)
 Sets the viscosity coefficient. More...
 
double cfl (double timeIntervalInSeconds) const
 Returns the CFL number from the current velocity field for given time interval. More...
 
double maxCfl () const
 Returns the max allowed CFL number. More...
 
void setMaxCfl (double newCfl)
 Sets the max allowed CFL number. More...
 
bool useCompressedLinearSystem () const
 Returns true if the solver is using compressed linear system. More...
 
void setUseCompressedLinearSystem (bool onoff)
 Sets whether the solver should use compressed linear system. More...
 
const AdvectionSolver3PtradvectionSolver () const
 Returns the advection solver instance. More...
 
void setAdvectionSolver (const AdvectionSolver3Ptr &newSolver)
 Sets the advection solver. More...
 
const GridDiffusionSolver3PtrdiffusionSolver () const
 Returns the diffusion solver instance. More...
 
void setDiffusionSolver (const GridDiffusionSolver3Ptr &newSolver)
 Sets the diffusion solver. More...
 
const GridPressureSolver3PtrpressureSolver () const
 Returns the pressure solver instance. More...
 
void setPressureSolver (const GridPressureSolver3Ptr &newSolver)
 Sets the pressure solver. More...
 
int closedDomainBoundaryFlag () const
 Returns the closed domain boundary flag. More...
 
void setClosedDomainBoundaryFlag (int flag)
 Sets the closed domain boundary flag. More...
 
const GridSystemData3PtrgridSystemData () const
 Returns the grid system data. More...
 
void resizeGrid (const Size3 &newSize, const Vector3D &newGridSpacing, const Vector3D &newGridOrigin)
 Resizes grid system data. More...
 
Size3 resolution () const
 Returns the resolution of the grid system data. More...
 
Vector3D gridSpacing () const
 Returns the grid spacing of the grid system data. More...
 
Vector3D gridOrigin () const
 Returns the origin of the grid system data. More...
 
const FaceCenteredGrid3Ptrvelocity () const
 Returns the velocity field. More...
 
const Collider3Ptrcollider () const
 Returns the collider. More...
 
void setCollider (const Collider3Ptr &newCollider)
 Sets the collider. More...
 
const GridEmitter3Ptremitter () const
 Returns the emitter. More...
 
void setEmitter (const GridEmitter3Ptr &newEmitter)
 Sets the emitter. More...
 
- Public Member Functions inherited from jet::PhysicsAnimation
 PhysicsAnimation ()
 Default constructor. More...
 
virtual ~PhysicsAnimation ()
 Destructor. More...
 
bool isUsingFixedSubTimeSteps () const
 Returns true if fixed sub-timestepping is used. More...
 
void setIsUsingFixedSubTimeSteps (bool isUsing)
 Sets true if fixed sub-timestepping is used. More...
 
unsigned int numberOfFixedSubTimeSteps () const
 Returns the number of fixed sub-timesteps. More...
 
void setNumberOfFixedSubTimeSteps (unsigned int numberOfSteps)
 Sets the number of fixed sub-timesteps. More...
 
void advanceSingleFrame ()
 Advances a single frame. More...
 
Frame currentFrame () const
 Returns current frame. More...
 
void setCurrentFrame (const Frame &frame)
 Sets current frame cursor (but do not invoke update()). More...
 
double currentTimeInSeconds () const
 Returns current time in seconds. More...
 
- Public Member Functions inherited from jet::Animation
 Animation ()
 
virtual ~Animation ()
 
void update (const Frame &frame)
 Updates animation state for given frame. More...
 

Static Public Member Functions

static Builder builder ()
 Returns builder fox GridSmokeSolver3. More...
 
- Static Public Member Functions inherited from jet::GridFluidSolver3
static Builder builder ()
 Returns builder fox GridFluidSolver3. More...
 

Protected Member Functions

void onEndAdvanceTimeStep (double timeIntervalInSeconds) override
 Called at the end of a time-step. More...
 
void computeExternalForces (double timeIntervalInSeconds) override
 Computes the external force terms. More...
 
- Protected Member Functions inherited from jet::GridFluidSolver3
void onInitialize () override
 Called when it needs to setup initial condition. More...
 
void onAdvanceTimeStep (double timeIntervalInSeconds) override
 Called when advancing a single time-step. More...
 
unsigned int numberOfSubTimeSteps (double timeIntervalInSeconds) const override
 Returns the required sub-time-steps for given time interval. More...
 
virtual void onBeginAdvanceTimeStep (double timeIntervalInSeconds)
 Called at the beginning of a time-step. More...
 
virtual void computeViscosity (double timeIntervalInSeconds)
 Computes the viscosity term using the diffusion solver. More...
 
virtual void computePressure (double timeIntervalInSeconds)
 Computes the pressure term using the pressure solver. More...
 
virtual void computeAdvection (double timeIntervalInSeconds)
 Computes the advection term using the advection solver. More...
 
virtual ScalarField3Ptr fluidSdf () const
 
void computeGravity (double timeIntervalInSeconds)
 Computes the gravity term. More...
 
void applyBoundaryCondition ()
 Applies the boundary condition to the velocity field. More...
 
void extrapolateIntoCollider (ScalarGrid3 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
void extrapolateIntoCollider (CollocatedVectorGrid3 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
void extrapolateIntoCollider (FaceCenteredGrid3 *grid)
 Extrapolates given field into the collider-occupied region. More...
 
ScalarField3Ptr colliderSdf () const
 Returns the signed-distance field representation of the collider. More...
 
VectorField3Ptr colliderVelocityField () const
 Returns the velocity field of the collider. More...
 

Detailed Description

3-D grid-based smoke solver.

This class extends GridFluidSolver3 to implement smoke simulation solver. It adds smoke density and temperature fields to define the smoke and uses buoyancy force to simulate hot rising smoke.

See also
Fedkiw, Ronald, Jos Stam, and Henrik Wann Jensen. "Visual simulation of smoke." Proceedings of the 28th annual conference on Computer graphics and interactive techniques. ACM, 2001.

Constructor & Destructor Documentation

◆ GridSmokeSolver3() [1/2]

jet::GridSmokeSolver3::GridSmokeSolver3 ( )

Default constructor.

◆ GridSmokeSolver3() [2/2]

jet::GridSmokeSolver3::GridSmokeSolver3 ( const Size3 resolution,
const Vector3D gridSpacing,
const Vector3D gridOrigin 
)

Constructs solver with initial grid size.

◆ ~GridSmokeSolver3()

virtual jet::GridSmokeSolver3::~GridSmokeSolver3 ( )
virtual

Destructor.

Member Function Documentation

◆ builder()

static Builder jet::GridSmokeSolver3::builder ( )
static

Returns builder fox GridSmokeSolver3.

◆ buoyancySmokeDensityFactor()

double jet::GridSmokeSolver3::buoyancySmokeDensityFactor ( ) const

Returns the buoyancy factor which will be multiplied to the smoke density.

This class computes buoyancy by looking up the value of smoke density and temperature, compare them to the average values, and apply multiplier factor to the diff between the value and the average. That multiplier is defined for each smoke density and temperature separately. For example, negative smoke density buoyancy factor means a heavier smoke should sink.

Returns
The buoyance factor for the smoke density.

◆ buoyancyTemperatureFactor()

double jet::GridSmokeSolver3::buoyancyTemperatureFactor ( ) const

Returns the buoyancy factor which will be multiplied to the temperature.

This class computes buoyancy by looking up the value of smoke density and temperature, compare them to the average values, and apply multiplier factor to the diff between the value and the average. That multiplier is defined for each smoke density and temperature separately. For example, negative smoke density buoyancy factor means a heavier smoke should sink.

Returns
The buoyance factor for the temperature.

◆ computeExternalForces()

void jet::GridSmokeSolver3::computeExternalForces ( double  timeIntervalInSeconds)
overrideprotectedvirtual

Computes the external force terms.

This function computes the external force applied for given time interval. By default, it only computes the gravity.

See also
GridFluidSolver3::computeGravity

Reimplemented from jet::GridFluidSolver3.

◆ onEndAdvanceTimeStep()

void jet::GridSmokeSolver3::onEndAdvanceTimeStep ( double  timeIntervalInSeconds)
overrideprotectedvirtual

Called at the end of a time-step.

Reimplemented from jet::GridFluidSolver3.

◆ setBuoyancySmokeDensityFactor()

void jet::GridSmokeSolver3::setBuoyancySmokeDensityFactor ( double  newValue)

Sets the buoyancy factor which will be multiplied to the smoke density.

This class computes buoyancy by looking up the value of smoke density and temperature, compare them to the average values, and apply multiplier factor to the diff between the value and the average. That multiplier is defined for each smoke density and temperature separately. For example, negative smoke density buoyancy factor means a heavier smoke should sink.

Parameters
newValueThe new buoyancy factor for smoke density.

◆ setBuoyancyTemperatureFactor()

void jet::GridSmokeSolver3::setBuoyancyTemperatureFactor ( double  newValue)

Sets the buoyancy factor which will be multiplied to the temperature.

This class computes buoyancy by looking up the value of smoke density and temperature, compare them to the average values, and apply multiplier factor to the diff between the value and the average. That multiplier is defined for each smoke density and temperature separately. For example, negative smoke density buoyancy factor means a heavier smoke should sink.

Parameters
newValueThe new buoyancy factor for temperature.

◆ setSmokeDecayFactor()

void jet::GridSmokeSolver3::setSmokeDecayFactor ( double  newValue)

Sets the smoke decay factor.

In addition to the diffusion, the smoke also can fade-out over time by setting the decay factor between 0 and 1.

Parameters
[in]newValueThe new decay factor.

◆ setSmokeDiffusionCoefficient()

void jet::GridSmokeSolver3::setSmokeDiffusionCoefficient ( double  newValue)

Sets smoke diffusion coefficient.

◆ setTemperatureDecayFactor()

void jet::GridSmokeSolver3::setTemperatureDecayFactor ( double  newValue)

Sets the temperature decay factor.

In addition to the diffusion, the temperature also can fade-out over time by setting the decay factor between 0 and 1.

Parameters
[in]newValueThe new decay factor.

◆ setTemperatureDiffusionCoefficient()

void jet::GridSmokeSolver3::setTemperatureDiffusionCoefficient ( double  newValue)

Sets temperature diffusion coefficient.

◆ smokeDecayFactor()

double jet::GridSmokeSolver3::smokeDecayFactor ( ) const

Returns smoke decay factor.

In addition to the diffusion, the smoke also can fade-out over time by setting the decay factor between 0 and 1.

Returns
The decay factor for smoke density.

◆ smokeDensity()

ScalarGrid3Ptr jet::GridSmokeSolver3::smokeDensity ( ) const

Returns smoke density field.

◆ smokeDiffusionCoefficient()

double jet::GridSmokeSolver3::smokeDiffusionCoefficient ( ) const

Returns smoke diffusion coefficient.

◆ smokeTemperatureDecayFactor()

double jet::GridSmokeSolver3::smokeTemperatureDecayFactor ( ) const

Returns temperature decay factor.

In addition to the diffusion, the smoke also can fade-out over time by setting the decay factor between 0 and 1.

Returns
The decay factor for smoke temperature.

◆ temperature()

ScalarGrid3Ptr jet::GridSmokeSolver3::temperature ( ) const

Returns temperature field.

◆ temperatureDiffusionCoefficient()

double jet::GridSmokeSolver3::temperatureDiffusionCoefficient ( ) const

Returns temperature diffusion coefficient.


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