Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions solvers/heatSphereGranFlow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

set(source_files
heatSphereGranFlow.cpp
)
set(link_lib Kokkos::kokkos phasicFlow Particles Geometry Property Interaction Interaction Utilities)

pFlow_make_executable_install(heatSphereGranFlow source_files link_lib)
121 changes: 121 additions & 0 deletions solvers/heatSphereGranFlow/createDEMComponents.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.

phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-----------------------------------------------------------------------------*/

/**
* @file createDEMComponents.hpp
* @brief Initialization sequence for the thermal DEM simulation objects.
*
* @details
* Instantiates the thermal shape, particle container, insertion
* mechanism, and mechanical + thermal interaction models required
* before the main time loop begins.
*/

// ========================================================================= //
// Section 1: Shape & Material Initialization
// ========================================================================= //

REPORT(0) << "Reading thermal shapes dictionary..." << END_REPORT;

/**
* @brief Geometric + thermal shape dictionary.
* Binds per-material thermal data from thermalProperty
* to per-shape geometry properties.
*/
pFlow::thermalSphereShape spheres
(
pFlow::shapeFile__,
&Control.caseSetup(),
proprties // thermalProperty instance from the main solver
);

// ========================================================================= //
// Section 2: Particle Container Initialization
// ========================================================================= //

REPORT(0) << "\nReading thermal sphere particles . . ." << END_REPORT;

/**
* @brief Main GPU-backed thermal particle container.
*/
pFlow::thermalSphereParticles sphParticles
(
Control,
spheres,
spheres
);

// ========================================================================= //
// Section 3: Particle Insertion Mechanism
// ========================================================================= //

REPORT(0) << "\nCreating particle insertion object . . ." << END_REPORT;

/**
* @brief Time-triggered particle injector.
*/
auto sphInsertion = pFlow::sphereInsertion
(
sphParticles,
sphParticles.spheres()
);

// ========================================================================= //
// Section 4: Mechanical Interaction Model
// ========================================================================= //

REPORT(0) << "\nCreating interaction model for sphere-sphere contact . . ."
<< END_REPORT;

/**
* @brief Factory-instantiated contact-force model (e.g., Hertz-Mindlin).
* Handles particle-particle and particle-wall collisions.
*/
auto interactionPtr = pFlow::interaction::create
(
Control,
sphParticles,
surfGeometry
);

auto& sphInteraction = interactionPtr();

// ========================================================================= //
// Section 5: Thermal Interaction Model (Fixed for Standalone Mode)
// ========================================================================= //

REPORT(0) << "\nCreating unified thermal interaction model "
<< "(Conduction, PFP, Radiation) . . ." << END_REPORT;

/**
* @brief Thermal physics dispatcher.
* Computes Q_pp (Batchelor-O'Brien) and particle-particle radiation.
*/
auto thermalIntPtr = pFlow::makeUnique<pFlow::thermalInteraction>
(
Control,
sphParticles,
pFlow::box()
);

auto& thermalInt = thermalIntPtr();



163 changes: 163 additions & 0 deletions solvers/heatSphereGranFlow/heatSphereGranFlow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.

phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-----------------------------------------------------------------------------*/

/**
* @file heatSphereGranFlow.cpp
* @brief Standalone DEM solver for granular flow with heat transfer.
*
* @details
* This solver simulates the granular flow of cohesion-less, spherical
* particles while additionally solving the explicit particle energy
* equation (contact conduction, radiation, and particle-fluid-particle
* sub-grid heat transfer) via Kokkos kernels. It carries no chemical
* reaction capability; for reacting flows, use multiSpeciesGranFlow,
* which extends this same thermal layer.
*
* Note: Q_conv (convection) and Q_pfp (fluid bridge) remain 0.0 since
* the Eulerian fluid mesh does not exist in standalone mode. This mode
* is ideal for unit-testing conduction (Q_pp) and radiation.
*/

#include "vocabs.hpp"
#include "phasicFlowKokkos.hpp"
#include "systemControl.hpp"
#include "commandLine.hpp"
#include "property.hpp"
#include "geometry.hpp"
#include "sphereParticles.hpp"
#include "interaction.hpp"
#include "Insertions.hpp"

// --- Thermal Additions ---
#include "thermalProperty.hpp"
#include "thermalSphereShape.hpp"
#include "thermalSphereParticles.hpp"
#include "thermalInteraction.hpp"

/**
* @brief Main execution entry point for the standalone thermal DEM
* solver.
*/
int main(int argc, char* argv[])
{
// ===================================================================== //
// Section 1: Initialization & CLI Parsing
// ===================================================================== //
pFlow::commandLine cmds
(
"heatSphereGranFlow",
"DEM solver for non-cohesive spherical particles with heat "
"transfer, particle insertion mechanism, and moving geometry."
);

bool isCoupling = false;

if (!cmds.parse(argc, argv)) return 0;

// this should be palced in each main
pFlow::processors::initProcessors(argc, argv);
pFlow::initialize_pFlowProcessors();

#include "initialize_Control.hpp"

// ===================================================================== //
// Section 2: Material & Geometry Setup
// ===================================================================== //

/// Read global thermal properties from the case directory.
auto proprties = pFlow::thermalProperty
(
pFlow::propertyFile__,
Control.caseSetup().path()
);

#include "setSurfaceGeometry.hpp"

#include "createDEMComponents.hpp"

// ===================================================================== //
// Section 3: Solver Capabilities Notice
// ===================================================================== //
REPORT(0)
<< "\n[INFO] Standalone Thermal Mode Active.\n"
<< " Q_pp (contact conduction) : Computed via Kokkos kernel\n"
<< " Q_rad (radiation) : Computed via Kokkos kernel\n"
<< " Q_conv / Q_pfp = 0 (No Eulerian fluid mesh "
<< "present)\n"
<< " No chemical reaction capability in this solver.\n"
<< " Use multiSpeciesGranFlow for reacting flows, or\n"
<< " unresolvedHeatSpherePFPlus for coupled CFD-DEM heat "
<< "transfer.\n"
<< END_REPORT;

// ===================================================================== //
// Section 4: Main Transient Time Loop
// ===================================================================== //
REPORT(0) << "\nStart of time loop . . .\n" << END_REPORT;

do
{
// 4.1 Particle insertion phase
if (!sphInsertion.insertParticles(
Control.time().currentIter(),
Control.time().currentTime(),
Control.time().dt()))
{
fatalError
<< "particle insertion failed in heatSphereGranFlow "
<< "solver.\n";
return 1;
}

// 4.2 Pre-processing updates (reset forces, predict, etc.)
surfGeometry.beforeIteration();
sphParticles.beforeIteration();
sphInteraction.beforeIteration();

// 4.3 Evaluate contact interactions (particle-particle, wall)
sphInteraction.iterate();

// 4.4 Thermal physics (conduction, radiation, PFP)
thermalInt.iterate();

// 4.5 Update boundary kinematics
surfGeometry.iterate();

// 4.6 Update particle kinematics and integrate temperature
sphParticles.iterate();

// 4.7 Post-processing cleanups
sphInteraction.afterIteration();
surfGeometry.afterIteration();
sphParticles.afterIteration();

} while (Control++);

REPORT(0) << "\nEnd of time loop.\n" << END_REPORT;

// this should be palced in each main
#include "finalize.hpp"
pFlow::processors::finalizeProcessors();

return 0;
}



Loading