![]() |
Shamrock 2025.10.0
Astrophysical Code
|
GSPH force computation using Riemann solver results. More...
#include "shambackends/math.hpp"#include "shambackends/sycl.hpp"#include "shammodels/gsph/math/riemann/iterative.hpp"#include "shammodels/sph/math/forces.hpp"
Include dependency graph for forces.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Namespaces | |
| namespace | shammodels |
| namespace for models | |
Functions | |
| template<class Tvec , class Tscal > | |
| Tscal | shammodels::gsph::gsph_energy_rate (Tscal m_b, Tscal p_star, Tscal v_star, Tscal rho_a_sq, Tscal rho_b_sq, Tscal omega_a, Tscal omega_b, Tvec v_a, Tvec r_ab_unit, Tvec nabla_W_a, Tvec nabla_W_b) |
| Compute GSPH energy equation contribution. | |
| template<class Tvec , class Tscal > | |
| void | shammodels::gsph::add_gsph_force_contribution (Tscal m_b, Tscal p_star, Tscal v_star, Tscal rho_a, Tscal rho_b, Tscal omega_a, Tscal omega_b, Tscal Fab_a, Tscal Fab_b, Tvec r_ab_unit, Tvec v_a, Tvec &dv_dt, Tscal &du_dt) |
| Add GSPH force contribution from a single neighbor pair. | |
GSPH force computation using Riemann solver results.
Implements the Godunov SPH (GSPH) force formulation following Cha & Whitworth (2003). The key difference from standard SPH is that the interface pressure p* comes from solving the Riemann problem, rather than using artificial viscosity.
References:
Definition in file forces.hpp.
|
inline |
Add GSPH force contribution from a single neighbor pair.
Convenience function that computes both acceleration and energy rate contributions from a single particle pair, given the Riemann solver result.
| Tvec | Vector type |
| Tscal | Scalar type |
| m_b | Mass of neighbor particle | |
| p_star | Interface pressure from Riemann solver | |
| v_star | Interface velocity from Riemann solver | |
| rho_a | Density of particle a | |
| rho_b | Density of particle b | |
| omega_a | Grad-h correction factor for particle a | |
| omega_b | Grad-h correction factor for particle b | |
| Fab_a | Kernel gradient magnitude |nabla W_ab(h_a)| | |
| Fab_b | Kernel gradient magnitude |nabla W_ab(h_b)| | |
| r_ab_unit | Unit vector from a to b (points toward b) | |
| v_a | Velocity of particle a | |
| [out] | dv_dt | Accumulated acceleration |
| [out] | du_dt | Accumulated energy rate |
Definition at line 119 of file forces.hpp.
Here is the call graph for this function:
|
inline |
Compute GSPH energy equation contribution.
Following Cha & Whitworth (2003), the energy equation uses the same symmetric force as the momentum equation: f_ab = m_b * p* * (nabla_W_a / (rho_a^2 * Omega_a) + nabla_W_b / (rho_b^2 * Omega_b)) du_a/dt = -f_ab dot (v* - v_a)
This ensures proper energy conservation in shocks by using the same force that appears in the momentum equation.
| Tvec | Vector type |
| Tscal | Scalar type |
| m_b | Mass of particle b |
| p_star | Interface pressure from Riemann solver |
| v_star | Interface velocity (scalar, in direction of r_ab) |
| rho_a_sq | Density squared of particle a |
| rho_b_sq | Density squared of particle b |
| omega_a | Grad-h correction factor for particle a |
| omega_b | Grad-h correction factor for particle b |
| v_a | Velocity of particle a |
| r_ab_unit | Unit vector from a to b |
| nabla_W_a | Kernel gradient at r_ab with smoothing length h_a |
| nabla_W_b | Kernel gradient at r_ab with smoothing length h_b |
Definition at line 68 of file forces.hpp.
Here is the call graph for this function: