Skip to content

Thermal Separated Interaction Files Rev0 - #276

Open
0Arian0 wants to merge 5 commits into
PhasicFlow:mainfrom
0Arian0:heatSphereGranFlow
Open

Thermal Separated Interaction Files Rev0#276
0Arian0 wants to merge 5 commits into
PhasicFlow:mainfrom
0Arian0:heatSphereGranFlow

Conversation

@0Arian0

@0Arian0 0Arian0 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need host view for DEM calculations. should be transferred to DEMSystems part.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be here. it should not be done here. Maybe in thermalSphereParticle class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved all per-mechanism sweep logic out of this function. thermalRadiationMechanism and thermalConductionPFPMechanism each now own a complete, independent 27-cell neighbour traversal in their own files. iterate() here no longer contains any per-pair physics — it only rebuilds the shared mapper and dispatches to whichever mechanism objects exist.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define a parameter in thermoPhysicalInteraction file like "listUpdateInterval" or "neighborListUpdataInterval" or any other proper name.

then here the build() function should happen based on this interval.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new, dedicated neighborListUpdateInterval entry, read unconditionally by thermalInteraction regardless of whether radiation is enabled, since conduction/PFP depend on the same mapper too. mapper_->build() now runs only every neighborListUpdateInterval steps. This is kept as a separate key from radiation's own radUpdateInterval — the two serve different purposes (rebuild cost vs. radiation's own update cadence) even though the names are similar.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use fatalErrorInFunction macro for error report.

and then fatalExit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the warning-and-skip path with fatalErrorInFunction followed by fatalExit.

bool calcPFP = condPfpMech_ && condPfpMech_->pfpEnabled();

thermalKernelTimer_.start();
bool doRadThisStep = hasRad &&

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check should be moved into the radiation objection.

in there keep a history of the source term and in each iteration just copy the history to the the radiation heat source.

but each for example 10th iteration, just perform the actual calculations to update the history.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thermalRadiationMechanism now owns its own step counter and its radUpdateInterval. Its iterate() checks internally: on a non-update step it returns immediately, leaving radSumTemp/ radNumPrt at their last value (the history); on an update step it runs the full sweep and overwrites them.

/// Sum of neighbouring particle temperatures per particle,
/// used by the linearised radiation model (CFD side) [K].
deviceViewType1D<real> radSumTemp_;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use pointFiled, like realPointField and uint32PointField

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

radSumTemp_/radNumPrt_ are now realPointField_D/ uint32PointField_D, owned by thermalSphereParticles (same ownership split as heatSourceCondPP_/heatSourcePFP_). thermalRadiationMechanism receives them as parameters to iterate() and writes into them; it owns no per-particle storage itself.

@0Arian0

0Arian0 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

thermalInteraction — review fixes

Addresses the 5 review comments on thermalInteraction/
thermalRadiationMechanism.

Summary

  • Separation of concerns: thermalInteraction is now a thin
    dispatcher with no per-pair physics of its own. Radiation and
    conduction+PFP each run their own complete, independent 27-cell
    neighbour sweep, in their own files.
  • Two independent update intervals, both mandatory:
    • neighborListUpdateInterval (new): gates how often the shared
      neighbour-search mapper is rebuilt. Read by thermalInteraction
      itself, regardless of whether radiation is enabled, since
      conduction/PFP depend on the same mapper.
    • radUpdateInterval (existing, unchanged in meaning): gates how
      often radiation recomputes its own neighbourhood temperature sum.
      Owned entirely by thermalRadiationMechanism, including its own
      step counter. On a non-update step it simply keeps the previous
      value; on an update step it recomputes.
  • Fatal error handling: a failed mapper rebuild now reports via
    fatalErrorInFunction and stops execution via fatalExit, instead
    of logging a warning and skipping the step.
  • Storage ownership: radSumTemp_/radNumPrt_ are now
    realPointField_D/uint32PointField_D, owned by
    thermalSphereParticles — the same ownership pattern already used
    for heatSourceCondPP_/heatSourcePFP_. thermalRadiationMechanism
    writes into them through the views passed to iterate(); it owns
    no per-particle storage itself.

thermoPhysicalInteraction dictionary

Both intervals are now mandatory (no default):

enableRadiation             No;
radUpdateInterval           10;
radCut                      0.003;
neighborListUpdateInterval  10;
enableConduction            No;
enablePFP                   No;

Files changed

  • thermalInteraction.hpp/.cpp — thin dispatcher; owns
    neighborListUpdateInterval_; no more per-pair physics or
    radiation-specific accessors.
  • thermalRadiationMechanism.hpp/.cpp — owns its own
    radUpdateInterval_ and step counter; self-contained sweep; no
    longer owns any per-particle storage.
  • thermalConductionPFPMechanism.hpp/.cpp — self-contained sweep,
    independent of radiation's file.
  • thermalSphereParticles.hpp/.cpp — added radSumTemp_/
    radNumPrt_ as point fields.
  • thermalSphereDEMSystem.cpp — reads radSumTemp()/radNumPrt()
    directly from the particle container instead of through
    thermalInteraction.

Removed

thermalInteractionKernels.hpp is no longer used and has been
deleted — the shared kernel it defined has been replaced by the two
independent, per-mechanism sweeps described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants