Jet  v1.3.3
grid_smoke_solver3.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_GRID_SMOKE_SOLVER3_H_
8 #define INCLUDE_JET_GRID_SMOKE_SOLVER3_H_
9 
10 #include <jet/grid_fluid_solver3.h>
11 
12 namespace jet {
13 
26  public:
27  class Builder;
28 
31 
34  const Size3& resolution,
35  const Vector3D& gridSpacing,
36  const Vector3D& gridOrigin);
37 
39  virtual ~GridSmokeSolver3();
40 
42  double smokeDiffusionCoefficient() const;
43 
45  void setSmokeDiffusionCoefficient(double newValue);
46 
49 
51  void setTemperatureDiffusionCoefficient(double newValue);
52 
67 
81  void setBuoyancySmokeDensityFactor(double newValue);
82 
96  double buoyancyTemperatureFactor() const;
97 
111  void setBuoyancyTemperatureFactor(double newValue);
112 
121  double smokeDecayFactor() const;
122 
131  void setSmokeDecayFactor(double newValue);
132 
142 
151  void setTemperatureDecayFactor(double newValue);
152 
155 
158 
160  static Builder builder();
161 
162  protected:
163  void onEndAdvanceTimeStep(double timeIntervalInSeconds) override;
164 
165  void computeExternalForces(double timeIntervalInSeconds) override;
166 
167  private:
168  size_t _smokeDensityDataId;
169  size_t _temperatureDataId;
170  double _smokeDiffusionCoefficient = 0.0;
171  double _temperatureDiffusionCoefficient = 0.0;
172  double _buoyancySmokeDensityFactor = -0.000625;
173  double _buoyancyTemperatureFactor = 5.0;
174  double _smokeDecayFactor = 0.001;
175  double _temperatureDecayFactor = 0.001;
176 
177  void computeDiffusion(double timeIntervalInSeconds);
178 
179  void computeBuoyancyForce(double timeIntervalInSeconds);
180 };
181 
183 typedef std::shared_ptr<GridSmokeSolver3> GridSmokeSolver3Ptr;
184 
185 
190  : public GridFluidSolverBuilderBase3<GridSmokeSolver3::Builder> {
191  public:
194 
197 };
198 
199 } // namespace jet
200 
201 #endif // INCLUDE_JET_GRID_SMOKE_SOLVER3_H_
grid_fluid_solver3.h
jet::GridSmokeSolver3::builder
static Builder builder()
Returns builder fox GridSmokeSolver3.
jet::GridSmokeSolver3::GridSmokeSolver3
GridSmokeSolver3(const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin)
Constructs solver with initial grid size.
jet::GridSmokeSolver3::buoyancyTemperatureFactor
double buoyancyTemperatureFactor() const
Returns the buoyancy factor which will be multiplied to the temperature.
jet::GridFluidSolver3::resolution
Size3 resolution() const
Returns the resolution of the grid system data.
jet::GridSmokeSolver3::computeExternalForces
void computeExternalForces(double timeIntervalInSeconds) override
Computes the external force terms.
jet::GridSmokeSolver3::temperature
ScalarGrid3Ptr temperature() const
Returns temperature field.
jet::GridSmokeSolver3::smokeDensity
ScalarGrid3Ptr smokeDensity() const
Returns smoke density field.
jet::GridSmokeSolver3::smokeDecayFactor
double smokeDecayFactor() const
Returns smoke decay factor.
jet::GridSmokeSolver3
3-D grid-based smoke solver.
Definition: grid_smoke_solver3.h:25
jet::GridSmokeSolver3::smokeDiffusionCoefficient
double smokeDiffusionCoefficient() const
Returns smoke diffusion coefficient.
jet::GridSmokeSolver3::onEndAdvanceTimeStep
void onEndAdvanceTimeStep(double timeIntervalInSeconds) override
Called at the end of a time-step.
jet::ScalarGrid3Ptr
std::shared_ptr< ScalarGrid3 > ScalarGrid3Ptr
Shared pointer for the ScalarGrid3 type.
Definition: scalar_grid3.h:193
jet::GridSmokeSolver3::setTemperatureDiffusionCoefficient
void setTemperatureDiffusionCoefficient(double newValue)
Sets temperature diffusion coefficient.
jet::GridSmokeSolver3::temperatureDiffusionCoefficient
double temperatureDiffusionCoefficient() const
Returns temperature diffusion coefficient.
jet::GridSmokeSolver3::~GridSmokeSolver3
virtual ~GridSmokeSolver3()
Destructor.
jet
Definition: advection_solver2.h:18
jet::GridSmokeSolver3::Builder::build
GridSmokeSolver3 build() const
Builds GridSmokeSolver3.
jet::GridFluidSolver3::gridSpacing
Vector3D gridSpacing() const
Returns the grid spacing of the grid system data.
jet::GridFluidSolverBuilderBase3
Base class for grid-based fluid solver builder.
Definition: grid_fluid_solver3.h:300
jet::GridSmokeSolver3::GridSmokeSolver3
GridSmokeSolver3()
Default constructor.
jet::Size3
3-D size class.
Definition: size3.h:19
jet::GridFluidSolver3::gridOrigin
Vector3D gridOrigin() const
Returns the origin of the grid system data.
jet::GridSmokeSolver3::smokeTemperatureDecayFactor
double smokeTemperatureDecayFactor() const
Returns temperature decay factor.
jet::GridFluidSolver3
Abstract base class for grid-based 3-D fluid solver.
Definition: grid_fluid_solver3.h:34
jet::GridSmokeSolver3::setBuoyancySmokeDensityFactor
void setBuoyancySmokeDensityFactor(double newValue)
Sets the buoyancy factor which will be multiplied to the smoke density.
jet::GridSmokeSolver3::buoyancySmokeDensityFactor
double buoyancySmokeDensityFactor() const
Returns the buoyancy factor which will be multiplied to the smoke density.
jet::GridSmokeSolver3::setTemperatureDecayFactor
void setTemperatureDecayFactor(double newValue)
Sets the temperature decay factor.
jet::GridSmokeSolver3::Builder
Front-end to create GridSmokeSolver3 objects step by step.
Definition: grid_smoke_solver3.h:190
jet::Vector< T, 3 >
3-D vector class.
Definition: vector3.h:25
jet::GridSmokeSolver3Ptr
std::shared_ptr< GridSmokeSolver3 > GridSmokeSolver3Ptr
Shared pointer type for the GridSmokeSolver3.
Definition: grid_smoke_solver3.h:183
jet::GridSmokeSolver3::Builder::makeShared
GridSmokeSolver3Ptr makeShared() const
Builds shared pointer of GridSmokeSolver3 instance.
jet::GridSmokeSolver3::setSmokeDecayFactor
void setSmokeDecayFactor(double newValue)
Sets the smoke decay factor.
jet::GridSmokeSolver3::setBuoyancyTemperatureFactor
void setBuoyancyTemperatureFactor(double newValue)
Sets the buoyancy factor which will be multiplied to the temperature.
jet::GridSmokeSolver3::setSmokeDiffusionCoefficient
void setSmokeDiffusionCoefficient(double newValue)
Sets smoke diffusion coefficient.