Merge pull request #12 from hamidrezanorouzi/initial-code-pushup

sphereGranFlow added
This commit is contained in:
hamidrezanorouzi 2022-09-05 10:32:43 +04:30 committed by GitHub
commit e6fb388e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 168 additions and 1 deletions

View File

@ -70,7 +70,7 @@ add_subdirectory(${Kokkos_Source_DIR} ${phasicFlow_BINARY_DIR}/kokkos)
add_subdirectory(src) add_subdirectory(src)
#add_subdirectory(solvers) add_subdirectory(solvers)
#add_subdirectory(utilities) #add_subdirectory(utilities)

7
solvers/CMakeLists.txt Normal file
View File

@ -0,0 +1,7 @@
#add_subdirectory(iterateSphereParticles)
#add_subdirectory(iterateGeometry)
add_subdirectory(sphereGranFlow)

View File

@ -0,0 +1,7 @@
set(source_files
sphereGranFlow.C
)
set(link_lib Kokkos::kokkos phasicFlow Particles Geometry Property Interaction Interaction)
pFlow_make_executable_install(sphereGranFlow source_files link_lib)

View File

@ -0,0 +1,48 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
//
Report(0)<<"\nReading sphere particles . . ."<<endReport;
sphereParticles sphParticles(Control, proprties);
//
Report(0)<<"\nCreating particle insertion object . . ."<<endReport;
auto& sphInsertion =
Control.caseSetup().emplaceObject<sphereInsertion>(
objectFile(
insertionFile__,
"",
objectFile::READ_ALWAYS,
objectFile::WRITE_ALWAYS
),
sphParticles,
sphParticles.shapes()
);
Report(0)<<"\nCreating interation model for sphere-sphere contact and sphere-wall contact . . ."<<endReport;
auto interactionPtr = interaction::create(
Control,
sphParticles,
surfGeometry
);
auto& sphInteraction = interactionPtr();

View File

@ -0,0 +1,105 @@
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#include "property.H"
#include "geometry.H"
#include "sphereParticles.H"
#include "Insertions.H"
#include "systemControl.H"
#include "contactSearch.H"
#include "sphereInteraction.H"
#include "commandLine.H"
using pFlow::output;
using pFlow::endl;
using pFlow::property;
using pFlow::sphereParticles;
using pFlow::objectFile;
using pFlow::sphereInsertion;
using pFlow::insertionFile__;
using pFlow::interactionFile__;
using pFlow::contactSearch;
using pFlow::interaction;
using pFlow::commandLine;
int main( int argc, char* argv[])
{
commandLine cmds(
"sphereGranFlow",
"DEM solver for non-cohesive spherical particles with particle insertion "
"mechanism and moving geometry");
if(!cmds.parse(argc, argv)) return 0;
// this should be palced in each main
#include "initialize_Control.H"
#include "setProperty.H"
#include "setSurfaceGeometry.H"
#include "createDEMComponents.H"
Report(0)<<"\nStart of time loop . . .\n"<<endReport;
do
{
Control.timers().start();
if(! sphInsertion.insertParticles(
Control.time().currentTime(),
Control.time().dt() ) )
{
fatalError<<
"particle insertion failed in sphereDFlow solver.\n";
return 1;
}
surfGeometry.beforeIteration();
sphInteraction.beforeIteration();
sphParticles.beforeIteration();
sphInteraction.iterate();
sphParticles.iterate();
surfGeometry.iterate();
sphParticles.afterIteration();
surfGeometry.afterIteration();
Control.timers().end();
}while(Control++);
Report(0)<<"\nEnd of time loop.\n"<<endReport;
// this should be palced in each main
#include "finalize.H"
}