SPHinXsys
SPHinXsys copied to clipboard
Modified algorithm for heat flow calculation
Describe the bug The right hand side of diffusion_dt_ algorithm in all of diffusion types (Inner, Robin, etc. ) only calculate the rate of heat flow per unit volume (W/m3), we need to multiply a particle volume term to get heat flow (W), then we can use it for heat flux calculation.
Trace to the source Steps to trace the source:
- Go to 'diffusion_dynamics.hpp'.
- Scroll down to 'DiffusionRelaxation<Robin<...>>' for example.
- Find two functions inside of the class ”getDiffusionChangeRateRobin“ and "interaction".
- Check the algorithm of diffusion_dt_.
Modified algorithm The modified diffusion_dt_m should be: diffusion_dt_m = diffusion_dt_ * particle_volume
Additional context However, this bug does not effect the final temperature field calculation, it is only useful if we want to calculate overall heat flow instead of volumetric heat flow.
Please check the thermal_diffusion branch, where more general thermal dynamics equations are solved.
@DrChiZhang could you make a pull request if you think the changes are done?
@DrChiZhang could you make a pull request if you think the changes are done?
Sure, I will try to merge master to this branch first.