From 2b514d03021c43427a8db4b976d570ab6d05daca Mon Sep 17 00:00:00 2001 From: hamidrezanorouzi Date: Sat, 3 Dec 2022 12:12:56 +0330 Subject: [PATCH] first modifications for coupling --- DEMSystems/CMakeLists.txt | 11 ++ DEMSystems/sphereDEMSystem/sphereDEMSystem.C | 27 ++++ DEMSystems/sphereDEMSystem/sphereDEMSystem.H | 86 +++++++++++++ solvers/iterateGeometry/CMakeLists.txt | 2 +- solvers/iterateGeometry/iterateGeometry.C | 18 ++- solvers/sphereGranFlow/CMakeLists.txt | 2 +- solvers/sphereGranFlow/sphereGranFlow.C | 3 + src/phasicFlow/repository/Time/Time.C | 31 +++++ src/phasicFlow/repository/Time/Time.H | 8 ++ src/phasicFlow/repository/Time/timeControl.C | 44 +++++++ src/phasicFlow/repository/Time/timeControl.H | 28 +++- .../repository/systemControl/systemControl.C | 92 +++++++++---- .../repository/systemControl/systemControl.H | 23 +++- .../repository/systemControl/timeFolder.H | 45 ++++++- src/phasicFlow/streams/Stream/Istream.C | 2 +- src/phasicFlow/streams/iStream/iIstream.C | 20 ++- src/phasicFlow/streams/iStream/iIstream.H | 4 +- src/phasicFlow/streams/token/token.H | 2 + src/phasicFlow/streams/token/tokenI.H | 10 ++ .../types/basicTypes/bTypesFunctions.C | 21 +++ .../types/basicTypes/bTypesFunctions.H | 3 + src/setHelpers/initialize_Control.H | 21 ++- utilities/Utilities/CMakeLists.txt | 1 + utilities/Utilities/readControlDict.C | 121 ++++++++++++++++++ utilities/Utilities/readControlDict.H | 87 +++++++++++++ utilities/geometryPhasicFlow/CMakeLists.txt | 2 +- .../geometryPhasicFlow/geometryPhasicFlow.C | 17 +++ utilities/pFlowToVTK/pFlowToVTK.C | 4 + utilities/particlesPhasicFlow/CMakeLists.txt | 2 +- .../particlesPhasicFlow/particlesPhasicFlow.C | 8 +- .../postprocessPhasicFlow.C | 3 + 31 files changed, 701 insertions(+), 47 deletions(-) create mode 100644 DEMSystems/CMakeLists.txt create mode 100644 DEMSystems/sphereDEMSystem/sphereDEMSystem.C create mode 100644 DEMSystems/sphereDEMSystem/sphereDEMSystem.H create mode 100644 utilities/Utilities/readControlDict.C create mode 100644 utilities/Utilities/readControlDict.H diff --git a/DEMSystems/CMakeLists.txt b/DEMSystems/CMakeLists.txt new file mode 100644 index 00000000..dde2d20a --- /dev/null +++ b/DEMSystems/CMakeLists.txt @@ -0,0 +1,11 @@ + +set(SourceFiles +sphereDEMSystem/sphereDEMSystem.C +) + +set(link_libs Kokkos::kokkos phasicFlow Particles Geometry Property Interaction Interaction) + +pFlow_add_library_install(DEMSystems SourceFiles link_libs) + + + diff --git a/DEMSystems/sphereDEMSystem/sphereDEMSystem.C b/DEMSystems/sphereDEMSystem/sphereDEMSystem.C new file mode 100644 index 00000000..91e345b6 --- /dev/null +++ b/DEMSystems/sphereDEMSystem/sphereDEMSystem.C @@ -0,0 +1,27 @@ +/*------------------------------- 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 "sphereDEMSystem.H" + + +pFlow::sphereDEMSystem::sphereDEMSystem() +{ + +} \ No newline at end of file diff --git a/DEMSystems/sphereDEMSystem/sphereDEMSystem.H b/DEMSystems/sphereDEMSystem/sphereDEMSystem.H new file mode 100644 index 00000000..4028d5b5 --- /dev/null +++ b/DEMSystems/sphereDEMSystem/sphereDEMSystem.H @@ -0,0 +1,86 @@ +/*------------------------------- 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. + +-----------------------------------------------------------------------------*/ + +#ifndef __sphereDEMSystem_H__ +#define __sphereDEMSystem_H__ + +#include "systemControl.H" +#include "property.H" +#include "uniquePtr.H" +#include "geometry.H" +#include "sphereParticles.H" +#include "interaction.H" +#include "Insertions.H" + + +namespace pFlow +{ + +class sphereDEMSystem +{ +protected: + + systemControl Control_; + + uniquePtr property_ = nullptr; + + uniquePtr geometry_ = nullptr; + + uniquePtr particles_ = nullptr; + + uniquePtr interaction_ = nullptr; + + uniquePtr insertion_ = nullptr; + + auto& Control() + { + return Control_; + } + + auto& Property() + { + return property_(); + } + + auto& Geometry() + { + return geometry_(); + } + + auto& Particles() + { + return particles_(); + } + + auto& Interaction() + { + return interaction_(); + } + +public: + + sphereDEMSystem(); + +}; + + +} // pFlow + +#endif \ No newline at end of file diff --git a/solvers/iterateGeometry/CMakeLists.txt b/solvers/iterateGeometry/CMakeLists.txt index baf770a1..bbf408c9 100644 --- a/solvers/iterateGeometry/CMakeLists.txt +++ b/solvers/iterateGeometry/CMakeLists.txt @@ -2,6 +2,6 @@ set(source_files iterateGeometry.C ) -set(link_lib phasicFlow Geometry MotionModel Kokkos::kokkos) +set(link_lib phasicFlow Geometry MotionModel Kokkos::kokkos Utilities) pFlow_make_executable_install(iterateGeometry source_files link_lib) diff --git a/solvers/iterateGeometry/iterateGeometry.C b/solvers/iterateGeometry/iterateGeometry.C index f2816916..b777d442 100755 --- a/solvers/iterateGeometry/iterateGeometry.C +++ b/solvers/iterateGeometry/iterateGeometry.C @@ -20,12 +20,28 @@ Licence: #include "systemControl.H" #include "geometryMotion.H" +#include "commandLine.H" +#include "readControlDict.H" - +using pFlow::commandLine; int main( int argc, char* argv[] ) { +commandLine cmds( + "iterateGeometry", + "Performs simulation without particles, only geometry is solved"); + + + bool isCoupling = false; + cmds.add_flag( + "-c,--coupling", + isCoupling, + "Is this a fluid-particle coupling simulation?"); + + if(!cmds.parse(argc, argv)) return 0; + + // this should be palced in each main #include "initialize_Control.H" diff --git a/solvers/sphereGranFlow/CMakeLists.txt b/solvers/sphereGranFlow/CMakeLists.txt index c008c4e2..e1bc5486 100644 --- a/solvers/sphereGranFlow/CMakeLists.txt +++ b/solvers/sphereGranFlow/CMakeLists.txt @@ -2,6 +2,6 @@ set(source_files sphereGranFlow.C ) -set(link_lib Kokkos::kokkos phasicFlow Particles Geometry Property Interaction Interaction) +set(link_lib Kokkos::kokkos phasicFlow Particles Geometry Property Interaction Interaction Utilities) pFlow_make_executable_install(sphereGranFlow source_files link_lib) diff --git a/solvers/sphereGranFlow/sphereGranFlow.C b/solvers/sphereGranFlow/sphereGranFlow.C index a2bd53e7..2cf94601 100755 --- a/solvers/sphereGranFlow/sphereGranFlow.C +++ b/solvers/sphereGranFlow/sphereGranFlow.C @@ -26,6 +26,7 @@ Licence: #include "contactSearch.H" #include "sphereInteraction.H" #include "commandLine.H" +#include "readControlDict.H" using pFlow::output; using pFlow::endl; @@ -47,6 +48,8 @@ commandLine cmds( "DEM solver for non-cohesive spherical particles with particle insertion " "mechanism and moving geometry"); +bool isCoupling = false; + if(!cmds.parse(argc, argv)) return 0; // this should be palced in each main diff --git a/src/phasicFlow/repository/Time/Time.C b/src/phasicFlow/repository/Time/Time.C index 44a0077c..4808adee 100644 --- a/src/phasicFlow/repository/Time/Time.C +++ b/src/phasicFlow/repository/Time/Time.C @@ -47,6 +47,37 @@ pFlow::Time::Time } +pFlow::Time::Time( + repository* owner, + dictionary& setiingsDict, + real startTime, + real endTime, + real saveInterval, + word startTimeName) +: + repository("Time", "", owner), + timeControl( + setiingsDict, + startTime, + endTime, + saveInterval, + startTimeName), + geometry_ + ( + geometryRepository_, + geometryFolder__, + this + ), + integration_ + ( + integrationRepository__, + integrationFolder__, + this + ) +{ + +} + bool pFlow::Time::write ( bool verbose diff --git a/src/phasicFlow/repository/Time/Time.H b/src/phasicFlow/repository/Time/Time.H index dc3c19c6..0cb3fd43 100644 --- a/src/phasicFlow/repository/Time/Time.H +++ b/src/phasicFlow/repository/Time/Time.H @@ -55,6 +55,14 @@ public: // Constructor with owner and settings dict Time( repository* owner, const dictionary& setiingsDict); + Time( + repository* owner, + dictionary& setiingsDict, + real startTime, + real endTime, + real saveInterval, + word startTimeName); + //// - Methods virtual fileSystem localPath()const diff --git a/src/phasicFlow/repository/Time/timeControl.C b/src/phasicFlow/repository/Time/timeControl.C index 87891d6e..ba05a744 100644 --- a/src/phasicFlow/repository/Time/timeControl.C +++ b/src/phasicFlow/repository/Time/timeControl.C @@ -63,13 +63,47 @@ pFlow::timeControl::timeControl ) { + checkForOutputToFile(); +} +pFlow::timeControl::timeControl( + dictionary& dict, + real startTime, + real endTime, + real saveInterval, + word startTimeName) +: + dt_ + ( + dict.getVal("dt") + ), + startTime_(startTime), + endTime_(endTime), + currentTime_(startTime_), + saveInterval_(saveInterval), + lastSaved_(startTime_), + currentIter_(0), + timePrecision_ + ( + dict.getValOrSet("timePrecision", 4) + ), + managedExternaly_(true), + timeName_(startTimeName), + timersReportInterval_ + ( + startTime_, + dict.getValOrSet("timersReportInterval", 0.04) + ) +{ checkForOutputToFile(); } void pFlow::timeControl::checkForOutputToFile() { + + if(managedExternaly_) return; + bool save = false; if ( abs(currentTime_ - lastSaved_ - saveInterval_) < 0.5 * dt_ ) @@ -92,4 +126,14 @@ bool pFlow::timeControl::timersReportTime()const return timersReportInterval_.isMember(currentTime_, dt_); } +void pFlow::timeControl::setSaveTimeFolder( + bool saveToFile, + const word& timeName) +{ + if(managedExternaly_) + { + outputToFile_ = saveToFile; + timeName_ = timeName; + } +} diff --git a/src/phasicFlow/repository/Time/timeControl.H b/src/phasicFlow/repository/Time/timeControl.H index 1f81215d..a8d393b9 100644 --- a/src/phasicFlow/repository/Time/timeControl.H +++ b/src/phasicFlow/repository/Time/timeControl.H @@ -65,6 +65,10 @@ protected: // - time precision for output time folders int32 timePrecision_; + bool managedExternaly_ = false; + + word timeName_ = "wrongSettings"; + realStridedRange timersReportInterval_; int32StridedRagne screenReportInterval_ ={0,100}; @@ -78,6 +82,13 @@ protected: public: timeControl(const dictionary& dict); + + timeControl( + dictionary& dict, + real startTime, + real endTime, + real saveInterval, + word startTimeName); virtual ~timeControl() {} @@ -103,9 +114,19 @@ public: return currentTime_; } - word currentTimeWord() const + word currentTimeWord(bool forSave = true)const { - return real2FixedStripZeros( currentTime(), timePrecision());; + if(forSave) + { + if(!managedExternaly_) + return real2FixedStripZeros( currentTime(), timePrecision()); + else + return timeName_; + } + else + { + return real2FixedStripZeros( currentTime(), timePrecision()); + } } int32 currentIter()const @@ -145,6 +166,9 @@ public: return true; } + void setSaveTimeFolder( + bool saveToFile, + const word& timeName = "wrongTimeFolder"); int32 timePrecision()const { diff --git a/src/phasicFlow/repository/systemControl/systemControl.C b/src/phasicFlow/repository/systemControl/systemControl.C index 3226f837..e3742dd5 100644 --- a/src/phasicFlow/repository/systemControl/systemControl.C +++ b/src/phasicFlow/repository/systemControl/systemControl.C @@ -154,6 +154,75 @@ pFlow::systemControl::systemControl writeToFileTimer_("Write to file", &timers_) {} +pFlow::systemControl::systemControl( + const real startTime, + const real endTime, + const real saveInterval, + const word startTimeName, + const fileSystem path) +: + repository + ( + "systemControl", + path, // local path + nullptr // no owner + ), + runName_ + ( + getRunName(path) + ), + topLevelFolder_ + ( + getTopFolder(path) + ), + settings_ + ( + settingsRepository__, + settingsFolder__, + this + ), + caseSetup_ + ( + caseSetupRepository__, + caseSetupFolder__, + this + ), + settingsDict_ + ( + settings().emplaceObject + ( + objectFile + ( + settingsFile__, + "", + objectFile::READ_ALWAYS, + objectFile::WRITE_NEVER + ), + settingsFile__, + true + ) + ), + Time_ + ( + this, + settingsDict_ + ), + externalTimeControl_(true), + g_( + settingsDict_.getVal("g") + ), + domain_( + settingsDict_.subDict("domain") + ), + timers_(runName_), + timersReport_ + ( + settingsDict_.getValOrSet("timersReport", Logical("Yes")) + ), + writeToFileTimer_("Write to file", &timers_) +{} + + bool pFlow::systemControl::operator ++(int) { @@ -188,27 +257,4 @@ bool pFlow::systemControl::operator ++(int) } -pFlow::Map - pFlow::systemControl::getTimeFolders()const -{ - Map tFolders; - auto subDirs = subDirectories(this->path()); - - for(auto& subD: subDirs) - { - auto timeName = tailName(subD.wordPath(), '/'); - real TIME; - if( auto success = readReal(timeName, TIME); success) - { - if(!tFolders.insertIf(TIME, subD)) - { - fatalErrorInFunction<< - " duplicate time folder! time = " << TIME < getTimeFolders()const; + void setSaveTimeFolder( + bool saveToFile, + const word& timeName = "wrongTimeFolder") + { + Time_.setSaveTimeFolder(saveToFile, timeName); + } }; diff --git a/src/phasicFlow/repository/systemControl/timeFolder.H b/src/phasicFlow/repository/systemControl/timeFolder.H index b8d5a554..e605158a 100644 --- a/src/phasicFlow/repository/systemControl/timeFolder.H +++ b/src/phasicFlow/repository/systemControl/timeFolder.H @@ -27,13 +27,13 @@ Licence: namespace pFlow { +Map getTimeFolders(const fileSystem& path); class timeFolder { using timeList = Map; protected: - const systemControl& control_; - + timeList folders_; timeList::iterator currentFolder_; @@ -41,12 +41,19 @@ protected: public: - timeFolder(const systemControl& control ): - control_(control), - folders_(control.getTimeFolders()), - currentFolder_(folders_.begin()) + timeFolder(const systemControl& control ) + : + timeFolder(control.path()) {} + timeFolder(const fileSystem& path) + : + folders_(getTimeFolders(path)), + currentFolder_(folders_.begin()) + { + + } + real time()const { return currentFolder_->first; @@ -108,6 +115,32 @@ public: } }; +inline +Map getTimeFolders(const fileSystem& path) +{ + Map tFolders; + + auto subDirs = subDirectories(path); + + for(auto& subD: subDirs) + { + auto timeName = tailName(subD.wordPath(), '/'); + real TIME; + if( auto success = readReal(timeName, TIME); success) + { + if(!tFolders.insertIf(TIME, subD)) + { + fatalErrorInFunction<< + " duplicate time folder! time = " << TIME < ControlPtr = nullptr; + +if(isCoupling) +{ + pFlow::readControlDict controlDict; + + ControlPtr = pFlow::makeUnique + ( + controlDict.startTime(), + controlDict.endTime(), + controlDict.saveInterval(), + controlDict.startTimeName() + ); +} +else +{ + ControlPtr = pFlow::makeUnique(); +} + +auto& Control = ControlPtr(); #endif diff --git a/utilities/Utilities/CMakeLists.txt b/utilities/Utilities/CMakeLists.txt index 3f3df352..25dc5f36 100644 --- a/utilities/Utilities/CMakeLists.txt +++ b/utilities/Utilities/CMakeLists.txt @@ -2,6 +2,7 @@ set(SourceFiles vtkFile.C readFromTimeFolder.C +readControlDict.C ) set(link_libs Kokkos::kokkos phasicFlow Particles Geometry) diff --git a/utilities/Utilities/readControlDict.C b/utilities/Utilities/readControlDict.C new file mode 100644 index 00000000..32ea1974 --- /dev/null +++ b/utilities/Utilities/readControlDict.C @@ -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. + +-----------------------------------------------------------------------------*/ +#include "readControlDict.H" +#include "iFstream.H" +#include "timeFolder.H" + +pFlow::word pFlow::readControlDict::convertTimeToName( + const real t, + const int32 precision)const +{ + std::ostringstream buf; + if( formatType_ == "general") + buf.setf(ios_base::fmtflags(0), ios_base::floatfield); + else if(formatType_ == "scientific") + buf.setf(ios_base::fmtflags(ios_base::scientific), ios_base::floatfield); + else if(formatType_ == "fixed") + buf.setf(ios_base::fmtflags(ios_base::fixed), ios_base::floatfield); + else + { + fatalErrorInFunction<<"the timeFormat is not correct, it should be " + " (genral, scientific, fixe) but you supplied "<< formatType_<("timeFormat", "general"); + + precision_ = cdFile.lookupDataOrSet("timePrecision", 6); + + return true; +} + +pFlow::readControlDict::readControlDict( + const fileSystem& rootPath, + const fileSystem& cdPath) +: + rootPath_(rootPath), + cdPath_(cdPath) +{ + + if(!read()) + { + fatalExit; + } +} \ No newline at end of file diff --git a/utilities/Utilities/readControlDict.H b/utilities/Utilities/readControlDict.H new file mode 100644 index 00000000..3ff6bab8 --- /dev/null +++ b/utilities/Utilities/readControlDict.H @@ -0,0 +1,87 @@ +/*------------------------------- 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. + +-----------------------------------------------------------------------------*/ + +#ifndef __readControlDict_H__ +#define __readControlDict_H__ + +#include "fileSystem.H" + + +namespace pFlow +{ + +class +readControlDict +{ +protected: + + fileSystem rootPath_; + + fileSystem cdPath_; + + real startTime_; + + real endTime_; + + real saveInterval_; + + word formatType_; + + int32 precision_; + + inline static fileSystem defaultRootPath = CWD(); + inline static fileSystem defaultCDPath = CWD()/"system"+"controlDict"; + + word convertTimeToName(const real t, const int32 precision)const; + + bool read(); + +public: + + readControlDict( + const fileSystem& rootPath = defaultRootPath, + const fileSystem& cdPath = defaultCDPath); + + auto startTime()const + { + return startTime_; + } + + auto endTime()const + { + return endTime_; + } + + auto saveInterval()const + { + return saveInterval_; + } + + auto startTimeName()const + { + return convertTimeToName(startTime_, precision_); + } + +}; + +} + +#endif //__readControlDict_H__ + diff --git a/utilities/geometryPhasicFlow/CMakeLists.txt b/utilities/geometryPhasicFlow/CMakeLists.txt index d82f8cd2..47e91685 100644 --- a/utilities/geometryPhasicFlow/CMakeLists.txt +++ b/utilities/geometryPhasicFlow/CMakeLists.txt @@ -7,6 +7,6 @@ stlWall/stlWall.C cylinderWall/cylinderWall.C cuboidWall/cuboidWall.C ) -set(link_lib phasicFlow Geometry Kokkos::kokkos) +set(link_lib phasicFlow Geometry Kokkos::kokkos Utilities) pFlow_make_executable_install(geometryPhasicFlow source_files link_lib) diff --git a/utilities/geometryPhasicFlow/geometryPhasicFlow.C b/utilities/geometryPhasicFlow/geometryPhasicFlow.C index 76092834..8265998c 100755 --- a/utilities/geometryPhasicFlow/geometryPhasicFlow.C +++ b/utilities/geometryPhasicFlow/geometryPhasicFlow.C @@ -23,6 +23,8 @@ Licence: #include "Wall.H" #include "multiTriSurface.H" #include "geometryMotion.H" +#include "commandLine.H" +#include "readControlDict.H" using pFlow::output; using pFlow::endl; @@ -33,10 +35,25 @@ using pFlow::wordVector; using pFlow::Wall; using pFlow::geometry; using pFlow::multiTriSurface; +using pFlow::commandLine; int main( int argc, char* argv[] ) { + commandLine cmds( + "geometryPhasicFlow", + "Converts the supplied informaiton for sufraces in" + " geometryDict into PhasicFlow geometry data structure"); + + + bool isCoupling = false; + cmds.add_flag( + "-c,--coupling", + isCoupling, + "Is this a fluid-particle coupling simulation?"); + + if(!cmds.parse(argc, argv)) return 0; + // this should be palced in each main #include "initialize_Control.H" diff --git a/utilities/pFlowToVTK/pFlowToVTK.C b/utilities/pFlowToVTK/pFlowToVTK.C index 8064c7cd..42998afd 100755 --- a/utilities/pFlowToVTK/pFlowToVTK.C +++ b/utilities/pFlowToVTK/pFlowToVTK.C @@ -25,6 +25,8 @@ Licence: #include "timeFolder.H" #include "commandLine.H" #include "ranges.H" +#include "readControlDict.H" + using pFlow::word; using pFlow::wordVector; @@ -80,6 +82,8 @@ int main(int argc, char** argv ) "a space separated lists of time folders, or a strided range begin:stride:end, or an interval begin:end", " "); + bool isCoupling = false; + if(!cmds.parse(argc, argv)) return 0; diff --git a/utilities/particlesPhasicFlow/CMakeLists.txt b/utilities/particlesPhasicFlow/CMakeLists.txt index ee336506..43e30daf 100644 --- a/utilities/particlesPhasicFlow/CMakeLists.txt +++ b/utilities/particlesPhasicFlow/CMakeLists.txt @@ -6,6 +6,6 @@ positionOrdered/positionOrdered.C positionRandom/positionRandom.C empty/empty.C ) -set(link_lib phasicFlow Kokkos::kokkos Interaction) +set(link_lib phasicFlow Kokkos::kokkos Interaction Utilities) pFlow_make_executable_install(particlesPhasicFlow source_files link_lib) diff --git a/utilities/particlesPhasicFlow/particlesPhasicFlow.C b/utilities/particlesPhasicFlow/particlesPhasicFlow.C index 63683306..a39e3892 100755 --- a/utilities/particlesPhasicFlow/particlesPhasicFlow.C +++ b/utilities/particlesPhasicFlow/particlesPhasicFlow.C @@ -24,6 +24,7 @@ Licence: #include "setFields.H" #include "systemControl.H" #include "commandLine.H" +#include "readControlDict.H" using pFlow::output; using pFlow::endl; @@ -45,7 +46,7 @@ int main( int argc, char* argv[] ) "createParticles", "Read the dictionary createParticles and create particles" " based on the two sub-dictionaries positionParticles and setFields.\n" - "First executespositionParticles and then setFields, except " + "First executes positionParticles and then setFields, except " "otherwise selected in the command line."); @@ -62,6 +63,11 @@ int main( int argc, char* argv[] ) "Exectue the setFields part only. Read the pointStructure from " "time folder and setFields and save the result in the same time folder."); + bool isCoupling = false; + cmds.add_flag( + "-c,--coupling", + isCoupling, + "Is this a fluid-particle coupling simulation"); if(!cmds.parse(argc, argv)) return 0; diff --git a/utilities/postprocessPhasicFlow/postprocessPhasicFlow.C b/utilities/postprocessPhasicFlow/postprocessPhasicFlow.C index c57fe609..1f76a425 100644 --- a/utilities/postprocessPhasicFlow/postprocessPhasicFlow.C +++ b/utilities/postprocessPhasicFlow/postprocessPhasicFlow.C @@ -22,6 +22,7 @@ Licence: #include "timeFolder.H" #include "commandLine.H" #include "ranges.H" +#include "readControlDict.H" #include "postprocess.H" @@ -65,6 +66,8 @@ int main(int argc, char** argv ) withZeroFolder, "Do NOT exclude zero folder from processing time folders"); + bool isCoupling = false; + if(!cmds.parse(argc, argv)) return 0; #include "initialize_Control.H"