This paper presents a real-time interactive system for simulating and visualizing motor-driven fluid hydrodynamics. The framework integrates a torque-based motor model with Heightfield and Smoothed Particle Hydrodynamics (SPH) fluid simulations. Utilizing modern OpenGL and an ImGui-based control interface, the system achieves consistent real-time performance on a CPU-based laptop and effectively illustrates the differences between surface-only and volumetric fluid models. Quantitative evaluation on a consumer-grade laptop demonstrates real-time performance near 60 FPS for SPH simulations up to approximately 2,000 particles, and interactive rates (15–30 FPS) up to about 5,000 particles. These results validate the system’s suitability for interactive visualization, education, and exploratory research under modest hardware constraints, while acknowledging limitations due to weakly compressible SPH, simplified boundary handling, and heuristic impeller–fluid coupling.
The simulation and visualization of fluid-structure interaction in rotating machinery have long been a topic of interest in both engineering and computer graphics. The project presented in this paper develops a real-time software system that integrates a physically inspired rotating motor model with two fluid simulation methods and renders the resulting motion in a modern OpenGL environment. The system uses GLSL shaders and provides an interactive interface through ImGui 1, 2, 3, 4, enabling detailed visualization and parameter adjustment during runtime.
The motor is modeled as a permanent-magnet rotor with an attached impeller. The motor is treated as a standard rotational device driven by torque models 5, 6, 7, which enables the focus on the fluid systems that represent the primary computational and visualization challenges addressed in the paper.
To represent the behavior of the fluid in the cylindrical tank, two separate simulation models were implemented. The first is a Heightfield model, which treats the fluid surface as a discretized grid storing height and velocity values. The second model is a full 3D Smoothed Particle Hydrodynamics (SPH) solver that discretizes water into interacting particles. By including both models within the same framework, the project allows comparison between a computationally efficient but surface-limited simulation and a more physically expressive but computationally expensive particle-based approach.
The purpose of the system is not to replicate high-fidelity engineering accuracy, but rather to provide a real-time visualization framework suitable for interactive exploration, education, and further extension. The simulation includes a control interface through ImGui, allowing users to toggle motor states, modify fluid parameters, adjust visualization properties, and observe how the impeller influences fluid behavior over time.
This paper describes mathematical models, numerical methods, implementation design, and visual rendering techniques used to construct the system. It also analyzes the performance of the simulation components, discusses practical limitations, and outlines potential future work. Together, these contributions form a complete project that bridges physical simulation, computer graphics, and software systems engineering.
The main contributions of this work are summarized as follows:
• A unified real-time visualization framework coupling a torque-driven motor–impeller model with both Heightfield and SPH fluid solvers under a shared simulation and rendering pipeline;
• A controlled interactive environment that enables direct comparison between surface-only and volumetric fluid representations driven by identical motor actuation;
• A quantitative performance and stability evaluation on commodity hardware, demonstrating the feasibility of interactive motor-driven fluid visualization on CPU hardware without specialized GPU resources.
The simulation of fluid motion in response to mechanical stirring has been widely studied. Historically, fluid animation relied on Eulerian grid-based numerical solvers derived from the Navier–Stokes equations 8, 9, 10 and the stable fluid method 11. These approaches offer high visual fidelity but are computationally demanding, making real-time interactivity challenging without substantial simplification or hardware acceleration.
One of the most widely adopted simplifications for real-time fluids is the heightfield model 12, 13. In this method, the water surface is represented as a 2D grid. The heightfield evolves according to shallow-water wave equations or discretized surface-diffusion dynamics. While highly effective for rendering large-scale surfaces and wave phenomena, heightfields assume a single-valued surface function h(x, y) and thus cannot capture 3D effects.
To overcome the limitations, SPH has become a widely used method, which represents fluids as a collection of particles 14. Particle interactions are computed using radially symmetric smoothing kernels derived from earlier astrophysics literature 15. Subsequent improvements tailored for applications include pressure stabilization and incompressibility corrections 16 and Divergence-Free SPH (DFSPH) 17. A critical challenge in SPH is neighbor finding, and spatial hashing or uniform grids are common acceleration structures 18.
Parallel to advances in fluid simulation, interactive modeling and visualization of rotating mechanical components has been supported by modern programmable graphics hardware. Real-time rendering techniques using vertex and fragment shaders within OpenGL are described extensively in standard literature 19, 20. For real-time user interaction, immediate-mode graphical interface libraries such as ImGui have become popular tools for rapid prototyping and simulation control 1, 2, 3, 4.
In recent years, the increasing availability of GPUs has significantly advanced real-time physics simulation. Compute shaders in OpenGL, introduced in version 4.3 21, allow general-purpose parallel computation directly on GPU hardware. Many SPH implementations leverage compute shaders or CUDA to accelerate density computation, pressure forces, and neighbor search 22.
Taken together, the literature provides a spectrum of fluid modeling techniques and a rich ecosystem of rendering and interaction frameworks that support real-time scientific visualization. The work presented in this paper draws directly from these foundations by integrating a heightfield solver and a 3D SPH solver within a unified interactive visualization system. The following sections discuss how these methods are adapted, implemented, and combined with motor-driven stirring to produce the final simulation.
The system developed in this paper is a real-time application designed to simulate and visualize the interaction between a rotating mechanical impeller and fluid contained in a cylindrical tank. It integrates multiple computational components and rendering subsystems into a unified C++ framework built on modern OpenGL. The overall architecture follows a modular design in which the motor model, the Heightfield fluid solver, the SPH fluid solver, and the visualization layer operate as independent yet coordinated subsystems. These modules interact through a shared simulation loop that governs the evolution of physical state and communicates updated data to the graphics pipeline.
The application follows a standard real-time loop. Each iteration of the loop begins by processing user input via ImGui controls, allowing adjustments to motor state, torque parameters, fluid model selection, and rendering options. The motor subsystem then advances the rotation of the impeller based on user-selected states such as ON, OFF, STOP, and RESET. The impeller’s angular velocity and orientation matrix are computed in the motor module and subsequently passed to the fluid modules to influence local fluid motion.
Following the motor update, the chosen fluid model is advanced by one simulation timestep. In the Heightfield model, the fluid surface is treated as a 2D grid of height and velocity values, and the solver updates these quantities according to discrete shallow-water dynamics. The impeller’s influence is incorporated by injecting wave disturbances and modifying surface velocities in regions near the projected impeller footprint. For the SPH model, the system evolves a collection of fluid particles that interact through pressure, viscosity, and external forces. The impeller’s rotation induces azimuthal velocity around its axis, imparting momentum to nearby particles and creating stirring effects. The SPH solver also performs spatial hashing, density and pressure evaluation, force accumulation, and explicit time integration before returning updated particle positions to the rendering subsystem.
The rendering pipeline is responsible for visualizing all components efficiently. The motor and impeller are rendered as 3D meshes transformed by the motor module’s rotation matrices. The tank is drawn as a transparent cylindrical surface using alpha blending to reveal internal fluid dynamics. For the Heightfield model, the fluid surface is rendered as a mesh whose vertices are displaced vertically according to the grid’s height values. In the SPH model, fluid particles are rendered as small, shaded spheres using instanced drawing techniques, enabling fast rendering of thousands of particles in each frame. All rendering is performed using vertex and fragment shaders, and the scene is viewed through a perspective camera with user-adjustable parameters.
These subsystems are tied together via the core simulation loop, which functions as the orchestrating backbone of the application: user input informs control variables; the motor module updates rotational motion; the fluid module computes new states; and the renderer displays the updated scene. This pipeline supports real-time interactivity, allowing users to observe how the fluid responds to different impeller speeds, how surface waves propagate in the Heightfield model, or how volumetric motion develops in the SPH model. The modular structure also facilitates further extension, such as integrating more advanced motor dynamics, adding free-surface reconstruction, or using GPU-accelerated solvers.
Overall, the system architecture embodies a flexible and extensible design that seamlessly integrates simulation, rendering, and user interaction. It provides a coherent platform for real-time experimentation with motor-driven fluid dynamics and serves as the foundation for the detailed motor and fluid methods described in subsequent sections.
The motor subsystem provides the mechanical actuation responsible for stirring the fluid within the tank. The motor is modeled as a permanent-magnet rotor connected to an impeller, with rotation governed by a simplified torque-driven rigid-body formulation. This approach reflects standard practice in introductory motor-drive modeling and mechanical system simulation, where the essential behavior of rotational acceleration can be captured without detailed electromagnetic equations 23, 24, 25. The motor has several parts: rotor, magnets, stator, and impeller with blades, as shown in Figure 1. The motor is generated procedurally within the Motor.cpp module.
The rotor is represented as a rigid cylindrical body whose angular position, angular velocity, and orientation matrix evolve over time according to Newton’s Second Law for rotational motion 26, 27. The impeller is rigidly attached to the rotor and is rendered using polygonal geometry. Together, the rotor and impeller form a coupled unit whose rotation drives motion within the fluid domain. The evolution of the rotor’s angular velocity ω is governed by a torque-based ordinary differential equation of the form dω/dt = (τapp – Dω) / I, where τapp is the externally applied torque, D is an empirical damping coefficient representing rotational drag and internal friction, and I is the moment of inertia of the rotor-impeller assembly. The implementation assumes a constant applied torque when the motor is in the ON state, while the OFF-state sets τapp = 0, producing passive slowing due to damping. Both the STOP and RESET states override dynamic evolution: STOP freezes the rotor in place without updating its kinematic quantities, whereas RESET returns the rotor to its initial angular position and zero angular velocity. These control states allow users to manipulate rotation in an intuitive manner during interactive experiments.
Angular velocity is integrated explicitly using a fixed timestep aligned with the main simulation loop. The rotor’s angular position θ evolves according to dθ/dt = ω, and the corresponding rotation matrix is computed in each frame to transform the geometry of the rotor, magnets, and impeller blades. Although the electromagnetic details of permanent-magnet torque production are abstracted away, this simplified kinematic description is sufficient to capture the essential mechanical behavior required to drive either fluid model.
The motor’s interaction with the fluid occurs through geometric coupling and momentum transfer. The coupling precise form is not intended to reproduce high-fidelity fluid-structure interaction as seen in CFD simulations, but rather to generate visually plausible stirring effects consistent with the goals of an educational and interactive graphics environment.
Rendering of the motor is handled independently of its underlying physics. The motor and impeller geometries are drawn in each frame using transformation matrices derived from the rotor’s orientation. The transparency of the surrounding cylindrical tank allows users to view the impeller’s rotational motion simultaneously with the resulting fluid dynamics.
Overall, the motor model in this paper strikes a balance between physical plausibility and computational efficiency. By abstracting away electromagnetic complexities and focusing on torque-driven mechanical rotation, the implementation provides a clear and controllable mechanism for inducing fluid motion.
4.2. Tank ModelingThe tank serves as the physical boundary in which the simulated fluid interacts with the rotating impeller, and its geometric and visual representation play an essential role in both physical plausibility and interpretability of the system. In this paper, the tank is modeled as a transparent, vertically oriented cylindrical container with adjustable radius, height and thickness. The modeling strategy balances geometric simplicity, rendering efficiency, and visual clarity to ensure coherent integration with the motor and fluid subsystems.
The tank is generated procedurally within the Tank.cpp module. The cylindrical geometry is constructed by discretizing the circular footprint into a configurable number of angular slices. For each slice, pairs of vertices are generated along the vertical direction to form a triangular strip, which collectively approximates the tank’s curved surface. The mesh is uploaded to OpenGL vertex buffer objects (VBOs) and rendered using an indexed draw call for efficiency.
The tank is visualized using alpha-blended rendering to allow the user to observe the interior fluid and the rotating impeller. The fragment shader applies semi-transparent shading with user-adjustable opacity, enabling different levels of visibility depending on the visualization task. The transparency can be changed as shown in Figure 2.
The choice of transparency introduces potential rendering order issues (e.g., depth-sorting artifacts). To mitigate these while maintaining simplicity, the tank is rendered before the fluid but after the motor. Depth testing is enabled throughout the rendering pipeline, ensuring that the impeller and fluid elements correctly occlude one another behind the tank walls.
In the physical simulation, the tank defines the boundary of the fluid domain. Each frame, the fluid solvers enforce boundary constraints derived from the cylindrical shape. If a particle attempts to move beyond the tank radius, the solver clamps its position to the boundary and damps the radial component of its velocity. This penalty-based method prevents particle escape while avoiding the complexity of rigid-body collision models. The floor boundary applies a similar clamping technique. Although the boundary-handling strategies do not capture detailed wall-fluid interactions such as shear layers or no-slip effects, they provide computationally efficient containment suitable for real-time visualization.
In summary, the tank model provides an essential structural and visual component of the simulation. Its geometric simplicity, efficient rendering, and straight-forward boundary conditions ensure that it integrates smoothly with the motor and fluid solvers while enabling clear visualization of the system’s internal dynamics. Despite its simplicity, the tank offers a stable and effective enclosure for both fluid models and supports real-time interaction without imposing significant computational cost.
The heightfield fluid model provides an efficient and visually intuitive approximation of fluid surface dynamics and is well suited for real-time graphics applications where computational cost must remain low. A heightfield assumes that the water surface can be represented as a single-valued function h(x, y), hereby restricting the simulation to surface waves without overturning or multi-valued geometries. This representation corresponds closely to the shallow-water equations, a simplified form of the full Navier-Stokes equations 28. Such models have been widely adopted due to their stability and computational efficiency 29, 30.
The heightfield is represented as a discretized 2D grid of scalar heights {hi,j} and associated horizontal velocity fields. The underlying mathematical model is based on the shallow-water approximation, which assumes that horizontal fluid velocities are small relative to gravitational forces. The dynamics can be expressed in terms of the height field and horizontal momentum. The velocity field is updated according to pressure and gravity-driven terms. In practice, many real-time heightfield solvers use simplified wave-propagation models, allowing surface waves to propagate with controllable damping.
The solver in this paper operates directly on a grid stored in CPU memory and updates it in each frame. The grid typically ranges from tens to hundreds of cells per dimension, balancing smooth visual appearance with computational efficiency. Boundary conditions prevent numerical instabilities and ensure that waves reflect realistically within the tank. To maintain simplicity and speed, the implementation does not enforce strict conservation properties but instead prioritizes stable and visually convincing motion.
Each simulation step consists of evaluating the discrete Laplacian or divergence operator using finite differences, computing the new heights, applying damping, and updating any associated velocity components.
The impeller’s rotation influences the heightfield primarily through localized disturbances applied within the impeller’s projected footprint onto the grid. These disturbances may take the form of (1) Direct modification of local height values, (2) Injection of horizontal velocity components to induce directional wave propagation, or (3) Superposition of radially distributed perturbations to mimic stirring.
The rendered fluid surface is produced by mapping the height grid to a tessellated mesh in the vertex shader. Each vertex corresponds to a grid point, with its vertical displacement set to the corresponding height value. The mesh is shaded using fragment shaders to enhance depth perception. Normals are typically reconstructed from the height differences between neighboring cells, enabling visually appealing reflections and shading.
The heightfield is rendered in the transparent tank, allowing users to simultaneously observe both the surface dynamics and the rotating impeller below. Because the heightfield is limited to the surface, internal fluid motion is not visualized directly; instead, surface waves serve as a proxy for the underlying stirring dynamics. The rendered fluid is shown in Figure 3.
The heightfield model offers several advantages: it is fast, stable, and visually intuitive. It enables real-time interaction even with modest hardware and is straightforward to integrate with the motor’s motion. However, it cannot represent splashes, overturning waves, or volumetric fluid movement, making it unsuitable for capturing the full complexity of stirring mechanics. As such, the heightfield model serves as a lightweight alternative or complement to the more physically expressive SPH model described in the next section.
5.2. SPH Fluid ModelThe SPH solver 15, 31 provides a fully 3D, particle-based representation of fluid motion, enabling the simulation of volumetric effects. The fluid is modeled as a collection of interacting discrete particles whose behavior is governed by continuous equations of motion approximated through smoothing kernels. SPH has become widely used in computer graphics for real-time fluid animation due to its Lagrangian nature, flexibility with complex boundaries, and intuitive formulation 16, 17, 32, 33.
The SPH method approximates continuum fluid mechanics by smoothing field quantities over local neighborhoods using kernel functions. Although more advanced SPH variants (PCISPH and DFSPH) offer improved incompressibility 16, 17, this implementation adopts the classical weakly compressible SPH formulation due to its simplicity and speed.
A central computational challenge is identifying the particles in the kernel radius h of each particle. A naive all-pairs search incurs O(n2) cost, which quickly becomes prohibitive. To address this, the solver uses a uniform grid spatial hashing method in which particle positions are mapped to discrete grid cells using integer flooring. This reduces neighbor search complexity to near linear in particle count and enables the simulation of thousands of particles in real-time on a CPU.
The fluid is confined in the cylindrical tank. Boundary handling is implemented by projecting particles back into the valid region whenever their updated positions exceed the tank’s radius or fall below the floor. This simplistic boundary model ensures numerical stability and prevents particle escape without introducing complex rigid-body collision handling.
The SPH solver incorporates stirring effects by applying velocity impulses to particles near the impeller. This operation is applied only to particles within a limited radial region near the impeller blades, generating vortices and swirl patterns consistent with qualitative expectations of stirred liquid. The coupling remains visually plausible while avoiding the computational burden of evaluating detailed fluid-structure contact forces.
SPH particles are rendered using point sprites or instanced spheres via OpenGL. Particle positions are stored in CPU arrays. The vertex shader expands each particle into a screen-aligned primitive, optionally applying per-particle lighting using reconstructed normals from local velocity gradients. This approach supports high particle counts while maintaining real-time rendering throughput.
The solver provides a physically motivated, visually expressive, and fully 3D representation of fluid behavior. It captures swirling, agitation, localized momentum transfer, and transient effects as shown in Figure 4. However, it remains a weakly compressible formulation and does not enforce strict incompressibility constraints, which can lead to density fluctuations.
The rendering subsystem plays a central role in translating the numerical simulation data into an interactive visual environment. The visualization pipeline is designed to balance efficiency, clarity, and aesthetic fidelity. The system relies on the modern programmable graphics pipeline provided by OpenGL, employing custom vertex and fragment shaders to render the motor, tank, Heightfield surface, and SPH particles. The graphical user interface is implemented using the ImGui library, which facilitates intuitive control over simulation parameters without disrupting rendering performance.
The simulated environment consists of three principal visual elements: the rotating motor and impeller assembly, the cylindrical tank, and the fluid representation. These elements are transformed and rendered using a shared perspective camera model that supports rotation, zooming, and panning. The camera is updated in each frame to reflect user input, ensuring that the system remains responsive during interaction.
Motor and impeller geometries are rendered using standard mesh rendering techniques. The rotor’s orientation matrix, computed by the motor simulation module, is passed into the vertex shader to transform the mesh into each frame. The impeller blades, which serve as the primary stirring mechanism, are rendered using solid shading and may optionally include specular highlights to improve visual presence within the tank.
The tank is rendered as a transparent mesh using alpha blending. Adjustable opacity parameters allow the user to choose between clearer views of the internal dynamics or more realistic water–glass occlusion effects. The rendering of the tank geometry relies on a standard vertex shader for transforming vertices and a fragment shader that applies color attenuation based on transparency and lighting.
When the heightfield fluid model is active, the water surface is visualized using a triangulated mesh whose vertex positions are dynamically displaced based on the computed height values. The vertex shader receives the height grid as a uniform buffer or texture-like structure and adjusts the vertical component of each vertex accordingly. Surface normals are reconstructed by computing gradients from neighboring height samples, enabling smooth shading and the appearance of natural lighting. The fragment shader applies simple Phong or Lambertian lighting to enhance depth perception. Although not physically based, these shading models offer a good compromise between realism and performance.
In the SPH model, the fluid is visualized as a set of particles, whose positions are stored in CPU-side arrays. The rendering system uses instanced drawing or point-sprites to render each particle efficiently. In the simplest implementation, each particle corresponds to a point primitive expanded in the vertex shader into a camera-facing quad, known as a billboard. The fragment shader then shades the quad to resemble a small sphere by applying radial attenuation or smoothstep blending. Particle color may encode additional information such as velocity magnitude, local density, or pressure.
The rendering emphasizes the spatial relationship between the rotating impeller and the fluid. By combining transparency in the tank and lighting on the blades, the system provides a clear and continuous visual cue connecting the mechanical motion to the fluid response.
The camera follows a standard orbit (arcball) control scheme with adjustable distance, azimuth, and elevation. User interactions – mouse dragging for rotation and translation and scrolling for zoom – allow fine control over the scene. This flexibility supports detailed examination of fluid–structure interactions from arbitrary angles.
The ImGui interface provides sliders, drop-down menus, and checkboxes for controlling simulation parameters, such as font size, amount of motor parts, motor torque and damping, tank transparency and geometry, fluid level, fluid model selection, particle count, showing/hiding individual component, motor on/off/stop functions, and simulation reset/pause/resume functions. The immediate-mode nature of ImGui ensures that the interface remains decoupled from the rendering pipeline, avoiding the overhead associated with retained-mode GUI systems. The ImGui control panel is shown in Figure 5.
Through the combination of modern OpenGL rendering, shader-based geometry processing, and an intuitive user interface, the visualization subsystem provides a clear and responsive depiction of motor-driven fluid dynamics. The rendering design not only enhances the interpretability of the simulation but also supports the experimental and educational objectives of the project, ensuring that fluid responses, wave patterns, and stirring motions are communicated effectively to the user.
The integrated simulation system was evaluated qualitatively and quantitatively to assess its real-time performance, visual fidelity, and responsiveness under both fluid models. Because the primary goal of the project is to provide an interactive visualization environment rather than a high-precision computational fluid dynamics platform, the results focus on perceptual and functional correctness, rendering quality, and responsiveness under user-controlled motor and fluid parameters. All results reported here correspond to the verified CPU implementations of the Heightfield and SPH solvers.
Quantitative performance and stability metrics were collected on a consumer-grade laptop equipped with a 12th-generation Intel Core i5-1235U processor, 16 GB of system memory, and integrated Intel Iris Xe graphics, running 64-bit Windows 11. No discrete GPU acceleration was used. This configuration reflects a typical commodity system and provides a conservative lower-bound estimate of interactive visualization performance.
For SPH simulations with up to approximately 2,000 particles, the system maintains real-time update rates close to 60 FPS. Interactive visualization (15–30 FPS) remains feasible up to roughly 5,000 particles, after which performance degrades gracefully as particle count increases, as expected for a CPU-based solver. Across all tested configurations, density deviation statistics remain bounded, with mean relative density error below 0.25, consistent with weakly compressible SPH formulations. These results indicate stable qualitative behavior suitable for visualization, while not intended for CFD-grade prediction.
The Heightfield solver exhibited stable and visually convincing surface-wave behavior across a range of motor speeds and grid resolutions. When the impeller rotated, the heightfield responded by generating circular waves and radial disturbances centered beneath the impeller. At low rotational speeds, the surface displayed gentle ripple propagation, while higher speeds produced more energetic wavefronts that spread outward and reflected from the tank boundaries. The system maintained real-time performance even with relatively fine grid resolutions due to computational efficiency. Wave damping and propagation speeds behaved predictably based on user-adjusted parameters, and the Heightfield remained free of numerical instabilities such as divergence or excessive oscillation. The heightfield visualization communicated clearly between motor-induced forcing and surface response, fulfilling its role as a fast, intuitive model of surface fluid dynamics. However, as expected, the Heightfield model was unable to represent volumetric stirring or subsurface flow patterns. This limitation reaffirms the complementary role of the SPH solver for fully 3D fluid motion.
The SPH solver provided a much richer representation of fluid behavior. For modest particle counts, it maintained visually smooth and physically plausible dynamics at interactive frame rates. The motor’s rotation induced swirling motion, generating tangential velocity profiles that qualitatively resemble real fluid agitation under a rotating impeller. Particles near the impeller quickly accelerated, forming a circular flow that propagated outward and upward. Density fluctuations remained bounded, and the weakly compressible approach produced visually acceptable pressure responses without numerical explosion. Boundary handling at the tank walls and floor kept particles well confined. While slight accumulation or clustering sometimes occurred near the outer radius – an artifact of the simplified boundary constraints – these effects did not significantly detract from the overall visual experience. One notable qualitative result was the system’s ability to demonstrate realistic “spin-down” behavior: when the motor transitioned from ON to OFF, the fluid gradually lost angular momentum through viscosity and damping. The SPH solver therefore succeeded in capturing volumetric stirring phenomena that the Heightfield model could not reproduce.
The rendering subsystem maintained smooth real-time performance under both fluid models. SPH particle rendering incurred minimal overhead. Tank transparency and lighting effects on the impeller contributed to visual clarity without compromising performance.
Camera interaction remained responsive during rotation, zooming, and panning. The ImGui interface produced negligible computational overhead and allowed users to modify parameters without interrupting the simulation loop. Together, these features confirmed the system’s effectiveness as an interactive visualization tool.
Overall, the system achieved the goal of providing a responsive, real-time visualization of motor-induced fluid dynamics. The Heightfield solver offered fast and smooth surface-wave rendering, while the SPH solver provided volumetric stirring behavior and complex flow patterns. The unified rendering pipeline and user interface allowed seamless interaction and clear visualization of both models. These results demonstrate the effectiveness of the underlying simulation architecture and support the system’s use as a foundation for further research, education, and visualization applications.
The development and evaluation of the system reveal several important insights regarding the capabilities, limitations, and tradeoffs inherent in using simplified physical models for interactive visualization. The inclusion of two distinct fluid representations offers a valuable comparative perspective, demonstrating how modeling decisions influence computational performance and the qualitative realism of the resulting dynamics.
8.1. Interpretation of Fluid Model BehaviorsThe Heightfield model proved highly effective for depicting surface-level wave propagation and motor-induced disturbances. Its efficiency makes it ideal for interactive scenarios where computational overhead must remain minimal. However, its intrinsic assumption of a single-valued height function imposes strict limitations on physical realism. The absence of volumetric flow, vertical motion beneath the surface, or non-surface turbulence means that swirling behavior generated by the impeller is not captured in a physically meaningful way. Instead, the interaction is expressed through surface ripples and oscillations that approximate the qualitative effects of objects passing beneath the water surface. As it cannot represent the 3D flow structures characteristic of mechanically stirred fluids, for applications requiring detailed mixing or vortex visualization, the Heightfield model is insufficient.
In contrast, the SPH solver successfully reproduced volumetric fluid motion with swirl, circulation, and transient vortex-like features. Particles respond naturally to the impeller’s rotation, and the Lagrangian formulation provides an intuitive and visually compelling representation of stirred fluid. The persistence of motion after the motor transitions from ON to OFF illustrates the solver’s ability to maintain fluid inertia and dissipate energy gradually through viscosity and damping. However, the SPH model has its own limitations. The weakly compressible SPH formulation permits noticeable density variations. Artifacts are common in implementations and reflect the balance between computational simplicity and physical accuracy. More advanced formulations would mitigate the issues but require significantly more computational resources and algorithmic complexity.
Boundary handling also introduces artifacts. The simple clamping and damping techniques used to contain particles within the tank ensure stability but do not fully capture the physics of fluid-wall interactions. Real fluids experience boundary layers, shear stresses, and complex interactions with curved walls, none of which are modeled in the present system.
8.2. Integration with Motor DynamicsThe coupling between the impeller and fluid is intentionally simplified to ensure clarity and stability during real-time interaction. While the imposed tangential velocities reproduce visually recognizable stirring behavior, they do not arise from rigorous fluid-structure interaction calculations. No-slip boundary conditions on the impeller blades, hydrodynamic lift, and turbulent eddies are not explicitly modeled. Instead, the system prioritizes real-time responsiveness and robustness over detailed physical accuracy. Despite these simplifications, the coupling achieves the goal: it creates a perceptually convincing demonstration of how mechanical rotation influences fluid flow. The interaction between motor states and fluid response helps users develop intuition about dynamical systems and momentum transfer.
8.3. Rendering and User InteractionRendering clarity and responsiveness are essential for interpreting the simulation results. The use of transparency for the tank, shading for the impeller, and point-sprite or sphere-based visualization for SPH particles provides a visually coherent scene in which fluid motion is easy to observe. The ImGui interface plays an equally important role by enabling dynamic adjustment of parameters and direct observation of their effects. A notable strength of the rendering system is its decoupling from the simulation logic. This separation allows the user to switch between fluid models or adjust motor parameters without significant performance penalties.
8.4. Overall AssessmentCollectively, the results and observations suggest that the system successfully achieves its primary objectives: providing an interactive, educational, and visually compelling simulation of motor-driven fluid dynamics. The Heightfield model delivers speed and simplicity, while the SPH model captures volumetric complexity and dynamic stirring. The rendering pipeline and UI interface complement the models by maintaining clarity, responsiveness, and ease of use.
In summary, the system is a successful synthesis of real-time simulation, computational modeling, and interactive visualization. While several components remain simplified or preliminary, the architecture provides a foundation for future research and pedagogical use.
This paper presents a real-time interactive system for simulating and visualizing motor-driven fluid dynamics with two fluid models: Heightfield and SPH. Integrated within a modern OpenGL rendering framework and controlled through an intuitive ImGui interface, the system successfully demonstrates the distinct behaviors produced by each fluid model under the influence of a rotating impeller. By separating the simulation logic from the rendering pipeline and adopting modular software design principles, the project provides a clear and extensible foundation for real-time computational graphics applications.
On a consumer-grade CPU-based laptop platform (Intel i5-1235U), quantitative evaluation shows that the system maintains real-time performance near 60 FPS for SPH simulations up to about 2,000 particles and interactive rates (15–30 FPS) up to approximately 5,000 particles. The results are intended for visualization rather than CFD-grade prediction, and the measurements demonstrate stable numerical behavior and predictable performance scaling with particle count.
The rendering pipeline offers clear visualization of both fluid models and the motor assembly. Transparency, shading, instanced particle rendering, and camera controls all contribute to an interactive environment that aids visual interpretation. The overall system functions as an effective educational and exploratory tool, enabling users to experiment with motor states, fluid parameters, and visualization settings in real time under modest hardware constraints.
At the same time, the project reveals several limitations and opportunities for further development. The simplified coupling between the impeller and fluid, basic boundary conditions, and weakly compressible SPH formulation all point to potential avenues for improving physical realism.
Looking ahead, several directions for future work emerge: (1) GPU implementation; (2) Advanced SPH formulations; (3) Improved fluid-boundary interaction; (4) Surface reconstruction for SPH; and (5) Physics-based impeller–fluid coupling.
By establishing a modular, extensible platform that integrates motor dynamics, multiple fluid simulation paradigms, and real-time rendering, this project lays the groundwork for a broad spectrum of future enhancements in both performance and physical accuracy. The system serves as an effective demonstration of the interplay between computational modeling and interactive visualization, and it offers a valuable foundation for further research, educational use, and exploratory simulation in computer graphics and fluid dynamics.
| [1] | https://dearimgui.com [Accessed Feb. 4, 2026]. | ||
| In article | |||
| [2] | https://github.com/ocornut/imgui [Accessed Feb. 4, 2026]. | ||
| In article | |||
| [3] | Olajos, Rikard. “Real-time rendering of volumetric clouds.” LU-CS-EX 2016-42 (2016). | ||
| In article | |||
| [4] | Castro, Guilherme Cattani de. CG Guide: a modern openGL and computer graphics teaching application. 2021. | ||
| In article | |||
| [5] | Hughes, Austin, and Bill Drury. Electric motors and drives: fundamentals, types and applications. Newnes, 2019. | ||
| In article | View Article PubMed | ||
| [6] | Liu, Tian-Hua. “Design and Control of Electrical Motor Drives.” Energies 14, no. 22 (2021): 7717. | ||
| In article | View Article | ||
| [7] | Štulrajter, Marek, Valeria Hrabovcova, and Marek Franko. “Permanent magnets synchronous motor control theory.” Journal of electrical engineering 58, no. 2 (2007): 79-84. | ||
| In article | |||
| [8] | Wang, Xiaokun, Yanrui Xu, Sinuo Liu, Bo Ren, Jirí Kosinka, Alexandru C. Telea, Jiamin Wang et al. “Physics-based fluid simulation in computer graphics: Survey, research trends, and challenges.” Computational Visual Media 10, no. 5 (2024): 803-858. | ||
| In article | View Article | ||
| [9] | Hartmann, Kay. Implementation of an Interactive Real-Time Eulerian Fluid Simulation. 2024. | ||
| In article | |||
| [10] | Foster, Nick, and Dimitri Metaxas. “Realistic animation of liquids.” Graphical models and image processing 58, no. 5 (1996): 471-483. | ||
| In article | View Article | ||
| [11] | Stam, Jos. “Stable Fluids,” in Proceedings of SIGGRAPH 1999, pp. 121–128. | ||
| In article | View Article | ||
| [12] | Kass, Michael, and Gavin Miller. “Rapid, stable fluid dynamics for computer graphics.” In Proceedings of the 17th annual conference on Computer graphics and interactive techniques, pp. 49-57. 1990. | ||
| In article | View Article | ||
| [13] | Tessendorf, Jerry. “Simulating Ocean Water.” ACM SIGGRAPH course notes SIGGRAPH (1999). | ||
| In article | |||
| [14] | Müller, Matthias, David Charypar, and Markus Gross. “Particle-based fluid simulation for interactive applications.” In Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation, pp. 154-159. 2003. | ||
| In article | |||
| [15] | Gingold, Robert A., and Joseph J. Monaghan. “Smoothed particle hydrodynamics: theory and application to non-spherical stars.” Monthly notices of the royal astronomical society 181, no. 3 (1977): 375-389. | ||
| In article | View Article | ||
| [16] | Solenthaler, Barbara, and Renato Pajarola. “Predictive-corrective incompressible SPH.” In ACM SIGGRApH 2009 papers, pp. 1-6. 2009. | ||
| In article | View Article | ||
| [17] | Bender, Jan, Matthias Müller, Miguel A. Otaduy, Matthias Teschner, and Miles Macklin. “A survey on position‐based simulation methods in computer graphics.” In Computer graphics forum, vol. 33, no. 6, pp. 228-251. 2014. | ||
| In article | View Article | ||
| [18] | Ihmsen, Markus, Jens Orthmann, Barbara Solenthaler, Andreas Kolb, and Matthias Teschner. “SPH fluids in computer graphics.” Eurographics 2014 – State of the Art Reports, pp. 21–42, 2014. | ||
| In article | |||
| [19] | Rost, Randi J., Bill Licea-Kane, Dan Ginsburg, John Kessenich, Barthold Lichtenbelt, Hugh Malan, and Mike Weiblen. OpenGL shading language. Pearson Education, 2009. | ||
| In article | |||
| [20] | Kessenich, John, Graham Sellers, and Dave Shreiner. OpenGL Programming Guide: The official guide to learning OpenGL, version 4.5 with SPIR-V. Addison-Wesley Professional, 2016. | ||
| In article | |||
| [21] | Khronos Group, OpenGL 4.6 Core Profile Specification, 2019. | ||
| In article | |||
| [22] | Goswami, Prashant, Philipp Schlegel, Barbara Solenthaler, and Renato Pajarola. “Interactive SPH simulation and rendering on the GPU.” in Proceedings of the 5th International Conference on Computer Graphics Theory and Applications, 2010. | ||
| In article | |||
| [23] | Krause, Paul C., Oleg Wasynczuk, Scott D. Sudhoff, and Steven Pekarek. Analysis of electric machinery and drive systems. Vol. 2. New York: IEEE press, 2002. | ||
| In article | View Article | ||
| [24] | Fitzgerald, Arthur Eugene, Charles Kingsley, and Stephen D. Umans. Electric machinery. McGraw-Hill, 2003. | ||
| In article | |||
| [25] | Krishnan, Ramu. Electric motor drives: modeling, analysis, and control. Prentice Hall., 2001. | ||
| In article | |||
| [26] | Craig, John J. Introduction to robotics: mechanics and control, 3/E. Pearson Education India, 2009. | ||
| In article | |||
| [27] | Alciatore, David G., and Michael B. Histand. Introduction to mechatronics and measurement systems. Vol. 3. New York: McGraw-Hill, 2007. | ||
| In article | |||
| [28] | Stoker, James Johnston. Water waves: The mathematical theory with applications. Courier Dover Publications, 2019. | ||
| In article | |||
| [29] | Kass, Michael, and Gavin Miller. “Rapid, stable fluid dynamics for computer graphics.” In Proceedings of the 17th annual conference on Computer graphics and interactive techniques, pp. 49-57. 1990. | ||
| In article | View Article | ||
| [30] | Hinsinger, Damien, Fabrice Neyret, and Marie-Paule Cani. “Interactive animation of ocean waves.” In Proceedings of the 2002 ACM SIGGRAPH/Eurographics symposium on Computer animation, pp. 161-166. 2002. | ||
| In article | View Article | ||
| [31] | Lucy, Leon B. “A numerical approach to the testing of the fission hypothesis.” Astronomical Journal, vol. 82, Dec. 1977, p. 1013-1024. 82 (1977): 1013-1024. | ||
| In article | View Article | ||
| [32] | Müller, Matthias, David Charypar, and Markus Gross. “Particle-based fluid simulation for interactive applications.” In Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation, pp. 154-159. 2003. | ||
| In article | |||
| [33] | Bender, Jan, and Dan Koschier. “Divergence-free SPH for incompressible and viscous fluids.” IEEE Transactions on Visualization and Computer Graphics 23, no. 3 (2016): 1193-1206. | ||
| In article | View Article PubMed | ||
Published with license by Science and Education Publishing, Copyright © 2026 Peizheng Ma, Benjamin Ma and Nianhua Guo
This work is licensed under a Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by/4.0/
| [1] | https://dearimgui.com [Accessed Feb. 4, 2026]. | ||
| In article | |||
| [2] | https://github.com/ocornut/imgui [Accessed Feb. 4, 2026]. | ||
| In article | |||
| [3] | Olajos, Rikard. “Real-time rendering of volumetric clouds.” LU-CS-EX 2016-42 (2016). | ||
| In article | |||
| [4] | Castro, Guilherme Cattani de. CG Guide: a modern openGL and computer graphics teaching application. 2021. | ||
| In article | |||
| [5] | Hughes, Austin, and Bill Drury. Electric motors and drives: fundamentals, types and applications. Newnes, 2019. | ||
| In article | View Article PubMed | ||
| [6] | Liu, Tian-Hua. “Design and Control of Electrical Motor Drives.” Energies 14, no. 22 (2021): 7717. | ||
| In article | View Article | ||
| [7] | Štulrajter, Marek, Valeria Hrabovcova, and Marek Franko. “Permanent magnets synchronous motor control theory.” Journal of electrical engineering 58, no. 2 (2007): 79-84. | ||
| In article | |||
| [8] | Wang, Xiaokun, Yanrui Xu, Sinuo Liu, Bo Ren, Jirí Kosinka, Alexandru C. Telea, Jiamin Wang et al. “Physics-based fluid simulation in computer graphics: Survey, research trends, and challenges.” Computational Visual Media 10, no. 5 (2024): 803-858. | ||
| In article | View Article | ||
| [9] | Hartmann, Kay. Implementation of an Interactive Real-Time Eulerian Fluid Simulation. 2024. | ||
| In article | |||
| [10] | Foster, Nick, and Dimitri Metaxas. “Realistic animation of liquids.” Graphical models and image processing 58, no. 5 (1996): 471-483. | ||
| In article | View Article | ||
| [11] | Stam, Jos. “Stable Fluids,” in Proceedings of SIGGRAPH 1999, pp. 121–128. | ||
| In article | View Article | ||
| [12] | Kass, Michael, and Gavin Miller. “Rapid, stable fluid dynamics for computer graphics.” In Proceedings of the 17th annual conference on Computer graphics and interactive techniques, pp. 49-57. 1990. | ||
| In article | View Article | ||
| [13] | Tessendorf, Jerry. “Simulating Ocean Water.” ACM SIGGRAPH course notes SIGGRAPH (1999). | ||
| In article | |||
| [14] | Müller, Matthias, David Charypar, and Markus Gross. “Particle-based fluid simulation for interactive applications.” In Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation, pp. 154-159. 2003. | ||
| In article | |||
| [15] | Gingold, Robert A., and Joseph J. Monaghan. “Smoothed particle hydrodynamics: theory and application to non-spherical stars.” Monthly notices of the royal astronomical society 181, no. 3 (1977): 375-389. | ||
| In article | View Article | ||
| [16] | Solenthaler, Barbara, and Renato Pajarola. “Predictive-corrective incompressible SPH.” In ACM SIGGRApH 2009 papers, pp. 1-6. 2009. | ||
| In article | View Article | ||
| [17] | Bender, Jan, Matthias Müller, Miguel A. Otaduy, Matthias Teschner, and Miles Macklin. “A survey on position‐based simulation methods in computer graphics.” In Computer graphics forum, vol. 33, no. 6, pp. 228-251. 2014. | ||
| In article | View Article | ||
| [18] | Ihmsen, Markus, Jens Orthmann, Barbara Solenthaler, Andreas Kolb, and Matthias Teschner. “SPH fluids in computer graphics.” Eurographics 2014 – State of the Art Reports, pp. 21–42, 2014. | ||
| In article | |||
| [19] | Rost, Randi J., Bill Licea-Kane, Dan Ginsburg, John Kessenich, Barthold Lichtenbelt, Hugh Malan, and Mike Weiblen. OpenGL shading language. Pearson Education, 2009. | ||
| In article | |||
| [20] | Kessenich, John, Graham Sellers, and Dave Shreiner. OpenGL Programming Guide: The official guide to learning OpenGL, version 4.5 with SPIR-V. Addison-Wesley Professional, 2016. | ||
| In article | |||
| [21] | Khronos Group, OpenGL 4.6 Core Profile Specification, 2019. | ||
| In article | |||
| [22] | Goswami, Prashant, Philipp Schlegel, Barbara Solenthaler, and Renato Pajarola. “Interactive SPH simulation and rendering on the GPU.” in Proceedings of the 5th International Conference on Computer Graphics Theory and Applications, 2010. | ||
| In article | |||
| [23] | Krause, Paul C., Oleg Wasynczuk, Scott D. Sudhoff, and Steven Pekarek. Analysis of electric machinery and drive systems. Vol. 2. New York: IEEE press, 2002. | ||
| In article | View Article | ||
| [24] | Fitzgerald, Arthur Eugene, Charles Kingsley, and Stephen D. Umans. Electric machinery. McGraw-Hill, 2003. | ||
| In article | |||
| [25] | Krishnan, Ramu. Electric motor drives: modeling, analysis, and control. Prentice Hall., 2001. | ||
| In article | |||
| [26] | Craig, John J. Introduction to robotics: mechanics and control, 3/E. Pearson Education India, 2009. | ||
| In article | |||
| [27] | Alciatore, David G., and Michael B. Histand. Introduction to mechatronics and measurement systems. Vol. 3. New York: McGraw-Hill, 2007. | ||
| In article | |||
| [28] | Stoker, James Johnston. Water waves: The mathematical theory with applications. Courier Dover Publications, 2019. | ||
| In article | |||
| [29] | Kass, Michael, and Gavin Miller. “Rapid, stable fluid dynamics for computer graphics.” In Proceedings of the 17th annual conference on Computer graphics and interactive techniques, pp. 49-57. 1990. | ||
| In article | View Article | ||
| [30] | Hinsinger, Damien, Fabrice Neyret, and Marie-Paule Cani. “Interactive animation of ocean waves.” In Proceedings of the 2002 ACM SIGGRAPH/Eurographics symposium on Computer animation, pp. 161-166. 2002. | ||
| In article | View Article | ||
| [31] | Lucy, Leon B. “A numerical approach to the testing of the fission hypothesis.” Astronomical Journal, vol. 82, Dec. 1977, p. 1013-1024. 82 (1977): 1013-1024. | ||
| In article | View Article | ||
| [32] | Müller, Matthias, David Charypar, and Markus Gross. “Particle-based fluid simulation for interactive applications.” In Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation, pp. 154-159. 2003. | ||
| In article | |||
| [33] | Bender, Jan, and Dan Koschier. “Divergence-free SPH for incompressible and viscous fluids.” IEEE Transactions on Visualization and Computer Graphics 23, no. 3 (2016): 1193-1206. | ||
| In article | View Article PubMed | ||