Xiangyu-Hu / SPHinXsys

SPHinXsys provides C++ APIs for engineering simulation and optimization. It aims at complex systems driven by fluid, structure, multi-body dynamics and beyond. The multi-physics library is based on a unique and unified computational framework by which strong coupling has been achieved for all involved physics.
https://xiangyu-hu.github.io/SPHinXsys/
Apache License 2.0
316 stars 233 forks source link

Modified algorithm for heat flow calculation #498

Open Harmon9802 opened 10 months ago

Harmon9802 commented 10 months ago

Describe the bug The right hand side of diffusiondt 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:

  1. Go to 'diffusion_dynamics.hpp'.
  2. Scroll down to 'DiffusionRelaxation<Robin<...>>' for example.
  3. Find two functions inside of the class ”getDiffusionChangeRateRobin“ and "interaction".
  4. Check the algorithm of diffusiondt.

Modified algorithm The modified diffusion_dt_m should be: diffusion_dt_m = diffusiondt * 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.

DrChiZhang commented 10 months ago

Please check the thermal_diffusion branch, where more general thermal dynamics equations are solved.

Xiangyu-Hu commented 7 months ago

@DrChiZhang could you make a pull request if you think the changes are done?

DrChiZhang commented 7 months ago

@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.