Loading...
Searching...
No Matches
GridSmokeSolver3.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_GRID_SMOKE_SOLVER3_HPP
12#define CUBBYFLOW_GRID_SMOKE_SOLVER3_HPP
13
15
16namespace CubbyFlow
17{
30{
31 public:
32 class Builder;
33
36
39 const Vector3D& gridOrigin);
40
43
46
49
52
55
58
61
64
67
82
97
112
127
137
147
157
167
170
173
176
177 protected:
178 void OnEndAdvanceTimeStep(double timeIntervalInSeconds) override;
179
180 void ComputeExternalForces(double timeIntervalInSeconds) override;
181
182 private:
183 void ComputeDiffusion(double timeIntervalInSeconds);
184
185 void ComputeBuoyancyForce(double timeIntervalInSeconds);
186
187 size_t m_smokeDensityDataID = 0;
188 size_t m_temperatureDataID = 0;
189 double m_smokeDiffusionCoefficient = 0.0;
190 double m_temperatureDiffusionCoefficient = 0.0;
191 double m_buoyancySmokeDensityFactor = -0.000625;
192 double m_buoyancyTemperatureFactor = 5.0;
193 double m_smokeDecayFactor = 0.001;
194 double m_temperatureDecayFactor = 0.001;
195};
196
199
213} // namespace CubbyFlow
214
215#endif
Abstract base class for grid-based 3-D fluid solver.
Definition GridFluidSolver3.hpp:36
Base class for grid-based fluid solver builder.
Definition GridFluidSolver3.hpp:316
Front-end to create GridSmokeSolver3 objects step by step.
Definition GridSmokeSolver3.hpp:205
GridSmokeSolver3Ptr MakeShared() const
Builds shared pointer of GridSmokeSolver3 instance.
GridSmokeSolver3 Build() const
Builds GridSmokeSolver3.
3-D grid-based smoke solver.
Definition GridSmokeSolver3.hpp:30
GridSmokeSolver3(GridSmokeSolver3 &&) noexcept=delete
Deleted move constructor.
double GetTemperatureDiffusionCoefficient() const
Returns temperature diffusion coefficient.
double GetSmokeDecayFactor() const
Returns smoke decay factor.
void SetTemperatureDecayFactor(double newValue)
Sets the temperature decay factor.
double GetBuoyancyTemperatureFactor() const
Returns the buoyancy factor which will be multiplied to the temperature.
static Builder GetBuilder()
Returns builder fox GridSmokeSolver3.
GridSmokeSolver3(const Vector3UZ &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
Constructs solver with initial grid size.
void OnEndAdvanceTimeStep(double timeIntervalInSeconds) override
Called at the end of a time-step.
void SetBuoyancySmokeDensityFactor(double newValue)
Sets the buoyancy factor which will be multiplied to the smoke density.
ScalarGrid3Ptr GetTemperature() const
Returns temperature field.
void ComputeExternalForces(double timeIntervalInSeconds) override
Computes the external force terms.
double GetBuoyancySmokeDensityFactor() const
Returns the buoyancy factor which will be multiplied to the smoke density.
void SetBuoyancyTemperatureFactor(double newValue)
Sets the buoyancy factor which will be multiplied to the temperature.
ScalarGrid3Ptr GetSmokeDensity() const
Returns smoke density field.
double GetSmokeDiffusionCoefficient() const
Returns smoke diffusion coefficient.
GridSmokeSolver3()
Default constructor.
void SetSmokeDiffusionCoefficient(double newValue)
Sets smoke diffusion coefficient.
void SetTemperatureDiffusionCoefficient(double newValue)
Sets temperature diffusion coefficient.
GridSmokeSolver3(const GridSmokeSolver3 &)=delete
Deleted copy constructor.
double GetTemperatureDecayFactor() const
Returns temperature decay factor.
void SetSmokeDecayFactor(double newValue)
Sets the smoke decay factor.
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:21
std::shared_ptr< ScalarGrid3 > ScalarGrid3Ptr
Shared pointer for the ScalarGrid3 type.
Definition ScalarGrid.hpp:269
std::shared_ptr< GridSmokeSolver3 > GridSmokeSolver3Ptr
Shared pointer type for the GridSmokeSolver3.
Definition GridSmokeSolver3.hpp:198
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738