Thermal engine improvements
This MR introduces the following enhancements to the ThermalEngine.
-
Pure thermal analyses: The purpose is to enable the use of the ThermalEngine independently of the FlowEngine, allowing for pure thermal simulations including periodic boundaries. For this, a new flag attribute flowEngine is added to the ThermalEngine, which can be set from Python. Its default value is True, but when set to False, all fluid-related operations are skipped.
-
Fixed mass/momentum conservation during thermal expansion: When particles expand thermally, their radii were updated in thermalExpansion(), but not their density and moment of inertia. As a result, during temperature updates in computeNewParticleTemperatures(), particle mass was computed with the new volume and a constant density, leading to a different mass. Now, the moment of inertia is updated with the new particle size; however, density remains constant, as it is a shared property among multiple particles, either through state.thermalMass or particleDensity. Therefore, a new state attribute thermalMass is introduced, which is set in setInitialValues() for each particle, using either state.thermalMass or particleDensity. This constant thermalMass is then used in all thermal calculations, including temperature update. Attention to the fact that density should not be used to compute particle mass during the simulation, as this would violate mass conservation when thermal expansion is active.
-
Individual thermal properties for particles: Initial values of temperature (state.temp), conductivity (state.k), heat capacity (state.Cp), and expansion coefficient (state.alpha) can now be set individually for each particle from Python, instead of assigning the same value (from global properties: particleT0, particleK, particleCp, particleAlpha) to all particles in setInitialValues(). The adopted convention is: if a global property is set to NaN, the value assigned to the state attribute in Python is preserved. In addition, a new flag attribute particleExpansion was created for the ThermalEngine. This flag is True if any particle has state.alpha!=0 and is used to verify whether thermal expansion effects should be computed, instead of making this verification through the global property particleAlpha.
-
Solid-solid conduction model: The formula for the Batchelor & O'Brien (BoB) heat conduction model has been implemented in computeSolidSolidFluxes(). Therefore, a new flag attribute useBoBMethod was created for the ThermalEngine in order to enable the use of this model.
-
New check test for ThermalEngine: The previous thermal engine check test, originally named checkThermalEngine, has been renamed to checkThermalFlowEngine, as it is testing a problem using both the ThermalEngine and the FlowEngine. A new check test checkThermalEngine has been added to validate purely thermal simulations in a periodic domain.