From cb1859383007682de4732a64ec95eadb5118df8c Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 10 Apr 2017 11:36:48 +0200 Subject: [PATCH 01/99] add CFDEM_LIGGGHTS_BIN_DIR to cfdemSysTest path must not be empty for building LIGGGHTS via cmake (default) resolves #19 --- src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh b/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh index 3baca4c3..e64b8e95 100755 --- a/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh +++ b/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh @@ -33,6 +33,7 @@ checkDirComment "$CFDEM_SRC_DIR" '$CFDEM_SRC_DIR' "yes" checkDirComment "$CFDEM_SOLVER_DIR" '$CFDEM_SOLVER_DIR' "yes" checkDirComment "$CFDEM_TUT_DIR" '$CFDEM_TUT_DIR' "yes" checkDirComment "$CFDEM_LIGGGHTS_SRC_DIR" '$CFDEM_LIGGGHTS_SRC_DIR' "yes" +checkEnvComment "$CFDEM_LIGGGHTS_BIN_DIR" '$CFDEM_LIGGGHTS_BIN_DIR' "yes" checkDirComment "$CFDEM_LPP_DIR" '$CFDEM_LPP_DIR' "yes" checkDirComment "$CFDEM_ADD_LIBS_DIR" '$CFDEM_ADD_LIBS_DIR' "yes" checkDirComment "$CFDEM_PIZZA_DIR" '$CFDEM_PIZZA_DIR' "no" From fba3a692435a4e2cf79d859eece876c7aa92bb72 Mon Sep 17 00:00:00 2001 From: Gerhard Holzinger Date: Tue, 25 Apr 2017 14:47:07 +0200 Subject: [PATCH 02/99] writing the value field inherited from fixedValue BC; fixing #20 --- .../uniformFixedValueTube/uniformFixedValueTubeFvPatchField.C | 1 + .../uniformFixedValueVoidfractionFvPatchField.C | 1 + 2 files changed, 2 insertions(+) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueTube/uniformFixedValueTubeFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueTube/uniformFixedValueTubeFvPatchField.C index 9787583a..00f0033b 100755 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueTube/uniformFixedValueTubeFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueTube/uniformFixedValueTubeFvPatchField.C @@ -195,6 +195,7 @@ template void uniformFixedValueTubeFvPatchField::write(Ostream& os) const { fvPatchField::write(os); + this->writeEntry("value", os); uniformValue_->writeData(os); os.writeKeyword("tubeLength") << tubeLength_ << token::END_STATEMENT << nl; os.writeKeyword("tubeDiameter") << tubeDiameter_ << token::END_STATEMENT << nl; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueVoidfraction/uniformFixedValueVoidfractionFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueVoidfraction/uniformFixedValueVoidfractionFvPatchField.C index ab88c98a..1608b93a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueVoidfraction/uniformFixedValueVoidfractionFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValueVoidfraction/uniformFixedValueVoidfractionFvPatchField.C @@ -145,6 +145,7 @@ template void uniformFixedValueVoidfractionFvPatchField::write(Ostream& os) const { fvPatchField::write(os); + this->writeEntry("value", os); uniformValue_->writeData(os); } From 57a929dce2547a61b1739f94e90aee58fba5b7c3 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 2 May 2017 16:49:22 +0200 Subject: [PATCH 03/99] move etc directory to CFDEM_PROJECT_DIR --- {src/lagrangian/cfdemParticle/etc => etc}/OFversion/OFversion.H | 0 {src/lagrangian/cfdemParticle/etc => etc}/additionalLibs | 0 {src/lagrangian/cfdemParticle/etc => etc}/bashrc | 0 {src/lagrangian/cfdemParticle/etc => etc}/cfdemSystemTest.sh | 0 {src/lagrangian/cfdemParticle/etc => etc}/cleanCFDEMcoupling.sh | 0 {src/lagrangian/cfdemParticle/etc => etc}/compileCFDEMcoupling.sh | 0 .../cfdemParticle/etc => etc}/compileCFDEMcoupling_all.sh | 0 .../cfdemParticle/etc => etc}/compileCFDEMcoupling_sol.sh | 0 .../cfdemParticle/etc => etc}/compileCFDEMcoupling_src.sh | 0 .../cfdemParticle/etc => etc}/compileCFDEMcoupling_uti.sh | 0 {src/lagrangian/cfdemParticle/etc => etc}/compileLIGGGHTS.sh | 0 {src/lagrangian/cfdemParticle/etc => etc}/compileLIGGGHTS_lib.sh | 0 {src/lagrangian/cfdemParticle/etc => etc}/controlDict_cgs_2.1.x | 0 {src/lagrangian/cfdemParticle/etc => etc}/controlDict_cgs_2.2.x | 0 {src/lagrangian/cfdemParticle/etc => etc}/cshrc | 0 {src/lagrangian/cfdemParticle/etc => etc}/functions.sh | 0 .../cfdemParticle/etc => etc}/library-liggghts-list.txt | 0 {src/lagrangian/cfdemParticle/etc => etc}/library-list.txt | 0 {src/lagrangian/cfdemParticle/etc => etc}/log/dummy | 0 {src/lagrangian/cfdemParticle/etc => etc}/pullLIGGGHTS.sh | 0 {src/lagrangian/cfdemParticle/etc => etc}/solver-list.txt | 0 {src/lagrangian/cfdemParticle/etc => etc}/testTutorials.sh | 0 {src/lagrangian/cfdemParticle/etc => etc}/tutorial-list.txt | 0 {src/lagrangian/cfdemParticle/etc => etc}/utilities-list.txt | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename {src/lagrangian/cfdemParticle/etc => etc}/OFversion/OFversion.H (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/additionalLibs (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/bashrc (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/cfdemSystemTest.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/cleanCFDEMcoupling.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/compileCFDEMcoupling.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/compileCFDEMcoupling_all.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/compileCFDEMcoupling_sol.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/compileCFDEMcoupling_src.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/compileCFDEMcoupling_uti.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/compileLIGGGHTS.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/compileLIGGGHTS_lib.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/controlDict_cgs_2.1.x (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/controlDict_cgs_2.2.x (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/cshrc (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/functions.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/library-liggghts-list.txt (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/library-list.txt (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/log/dummy (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/pullLIGGGHTS.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/solver-list.txt (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/testTutorials.sh (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/tutorial-list.txt (100%) rename {src/lagrangian/cfdemParticle/etc => etc}/utilities-list.txt (100%) diff --git a/src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H b/etc/OFversion/OFversion.H similarity index 100% rename from src/lagrangian/cfdemParticle/etc/OFversion/OFversion.H rename to etc/OFversion/OFversion.H diff --git a/src/lagrangian/cfdemParticle/etc/additionalLibs b/etc/additionalLibs similarity index 100% rename from src/lagrangian/cfdemParticle/etc/additionalLibs rename to etc/additionalLibs diff --git a/src/lagrangian/cfdemParticle/etc/bashrc b/etc/bashrc similarity index 100% rename from src/lagrangian/cfdemParticle/etc/bashrc rename to etc/bashrc diff --git a/src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh b/etc/cfdemSystemTest.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh rename to etc/cfdemSystemTest.sh diff --git a/src/lagrangian/cfdemParticle/etc/cleanCFDEMcoupling.sh b/etc/cleanCFDEMcoupling.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/cleanCFDEMcoupling.sh rename to etc/cleanCFDEMcoupling.sh diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling.sh b/etc/compileCFDEMcoupling.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling.sh rename to etc/compileCFDEMcoupling.sh diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_all.sh b/etc/compileCFDEMcoupling_all.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_all.sh rename to etc/compileCFDEMcoupling_all.sh diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh b/etc/compileCFDEMcoupling_sol.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh rename to etc/compileCFDEMcoupling_sol.sh diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh b/etc/compileCFDEMcoupling_src.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh rename to etc/compileCFDEMcoupling_src.sh diff --git a/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh b/etc/compileCFDEMcoupling_uti.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh rename to etc/compileCFDEMcoupling_uti.sh diff --git a/src/lagrangian/cfdemParticle/etc/compileLIGGGHTS.sh b/etc/compileLIGGGHTS.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/compileLIGGGHTS.sh rename to etc/compileLIGGGHTS.sh diff --git a/src/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh b/etc/compileLIGGGHTS_lib.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh rename to etc/compileLIGGGHTS_lib.sh diff --git a/src/lagrangian/cfdemParticle/etc/controlDict_cgs_2.1.x b/etc/controlDict_cgs_2.1.x similarity index 100% rename from src/lagrangian/cfdemParticle/etc/controlDict_cgs_2.1.x rename to etc/controlDict_cgs_2.1.x diff --git a/src/lagrangian/cfdemParticle/etc/controlDict_cgs_2.2.x b/etc/controlDict_cgs_2.2.x similarity index 100% rename from src/lagrangian/cfdemParticle/etc/controlDict_cgs_2.2.x rename to etc/controlDict_cgs_2.2.x diff --git a/src/lagrangian/cfdemParticle/etc/cshrc b/etc/cshrc similarity index 100% rename from src/lagrangian/cfdemParticle/etc/cshrc rename to etc/cshrc diff --git a/src/lagrangian/cfdemParticle/etc/functions.sh b/etc/functions.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/functions.sh rename to etc/functions.sh diff --git a/src/lagrangian/cfdemParticle/etc/library-liggghts-list.txt b/etc/library-liggghts-list.txt similarity index 100% rename from src/lagrangian/cfdemParticle/etc/library-liggghts-list.txt rename to etc/library-liggghts-list.txt diff --git a/src/lagrangian/cfdemParticle/etc/library-list.txt b/etc/library-list.txt similarity index 100% rename from src/lagrangian/cfdemParticle/etc/library-list.txt rename to etc/library-list.txt diff --git a/src/lagrangian/cfdemParticle/etc/log/dummy b/etc/log/dummy similarity index 100% rename from src/lagrangian/cfdemParticle/etc/log/dummy rename to etc/log/dummy diff --git a/src/lagrangian/cfdemParticle/etc/pullLIGGGHTS.sh b/etc/pullLIGGGHTS.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/pullLIGGGHTS.sh rename to etc/pullLIGGGHTS.sh diff --git a/src/lagrangian/cfdemParticle/etc/solver-list.txt b/etc/solver-list.txt similarity index 100% rename from src/lagrangian/cfdemParticle/etc/solver-list.txt rename to etc/solver-list.txt diff --git a/src/lagrangian/cfdemParticle/etc/testTutorials.sh b/etc/testTutorials.sh similarity index 100% rename from src/lagrangian/cfdemParticle/etc/testTutorials.sh rename to etc/testTutorials.sh diff --git a/src/lagrangian/cfdemParticle/etc/tutorial-list.txt b/etc/tutorial-list.txt similarity index 100% rename from src/lagrangian/cfdemParticle/etc/tutorial-list.txt rename to etc/tutorial-list.txt diff --git a/src/lagrangian/cfdemParticle/etc/utilities-list.txt b/etc/utilities-list.txt similarity index 100% rename from src/lagrangian/cfdemParticle/etc/utilities-list.txt rename to etc/utilities-list.txt From 2a77e96af05c973532428d03d95103ccda8bc0a0 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 2 May 2017 16:51:28 +0200 Subject: [PATCH 04/99] rename dummy file to .gitignore --- etc/log/{dummy => .gitignore} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename etc/log/{dummy => .gitignore} (100%) diff --git a/etc/log/dummy b/etc/log/.gitignore similarity index 100% rename from etc/log/dummy rename to etc/log/.gitignore From 4cbec2cffecb2ea6616ec3c41631f27132aa5418 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 2 May 2017 17:50:02 +0200 Subject: [PATCH 05/99] adjust shell scripts to new etc location --- etc/bashrc | 28 ++++++++++++++-------------- etc/cfdemSystemTest.sh | 2 +- etc/cleanCFDEMcoupling.sh | 2 +- etc/compileCFDEMcoupling.sh | 10 +++++----- etc/compileCFDEMcoupling_all.sh | 10 +++++----- etc/compileCFDEMcoupling_sol.sh | 4 ++-- etc/compileCFDEMcoupling_src.sh | 6 +++--- etc/compileCFDEMcoupling_uti.sh | 4 ++-- etc/compileLIGGGHTS.sh | 6 +++--- etc/compileLIGGGHTS_lib.sh | 6 +++--- etc/cshrc | 26 +++++++++++++------------- etc/functions.sh | 4 ++-- etc/pullLIGGGHTS.sh | 4 ++-- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 3f11759f..7f0e1321 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -24,7 +24,7 @@ #export CFDEM_UT_DIR=$CFDEM_PROJECT_DIR/applications/utilities #export CFDEM_TUT_DIR=$CFDEM_PROJECT_DIR/tutorials #export CFDEM_PROJECT_USER_DIR=$HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION -#export CFDEM_bashrc=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/bashrc +#export CFDEM_bashrc=$CFDEM_PROJECT_DIR/etc/bashrc #export CFDEM_LIGGGHTS_SRC_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src #export CFDEM_LIGGGHTS_BIN_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src-build #export CFDEM_LIGGGHTS_MAKEFILE_NAME=fedora_fpic # obsolete with CMake @@ -56,7 +56,7 @@ export CFDEM_LIB_COMP_NAME=lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSIO #check if additional libraries should be compiled together with solvers if [[ $CFDEM_ADD_LIBS_DIR == "" ]]; then - export CFDEM_ADD_LIBS_DIR=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc + export CFDEM_ADD_LIBS_DIR=$CFDEM_PROJECT_DIR/etc else echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user." fi @@ -94,7 +94,7 @@ export CFDEM_LIB_DIR=$FOAM_USER_LIBBIN export CFDEM_APP_DIR=$FOAM_USER_APPBIN #- path to OF version flag file -export CFDEM_OFVERSION_DIR=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/OFversion +export CFDEM_OFVERSION_DIR=$CFDEM_PROJECT_DIR/etc/OFversion #------------------------------------------------------------------------------ #- settings for lpp postproc tool #------------------------------------------------------------------------------ @@ -142,37 +142,37 @@ alias cfdemDox='firefox $CFDEM_DOC_DIR/doxygen/html/index.html' alias cfdemLIG='cd $CFDEM_LIGGGHTS_SRC_DIR' #- shortcut to system test -alias cfdemSysTest='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh' +alias cfdemSysTest='bash $CFDEM_PROJECT_DIR/etc/cfdemSystemTest.sh' #- shortcut to pull LIGGGHTS -alias cfdemPullLIG='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/pullLIGGGHTS.sh' +alias cfdemPullLIG='bash $CFDEM_PROJECT_DIR/etc/pullLIGGGHTS.sh' #- shortcut to pull CFDEMcoupling -alias cfdemPullCFDEMcoupling='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/pullCFDEMcoupling.sh' +alias cfdemPullCFDEMcoupling='bash $CFDEM_PROJECT_DIR/etc/pullCFDEMcoupling.sh' #- shortcut to clean CFDEM -alias cfdemCleanCFDEM='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/cleanCFDEMcoupling.sh' +alias cfdemCleanCFDEM='bash $CFDEM_PROJECT_DIR/etc/cleanCFDEMcoupling.sh' #- shortcut to compile LIGGGHTS + sublibraries -alias cfdemCompLIG='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileLIGGGHTS.sh' +alias cfdemCompLIG='bash $CFDEM_PROJECT_DIR/etc/compileLIGGGHTS.sh' #- shortcut to compile CFDEMcoupling +LIGGGHTS -alias cfdemCompCFDEMall='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_all.sh' +alias cfdemCompCFDEMall='bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_all.sh' #- shortcut to compile CFDEMcoupling (src+solvers) -alias cfdemCompCFDEM='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling.sh' +alias cfdemCompCFDEM='bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling.sh' #- shortcut to compile CFDEMcoupling src -alias cfdemCompCFDEMsrc='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh' +alias cfdemCompCFDEMsrc='bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_src.sh' #- shortcut to compile CFDEMcoupling solvers -alias cfdemCompCFDEMsol='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh' +alias cfdemCompCFDEMsol='bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_sol.sh' #- shortcut to compile CFDEMcoupling utilities -alias cfdemCompCFDEMuti='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh' +alias cfdemCompCFDEMuti='bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_uti.sh' #- shortcut to test basic tutorials -alias cfdemTestTUT='bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/testTutorials.sh' +alias cfdemTestTUT='bash $CFDEM_PROJECT_DIR/etc/testTutorials.sh' #- shortcut to visualize the clock model data alias vizClock='python $CFDEM_UT_DIR/vizClock/matPlot.py' diff --git a/etc/cfdemSystemTest.sh b/etc/cfdemSystemTest.sh index e64b8e95..3c3e44b3 100755 --- a/etc/cfdemSystemTest.sh +++ b/etc/cfdemSystemTest.sh @@ -6,7 +6,7 @@ #===================================================================# #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #- show gcc settings checkGPP="true" diff --git a/etc/cleanCFDEMcoupling.sh b/etc/cleanCFDEMcoupling.sh index 99008b3c..b8ca631e 100644 --- a/etc/cleanCFDEMcoupling.sh +++ b/etc/cleanCFDEMcoupling.sh @@ -6,7 +6,7 @@ #===================================================================# #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #================================================================================# # clean src remove object files diff --git a/etc/compileCFDEMcoupling.sh b/etc/compileCFDEMcoupling.sh index 9792a1a4..8854966b 100755 --- a/etc/compileCFDEMcoupling.sh +++ b/etc/compileCFDEMcoupling.sh @@ -6,26 +6,26 @@ #===================================================================# #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh NOW="$(date +"%Y-%m-%d-%H:%M")" logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir #================================================================================# # compile src #================================================================================# -bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh +bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_src.sh #================================================================================# # compile solvers #================================================================================# -bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh +bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_sol.sh #================================================================================# # compile utilities #================================================================================# -bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh +bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_uti.sh diff --git a/etc/compileCFDEMcoupling_all.sh b/etc/compileCFDEMcoupling_all.sh index 96c4c91a..aacc641c 100755 --- a/etc/compileCFDEMcoupling_all.sh +++ b/etc/compileCFDEMcoupling_all.sh @@ -7,26 +7,26 @@ #===================================================================# #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh NOW="$(date +"%Y-%m-%d-%H:%M")" logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir #================================================================================# # compile LIGGGHTS src #================================================================================# -bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileLIGGGHTS.sh +bash $CFDEM_PROJECT_DIR/etc/compileLIGGGHTS.sh #================================================================================# # compile LIGGGHTS libraries #================================================================================# -bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh +bash $CFDEM_PROJECT_DIR/etc/compileLIGGGHTS_lib.sh #================================================================================# # compile CFDEMcoupling #================================================================================# -bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling.sh +bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling.sh diff --git a/etc/compileCFDEMcoupling_sol.sh b/etc/compileCFDEMcoupling_sol.sh index 6dbbb3a0..96678146 100755 --- a/etc/compileCFDEMcoupling_sol.sh +++ b/etc/compileCFDEMcoupling_sol.sh @@ -8,9 +8,9 @@ whitelist="solver-list.txt" #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir #- remove old success/fail logs diff --git a/etc/compileCFDEMcoupling_src.sh b/etc/compileCFDEMcoupling_src.sh index a4b531c3..9af4cb54 100755 --- a/etc/compileCFDEMcoupling_src.sh +++ b/etc/compileCFDEMcoupling_src.sh @@ -7,20 +7,20 @@ #===================================================================# #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh NOW="$(date +"%Y-%m-%d-%H:%M")" logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir #================================================================================# # compile src #================================================================================# -whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/library-list.txt" +whitelist="$CFDEM_PROJECT_DIR/etc/library-list.txt" echo "" echo "Please provide the libraries to be compiled in the $CWD/$whitelist file." diff --git a/etc/compileCFDEMcoupling_uti.sh b/etc/compileCFDEMcoupling_uti.sh index d4e0306e..6efddf2a 100644 --- a/etc/compileCFDEMcoupling_uti.sh +++ b/etc/compileCFDEMcoupling_uti.sh @@ -8,9 +8,9 @@ whitelist="utilities-list.txt" #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir CWD="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" diff --git a/etc/compileLIGGGHTS.sh b/etc/compileLIGGGHTS.sh index a5c35c54..2c627888 100755 --- a/etc/compileLIGGGHTS.sh +++ b/etc/compileLIGGGHTS.sh @@ -6,12 +6,12 @@ #=================================================================== #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh NOW="$(date +"%Y-%m-%d-%H:%M")" logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir #================================================================================# @@ -38,4 +38,4 @@ compileLIGGGHTS $logpath $logfileName $headerText #================================================================================# # compile LIGGGHTS libraries #================================================================================# -bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileLIGGGHTS_lib.sh +bash $CFDEM_PROJECT_DIR/etc/compileLIGGGHTS_lib.sh diff --git a/etc/compileLIGGGHTS_lib.sh b/etc/compileLIGGGHTS_lib.sh index 4461d7de..4725f09b 100755 --- a/etc/compileLIGGGHTS_lib.sh +++ b/etc/compileLIGGGHTS_lib.sh @@ -6,19 +6,19 @@ #===================================================================# #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh NOW="$(date +"%Y-%m-%d-%H:%M")" logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir #================================================================================# # compile src #================================================================================# - whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/library-liggghts-list.txt" + whitelist="$CFDEM_PROJECT_DIR/etc/library-liggghts-list.txt" echo "" echo "Compiling sub-libraries of LIGGGHTS now..." echo "Please provide the libraries to be compiled in the $CWD/$whitelist file." diff --git a/etc/cshrc b/etc/cshrc index 54154dfb..15374dcd 100755 --- a/etc/cshrc +++ b/etc/cshrc @@ -24,7 +24,7 @@ #setenv CFDEM_UT_DIR $CFDEM_PROJECT_DIR/applications/utilities #setenv CFDEM_TUT_DIR $CFDEM_PROJECT_DIR/tutorials #setenv CFDEM_PROJECT_USER_DIR $HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION -#setenv CFDEM_bashrc $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/cshrc +#setenv CFDEM_bashrc $CFDEM_PROJECT_DIR/etc/cshrc #setenv CFDEM_LIGGGHTS_SRC_DIR $HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src #setenv CFDEM_LIGGGHTS_MAKEFILE_NAME fedora_fpic #setenv CFDEM_LPP_DIR $HOME/LIGGGHTS/mylpp/src @@ -55,7 +55,7 @@ setenv CFDEM_LIB_COMP_NAME lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSIO #check if additional libraries should be compiled together with solvers if ( ! ($?CFDEM_ADD_LIBS_DIR) ) then - setenv CFDEM_ADD_LIBS_DIR $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc + setenv CFDEM_ADD_LIBS_DIR $CFDEM_PROJECT_DIR/etc else echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user." endif @@ -131,37 +131,37 @@ alias cfdemDox 'firefox $CFDEM_DOC_DIR/doxygen/html/index.html' alias cfdemLIG 'cd $CFDEM_LIGGGHTS_SRC_DIR' #- shortcut to system test -alias cfdemSysTest 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/cfdemSystemTest.sh' +alias cfdemSysTest 'bash $CFDEM_PROJECT_DIR/etc/cfdemSystemTest.sh' #- shortcut to pull LIGGGHTS -alias cfdemPullLIG 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/pullLIGGGHTS.sh' +alias cfdemPullLIG 'bash $CFDEM_PROJECT_DIR/etc/pullLIGGGHTS.sh' #- shortcut to pull CFDEMcoupling -alias cfdemPullCFDEMcoupling 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/pullCFDEMcoupling.sh' +alias cfdemPullCFDEMcoupling 'bash $CFDEM_PROJECT_DIR/etc/pullCFDEMcoupling.sh' #- shortcut to clean CFDEM -alias cfdemCleanCFDEM 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/cleanCFDEMcoupling.sh' +alias cfdemCleanCFDEM 'bash $CFDEM_PROJECT_DIR/etc/cleanCFDEMcoupling.sh' #- shortcut to compile LIGGGHTS + sublibraries -alias cfdemCompLIG 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileLIGGGHTS.sh' +alias cfdemCompLIG 'bash $CFDEM_PROJECT_DIR/etc/compileLIGGGHTS.sh' #- shortcut to compile CFDEMcoupling +LIGGGHTS -alias cfdemCompCFDEMall 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_all.sh' +alias cfdemCompCFDEMall 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_all.sh' #- shortcut to compile CFDEMcoupling (src+solvers) -alias cfdemCompCFDEM 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling.sh' +alias cfdemCompCFDEM 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling.sh' #- shortcut to compile CFDEMcoupling src -alias cfdemCompCFDEMsrc 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_src.sh' +alias cfdemCompCFDEMsrc 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_src.sh' #- shortcut to compile CFDEMcoupling solvers -alias cfdemCompCFDEMsol 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_sol.sh' +alias cfdemCompCFDEMsol 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_sol.sh' #- shortcut to compile CFDEMcoupling utilities -alias cfdemCompCFDEMuti 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/compileCFDEMcoupling_uti.sh' +alias cfdemCompCFDEMuti 'bash $CFDEM_PROJECT_DIR/etc/compileCFDEMcoupling_uti.sh' #- shortcut to test basic tutorials -alias cfdemTestTUT 'bash $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/testTutorials.sh' +alias cfdemTestTUT 'bash $CFDEM_PROJECT_DIR/etc/testTutorials.sh' #- shortcut to visualize the clock model data alias vizClock 'python $CFDEM_UT_DIR/vizClock/matPlot.py' diff --git a/etc/functions.sh b/etc/functions.sh index 5361189b..cdd88ecb 100755 --- a/etc/functions.sh +++ b/etc/functions.sh @@ -249,7 +249,7 @@ cleanCFDEM() #********************************************** #cleaning libraries - whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/library-list.txt" + whitelist="$CFDEM_PROJECT_DIR/etc/library-list.txt" echo "" echo "Please provide the libraries to be cleaned in the $CWD/$whitelist file." @@ -303,7 +303,7 @@ cleanCFDEM() #********************************************** #cleaning solvers - whitelist="$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/solver-list.txt" + whitelist="$CFDEM_PROJECT_DIR/etc/solver-list.txt" echo "" echo "Please provide the solvers to be cleaned in the $CWD/$whitelist file." diff --git a/etc/pullLIGGGHTS.sh b/etc/pullLIGGGHTS.sh index c21b979a..170faec7 100644 --- a/etc/pullLIGGGHTS.sh +++ b/etc/pullLIGGGHTS.sh @@ -6,12 +6,12 @@ #=================================================================== #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh NOW="$(date +"%Y-%m-%d-%H:%M")" logDir="log" -cd $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc +cd $CFDEM_PROJECT_DIR/etc mkdir -p $logDir #--------------------------------------------------------------------------------# From 2f532af9bbddb01b257abd0890a9aa2a5946ec98 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 2 May 2017 17:51:00 +0200 Subject: [PATCH 06/99] update make options to include OFversion header location --- applications/solvers/cfdemSolverIB/Make/options | 1 + applications/solvers/cfdemSolverPiso/Make/options | 1 + applications/solvers/cfdemSolverPisoMS/Make/options | 1 + applications/solvers/cfdemSolverPisoScalar/Make/options | 1 + applications/solvers/cfdemSolverRhoPimple/Make/options | 1 + applications/utilities/cfdemPostproc/Make/options | 1 + src/lagrangian/cfdemParticle/Make/options | 1 + src/lagrangian/cfdemParticleComp/Make/options | 1 + 8 files changed, 8 insertions(+) diff --git a/applications/solvers/cfdemSolverIB/Make/options b/applications/solvers/cfdemSolverIB/Make/options index b841d1a3..9ef40aef 100755 --- a/applications/solvers/cfdemSolverIB/Make/options +++ b/applications/solvers/cfdemSolverIB/Make/options @@ -1,6 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ + -I$(CFDEM_OFVERSION_DIR) \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ diff --git a/applications/solvers/cfdemSolverPiso/Make/options b/applications/solvers/cfdemSolverPiso/Make/options index 91f9f553..22cdcc2b 100644 --- a/applications/solvers/cfdemSolverPiso/Make/options +++ b/applications/solvers/cfdemSolverPiso/Make/options @@ -1,6 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ + -I$(CFDEM_OFVERSION_DIR) \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ diff --git a/applications/solvers/cfdemSolverPisoMS/Make/options b/applications/solvers/cfdemSolverPisoMS/Make/options index aa6e3aeb..b273ccb1 100644 --- a/applications/solvers/cfdemSolverPisoMS/Make/options +++ b/applications/solvers/cfdemSolverPisoMS/Make/options @@ -1,6 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ + -I$(CFDEM_OFVERSION_DIR) \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \ diff --git a/applications/solvers/cfdemSolverPisoScalar/Make/options b/applications/solvers/cfdemSolverPisoScalar/Make/options index b5046521..5e43f56a 100644 --- a/applications/solvers/cfdemSolverPisoScalar/Make/options +++ b/applications/solvers/cfdemSolverPisoScalar/Make/options @@ -1,6 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ + -I$(CFDEM_OFVERSION_DIR) \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ diff --git a/applications/solvers/cfdemSolverRhoPimple/Make/options b/applications/solvers/cfdemSolverRhoPimple/Make/options index 3529eff7..0377ece5 100644 --- a/applications/solvers/cfdemSolverRhoPimple/Make/options +++ b/applications/solvers/cfdemSolverRhoPimple/Make/options @@ -4,6 +4,7 @@ PFLAGS+= -Dcompre EXE_INC = \ $(PFLAGS) \ + -I$(CFDEM_OFVERSION_DIR) \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ diff --git a/applications/utilities/cfdemPostproc/Make/options b/applications/utilities/cfdemPostproc/Make/options index 21948957..105b3029 100644 --- a/applications/utilities/cfdemPostproc/Make/options +++ b/applications/utilities/cfdemPostproc/Make/options @@ -1,6 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ + -I$(CFDEM_OFVERSION_DIR) \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels \ diff --git a/src/lagrangian/cfdemParticle/Make/options b/src/lagrangian/cfdemParticle/Make/options index 779508e0..9c152540 100644 --- a/src/lagrangian/cfdemParticle/Make/options +++ b/src/lagrangian/cfdemParticle/Make/options @@ -9,6 +9,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ $(PFLAGS) \ $(PINC) \ + -I$(CFDEM_OFVERSION_DIR) \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ diff --git a/src/lagrangian/cfdemParticleComp/Make/options b/src/lagrangian/cfdemParticleComp/Make/options index 1bbb8cc5..e79a9574 100644 --- a/src/lagrangian/cfdemParticleComp/Make/options +++ b/src/lagrangian/cfdemParticleComp/Make/options @@ -12,6 +12,7 @@ PFLAGS+= -Dcompre EXE_INC = \ $(PFLAGS) \ $(PINC) \ + -I$(CFDEM_OFVERSION_DIR) \ -I../cfdemParticle/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels \ From 76735648966584f91a547b1dc52c82f576f3dab3 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 11 May 2017 15:23:36 +0200 Subject: [PATCH 07/99] fix up shortcuts for running LIGGGHTS --- etc/bashrc | 4 ++-- etc/cshrc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 7f0e1321..836693c6 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -181,11 +181,11 @@ alias vizClock='python $CFDEM_UT_DIR/vizClock/matPlot.py' alias touchRec='find ./* -exec touch {} \;' #- shortcut to run liggghts in serial -cfdemLiggghts() { $CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME < $1; } +cfdemLiggghts() { $CFDEM_LIGGGHTS_BIN_DIR/liggghts < $1; } export -f cfdemLiggghts #- shortcut to run liggghts in parallel -cfdemLiggghtsPar() { mpirun -np $2 $CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME < $1; } +cfdemLiggghtsPar() { mpirun -np $2 $CFDEM_LIGGGHTS_BIN_DIR/liggghts < $1; } export -f cfdemLiggghtsPar #- shortcut to open files including a pattern diff --git a/etc/cshrc b/etc/cshrc index 15374dcd..0571d10c 100755 --- a/etc/cshrc +++ b/etc/cshrc @@ -167,10 +167,10 @@ alias cfdemTestTUT 'bash $CFDEM_PROJECT_DIR/etc/testTutorials.sh' alias vizClock 'python $CFDEM_UT_DIR/vizClock/matPlot.py' #- shortcut to run liggghts in serial -alias cfdemLiggghts '$CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME' +alias cfdemLiggghts '$CFDEM_LIGGGHTS_BIN_DIR/liggghts' #- shortcut to run liggghts in parallel (no fcts in csh...) -alias cfdemLiggghtsPar 'echo "mpirun -np xx -machinefile mynodes $CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME < in.liggghts_init"' +alias cfdemLiggghtsPar 'echo "mpirun -np xx -machinefile mynodes $CFDEM_LIGGGHTS_BIN_DIR/liggghts < in.liggghts_init"' #- shortcut to run liggghts in parallel # unfortunately no functions available in csh From ea71689908604ddc86cf351395f6fb4915ee56fe Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 11 May 2017 16:27:02 +0200 Subject: [PATCH 08/99] remove unused function --- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 23 ------------------- .../cfdemParticle/cfdemCloud/cfdemCloud.H | 3 --- 2 files changed, 26 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 359b51ac..f46c2a82 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -675,29 +675,6 @@ bool cfdemCloud::reAllocArrays() return false; } -bool cfdemCloud::reAllocArrays(int nP, bool forceRealloc) -{ - if( (numberOfParticlesChanged_ && !arraysReallocated_) || forceRealloc) - { - // get arrays of new length - dataExchangeM().allocateArray(positions_,0.,3,nP); - dataExchangeM().allocateArray(velocities_,0.,3,nP); - dataExchangeM().allocateArray(fluidVel_,0.,3,nP); - dataExchangeM().allocateArray(impForces_,0.,3,nP); - dataExchangeM().allocateArray(expForces_,0.,3,nP); - dataExchangeM().allocateArray(DEMForces_,0.,3,nP); - dataExchangeM().allocateArray(Cds_,0.,1,nP); - dataExchangeM().allocateArray(radii_,0.,1,nP); - dataExchangeM().allocateArray(voidfractions_,1.,voidFractionM().maxCellsPerParticle(),nP); - dataExchangeM().allocateArray(cellIDs_,-1,voidFractionM().maxCellsPerParticle(),nP); - dataExchangeM().allocateArray(particleWeights_,0.,voidFractionM().maxCellsPerParticle(),nP); - dataExchangeM().allocateArray(particleVolumes_,0.,voidFractionM().maxCellsPerParticle(),nP); - arraysReallocated_ = true; - return true; - } - return false; -} - tmp cfdemCloud::divVoidfractionTau(volVectorField& U,volScalarField& voidfraction) const { return diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index c199cd2b..78791c97 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -376,9 +376,6 @@ public: virtual bool reAllocArrays(); - virtual bool reAllocArrays(int nP, bool forceRealloc); //force number of particles during reallocation - - // IO void writeScalarFieldToTerminal(double**&); From b04810f2c5ad1c8089315cecc6ec9f443f917b1c Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 11 May 2017 16:38:11 +0200 Subject: [PATCH 09/99] use proper data type --- .../derived/cfdemCloudIB/cfdemCloudIB.C | 2 +- .../derived/cfdemCloudMS/cfdemCloudMS.C | 16 ++++++++-------- .../regionModel/regionModel/regionModel.C | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C index 3f578ef5..9763a700 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C @@ -91,7 +91,7 @@ bool cfdemCloudIB::reAllocArrays() if(cfdemCloud::reAllocArrays()) { // get arrays of new length - dataExchangeM().allocateArray(angularVelocities_,0,3); + dataExchangeM().allocateArray(angularVelocities_,0.,3); return true; } return false; diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C index 1b34cad0..5f254a79 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C @@ -128,7 +128,7 @@ void cfdemCloudMS::getDEMdata() //- save clump volume and mass double **typeDH(NULL); - dataExchangeM().allocateArray(typeDH,-1,1,nClumpTypes()+1); + dataExchangeM().allocateArray(typeDH,-1.,1,nClumpTypes()+1); if(manDHdev_) // use manually defined dH { for(int k = 1;k <= nClumpTypes(); k++) @@ -192,18 +192,18 @@ bool cfdemCloudMS::reAllocArrays() if(cfdemCloud::reAllocArrays()) { // get arrays of new length - dataExchangeM().allocateArray(positionsCM_,0,3,"nbodies"); - dataExchangeM().allocateArray(velocitiesCM_,0,3,"nbodies"); + dataExchangeM().allocateArray(positionsCM_,0.,3,"nbodies"); + dataExchangeM().allocateArray(velocitiesCM_,0.,3,"nbodies"); dataExchangeM().allocateArray(cellIDsCM_,-1,1,"nbodies"); dataExchangeM().allocateArray(bodies_,0,1); dataExchangeM().allocateArray(nrigids_,0,1,"nbodies"); dataExchangeM().allocateArray(clumpType_,0,1,"nbodies"); - dataExchangeM().allocateArray(clumpVol_,0,1,"nbodies"); + dataExchangeM().allocateArray(clumpVol_,0.,1,"nbodies"); dataExchangeM().allocateArray(clumpDH_,1.,1,"nbodies"); - dataExchangeM().allocateArray(clumpWeights_,1,1,"nbodies"); - dataExchangeM().allocateArray(impForcesCM_,0,3,"nbodies"); - dataExchangeM().allocateArray(expForcesCM_,0,3,"nbodies"); - dataExchangeM().allocateArray(DEMForcesCM_,0,3,"nbodies"); + dataExchangeM().allocateArray(clumpWeights_,1.,1,"nbodies"); + dataExchangeM().allocateArray(impForcesCM_,0.,3,"nbodies"); + dataExchangeM().allocateArray(expForcesCM_,0.,3,"nbodies"); + dataExchangeM().allocateArray(DEMForcesCM_,0.,3,"nbodies"); return true; } return false; diff --git a/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C b/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C index d9a6ed6d..580de2bb 100644 --- a/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C @@ -51,8 +51,8 @@ void Foam::regionModel::reAllocArrays() const if(particleCloud_.numberOfParticlesChanged()) { // get arrays of new length - particleCloud_.dataExchangeM().allocateArray(inRegion_,1,1); - particleCloud_.dataExchangeM().allocateArray(outRegion_,1,1); + particleCloud_.dataExchangeM().allocateArray(inRegion_,1.,1); + particleCloud_.dataExchangeM().allocateArray(outRegion_,1.,1); } } From e265039fed5fd5de4c71dbefaff0f18f99a604c5 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 11 May 2017 17:02:38 +0200 Subject: [PATCH 10/99] remove superfluous namespace scoping --- .../cfdemParticle/cfdemCloud/cfdemCloud.H | 4 +- .../averagingModel/averagingModel.C | 6 +-- .../clockModel/clockModel/clockModel.C | 32 +++++++-------- .../dataExchangeModel/dataExchangeModel.C | 34 ++++++++-------- .../dataExchangeModel/twoWayMPI/twoWayMPI.C | 26 ++++++------ .../twoWayMany2Many/twoWayMany2Many.C | 40 +++++++++---------- .../explicitCouple/explicitCouple.C | 6 +-- .../implicitCouple/implicitCouple.C | 2 +- .../momCoupleModel/noCouple/noCouple.C | 2 +- .../regionModel/regionModel/regionModel.C | 2 +- .../constDiffSmoothing/constDiffSmoothing.C | 24 +++++------ .../smoothingModel/noSmoothing/noSmoothing.C | 6 +-- .../smoothingModel/smoothingModel.C | 10 ++--- .../voidFractionModel/voidFractionModel.C | 8 ++-- 14 files changed, 101 insertions(+), 101 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index 78791c97..3c05e065 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -322,11 +322,11 @@ public: //access to the particle's rotation and torque data virtual inline double ** DEMTorques() const {return NULL;} virtual inline double ** omegaArray() const {return NULL;} - virtual vector omega(int) const {return Foam::vector(0,0,0);} + virtual vector omega(int) const {return vector(0,0,0);} //access to the particles' orientation information virtual inline double ** exArray() const {return NULL;} - virtual vector ex(int) const {return Foam::vector(0,0,0);} + virtual vector ex(int) const {return vector(0,0,0);} //Detector if SRF module is enable or not virtual inline bool SRFOn(){return false;} diff --git a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C index b0d8b4bc..0f85e686 100644 --- a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C +++ b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C @@ -262,7 +262,7 @@ void averagingModel::setDSauter for(int index=0; index< particleCloud_.numberOfParticles(); index++) { if(myParticleType!=0) //in case a particle type is specified, only consider particles of the right type - if(myParticleType != particleCloud_.particleType(index)) continue; + if(myParticleType != particleCloud_.particleType(index)) continue; radius = particleCloud_.radii()[index][0] / scale_; //the primary particle diameter radiusPow2 = radius*radius; @@ -313,7 +313,7 @@ void averagingModel::resetWeightFields() const } -void Foam::averagingModel::undoWeightFields(double**const& mask) const +void averagingModel::undoWeightFields(double**const& mask) const { for(int index=0; index< particleCloud_.numberOfParticles(); index++) { @@ -326,7 +326,7 @@ void Foam::averagingModel::undoWeightFields(double**const& mask) const } } -tmp Foam::averagingModel::UsInterp() const +tmp averagingModel::UsInterp() const { tmp tsource ( diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C index 43a77955..97d2dd17 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C @@ -48,13 +48,13 @@ defineRunTimeSelectionTable(clockModel, dictionary); // * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * // -void Foam::clockModel::start(int pos) const +void clockModel::start(int pos) const { start(pos,""); return; } -void Foam::clockModel::start(int pos, const std::string& ident) const +void clockModel::start(int pos, const std::string& ident) const { if (particleCloud_.mesh().time().value() > startTime_) { @@ -78,7 +78,7 @@ void Foam::clockModel::start(int pos, const std::string& ident) const return; } -void Foam::clockModel::stop() const +void clockModel::stop() const { if (particleCloud_.mesh().time().value() > startTime_) { @@ -96,7 +96,7 @@ void Foam::clockModel::stop() const return; } -void Foam::clockModel::stop(const std::string& ident) const +void clockModel::stop(const std::string& ident) const { if (particleCloud_.mesh().time().value() > startTime_) { @@ -118,7 +118,7 @@ void Foam::clockModel::stop(const std::string& ident) const return; } -std::string Foam::clockModel::eval() const +std::string clockModel::eval() const { std::ostringstream strs("Measurements in CPU-seconds:\n"); strs << "Name\tdeltaT\tnOfRuns\tlevel\tparentNr\tparentName\n"; @@ -149,7 +149,7 @@ std::string Foam::clockModel::eval() const return strs.str(); } -void Foam::clockModel::evalFile() const +void clockModel::evalFile() const { std::ofstream outFile; std::string fileName(path_/"timeEval.txt"); @@ -159,7 +159,7 @@ void Foam::clockModel::evalFile() const outFile.close(); } -void Foam::clockModel::evalPar() const +void clockModel::evalPar() const { int myrank, numprocs; MPI_Comm_rank(MPI_COMM_WORLD,&myrank); @@ -232,7 +232,7 @@ void Foam::clockModel::evalPar() const } -void Foam::clockModel::initElems() +void clockModel::initElems() { //init elems for (int i = 0;i < n_; i++) @@ -245,7 +245,7 @@ void Foam::clockModel::initElems() } } -std::vector Foam::clockModel::calcShift() const +std::vector clockModel::calcShift() const { std::vector shifts(n_, 0); @@ -263,7 +263,7 @@ std::vector Foam::clockModel::calcShift() const return shifts; } -void Foam::clockModel::normHist() const +void clockModel::normHist() const { int myrank, numprocs; MPI_Comm_rank(MPI_COMM_WORLD,&myrank); @@ -303,7 +303,7 @@ void Foam::clockModel::normHist() const return; } -void Foam::clockModel::plotHist(double buffIn,const std::string& identifier,int numprocs,int myrank) const +void clockModel::plotHist(double buffIn,const std::string& identifier,int numprocs,int myrank) const { double* globalTime_all = NULL; if (myrank == 0) globalTime_all = new double[numprocs]; @@ -318,7 +318,7 @@ void Foam::clockModel::plotHist(double buffIn,const std::string& identifier,int delete [] globalTime_all; } -void Foam::clockModel::Hist() const +void clockModel::Hist() const { int myrank=-10; MPI_Comm_rank(MPI_COMM_WORLD,&myrank); @@ -337,7 +337,7 @@ void Foam::clockModel::Hist() const return; } -void Foam::clockModel::getRAMUsage() const +void clockModel::getRAMUsage() const { int myrank, numprocs; MPI_Comm_rank(MPI_COMM_WORLD,&myrank); @@ -390,7 +390,7 @@ void Foam::clockModel::getRAMUsage() const // set up communication between Procs and plot Stuff Info << " RAM USAGE HISTOGRAM in MB" << endl; plotHist(RssMB,"RSS memory used",numprocs,myrank); - if (SwapMem > 0) + if (SwapMem > 0) { plotHist(SwapMB,"WARNING: Swap",numprocs,myrank); } @@ -406,7 +406,7 @@ void Foam::clockModel::getRAMUsage() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components -Foam::clockModel::clockModel +clockModel::clockModel ( const dictionary& dict, cfdemCloud& sm @@ -432,7 +432,7 @@ Foam::clockModel::clockModel // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::clockModel::~clockModel() +clockModel::~clockModel() {} diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C index dfe718c1..0bd182fc 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C @@ -45,7 +45,7 @@ defineRunTimeSelectionTable(dataExchangeModel, dictionary); // * * * * * * * * * * * * * * protected Member Functions * * * * * * * * * * * * * // -void Foam::dataExchangeModel::setNumberOfParticles(int numberOfParticles) const +void dataExchangeModel::setNumberOfParticles(int numberOfParticles) const { particleCloud_.setNumberOfParticles(numberOfParticles); } @@ -55,7 +55,7 @@ void Foam::dataExchangeModel::setNumberOfParticles(int numberOfParticles) const //==== // double ** -void Foam::dataExchangeModel::allocateArray +void dataExchangeModel::allocateArray ( double**& array, double initVal, @@ -77,7 +77,7 @@ void Foam::dataExchangeModel::allocateArray } } -void Foam::dataExchangeModel::allocateArray +void dataExchangeModel::allocateArray ( double**& array, double initVal, @@ -92,7 +92,7 @@ void Foam::dataExchangeModel::allocateArray allocateArray(array,initVal,width,len); } -void Foam::dataExchangeModel::destroy(double** array,int /*len*/) const +void dataExchangeModel::destroy(double** array,int /*len*/) const { if (array == NULL) return; @@ -103,7 +103,7 @@ void Foam::dataExchangeModel::destroy(double** array,int /*len*/) const //==== // int ** -void Foam::dataExchangeModel::allocateArray +void dataExchangeModel::allocateArray ( int**& array, int initVal, @@ -125,7 +125,7 @@ void Foam::dataExchangeModel::allocateArray } } -void Foam::dataExchangeModel::allocateArray +void dataExchangeModel::allocateArray ( int**& array, int initVal, @@ -140,7 +140,7 @@ void Foam::dataExchangeModel::allocateArray allocateArray(array,initVal,width,len); } -void Foam::dataExchangeModel::destroy(int** array,int /*len*/) const +void dataExchangeModel::destroy(int** array,int /*len*/) const { if (array == NULL) return; @@ -152,7 +152,7 @@ void Foam::dataExchangeModel::destroy(int** array,int /*len*/) const //==== // int * -void Foam::dataExchangeModel::allocateArray +void dataExchangeModel::allocateArray ( int*& array, int initVal, @@ -166,7 +166,7 @@ void Foam::dataExchangeModel::allocateArray array[i] = initVal; } -void Foam::dataExchangeModel::destroy(int* array) const +void dataExchangeModel::destroy(int* array) const { if (array == NULL) return; delete [] array; @@ -175,7 +175,7 @@ void Foam::dataExchangeModel::destroy(int* array) const //==== // double * -void Foam::dataExchangeModel::allocateArray +void dataExchangeModel::allocateArray ( double*& array, double initVal, @@ -189,7 +189,7 @@ void Foam::dataExchangeModel::allocateArray array[i] = initVal; } -void Foam::dataExchangeModel::destroy(double* array) const +void dataExchangeModel::destroy(double* array) const { if (array == NULL) return; @@ -198,7 +198,7 @@ void Foam::dataExchangeModel::destroy(double* array) const //==== -bool Foam::dataExchangeModel::couple(int i) const +bool dataExchangeModel::couple(int i) const { bool coupleNow = false; if (doCoupleNow()) @@ -209,7 +209,7 @@ bool Foam::dataExchangeModel::couple(int i) const return coupleNow; } -scalar Foam::dataExchangeModel::timeStepFraction() const +scalar dataExchangeModel::timeStepFraction() const { //return fraction between previous coupling TS and actual TS //scalar DEMtime = DEMts_ * couplingInterval_; @@ -220,25 +220,25 @@ scalar Foam::dataExchangeModel::timeStepFraction() const return frac; } -int Foam::dataExchangeModel::getNumberOfParticles() const +int dataExchangeModel::getNumberOfParticles() const { Warning << "ask for nr of particles - which is not supported for this dataExchange model" << endl; return -1; } -int Foam::dataExchangeModel::getNumberOfClumps() const +int dataExchangeModel::getNumberOfClumps() const { Warning << "ask for nr of clumps - which is not supported for this dataExchange model" << endl; return -1; } -int Foam::dataExchangeModel::getNumberOfTypes() const +int dataExchangeModel::getNumberOfTypes() const { Warning << "ask for nr of types - which is not supported for this dataExchange model" << endl; return -1; } -double* Foam::dataExchangeModel::getTypeVol() const +double* dataExchangeModel::getTypeVol() const { Warning << "ask for type volume - which is not supported for this dataExchange model" << endl; return NULL; diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C index 59350e5d..604ef3b8 100644 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C @@ -127,7 +127,7 @@ void twoWayMPI::giveData //============ // double ** -void Foam::twoWayMPI::allocateArray +void twoWayMPI::allocateArray ( double**& array, double initVal, @@ -138,7 +138,7 @@ void Foam::twoWayMPI::allocateArray allocate_external_double(array, width, length, initVal, lmp); } -void Foam::twoWayMPI::allocateArray +void twoWayMPI::allocateArray ( double**& array, double initVal, @@ -149,7 +149,7 @@ void Foam::twoWayMPI::allocateArray allocate_external_double(array, width, length, initVal, lmp); } -void Foam::twoWayMPI::destroy(double** array,int /*len*/) const +void twoWayMPI::destroy(double** array,int /*len*/) const { if (array == NULL) return; @@ -160,7 +160,7 @@ void Foam::twoWayMPI::destroy(double** array,int /*len*/) const //============ // int ** -void Foam::twoWayMPI::allocateArray +void twoWayMPI::allocateArray ( int**& array, int initVal, @@ -171,7 +171,7 @@ void Foam::twoWayMPI::allocateArray allocate_external_int(array, width, length, initVal, lmp); } -void Foam::twoWayMPI::allocateArray +void twoWayMPI::allocateArray ( int**& array, int initVal, @@ -182,7 +182,7 @@ void Foam::twoWayMPI::allocateArray allocate_external_int(array, width, length, initVal, lmp); } -void Foam::twoWayMPI::destroy(int** array,int /*len*/) const +void twoWayMPI::destroy(int** array,int /*len*/) const { if (array == NULL) return; @@ -192,21 +192,21 @@ void Foam::twoWayMPI::destroy(int** array,int /*len*/) const } //============ // int * -void Foam::twoWayMPI::destroy(int* array) const +void twoWayMPI::destroy(int* array) const { if (array == NULL) return; free(array); } //============ // double * -void Foam::twoWayMPI::destroy(double* array) const +void twoWayMPI::destroy(double* array) const { if (array == NULL) return; free(array); } //============ -bool Foam::twoWayMPI::couple(int i) const +bool twoWayMPI::couple(int i) const { bool coupleNow = false; if (i==0) @@ -354,12 +354,12 @@ bool Foam::twoWayMPI::couple(int i) const return coupleNow; } -int Foam::twoWayMPI::getNumberOfParticles() const +int twoWayMPI::getNumberOfParticles() const { return liggghts_get_maxtag(lmp); } -int Foam::twoWayMPI::getNumberOfClumps() const +int twoWayMPI::getNumberOfClumps() const { #ifdef multisphere return liggghts_get_maxtag_ms(lmp); @@ -369,7 +369,7 @@ int Foam::twoWayMPI::getNumberOfClumps() const return -1; } -int Foam::twoWayMPI::getNumberOfTypes() const +int twoWayMPI::getNumberOfTypes() const { #ifdef multisphere return liggghts_get_ntypes_ms(lmp); @@ -378,7 +378,7 @@ int Foam::twoWayMPI::getNumberOfTypes() const return -1; } -double* Foam::twoWayMPI::getTypeVol() const +double* twoWayMPI::getTypeVol() const { #ifdef multisphere return liggghts_get_vclump_ms(lmp); diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.C index 5dcb7f3c..74d50569 100644 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.C @@ -62,7 +62,7 @@ twoWayMany2Many::twoWayMany2Many : dataExchangeModel(dict,sm), propsDict_(dict.subDict(typeName + "Props")), - pbm_(sm.mesh().boundaryMesh()), + pbm_(sm.mesh().boundaryMesh()), pData_(sm.mesh().globalData()), procPatches_(pData_.processorPatches()), procPatchIndices_(pData_.processorPatchIndices()), @@ -280,7 +280,7 @@ void twoWayMany2Many::giveData //============ // double ** -void Foam::twoWayMany2Many::allocateArray +void twoWayMany2Many::allocateArray ( double**& array, double initVal, @@ -295,7 +295,7 @@ void Foam::twoWayMany2Many::allocateArray array[i][j] = initVal; } -void Foam::twoWayMany2Many::allocateArray +void twoWayMany2Many::allocateArray ( double**& array, double initVal, @@ -310,14 +310,14 @@ void Foam::twoWayMany2Many::allocateArray array[i][j] = initVal; } -void inline Foam::twoWayMany2Many::destroy(double** array,int len) const +void inline twoWayMany2Many::destroy(double** array,int len) const { lmp->memory->destroy(array); } //============ // int ** -void Foam::twoWayMany2Many::allocateArray +void twoWayMany2Many::allocateArray ( int**& array, int initVal, @@ -332,7 +332,7 @@ void Foam::twoWayMany2Many::allocateArray array[i][j] = initVal; } -void Foam::twoWayMany2Many::allocateArray +void twoWayMany2Many::allocateArray ( int**& array, int initVal, @@ -347,14 +347,14 @@ void Foam::twoWayMany2Many::allocateArray array[i][j] = initVal; } -void inline Foam::twoWayMany2Many::destroy(int** array,int len) const +void inline twoWayMany2Many::destroy(int** array,int len) const { lmp->memory->destroy(array); } //============ // double * -void Foam::twoWayMany2Many::allocateArray(double*& array, double initVal, int length) const +void twoWayMany2Many::allocateArray(double*& array, double initVal, int length) const { int len = max(length,1); lmp->memory->grow(array, len, "m2m:dbl*"); @@ -362,14 +362,14 @@ void Foam::twoWayMany2Many::allocateArray(double*& array, double initVal, int le array[i] = initVal; } -void inline Foam::twoWayMany2Many::destroy(double* array) const +void inline twoWayMany2Many::destroy(double* array) const { lmp->memory->destroy(array); } //============== // int * -void Foam::twoWayMany2Many::allocateArray(int*& array, int initVal, int length) const +void twoWayMany2Many::allocateArray(int*& array, int initVal, int length) const { int len = max(length,1); lmp->memory->grow(array, len, "m2m:int*"); @@ -377,14 +377,14 @@ void Foam::twoWayMany2Many::allocateArray(int*& array, int initVal, int length) array[i] = initVal; } -void inline Foam::twoWayMany2Many::destroy(int* array) const +void inline twoWayMany2Many::destroy(int* array) const { lmp->memory->destroy(array); } //============== -bool Foam::twoWayMany2Many::couple(int i) const +bool twoWayMany2Many::couple(int i) const { bool coupleNow = false; if (i==0) @@ -443,19 +443,19 @@ bool Foam::twoWayMany2Many::couple(int i) const return coupleNow; } -int Foam::twoWayMany2Many::getNumberOfParticles() const +int twoWayMany2Many::getNumberOfParticles() const { return liggghts_get_maxtag(lmp); } -int Foam::twoWayMany2Many::getNumberOfClumps() const +int twoWayMany2Many::getNumberOfClumps() const { Warning << "Foam::twoWayMany2Many::getNumberOfClumps() - changes necessary here" << endl; //return liggghts_get_maxtag_ms(lmp); return 1; } -void Foam::twoWayMany2Many::syncIDs() const +void twoWayMany2Many::syncIDs() const { particleCloud_.clockM().start(5,"recv_DEM_ids"); @@ -575,7 +575,7 @@ void Foam::twoWayMany2Many::syncIDs() const particleCloud_.clockM().stop("setup_Comm"); } -void Foam::twoWayMany2Many::locateParticle(int* id_lammpsSync, bool id_lammps_alloc_flag) const +void twoWayMany2Many::locateParticle(int* id_lammpsSync, bool id_lammps_alloc_flag) const { #if defined(version21) @@ -669,7 +669,7 @@ void Foam::twoWayMany2Many::locateParticle(int* id_lammpsSync, bool id_lammps_al } particleCloud_.clockM().stop("locate_Stage1"); particleCloud_.clockM().start(8,"locate_Stage2"); - + PstreamBuffers pBufs(Pstream::nonBlocking); forAll(particleTransferID, i) @@ -802,7 +802,7 @@ void Foam::twoWayMany2Many::locateParticle(int* id_lammpsSync, bool id_lammps_al if (firstRun_) { int* id_foam_nowhere_all; - Foam::dataExchangeModel::allocateArray(id_foam_nowhere_all,1,nlocal_foam_lostAll); + dataExchangeModel::allocateArray(id_foam_nowhere_all,1,nlocal_foam_lostAll); MPI_Allreduce(id_foamLostAll, id_foam_nowhere_all, nlocal_foam_lostAll, MPI_INT, MPI_MIN, MPI_COMM_WORLD); int i = 0; @@ -820,7 +820,7 @@ void Foam::twoWayMany2Many::locateParticle(int* id_lammpsSync, bool id_lammps_al for (int k=0;k<3;k++) id_lammpsVec_[j*3+k] = id_lammpsVec_[(nlocal_lammps_-1)*3+k]; - + nlocal_lammps_ -= 1; break; } @@ -828,7 +828,7 @@ void Foam::twoWayMany2Many::locateParticle(int* id_lammpsSync, bool id_lammps_al } i++; } - Foam::dataExchangeModel::destroy(id_foam_nowhere_all); + dataExchangeModel::destroy(id_foam_nowhere_all); id_foam_nowhere_all = NULL; if (id_lammps_alloc_flag) destroy(id_lammps_); id_lammps_ = NULL; diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C index a5512441..99e2b906 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C @@ -139,7 +139,7 @@ tmp explicitCouple::expMomSource() const forAll(fNext_,cellI) { fNext_[cellI] = arrayToField(cellI); - + // limiter for (int i=0;i<3;i++) { @@ -155,13 +155,13 @@ tmp explicitCouple::expMomSource() const return tsource; } -void Foam::explicitCouple::resetMomSourceField() const +void explicitCouple::resetMomSourceField() const { fPrev_.ref() = fNext_.ref(); fNext_.primitiveFieldRef() = vector::zero; } -inline vector Foam::explicitCouple::arrayToField(label cellI) const +inline vector explicitCouple::arrayToField(label cellI) const { return particleCloud_.forceM(0).expParticleForces()[cellI] / particleCloud_.mesh().V()[cellI]; } diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C index 377fc137..90b1c955 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C @@ -175,7 +175,7 @@ tmp implicitCouple::impMomSource() const return tsource; } -void Foam::implicitCouple::resetMomSourceField() const +void implicitCouple::resetMomSourceField() const { KslPrev_.ref() = KslNext_.ref(); KslNext_.primitiveFieldRef() = 0; diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/noCouple/noCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/noCouple/noCouple.C index 789907df..ffd629ec 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/noCouple/noCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/noCouple/noCouple.C @@ -72,7 +72,7 @@ noCouple::~noCouple() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::noCouple::resetMomSourceField() const +void noCouple::resetMomSourceField() const { FatalError<<"the solver calls for resetMomSourceField() although you use IB method where this is not needed!\n" <<", check your solver! - PANIC -\n"; diff --git a/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C b/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C index 580de2bb..63b37478 100644 --- a/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/regionModel/regionModel/regionModel.C @@ -46,7 +46,7 @@ defineRunTimeSelectionTable(regionModel, dictionary); // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::regionModel::reAllocArrays() const +void regionModel::reAllocArrays() const { if(particleCloud_.numberOfParticlesChanged()) { diff --git a/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C b/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C index 1af57abe..824b2630 100644 --- a/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C +++ b/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C @@ -6,7 +6,7 @@ Christoph Goniva, christoph.goniva@cfdem.com Copyright 2009-2012 JKU Linz Copyright 2012- DCS Computing GmbH, Linz - Copyright (C) 2013- Graz University of + Copyright (C) 2013- Graz University of Technology, IPPT ------------------------------------------------------------------------------- License @@ -71,10 +71,10 @@ constDiffSmoothing::constDiffSmoothing verbose_(false) { - if(propsDict_.found("verbose")) + if(propsDict_.found("verbose")) verbose_ = true; - if(propsDict_.found("smoothingLengthReferenceField")) + if(propsDict_.found("smoothingLengthReferenceField")) smoothingLengthReferenceField_.value() = double(readScalar(propsDict_.lookup("smoothingLengthReferenceField"))); checkFields(sSmoothField_); @@ -94,7 +94,7 @@ bool constDiffSmoothing::doSmoothing() const } -void Foam::constDiffSmoothing::smoothen(volScalarField& fieldSrc) const +void constDiffSmoothing::smoothen(volScalarField& fieldSrc) const { // Create scalar smooth field from virgin scalar smooth field template volScalarField sSmoothField = sSmoothField_; @@ -120,11 +120,11 @@ void Foam::constDiffSmoothing::smoothen(volScalarField& fieldSrc) const forAll(sSmoothField,cellI) { sSmoothField[cellI]=max(lowerLimit_,min(upperLimit_,sSmoothField[cellI])); - } + } // get data from working sSmoothField - will copy only values at new time fieldSrc=sSmoothField; - fieldSrc.correctBoundaryConditions(); + fieldSrc.correctBoundaryConditions(); if(verbose_) { @@ -135,7 +135,7 @@ void Foam::constDiffSmoothing::smoothen(volScalarField& fieldSrc) const } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void Foam::constDiffSmoothing::smoothen(volVectorField& fieldSrc) const +void constDiffSmoothing::smoothen(volVectorField& fieldSrc) const { // Create scalar smooth field from virgin scalar smooth field template volVectorField vSmoothField = vSmoothField_; @@ -159,7 +159,7 @@ void Foam::constDiffSmoothing::smoothen(volVectorField& fieldSrc) const // get data from working vSmoothField fieldSrc=vSmoothField; - fieldSrc.correctBoundaryConditions(); + fieldSrc.correctBoundaryConditions(); if(verbose_) { @@ -170,7 +170,7 @@ void Foam::constDiffSmoothing::smoothen(volVectorField& fieldSrc) const } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void Foam::constDiffSmoothing::smoothenReferenceField(volVectorField& fieldSrc) const +void constDiffSmoothing::smoothenReferenceField(volVectorField& fieldSrc) const { // Create scalar smooth field from virgin scalar smooth field template volVectorField vSmoothField = vSmoothField_; @@ -185,7 +185,7 @@ void Foam::constDiffSmoothing::smoothenReferenceField(volVectorField& fieldSrc) double sourceStrength = 1e5; //large number to keep reference values constant dimensionedScalar deltaT = vSmoothField.mesh().time().deltaT(); - DT_.value() = smoothingLengthReferenceField_.value() + DT_.value() = smoothingLengthReferenceField_.value() * smoothingLengthReferenceField_.value() / deltaT.value(); tmp NLarge @@ -218,14 +218,14 @@ void Foam::constDiffSmoothing::smoothenReferenceField(volVectorField& fieldSrc) ( fvm::ddt(vSmoothField) -fvm::laplacian( DT_, vSmoothField) - == + == NLarge() / deltaT * vSmoothField.oldTime() //add source to keep cell values constant -fvm::Sp( NLarge() / deltaT, vSmoothField) //add sink to keep cell values constant ); // get data from working vSmoothField fieldSrc=vSmoothField; - fieldSrc.correctBoundaryConditions(); + fieldSrc.correctBoundaryConditions(); if(verbose_) { diff --git a/src/lagrangian/cfdemParticle/subModels/smoothingModel/noSmoothing/noSmoothing.C b/src/lagrangian/cfdemParticle/subModels/smoothingModel/noSmoothing/noSmoothing.C index 01a73ab1..61f5bcfd 100644 --- a/src/lagrangian/cfdemParticle/subModels/smoothingModel/noSmoothing/noSmoothing.C +++ b/src/lagrangian/cfdemParticle/subModels/smoothingModel/noSmoothing/noSmoothing.C @@ -70,13 +70,13 @@ noSmoothing::~noSmoothing() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::noSmoothing::smoothen(volScalarField& field) const +void noSmoothing::smoothen(volScalarField& field) const {} -void Foam::noSmoothing::smoothen(volVectorField& field) const +void noSmoothing::smoothen(volVectorField& field) const {} -void Foam::noSmoothing::smoothenReferenceField(volVectorField& field) const +void noSmoothing::smoothenReferenceField(volVectorField& field) const {} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C b/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C index b906a160..a98d4bde 100644 --- a/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C +++ b/src/lagrangian/cfdemParticle/subModels/smoothingModel/smoothingModel/smoothingModel.C @@ -50,7 +50,7 @@ defineRunTimeSelectionTable(smoothingModel, dictionary); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components -Foam::smoothingModel::smoothingModel +smoothingModel::smoothingModel ( const dictionary& dict, cfdemCloud& sm @@ -59,7 +59,7 @@ Foam::smoothingModel::smoothingModel dict_(dict), particleCloud_(sm), vSmoothField_ - ( + ( IOobject ( "vSmoothField", @@ -72,7 +72,7 @@ Foam::smoothingModel::smoothingModel dimensionedVector("zero", dimensionSet(0,0,0,0,0), vector::zero) ), sSmoothField_ - ( + ( IOobject ( "sSmoothField", @@ -89,7 +89,7 @@ Foam::smoothingModel::smoothingModel // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::smoothingModel::~smoothingModel() +smoothingModel::~smoothingModel() {} @@ -110,7 +110,7 @@ void smoothingModel::checkFields(volVectorField& vSmoothField_) const { // currently it is detected if field was auto generated or defined // improvement would be changing the type here automatically - forAll(vSmoothField_.boundaryField(),patchI) + forAll(vSmoothField_.boundaryField(),patchI) if(vSmoothField_.boundaryField()[patchI].type()=="calculated") FatalError <<"Vector field:"<< vSmoothField_.name() << " must be defined.\n" << abort(FatalError); diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C index b5ddbddf..a3afcf94 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C @@ -100,7 +100,7 @@ voidFractionModel::~voidFractionModel() } // * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * // -tmp Foam::voidFractionModel::voidFractionInterp() const +tmp voidFractionModel::voidFractionInterp() const { tmp tsource ( @@ -136,13 +136,13 @@ tmp Foam::voidFractionModel::voidFractionInterp() const return tsource; } -void Foam::voidFractionModel::resetVoidFractions() const +void voidFractionModel::resetVoidFractions() const { voidfractionPrev_.ref() = voidfractionNext_.ref(); voidfractionNext_.ref() = 1; } -/*void Foam::voidFractionModel::undoVoidFractions(double**const& mask) const +/*void voidFractionModel::undoVoidFractions(double**const& mask) const { voidfractionPrev_.internalField() = voidfractionNext_.internalField(); @@ -163,7 +163,7 @@ int** const& voidFractionModel::cellsPerParticle() const return cellsPerParticle_; } -int Foam::voidFractionModel::maxCellsPerParticle() const +int voidFractionModel::maxCellsPerParticle() const { return maxCellsPerParticle_; } From dd54ca1bbae9fb6ac65ff10da9e295097fe554ed Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 11 May 2017 18:00:54 +0200 Subject: [PATCH 11/99] what has been allocated must be destroyed new - delete malloc - free allocateArray - destroy Programming 101: Don't mix them! --- .../subModels/chemistryModel/species/species.C | 8 ++++---- .../energyModel/heatTransferGunn/heatTransferGunn.C | 8 ++++---- .../heatTransferGunnImplicit/heatTransferGunnImplicit.C | 2 +- .../subModels/energyModel/reactionHeat/reactionHeat.C | 2 +- .../subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C | 4 ++-- .../subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C | 4 ++-- .../cfdemParticle/subModels/forceModel/dSauter/dSauter.C | 4 ++-- .../forceModel/granKineticEnergy/granKineticEnergy.C | 2 +- .../forceModel/virtualMassForce/virtualMassForce.C | 2 +- .../subModels/regionModel/regionModel/regionModel.C | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C index fc27c319..9a869b54 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C @@ -147,11 +147,11 @@ species::species species::~species() { - delete partTemp_; - delete partRho_; + particleCloud_.dataExchangeM().destroy(partTemp_,1); + particleCloud_.dataExchangeM().destroy(partRho_,1); - for (int i=0; i Date: Thu, 11 May 2017 18:21:53 +0200 Subject: [PATCH 12/99] clean up whitespaces --- .../derived/cfdemCloudMS/cfdemCloudMS.C | 4 +- .../chemistryModel/species/species.C | 12 +-- .../heatTransferGunn/heatTransferGunn.C | 89 +++++++++---------- .../heatTransferGunnImplicit.C | 14 +-- .../subModels/forceModel/dSauter/dSauter.C | 30 +++---- .../granKineticEnergy/granKineticEnergy.C | 18 ++-- .../virtualMassForce/virtualMassForce.C | 20 ++--- 7 files changed, 92 insertions(+), 95 deletions(-) diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C index 5f254a79..40e5ddde 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.C @@ -135,7 +135,7 @@ void cfdemCloudMS::getDEMdata() typeDH[k][0]=dHbyV_[k-1]*typeVol_[k]; } else // calc dH from volAeqivalent shpere - { + { for(int k = 1;k <= nClumpTypes(); k++) typeDH[k][0]=pow(typeVol_[k]*1.9099,1./3.); // 6/pi=1.9099 // calc a hydraulic diameter as d of vol equal sphere } @@ -144,7 +144,7 @@ void cfdemCloudMS::getDEMdata() for(int ind = 0;ind < numberOfClumps(); ind++) { ct=clumpType()[0][ind]; - clumpVol_[ind][0] = typeVol_[ct]; + clumpVol_[ind][0] = typeVol_[ct]; clumpDH_[ind][0]=typeDH[ct][0]; //Info << "ct=" << ct << endl; //Info << "clumpVol()[ind][0]=" << clumpVol()[ind][0] << endl; diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C index 9a869b54..e0aaa6f5 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C @@ -176,10 +176,10 @@ void species::allocateMyArrays() const void species::execute() { - // realloc the arrays + // realloc the arrays allocateMyArrays(); - // get Y_i, T, rho at particle positions, fill arrays with them and push to LIGGGHTS + // get Y_i, T, rho at particle positions, fill arrays with them and push to LIGGGHTS label cellI=0; scalar Tfluid(0); @@ -194,7 +194,7 @@ void species::execute() for (int index=0; index=0) + if (cellI >= 0) { if(interpolation_) { @@ -213,12 +213,12 @@ void species::execute() partRho_[index][0]=rhofluid; for (int i=0; i=0 && index < 2) + if(particleCloud_.verbose() && index >= 0 && index < 2) { /*for(int i =0; i TInterpolator_(tempField_); - + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; @@ -146,12 +146,12 @@ void heatTransferGunnImplicit::postFlow() } else Tfluid = tempField_[cellI]; - + Tpart = partTemp_[index][0]; partHeatFlux_[index][0] = (Tfluid - Tpart) * partHeatFluxCoeff_[index][0]; } } - + giveData(1); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C b/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C index 7f91b8f3..26d96a55 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C @@ -92,12 +92,12 @@ dSauter::dSauter ), sm.mesh(), dimensionedScalar("zero", dimensionSet(0,1,0,0,0), 0), - "zeroGradient" + "zeroGradient" ) { allocateMyArrays(); dSauter_.write(); - + // init force sub model setForceSubModels(propsDict_); @@ -142,21 +142,21 @@ void dSauter::setForce() const label cellI=0; scalar ds(0); scalar scale = scaleDiaDist_/scaleDia_; - + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; if(cellI >= 0) { - ds = particleCloud_.d(index); - d2_[index][0] = ds*ds; - d3_[index][0] = ds*ds*ds; - } + ds = particleCloud_.d(index); + d2_[index][0] = ds*ds; + d3_[index][0] = ds*ds*ds; + } } - + d2Field_.primitiveFieldRef() = 0.0; d3Field_.primitiveFieldRef() = 0.0; - + particleCloud_.averagingM().setScalarSum ( d2Field_, @@ -164,7 +164,7 @@ void dSauter::setForce() const particleCloud_.particleWeights(), NULL ); - + particleCloud_.averagingM().setScalarSum ( d3Field_, @@ -172,7 +172,7 @@ void dSauter::setForce() const particleCloud_.particleWeights(), NULL ); - + forAll(dSauter_,cellI) { if(d2Field_[cellI] > ROOTVSMALL) @@ -180,11 +180,11 @@ void dSauter::setForce() const dSauter_[cellI] = d3Field_[cellI] / d2Field_[cellI] * scale; } else - { - dSauter_[cellI] = SMALL; - } + { + dSauter_[cellI] = SMALL; + } } - + dSauter_.correctBoundaryConditions(); } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C b/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C index 6f6f1aa7..7056a3c0 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C @@ -67,12 +67,12 @@ granKineticEnergy::granKineticEnergy ), sm.mesh(), dimensionedScalar("zero", dimensionSet(0,2,-2,0,0), 0), - "zeroGradient" + "zeroGradient" ) { allocateMyArrays(); granKineticEnergy_.write(); - + // init force sub model setForceSubModels(propsDict_); @@ -101,17 +101,17 @@ void granKineticEnergy::setForce() const label cellI=0; vector velfluc(0,0,0); - + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; if(cellI >= 0) { - velfluc = particleCloud_.velocity(index) - UsField_[cellI]; - vfluc_[index][0] = magSqr(velfluc); - } + velfluc = particleCloud_.velocity(index) - UsField_[cellI]; + vfluc_[index][0] = magSqr(velfluc); + } } - + granKineticEnergy_.primitiveFieldRef() = 0.0; particleCloud_.averagingM().resetWeightFields(); @@ -120,10 +120,10 @@ void granKineticEnergy::setForce() const granKineticEnergy_, vfluc_, particleCloud_.particleWeights(), - particleCloud_.averagingM().UsWeightField(), + particleCloud_.averagingM().UsWeightField(), NULL ); - + granKineticEnergy_ *= 0.5; } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C index 94c3a886..8130bb40 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C @@ -90,14 +90,14 @@ virtualMassForce::virtualMassForce //Extra switches/settings if(propsDict_.found("splitUrelCalculation")) { - splitUrelCalculation_ = readBool(propsDict_.lookup("splitUrelCalculation")); + splitUrelCalculation_ = readBool(propsDict_.lookup("splitUrelCalculation")); if(splitUrelCalculation_) Info << "Virtual mass model: will split the Urel calculation\n"; Info << "WARNING: be sure that LIGGGHTS integration takes ddtv_p implicitly into account! \n"; } if(propsDict_.found("Cadd")) { - Cadd_ = readScalar(propsDict_.lookup("Cadd")); + Cadd_ = readScalar(propsDict_.lookup("Cadd")); Info << "Virtual mass model: using non-standard Cadd = " << Cadd_ << endl; } @@ -146,7 +146,7 @@ void virtualMassForce::setForce() const #include "setupProbeModel.H" - bool haveUrelOld_(false); + bool haveUrelOld_(false); for(int index = 0;index < particleCloud_.numberOfParticles(); index++) { @@ -156,19 +156,19 @@ void virtualMassForce::setForce() const if (cellI > -1) // particle Found { - if(forceSubM(0).interpolation()) + if(forceSubM(0).interpolation()) { - position = particleCloud_.position(index); - Ufluid = UInterpolator_.interpolate(position,cellI); + position = particleCloud_.position(index); + Ufluid = UInterpolator_.interpolate(position,cellI); } else { Ufluid = U_[cellI]; } - + if(splitUrelCalculation_) //if split, just use total derivative of fluid velocity - if(forceSubM(0).interpolation()) + if(forceSubM(0).interpolation()) { DDtU = DDtUInterpolator_.interpolate(position,cellI); } @@ -182,7 +182,7 @@ void virtualMassForce::setForce() const Ur = Ufluid - Us; } - + //Check of particle was on this CPU the last step if(UrelOld_[index][0]==NOTONCPU) //use 1. element to indicate that particle was on this CPU the last time step haveUrelOld_ = false; @@ -229,7 +229,7 @@ void virtualMassForce::setForce() const } else //particle not on this CPU UrelOld_[index][0]=NOTONCPU; - + // write particle based data to global array forceSubM(0).partToArray(index,virtualMassForce,vector::zero); } From dc8ca8b5206be5f561f61706ae2cfce2a72022e7 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 11 May 2017 19:10:12 +0200 Subject: [PATCH 13/99] pass label by value instead of reference index does not get modified; also avoid potential problems in case int needs to be cast to a label of different size; --- .../forceModel/forceSubModels/ScaleForce/ScaleForce.C | 2 +- .../forceModel/forceSubModels/ScaleForce/ScaleForce.H | 4 ++-- .../forceModel/forceSubModels/forceSubModel/forceSubModel.C | 2 +- .../forceModel/forceSubModels/forceSubModel/forceSubModel.H | 2 +- .../forceSubModels/scaleForceBoundary/scaleForceBoundary.C | 2 +- .../forceSubModels/scaleForceBoundary/scaleForceBoundary.H | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.C index 942d3a59..89527e65 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.C @@ -62,7 +62,7 @@ ScaleForce::~ScaleForce() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void ScaleForce::partToArray ( - label& index, + label index, vector& dragTot, const vector& dragEx, const vector& Ufluid, diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H index cd44fee5..95f8a455 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H @@ -70,8 +70,8 @@ public: // Member Functions - - void partToArray(label&, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const; + + void partToArray(label, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const; word myType() const{return typeName; }; }; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C index ba235213..1db018c6 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C @@ -131,7 +131,7 @@ forceSubModel::~forceSubModel() // * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * // void forceSubModel::partToArray ( - label& index, + label index, vector& dragTot, const vector& dragEx, const vector& Ufluid, diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H index f64173bf..4e0a3d3a 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H @@ -130,7 +130,7 @@ public: // Member Functions - virtual void partToArray(label&, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const; + virtual void partToArray(label, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const; virtual void explicitCorr(vector&, vector&, scalar&, vector&, const vector&, vector&, const vector&, bool,label index=100) const; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C index 0270881b..48ba4c4b 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C @@ -97,7 +97,7 @@ scaleForceBoundary::~scaleForceBoundary() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void scaleForceBoundary::partToArray ( - label& index, + label index, vector& dragTot, const vector& dragEx, const vector& Ufluid, diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H index 807c860f..d12ef476 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H @@ -82,10 +82,10 @@ public: // Member Functions - - void partToArray(label&, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const; - word myType() const{return typeName; }; + void partToArray(label, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const; + + word myType() const {return typeName; } }; From d1dc21acb8ece0320610278a9ce290bf6aa60388 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 11 May 2017 19:12:07 +0200 Subject: [PATCH 14/99] clean up whitespaces --- .../forceModel/Archimedes/Archimedes.C | 2 +- .../forceModel/ArchimedesIB/ArchimedesIB.C | 6 +++--- .../forceSubModels/ScaleForce/ScaleForce.H | 4 ++-- .../forceSubModel/forceSubModel.C | 16 +++++++-------- .../scaleForceBoundary/scaleForceBoundary.C | 20 +++++++++---------- .../scaleForceBoundary/scaleForceBoundary.H | 14 ++++++------- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C index 50f5a7e4..91094519 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C @@ -71,7 +71,7 @@ Archimedes::Archimedes particleCloud_.probeM().initialize(typeName, "archimedesF.logDat"); particleCloud_.probeM().vectorFields_.append("archimedesForce"); //first entry must the be the force particleCloud_.probeM().scalarFields_.append("Vp"); - particleCloud_.probeM().writeHeader(); + particleCloud_.probeM().writeHeader(); if (propsDict_.found("twoDimensional")) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C index 46c016b6..01501c1c 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C @@ -71,7 +71,7 @@ ArchimedesIB::ArchimedesIB //Append the field names to be probed particleCloud_.probeM().initialize(typeName, "archimedesIBF.logDat"); particleCloud_.probeM().vectorFields_.append("archimedesIBForce"); //first entry must the be the force - particleCloud_.probeM().writeHeader(); + particleCloud_.probeM().writeHeader(); if (propsDict_.found("twoDimensional")) { @@ -120,8 +120,8 @@ void ArchimedesIB::setForce() const if (cellI > -1) // particle Found { //force += -g_.value()*forceSubM(0).rhoField()[cellI]*forceSubM(0).rhoField().mesh().V()[cellI]*(1-particleCloud_.voidfractions()[index][subCell]);//mod by alice - force += -g_.value()*forceSubM(0).rhoField()[cellI]*particleCloud_.mesh().V()[cellI]*(1-voidfractions_[cellI]);//mod by alice - } + force += -g_.value()*forceSubM(0).rhoField()[cellI]*particleCloud_.mesh().V()[cellI]*(1-voidfractions_[cellI]);//mod by alice + } } //Set value fields and write the probe diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H index 95f8a455..47715b85 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/ScaleForce/ScaleForce.H @@ -41,9 +41,9 @@ class ScaleForce public forceSubModel { private: - + dictionary propsDict_; - + word scaleFieldName_; const volScalarField& scaleField_; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C index 1db018c6..84ecc272 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C @@ -145,11 +145,11 @@ void forceSubModel::partToArray { for(int j=0;j<3;j++) myForceM().expForces()[index][j] += dragTot[j]; - } + } else //implicit treatment, taking explicit force contribution into account { - for(int j=0;j<3;j++) - { + for(int j=0;j<3;j++) + { myForceM().impForces()[index][j] += dragTot[j] - dragEx[j]; //only consider implicit part! myForceM().expForces()[index][j] += dragEx[j]; } @@ -166,7 +166,7 @@ void forceSubModel::partToArray } else { - for(int j=0;j<3;j++) + for(int j=0;j<3;j++) myForceM().DEMForces()[index][j] += dragTot[j]; } } @@ -183,7 +183,7 @@ void forceSubModel::explicitCorr vector& Us, const vector& UsCell, bool verbose, - label index + label index ) const { dragExplicit=vector::zero; @@ -201,9 +201,9 @@ void forceSubModel::readSwitches() const Info << " looking for " << switchesNameList_[i] << " ..." << endl; if (dict_.found(switchesNameList_[i])) switches_[i]=Switch(dict_.lookup(switchesNameList_[i])); - + Info << "\t" << switchesNameList_[i] << " = " << switches_[i] << endl; - } + } } Info << endl; @@ -259,7 +259,7 @@ void forceSubModel::readSwitches() const // look for old nomenclature if (dict_.found("treatExplicit") || dict_.found("treatDEM") || dict_.found("implDEM")) FatalError<< "You are using an old nomenclature for force model settings, please have a look at the forceSubModel doc." << abort(FatalError); - + // look for old nomenclature if (dict_.found("verbose")) Warning<< "Please make sure you use the new nomenclature for verbose force model settings, please have a look at the forceSubModel doc." << endl; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C index 48ba4c4b..aa2b0639 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.C @@ -56,35 +56,35 @@ scaleForceBoundary::scaleForceBoundary if (propsDict_.found("x1") && propsDict_.found("x2")) { coordinateInner_=readScalar(propsDict_.lookup ("x1")); - coordinateOuter_=readScalar(propsDict_.lookup ("x2")); - dim_ = 0; + coordinateOuter_=readScalar(propsDict_.lookup ("x2")); + dim_ = 0; Info << "scaleForceBoundary: Limiting force in x direction." << endl; } else if (propsDict_.found("y1") && propsDict_.found("y2")) { coordinateInner_=readScalar(propsDict_.lookup ("y1")); - coordinateOuter_=readScalar(propsDict_.lookup ("y2")); - dim_ = 1; + coordinateOuter_=readScalar(propsDict_.lookup ("y2")); + dim_ = 1; Info << "scaleForceBoundary: Limiting force in y direction." << endl; } else if (propsDict_.found("z1") && propsDict_.found("z2")) { coordinateInner_=readScalar(propsDict_.lookup ("z1")); - coordinateOuter_=readScalar(propsDict_.lookup ("z2")); - dim_ = 2; + coordinateOuter_=readScalar(propsDict_.lookup ("z2")); + dim_ = 2; Info << "scaleForceBoundary: Limiting force in z direction." << endl; } - + if (propsDict_.found("outerValue")) outerVal_=readScalar(propsDict_.lookup ("outerValue")); - + if(coordinateOuter_ > coordinateInner_) orientation_ = 1; else orientation_ = -1; - + dist_ = fabs(coordinateOuter_ - coordinateInner_); - + } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H index d12ef476..8a4f65cd 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/scaleForceBoundary/scaleForceBoundary.H @@ -45,19 +45,19 @@ class scaleForceBoundary public forceSubModel { private: - + dictionary propsDict_; - + scalar coordinateInner_; - + scalar coordinateOuter_; - + scalar dist_; - + scalar outerVal_; - + int dim_; - + int orientation_; public: From 1e5bc6ef8940fdc890dce0bb3ba29696a34d9d75 Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 12 May 2017 10:06:03 +0200 Subject: [PATCH 15/99] remove unneeded checks delete NULL is a valid operation --- .../dataExchangeModel/dataExchangeModel/dataExchangeModel.C | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C index 0bd182fc..df0ed4c4 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C @@ -168,7 +168,6 @@ void dataExchangeModel::allocateArray void dataExchangeModel::destroy(int* array) const { - if (array == NULL) return; delete [] array; } //==== @@ -191,8 +190,6 @@ void dataExchangeModel::allocateArray void dataExchangeModel::destroy(double* array) const { - if (array == NULL) return; - delete [] array; } //==== From a6875d8a4ab2114051e1ca3d86b129a0090f1a2d Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 16 May 2017 09:37:50 +0200 Subject: [PATCH 16/99] use typename of force models for log file name --- .../cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C | 2 +- .../subModels/forceModel/ArchimedesIB/ArchimedesIB.C | 2 +- .../subModels/forceModel/BeetstraDrag/BeetstraDrag.C | 2 +- .../subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C | 2 +- .../cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C | 2 +- .../subModels/forceModel/GidaspowDrag/GidaspowDrag.C | 2 +- .../subModels/forceModel/KochHillDrag/KochHillDrag.C | 2 +- .../cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C | 2 +- .../forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C | 2 +- .../subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C | 2 +- .../cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C | 2 +- .../subModels/forceModel/virtualMassForce/virtualMassForce.C | 2 +- .../cfdemParticle/subModels/forceModel/viscForce/viscForce.C | 2 +- .../subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C index 91094519..34c2ef38 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C @@ -68,7 +68,7 @@ Archimedes::Archimedes { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "archimedesF.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("archimedesForce"); //first entry must the be the force particleCloud_.probeM().scalarFields_.append("Vp"); particleCloud_.probeM().writeHeader(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C index 01501c1c..04ac6ada 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C @@ -69,7 +69,7 @@ ArchimedesIB::ArchimedesIB g_(sm.mesh().lookupObject (gravityFieldName_)) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "archimedesIBF.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("archimedesIBForce"); //first entry must the be the force particleCloud_.probeM().writeHeader(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C index 779a7a42..5ca4dd5c 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C @@ -59,7 +59,7 @@ BeetstraDrag::BeetstraDrag scaleDrag_(1.) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "BeetstraDrag.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must be the force particleCloud_.probeM().vectorFields_.append("Urel"); particleCloud_.probeM().scalarFields_.append("Rep"); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C index 29bc0ef7..4b04dbb7 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C @@ -74,7 +74,7 @@ DiFeliceDrag::DiFeliceDrag scaleDrag_(1.) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "diFeliceDrag.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C index 17fffd4e..addd2055 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C @@ -66,7 +66,7 @@ ErgunStatFines::ErgunStatFines switchingVoidfraction_(0.8) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "ErgunStatFines.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must be the force particleCloud_.probeM().vectorFields_.append("Urel"); particleCloud_.probeM().scalarFields_.append("Rep"); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C index eaaeb94a..8bc530e9 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C @@ -75,7 +75,7 @@ GidaspowDrag::GidaspowDrag switchingVoidfraction_(0.8) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "gidaspowDrag.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must be the force particleCloud_.probeM().vectorFields_.append("Urel"); particleCloud_.probeM().scalarFields_.append("Rep"); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C index 8a7ec04f..94d9b7e3 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C @@ -74,7 +74,7 @@ KochHillDrag::KochHillDrag scaleDrag_(1.) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "kochHillDrag.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C index d8f688d6..1f804f38 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C @@ -82,7 +82,7 @@ MeiLift::MeiLift particleCloud_.checkCG(false); //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "meiLift.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("liftForce"); //first entry must the be the force particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug particleCloud_.probeM().vectorFields_.append("vorticity"); //other are debug diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C index 3fc632cd..a28f5133 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C @@ -69,7 +69,7 @@ SchillerNaumannDrag::SchillerNaumannDrag U_(sm.mesh().lookupObject (velFieldName_)) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "schillerNaumannDrag.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C index 59569a45..53f4f338 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C @@ -72,7 +72,7 @@ ShirgaonkarIB::ShirgaonkarIB p_(sm.mesh().lookupObject (pressureFieldName_)) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "shirgaonkarIB.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force particleCloud_.probeM().writeHeader(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C index 1885294c..734472da 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C @@ -113,7 +113,7 @@ gradPForce::gradPForce particleCloud_.checkCG(true); - particleCloud_.probeM().initialize(typeName, "gradP.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("gradPForce"); //first entry must the be the force particleCloud_.probeM().scalarFields_.append("Vs"); particleCloud_.probeM().scalarFields_.append("rho"); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C index 8130bb40..18b4647e 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C @@ -104,7 +104,7 @@ virtualMassForce::virtualMassForce particleCloud_.checkCG(true); //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "virtualMass.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("virtualMassForce"); //first entry must the be the force particleCloud_.probeM().vectorFields_.append("Urel"); particleCloud_.probeM().vectorFields_.append("UrelOld"); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C index 571915ab..ec0f0642 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C @@ -109,7 +109,7 @@ viscForce::viscForce particleCloud_.checkCG(true); //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "visc.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("viscForce"); //first entry must the be the force particleCloud_.probeM().scalarFields_.append("Vs"); particleCloud_.probeM().writeHeader(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C index 27b4f278..e2c4d107 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C @@ -75,7 +75,7 @@ DiFeliceDragMS::DiFeliceDragMS //dH_(readScalar(propsDict_.lookup("hydraulicDiameter"))) { //Append the field names to be probed - particleCloud_.probeM().initialize(typeName, "diFeliceDrag.logDat"); + particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug From 91139084290d47e8195db94974595fdf59fa04b3 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 16 May 2017 11:40:27 +0200 Subject: [PATCH 17/99] clean up whitespaces --- .../forceModel/Archimedes/Archimedes.C | 12 +- .../forceModel/ArchimedesIB/ArchimedesIB.C | 2 +- .../forceModel/BeetstraDrag/BeetstraDrag.C | 13 +- .../forceModel/BeetstraDrag/BeetstraDrag.H | 2 +- .../forceModel/DiFeliceDrag/DiFeliceDrag.C | 28 ++- .../forceModel/DiFeliceDrag/DiFeliceDrag.H | 2 +- .../forceModel/Fines/ErgunStatFines.C | 54 ++-- .../forceModel/Fines/ErgunStatFines.H | 10 +- .../forceModel/Fines/FanningDynFines.C | 28 ++- .../forceModel/Fines/FanningDynFines.H | 14 +- .../subModels/forceModel/Fines/Fines.H | 2 +- .../subModels/forceModel/Fines/FinesFields.C | 235 +++++++++--------- .../subModels/forceModel/Fines/FinesFields.H | 86 +++---- .../forceModel/GidaspowDrag/GidaspowDrag.C | 43 ++-- .../forceModel/GidaspowDrag/GidaspowDrag.H | 2 +- .../forceModel/KochHillDrag/KochHillDrag.C | 18 +- .../forceModel/KochHillDrag/KochHillDrag.H | 6 +- .../KochHillRWDrag/KochHillRWDrag.C | 18 +- .../KochHillRWDrag/KochHillRWDrag.H | 4 +- .../LaEuScalarTemp/LaEuScalarTemp.C | 10 +- .../LaEuScalarTemp/LaEuScalarTemp.H | 4 +- .../subModels/forceModel/MeiLift/MeiLift.C | 48 ++-- .../subModels/forceModel/dSauter/dSauter.C | 22 +- .../forceModel/gradPForce/gradPForce.C | 27 +- .../granKineticEnergy/granKineticEnergy.C | 6 +- .../DiFeliceDragMS/DiFeliceDragMS.C | 36 +-- .../DiFeliceDragMS/DiFeliceDragMS.H | 2 +- 27 files changed, 384 insertions(+), 350 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C index 34c2ef38..18172461 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C @@ -88,13 +88,15 @@ Archimedes::Archimedes forceSubM(0).setSwitchesList(1,true); // activate treatForceDEM switch forceSubM(0).readSwitches(); - if (modelType_=="A" || modelType_=="Bfull"){ + if (modelType_=="A" || modelType_=="Bfull") + { if(!forceSubM(0).switches()[1]) // treatDEM != true { Warning << "Usually model type A and Bfull need Archimedes only on DEM side only (treatForceDEM=true)! are you sure about your settings?" << endl; } } - if (modelType_=="B"){ + else if (modelType_=="B") + { if(forceSubM(0).switches()[1]) // treatDEM = true { Warning << "Usually model type B needs Archimedes on CFD and DEM side (treatForceDEM=false)! are you sure about your settings?" << endl; @@ -119,7 +121,7 @@ void Archimedes::setForce() const #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { //if(mask[index][0]) //{ @@ -133,7 +135,9 @@ void Archimedes::setForce() const scalar r = particleCloud_.radius(index); force = -g_.value()*forceSubM(0).rhoField()[cellI]*r*r*M_PI; // circle area Warning << "Archimedes::setForce() : this functionality is not tested!" << endl; - }else{ + } + else + { force = -g_.value()*forceSubM(0).rhoField()[cellI]*particleCloud_.particleVolume(index); } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C index 04ac6ada..55f49a3e 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C @@ -109,7 +109,7 @@ void ArchimedesIB::setForce() const #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { //if(mask[index][0]) //{ diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C index 5ca4dd5c..f49d087d 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C @@ -97,8 +97,11 @@ BeetstraDrag::~BeetstraDrag() void BeetstraDrag::setForce() const { if (scaleDia_ > 1) + { Info << "Beetstra using scale = " << scaleDia_ << endl; - else if (particleCloud_.cg() > 1){ + } + else if (particleCloud_.cg() > 1) + { scaleDia_=particleCloud_.cg(); Info << "Beetstra using scale from liggghts cg = " << scaleDia_ << endl; } @@ -125,13 +128,13 @@ void BeetstraDrag::setForce() const vector dragExplicit(0,0,0); scalar dragCoefficient(0); - + interpolationCellPoint voidfractionInterpolator_(voidfraction_); interpolationCellPoint UInterpolator_(U_); #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; drag = vector(0,0,0); @@ -163,7 +166,7 @@ void BeetstraDrag::setForce() const Ur = Ufluid-Us; magUr = mag(Ur); ds = 2*particleCloud_.radius(index); - ds_scaled = ds/scaleDia_; + ds_scaled = ds/scaleDia_; rho = rhoField[cellI]; nuf = nufField[cellI]; @@ -171,7 +174,7 @@ void BeetstraDrag::setForce() const localPhiP = 1.0f-voidfraction+SMALL; // calc particle's drag coefficient (i.e., Force per unit slip velocity and Stokes drag) - + Rep=ds_scaled*voidfraction*magUr/nuf+SMALL; dragCoefficient = 10.0*localPhiP/(voidfraction*voidfraction) + voidfraction*voidfraction*(1.0+1.5*Foam::sqrt(localPhiP)) + diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.H index a36ab894..f6e079ab 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.H @@ -51,7 +51,7 @@ private: const volScalarField& voidfraction_; - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C index 4b04dbb7..4960cd01 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C @@ -34,8 +34,6 @@ Description #include "DiFeliceDrag.H" #include "addToRunTimeSelectionTable.H" -//#include - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -75,11 +73,11 @@ DiFeliceDrag::DiFeliceDrag { //Append the field names to be probed particleCloud_.probeM().initialize(typeName, typeName+".logDat"); - particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force - particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug - particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug - particleCloud_.probeM().scalarFields_.append("Cd"); //other are debug - particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug + particleCloud_.probeM().vectorFields_.append("dragForce"); // first entry must the be the force + particleCloud_.probeM().vectorFields_.append("Urel"); // other are debug + particleCloud_.probeM().scalarFields_.append("Rep"); // other are debug + particleCloud_.probeM().scalarFields_.append("Cd"); // other are debug + particleCloud_.probeM().scalarFields_.append("voidfraction"); // other are debug particleCloud_.probeM().writeHeader(); particleCloud_.checkCG(true); @@ -114,15 +112,18 @@ DiFeliceDrag::~DiFeliceDrag() void DiFeliceDrag::setForce() const { if (scaleDia_ > 1) + { Info << "DiFeliceDrag using scale = " << scaleDia_ << endl; - else if (particleCloud_.cg() > 1){ + } + else if (particleCloud_.cg() > 1) + { scaleDia_=particleCloud_.cg(); Info << "DiFeliceDrag using scale from liggghts cg = " << scaleDia_ << endl; } const volScalarField& nufField = forceSubM(0).nuField(); const volScalarField& rhoField = forceSubM(0).rhoField(); - + vector position(0,0,0); scalar voidfraction(1); vector Ufluid(0,0,0); @@ -144,7 +145,7 @@ void DiFeliceDrag::setForce() const #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); index++) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; drag = vector(0,0,0); @@ -159,7 +160,8 @@ void DiFeliceDrag::setForce() const position = particleCloud_.position(index); voidfraction = voidfractionInterpolator_.interpolate(position,cellI); Ufluid = UInterpolator_.interpolate(position,cellI); - }else + } + else { voidfraction = voidfraction_[cellI]; Ufluid = U_[cellI]; @@ -189,8 +191,8 @@ void DiFeliceDrag::setForce() const // calc particle's drag dragCoefficient = 0.125*Cd*rho *M_PI - *ds*ds - *scaleDia_ + *ds*ds + *scaleDia_ *pow(voidfraction,(2-Xi))*magUr *scaleDrag_; if (modelType_=="B") diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H index a043b28e..b92e8c0f 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.H @@ -68,7 +68,7 @@ private: const volScalarField& voidfraction_; - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; // the average particle velocity field (for implicit/expliti force split) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C index addd2055..e696308f 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C @@ -86,17 +86,17 @@ ErgunStatFines::ErgunStatFines particleCloud_.checkCG(true); if (propsDict_.found("scale")) - scaleDia_=scalar(readScalar(propsDict_.lookup("scale"))); + scaleDia_ = scalar(readScalar(propsDict_.lookup("scale"))); if (propsDict_.found("scaleDrag")) - scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag"))); + scaleDrag_ = scalar(readScalar(propsDict_.lookup("scaleDrag"))); if (propsDict_.found("switchingVoidfraction")) switchingVoidfraction_ = readScalar(propsDict_.lookup("switchingVoidfraction")); dictionary SauterDict(dict.subDict("dSauterProps")); if (SauterDict.found("scaleDist")) - scaleDist_=scalar(readScalar(SauterDict.lookup("scaleDist"))); - + scaleDist_ = scalar(readScalar(SauterDict.lookup("scaleDist"))); + } @@ -117,7 +117,9 @@ scalar ErgunStatFines::dSauter(label cellI) const void ErgunStatFines::setForce() const { if (scaleDia_ > 1) + { Info << "ErgunStatFines using scale = " << scaleDia_ << endl; + } else if (particleCloud_.cg() > 1) { scaleDia_=particleCloud_.cg(); @@ -131,7 +133,7 @@ void ErgunStatFines::setForce() const scalar voidfraction(1); vector Ufluid(0,0,0); vector drag(0,0,0); - label cellI=0; + label cellI = 0; vector Us(0,0,0); vector Ur(0,0,0); @@ -144,13 +146,13 @@ void ErgunStatFines::setForce() const scalar alphaPartEff(0); scalar CdMagUrLag(0); //Cd of the very particle - scalar betaP(0); //momentum exchange of the very particle + scalar betaP(0); //momentum exchange of the very particle vector dragExplicit(0,0,0); scalar dragCoefficient(0); scalar scaleDia3 = scaleDia_*scaleDia_*scaleDia_; - + interpolationCellPoint voidfractionInterpolator_(voidfraction_); interpolationCellPoint UInterpolator_(U_); @@ -158,15 +160,15 @@ void ErgunStatFines::setForce() const if(forceSubM(0).verbose()) Info << "Entering force loop of ErgunStatFines.\n" << endl; - - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) - { + + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) + { cellI = particleCloud_.cellIDs()[index][0]; drag = vector(0,0,0); dragExplicit = vector(0,0,0); betaP = 0; - Ufluid =vector(0,0,0); - voidfraction=0; + Ufluid = vector(0,0,0); + voidfraction = 0; dragCoefficient = 0; if (cellI > -1) // particle found @@ -174,34 +176,34 @@ void ErgunStatFines::setForce() const if( forceSubM(0).interpolation() ) { - position = particleCloud_.position(index); + position = particleCloud_.position(index); voidfraction = voidfractionInterpolator_.interpolate(position,cellI); - Ufluid = UInterpolator_.interpolate(position,cellI); + Ufluid = UInterpolator_.interpolate(position,cellI); } else { - voidfraction = voidfraction_[cellI]; + voidfraction = voidfraction_[cellI]; Ufluid = U_[cellI]; } // ensure voidfraction to be meaningful // problems could arise from interpolation or empty cells - if(voidfraction>0.999) + if(voidfraction > 0.999) voidfraction = 0.999; - else if(voidfraction<0.05) + else if(voidfraction < 0.05) voidfraction = 0.05; Us = particleCloud_.velocity(index); Ur = Ufluid-Us; magUr = mag(Ur); - dSauterMix = dSauterMix_[cellI]; - ds = 2*particleCloud_.radius(index); + dSauterMix = dSauterMix_[cellI]; + ds = 2*particleCloud_.radius(index); rho = rhoField[cellI]; nuf = nufField[cellI]; - Rep=0.0; - alphaPartEff = 1.0 - voidfraction + alphaSt_[cellI] + SMALL; + Rep = 0.0; + alphaPartEff = 1.0 - voidfraction + alphaSt_[cellI] + SMALL; // calc particle's drag coefficient (i.e., Force per unit slip velocity and per m³ PARTICLE) if(voidfraction > switchingVoidfraction_) //dilute, no static hold-up present @@ -210,7 +212,7 @@ void ErgunStatFines::setForce() const CdMagUrLag = (24.0*nuf/(dSauterMix*voidfraction)) //1/magUr missing here, but compensated in expression for betaP! *(scalar(1.0)+0.15*Foam::pow(Rep, 0.687)); - betaP = 0.75* alphaPartEff * ( + betaP = 0.75* alphaPartEff * ( rho*voidfraction*CdMagUrLag / (dSauterMix*Foam::pow(voidfraction,2.65)) @@ -224,12 +226,12 @@ void ErgunStatFines::setForce() const (1.75 * magUr * rho * alphaPartEff) /((dSauterMix*phi_)); } - + // calc particle's drag betaP /= (1-alphaPartEff); dragCoefficient = M_PI/6 * ds/scaleDia_ * ds/scaleDia_ * dSauter(cellI) * voidfraction / (1 - voidfraction) * betaP * scaleDrag_; dragCoefficient *= scaleDia3; - if (modelType_=="B") + if (modelType_ == "B") dragCoefficient /= voidfraction; drag = dragCoefficient * Ur; @@ -237,7 +239,7 @@ void ErgunStatFines::setForce() const // explicitCorr forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose()); - if(forceSubM(0).verbose() && index >=0 && index <2) + if(forceSubM(0).verbose() && index >= 0 && index < 2) { Pout << "cellI = " << cellI << endl; Pout << "index = " << index << endl; @@ -271,7 +273,7 @@ void ErgunStatFines::setForce() const forceSubM(0).partToArray(index,drag,dragExplicit,Ufluid,dragCoefficient); }// end loop particles - + if(forceSubM(0).verbose()) Pout << "Leaving force loop of ErgunStatFines.\n" << endl; } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.H b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.H index 1b33e30e..00bb186a 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.H @@ -50,18 +50,18 @@ private: word voidfractionFieldName_; const volScalarField& voidfraction_; - + const volScalarField& dSauter_; - + const volScalarField& dSauterMix_; - + const volScalarField& alphaP_; - + const volScalarField& alphaSt_; const scalar phi_; - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; // the average particle velocity field diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C index 997cfdf4..5096ace0 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C @@ -72,9 +72,9 @@ FanningDynFines::FanningDynFines particleCloud_.checkCG(true); if (propsDict_.found("scale")) - scaleDia_=scalar(readScalar(propsDict_.lookup("scale"))); + scaleDia_ = scalar(readScalar(propsDict_.lookup("scale"))); if (propsDict_.found("scaleDrag")) - scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag"))); + scaleDrag_ = scalar(readScalar(propsDict_.lookup("scaleDrag"))); } @@ -91,18 +91,20 @@ void FanningDynFines::setForce() const { if(forceSubM(0).verbose()) Info << "Entering force loop of FanningDynFines.\n" << endl; - + if (scaleDia_ > 1) + { Info << "FanningDynFines using scale = " << scaleDia_ << endl; + } else if (particleCloud_.cg() > 1) { scaleDia_=particleCloud_.cg(); Info << "FanningDynFines using scale from liggghts cg = " << scaleDia_ << endl; } - + vector UDyn(0,0,0); vector drag(0,0,0); - label cellI=0; + label cellI = 0; vector Us(0,0,0); vector Ur(0,0,0); @@ -111,11 +113,11 @@ void FanningDynFines::setForce() const scalar scaleDia3 = scaleDia_*scaleDia_*scaleDia_; scalar dragCoefficient(0); - + #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; drag = vector(0,0,0); @@ -127,14 +129,14 @@ void FanningDynFines::setForce() const UDyn = UDyn_[cellI]; Us = UsField_[cellI]; Ur = UDyn-Us; - ds = 2*particleCloud_.radius(index); - ds_scaled = ds/scaleDia_; - + ds = 2 * particleCloud_.radius(index); + ds_scaled = ds/scaleDia_; + dragCoefficient = FanningCoeff_[cellI]; // calc particle's drag dragCoefficient *= M_PI/6 * ds_scaled * ds_scaled / alphaP_[cellI] * dSauter_[cellI] * scaleDia3 * scaleDrag_; - if (modelType_=="B") + if (modelType_ == "B") dragCoefficient /= voidfraction_[cellI]; drag = dragCoefficient * Ur; @@ -143,8 +145,8 @@ void FanningDynFines::setForce() const // write particle based data to global array forceSubM(0).partToArray(index,drag,vector::zero); } - - if(forceSubM(0).verbose()) + + if (forceSubM(0).verbose()) Info << "Leaving force loop of FanningDynFines.\n" << endl; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.H b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.H index 195de6c6..090ece60 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.H @@ -41,7 +41,7 @@ class FanningDynFines public forceModel { private: - + dictionary propsDict_; word velFieldName_; @@ -52,22 +52,22 @@ private: const volScalarField& voidfraction_; - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; - + const volVectorField& UDyn_; - + const volScalarField& FanningCoeff_; - + const volScalarField& alphaP_; - + const volScalarField& dSauter_; mutable scalar scaleDia_; mutable scalar scaleDrag_; - + public: diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/Fines.H b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/Fines.H index a6ff8d71..06153a63 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/Fines.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/Fines.H @@ -41,7 +41,7 @@ class Fines public forceModel { private: - mutable FinesFields finesFields_; + mutable FinesFields finesFields_; public: diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.C index 8f6b3b30..1147bbe6 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.C @@ -56,7 +56,7 @@ FinesFields::FinesFields p_(sm.mesh().lookupObject (pFieldName_)), rhoGFieldName_(propsDict_.lookupOrDefault("rhoGFieldName","rho")), rhoG_(sm.mesh().lookupObject (rhoGFieldName_)), - dSauter_(sm.mesh().lookupObject ("dSauter")), + dSauter_(sm.mesh().lookupObject ("dSauter")), alphaG_ ( IOobject ( @@ -126,7 +126,7 @@ FinesFields::FinesFields ), sm.mesh(), dimensionedScalar("zero", dimensionSet(0,1,0,0,0), 0), - "zeroGradient" + "zeroGradient" ), DragCoeff_ ( IOobject @@ -151,7 +151,7 @@ FinesFields::FinesFields ), sm.mesh(), dimensionedScalar("zero", dimensionSet(0,1,0,0,0), 0), - "zeroGradient" + "zeroGradient" ), FanningCoeff_ ( IOobject @@ -199,8 +199,8 @@ FinesFields::FinesFields IOobject::NO_WRITE ), sm.mesh(), - dimensionedScalar("zero", dimensionSet(1,0,-1,0,0), 0) - //dimensionedVector("zero", dimensionSet(1,-2,-1,0,0), vector::zero) + dimensionedScalar("zero", dimensionSet(1,0,-1,0,0), 0) + //dimensionedVector("zero", dimensionSet(1,-2,-1,0,0), vector::zero) ), uDyn_ ( IOobject @@ -243,12 +243,12 @@ FinesFields::FinesFields if (propsDict_.found("rhoFine")) rhoFine_.value()=readScalar(propsDict_.lookup ("rhoFine")); else - FatalError <<"Please specify rhoFine.\n" << abort(FatalError); + FatalError <<"Please specify rhoFine.\n" << abort(FatalError); if (propsDict_.found("nuAve")) nuAve_.value()=readScalar(propsDict_.lookup ("nuAve")); if (propsDict_.found("alphaDynMax")) alphaDynMax_=readScalar(propsDict_.lookup ("alphaDynMax")); - + if(verbose_) { alphaG_.writeOpt() = IOobject::AUTO_WRITE; @@ -305,143 +305,144 @@ void FinesFields::update() } -void FinesFields::calcSource() +void FinesFields::calcSource() { - Sds_.primitiveFieldRef()=0; + Sds_.primitiveFieldRef() = 0; deltaAlpha_.primitiveFieldRef() = 0.0; scalar f(0.0); scalar critpore(0.0); scalar dmean(0.0); scalar d1(0.0); scalar d2(0.0); + forAll(Sds_,cellI) { // calculate everything in units auf dSauter critpore = nCrit_*dFine_.value()/dSauter_[cellI]; - // pore size from hydraulic radius - dmean = 2 * (1 - alphaP_[cellI]) / ( (1 + poresizeWidth_*poresizeWidth_/3) * 3 * alphaP_[cellI] ); - // Sweeney and Martin, Acta Materialia 51 (2003): ratio of hydraulic to pore throat radius - dmean /= ratioHydraulicPore_; - d1 = dmean * (1 - poresizeWidth_); - d2 = dmean * (1 + poresizeWidth_); - + // pore size from hydraulic radius + dmean = 2 * (1 - alphaP_[cellI]) / ( (1 + poresizeWidth_*poresizeWidth_/3) * 3 * alphaP_[cellI] ); + // Sweeney and Martin, Acta Materialia 51 (2003): ratio of hydraulic to pore throat radius + dmean /= ratioHydraulicPore_; + d1 = dmean * (1 - poresizeWidth_); + d2 = dmean * (1 + poresizeWidth_); + f = (critpore*critpore*critpore - d1 * d1 * d1) / (d2 * d2 * d2 - d1 * d1 * d1); - if (f<0) - { - f=0.0; - } - else if (f>1.0) - { - f=1.0; + if (f < 0) + { + f = 0.0; } - - // at this point, voidfraction is still calculated from the true particle sizes - deltaAlpha_[cellI] = f * (alphaMax_ - alphaP_[cellI]) - alphaSt_[cellI]; - // too much volume occupied: release it (50% per time step) - if (deltaAlpha_[cellI] < 0.0) - { - Sds_[cellI] = 0.5*deltaAlpha_[cellI]; - } - // volume too occupy available: deposit at most 80% of dyn hold up - else if (depRate_ * deltaAlpha_[cellI] > 0.8 * alphaDyn_[cellI]) - { - Sds_[cellI] = 0.8 * alphaDyn_[cellI]; - } - else - { - Sds_[cellI] = depRate_ * deltaAlpha_[cellI]; - } - } + else if (f > 1.0) + { + f = 1.0; + } + + // at this point, voidfraction is still calculated from the true particle sizes + deltaAlpha_[cellI] = f * (alphaMax_ - alphaP_[cellI]) - alphaSt_[cellI]; + // too much volume occupied: release it (50% per time step) + if (deltaAlpha_[cellI] < 0.0) + { + Sds_[cellI] = 0.5*deltaAlpha_[cellI]; + } + // volume too occupy available: deposit at most 80% of dyn hold up + else if (depRate_ * deltaAlpha_[cellI] > 0.8 * alphaDyn_[cellI]) + { + Sds_[cellI] = 0.8 * alphaDyn_[cellI]; + } + else + { + Sds_[cellI] = depRate_ * deltaAlpha_[cellI]; + } + } } -void FinesFields::integrateFields() +void FinesFields::integrateFields() { - + surfaceScalarField phiSt(linearInterpolate(UsField_) & particleCloud_.mesh().Sf()); surfaceScalarField phiDyn(linearInterpolate(uDyn_) & particleCloud_.mesh().Sf()); - + fvScalarMatrix alphaStEqn ( fvm::ddt(alphaSt_) - + fvm::div(phiSt,alphaSt_) - == - Sds_ + + fvm::div(phiSt,alphaSt_) + == + Sds_ ); fvScalarMatrix alphaDynEqn ( fvm::ddt(alphaDyn_) - + fvm::div(phiDyn,alphaDyn_) - - fvm::laplacian(diffCoeff_,alphaDyn_) - == - -Sds_ + + fvm::div(phiDyn,alphaDyn_) + - fvm::laplacian(diffCoeff_,alphaDyn_) + == + -Sds_ ); alphaStEqn.solve(); alphaDynEqn.solve(); - + if(smoothing_) particleCloud_.smoothingM().smoothen(alphaDyn_); - + // limit hold-ups, should be done more elegantly - + scalar alphaStErr(0.0); scalar alphaDynErr1(0.0); scalar alphaDynErr2(0.0); forAll(alphaSt_, cellI) { if (alphaSt_[cellI] < 0.0) - { - alphaStErr += alphaSt_[cellI] * particleCloud_.mesh().V()[cellI]; - alphaSt_[cellI] = 0.0; - } - - if (alphaDyn_[cellI] < 0.0) - { - alphaDynErr1 += alphaDyn_[cellI] * particleCloud_.mesh().V()[cellI]; - alphaDyn_[cellI] = 0.0; - } - else if (alphaDyn_[cellI] > alphaDynMax_) - { - alphaDynErr2 += (alphaDyn_[cellI] - alphaDynMax_) * particleCloud_.mesh().V()[cellI]; - alphaDyn_[cellI] = alphaDynMax_; - } + { + alphaStErr += alphaSt_[cellI] * particleCloud_.mesh().V()[cellI]; + alphaSt_[cellI] = 0.0; + } + + if (alphaDyn_[cellI] < 0.0) + { + alphaDynErr1 += alphaDyn_[cellI] * particleCloud_.mesh().V()[cellI]; + alphaDyn_[cellI] = 0.0; + } + else if (alphaDyn_[cellI] > alphaDynMax_) + { + alphaDynErr2 += (alphaDyn_[cellI] - alphaDynMax_) * particleCloud_.mesh().V()[cellI]; + alphaDyn_[cellI] = alphaDynMax_; + } } - + if (verbose_) { Sout << "[" << Pstream::myProcNo() << "] " << "amount of alphaSt added because of positivity requirement: " << -alphaStErr << endl; Sout << "[" << Pstream::myProcNo() << "] " << "amount of alphaDyn added because of positivity requirement: " << -alphaDynErr1 << endl; Sout << "[" << Pstream::myProcNo() << "] " << "amount of alphaDyn removed because of max. value: " << -alphaDynErr2 << endl; } - + alphaSt_.correctBoundaryConditions(); alphaDyn_.correctBoundaryConditions(); - + massFluxDyn_ = rhoFine_ * fvc::interpolate(alphaDyn_) * phiDyn; } -void FinesFields::updateAlphaG() +void FinesFields::updateAlphaG() { - alphaG_ = max(voidfraction_ - alphaSt_ - alphaDyn_, critVoidfraction_); + alphaG_ = max(voidfraction_ - alphaSt_ - alphaDyn_, critVoidfraction_); } -void FinesFields::updateAlphaP() +void FinesFields::updateAlphaP() { alphaP_ = 1.0 - voidfraction_ + SMALL; } -void FinesFields::updateDHydMix() +void FinesFields::updateDHydMix() { forAll(dHydMix_,cellI) { scalar aPSt = alphaP_[cellI] + alphaSt_[cellI]; - if(aPSt < SMALL || aPSt > 1 - SMALL) - dHydMix_[cellI] = SMALL; - else - dHydMix_[cellI] = 2*(1 - aPSt) / (3*aPSt ) * dSauterMix_[cellI]; + if(aPSt < SMALL || aPSt > 1 - SMALL) + dHydMix_[cellI] = SMALL; + else + dHydMix_[cellI] = 2*(1 - aPSt) / (3*aPSt ) * dSauterMix_[cellI]; } dHydMix_.correctBoundaryConditions(); } @@ -453,54 +454,54 @@ void FinesFields::updateDragCoeff() volScalarField Ref = dFine_ * alphaG_ / nuAve_ * mag(U_ - uDyn_); scalar Cd(0.0); scalar Ref1(0.0); - + // calculate drag coefficient for cells forAll(DragCoeff_,cellI) { Ref1 = Ref[cellI]; if(Ref1 <= SMALL) - Cd = 24.0 / SMALL; + Cd = 24.0 / SMALL; else if(Ref1 <= 1.0) - Cd = 24.0 / Ref1; - else if(Ref1 <= 1000) - Cd = 24 * (1.0 + 0.15 * Foam::pow(Ref1,0.687) ) / Ref1; - else - Cd = 0.44; - DragCoeff_[cellI] = Cd * beta[cellI]; + Cd = 24.0 / Ref1; + else if(Ref1 <= 1000) + Cd = 24 * (1.0 + 0.15 * Foam::pow(Ref1,0.687) ) / Ref1; + else + Cd = 0.44; + DragCoeff_[cellI] = Cd * beta[cellI]; } - + // calculate drag coefficient for faces forAll(DragCoeff_.boundaryField(), patchI) forAll(DragCoeff_.boundaryField()[patchI], faceI) { Ref1 = Ref.boundaryField()[patchI][faceI]; if(Ref1 <= SMALL) - Cd = 24.0 / SMALL; + Cd = 24.0 / SMALL; else if(Ref1 <= 1.0) - Cd = 24.0 / Ref1; - else if(Ref1 <= 1000) - Cd = 24 * (1.0 + 0.15 * Foam::pow(Ref1,0.687) ) / Ref1; - else - Cd = 0.44; - DragCoeff_.boundaryFieldRef()[patchI][faceI] = Cd * beta.boundaryFieldRef()[patchI][faceI]; + Cd = 24.0 / Ref1; + else if(Ref1 <= 1000) + Cd = 24 * (1.0 + 0.15 * Foam::pow(Ref1,0.687) ) / Ref1; + else + Cd = 0.44; + DragCoeff_.boundaryFieldRef()[patchI][faceI] = Cd * beta.boundaryFieldRef()[patchI][faceI]; } - + DragCoeff_ = max( DragCoeff_, dimensionedScalar("SMALL", dimensionSet(1,-3,-1,0,0), SMALL) ); } -void FinesFields::updateDSauter() +void FinesFields::updateDSauter() { forAll(dSauterMix_,cellI) { scalar aP = alphaP_[cellI]; - scalar aSt = alphaSt_[cellI]; - if(aSt < SMALL) - dSauterMix_[cellI] = dSauter_[cellI]; - else if(aP < SMALL) - dSauterMix_[cellI] = dFine_.value(); - else - dSauterMix_[cellI] = (aP + aSt) / (aP / dSauter_[cellI] + aSt / dFine_.value() ); + scalar aSt = alphaSt_[cellI]; + if(aSt < SMALL) + dSauterMix_[cellI] = dSauter_[cellI]; + else if(aP < SMALL) + dSauterMix_[cellI] = dFine_.value(); + else + dSauterMix_[cellI] = (aP + aSt) / (aP / dSauter_[cellI] + aSt / dFine_.value() ); } dSauterMix_.correctBoundaryConditions(); } @@ -514,7 +515,7 @@ void FinesFields::updateFanningCoeff() } -void FinesFields::updateFroude() +void FinesFields::updateFroude() { // seems like different authors use different conventions for the Froude number // Chen et al. (1994) define it in terms of a superficial velocity, @@ -534,27 +535,27 @@ void FinesFields::updateUDyn() volScalarField denom = FanningCoeff_ + DragCoeff_; uDyn_ = num / denom; - + // limit uDyn for stability reasons forAll(uDyn_,cellI) { scalar mU(mag(U_[cellI])); - scalar muDyn(mag(uDyn_[cellI])); + scalar muDyn(mag(uDyn_[cellI])); if(muDyn > mU && muDyn > SMALL) - { - uDyn_[cellI] *= mU / muDyn; - } + { + uDyn_[cellI] *= mU / muDyn; + } } - + forAll(uDyn_.boundaryField(), patchI) forAll(uDyn_.boundaryField()[patchI], faceI) { - scalar mU(mag(U_.boundaryField()[patchI][faceI])); - scalar muDyn(mag(uDyn_.boundaryField()[patchI][faceI])); + scalar mU(mag(U_.boundaryField()[patchI][faceI])); + scalar muDyn(mag(uDyn_.boundaryField()[patchI][faceI])); if(muDyn > mU && muDyn > SMALL) - { - uDyn_.boundaryFieldRef()[patchI][faceI] *= mU / muDyn; - } + { + uDyn_.boundaryFieldRef()[patchI][faceI] *= mU / muDyn; + } } } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.H b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.H index 75ae75b9..3098ff2f 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FinesFields.H @@ -39,11 +39,11 @@ class FinesFields { private: cfdemCloud& particleCloud_; - + dictionary propsDict_; - + bool smoothing_; - + bool verbose_; word velFieldName_; @@ -54,95 +54,95 @@ private: volScalarField& voidfraction_; - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; - + word pFieldName_; const volScalarField& p_; - + word rhoGFieldName_; const volScalarField& rhoG_; - + const volScalarField& dSauter_; - + volScalarField alphaG_; - + volScalarField alphaDyn_; - + volScalarField alphaP_; volScalarField alphaSt_; volScalarField deltaAlpha_; - + volScalarField dHydMix_; - + volScalarField DragCoeff_; - + volScalarField dSauterMix_; - + volScalarField FanningCoeff_; - + volScalarField Froude_; - + volScalarField Sds_; - + //volVectorField massFluxDyn_; surfaceScalarField massFluxDyn_; - + volVectorField uDyn_; dimensionedScalar dFine_; - + dimensionedScalar diffCoeff_; - + dimensionedScalar nuAve_; - + dimensionedScalar rhoFine_; - + const dimensionedVector g_; - + scalar alphaDynMax_; - + scalar alphaMax_; - + scalar critVoidfraction_; - + scalar depRate_; - + scalar exponent_; - + scalar nCrit_; - + scalar poresizeWidth_; - + scalar prefactor_; - + scalar ratioHydraulicPore_; - + void calcSource(); - + void integrateFields(); - + void updateAlphaG(); - + void updateAlphaP(); - + void updateDHydMix(); - + void updateDragCoeff(); - + void updateDSauter(); - + void updateFanningCoeff(); - + void updateFroude(); - + void updateUDyn(); - + public: //- Runtime type information @@ -165,7 +165,7 @@ public: // Member Functions - + void update(); }; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C index 8bc530e9..4e9fc5bf 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C @@ -76,7 +76,7 @@ GidaspowDrag::GidaspowDrag { //Append the field names to be probed particleCloud_.probeM().initialize(typeName, typeName+".logDat"); - particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must be the force + particleCloud_.probeM().vectorFields_.append("dragForce"); // first entry must be the force particleCloud_.probeM().vectorFields_.append("Urel"); particleCloud_.probeM().scalarFields_.append("Rep"); particleCloud_.probeM().scalarFields_.append("betaP"); @@ -95,9 +95,9 @@ GidaspowDrag::GidaspowDrag particleCloud_.checkCG(true); if (propsDict_.found("scale")) - scaleDia_=scalar(readScalar(propsDict_.lookup("scale"))); + scaleDia_ = scalar(readScalar(propsDict_.lookup("scale"))); if (propsDict_.found("scaleDrag")) - scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag"))); + scaleDrag_ = scalar(readScalar(propsDict_.lookup("scaleDrag"))); if (propsDict_.found("switchingVoidfraction")) switchingVoidfraction_ = readScalar(propsDict_.lookup("switchingVoidfraction")); @@ -115,8 +115,11 @@ GidaspowDrag::~GidaspowDrag() void GidaspowDrag::setForce() const { if (scaleDia_ > 1) + { Info << "Gidaspow using scale = " << scaleDia_ << endl; - else if (particleCloud_.cg() > 1){ + } + else if (particleCloud_.cg() > 1) + { scaleDia_=particleCloud_.cg(); Info << "Gidaspow using scale from liggghts cg = " << scaleDia_ << endl; } @@ -128,7 +131,7 @@ void GidaspowDrag::setForce() const scalar voidfraction(1); vector Ufluid(0,0,0); vector drag(0,0,0); - label cellI=0; + label cellI = 0; vector Us(0,0,0); vector Ur(0,0,0); @@ -145,13 +148,13 @@ void GidaspowDrag::setForce() const vector dragExplicit(0,0,0); scalar dragCoefficient(0); - + interpolationCellPoint voidfractionInterpolator_(voidfraction_); interpolationCellPoint UInterpolator_(U_); #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { //if(mask[index][0]) //{ @@ -160,26 +163,26 @@ void GidaspowDrag::setForce() const dragExplicit = vector(0,0,0); betaP = 0; Vs = 0; - Ufluid =vector(0,0,0); - voidfraction=0; + Ufluid = vector(0,0,0); + voidfraction = 0; dragCoefficient = 0; if (cellI > -1) // particle Found { - if( forceSubM(0).interpolation() ) + if ( forceSubM(0).interpolation() ) { - position = particleCloud_.position(index); + position = particleCloud_.position(index); voidfraction = voidfractionInterpolator_.interpolate(position,cellI); Ufluid = UInterpolator_.interpolate(position,cellI); //Ensure interpolated void fraction to be meaningful // Info << " --> voidfraction: " << voidfraction << endl; - if(voidfraction>1.00) voidfraction = 1.0; - if(voidfraction<0.10) voidfraction = 0.10; + if (voidfraction > 1.0) voidfraction = 1.0; + else if (voidfraction < 0.1) voidfraction = 0.10; } else { - voidfraction = voidfraction_[cellI]; + voidfraction = voidfraction_[cellI]; Ufluid = U_[cellI]; } @@ -190,14 +193,14 @@ void GidaspowDrag::setForce() const rho = rhoField[cellI]; nuf = nufField[cellI]; - Rep=0.0; + Rep = 0.0; localPhiP = 1.0f-voidfraction+SMALL; Vs = ds*ds*ds*M_PI/6; // calc particle's drag coefficient (i.e., Force per unit slip velocity and per m³ PARTICLE) - if(voidfraction > switchingVoidfraction_) //dilute + if (voidfraction > switchingVoidfraction_) //dilute { - Rep=ds/scaleDia_*voidfraction*magUr/nuf; + Rep = ds/scaleDia_*voidfraction*magUr/nuf; CdMagUrLag = (24.0*nuf/(ds/scaleDia_*voidfraction)) //1/magUr missing here, but compensated in expression for betaP! *(scalar(1.0)+0.15*Foam::pow(Rep, 0.687)); @@ -218,7 +221,7 @@ void GidaspowDrag::setForce() const // calc particle's drag dragCoefficient = Vs*betaP*scaleDrag_; - if (modelType_=="B") + if (modelType_ == "B") dragCoefficient /= voidfraction; drag = dragCoefficient * Ur; @@ -226,7 +229,7 @@ void GidaspowDrag::setForce() const // explicitCorr forceSubM(0).explicitCorr(drag,dragExplicit,dragCoefficient,Ufluid,U_[cellI],Us,UsField_[cellI],forceSubM(0).verbose()); - if(forceSubM(0).verbose() && index >=0 && index <2) + if (forceSubM(0).verbose() && index >= 0 && index < 2) { Pout << "cellI = " << cellI << endl; Pout << "index = " << index << endl; @@ -244,7 +247,7 @@ void GidaspowDrag::setForce() const } //Set value fields and write the probe - if(probeIt_) + if (probeIt_) { #include "setupProbeModelfields.H" vValues.append(drag); //first entry must the be the force diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H index 61c7d191..76102bcb 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.H @@ -74,7 +74,7 @@ private: const scalar phi_; - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; // the average particle velocity field diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C index 94d9b7e3..a8739e09 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C @@ -134,7 +134,7 @@ void KochHillDrag::setForce() const vector drag(0,0,0); vector dragExplicit(0,0,0); scalar dragCoefficient(0); - label cellI=0; + label cellI = 0; vector Us(0,0,0); vector Ur(0,0,0); @@ -154,16 +154,16 @@ void KochHillDrag::setForce() const #include "setupProbeModel.H" - for (int index=0; index -1) // particle Found { @@ -174,8 +174,8 @@ void KochHillDrag::setForce() const Ufluid = UInterpolator_.interpolate(position,cellI); //Ensure interpolated void fraction to be meaningful // Info << " --> voidfraction: " << voidfraction << endl; - if (voidfraction > 1.00) voidfraction = 1.00; - if (voidfraction < 0.40) voidfraction = 0.40; + if (voidfraction > 1.0) voidfraction = 1.0; + else if (voidfraction < 0.4) voidfraction = 0.4; } else { @@ -227,7 +227,7 @@ void KochHillDrag::setForce() const // calc particle's drag dragCoefficient = Vs*betaP*scaleDrag_; - if (modelType_=="B") + if (modelType_ == "B") dragCoefficient /= voidfraction; if (forceSubM(0).switches()[7]) // implForceDEMaccumulated=true @@ -270,7 +270,7 @@ void KochHillDrag::setForce() const sValues.append(betaP); sValues.append(voidfraction); particleCloud_.probeM().writeProbe(index, sValues, vValues); - } + } } // write particle based data to global array diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H index 95d6712e..42c921f3 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.H @@ -29,7 +29,7 @@ Description and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). Koch, Hill drag law - based on Koch Hill 2001,"Inertial effects in suspensions and porous-media + based on Koch Hill 2001,"Inertial effects in suspensions and porous-media flows", Annual Review of fluid mechanics. including interpolation of the velocity to the exact position including drag coefficient for implicit drag for DEM @@ -72,9 +72,9 @@ private: const volScalarField& voidfraction_; - word UsFieldName_; + word UsFieldName_; - const volVectorField& UsField_; + const volVectorField& UsField_; mutable scalar scaleDia_; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C index 26cb36e8..540d058d 100755 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C @@ -79,9 +79,9 @@ KochHillRWDrag::KochHillRWDrag RanGen_(label(0)) { - if (propsDict_.found("verbose")) verbose_=true; - if (propsDict_.found("interpolation")) interpolation_=true; - if (propsDict_.found("randomTauE")) randomTauE_=true; + if (propsDict_.found("verbose")) verbose_ = true; + if (propsDict_.found("interpolation")) interpolation_ = true; + if (propsDict_.found("randomTauE")) randomTauE_ = true; // init force sub model setForceSubModels(propsDict_); @@ -152,7 +152,7 @@ void KochHillRWDrag::setForce() const vector drag(0,0,0); vector dragExplicit(0,0,0); scalar dragCoefficient(0); - label cellI=0; + label cellI = 0; vector Us(0,0,0); vector Ur(0,0,0); @@ -195,17 +195,17 @@ void KochHillRWDrag::setForce() const //Info << "RW-TEST: We are in setForce() at t = " << t << endl; // TEST-Output - for (int index=0; index voidfraction: " << voidfraction << endl; - if (voidfraction > 1.00) voidfraction = 1.00; - if (voidfraction < 0.40) voidfraction = 0.40; + if (voidfraction > 1.0) voidfraction = 1.0; + else if (voidfraction < 0.4) voidfraction = 0.4; } else { diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.H b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.H index ba80cfb1..16d3f463 100755 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.H @@ -29,7 +29,7 @@ Description and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). Koch, Hill drag law - based on Koch Hill 2001,"Inertial effects in suspensions and porous-media + based on Koch Hill 2001,"Inertial effects in suspensions and porous-media flows", Annual Review of fluid mechanics. including interpolation of the velocity to the exact position including drag coefficient for implicit drag for DEM @@ -75,7 +75,7 @@ private: const volScalarField& voidfraction_; - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; // the average particle velocity field diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C index aaae4b04..6a2a15e9 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C @@ -113,7 +113,7 @@ LaEuScalarTemp::~LaEuScalarTemp() void LaEuScalarTemp::allocateMyArrays() const { // get memory for 2d arrays - double initVal=0.0; + double initVal = 0.0; particleCloud_.dataExchangeM().allocateArray(partTemp_,initVal,1); // field/initVal/with/lenghtFromLigghts particleCloud_.dataExchangeM().allocateArray(partHeatFlux_,initVal,1); } @@ -156,14 +156,14 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const interpolationCellPoint UInterpolator_(U_); interpolationCellPoint TInterpolator_(tempField_); - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { //if(particleCloud_.regionM().inRegion()[index][0]) //{ cellI = particleCloud_.cellIDs()[index][0]; - if(cellI >= 0) + if (cellI >= 0) { - if(forceSubM(0).interpolation()) + if (forceSubM(0).interpolation()) { vector position = particleCloud_.position(index); voidfraction = voidfractionInterpolator_.interpolate(position,cellI); @@ -206,7 +206,7 @@ void LaEuScalarTemp::manipulateScalarField(volScalarField& EuField) const partHeatFlux_[index][0] = partHeatFlux; - if(forceSubM(0).verbose() && index >=0 && index <2) + if(forceSubM(0).verbose() && index >= 0 && index < 2) { Info << "partHeatFlux = " << partHeatFlux << endl; Info << "magUr = " << magUr << endl; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H index 01e6354f..c9de04f9 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.H @@ -71,7 +71,7 @@ private: word voidfractionFieldName_; - const volScalarField& voidfraction_; // ref to voidfraction field + const volScalarField& voidfraction_; // ref to voidfraction field scalar maxSource_; // max (limited) value of src field @@ -81,7 +81,7 @@ private: word partTempName_; - mutable double **partTemp_; // Lagrangian array + mutable double **partTemp_; // Lagrangian array word partHeatFluxName_; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C index 1f804f38..2b6cd53a 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C @@ -134,11 +134,11 @@ void MeiLift::setForce() const #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); index++) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { //if(mask[index][0]) //{ - lift = vector::zero; + lift = vector::zero; label cellI = particleCloud_.cellIDs()[index][0]; if (cellI > -1) // particle Found @@ -147,10 +147,10 @@ void MeiLift::setForce() const if( forceSubM(0).interpolation() ) { - position = particleCloud_.position(index); - Ur = UInterpolator_.interpolate(position,cellI) - - Us; - vorticity = VorticityInterpolator_.interpolate(position,cellI); + position = particleCloud_.position(index); + Ur = UInterpolator_.interpolate(position,cellI) + - Us; + vorticity = VorticityInterpolator_.interpolate(position,cellI); } else { @@ -159,7 +159,7 @@ void MeiLift::setForce() const vorticity=vorticityField[cellI]; } - magUr = mag(Ur); + magUr = mag(Ur); magVorticity = mag(vorticity); if (magUr > 0 && magVorticity > 0) @@ -170,26 +170,26 @@ void MeiLift::setForce() const // calc dimensionless properties Rep = ds*magUr/nuf; - Rew = magVorticity*ds*ds/nuf; + Rew = magVorticity*ds*ds/nuf; - alphaStar = magVorticity*ds/magUr/2.0; - epsilon = sqrt(2.0*alphaStar /Rep ); - omega_star=2.0*alphaStar; + alphaStar = magVorticity*ds/magUr/2.0; + epsilon = sqrt(2.0*alphaStar /Rep ); + omega_star = 2.0*alphaStar; //Basic model for the correction to the Saffman lift //Based on McLaughlin (1991) if(epsilon < 0.1) { - J_star = -140 *epsilon*epsilon*epsilon*epsilon*epsilon + J_star = -140 *epsilon*epsilon*epsilon*epsilon*epsilon *log( 1./(epsilon*epsilon+SMALL) ); } else if(epsilon > 20) { - J_star = 1.0-0.287/(epsilon*epsilon+SMALL); + J_star = 1.0-0.287/(epsilon*epsilon+SMALL); } else { - J_star = 0.3 + J_star = 0.3 *( 1.0 +tanh( 2.5 * log10(epsilon+0.191) ) ) @@ -197,11 +197,11 @@ void MeiLift::setForce() const +tanh( 6.0 * (epsilon-0.32) ) ); } - Cl=J_star*4.11*epsilon; //multiply McLaughlin's correction to the basic Saffman model + Cl = J_star * 4.11 * epsilon; //multiply McLaughlin's correction to the basic Saffman model - //Second order terms given by Loth and Dorgan 2009 + //Second order terms given by Loth and Dorgan 2009 if(useSecondOrderTerms_) - { + { Omega_eq = omega_star/2.0*(1.0-0.0075*Rew)*(1.0-0.062*sqrt(Rep)-0.001*Rep); Cl_star=1.0-(0.675+0.15*(1.0+tanh(0.28*(omega_star/2.0-2.0))))*tanh(0.18*sqrt(Rep)); Cl += Omega_eq*Cl_star; @@ -209,21 +209,21 @@ void MeiLift::setForce() const lift = 0.125*M_PI *rho - *Cl + *Cl *magUr*Ur^vorticity/magVorticity *ds*ds; - if (modelType_=="B") + if (modelType_ == "B") { voidfraction = particleCloud_.voidfraction(index); lift /= voidfraction; } } - //********************************** + //********************************** //SAMPLING AND VERBOSE OUTOUT - if( forceSubM(0).verbose() ) - { + if ( forceSubM(0).verbose() ) + { Pout << "index = " << index << endl; Pout << "Us = " << Us << endl; Pout << "Ur = " << Ur << endl; @@ -240,7 +240,7 @@ void MeiLift::setForce() const } //Set value fields and write the probe - if(probeIt_) + if (probeIt_) { #include "setupProbeModelfields.H" vValues.append(lift); //first entry must the be the force @@ -252,7 +252,7 @@ void MeiLift::setForce() const particleCloud_.probeM().writeProbe(index, sValues, vValues); } // END OF SAMPLING AND VERBOSE OUTOUT - //********************************** + //********************************** } // write particle based data to global array diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C b/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C index 26d96a55..081742c3 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/dSauter/dSauter.C @@ -103,9 +103,9 @@ dSauter::dSauter setForceSubModels(propsDict_); if (propsDict_.found("scaleCG")) - scaleDia_=scalar(readScalar(propsDict_.lookup("scaleCG"))); + scaleDia_ = scalar(readScalar(propsDict_.lookup("scaleCG"))); if (propsDict_.found("scaleDist")) - scaleDiaDist_=scalar(readScalar(propsDict_.lookup("scaleDist"))); + scaleDiaDist_ = scalar(readScalar(propsDict_.lookup("scaleDist"))); } @@ -118,22 +118,26 @@ dSauter::~dSauter() } // * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * // + void dSauter::allocateMyArrays() const { // get memory for 2d arrays - double initVal=0.0; + double initVal = 0.0; particleCloud_.dataExchangeM().allocateArray(d2_,initVal,1); // field/initVal/with/lenghtFromLigghts particleCloud_.dataExchangeM().allocateArray(d3_,initVal,1); } + // * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * // void dSauter::setForce() const { if (scaleDia_ > 1) + { Info << "dSauter using scaleCG = " << scaleDia_ << endl; + } else if (particleCloud_.cg() > 1) { - scaleDia_=particleCloud_.cg(); + scaleDia_ = particleCloud_.cg(); Info << "dSauter using scaleCG from liggghts cg = " << scaleDia_ << endl; } @@ -143,10 +147,10 @@ void dSauter::setForce() const scalar ds(0); scalar scale = scaleDiaDist_/scaleDia_; - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; - if(cellI >= 0) + if (cellI >= 0) { ds = particleCloud_.d(index); d2_[index][0] = ds*ds; @@ -175,13 +179,13 @@ void dSauter::setForce() const forAll(dSauter_,cellI) { - if(d2Field_[cellI] > ROOTVSMALL) + if (d2Field_[cellI] > ROOTVSMALL) { - dSauter_[cellI] = d3Field_[cellI] / d2Field_[cellI] * scale; + dSauter_[cellI] = d3Field_[cellI] / d2Field_[cellI] * scale; } else { - dSauter_[cellI] = SMALL; + dSauter_[cellI] = SMALL; } } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C index 734472da..7bcfcb57 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C @@ -84,14 +84,16 @@ gradPForce::gradPForce if (modelType_ == "B") { FatalError <<"using model gradPForce with model type B is not valid\n" << abort(FatalError); - }else if (modelType_ == "Bfull") + } + else if (modelType_ == "Bfull") { if(forceSubM(0).switches()[1]) { Info << "Using treatForceDEM false!" << endl; forceSubM(0).setSwitches(1,false); // treatForceDEM = false } - }else // modelType_=="A" + } + else // modelType_=="A" { if(!forceSubM(0).switches()[1]) { @@ -100,10 +102,12 @@ gradPForce::gradPForce } } - if (propsDict_.found("useU")) useU_=true; - if (propsDict_.found("useAddedMass")) + if (propsDict_.found("useU")) + useU_ = true; + + if (propsDict_.found("useAddedMass")) { - addedMassCoeff_ = readScalar(propsDict_.lookup("useAddedMass")); + addedMassCoeff_ = readScalar(propsDict_.lookup("useAddedMass")); Info << "gradP will also include added mass with coefficient: " << addedMassCoeff_ << endl; Info << "WARNING: use fix nve/sphere/addedMass in LIGGGHTS input script to correctly account for added mass effects!" << endl; } @@ -152,21 +156,22 @@ void gradPForce::setForce() const #include "setupProbeModel.H" - for(int index = 0;index < particleCloud_.numberOfParticles(); index++) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { //if(mask[index][0]) //{ - force=vector(0,0,0); + force = vector(0,0,0); cellI = particleCloud_.cellIDs()[index][0]; if (cellI > -1) // particle Found { position = particleCloud_.position(index); - if(forceSubM(0).interpolation()) // use intepolated values for alpha (normally off!!!) + if (forceSubM(0).interpolation()) // use intepolated values for alpha (normally off!!!) { gradP = gradPInterpolator_.interpolate(position,cellI); - }else + } + else { gradP = gradPField[cellI]; } @@ -180,7 +185,7 @@ void gradPForce::setForce() const else force = -Vs*gradP*(1.0+addedMassCoeff_); - if(forceSubM(0).verbose() && index >=0 && index <2) + if (forceSubM(0).verbose() && index >= 0 && index < 2) { Info << "index = " << index << endl; Info << "gradP = " << gradP << endl; @@ -188,7 +193,7 @@ void gradPForce::setForce() const } //Set value fields and write the probe - if(probeIt_) + if (probeIt_) { #include "setupProbeModelfields.H" vValues.append(force); //first entry must the be the force diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C b/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C index 7056a3c0..072ea2de 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/granKineticEnergy/granKineticEnergy.C @@ -89,7 +89,7 @@ granKineticEnergy::~granKineticEnergy() void granKineticEnergy::allocateMyArrays() const { // get memory for 2d arrays - double initVal=0.0; + double initVal = 0.0; particleCloud_.dataExchangeM().allocateArray(vfluc_,initVal,1); } // * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * // @@ -98,11 +98,11 @@ void granKineticEnergy::setForce() const { allocateMyArrays(); - label cellI=0; + label cellI = 0; vector velfluc(0,0,0); - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; if(cellI >= 0) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C index e2c4d107..c3bf6078 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C @@ -76,11 +76,11 @@ DiFeliceDragMS::DiFeliceDragMS { //Append the field names to be probed particleCloud_.probeM().initialize(typeName, typeName+".logDat"); - particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force - particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug - particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug - particleCloud_.probeM().scalarFields_.append("Cd"); //other are debug - particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug + particleCloud_.probeM().vectorFields_.append("dragForce"); // first entry must the be the force + particleCloud_.probeM().vectorFields_.append("Urel"); // other are debug + particleCloud_.probeM().scalarFields_.append("Rep"); // other are debug + particleCloud_.probeM().scalarFields_.append("Cd"); // other are debug + particleCloud_.probeM().scalarFields_.append("voidfraction"); // other are debug particleCloud_.probeM().writeHeader(); // init force sub model @@ -98,11 +98,12 @@ DiFeliceDragMS::DiFeliceDragMS { Warning << " interpolation is commented for this force model - it seems to be unstable with AMI!" << endl; } + if (propsDict_.found("splitImplicitExplicit")) { Info << "will split implicit / explicit force contributions." << endl; splitImplicitExplicit_ = true; - if(!forceSubM(0).interpolation()) + if(!forceSubM(0).interpolation()) Info << "WARNING: will only consider fluctuating particle velocity in implicit / explicit force split!" << endl; } particleCloud_.checkCG(false); @@ -124,11 +125,11 @@ void DiFeliceDragMS::setForce() const const volScalarField& nufField = forceSubM(0).nuField(); const volScalarField& rhoField = forceSubM(0).rhoField(); - vector position(0,0,0); + //vector position(0,0,0); scalar voidfraction(1); vector Ufluid(0,0,0); vector drag(0,0,0); - label cellI=0; + label cellI = 0; vector Us(0,0,0); vector Ur(0,0,0); scalar ds(0); @@ -138,17 +139,17 @@ void DiFeliceDragMS::setForce() const scalar Rep(0); scalar Cd(0); - vector UfluidFluct(0,0,0); + vector UfluidFluct(0,0,0); vector UsFluct(0,0,0); vector dragExplicit(0,0,0); - scalar dragCoefficient(0); + scalar dragCoefficient(0); //interpolationCellPoint voidfractionInterpolator_(voidfraction_); //interpolationCellPoint UInterpolator_(U_); #include "setupProbeModel.H" - for(int index = 0;index < cloudRefMS().numberOfClumps(); index++) + for(int index = 0; index < cloudRefMS().numberOfClumps(); ++index) { //if(mask[index][0]) // would have to be transformed from body ID to particle ID @@ -214,7 +215,7 @@ void DiFeliceDragMS::setForce() const } } - if(forceSubM(0).verbose() && index >=0 && index <10) + if(forceSubM(0).verbose() && index >= 0 && index < 10) { Pout << "index = " << index << endl; Pout << "Us = " << Us << endl; @@ -246,8 +247,13 @@ void DiFeliceDragMS::setForce() const particleCloud_.probeM().writeProbe(index, sValues, vValues); } } + // set force on bodies - if(forceSubM(0).switches()[0]) for(int j=0;j<3;j++) cloudRefMS().expForcesCM()[index][j] += drag[j]; + if (forceSubM(0).switches()[0]) + { + for(int j=0;j<3;j++) + cloudRefMS().expForcesCM()[index][j] += drag[j]; + } else //implicit treatment, taking explicit force contribution into account { for(int j=0;j<3;j++) @@ -256,7 +262,9 @@ void DiFeliceDragMS::setForce() const cloudRefMS().expForcesCM()[index][j] += dragExplicit[j]; } } - for(int j=0;j<3;j++) cloudRefMS().DEMForcesCM()[index][j] += drag[j]; + + for(int j=0;j<3;j++) + cloudRefMS().DEMForcesCM()[index][j] += drag[j]; //} } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.H b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.H index 27bc6275..4a0efaf6 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.H @@ -71,7 +71,7 @@ private: bool splitImplicitExplicit_; // use splitting of implicit and explict force contribution - word UsFieldName_; + word UsFieldName_; const volVectorField& UsField_; // the average particle velocity field (for implicit/expliti force split) From b9cff039ad87a7fbabd72c997d0a454191d5360c Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 18 May 2017 13:57:58 +0200 Subject: [PATCH 18/99] fix up probe model remove internal vProbes and sProbes and corresponding getter functions since the data structures are unsuitable and they are not used anywhere else; remove misleading const specifiers from methods and the excruciating mutable specifiers; use const references as parameters where appropriate; --- .../cfdemParticle/cfdTools/setupProbeModel.H | 5 +- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 10 - .../cfdemParticle/cfdemCloud/cfdemCloud.H | 8 +- .../cfdemParticle/cfdemCloud/cfdemCloudI.H | 4 +- .../probeModel/particleProbe/particleProbe.C | 210 ++++++------------ .../probeModel/particleProbe/particleProbe.H | 36 ++- .../probeModel/probeModel/probeModel.H | 10 +- 7 files changed, 94 insertions(+), 189 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdTools/setupProbeModel.H b/src/lagrangian/cfdemParticle/cfdTools/setupProbeModel.H index d94133eb..cf15a61d 100644 --- a/src/lagrangian/cfdemParticle/cfdTools/setupProbeModel.H +++ b/src/lagrangian/cfdemParticle/cfdTools/setupProbeModel.H @@ -1,3 +1,2 @@ - //set probeModel parameters for this force model - particleCloud_.probeM().setOutputFile(); - particleCloud_.probeM().setCounter(); +//set probeModel parameters for this force model +if (probeIt_) { particleCloud_.probeM().setOutputFile(typeName+".logDat"); } diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index f46c2a82..3bde71ab 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -497,16 +497,6 @@ label cfdemCloud::liggghtsCommandModelIndex(word name) return index; } -std::vector< std::vector >* cfdemCloud::getVprobe() -{ - return probeModel_->getVprobe(); -} - -std::vector< std::vector >* cfdemCloud::getSprobe() -{ - return probeModel_->getSprobe(); -} - // * * * * * * * * * * * * * * * WRITE * * * * * * * * * * * * * // // * * * write cfdemCloud internal data * * * // diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index 3c05e065..5de625ff 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -49,7 +49,7 @@ SourceFiles #include "fvCFD.H" #include "IFstream.H" -#include +#include "turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -351,7 +351,7 @@ public: inline const IOModel& IOM() const; - inline const probeModel& probeM() const; + inline probeModel& probeM(); inline const averagingModel& averagingM() const; @@ -394,10 +394,6 @@ public: void resetArray(double**&,int,int,double resetVal=0.); - std::vector< std::vector >* getVprobe(); - - std::vector< std::vector >* getSprobe(); - void otherForces(volVectorField&); }; diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H index 84cd29c5..eeb829b7 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H @@ -262,9 +262,9 @@ inline const IOModel& cfdemCloud::IOM() const return IOModel_; } -inline const probeModel& cfdemCloud::probeM() const +inline probeModel& cfdemCloud::probeM() { - return probeModel_; + return probeModel_(); } inline const voidFractionModel& cfdemCloud::voidFractionM() const diff --git a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C index c9bc6826..ca5bab6e 100644 --- a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C +++ b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.C @@ -87,12 +87,12 @@ particleProbe::particleProbe if (propsDict_.found("verbose")) verbose_=true; if (propsDict_.found("verboseToFile")) verboseToFile_=true; - if (propsDict_.found("printEvery")) printEvery_= readScalar(propsDict_.lookup("printEvery")); - if (propsDict_.found("sampleAll")) sampleAll_=true; - if (propsDict_.found("probeDebug")) probeDebug_=true; - if (propsDict_.found("includePosition")) includePosition_=true; + if (propsDict_.found("printEvery")) printEvery_ = readScalar(propsDict_.lookup("printEvery")); + if (propsDict_.found("sampleAll")) sampleAll_ = true; + if (propsDict_.found("probeDebug")) probeDebug_ = true; + if (propsDict_.found("includePosition")) includePosition_ = true; - if (propsDict_.found("writePrecision")) writePrecision_= readScalar(propsDict_.lookup("writePrecision")); + if (propsDict_.found("writePrecision")) writePrecision_ = readScalar(propsDict_.lookup("writePrecision")); } @@ -100,25 +100,36 @@ particleProbe::particleProbe particleProbe::~particleProbe() { - clearProbes(); + forAll(sPtrList_, i) + delete sPtrList_[i]; } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void particleProbe::setOutputFile() const +void particleProbe::setOutputFile(const word& logFileName) { - //set the current item ID - if(currItemId_== itemCounter_) - currItemId_=1; - else - currItemId_+=1; - sPtr = sPtrList_[currItemId_-1]; //set the pointer to the output file from list - probeIndex_=currItemId_-1; + if (itemCounter_ > 0 && verboseToFile_) + { + bool foundFile = false; + forAll(itemsToSample_, i) + { + if (itemsToSample_[i] == logFileName) + { + probeIndex_ = i; + foundFile = true; + } + } + + if(!foundFile) + FatalError << "particleProbe::setOutputFile for logFileName " << logFileName << " : " << "File not found" << abort(FatalError); + currItemId_ = probeIndex_ + 1; + setCounter(); + } } -void particleProbe::initialize(word typeName, word logFileName) const +void particleProbe::initialize(const word& modelName, const word& logFileName) { //update the list of items to be sampled ++itemCounter_; @@ -126,7 +137,7 @@ void particleProbe::initialize(word typeName, word logFileName) const // init environment //propsDict_ = particleCloud_.couplingProperties().subDict(typeName + "Props"); - name_ = typeName; + name_ = modelName; if (verboseToFile_) { @@ -136,8 +147,8 @@ void particleProbe::initialize(word typeName, word logFileName) const MPI_Comm_rank(MPI_COMM_WORLD, &rank_); //open a separate file for each processor - char* filecurrent_ = new char[strlen(logFileName.c_str()) + 4]; //reserve 4 chars for processor name - sprintf(filecurrent_,"%s%s%d", logFileName.c_str(), ".", rank_); + char* filecurrent_ = new char[logFileName.length() + 1 + 4 + 1]; //reserve 4 chars for processor name + sprintf(filecurrent_,"%s.%d", logFileName.c_str(), rank_); Info << "particleProbe for model " << name_ << " will write to file " << filecurrent_ << endl; @@ -171,120 +182,44 @@ void particleProbe::initialize(word typeName, word logFileName) const scalarFields_.clear(); vectorFields_.clear(); } - - return; } + void particleProbe::writeHeader() const { + if (verboseToFile_) + { + *sPtr << "#processor: " << rank_ << endl; + *sPtr << "#index time " << " "; + *sPtr << "|| vectorData: " << " "; - if(verboseToFile_ ) - { - *sPtr<<"#processor: " << rank_ << endl; - *sPtr<<"#index time " << " "; + forAll(vectorFields_, iter) + { + if (!probeDebug_ && iter > 0) break; + *sPtr << vectorFields_(iter) << " "; + } - - *sPtr<<"|| vectorData: " << " "; - - forAll(vectorFields_, iter) - { - if(!probeDebug_ && iter>0) break; - *sPtr << vectorFields_(iter) << " "; - } - - if(probeDebug_) - { - *sPtr<<"|| scalarData: " << " "; + if (probeDebug_) + { + *sPtr << "|| scalarData: " << " "; forAll(scalarFields_, iter) { - *sPtr << scalarFields_(iter) << " "; + *sPtr << scalarFields_(iter) << " "; } - } - - if(includePosition_) *sPtr<<" || position" << endl; - else *sPtr << endl; - } - -} - -void particleProbe::clearProbes() const -{ - for (unsigned int i=0; i sValues, Field vValues) const -{ - int vSize_=vProbes_.size(); - int sSize_=sProbes_.size(); - - //check if the particle already has an allocated vector. If not, create it. It should be only called at the beginning. - while(index >= vSize_) - { - std::vector particleVector_; - vProbes_.push_back(particleVector_); - vSize_=vProbes_.size(); - } - - while(index >= sSize_) - { - std::vector particleScalar_; - sProbes_.push_back(particleScalar_); - sSize_=sProbes_.size(); - } - - //register vector probes on the corresponding vector - forAll(vValues, iter) - { - int ProbeSize_=vProbes_[index].size(); - - if(probeIndex_ sValues, Field vValues) const + +void particleProbe::writeProbe(int index, Field sValues, Field vValues) { - updateProbes(index,sValues,vValues); //update probe vectors - - - if(printNow_ && checkIDForPrint(index) && verboseToFile_) + if (printNow_ && verboseToFile_ && checkIDForPrint(index)) { + sPtr = sPtrList_[probeIndex_]; //set the pointer to the output file from list + //index and time *sPtr << setprecision(IOstream::defaultPrecision()+7); *sPtr << index << tab << particleCloud_.mesh().time().value() << " "; @@ -298,7 +233,6 @@ void particleProbe::writeProbe(int index, Field sValues, Field v *sPtr << vValues[iter][0] << " "; *sPtr << vValues[iter][1] << " "; *sPtr << vValues[iter][2] << " "; - } //scalarFields @@ -324,42 +258,40 @@ void particleProbe::writeProbe(int index, Field sValues, Field v *sPtr << endl; } } - - return; } + bool particleProbe::checkIDForPrint(int index) const { - bool sampleThisId_ = false; - if(sampleAll_) sampleThisId_ = true; - else - { - forAll(particleIDsToSample_, iSample) - { - if(index==particleIDsToSample_[iSample]) sampleThisId_ = true; - } - } - return sampleThisId_; + if(sampleAll_) + { + return true; + } + else + { + forAll(particleIDsToSample_, iSample) + { + if (index == particleIDsToSample_[iSample]) return true; + } + } + return false; } -void particleProbe::setCounter() const +void particleProbe::setCounter() { - - //reset or increment counter for printing to file + //reset or increment counter for printing to file //Do only if called by first item in the list of items! - if(currItemId_==1) + if (currItemId_ == 1) { - printCounter_++; - if( printCounter_ >= printEvery_ ) + ++printCounter_; + + if (printCounter_ >= printEvery_) { - printCounter_=0; + printCounter_ = 0; printNow_ = true; } else printNow_ = false; - } - return; - } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H index 3155a16e..e840f790 100644 --- a/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H +++ b/src/lagrangian/cfdemParticle/subModels/probeModel/particleProbe/particleProbe.H @@ -63,7 +63,7 @@ private: dictionary propsDict_; - mutable word name_; + word name_; cfdemCloud& particleCloud_; @@ -75,7 +75,7 @@ private: word dirName_; - mutable int rank_; + int rank_; mutable OFstream* sPtr; @@ -89,25 +89,23 @@ private: const labelList particleIDsToSample_; - mutable wordList itemsToSample_; + wordList itemsToSample_; - mutable List sPtrList_; + List sPtrList_; - mutable int itemCounter_; + int itemCounter_; - mutable int currItemId_; + int currItemId_; - mutable int printCounter_; + int printCounter_; - mutable bool printNow_; + bool printNow_; - mutable std::vector< std::vector > sProbes_; + std::vector probeName_; - mutable std::vector< std::vector > vProbes_; + int probeIndex_; - mutable std::vector probeName_; - - mutable int probeIndex_; + void setCounter(); public: @@ -131,17 +129,11 @@ public: ~particleProbe(); // Member Functions - void updateProbes(int index, Field sValues, Field vValues) const; - void initialize(word typeName, word logFileName) const; - void setOutputFile() const; + void initialize(const word& modelName, const word& logFileName); + void setOutputFile(const word& logFileName); void writeHeader() const; - void writeProbe(int index, Field sValues, Field vValues) const; + void writeProbe(int index, Field sValues, Field vValues); bool checkIDForPrint(int) const; - void setCounter() const; - void clearProbes() const; - std::vector< std::vector >* getVprobe() { return &vProbes_; } - std::vector< std::vector >* getSprobe() { return &sProbes_; } - }; diff --git a/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H b/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H index d30bd808..a7c811f0 100644 --- a/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H +++ b/src/lagrangian/cfdemParticle/subModels/probeModel/probeModel/probeModel.H @@ -133,16 +133,12 @@ public: // Member Functions - virtual void initialize(word typeName, word logFileName) const {} - virtual void setOutputFile() const {} + virtual void initialize(const word& modelName, const word& logFileName) {} + virtual void setOutputFile(const word& logFileName) {} virtual void writeHeader() const {} - virtual void writeProbe(int index, Field sValues, Field vValues) const {} + virtual void writeProbe(int index, Field sValues, Field vValues) {} virtual bool checkIDForPrint(int) const { return false; } - virtual void setCounter() const {} virtual bool active() const { return true; } - virtual std::vector< std::vector >* getVprobe() { return NULL; } - virtual std::vector< std::vector >* getSprobe() { return NULL; } - virtual void clearProbes() const {} // Access From b2a089a4441df7c8d2ff257d55349a99ceefe862 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 18 May 2017 13:59:01 +0200 Subject: [PATCH 19/99] fix some typos --- .../solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C | 2 +- .../voidFractionModel/GaussVoidFraction/GaussVoidFraction.C | 2 +- .../bigParticleVoidFraction/bigParticleVoidFraction.C | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C index 788c8f02..9fc59b59 100644 --- a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C +++ b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C @@ -25,7 +25,7 @@ License along with CFDEMcoupling. If not, see . Application - cfdemSolverPiso + cfdemSolverPisoScalar Description Transient solver for incompressible flow. diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C index 9a929d67..231e7e97 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C @@ -137,7 +137,7 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract if (hashSetLength > maxCellsPerParticle_) { FatalError<< "big particle algo found more cells ("<< hashSetLength - <<") than storage is prepered ("< 0) { diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C index 179a3b6a..63405dca 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C @@ -132,7 +132,7 @@ void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voi if (hashSetLength > maxCellsPerParticle_) { FatalError<< "big particle algo found more cells ("<< hashSetLength - <<") than storage is prepered ("< 0) { From e8f8f4668debfb0edf2632a8bf7348ccdeeb1577 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 18 May 2017 14:08:33 +0200 Subject: [PATCH 20/99] disable some warnings in make options for compressible use the default 7 hexadecimal digits as the abbreviated object name; disable warnings about old-style casts, unused results and literal suffix, since they are of little interest and mostly caused by external libraries (mpi, c/c++ standard libraries) (same as in 80aaf69748d5b619111893e0cad2cd5b8393ad98 and 9e478e23a63c31e038956c72646a83bf2c68955e) --- src/lagrangian/cfdemParticleComp/Make/options | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticleComp/Make/options b/src/lagrangian/cfdemParticleComp/Make/options index e79a9574..a7718b58 100644 --- a/src/lagrangian/cfdemParticleComp/Make/options +++ b/src/lagrangian/cfdemParticleComp/Make/options @@ -4,7 +4,7 @@ sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) sinclude $(RULES)/mplib$(WM_MPLIB) -GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) +GIT_VERSION := $(shell git describe --dirty --always --tags) PFLAGS+= -DGITVERSION=\"$(GIT_VERSION)\" PFLAGS+= -Dcompre @@ -24,6 +24,9 @@ EXE_INC = \ -I$(CFDEM_LIGGGHTS_SRC_DIR) \ -I$(CFDEM_M2MLIB_PATH) \ -I$(CFDEM_SRC_DIR)/cfdTools \ + -Wno-old-style-cast \ + -Wno-unused-result \ + -Wno-literal-suffix LIB_LIBS = \ $(PLIBS) \ From 232e8a75d0a5cf41210bcefec0e3cf125abe04d0 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 18 May 2017 14:10:00 +0200 Subject: [PATCH 21/99] use better name for volScalarField --- .../smoothingModel/constDiffSmoothing/constDiffSmoothing.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C b/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C index 824b2630..dc739cc2 100644 --- a/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C +++ b/src/lagrangian/cfdemParticle/subModels/smoothingModel/constDiffSmoothing/constDiffSmoothing.C @@ -194,7 +194,7 @@ void constDiffSmoothing::smoothenReferenceField(volVectorField& fieldSrc) const ( IOobject ( - "xxx", + "NLarge", particleCloud_.mesh().time().timeName(), particleCloud_.mesh(), IOobject::NO_READ, From ac4c80e14888d58f2398907a6deb7af41f4cb875 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 18 May 2017 16:56:46 +0200 Subject: [PATCH 22/99] fix some const madness generally: setter methods should not be const getter methods are predestined candidates for const --- .../cfdemParticle/cfdemCloud/cfdemCloud.H | 12 ++++++------ .../cfdemParticle/cfdemCloud/cfdemCloudI.H | 16 ++++++++-------- .../derived/cfdemCloudMS/cfdemCloudMS.H | 6 +++--- .../derived/cfdemCloudMS/cfdemCloudMSI.H | 8 ++++---- .../dataExchangeModel/dataExchangeModel.H | 6 +++--- .../dataExchangeModel/twoWayMPI/twoWayMPI.H | 2 +- .../twoWayMany2Many/twoWayMany2Many.H | 4 ++-- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index 5de625ff..ca251001 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -250,7 +250,7 @@ public: label liggghtsCommandModelIndex(word); - inline void setCG(double) const; + inline void setCG(double); inline const scalar& cg() const; @@ -300,13 +300,13 @@ public: inline double ** particleWeights() const; - virtual inline label body(int); + virtual inline label body(int) const; - virtual inline double particleVolume(int); + virtual inline double particleVolume(int) const; - inline scalar radius(int); + inline scalar radius(int) const; - virtual inline double d(int); + virtual inline double d(int) const; inline scalar d32(bool recalc=true); virtual inline double dMin() {return -1;} @@ -347,7 +347,7 @@ public: inline const momCoupleModel& momCoupleM(int) const; - inline const dataExchangeModel& dataExchangeM() const; + inline dataExchangeModel& dataExchangeM(); inline const IOModel& IOM() const; diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H index eeb829b7..7d26b0cc 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H @@ -44,7 +44,7 @@ namespace Foam { // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline void cfdemCloud::setCG(double cg) const +inline void cfdemCloud::setCG(double cg) { cg_ = cg; Info << "cg is set to: " << cg_ << endl; @@ -177,24 +177,24 @@ inline double ** cfdemCloud::particleWeights() const return particleWeights_; } -inline label cfdemCloud::body(int index) +inline label cfdemCloud::body(int index) const { return index; } -inline double cfdemCloud::particleVolume(int index) +inline double cfdemCloud::particleVolume(int index) const { return particleV_[index][0]; } -inline scalar cfdemCloud::radius(int index) +inline scalar cfdemCloud::radius(int index) const { return radii_[index][0]; } -inline double cfdemCloud::d(int index) +inline double cfdemCloud::d(int index) const { - return 2*radii_[index][0]; + return 2.*radii_[index][0]; } inline double cfdemCloud::d32(bool recalc) @@ -252,9 +252,9 @@ inline const momCoupleModel& cfdemCloud::momCoupleM(int i) const return momCoupleModel_[i]; } -inline const dataExchangeModel& cfdemCloud::dataExchangeM() const +inline dataExchangeModel& cfdemCloud::dataExchangeM() { - return dataExchangeModel_; + return dataExchangeModel_(); } inline const IOModel& cfdemCloud::IOM() const diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H index 9888149b..563e840d 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H @@ -117,9 +117,9 @@ public: // Member Functions // Access - inline label body(int); + inline label body(int) const; - inline double particleVolume(int); + inline double particleVolume(int) const; inline vector positionCM(int); @@ -127,7 +127,7 @@ public: inline label cellIDCM(int); - inline label nrigid(int); + inline label nrigid(int) const; inline int nrForceModels(); diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H index ecb76590..f9f10832 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H @@ -36,12 +36,12 @@ namespace Foam // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline label cfdemCloudMS::body(int index) +inline label cfdemCloudMS::body(int index) const { return bodies_[0][index]-1; } -inline double cfdemCloudMS::particleVolume(int index) +inline double cfdemCloudMS::particleVolume(int index) const { int ind = body(index); // particle to clump ID @@ -50,7 +50,7 @@ inline double cfdemCloudMS::particleVolume(int index) Vp=clumpVol_[ind][0]; else Warning << "ind=" << ind << endl; - + int nR(nrigid(ind)); if(nR>0) Vp/=nR; return Vp; @@ -75,7 +75,7 @@ inline label cfdemCloudMS::cellIDCM(int index) return cellIDsCM_[index][0]; } -inline label cfdemCloudMS::nrigid(int index) +inline label cfdemCloudMS::nrigid(int index) const { return nrigids_[0][index]; } diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H index a1c7b78c..e6098fb7 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H @@ -245,16 +245,16 @@ public: for (int i=0;iforce->cg()); } + void setCG() { particleCloud_.setCG(lmp->force->cg()); } }; diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.H index 76d5de73..96d8fc25 100644 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.H +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/twoWayMany2Many.H @@ -114,7 +114,7 @@ private: mutable int *cellID_foam_; mutable double *pos_foam_; - const polyBoundaryMesh& pbm_; + const polyBoundaryMesh& pbm_; const globalMeshData& pData_; const labelList& procPatches_; const labelList& procPatchIndices_; @@ -209,7 +209,7 @@ public: void syncIDs() const; void locateParticle(int*, bool) const; word myType() const { return typeName; } - void setCG() const { particleCloud_.setCG(lmp->force->cg()); } + void setCG() { particleCloud_.setCG(lmp->force->cg()); } }; From e11697a9f2e1a687af066f7cd23148895fd5b74f Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 19 May 2017 14:35:26 +0200 Subject: [PATCH 23/99] fix some more const madness --- src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H | 12 ++++++------ .../cfdemParticle/cfdemCloud/cfdemCloudI.H | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index ca251001..69322637 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -252,17 +252,17 @@ public: inline void setCG(double); - inline const scalar& cg() const; + inline scalar cg() const; - inline const bool& impDEMdrag() const; + inline bool impDEMdrag() const; - inline const bool& impDEMdragAcc() const; + inline bool impDEMdragAcc() const; - inline const scalar& imExSplitFactor() const; + inline scalar imExSplitFactor() const; - inline const bool& treatVoidCellsAsExplicitForce() const; + inline bool treatVoidCellsAsExplicitForce() const; - inline const bool& ignore() const; + inline bool ignore() const; inline const fvMesh& mesh() const; diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H index 7d26b0cc..abe063ef 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H @@ -50,32 +50,32 @@ inline void cfdemCloud::setCG(double cg) Info << "cg is set to: " << cg_ << endl; } -inline const bool& cfdemCloud::impDEMdrag() const +inline bool cfdemCloud::impDEMdrag() const { return impDEMdrag_; } -inline const bool& cfdemCloud::impDEMdragAcc() const +inline bool cfdemCloud::impDEMdragAcc() const { return impDEMdragAcc_; } -inline const scalar& cfdemCloud::imExSplitFactor() const +inline scalar cfdemCloud::imExSplitFactor() const { return imExSplitFactor_; } -inline const bool& cfdemCloud::treatVoidCellsAsExplicitForce() const +inline bool cfdemCloud::treatVoidCellsAsExplicitForce() const { return treatVoidCellsAsExplicitForce_; } -inline const scalar& cfdemCloud::cg() const +inline scalar cfdemCloud::cg() const { return cg_; } -inline const bool& cfdemCloud::ignore() const +inline bool cfdemCloud::ignore() const { return ignore_; } From c19b04e6d06346e4559d06c9e9b9d83ea116fa73 Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 19 May 2017 14:40:26 +0200 Subject: [PATCH 24/99] save local variable --- src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 3bde71ab..b3b94289 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -431,8 +431,7 @@ void cfdemCloud::setPos(double**& pos) label cfdemCloud::particleCell(int index) { - label cellI = cellIDs()[index][0]; - return cellI; + return cellIDs()[index][0]; } vector cfdemCloud::position(int index) @@ -485,16 +484,14 @@ scalar cfdemCloud::voidfraction(int index) label cfdemCloud::liggghtsCommandModelIndex(word name) { - int index=-1; forAll(liggghtsCommandModelList_,i) { if(liggghtsCommand()[i]().name() == name) { - index = i; - break; + return i; } } - return index; + return -1; } // * * * * * * * * * * * * * * * WRITE * * * * * * * * * * * * * // From 13da1dd890ca694ac43b81333a6750accc8edc46 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 24 May 2017 11:53:29 +0200 Subject: [PATCH 25/99] make clock model indpendent of cfdemCloud New version only depends on valid Foam::Time instance --- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 2 +- .../clockModel/clockModel/clockModel.C | 55 ++++++++----------- .../clockModel/clockModel/clockModel.H | 20 +++---- .../clockModel/clockModel/newClockModel.C | 6 +- .../subModels/clockModel/noClock/noClock.C | 4 +- .../subModels/clockModel/noClock/noClock.H | 8 +-- .../clockModel/standardClock/standardClock.C | 9 +-- .../clockModel/standardClock/standardClock.H | 4 +- 8 files changed, 49 insertions(+), 59 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index b3b94289..eec84a6e 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -196,7 +196,7 @@ cfdemCloud::cfdemCloud clockModel::New ( couplingProperties_, - *this + mesh.time() ) ), smoothingModel_ diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C index 97d2dd17..e2aa79c4 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.C @@ -33,7 +33,7 @@ Description #include #include "clockModel.H" #include - +#include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,16 +51,15 @@ defineRunTimeSelectionTable(clockModel, dictionary); void clockModel::start(int pos) const { start(pos,""); - return; } void clockModel::start(int pos, const std::string& ident) const { - if (particleCloud_.mesh().time().value() > startTime_) + if (time_.value() > startTime_) { if (pos >= n_) // alternatively one fixed size? { - n_ = 2*n_; + n_ += 32; deltaT_.resize(n_,0); identifier_.resize(n_,""); nOfRuns_.resize(n_,0); @@ -73,14 +72,13 @@ void clockModel::start(int pos, const std::string& ident) const parent_[pos]=curParent_; curParent_ = pos; nOfRuns_[pos] += 1; - deltaT_[pos]-=std::clock(); + deltaT_[pos] -= std::clock(); } - return; } void clockModel::stop() const { - if (particleCloud_.mesh().time().value() > startTime_) + if (time_.value() > startTime_) { deltaT_[curParent_] += std::clock(); curLev_ -= 1; @@ -93,17 +91,16 @@ void clockModel::stop() const curParent_ = -1; } } - return; } void clockModel::stop(const std::string& ident) const { - if (particleCloud_.mesh().time().value() > startTime_) + if (time_.value() > startTime_) { deltaT_[curParent_] += std::clock(); if (curParent_ > 0 && identifier_[curParent_].compare(ident) != 0) { - Pout<<"Warning: stop identifier did not equal start identifier! "<= 0) @@ -115,7 +112,6 @@ void clockModel::stop(const std::string& ident) const curParent_ = -1; } } - return; } std::string clockModel::eval() const @@ -162,7 +158,7 @@ void clockModel::evalFile() const void clockModel::evalPar() const { int myrank, numprocs; - MPI_Comm_rank(MPI_COMM_WORLD,&myrank); + MPI_Comm_rank(MPI_COMM_WORLD, &myrank); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); std::ofstream outFile; @@ -227,18 +223,16 @@ void clockModel::evalPar() const outFile << strs.str(); outFile.close(); } - - return; } void clockModel::initElems() { //init elems - for (int i = 0;i < n_; i++) + for (int i = 0; i < n_; ++i) { deltaT_[i] = 0; - identifier_[i] = ""; + identifier_[i].clear(); nOfRuns_[i] = 0; level_[i] = -1; parent_[i] = -2; @@ -249,7 +243,7 @@ std::vector clockModel::calcShift() const { std::vector shifts(n_, 0); - for (int i=1; i(SwapMem)/1024.0; //kB -> MB - double RssMB = static_cast(RssMem)/1024.0; + double SwapMB = SwapMem/1024.0; //kB -> MB + double RssMB = RssMem/1024.0; inFile.close(); // set up communication between Procs and plot Stuff Info << " RAM USAGE HISTOGRAM in MB" << endl; plotHist(RssMB,"RSS memory used",numprocs,myrank); + if (SwapMem > 0) { plotHist(SwapMB,"WARNING: Swap",numprocs,myrank); @@ -398,8 +392,6 @@ void clockModel::getRAMUsage() const //Pout << "SWAP Memory used: " << SwapMem <<"MB\n"; //Pout << "Rss Memory used: " << RssMem <<"MB\n"; - - return; } // * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * // @@ -409,15 +401,14 @@ void clockModel::getRAMUsage() const clockModel::clockModel ( const dictionary& dict, - cfdemCloud& sm + const Time& time ) : dict_(dict), - particleCloud_(sm), + time_(time), path_("clockData"), - startTime_(sm.mesh().time().startTime().value()+sm.mesh().time().deltaT().value()+SMALL), // delay start of measurement by deltaT - //startTime_(0), //no delay - n_(30), + startTime_(time.startTime().value()+time.deltaT().value()+SMALL), // delay start of measurement by deltaT + n_(32), deltaT_(n_), identifier_(n_), nOfRuns_(n_), diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.H b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.H index 942eae1b..ac9888c4 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.H +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/clockModel.H @@ -42,10 +42,8 @@ SourceFiles #define START(x) start(__COUNTER__,x) #include "fvCFD.H" -#include "cfdemCloud.H" -#include "dataExchangeModel.H" - #include + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -61,7 +59,7 @@ protected: // Protected data const dictionary& dict_; - cfdemCloud& particleCloud_; + const Time& time_; fileName path_; scalar startTime_; @@ -88,9 +86,9 @@ public: dictionary, ( const dictionary& dict, - cfdemCloud& sm + const Time& time ), - (dict,sm) + (dict,time) ); @@ -100,7 +98,7 @@ public: clockModel ( const dictionary& dict, - cfdemCloud& sm + const Time& time ); @@ -114,7 +112,7 @@ public: static autoPtr New ( const dictionary& dict, - cfdemCloud& sm + const Time& time ); @@ -129,9 +127,9 @@ public: virtual void evalPar() const; void initElems(); std::vector calcShift() const; //detects empty indices in vector, when times are evaluated - void Hist() const; //calc Histogram - virtual void normHist() const; //calc normalized Histogram - void plotHist(double,const std::string&,int,int) const; //plot histogramm to terminal + void Hist() const; //calc Histogram + virtual void normHist() const; //calc normalized Histogram + void plotHist(double,const std::string&,int,int) const; //plot histogramm to terminal void getRAMUsage() const; }; diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/newClockModel.C b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/newClockModel.C index f789525a..c3816d23 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/newClockModel.C +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/clockModel/newClockModel.C @@ -44,7 +44,7 @@ namespace Foam autoPtr clockModel::New ( const dictionary& dict, - cfdemCloud& sm + const Time& time ) { word clockModelType @@ -52,7 +52,7 @@ autoPtr clockModel::New dict.lookup("clockModel") ); - Info<< "Selecting clockModel " + Info << "Selecting clockModel " << clockModelType << endl; @@ -73,7 +73,7 @@ autoPtr clockModel::New << abort(FatalError); } - return autoPtr(cstrIter()(dict,sm)); + return autoPtr(cstrIter()(dict,time)); } diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.C b/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.C index 550724fb..b224b02c 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.C +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.C @@ -56,10 +56,10 @@ addToRunTimeSelectionTable noClock::noClock ( const dictionary& dict, - cfdemCloud& sm + const Time& time ) : - clockModel(dict,sm) + clockModel(dict,time) { initElems(); } diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H b/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H index 7af54865..744b9a88 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class noDrag Declaration + Class noClock Declaration \*---------------------------------------------------------------------------*/ class noClock @@ -67,7 +67,7 @@ public: noClock ( const dictionary& dict, - cfdemCloud& sm + const Time& time ); // Destructor @@ -79,8 +79,8 @@ public: void start(int pos) const {} void start(int pos,const std::string& identifier) const {} - void stop() const {} - void stop(const std::string& identifier) const {} + void stop() {} + void stop(const std::string& identifier) {} std::string eval() const { return ""; } void evalFile() const {} void evalPar() const {} diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.C b/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.C index bda6e6ce..25c11b14 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.C +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.C @@ -30,7 +30,6 @@ Description \*---------------------------------------------------------------------------*/ #include "error.H" -#include "IOModel.H" #include "standardClock.H" #include "addToRunTimeSelectionTable.H" @@ -57,12 +56,14 @@ addToRunTimeSelectionTable standardClock::standardClock ( const dictionary& dict, - cfdemCloud& sm + const Time& time ) : - clockModel(dict,sm) + clockModel(dict,time) { - path_=particleCloud_.IOM().createTimeDir(path_); + path_ = path_/time_.timeName(); + mkDir(path_,0777); + initElems(); } diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.H b/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.H index 3b62490c..b4bf2a35 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.H +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/standardClock/standardClock.H @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class noDrag Declaration + Class standardClock Declaration \*---------------------------------------------------------------------------*/ class standardClock @@ -67,7 +67,7 @@ public: standardClock ( const dictionary& dict, - cfdemCloud& sm + const Time& time ); // Destructor From fe24c2c7ed23081938fb6835ad347300b214bb21 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 12 Jun 2017 15:44:29 +0200 Subject: [PATCH 26/99] fix some more const madness --- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 16 ++++++++++------ .../cfdemParticle/cfdemCloud/cfdemCloud.H | 16 ++++++++-------- .../cfdemParticle/cfdemCloud/cfdemCloudI.H | 2 +- .../subModels/forceModel/forceModel/forceModel.H | 10 +++++----- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index eec84a6e..6a28348e 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -412,12 +412,15 @@ void cfdemCloud::setVectorAverages() ); if(verbose_) Info << "setVectorAverage done." << endl; } + // * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * // + void cfdemCloud::checkCG(bool ok) { if(!cgOK_) return; if(!ok) cgOK_ = ok; } + void cfdemCloud::setPos(double**& pos) { for(int index = 0;index < numberOfParticles(); ++index) @@ -427,35 +430,36 @@ void cfdemCloud::setPos(double**& pos) } } } + // * * * * * * * * * * * * * * * ACCESS * * * * * * * * * * * * * // -label cfdemCloud::particleCell(int index) +label cfdemCloud::particleCell(int index) const { return cellIDs()[index][0]; } -vector cfdemCloud::position(int index) +vector cfdemCloud::position(int index) const { vector pos; for(int i=0;i<3;i++) pos[i] = positions()[index][i]; return pos; } -vector cfdemCloud::velocity(int index) +vector cfdemCloud::velocity(int index) const { vector vel; for(int i=0;i<3;i++) vel[i] = velocities()[index][i]; return vel; } -vector cfdemCloud::expForce(int index) +vector cfdemCloud::expForce(int index) const { vector force; for(int i=0;i<3;i++) force[i] = DEMForces()[index][i]; return force; } -vector cfdemCloud::fluidVel(int index) +vector cfdemCloud::fluidVel(int index) const { vector vel; for(int i=0;i<3;i++) vel[i] = fluidVels()[index][i]; @@ -477,7 +481,7 @@ int cfdemCloud::nrMomCoupleModels() return momCoupleModels_.size(); } -scalar cfdemCloud::voidfraction(int index) +scalar cfdemCloud::voidfraction(int index) const { return voidfractions()[index][0]; } diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index 69322637..b1b93e16 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -228,17 +228,17 @@ public: void setPos(double **&); - word modelType(){ return modelType_; } + const word& modelType() const { return modelType_; } - label particleCell(int); + label particleCell(int) const; - vector position(int); + vector position(int) const; - vector velocity(int); + vector velocity(int) const; - vector expForce(int); + vector expForce(int) const; - vector fluidVel(int); + vector fluidVel(int) const; virtual const forceModel& forceM(int); @@ -246,7 +246,7 @@ public: virtual int nrMomCoupleModels(); - scalar voidfraction(int); + scalar voidfraction(int) const; label liggghtsCommandModelIndex(word); @@ -339,7 +339,7 @@ public: inline bool arraysReallocated() const; - inline const wordList& forceModels(); + inline const wordList& forceModels() const; inline const voidFractionModel& voidFractionM() const; diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H index abe063ef..2fbe1744 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H @@ -237,7 +237,7 @@ inline bool cfdemCloud::arraysReallocated() const return arraysReallocated_; } -inline const wordList& cfdemCloud::forceModels() +inline const wordList& cfdemCloud::forceModels() const { return forceModels_; } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.H index 99b7733c..204652eb 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.H @@ -131,7 +131,7 @@ public: virtual void manipulateScalarField(volScalarField&) const; // Access - word modelType() { return modelType_; } + const word& modelType() const { return modelType_; } inline volVectorField& impParticleForces() const { return impParticleForces_; } @@ -147,7 +147,7 @@ public: inline double ** fluidVel() const { return particleCloud_.fluidVel_; } - inline const bool& coupleForce() const { return coupleForce_; } + inline bool coupleForce() const { return coupleForce_; } virtual inline bool& requiresEx() { return requiresEx_; } @@ -155,11 +155,11 @@ public: void treatVoidCells() const; - inline const wordList& forceSubModels(){ return forceSubModels_; } + inline const wordList& forceSubModels() { return forceSubModels_; } - inline const forceSubModel& forceSubM(int i) const { return forceSubModel_[i]; } + inline forceSubModel& forceSubM(int i) const { return forceSubModel_[i](); } - inline int nrForceSubModels(){ return forceSubModels_.size(); } + inline int nrForceSubModels() const { return forceSubModels_.size(); } void setForceSubModels(dictionary& dict); }; From 9bd2fcf326591953dcf727aa19d90c579b98e94c Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 12 Jun 2017 16:07:39 +0200 Subject: [PATCH 27/99] introduce enum for forceSubModel switches --- .../forceModel/Archimedes/Archimedes.C | 10 ++-- .../forceModel/ArchimedesIB/ArchimedesIB.C | 4 +- .../forceModel/BeetstraDrag/BeetstraDrag.C | 10 ++-- .../forceModel/DiFeliceDrag/DiFeliceDrag.C | 10 ++-- .../forceModel/Fines/ErgunStatFines.C | 10 ++-- .../forceModel/Fines/FanningDynFines.C | 6 +- .../forceModel/GidaspowDrag/GidaspowDrag.C | 16 +++--- .../forceModel/KochHillDrag/KochHillDrag.C | 18 +++--- .../KochHillRWDrag/KochHillRWDrag.C | 4 +- .../LaEuScalarTemp/LaEuScalarTemp.C | 6 +- .../subModels/forceModel/MeiLift/MeiLift.C | 8 +-- .../SchillerNaumannDrag/SchillerNaumannDrag.C | 2 +- .../forceModel/ShirgaonkarIB/ShirgaonkarIB.C | 2 +- .../forceSubModel/forceSubModel.C | 57 +++++++++---------- .../forceSubModel/forceSubModel.H | 41 ++++++++----- .../forceModel/gradPForce/gradPForce.C | 14 ++--- .../forceModel/interface/interface.C | 2 +- .../subModels/forceModel/noDrag/noDrag.C | 6 +- .../virtualMassForce/virtualMassForce.C | 4 +- .../forceModel/viscForce/viscForce.C | 20 +++---- .../DiFeliceDragMS/DiFeliceDragMS.C | 8 +-- 21 files changed, 134 insertions(+), 124 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C index 18172461..c218844d 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Archimedes/Archimedes.C @@ -84,20 +84,20 @@ Archimedes::Archimedes setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(1,true); // activate treatForceDEM switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_DEM,true); // activate treatForceDEM switch forceSubM(0).readSwitches(); if (modelType_=="A" || modelType_=="Bfull") { - if(!forceSubM(0).switches()[1]) // treatDEM != true + if(!forceSubM(0).switches()[SW_TREAT_FORCE_DEM]) // treatDEM != true { Warning << "Usually model type A and Bfull need Archimedes only on DEM side only (treatForceDEM=true)! are you sure about your settings?" << endl; } } else if (modelType_=="B") { - if(forceSubM(0).switches()[1]) // treatDEM = true + if(forceSubM(0).switches()[SW_TREAT_FORCE_DEM]) // treatDEM = true { Warning << "Usually model type B needs Archimedes on CFD and DEM side (treatForceDEM=false)! are you sure about your settings?" << endl; } @@ -126,7 +126,7 @@ void Archimedes::setForce() const //if(mask[index][0]) //{ label cellI = particleCloud_.cellIDs()[index][0]; - force=vector::zero; + force = vector::zero; if (cellI > -1) // particle Found { diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C index 55f49a3e..4bafc636 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ArchimedesIB/ArchimedesIB.C @@ -83,12 +83,12 @@ ArchimedesIB::ArchimedesIB setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); - forceSubM(0).setSwitches(1,true); // treatDEM = true + forceSubM(0).setSwitches(SW_TREAT_FORCE_DEM,true); // treatDEM = true Info << "accounting for Archimedes only on DEM side!" << endl; particleCloud_.checkCG(true); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C index f49d087d..58677ad3 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/BeetstraDrag/BeetstraDrag.C @@ -70,11 +70,11 @@ BeetstraDrag::BeetstraDrag // init force sub model setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(2,true); // activate implDEM switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_IMPL_FORCE_DEM,true); // activate implDEM switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch forceSubM(0).readSwitches(); particleCloud_.checkCG(true); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C index 4960cd01..c15da1e1 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/DiFeliceDrag/DiFeliceDrag.C @@ -90,11 +90,11 @@ DiFeliceDrag::DiFeliceDrag setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(2,true); // activate implDEM switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_IMPL_FORCE_DEM,true); // activate implDEM switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C index e696308f..e229c15e 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/ErgunStatFines.C @@ -77,11 +77,11 @@ ErgunStatFines::ErgunStatFines // init force sub model setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(2,true); // activate implDEM switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_IMPL_FORCE_DEM,true); // activate implDEM switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch forceSubM(0).readSwitches(); particleCloud_.checkCG(true); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C index 5096ace0..29cbdd36 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/Fines/FanningDynFines.C @@ -65,10 +65,10 @@ FanningDynFines::FanningDynFines // init force sub model setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch forceSubM(0).readSwitches(); - forceSubM(0).setSwitches(0,true); + forceSubM(0).setSwitches(SW_TREAT_FORCE_EXPLICIT,true); particleCloud_.checkCG(true); if (propsDict_.found("scale")) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C index 4e9fc5bf..57bb5d3c 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/GidaspowDrag/GidaspowDrag.C @@ -86,11 +86,11 @@ GidaspowDrag::GidaspowDrag // init force sub model setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(2,true); // activate implDEM switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_IMPL_FORCE_DEM,true); // activate implDEM switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch forceSubM(0).readSwitches(); particleCloud_.checkCG(true); @@ -114,13 +114,13 @@ GidaspowDrag::~GidaspowDrag() void GidaspowDrag::setForce() const { - if (scaleDia_ > 1) + if (scaleDia_ > 1.) { Info << "Gidaspow using scale = " << scaleDia_ << endl; } - else if (particleCloud_.cg() > 1) + else if (particleCloud_.cg() > 1.) { - scaleDia_=particleCloud_.cg(); + scaleDia_ = particleCloud_.cg(); Info << "Gidaspow using scale from liggghts cg = " << scaleDia_ << endl; } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C index a8739e09..7368d942 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillDrag/KochHillDrag.C @@ -86,12 +86,12 @@ KochHillDrag::KochHillDrag setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(2,true); // activate implDEM switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(7,true); // activate implForceDEMacc switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_IMPL_FORCE_DEM,true); // activate implDEM switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_IMPL_FORCE_DEM_ACCUMULATED,true); // activate implForceDEMacc switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); @@ -99,9 +99,9 @@ KochHillDrag::KochHillDrag particleCloud_.checkCG(true); if (propsDict_.found("scale")) - scaleDia_=scalar(readScalar(propsDict_.lookup("scale"))); + scaleDia_ = scalar(readScalar(propsDict_.lookup("scale"))); if (propsDict_.found("scaleDrag")) - scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag"))); + scaleDrag_ = scalar(readScalar(propsDict_.lookup("scaleDrag"))); } @@ -230,7 +230,7 @@ void KochHillDrag::setForce() const if (modelType_ == "B") dragCoefficient /= voidfraction; - if (forceSubM(0).switches()[7]) // implForceDEMaccumulated=true + if (forceSubM(0).switches()[SW_IMPL_FORCE_DEM_ACCUMULATED]) // implForceDEMaccumulated=true { //get drag from the particle itself for (int j=0; j<3; j++) drag[j] = particleCloud_.fAccs()[index][j]/couplingInterval; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C index 540d058d..616069c8 100755 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C @@ -87,8 +87,8 @@ KochHillRWDrag::KochHillRWDrag setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(2,true); // activate implDEM switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_IMPL_FORCE_DEM,true); // activate implDEM switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C index 6a2a15e9..bb8813fc 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/LaEuScalarTemp/LaEuScalarTemp.C @@ -89,9 +89,9 @@ LaEuScalarTemp::LaEuScalarTemp setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C index 2b6cd53a..0dca7e3b 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C @@ -73,10 +73,10 @@ MeiLift::MeiLift // init force sub model setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch forceSubM(0).readSwitches(); particleCloud_.checkCG(false); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C index a28f5133..0c89a4aa 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/SchillerNaumannDrag/SchillerNaumannDrag.C @@ -82,7 +82,7 @@ SchillerNaumannDrag::SchillerNaumannDrag setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C b/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C index 53f4f338..d0002a81 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/ShirgaonkarIB/ShirgaonkarIB.C @@ -89,7 +89,7 @@ ShirgaonkarIB::ShirgaonkarIB setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C index 84ecc272..fe3e98df 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.C @@ -59,7 +59,7 @@ forceSubModel::forceSubModel dict_(dict), particleCloud_(sm), forceModel_(fm), - nrDefaultSwitches_(9), // !!! + nrDefaultSwitches_(SW_MAX), switchesNameList_(nrDefaultSwitches_), switchesList_(nrDefaultSwitches_), switches_(nrDefaultSwitches_), @@ -106,16 +106,15 @@ forceSubModel::forceSubModel rho_(sm.mesh().lookupObject (densityFieldName_)) { // init standard switch list - int iCounter(0); - switchesNameList_[iCounter]="treatForceExplicit"; iCounter++; //0 - switchesNameList_[iCounter]="treatForceDEM";iCounter++; //1 - switchesNameList_[iCounter]="implForceDEM";iCounter++; //2 - switchesNameList_[iCounter]="verbose";iCounter++; //3 - switchesNameList_[iCounter]="interpolation";iCounter++; //4 - switchesNameList_[iCounter]="useFilteredDragModel";iCounter++; //5 - switchesNameList_[iCounter]="useParcelSizeDependentFilteredDrag";iCounter++; //6 - switchesNameList_[iCounter]="implForceDEMaccumulated";iCounter++; //7 - switchesNameList_[iCounter]="scalarViscosity";iCounter++; //8 + switchesNameList_[SW_TREAT_FORCE_EXPLICIT] = "treatForceExplicit"; + switchesNameList_[SW_TREAT_FORCE_DEM] = "treatForceDEM"; + switchesNameList_[SW_IMPL_FORCE_DEM] = "implForceDEM"; + switchesNameList_[SW_VERBOSE] = "verbose"; + switchesNameList_[SW_INTERPOLATION] = "interpolation"; + switchesNameList_[SW_FILTERED_DRAG_MODEL] ="useFilteredDragModel"; + switchesNameList_[SW_PARCEL_SIZE_DEPENDENT_FILTERED_DRAG] = "useParcelSizeDependentFilteredDrag"; + switchesNameList_[SW_IMPL_FORCE_DEM_ACCUMULATED] = "implForceDEMaccumulated"; + switchesNameList_[SW_SCALAR_VISCOSITY] = "scalarViscosity"; // sanity check of what is defined above if(switchesNameList_.size() != nrDefaultSwitches_) @@ -139,9 +138,9 @@ void forceSubModel::partToArray ) const { // forces for CFD - if(!switches_[1])// !treatDEM + if(!switches_[SW_TREAT_FORCE_DEM])// !treatDEM { - if(switches_[0]) // treatExplicit + if(switches_[SW_TREAT_FORCE_EXPLICIT]) // treatExplicit { for(int j=0;j<3;j++) myForceM().expForces()[index][j] += dragTot[j]; @@ -157,12 +156,12 @@ void forceSubModel::partToArray } // forces for DEM - if(switches_[2]) // implForceDEM + if(switches_[SW_IMPL_FORCE_DEM]) // implForceDEM { for(int j=0;j<3;j++) myForceM().fluidVel()[index][j]=Ufluid[j]; - myForceM().Cds()[index][0]=Cd; + myForceM().Cds()[index][0] = Cd; } else { @@ -191,7 +190,7 @@ void forceSubModel::explicitCorr // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void forceSubModel::readSwitches() const +void forceSubModel::readSwitches() { Info << "\nreading switches for forceSubModel:" << myType() << endl; forAll(switchesNameList_,i) @@ -200,23 +199,23 @@ void forceSubModel::readSwitches() const { Info << " looking for " << switchesNameList_[i] << " ..." << endl; if (dict_.found(switchesNameList_[i])) - switches_[i]=Switch(dict_.lookup(switchesNameList_[i])); + switches_[i] = Switch(dict_.lookup(switchesNameList_[i])); Info << "\t" << switchesNameList_[i] << " = " << switches_[i] << endl; } } Info << endl; - if(switches_[2]) // implForceDEM=true + if(switches_[SW_IMPL_FORCE_DEM]) // implForceDEM=true { // communicate implForceDEM to particleCloud - particleCloud_.impDEMdrag_=true; + particleCloud_.impDEMdrag_ = true; // do sanity check // This can work if the accumulator is used, but is explicitely applied on the CFD side // Sanity check is therefore not necessary here /* - if(switches_[0]) // treatExplicit=true + if(switches_[SW_TREAT_FORCE_EXPLICIT]) // treatExplicit=true { FatalError << "Please check your settings, treatExplicit together with implForceDEM does not work!." << abort(FatalError); @@ -224,24 +223,24 @@ void forceSubModel::readSwitches() const */ } - if(switches_[7]) // implForceDEMaccumulated=true + if(switches_[SW_IMPL_FORCE_DEM_ACCUMULATED]) // implForceDEMaccumulated=true { // sanity check for implForceDEMaccumulated - if(!switches_[2]) //implForceDEM=false + if(!switches_[SW_IMPL_FORCE_DEM]) //implForceDEM=false { Warning<< "please check your settings, implForceDEMaccumulated without implForceDEM does not work! (using implForceDEMaccumulated=false)" << endl; - switches_[3]=false; + switches_[SW_VERBOSE] = false; }else { - particleCloud_.impDEMdragAcc_=true; + particleCloud_.impDEMdragAcc_ = true; } } - if(switches_[8]) // scalarViscosity=true + if(switches_[SW_SCALAR_VISCOSITY]) // scalarViscosity=true { Info << "Using a constant viscosity for this force model." << endl; dimensionedScalar nu0_("nu", dimensionSet(0, 2, -1, 0, 0), dict_.lookup("nu")); - nu_=volScalarField + nu_ = volScalarField ( IOobject ( @@ -274,7 +273,7 @@ const volScalarField& forceSubModel::nuField() const nu_=particleCloud_.turbulence().mu() / rho_; return nu_; #else - if(switches_[8]) // scalarViscosity=true + if(switches_[SW_SCALAR_VISCOSITY]) // scalarViscosity=true return nu_; else return particleCloud_.turbulence().nu(); @@ -287,9 +286,9 @@ const volScalarField& forceSubModel::muField() const return particleCloud_.turbulence().mu(); #else // passing the ref to nu*rho will not work->generate a mu_ field like nu_ - FatalError<< "implementation not complete!" << abort(FatalError); + FatalError << "implementation not complete!" << abort(FatalError); - if(switches_[8]) // scalarViscosity=true + if(switches_[SW_SCALAR_VISCOSITY]) // scalarViscosity=true return nu_*rho_; else return particleCloud_.turbulence().nu()*rho_; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H index 4e0a3d3a..591c525a 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceSubModels/forceSubModel/forceSubModel.H @@ -47,6 +47,19 @@ SourceFiles namespace Foam { +enum { + SW_TREAT_FORCE_EXPLICIT = 0, + SW_TREAT_FORCE_DEM, + SW_IMPL_FORCE_DEM, + SW_VERBOSE, + SW_INTERPOLATION, + SW_FILTERED_DRAG_MODEL, + SW_PARCEL_SIZE_DEPENDENT_FILTERED_DRAG, + SW_IMPL_FORCE_DEM_ACCUMULATED, + SW_SCALAR_VISCOSITY, + SW_MAX +}; + /*---------------------------------------------------------------------------*\ Class forceSubModel Declaration \*---------------------------------------------------------------------------*/ @@ -67,9 +80,9 @@ protected: wordList switchesNameList_; // names of switches available - mutable List switchesList_; // switches which are requested in dict + List switchesList_; // switches which are requested from dict - mutable List switches_; + List switches_; // switch status mutable volScalarField nu_; @@ -136,29 +149,27 @@ public: // Access - inline bool verbose() const { return switches_[3]; } + inline bool verbose() const { return switches_[SW_VERBOSE]; } - inline bool interpolation() const { return switches_[4]; } + inline bool interpolation() const { return switches_[SW_INTERPOLATION]; } - inline bool useFilteredDragModel() const { return switches_[5]; } + inline bool useFilteredDragModel() const { return switches_[SW_FILTERED_DRAG_MODEL]; } - inline bool useParcelSizeDependentFilteredDrag() const { return switches_[6]; } + inline bool useParcelSizeDependentFilteredDrag() const { return switches_[SW_PARCEL_SIZE_DEPENDENT_FILTERED_DRAG]; } - virtual word myType() const=0; + virtual word myType() const = 0; - inline forceModel& myForceM() const { return forceModel_;} + inline forceModel& myForceM() const { return forceModel_; } - inline const List& switches() const { return switches_;} + inline const List& switches() const { return switches_; } - inline const wordList& switchesNameList() const { return switchesNameList_;} + inline const wordList& switchesNameList() const { return switchesNameList_; } - void setSwitchesList(label i, bool v) const { switchesList_[i] = v;} + void setSwitchesList(label i, Switch v) { switchesList_[i] = v; } - void setSwitches(label i, Switch v) const { switches_[i] = v;} + void setSwitches(label i, Switch v) { switches_[i] = v; } - virtual void readSwitches() const; - - const label& nrDefaultSwitches() const {return nrDefaultSwitches_;} + virtual void readSwitches(); const volScalarField& nuField() const; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C index 7bcfcb57..586579b7 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/gradPForce/gradPForce.C @@ -74,9 +74,9 @@ gradPForce::gradPForce setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(1,true); // activate treatForceDEM switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_DEM,true); // activate treatForceDEM switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); @@ -87,18 +87,18 @@ gradPForce::gradPForce } else if (modelType_ == "Bfull") { - if(forceSubM(0).switches()[1]) + if(forceSubM(0).switches()[SW_TREAT_FORCE_DEM]) { Info << "Using treatForceDEM false!" << endl; - forceSubM(0).setSwitches(1,false); // treatForceDEM = false + forceSubM(0).setSwitches(SW_TREAT_FORCE_DEM,false); // treatForceDEM = false } } else // modelType_=="A" { - if(!forceSubM(0).switches()[1]) + if(!forceSubM(0).switches()[SW_TREAT_FORCE_DEM]) { Info << "Using treatForceDEM true!" << endl; - forceSubM(0).setSwitches(1,true); // treatForceDEM = true + forceSubM(0).setSwitches(SW_TREAT_FORCE_DEM,true); // treatForceDEM = true } } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C b/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C index 3507f08d..ad77200e 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/interface/interface.C @@ -83,7 +83,7 @@ interface::interface setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C index 0a403a02..f431f890 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/noDrag/noDrag.C @@ -72,7 +72,7 @@ noDrag::noDrag setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); @@ -98,7 +98,7 @@ void noDrag::setForce() const // Do nothing Info << "noDrag::setForce" << endl; label cellI=0; - bool treatExplicit=forceSubM(0).switches()[0]; + bool treatExplicit = forceSubM(0).switches()[SW_TREAT_FORCE_EXPLICIT]; for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; @@ -125,7 +125,7 @@ void noDrag::setForce() const } } //========================== - } + } } } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C index 18b4647e..d378163e 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C @@ -83,8 +83,8 @@ virtualMassForce::virtualMassForce // init force sub model setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch forceSubM(0).readSwitches(); //Extra switches/settings diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C index ec0f0642..30762ce8 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/viscForce/viscForce.C @@ -71,10 +71,10 @@ viscForce::viscForce setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(1,true); // activate treatForceDEM switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch - forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_DEM,true); // activate treatForceDEM switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_SCALAR_VISCOSITY,true); // activate scalarViscosity switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); @@ -84,22 +84,22 @@ viscForce::viscForce FatalError <<"using model viscForce with model type B is not valid\n" << abort(FatalError); }else if (modelType_ == "Bfull") { - if(forceSubM(0).switches()[1]) + if(forceSubM(0).switches()[SW_TREAT_FORCE_DEM]) { Info << "Using treatForceDEM false!" << endl; - forceSubM(0).setSwitches(1,false); // treatForceDEM = false + forceSubM(0).setSwitches(SW_TREAT_FORCE_DEM,false); // treatForceDEM = false } }else // modelType_=="A" { - if(!forceSubM(0).switches()[1]) + if(!forceSubM(0).switches()[SW_TREAT_FORCE_DEM]) { Info << "Using treatForceDEM true!" << endl; - forceSubM(0).setSwitches(1,true); // treatForceDEM = true + forceSubM(0).setSwitches(SW_TREAT_FORCE_DEM,true); // treatForceDEM = true } } - if (propsDict_.found("useAddedMass")) + if (propsDict_.found("useAddedMass")) { addedMassCoeff_ = readScalar(propsDict_.lookup("useAddedMass")); Info << "viscForce will also include added mass with coefficient: " << addedMassCoeff_ << endl; @@ -160,7 +160,7 @@ void viscForce::setForce() const Vs = particleCloud_.particleVolume(index); - // calc the contribution of the deviatoric stress + // calc the contribution of the deviatoric stress // to the generalized buoyancy force force = -Vs*divTau*(1.0+addedMassCoeff_); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C index c3bf6078..7cb38d76 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModelMS/DiFeliceDragMS/DiFeliceDragMS.C @@ -87,9 +87,9 @@ DiFeliceDragMS::DiFeliceDragMS setForceSubModels(propsDict_); // define switches which can be read from dict - forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch - forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch - forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch + forceSubM(0).setSwitchesList(SW_TREAT_FORCE_EXPLICIT,true); // activate treatExplicit switch + forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch + forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch // read those switches defined above, if provided in dict forceSubM(0).readSwitches(); @@ -249,7 +249,7 @@ void DiFeliceDragMS::setForce() const } // set force on bodies - if (forceSubM(0).switches()[0]) + if (forceSubM(0).switches()[SW_TREAT_FORCE_EXPLICIT]) { for(int j=0;j<3;j++) cloudRefMS().expForcesCM()[index][j] += drag[j]; From 1fed0679a91a14155229498d1febbb4f4444f5d4 Mon Sep 17 00:00:00 2001 From: Daniel Queteschiner Date: Wed, 16 Aug 2017 15:41:11 +0200 Subject: [PATCH 28/99] adjust tutorial run scripts to new etc location --- tutorials/cfdemPostproc/fillCylinder/Allrun.sh | 2 +- tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh | 2 +- .../cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh | 2 +- tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh | 2 +- tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh | 4 +--- tutorials/cfdemSolverPiso/ErgunTestCG/parDEMrun.sh | 2 +- tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh | 4 +--- tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh | 2 +- tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh | 4 +--- tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh | 2 +- tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh | 2 -- .../cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh | 2 +- tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh | 2 +- tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh | 4 +--- tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh | 2 +- tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh | 2 +- tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh | 4 +--- tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh | 2 +- tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parDEMrun.sh | 2 +- tutorials/cfdemSolverRhoPimple/FinesColumn/parCFDDEMrun.sh | 2 +- tutorials/cfdemSolverRhoPimple/FinesColumn/parDEMrun.sh | 2 +- 21 files changed, 20 insertions(+), 32 deletions(-) diff --git a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh index b8476329..4ad6d401 100755 --- a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh +++ b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh @@ -9,7 +9,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #- define variables casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh index 0c5232c9..def0b7cd 100755 --- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh +++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh @@ -6,7 +6,7 @@ # Christoph Goniva - July. 2011, mod by Alice Hager - July 2011 #===================================================================# -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #- define variables casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh index f3c02f0f..ddf201a0 100644 --- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh b/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh index 329831fa..cc668ce0 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh @@ -10,7 +10,7 @@ casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh # check if mesh was built if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh index 2a476176..bc700b7f 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables @@ -67,8 +67,6 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim cd $casePath/CFD foamToVTK #- serial run of foamToVTK - #source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh #- include functions - #pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK #- start paraview paraview diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/parDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestCG/parDEMrun.sh index 9b431c5b..aff0b785 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/parDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/parDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh index 73c92d20..743ee33c 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables @@ -67,8 +67,6 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim cd $casePath/CFD foamToVTK #- serial run of foamToVTK - #source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh #- include functions - #pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK #- start paraview paraview diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh index d1e3a033..b5c2d5dd 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/parDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh echo "starting DEM run in parallel..." #--------------------------------------------------------------------------------# diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh index e6c4a062..79f137a4 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables @@ -67,8 +67,6 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim cd $casePath/CFD foamToVTK #- serial run of foamToVTK - #source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh #- include functions - #pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK #- start paraview paraview diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh index 9b431c5b..aff0b785 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh index a5564adb..175563a0 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh @@ -92,8 +92,6 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim cd $casePath/CFD foamToVTK #- serial run of foamToVTK - #source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh #- include functions - #pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK #- start paraview paraview diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh index 75edf29d..be64f254 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh index 138c7400..fe247127 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh index 2d622d70..2af47890 100644 --- a/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables @@ -64,8 +64,6 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim cd $casePath/CFD foamToVTK #- serial run of foamToVTK - #source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh #- include functions - #pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK #- start paraview paraview diff --git a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh index 5f0949ca..709e2c05 100755 --- a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh +++ b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh @@ -38,7 +38,7 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim cd $casePath/CFD #foamToVTK #- serial run of foamToVTK - source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh #- include functions + source $CFDEM_PROJECT_DIR/etc/functions.sh #- include functions pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK #- start paraview diff --git a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh index 800f7aea..e484c4f3 100644 --- a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh index c0073d9a..52a34dcd 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables @@ -70,8 +70,6 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim cd $casePath/CFD foamToVTK #- serial run of foamToVTK - #source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh #- include functions - #pseudoParallelRun "foamToVTK" $nrPostProcProcessors #- pseudo parallel run of foamToVTK #- start paraview paraview diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh index 660b45a1..64e367bb 100755 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parDEMrun.sh b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parDEMrun.sh index d1e3a033..b5c2d5dd 100755 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parDEMrun.sh +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh echo "starting DEM run in parallel..." #--------------------------------------------------------------------------------# diff --git a/tutorials/cfdemSolverRhoPimple/FinesColumn/parCFDDEMrun.sh b/tutorials/cfdemSolverRhoPimple/FinesColumn/parCFDDEMrun.sh index 226bf237..802c3f12 100755 --- a/tutorials/cfdemSolverRhoPimple/FinesColumn/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverRhoPimple/FinesColumn/parCFDDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh #--------------------------------------------------------------------------------# #- define variables diff --git a/tutorials/cfdemSolverRhoPimple/FinesColumn/parDEMrun.sh b/tutorials/cfdemSolverRhoPimple/FinesColumn/parDEMrun.sh index c7a9b51d..1a45152f 100755 --- a/tutorials/cfdemSolverRhoPimple/FinesColumn/parDEMrun.sh +++ b/tutorials/cfdemSolverRhoPimple/FinesColumn/parDEMrun.sh @@ -10,7 +10,7 @@ . ~/.bashrc #- include functions -source $CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/functions.sh +source $CFDEM_PROJECT_DIR/etc/functions.sh echo "starting DEM run in parallel..." #--------------------------------------------------------------------------------# From 14f5af4727480b150a2d3994c7b856aa46180d41 Mon Sep 17 00:00:00 2001 From: Daniel Queteschiner Date: Wed, 16 Aug 2017 15:43:41 +0200 Subject: [PATCH 29/99] clean up whitespaces in tutorial run scripts --- tutorials/cfdemPostproc/fillCylinder/Allrun.sh | 2 +- tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh | 2 +- .../cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh | 8 ++++---- tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh | 4 ++-- tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh | 4 ++-- tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh | 4 ++-- .../cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh | 6 +++--- tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh | 8 ++++---- .../cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh | 2 +- tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh | 4 ++-- tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh | 4 ++-- tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh | 4 ++-- .../cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh | 4 ++-- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh index 4ad6d401..6230225d 100755 --- a/tutorials/cfdemPostproc/fillCylinder/Allrun.sh +++ b/tutorials/cfdemPostproc/fillCylinder/Allrun.sh @@ -73,7 +73,7 @@ if [ $postproc == "true" ] #- get VTK data from CFD sim #foamToVTK - + #- start paraview echo "" echo "trying to start paraview..." diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh index def0b7cd..1d4838e4 100755 --- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh +++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/Allrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest # Christoph Goniva - July. 2011, mod by Alice Hager - July 2011 #===================================================================# diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh index ddf201a0..967b517e 100644 --- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/parCFDDEMrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest CFD part # Christoph Goniva - Feb. 2011 #===================================================================# @@ -32,11 +32,11 @@ parCFDDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $m if [ $runOctave == "true" ] then - + cd $casePath/CFD/octave octave postproc.m - evince pos_z_two_part_rec_glow.eps - evince vel_z_two_part_rec_glow.eps + evince pos_z_two_part_rec_glow.eps + evince vel_z_two_part_rec_glow.eps #display pos_y_two_part_rec_glow.png & #display vel_y_two_part_rec_glow.png & fi diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh b/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh index cc668ce0..30c74145 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/Allrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run ErgunTestCG # Christoph Goniva - Sept. 2010 #===================================================================# @@ -29,4 +29,4 @@ else fi #- run parallel CFD-DEM in new terminal -gnome-terminal --title='cfdemSolverPiso ErgunTestCG CFD' -e "bash $casePath/parCFDDEMrun.sh" +gnome-terminal --title='cfdemSolverPiso ErgunTestCG CFD' -e "bash $casePath/parCFDDEMrun.sh" diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh index bc700b7f..1afa125b 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/parCFDDEMrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest CFD part # Christoph Goniva - Feb. 2011 #===================================================================# @@ -45,7 +45,7 @@ if [ $runOctave == "true" ] #- run octave octave totalPressureDrop.m - #- show plot + #- show plot evince cfdemSolverPiso_ErgunTestCG.eps #- copy log file to test harness diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh index 743ee33c..1043195d 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/parCFDDEMrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest CFD part # Christoph Goniva - Feb. 2011 #===================================================================# @@ -45,7 +45,7 @@ if [ $runOctave == "true" ] #- run octave octave totalPressureDrop.m - #- show plot + #- show plot evince cfdemSolverPiso_ErgunTestMPI.eps #- copy log file to test harness diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh index 79f137a4..427ea678 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/parCFDDEMrun.sh @@ -1,8 +1,8 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine -# run ErgunTestMPI_cgs +# allrun script for testcase as part of test routine +# run ErgunTestMPI_cgs # Christoph Goniva - March 2013 #===================================================================# @@ -45,7 +45,7 @@ if [ $runOctave == "true" ] #- run octave octave totalPressureDrop.m - #- show plot + #- show plot evince cfdemSolverPiso_ErgunTestMPI.eps #- copy log file to test harness diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh index 175563a0..c358ad19 100755 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/Allrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest # Christoph Goniva - Sept. 2010 #===================================================================# @@ -35,7 +35,7 @@ cp $casePath/CFD/system/controlDict_run $casePath/CFD/system/controlDict #-------------------------------------------------------# #- run parallel CFD-DEM in new terminal -gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh" +gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh" #- wait until sim has finished then run octave echo "simulation finished? ...press enter to proceed" @@ -49,7 +49,7 @@ cp $casePath/CFD/constant/couplingProperties_restart $casePath/CFD/constant/coup cp $casePath/CFD/system/controlDict_restart $casePath/CFD/system/controlDict #- run parallel CFD-DEM in new terminal -#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh" +#gnome-terminal --title='cfdemSolverPiso ErgunTestMPI_restart CFD' -e "bash $casePath/parCFDDEMrun.sh" bash $casePath/parCFDDEMrun.sh @@ -70,7 +70,7 @@ if [ $runOctave == "true" ] #- run octave octave totalPressureDrop.m - #- show plot + #- show plot evince cfdemSolverPiso_ErgunTestMPI.eps #- copy log file to test harness diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh index be64f254..2dd14810 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/parCFDDEMrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest CFD part # Christoph Goniva - Feb. 2011 #===================================================================# diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh index 2af47890..3e8fcd20 100644 --- a/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPiso/settlingTestMPI/parCFDDEMrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest CFD part # Christoph Goniva - Feb. 2011 #===================================================================# @@ -42,7 +42,7 @@ if [ $runOctave == "true" ] #- run octave octave settlingVelocity.m - #- show plot + #- show plot evince cfdemSolverPiso_settlingTestMPI.eps #- copy log file to test harness diff --git a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh index 709e2c05..680e02cb 100755 --- a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh +++ b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/Allrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest # Christoph Goniva - Sept. 2010 #===================================================================# @@ -22,7 +22,7 @@ else fi #- run parallel CFD-DEM in new terminal -gnome-terminal --title='cfdemSolverPisoMS ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh" +gnome-terminal --title='cfdemSolverPisoMS ErgunTestMPI CFD' -e "bash $casePath/parCFDDEMrun.sh" if [ $postproc == "true" ] then diff --git a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh index e484c4f3..d1633aa7 100644 --- a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/parCFDDEMrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest CFD part # Christoph Goniva - Feb. 2011 #===================================================================# @@ -42,7 +42,7 @@ rm cfdemSolverPisoMS_ErgunTestMPI.eps #- run octave octave totalPressureDrop.m -#- show plot +#- show plot evince cfdemSolverPisoMS_ErgunTestMPI.eps #------------------------------# diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh index 52a34dcd..03872339 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/parCFDDEMrun.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# allrun script for testcase as part of test routine +# allrun script for testcase as part of test routine # run settlingTest CFD part # Christoph Goniva - May. 2011 #===================================================================# @@ -43,7 +43,7 @@ if [ $runOctave == "true" ] #- run octave octave totalPressureDropAndNusselt.m - #- show plots + #- show plots evince cfdemSolverPisoScalar_Nusselt.eps & evince cfdemSolverPisoScalar_pressureDrop.eps #------------------------------# From 5563b9bd9cb4de247ae87c24ed9018b22b444db3 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 10 Aug 2017 18:26:10 +0200 Subject: [PATCH 30/99] fix bug introduced in 13da1dd890ca694ac43b81333a6750accc8edc46 methods must have same const qualifier as in base class --- .../cfdemParticle/subModels/clockModel/noClock/noClock.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H b/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H index 744b9a88..11797501 100644 --- a/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H +++ b/src/lagrangian/cfdemParticle/subModels/clockModel/noClock/noClock.H @@ -79,8 +79,8 @@ public: void start(int pos) const {} void start(int pos,const std::string& identifier) const {} - void stop() {} - void stop(const std::string& identifier) {} + void stop() const {} + void stop(const std::string& identifier) const {} std::string eval() const { return ""; } void evalFile() const {} void evalPar() const {} From ab49a5100355064a5736adb5e939c8262e6a45fd Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 13 Jun 2017 17:06:20 +0200 Subject: [PATCH 31/99] const correctness --- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 6 ++-- .../cfdemParticle/cfdemCloud/cfdemCloud.H | 10 +++--- .../cfdemParticle/cfdemCloud/cfdemCloudIO.C | 4 +-- .../cfdemCloudEnergy/cfdemCloudEnergy.C | 4 +-- .../cfdemCloudEnergy/cfdemCloudEnergy.H | 32 +++++++++---------- .../cfdemCloudEnergy/cfdemCloudEnergyI.H | 2 +- .../derived/cfdemCloudIB/cfdemCloudIB.C | 2 +- .../derived/cfdemCloudIB/cfdemCloudIB.H | 2 +- .../derived/cfdemCloudMS/cfdemCloudMS.H | 2 +- .../derived/cfdemCloudMS/cfdemCloudMSI.H | 2 +- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 6a28348e..9a82662d 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -471,12 +471,12 @@ const forceModel& cfdemCloud::forceM(int i) return forceModel_[i]; } -int cfdemCloud::nrForceModels() +label cfdemCloud::nrForceModels() const { return forceModels_.size(); } -int cfdemCloud::nrMomCoupleModels() +label cfdemCloud::nrMomCoupleModels() const { return momCoupleModels_.size(); } @@ -486,7 +486,7 @@ scalar cfdemCloud::voidfraction(int index) const return voidfractions()[index][0]; } -label cfdemCloud::liggghtsCommandModelIndex(word name) +label cfdemCloud::liggghtsCommandModelIndex(word name) const { forAll(liggghtsCommandModelList_,i) { diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index b1b93e16..9b84aa73 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -242,13 +242,13 @@ public: virtual const forceModel& forceM(int); - virtual int nrForceModels(); + virtual label nrForceModels() const; - virtual int nrMomCoupleModels(); + virtual label nrMomCoupleModels() const; scalar voidfraction(int) const; - label liggghtsCommandModelIndex(word); + label liggghtsCommandModelIndex(word) const; inline void setCG(double); @@ -377,9 +377,9 @@ public: virtual bool reAllocArrays(); // IO - void writeScalarFieldToTerminal(double**&); + void writeScalarFieldToTerminal(double**&) const; - void writeVectorFieldToTerminal(double**&); + void writeVectorFieldToTerminal(double**&) const; // functions tmp divVoidfractionTau(volVectorField& ,volScalarField&) const; diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudIO.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudIO.C index 51744a79..716c0eab 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudIO.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudIO.C @@ -48,7 +48,7 @@ namespace Foam // * * * * * * * * * * * * * * * IO * * * * * * * * * * * * * // -void cfdemCloud::writeScalarFieldToTerminal(double**& array) +void cfdemCloud::writeScalarFieldToTerminal(double**& array) const { // init double array for (int i=0; i* energyModel_; - + autoPtr thermCondModel_; - + autoPtr chemistryModel_; - + void calcEnergyContributions(); void speciesExecute(); - + public: friend class energyModel; @@ -89,23 +89,23 @@ public: const energyModel& energyM(int); - + const thermCondModel& thermCondM(); - + const chemistryModel& chemistryM(); - int nrEnergyModels(); + label nrEnergyModels() const; + + inline const wordList& energyModels() const; + + bool implicitEnergyModel() const; - inline const wordList& energyModels(); - - bool& implicitEnergyModel(); - void energyContributions(volScalarField&); - + void energyCoefficients(volScalarField&); - + bool evolve(volScalarField&,volVectorField&,volVectorField&); - + void postFlow(); }; diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudEnergy/cfdemCloudEnergyI.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudEnergy/cfdemCloudEnergyI.H index 14231a4b..12983d18 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudEnergy/cfdemCloudEnergyI.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudEnergy/cfdemCloudEnergyI.H @@ -25,7 +25,7 @@ namespace Foam { // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const wordList& cfdemCloudEnergy::energyModels() +inline const wordList& cfdemCloudEnergy::energyModels() const { return energyModels_; } diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C index 9763a700..076f9126 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C @@ -224,7 +224,7 @@ void cfdemCloudIB::calcVelocityCorrection } -vector cfdemCloudIB::angularVelocity(int index) +vector cfdemCloudIB::angularVelocity(int index) const { vector vel; for(int i=0;i<3;i++) vel[i] = angularVelocities_[index][i]; diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.H index 1aaffa5a..d1db244d 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.H @@ -90,7 +90,7 @@ public: void calcVelocityCorrection(volScalarField&,volVectorField&,volScalarField&,volScalarField&); // this could be moved to an IB mom couple model // Access - vector angularVelocity(int); + vector angularVelocity(int) const; inline double ** angularVelocities() const { diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H index 563e840d..df3f8352 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMS.H @@ -129,7 +129,7 @@ public: inline label nrigid(int) const; - inline int nrForceModels(); + inline label nrForceModels() const; inline double **& positionsCM() const; diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H index f9f10832..10abefb8 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudMS/cfdemCloudMSI.H @@ -80,7 +80,7 @@ inline label cfdemCloudMS::nrigid(int index) const return nrigids_[0][index]; } -inline int cfdemCloudMS::nrForceModels() +inline label cfdemCloudMS::nrForceModels() const { return forceModels_.size(); } From 36d5805d2ae46b198c684329615ef8e04b876c72 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 13 Jun 2017 17:11:49 +0200 Subject: [PATCH 32/99] shorter access methods --- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 16 ++++------------ .../derived/cfdemCloudIB/cfdemCloudIB.C | 4 +--- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 9a82662d..d4a93336 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -440,30 +440,22 @@ label cfdemCloud::particleCell(int index) const vector cfdemCloud::position(int index) const { - vector pos; - for(int i=0;i<3;i++) pos[i] = positions()[index][i]; - return pos; + return vector(positions()[index][0],positions()[index][1],positions()[index][2]); } vector cfdemCloud::velocity(int index) const { - vector vel; - for(int i=0;i<3;i++) vel[i] = velocities()[index][i]; - return vel; + return vector(velocities()[index][0],velocities()[index][1],velocities()[index][2]); } vector cfdemCloud::expForce(int index) const { - vector force; - for(int i=0;i<3;i++) force[i] = DEMForces()[index][i]; - return force; + return vector(DEMForces()[index][0],DEMForces()[index][1],DEMForces()[index][2]); } vector cfdemCloud::fluidVel(int index) const { - vector vel; - for(int i=0;i<3;i++) vel[i] = fluidVels()[index][i]; - return vel; + return vector(fluidVels()[index][0],fluidVels()[index][1],fluidVels()[index][2]); } const forceModel& cfdemCloud::forceM(int i) diff --git a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C index 076f9126..8fec93d2 100644 --- a/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C +++ b/src/lagrangian/cfdemParticle/derived/cfdemCloudIB/cfdemCloudIB.C @@ -226,9 +226,7 @@ void cfdemCloudIB::calcVelocityCorrection vector cfdemCloudIB::angularVelocity(int index) const { - vector vel; - for(int i=0;i<3;i++) vel[i] = angularVelocities_[index][i]; - return vel; + return vector(angularVelocities_[index][0],angularVelocities_[index][1],angularVelocities_[index][2]); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From 2c05e6e65f0876985c2c3f35d96733458c5a5d89 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 13 Jun 2017 18:01:49 +0200 Subject: [PATCH 33/99] add trilinear void fraction model from PUBLIC --- .../trilinearVoidFraction.C | 392 ++++++++++++++++++ .../trilinearVoidFraction.H | 103 +++++ 2 files changed, 495 insertions(+) create mode 100644 src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C create mode 100644 src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.H diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C new file mode 100644 index 00000000..b58e6ad7 --- /dev/null +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C @@ -0,0 +1,392 @@ +/*---------------------------------------------------------------------------*\ + CFDEMcoupling - Open Source CFD-DEM coupling + + CFDEMcoupling is part of the CFDEMproject + www.cfdem.com + Christoph Goniva, christoph.goniva@cfdem.com + Copyright 2012- DCS Computing GmbH, Linz +------------------------------------------------------------------------------- +License + This file is part of CFDEMcoupling. + + CFDEMcoupling is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or (at your + option) any later version. + + CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with CFDEMcoupling; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS + and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). +\*---------------------------------------------------------------------------*/ + +#include "error.H" + +#include "trilinearVoidFraction.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(trilinearVoidFraction, 0); + +addToRunTimeSelectionTable +( + voidFractionModel, + trilinearVoidFraction, + dictionary +); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// Construct from components +trilinearVoidFraction::trilinearVoidFraction +( + const dictionary& dict, + cfdemCloud& sm +) +: + voidFractionModel(dict,sm), + propsDict_(dict.subDict(typeName + "Props")), + alphaMin_(readScalar(propsDict_.lookup("alphaMin"))), + bb_(particleCloud_.mesh().points(),false), + cellVol_(particleCloud_.mesh().V()[0]), + cellLength_(pow(cellVol_,1./3.)), + nCellXYZ_ + ( + round((bb_.max()[0] - bb_.min()[0]) / cellLength_), + round((bb_.max()[1] - bb_.min()[1]) / cellLength_), + round((bb_.max()[2] - bb_.min()[2]) / cellLength_) + ) +{ + maxCellsPerParticle_ = 8; + checkWeightNporosity(propsDict_); + if (porosity() != 1.) FatalError << "porosity not used in trilinearVoidFraction" << abort(FatalError); + + Warning << "trilinearVoidFraction model is not yet complete and does not work near boundaries" << endl; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +trilinearVoidFraction::~trilinearVoidFraction() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void trilinearVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const +{ + reAllocArrays(); + + scalar radius(-1.); + scalar volume(0.); + const scalar scaleVol = weight(); + const scalar fourPiByThree = 4.0*constant::mathematical::pi/3.0; + + vector partPos(0.,0.,0.); + vector pt(0.,0.,0.); + vector posShift(0.,0.,0.); + vector offsetCell(0.,0.,0.); + vector offsetOrigin(0.,0.,0.); + + label i000(0); + label i100(0); + label i110(0); + label i101(0); + label i111(0); + label i010(0); + label i011(0); + label i001(0); + + scalar C000(0.); + scalar C100(0.); + scalar C110(0.); + scalar C101(0.); + scalar C111(0.); + scalar C010(0.); + scalar C011(0.); + scalar C001(0.); + + scalar x(0.); + scalar y(0.); + scalar z(0.); + + scalar a(0.); + scalar b(0.); + scalar c(0.); + + for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) + { + // reset + cellsPerParticle_[index][0] = 8; + //TODO do we need to set particleVolumes, particleV? + // === + + label cellI = particleCloud_.cellIDs()[index][0]; + + if (cellI >= 0) // particel centre is in domain + { + radius = particleCloud_.radius(index); + volume = fourPiByThree * radius * radius * radius * scaleVol; + + // store volume for each particle + particleVolumes[index][0] = volume; + particleV[index][0] = volume; + + // find a,b,c + partPos = particleCloud_.position(index); + offsetCell = partPos - particleCloud_.mesh().C()[cellI]; + a = offsetCell[0]; + b = offsetCell[1]; + c = offsetCell[2]; + + // find "origin" index for mapping + if ( a > 0.) + { + if (b > 0.) + { + if (c > 0.) //FNE + i000 = cellI; + else //BNE + i000 = cellI - nCellXYZ_[0] * nCellXYZ_[1]; + } + else + { + if (c > 0.) //FSE + i000 = cellI - nCellXYZ_[0]; + else //BSE + i000 = cellI - nCellXYZ_[0] - nCellXYZ_[0] * nCellXYZ_[1]; + } + } + else + { + if (b > 0.) + { + if (c > 0.) //FNW + i000 = cellI - 1; + else //BNW + i000 = cellI - 1 - nCellXYZ_[0] * nCellXYZ_[1]; + } + else + { + if (c > 0.) //FSW + i000 = cellI - 1 - nCellXYZ_[0]; + else //BSW + i000 = cellI - 1 - nCellXYZ_[0] - nCellXYZ_[0] * nCellXYZ_[1]; + } + } + + // check boundaries + // TODO different handling for periodic and processor boundaries + pt = particleCloud_.mesh().C()[cellI]; + posShift = vector::zero; + if (a > 0.) + { + pt += vector(cellLength_,0.,0.); + if (pt[0] > bb_.max()[0]) + { + --i000; + posShift[0] = -a; + } + } + else + { + pt -= vector(cellLength_,0.,0.); + if (pt[0] < bb_.min()[0]) + { + ++i000; + posShift[0] = -a; + } + } + if (b > 0.) + { + pt += vector(0.,cellLength_,0.); + if (pt[1] > bb_.max()[1]) + { + i000 -= nCellXYZ_[0]; + posShift[1] = -b; + } + } + else + { + pt -= vector(0.,cellLength_,0.); + if (pt[1] < bb_.min()[1]) + { + i000 += nCellXYZ_[0]; + posShift[1] = -b; + } + } + if (c > 0.) + { + pt += vector(0.,0.,cellLength_); + if (pt[2] > bb_.max()[2]) + { + i000 -= nCellXYZ_[0] * nCellXYZ_[1]; + posShift[2] = -c; + } + } + else + { + pt -= vector(0.,0.,cellLength_); + if (pt[2] < bb_.min()[2]) + { + i000 += nCellXYZ_[0] * nCellXYZ_[1]; + posShift[2] = -c; + } + } + + // define other 7 indices + i100 = i000 + 1; + i110 = i100 + nCellXYZ_[0]; + i010 = i000 + nCellXYZ_[0]; + i001 = i000 + nCellXYZ_[0] * nCellXYZ_[1]; + i101 = i100 + nCellXYZ_[0] * nCellXYZ_[1]; + i111 = i110 + nCellXYZ_[0] * nCellXYZ_[1]; + i011 = i010 + nCellXYZ_[0] * nCellXYZ_[1]; + + // find x,y,z + // TODO changes needed here when generalized for quader cells + offsetOrigin = particleCloud_.mesh().C()[i000] - (partPos + posShift); + x = mag(offsetOrigin[0]) / cellLength_; + y = mag(offsetOrigin[1]) / cellLength_; + z = mag(offsetOrigin[2]) / cellLength_; + + // calculate the mapping coeffs + C000 = (1 - x) * (1 - y) * (1 - z); + C100 = x * (1 - y) * (1 - z); + C110 = x * y * (1 - z); + C010 = (1 - x) * y * (1 - z); + C001 = (1 - x) * (1 - y) * z; + C101 = x * (1 - y) * z; + C111 = x * y * z; + C011 = (1 - x) * y * z; + + // set weights + particleWeights[index][0] = C000; + particleWeights[index][1] = C100; + particleWeights[index][2] = C110; + particleWeights[index][3] = C010; + particleWeights[index][4] = C001; + particleWeights[index][5] = C101; + particleWeights[index][6] = C111; + particleWeights[index][7] = C011; + + // set cellIDs + particleCloud_.cellIDs()[index][0] = i000; + particleCloud_.cellIDs()[index][1] = i100; + particleCloud_.cellIDs()[index][2] = i110; + particleCloud_.cellIDs()[index][3] = i010; + particleCloud_.cellIDs()[index][4] = i001; + particleCloud_.cellIDs()[index][5] = i101; + particleCloud_.cellIDs()[index][6] = i111; + particleCloud_.cellIDs()[index][7] = i011; + + //distribute volume + // TODO use different cell volume when generalized for quader cells + voidfractionNext_[i000] -= volume*C000 / cellVol_; + voidfractionNext_[i100] -= volume*C100 / cellVol_; + voidfractionNext_[i010] -= volume*C010 / cellVol_; + voidfractionNext_[i001] -= volume*C001 / cellVol_; + voidfractionNext_[i101] -= volume*C101 / cellVol_; + voidfractionNext_[i011] -= volume*C011 / cellVol_; + voidfractionNext_[i110] -= volume*C110 / cellVol_; + voidfractionNext_[i111] -= volume*C111 / cellVol_; + + // debugging + /*Pout << "cellI=" << cellI << endl; + Pout << "a=" << a << endl; + Pout << "b=" << b << endl; + Pout << "c=" << c << endl; + Pout << "x=" << x << endl; + Pout << "y=" << y << endl; + Pout << "z=" << z << endl; + Pout << "i000=" << i000 << endl; + Pout << "i100=" << i100 << endl; + Pout << "i010=" << i010 << endl; + Pout << "i001=" << i001 << endl; + Pout << "i101=" << i101 << endl; + Pout << "i011=" << i011 << endl; + Pout << "i110=" << i110 << endl; + Pout << "i111=" << i111 << endl; + + Pout << "C000=" << C000 << endl; + Pout << "C100=" << C100 << endl; + Pout << "C010=" << C010 << endl; + Pout << "C001=" << C001 << endl; + Pout << "C101=" << C101 << endl; + Pout << "C011=" << C011 << endl; + Pout << "C110=" << C110 << endl; + Pout << "C111=" << C111 << endl; + Pout << "sum(Cijk)=" << C000+C100+C010+C001+C101+C011+C110+C111 << endl;*/ + + /*voidfractionNext_[i000]=0.999; + voidfractionNext_[i100]=0.999; + voidfractionNext_[i010]=0.999; + voidfractionNext_[i001]=0.999; + voidfractionNext_[i101]=0.999; + voidfractionNext_[i011]=0.999; + voidfractionNext_[i110]=0.999; + voidfractionNext_[i111]=0.999;*/ + + // limit volumefraction + // TODO implement limiter for all 8 indices + /*if(voidfractionNext_[cellI] < alphaMin_ ) + { + voidfractionNext_[cellI] = alphaMin_; + alphaLimited = true; + } + if(index==0 && alphaLimited) Info<<"alpha limited to" <= 0) + { + voidfractions[index][0] = voidfractionNext_[i000]; + voidfractions[index][1] = voidfractionNext_[i100]; + voidfractions[index][2] = voidfractionNext_[i110]; + voidfractions[index][3] = voidfractionNext_[i010]; + voidfractions[index][4] = voidfractionNext_[i001]; + voidfractions[index][5] = voidfractionNext_[i101]; + voidfractions[index][6] = voidfractionNext_[i111]; + voidfractions[index][7] = voidfractionNext_[i011]; + } + else + { + for (int i = 0; i < 8; ++i) + voidfractions[index][i] = -1.; + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.H new file mode 100644 index 00000000..08a3bdd7 --- /dev/null +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + CFDEMcoupling - Open Source CFD-DEM coupling + + CFDEMcoupling is part of the CFDEMproject + www.cfdem.com + Christoph Goniva, christoph.goniva@cfdem.com + Copyright 2012- DCS Computing GmbH, Linz +------------------------------------------------------------------------------- +License + This file is part of CFDEMcoupling. + + CFDEMcoupling is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or (at your + option) any later version. + + CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with CFDEMcoupling; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS + and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). + +Class + trilinearVoidFraction + +SourceFiles + trilinearVoidFraction.C + +\*---------------------------------------------------------------------------*/ + +#ifndef trilinearVoidFraction_H +#define trilinearVoidFraction_H + +#include "voidFractionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class trilinearVoidFraction Declaration +\*---------------------------------------------------------------------------*/ + +class trilinearVoidFraction +: + public voidFractionModel +{ + +private: + dictionary propsDict_; + + const scalar alphaMin_; + + boundBox bb_; + + scalar cellVol_; + + scalar cellLength_; + + vector nCellXYZ_; + +public: + + //- Runtime type information + TypeName("trilinear"); + + + // Constructors + + //- Construct from components + trilinearVoidFraction + ( + const dictionary& dict, + cfdemCloud& sm + ); + + // Destructor + + ~trilinearVoidFraction(); + + + // Member Functions + void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From ee06cc84cb64a40189744f98f3dc83d41d9ca596 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 14 Jun 2017 09:32:50 +0200 Subject: [PATCH 34/99] construct field as copy resetting name --- .../explicitCouple/explicitCouple.C | 41 +++++------------ .../implicitCouple/implicitCouple.C | 46 ++++++------------- .../voidFractionModel/voidFractionModel.C | 38 +++++---------- 3 files changed, 38 insertions(+), 87 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C index 99e2b906..190b6c85 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C @@ -108,32 +108,9 @@ explicitCouple::~explicitCouple() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // tmp explicitCouple::expMomSource() const { - tmp tsource - ( - new volVectorField - ( - IOobject - ( - "f_explicitCouple", - particleCloud_.mesh().time().timeName(), - particleCloud_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - particleCloud_.mesh(), - dimensionedVector - ( - "zero", - dimensionSet(1, -2, -2, 0, 0), // N/m3 - vector::zero - ), - "zeroGradient" - ) - ); - scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); - if(1-tsf < 1e-4) //tsf==1 + if (1. - tsf < 1e-4) //tsf==1 { // calc fNext forAll(fNext_,cellI) @@ -147,12 +124,18 @@ tmp explicitCouple::expMomSource() const if (magF > fLimit_[i]) fNext_[cellI][i] *= fLimit_[i]/magF; } } - tsource.ref() = fPrev_; - }else - { - tsource.ref() = (1 - tsf) * fPrev_ + tsf * fNext_; + return tmp + ( + new volVectorField("f_explicitCouple", fPrev_) + ); + } + else + { + return tmp + ( + new volVectorField("f_explicitCouple", (1. - tsf) * fPrev_ + tsf * fNext_) + ); } - return tsource; } void explicitCouple::resetMomSourceField() const diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C index 90b1c955..124b7e9b 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C @@ -122,40 +122,19 @@ implicitCouple::~implicitCouple() tmp implicitCouple::impMomSource() const { - tmp tsource - ( - new volScalarField - ( - IOobject - ( - "Ksl_implicitCouple", - particleCloud_.mesh().time().timeName(), - particleCloud_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - particleCloud_.mesh(), - dimensionedScalar - ( - "zero", - dimensionSet(1, -3, -1, 0, 0), // N/m3 / m/s - 0 - ) - ) - ); - scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); // calc Ksl - scalar Ur; - if(1-tsf < 1e-4) //tsf==1 + if (1. - tsf < 1e-4) //tsf==1 { + scalar Ur; + forAll(KslNext_,cellI) { Ur = mag(U_[cellI] - Us_[cellI]); - if(Ur > SMALL && alpha_[cellI] < maxAlpha_) //momentum exchange switched off if alpha too big + if (Ur > SMALL && alpha_[cellI] < maxAlpha_) //momentum exchange switched off if alpha too big { KslNext_[cellI] = mag(particleCloud_.forceM(0).impParticleForces()[cellI]) / Ur @@ -166,13 +145,18 @@ tmp implicitCouple::impMomSource() const // limiter if (KslNext_[cellI] > KslLimit_) KslNext_[cellI] = KslLimit_; } - tsource.ref() = KslPrev_; - }else - { - tsource.ref() = (1 - tsf) * KslPrev_ + tsf * KslNext_; + return tmp + ( + new volScalarField("Ksl_implicitCouple", KslPrev_) + ); + } + else + { + return tmp + ( + new volScalarField("Ksl_implicitCouple", (1. - tsf) * KslPrev_ + tsf * KslNext_) + ); } - - return tsource; } void implicitCouple::resetMomSourceField() const diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C index a3afcf94..bee8547b 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C @@ -102,44 +102,28 @@ voidFractionModel::~voidFractionModel() // * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * // tmp voidFractionModel::voidFractionInterp() const { - tmp tsource - ( - new volScalarField - ( - IOobject - ( - "alpha_voidFractionModel", - particleCloud_.mesh().time().timeName(), - particleCloud_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - particleCloud_.mesh(), - dimensionedScalar - ( - "zero", - dimensionSet(0, 0, 0, 0, 0), - 0 - ) - ) - ); - scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); - if(1-tsf < 1e-4 && particleCloud_.dataExchangeM().couplingStep() > 1) //tsf==1 + + if (1. - tsf < 1e-4 && particleCloud_.dataExchangeM().couplingStep() > 1) //tsf==1 { - tsource.ref() = voidfractionPrev_; + return tmp + ( + new volScalarField("alpha_voidFractionModel", voidfractionPrev_) + ); } else { - tsource.ref() = (1 - tsf) * voidfractionPrev_ + tsf * voidfractionNext_; + return tmp + ( + new volScalarField("alpha_voidFractionModel", (1. - tsf) * voidfractionPrev_ + tsf * voidfractionNext_) + ); } - return tsource; } void voidFractionModel::resetVoidFractions() const { voidfractionPrev_.ref() = voidfractionNext_.ref(); - voidfractionNext_.ref() = 1; + voidfractionNext_.ref() = 1.; } /*void voidFractionModel::undoVoidFractions(double**const& mask) const From a4bf2fdd42e4960427d8246e2508e9d93c56a294 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 14 Jun 2017 09:48:55 +0200 Subject: [PATCH 35/99] add range check for imExSplitFactor value --- src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index d4a93336..688aceb5 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -225,6 +225,14 @@ cfdemCloud::cfdemCloud solveFlow_=Switch(couplingProperties_.lookup("solveFlow")); if (couplingProperties_.found("imExSplitFactor")) imExSplitFactor_ = readScalar(couplingProperties_.lookup("imExSplitFactor")); + + if(imExSplitFactor_ > 1.0) + FatalError << "You have set imExSplitFactor > 1 in your couplingProperties. Must be <= 1." + << abort(FatalError); + if(imExSplitFactor_ < 0.0) + FatalError << "You have set imExSplitFactor < 0 in your couplingProperties. Must be >= 0." + << abort(FatalError); + if (couplingProperties_.found("treatVoidCellsAsExplicitForce")) treatVoidCellsAsExplicitForce_ = readBool(couplingProperties_.lookup("treatVoidCellsAsExplicitForce")); if (couplingProperties_.found("verbose")) verbose_=true; From df1be8e004b3b2ab0f96073f5aa8ca1503b9da89 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 14 Jun 2017 15:18:07 +0200 Subject: [PATCH 36/99] add trilinear void fraction source file to make file --- src/lagrangian/cfdemParticle/Make/files | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index 6ddd9cc6..7cc1c491 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -111,6 +111,7 @@ $(voidFractionModels)/dividedVoidFractionMS/dividedVoidFractionMS.C $(voidFractionModels)/bigParticleVoidFraction/bigParticleVoidFraction.C $(voidFractionModels)/GaussVoidFraction/GaussVoidFraction.C $(voidFractionModels)/IBVoidFraction/IBVoidFraction.C +$(voidFractionModels)/trilinearVoidFraction/trilinearVoidFraction.C $(locateModels)/locateModel/locateModel.C $(locateModels)/locateModel/newLocateModel.C From ec5ed28885d1641b85b27b01dc14e9ec27145f21 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 19 Jun 2017 10:28:17 +0200 Subject: [PATCH 37/99] construct field as copy resetting name --- .../averagingModel/averagingModel.C | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C index 0f85e686..1f159643 100644 --- a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C +++ b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C @@ -328,39 +328,20 @@ void averagingModel::undoWeightFields(double**const& mask) const tmp averagingModel::UsInterp() const { - tmp tsource - ( - new volVectorField - ( - IOobject - ( - "Us_averagingModel", - particleCloud_.mesh().time().timeName(), - particleCloud_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - particleCloud_.mesh(), - dimensionedVector - ( - "zero", - dimensionSet(0, 1, -1, 0, 0), - vector::zero - ) - ) - ); - if (particleCloud_.dataExchangeM().couplingStep() > 1) { - tsource.ref() = (1 - particleCloud_.dataExchangeM().timeStepFraction()) * UsPrev_ - + particleCloud_.dataExchangeM().timeStepFraction() * UsNext_; + return tmp + ( + new volVectorField("Us_averagingModel", (1. - particleCloud_.dataExchangeM().timeStepFraction()) * UsPrev_ + particleCloud_.dataExchangeM().timeStepFraction() * UsNext_) + ); } else { - tsource.ref() = UsNext_; + return tmp + ( + new volVectorField("Us_averagingModel", UsNext_) + ); } - - return tsource; } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // From fd6d9164c41902dcb7230c9f945c8fb08f9394ac Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 21 Jun 2017 09:49:49 +0200 Subject: [PATCH 38/99] remove unneeded checks according to standard, freeing a null pointer is a nop some archaic C runtimes may have crashed on it in times long past --- .../subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C index 604ef3b8..9411b6a1 100644 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMPI/twoWayMPI.C @@ -194,14 +194,12 @@ void twoWayMPI::destroy(int** array,int /*len*/) const // int * void twoWayMPI::destroy(int* array) const { - if (array == NULL) return; free(array); } //============ // double * void twoWayMPI::destroy(double* array) const { - if (array == NULL) return; free(array); } //============ From 1b51d5ce2100b071581ffbe511f804c8249e0664 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 21 Jun 2017 10:23:26 +0200 Subject: [PATCH 39/99] proper member initialization allocating memory of zero size will produce useless pointer set to NULL instead --- .../cfdemParticle/subModels/forceModel/forceModel/forceModel.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C index 3619330c..7b55f128 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C @@ -88,7 +88,7 @@ forceModel::forceModel probeIt_(sm.probeM().active()), requiresEx_(false), forceSubModels_(0), - forceSubModel_(new autoPtr[nrForceSubModels()]) + forceSubModel_(NULL) {} From 807c6e30e7d02cfde1c987fbbb50c9791895e908 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 21 Jun 2017 10:25:15 +0200 Subject: [PATCH 40/99] fix memory leak anything new shall be deleted; --- .../subModels/forceModel/forceModel/forceModel.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C index 7b55f128..0b593924 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/forceModel/forceModel.C @@ -95,7 +95,9 @@ forceModel::forceModel // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // forceModel::~forceModel() -{} +{ + delete [] forceSubModel_; +} // * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * // /*tmp forceModel::provideScalarField() From 1a98e6eaee412de64ca8a09dc2815a1f6a451474 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 17 Aug 2017 16:30:09 +0200 Subject: [PATCH 41/99] determine necessity of periodic cell check in cfdemCloud class only check for periodic cells in submodels if all boundary patches are cyclic --- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 24 +++++++++++++++++++ .../cfdemParticle/cfdemCloud/cfdemCloud.H | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 688aceb5..e4a64e38 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -126,6 +126,7 @@ cfdemCloud::cfdemCloud mesh, dimensionedScalar("zero", dimensionSet(0,0,-1,0,0), 0) // 1/s ), + checkPeriodicCells_(false), turbulence_ ( mesh.lookupObject @@ -298,6 +299,29 @@ cfdemCloud::cfdemCloud dataExchangeM().setCG(); if (!cgOK_ && cg_ > 1) FatalError<< "at least one of your models is not fit for cg !!!"<< abort(FatalError); + + // check if simulation is a fully periodic box + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + int nPatchesCyclic(0); + int nPatchesNonCyclic(0); + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + if (isA(pp) || isA(pp)) + ++nPatchesCyclic; + else if (!isA(pp)) + ++nPatchesNonCyclic; + } + + if (nPatchesNonCyclic == 0) + { + checkPeriodicCells_ = true; + } + else if (nPatchesCyclic > 0 && nPatchesNonCyclic > 0) + { + if (verbose_) Info << "nPatchesNonCyclic=" << nPatchesNonCyclic << ", nPatchesCyclic=" << nPatchesCyclic << endl; + Warning << "Periodic handing is disabled because the domain is not fully periodic!\n" << endl; + } } // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index 9b84aa73..bf014ddf 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -160,6 +160,8 @@ protected: mutable volScalarField ddtVoidfraction_; + mutable Switch checkPeriodicCells_; + const turbulenceModel& turbulence_; autoPtr* forceModel_; @@ -395,6 +397,8 @@ public: void resetArray(double**&,int,int,double resetVal=0.); void otherForces(volVectorField&); + + bool checkPeriodicCells() { return checkPeriodicCells_; } }; From 123280958b0cb6235ea6ce4ee5f36aae7665db7d Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 17 Aug 2017 16:33:43 +0200 Subject: [PATCH 42/99] use flag from cfdemCloud for checking periodic cells in IBVoidFraction class --- .../voidFractionModel/IBVoidFraction/IBVoidFraction.C | 11 ++++------- .../voidFractionModel/IBVoidFraction/IBVoidFraction.H | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index 2b60cfac..48617e30 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -68,8 +68,7 @@ IBVoidFraction::IBVoidFraction propsDict_(dict.subDict(typeName + "Props")), alphaMin_(readScalar(propsDict_.lookup("alphaMin"))), alphaLimited_(0), - scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))), - checkPeriodicCells_(false) + scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))) { Info << "\n\n W A R N I N G - do not use in combination with differentialRegion model! \n\n" << endl; //Info << "\n\n W A R N I N G - this model does not yet work properly! \n\n" << endl; @@ -77,8 +76,6 @@ IBVoidFraction::IBVoidFraction if(scaleUpVol_ < 1){ FatalError<< "scaleUpVol shloud be > 1."<< abort(FatalError); } if(alphaMin_ > 1 || alphaMin_ < 0.01){ FatalError<< "alphaMin shloud be > 1 and < 0.01." << abort(FatalError); } - - if(propsDict_.found("checkPeriodicCells")) checkPeriodicCells_=true; } @@ -125,7 +122,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction scalar centreDist=mag(cellCentrePosition-positionCenter); vector minPeriodicParticlePos=positionCenter; - if(checkPeriodicCells_) //consider minimal distance to all periodic images of this particle + if(particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle { centreDist = minPeriodicDistance(cellCentrePosition, positionCenter, globalBb, minPeriodicParticlePos); @@ -142,7 +139,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction { vector vertexPosition = particleCloud_.mesh().points()[vertices[i]]; scalar centreVertexDist = mag(vertexPosition-positionCenter); - if(checkPeriodicCells_) //consider minimal distance to all periodic images of this particle + if(particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle { centreVertexDist = minPeriodicDistance(vertexPosition, positionCenter, globalBb, minPeriodicParticlePos); @@ -202,7 +199,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction buildLabelHashSet(radius, minPeriodicParticlePos, particleCenterCellID, hashSett, true); //Add cells of periodic particle images on same processor - if(checkPeriodicCells_) + if(particleCloud_.checkPeriodicCells()) { int doPeriodicImage[3]; for (int iDir=0; iDir<3; iDir++) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H index 78620719..e933311c 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H @@ -67,8 +67,6 @@ private: mutable bool alphaLimited_; const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle - - mutable bool checkPeriodicCells_; public: From 5f123bb6a1f71ca7035116a60f190bbb290514a3 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 17 Aug 2017 16:34:56 +0200 Subject: [PATCH 43/99] use flag from cfdemCloud for checking periodic cells in dividedVoidFraction class --- .../dividedVoidFraction/dividedVoidFraction.C | 1 + .../dividedVoidFraction/setWeightedSource.H | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C index d892d465..b59e8196 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C @@ -115,6 +115,7 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra scalar cellVol(0.); scalar scaleVol = weight(); scalar scaleRadius = pow(porosity(),1./3.); + const boundBox& globalBb = particleCloud_.mesh().bounds(); for(int index=0; index< particleCloud_.numberOfParticles(); index++) { diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/setWeightedSource.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/setWeightedSource.H index 36d472c9..8a2ebaa5 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/setWeightedSource.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/setWeightedSource.H @@ -3,6 +3,18 @@ { // locate subPoint vector subPosition = position + offset; + + if (particleCloud_.checkPeriodicCells()) + { + for (int iDir=0; iDir<3; iDir++) + { + if (subPosition[iDir] > globalBb.max()[iDir]) + subPosition[iDir] -= globalBb.max()[iDir]-globalBb.min()[iDir]; + else if (subPosition[iDir] < globalBb.min()[iDir]) + subPosition[iDir] += globalBb.max()[iDir]-globalBb.min()[iDir]; + } + } + label partCellId = particleCloud_.locateM().findSingleCell(subPosition,cellID); //NP fprintf(lmp->screen,"cellID=%d, partCellId=%d\n",static_cast(cellID),static_cast(partCellId)); From dc3f93f40190a564f540999f67d08cc6a69d9ca3 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 17 Aug 2017 16:50:51 +0200 Subject: [PATCH 44/99] change cg incompatibility error to warning by default added switch 'cgWarnOnly' to choose between warning (default) and error --- src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index e4a64e38..79f2a03f 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -298,7 +298,14 @@ cfdemCloud::cfdemCloud } dataExchangeM().setCG(); - if (!cgOK_ && cg_ > 1) FatalError<< "at least one of your models is not fit for cg !!!"<< abort(FatalError); + Switch cgWarnOnly_(couplingProperties_.lookupOrDefault("cgWarnOnly", true)); + if (!cgOK_ && cg_ > 1) + { + if (cgWarnOnly_) + Warning << "at least one of your models is not fit for cg !!!" << endl; + else + FatalError << "at least one of your models is not fit for cg !!!" << abort(FatalError); + } // check if simulation is a fully periodic box const polyBoundaryMesh& patches = mesh_.boundaryMesh(); From 3f8885c9b79f15f94b0c354e3f3efab7c95389bf Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 17 Aug 2017 17:13:16 +0200 Subject: [PATCH 45/99] add functions to get min dist of point to periodic particle image add functions to voidFractionModel class to determine minimal distance of a point to one of the periodic images of a particle --- .../voidFractionModel/voidFractionModel.C | 54 +++++++++++++++++++ .../voidFractionModel/voidFractionModel.H | 11 ++++ 2 files changed, 65 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C index bee8547b..b1ae3e78 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C @@ -170,6 +170,60 @@ void voidFractionModel::reAllocArrays(int nP) const } } +scalar voidFractionModel::pointInParticle(int index, const vector& positionCenter, const vector& point, double scale) const +{ + const scalar radius = particleCloud_.radius(index); + + if(radius > SMALL) + { + scalar pointDistSq = magSqr(point - positionCenter); + return pointDistSq / (scale*scale * radius*radius) - 1.0; + } + else + { + return 0.; + } +} + +//Function to determine minimal distance of point +//to one of the periodic images of a particle +scalar voidFractionModel::minPeriodicDistance(int index, + const vector& cellCentrePosition, + const vector& positionCenter, + const boundBox& globalBb, + vector& minPeriodicPos) const +{ + scalar f = VGREAT; + vector positionCenterPeriodic; + + for(label xDir=-1; xDir<=1; ++xDir) + { + positionCenterPeriodic[0] = positionCenter[0] + + static_cast(xDir) + * (globalBb.max()[0]-globalBb.min()[0]); + for(label yDir=-1; yDir<=1; ++yDir) + { + positionCenterPeriodic[1] = positionCenter[1] + + static_cast(yDir) + * (globalBb.max()[1]-globalBb.min()[1]); + for(label zDir=-1; zDir<=1; ++zDir) + { + positionCenterPeriodic[2] = positionCenter[2] + + static_cast(zDir) + * (globalBb.max()[2]-globalBb.min()[2]); + + if(pointInParticle(index, positionCenterPeriodic, cellCentrePosition) < f) + { + f = pointInParticle(index, positionCenterPeriodic, cellCentrePosition); + minPeriodicPos = positionCenterPeriodic; + } + } + } + } + + return f; +} + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H index 84d88667..877b49bf 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.H @@ -155,6 +155,17 @@ public: virtual void setParticleType(label type) const {} virtual bool checkParticleType(label) const { return true; } //consider all particles by default + + virtual scalar minPeriodicDistance + ( + int index, + const vector& cellCentrePosition, + const vector& positionCenter, + const boundBox& globalBb, + vector& minPeriodicPos + ) const; + + virtual scalar pointInParticle(int index, const vector& positionCenter, const vector& point, double scale=1.0) const; }; From 3dc7b6a150ee1cf07ba2fd00df10f79013b11d55 Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 18 Aug 2017 11:35:30 +0200 Subject: [PATCH 46/99] pre-generate marker points in dividedVoidFraction class generate marker points for unit sphere once and just scale these points for each particle instead of constantly recalculating them --- .../dividedVoidFraction/dividedVoidFraction.C | 87 +++++++++++-------- .../dividedVoidFraction/dividedVoidFraction.H | 4 + 2 files changed, 55 insertions(+), 36 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C index b59e8196..ea6bba9a 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C @@ -73,7 +73,7 @@ dividedVoidFraction::dividedVoidFraction interpolation_(false), cfdemUseOnly_(false) { - maxCellsPerParticle_ = 29; + maxCellsPerParticle_ = numberOfMarkerPoints; if(alphaMin_ > 1 || alphaMin_ < 0.01){ Warning << "alphaMin should be < 1 and > 0.01 !!!" << endl; } if (propsDict_.found("interpolation")){ @@ -90,6 +90,50 @@ dividedVoidFraction::dividedVoidFraction { cfdemUseOnly_ = readBool(propsDict_.lookup("cfdemUseOnly")); } + + // generate marker points on unit sphere + label m = 0; + offsets[m][0] = offsets[m][1] = offsets[m][2] = 0.0; + ++m; + + // for 2 different radii + scalar r1 = cbrt(1.0/numberOfMarkerPoints); + scalar r2 = cbrt(15.0/numberOfMarkerPoints); + scalar r[] = { 0.75 * (r2*r2*r2*r2 - r1*r1*r1*r1)/(r2*r2*r2 - r1*r1*r1), + 0.75 * (1.0 - r2*r2*r2*r2)/(1.0 - r2*r2*r2) }; + + for (label ir = 0; ir < 2; ++ir) + { + // try 8 subpoints derived from spherical coordinates + for (scalar zeta = M_PI_4; zeta < constant::mathematical::twoPi; zeta += constant::mathematical::piByTwo) + { + for (scalar theta = M_PI_4; theta < constant::mathematical::pi; theta += constant::mathematical::piByTwo) + { + offsets[m][0] = r[ir] * Foam::sin(theta) * Foam::cos(zeta); + offsets[m][1] = r[ir] * Foam::sin(theta) * Foam::sin(zeta); + offsets[m][2] = r[ir] * Foam::cos(theta); + ++m; + } + } + // try 2 more subpoints for each coordinate direction (6 total) + for (label j = -1; j <= 1; j += 2) + { + offsets[m][0] = r[ir] * j; + offsets[m][1] = 0.; + offsets[m][2] = 0.; + ++m; + + offsets[m][0] = 0.; + offsets[m][1] = r[ir] * j; + offsets[m][2] = 0.; + ++m; + + offsets[m][0] = 0.; + offsets[m][1] = 0.; + offsets[m][2] = r[ir] * j; + ++m; + } + } } @@ -141,7 +185,7 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra cellVol=0; //--variables for sub-search - int nPoints = 29; + int nPoints = numberOfMarkerPoints; int nNotFound=0,nUnEqual=0,nTotal=0; vector offset(0.,0.,0.); int cellsSet = 0; @@ -150,42 +194,13 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra { cellVol = particleCloud_.mesh().V()[cellID]; - // for 2 different radii - const scalar delta_r = 0.293976*radius; - for (scalar r = 0.623926*radius; r < radius; r+=delta_r) + for (label i = 1; i < numberOfMarkerPoints; ++i) { - // try 8 subpoint derived from spherical coordinates - for (scalar zeta=M_PI_4; zeta<2.*M_PI; zeta+=M_PI_2) - { - for (scalar theta=M_PI_4; theta(j); - offset[1] = 0.; - offset[2] = 0.; - #include "setWeightedSource.H" //NP set source terms at position+offset + offset = radius * offsets[i]; + #include "setWeightedSource.H" // set source terms at position+offset + } - offset[0] = 0.; - offset[1] = r * static_cast(j); - offset[2] = 0.; - #include "setWeightedSource.H" //NP set source terms at position+offset - - offset[0] = 0.; - offset[1] = 0.; - offset[2] = r * static_cast(j); - #include "setWeightedSource.H" //NP set source terms at position+offset - } - }// end loop radiivoidfractions - - if(cellsSet>29 || cellsSet<0) + if(cellsSet > maxCellsPerParticle_ || cellsSet < 0) { Info << "ERROR cellsSet =" << cellsSet << endl; } diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H index 1511ac8e..f3702cc1 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H @@ -57,6 +57,8 @@ class dividedVoidFraction { private: + static const int numberOfMarkerPoints = 29; + dictionary propsDict_; bool verbose_; @@ -71,6 +73,8 @@ private: bool cfdemUseOnly_; + vector offsets[numberOfMarkerPoints]; + virtual inline scalar Vp(int index, scalar radius, scalar scaleVol) const { return 4.188790205*radius*radius*radius*scaleVol; //4/3*pi=4.188790205 From 10fd33294300840124387a25b52b871adeebc16f Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 12:23:41 +0200 Subject: [PATCH 47/99] correct boundary conditions of voidfraction field correct BCs after modifying the voidfraction field --- .../voidFractionModel/centreVoidFraction/centreVoidFraction.C | 1 + .../voidFractionModel/dividedVoidFraction/dividedVoidFraction.C | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C index f04cfc07..a9237811 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C @@ -140,6 +140,7 @@ void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfrac } //} } + voidfractionNext_.correctBoundaryConditions(); // bring voidfraction from Eulerian Field to particle array for(int index=0; index< particleCloud_.numberOfParticles(); index++) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C index ea6bba9a..3fb59e97 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C @@ -242,6 +242,7 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra }// end if in cell //}// end if in mask }// end loop all particles + voidfractionNext_.correctBoundaryConditions(); // reset counter of lost volume if (verbose_) Pout << "Total particle volume neglected: " << tooMuch_ << endl; From 4ac84930c5649be2475a11a3a913d5702d2069c7 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 12:24:25 +0200 Subject: [PATCH 48/99] add braces --- .../subModels/forceModel/virtualMassForce/virtualMassForce.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C index d378163e..2d33a4fb 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/virtualMassForce/virtualMassForce.C @@ -92,8 +92,10 @@ virtualMassForce::virtualMassForce { splitUrelCalculation_ = readBool(propsDict_.lookup("splitUrelCalculation")); if(splitUrelCalculation_) + { Info << "Virtual mass model: will split the Urel calculation\n"; Info << "WARNING: be sure that LIGGGHTS integration takes ddtv_p implicitly into account! \n"; + } } if(propsDict_.found("Cadd")) { From 777a9e06ec2169a10953ca272eb7d18a684f3c94 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 12:32:09 +0200 Subject: [PATCH 49/99] refactor IBVoidFraction class move duplicate to separate function --- .../IBVoidFraction/IBVoidFraction.C | 167 ++++++++---------- .../IBVoidFraction/IBVoidFraction.H | 3 +- 2 files changed, 80 insertions(+), 90 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index 48617e30..92be1c0a 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -119,84 +119,58 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction //compute the voidfraction for the cell "particleCentreCellID vector cellCentrePosition = particleCloud_.mesh().C()[particleCenterCellID]; - scalar centreDist=mag(cellCentrePosition-positionCenter); - + scalar fc = pointInParticle(index, positionCenter, cellCentrePosition); vector minPeriodicParticlePos=positionCenter; + if(particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle { - centreDist = minPeriodicDistance(cellCentrePosition, positionCenter, globalBb, - minPeriodicParticlePos); + fc = minPeriodicDistance(index,cellCentrePosition, positionCenter, globalBb, minPeriodicParticlePos); } - if(centreDist + 0.5*sqrt(3.0)*pow(particleCloud_.mesh().V()[particleCenterCellID],0.33333) < radius) + scalar centreDist = mag(cellCentrePosition - minPeriodicParticlePos); + scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[particleCenterCellID], 1./3.); + vector coronaPoint = cellCentrePosition + (cellCentrePosition - minPeriodicParticlePos) * (corona / centreDist); + + if (pointInParticle(index, minPeriodicParticlePos, coronaPoint) < 0.0) { voidfractionNext_[particleCenterCellID] = 0; } else { const labelList& vertices = particleCloud_.mesh().cellPoints()[particleCenterCellID]; + const double ratio = 0.125; + forAll(vertices, i) { vector vertexPosition = particleCloud_.mesh().points()[vertices[i]]; - scalar centreVertexDist = mag(vertexPosition-positionCenter); + scalar fv = pointInParticle(index, positionCenter, vertexPosition); + if(particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle { - centreVertexDist = minPeriodicDistance(vertexPosition, positionCenter, globalBb, - minPeriodicParticlePos); + fv = minPeriodicDistance(index, vertexPosition, positionCenter, globalBb, minPeriodicParticlePos); } - if(centreDistradius) + else if (fc < 0.0 && fv > 0.0) { //compute lambda - scalar a = (vertexPosition - cellCentrePosition) - & (vertexPosition - cellCentrePosition); - scalar b = 2. * (vertexPosition - cellCentrePosition) - & (cellCentrePosition-minPeriodicParticlePos); - scalar c = ( (cellCentrePosition-minPeriodicParticlePos) - &(cellCentrePosition-minPeriodicParticlePos) - ) - - radius*radius; - - scalar lambda = 0.; - - if (b*b-4.*a*c>=0.) lambda = (-b+sqrt(b*b-4.*a*c))/(2.*a); - if (lambda > 0 && lambda <=1) voidfractionNext_[particleCenterCellID]-=lambda*0.125; - else - { - lambda = (-b-sqrt(b*b-4.*a*c))/(2.*a); - if (lambda > 0. && lambda <=1.) voidfractionNext_[particleCenterCellID]-=lambda*0.125; - } + scalar lambda = segmentParticleIntersection(index, minPeriodicParticlePos, cellCentrePosition, vertexPosition); + voidfractionNext_[particleCenterCellID] -= ratio * lambda; } - else if(centreDist>radius && centreVertexDist 0.0 && fv < 0.0) { - //compute another lambda too - scalar a = (vertexPosition - cellCentrePosition) - & (vertexPosition - cellCentrePosition); - scalar b = 2.* (vertexPosition - cellCentrePosition) - & (cellCentrePosition-minPeriodicParticlePos); - scalar c = ( (cellCentrePosition-minPeriodicParticlePos) - &(cellCentrePosition-minPeriodicParticlePos) - ) - - radius*radius; - scalar lambda = 0.; - - if(b*b-4.*a*c>=0.) lambda = (-b+sqrt(b*b-4.*a*c))/(2.*a); - if(lambda > 0. && lambda <=1.) voidfractionNext_[particleCenterCellID]-=(1.-lambda)*0.125; - else - { - lambda = (-b-sqrt(b*b-4.*a*c))/(2.*a); - if (lambda > 0. && lambda <=1.) voidfractionNext_[particleCenterCellID]-=(1.-lambda)*0.125; - } + //compute lambda + scalar lambda = segmentParticleIntersection(index, minPeriodicParticlePos, vertexPosition, cellCentrePosition); + voidfractionNext_[particleCenterCellID] -= ratio * lambda; } } } //end particle partially overlapping with cell //generating list with cell and subcells - buildLabelHashSet(radius, minPeriodicParticlePos, particleCenterCellID, hashSett, true); + buildLabelHashSet(index, minPeriodicParticlePos, particleCenterCellID, hashSett, true); //Add cells of periodic particle images on same processor if(particleCloud_.checkPeriodicCells()) @@ -322,7 +296,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction void IBVoidFraction::buildLabelHashSet ( - const scalar radius, + int index, const vector position, const label cellID, labelHashSet& hashSett, @@ -338,63 +312,42 @@ void IBVoidFraction::buildLabelHashSet vector cellCentrePosition = particleCloud_.mesh().C()[neighbor]; scalar centreDist = mag(cellCentrePosition-position); - if(!hashSett.found(neighbor) && centreDist + 0.5*sqrt(3.0)*pow(particleCloud_.mesh().V()[neighbor],0.33333) < radius) + scalar fc = pointInParticle(index, position, cellCentrePosition); + scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[neighbor], 1./3.); + vector coronaPoint = cellCentrePosition + (cellCentrePosition - position) * (corona / centreDist); + + if(!hashSett.found(neighbor) && pointInParticle(index, position, coronaPoint) < 0.0) { voidfractionNext_[neighbor] = 0.; - buildLabelHashSet(radius,position,neighbor,hashSett,true); + buildLabelHashSet(index,position,neighbor,hashSett,true); } - else if(!hashSett.found(neighbor) && centreDist < radius + sqrt(3.0)*pow(particleCloud_.mesh().V()[neighbor],0.33333)) + else if(!hashSett.found(neighbor)) { scalar scale = 1.; const labelList& vertexPoints = particleCloud_.mesh().cellPoints()[neighbor]; + const scalar ratio = 0.125; forAll(vertexPoints, j) { vector vertexPosition = particleCloud_.mesh().points()[vertexPoints[j]]; - scalar vertexDist = mag(vertexPosition - position); + scalar fv = pointInParticle(index, position, vertexPosition); - if (centreDist < radius) + if (fc < 0.0) { - if (vertexDist < radius) + if (fv < 0.0) { - scale -= 0.125; + scale -= ratio; } else { - scalar a = (vertexPosition - cellCentrePosition)&(vertexPosition - cellCentrePosition); - scalar b = 2.* (vertexPosition - cellCentrePosition)&(cellCentrePosition-position); - scalar c = ((cellCentrePosition-position)&(cellCentrePosition-position))-radius*radius; - scalar lambda = 0.; - - if(b*b-4.*a*c >= 0.) lambda = (-b+sqrt(b*b-4.*a*c))/(2.*a); - if (lambda > 0. && lambda <=1.) - { - scale -=lambda * 0.125; - } - else - { - lambda = (-b-sqrt(b*b-4.*a*c))/(2.*a); - if (lambda > 0. && lambda <= 1.) scale -=lambda * 0.125; - } + scalar lambda = segmentParticleIntersection(index, position, cellCentrePosition, vertexPosition); + scale -= lambda * ratio; } } - else if (vertexDist < radius) + else if (fv < 0.0) { - scalar a = (vertexPosition - cellCentrePosition)&(vertexPosition - cellCentrePosition); - scalar b = 2.* (vertexPosition - cellCentrePosition)&(cellCentrePosition-position); - scalar c = ((cellCentrePosition-position)&(cellCentrePosition-position))-radius*radius; - scalar lambda = 0.; - - if (b*b-4.*a*c >= 0.) lambda = (-b+sqrt(b*b-4.*a*c))/(2.*a); - if (lambda > 0. && lambda <= 1.) - { - scale -=(1.-lambda) * 0.125; - } - else - { - lambda = (-b-sqrt(b*b-4.*a*c))/(2.*a); - if (lambda > 0. && lambda <= 1.) scale -= (1.-lambda) * 0.125; - } + scalar lambda = segmentParticleIntersection(index, position, vertexPosition, cellCentrePosition); + scale -= lambda * ratio; } } @@ -407,7 +360,7 @@ void IBVoidFraction::buildLabelHashSet voidfractionNext_[neighbor] -= (1.0-scale); if(voidfractionNext_[neighbor] < 0.) voidfractionNext_[neighbor] = 0.0; } - if(!(scale == 1.0)) buildLabelHashSet(radius,position,neighbor,hashSett, true); + if(!(scale == 1.0)) buildLabelHashSet(index,position,neighbor,hashSett, true); } } } @@ -449,6 +402,42 @@ double IBVoidFraction::minPeriodicDistance(vector cellCentrePosition, return centreDist; } +double IBVoidFraction::segmentParticleIntersection(int index, vector positionCenter, vector pointInside, vector pointOutside) const +{ + const scalar radius = particleCloud_.radius(index); + const scalar a = (pointOutside - pointInside) & (pointOutside - pointInside); + const scalar b = 2.*(pointOutside - pointInside) & (pointInside - positionCenter); + const scalar c = ((pointInside - positionCenter) & (pointInside - positionCenter)) - radius*radius; + const scalar D = b*b - 4.0*a*c; + const scalar eps = 1e-12; + scalar lambda_ = 0.0; + scalar lambda = 0.0; + + if (D >= 0.0) + { + scalar sqrtD = sqrt(D); + lambda_ = (-b + sqrtD)/(2.0*a); + + if (lambda_ >= -eps && lambda_ <= 1.0+eps) + { + lambda = lambda_; + } + else + { + lambda_ = (-b - sqrtD)/(2.0*a); + if (lambda_ >= -eps && lambda_ <= 1.0+eps) + lambda = lambda_; + } + } + + if (lambda < 0.0) + return 0.0; + else if (lambda > 1.0) + return 1.0; + + return lambda; +} + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H index e933311c..d37aa110 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H @@ -93,7 +93,7 @@ public: void buildLabelHashSet ( - const scalar radius, + int index, const vector position, const label cellID, labelHashSet& hashSett, @@ -109,6 +109,7 @@ public: ) const; + virtual double segmentParticleIntersection(int index, vector positionCenter, vector pointInside, vector pointOutside) const; }; From 8e73260cb44a39faaab5a4d41e8bd318f79ab213 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 12:33:02 +0200 Subject: [PATCH 50/99] limit voidfractionNext and scale to values >= 0 --- .../voidFractionModel/IBVoidFraction/IBVoidFraction.C | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index 92be1c0a..21bd6be0 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -284,6 +284,8 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction if(cellID >= 0) { + if (voidfractionNext_[cellID] < 0.0) + voidfractionNext_[cellID] = 0.0; voidfractions[index][subcell] = voidfractionNext_[cellID]; } else @@ -351,6 +353,9 @@ void IBVoidFraction::buildLabelHashSet } } + if (scale < 0.0) + scale = 0.0; + if(voidfractionNext_[neighbor] == 1.0) { voidfractionNext_[neighbor] = scale; From 8b6222ba794e883e559ec7a0cd51b8b421afc6be Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 12:34:45 +0200 Subject: [PATCH 51/99] remove method no longer needed using base class method --- .../IBVoidFraction/IBVoidFraction.C | 37 ------------------- .../IBVoidFraction/IBVoidFraction.H | 11 +----- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index 21bd6be0..3882d0f1 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -370,43 +370,6 @@ void IBVoidFraction::buildLabelHashSet } } -//Function to determine minimal distance of point -//to one of the periodic images of a particle -double IBVoidFraction::minPeriodicDistance(vector cellCentrePosition, - vector positionCenter, - boundBox globalBb, - vector& minPeriodicPos)const -{ - double centreDist = 999e32; - vector positionCenterPeriodic; - - for (int xDir=-1; xDir<=1; xDir++) - { - positionCenterPeriodic[0] = positionCenter[0] - + static_cast(xDir) - * (globalBb.max()[0] - globalBb.min()[0]); - for (int yDir=-1; yDir<=1; yDir++) - { - positionCenterPeriodic[1] = positionCenter[1] - + static_cast(yDir) - * (globalBb.max()[1] - globalBb.min()[1]); - for (int zDir=-1; zDir<=1; zDir++) - { - positionCenterPeriodic[2] = positionCenter[2] - + static_cast(zDir) - * (globalBb.max()[2] - globalBb.min()[2]); - if (mag(cellCentrePosition-positionCenterPeriodic) < centreDist) - { - centreDist = mag(cellCentrePosition-positionCenterPeriodic); - minPeriodicPos = positionCenterPeriodic; - } - } - } - } - - return centreDist; -} - double IBVoidFraction::segmentParticleIntersection(int index, vector positionCenter, vector pointInside, vector pointOutside) const { const scalar radius = particleCloud_.radius(index); diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H index d37aa110..61eb32a2 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H @@ -99,16 +99,7 @@ public: labelHashSet& hashSett, bool initialInsert ) const; - - double minPeriodicDistance - ( - vector cellCentrePosition, - vector positionCenter, - boundBox globalBb, - vector& minPeriodicPos - ) const; - - + virtual double segmentParticleIntersection(int index, vector positionCenter, vector pointInside, vector pointOutside) const; }; From b2b3363104fe8604be3e4cb9828b5bdd930d4439 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 12:39:29 +0200 Subject: [PATCH 52/99] add procBoundaryCorrection for dividedVoidfraction in case of engineIB --- .../dividedVoidFraction/dividedVoidFraction.C | 35 +++++++++++++++++++ .../dividedVoidFraction/dividedVoidFraction.H | 2 ++ 2 files changed, 37 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C index 3fb59e97..6683147f 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C @@ -67,6 +67,7 @@ dividedVoidFraction::dividedVoidFraction voidFractionModel(dict,sm), propsDict_(dict.subDict(typeName + "Props")), verbose_(false), + procBoundaryCorrection_(propsDict_.lookupOrDefault("procBoundaryCorrection", false)), alphaMin_(readScalar(propsDict_.lookup("alphaMin"))), alphaLimited_(0), tooMuch_(0.0), @@ -91,6 +92,23 @@ dividedVoidFraction::dividedVoidFraction cfdemUseOnly_ = readBool(propsDict_.lookup("cfdemUseOnly")); } + if (procBoundaryCorrection_) + { + if (!(particleCloud_.locateM().type() == "engineIB")) + { + FatalError << typeName << ": You are requesting procBoundaryCorrection, this requires the use of engineIB!\n" + << abort(FatalError); + } + } + else + { + if (particleCloud_.locateM().type() == "engineIB") + { + FatalError << typeName << ": You are using engineIB, this requires using procBoundaryCorrection=true!\n" + << abort(FatalError); + } + } + // generate marker points on unit sphere label m = 0; offsets[m][0] = offsets[m][1] = offsets[m][2] = 0.0; @@ -190,10 +208,24 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra vector offset(0.,0.,0.); int cellsSet = 0; + if (procBoundaryCorrection_) + { + label cellWithCenter(-1); + // switch off cellIDs for force calc if steming from parallel search success + cellWithCenter = particleCloud_.locateM().findSingleCell(position,cellID); + particleCloud_.cellIDs()[index][0] = cellWithCenter; + } + if (cellID >= 0) // particel centre is in domain { cellVol = particleCloud_.mesh().V()[cellID]; + if (procBoundaryCorrection_) + { + offset = radius * offsets[0]; + #include "setWeightedSource.H" // set source terms at position+offset + } + for (label i = 1; i < numberOfMarkerPoints; ++i) { offset = radius * offsets[i]; @@ -205,6 +237,8 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra Info << "ERROR cellsSet =" << cellsSet << endl; } + if (!procBoundaryCorrection_) + { // set source for particle center; source 1/nPts+weight of all subpoints that have not been found scalar centreWeight = 1./nPoints*(nPoints-cellsSet); @@ -223,6 +257,7 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra // store particleVolume for each particle particleVolumes[index][0] += volume*centreWeight; particleV[index][0] += volume*centreWeight; + } /*//OUTPUT if (index==0 && verbose_) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H index f3702cc1..c23f12cb 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H @@ -63,6 +63,8 @@ private: bool verbose_; + Switch procBoundaryCorrection_; + const scalar alphaMin_; // min value of voidFraction mutable bool alphaLimited_; From 1213c90a504655f39ae567f9cae27192c899dfa9 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 13:09:33 +0200 Subject: [PATCH 53/99] clean up whitespaces and formatting --- .../IBVoidFraction/IBVoidFraction.C | 76 ++++++++++--------- .../IBVoidFraction/IBVoidFraction.H | 4 +- .../dividedVoidFraction/dividedVoidFraction.C | 73 ++++++++++-------- .../dividedVoidFraction/dividedVoidFraction.H | 2 +- 4 files changed, 84 insertions(+), 71 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index 3882d0f1..cdc33354 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -70,12 +70,13 @@ IBVoidFraction::IBVoidFraction alphaLimited_(0), scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))) { - Info << "\n\n W A R N I N G - do not use in combination with differentialRegion model! \n\n" << endl; - //Info << "\n\n W A R N I N G - this model does not yet work properly! \n\n" << endl; - maxCellsPerParticle_=readLabel(propsDict_.lookup("maxCellsPerParticle")); + Info << "\n\n W A R N I N G - do not use in combination with differentialRegion model!\n\n" << endl; + maxCellsPerParticle_ = readLabel(propsDict_.lookup("maxCellsPerParticle")); - if(scaleUpVol_ < 1){ FatalError<< "scaleUpVol shloud be > 1."<< abort(FatalError); } - if(alphaMin_ > 1 || alphaMin_ < 0.01){ FatalError<< "alphaMin shloud be > 1 and < 0.01." << abort(FatalError); } + if (scaleUpVol_ < 1.0) + FatalError << "scaleUpVol shloud be > 1." << abort(FatalError); + if (alphaMin_ > 1.0 || alphaMin_ < 0.01) + FatalError << "alphaMin shloud be > 1 and < 0.01." << abort(FatalError); } @@ -93,25 +94,26 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction reAllocArrays(); - voidfractionNext_.ref()=1; + voidfractionNext_.ref() = 1.0; - for(int index=0; index< particleCloud_.numberOfParticles(); index++) + for (int index=0; index < particleCloud_.numberOfParticles(); index++) { //if(mask[index][0]) //{ //reset - for(int subcell=0;subcell= 0) { @@ -120,9 +122,9 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction //compute the voidfraction for the cell "particleCentreCellID vector cellCentrePosition = particleCloud_.mesh().C()[particleCenterCellID]; scalar fc = pointInParticle(index, positionCenter, cellCentrePosition); - vector minPeriodicParticlePos=positionCenter; + vector minPeriodicParticlePos = positionCenter; - if(particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle + if (particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle { fc = minPeriodicDistance(index,cellCentrePosition, positionCenter, globalBb, minPeriodicParticlePos); } @@ -133,7 +135,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction if (pointInParticle(index, minPeriodicParticlePos, coronaPoint) < 0.0) { - voidfractionNext_[particleCenterCellID] = 0; + voidfractionNext_[particleCenterCellID] = 0.0; } else { @@ -145,7 +147,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction vector vertexPosition = particleCloud_.mesh().points()[vertices[i]]; scalar fv = pointInParticle(index, positionCenter, vertexPosition); - if(particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle + if (particleCloud_.checkPeriodicCells()) //consider minimal distance to all periodic images of this particle { fv = minPeriodicDistance(index, vertexPosition, positionCenter, globalBb, minPeriodicParticlePos); } @@ -173,12 +175,12 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction buildLabelHashSet(index, minPeriodicParticlePos, particleCenterCellID, hashSett, true); //Add cells of periodic particle images on same processor - if(particleCloud_.checkPeriodicCells()) + if (particleCloud_.checkPeriodicCells()) { int doPeriodicImage[3]; - for (int iDir=0; iDir<3; iDir++) + for (int iDir=0; iDir < 3; iDir++) { - doPeriodicImage[iDir]= 0; + doPeriodicImage[iDir] = 0; if ((minPeriodicParticlePos[iDir]+radius) > globalBb.max()[iDir]) { doPeriodicImage[iDir] = -1; @@ -209,10 +211,10 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction copyCounter++; } //y-direction - int currCopyCounter=copyCounter; + int currCopyCounter = copyCounter; if (doPeriodicImage[1] != 0) { - for(int yDirCop=0; yDirCop<=currCopyCounter; yDirCop++) + for (int yDirCop=0; yDirCop <= currCopyCounter; yDirCop++) { particlePosList.append( particlePosList[yDirCop] + vector( @@ -225,10 +227,10 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction } } //z-direction - currCopyCounter=copyCounter; + currCopyCounter = copyCounter; if (doPeriodicImage[2] != 0) { - for(int zDirCop=0; zDirCop<=currCopyCounter; zDirCop++) + for (int zDirCop=0; zDirCop <= currCopyCounter; zDirCop++) { particlePosList.append( particlePosList[zDirCop] + vector( @@ -244,7 +246,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction //add the nearest cell labels particleLabelList.append(particleCenterCellID); - for(int iPeriodicImage=1; iPeriodicImage<=copyCounter; iPeriodicImage++) + for (int iPeriodicImage=1; iPeriodicImage <= copyCounter; iPeriodicImage++) { label partCellId = particleCloud_.mesh().findNearestCell(particlePosList[iPeriodicImage]); particleLabelList.append(partCellId); @@ -258,17 +260,17 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction label hashSetLength = hashSett.size(); if (hashSetLength > maxCellsPerParticle_) { - FatalError<< "big particle algo found more cells ("<< hashSetLength - <<") than storage is prepared ("< 0) { cellsPerParticle_[index][0]=hashSetLength; hashSett.erase(particleCenterCellID); - for(label i=0;i= -eps && lambda_ <= 1.0+eps) lambda = lambda_; - } + } } if (lambda < 0.0) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H index 61eb32a2..e2072025 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H @@ -28,7 +28,7 @@ Description This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). - void fraction model for the smooth representation of spheres with + void fraction model for the smooth representation of spheres with radius > cell length. contribution from Alice Hager @@ -64,7 +64,7 @@ private: const scalar alphaMin_; //NP min value of voidFraction - mutable bool alphaLimited_; + mutable bool alphaLimited_; const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C index 6683147f..b5f13e8a 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C @@ -76,16 +76,20 @@ dividedVoidFraction::dividedVoidFraction { maxCellsPerParticle_ = numberOfMarkerPoints; - if(alphaMin_ > 1 || alphaMin_ < 0.01){ Warning << "alphaMin should be < 1 and > 0.01 !!!" << endl; } - if (propsDict_.found("interpolation")){ - interpolation_=true; + if (alphaMin_ > 1.0 || alphaMin_ < 0.01) + Warning << "alphaMin should be < 1 and > 0.01 !!!" << endl; + + if (propsDict_.found("interpolation")) + { + interpolation_ = true; Warning << "interpolation for dividedVoidFraction does not yet work correctly!" << endl; - Info << "Using interpolated voidfraction field - do not use this in combination with interpolation in drag model!"<< endl; + Info << "Using interpolated voidfraction field - do not use this in combination with interpolation in drag model!" << endl; } checkWeightNporosity(propsDict_); - if (propsDict_.found("verbose")) verbose_=true; + if (propsDict_.found("verbose")) + verbose_ = true; if (propsDict_.found("cfdemUseOnly")) { @@ -165,7 +169,7 @@ dividedVoidFraction::~dividedVoidFraction() void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes, double**& particleV) const { - if(cfdemUseOnly_) + if (cfdemUseOnly_) reAllocArrays(particleCloud_.numberOfParticles()); else reAllocArrays(); @@ -179,18 +183,18 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra scalar scaleRadius = pow(porosity(),1./3.); const boundBox& globalBb = particleCloud_.mesh().bounds(); - for(int index=0; index< particleCloud_.numberOfParticles(); index++) + for (int index=0; index < particleCloud_.numberOfParticles(); index++) { - if(!checkParticleType(index)) continue; //skip this particle if not correct type + if (!checkParticleType(index)) continue; //skip this particle if not correct type //if(mask[index][0]) //{ // reset - for(int subcell=0;subcell maxCellsPerParticle_ || cellsSet < 0) + if (cellsSet > maxCellsPerParticle_ || cellsSet < 0) { Info << "ERROR cellsSet =" << cellsSet << endl; } if (!procBoundaryCorrection_) { - // set source for particle center; source 1/nPts+weight of all subpoints that have not been found - scalar centreWeight = 1./nPoints*(nPoints-cellsSet); + // set source for particle center; source 1/nPts+weight of all subpoints that have not been found + scalar centreWeight = 1./nPoints*(nPoints-cellsSet); - // update voidfraction for each particle read - scalar newAlpha = voidfractionNext_[cellID]- volume*centreWeight/cellVol; - if(newAlpha > alphaMin_) voidfractionNext_[cellID] = newAlpha; - else - { - voidfractionNext_[cellID] = alphaMin_; - tooMuch_ += (alphaMin_-newAlpha) * cellVol; - } + // update voidfraction for each particle read + scalar newAlpha = voidfractionNext_[cellID]- volume*centreWeight/cellVol; + if (newAlpha > alphaMin_) + { + voidfractionNext_[cellID] = newAlpha; + } + else + { + voidfractionNext_[cellID] = alphaMin_; + tooMuch_ += (alphaMin_-newAlpha) * cellVol; + } - // store cellweight for each particle --- this should be done for subpoints as well!! - particleWeights[index][0] += centreWeight; + // store cellweight for each particle --- this should be done for subpoints as well!! + particleWeights[index][0] += centreWeight; - // store particleVolume for each particle - particleVolumes[index][0] += volume*centreWeight; - particleV[index][0] += volume*centreWeight; + // store particleVolume for each particle + particleVolumes[index][0] += volume*centreWeight; + particleV[index][0] += volume*centreWeight; } /*//OUTPUT @@ -286,7 +293,7 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra // bring voidfraction from Eulerian Field to particle array //interpolationCellPoint voidfractionInterpolator_(voidfractionNext_); //scalar voidfractionAtPos(0); - for(int index=0; index< particleCloud_.numberOfParticles(); index++) + for(int index=0; index < particleCloud_.numberOfParticles(); index++) { /*if(interpolation_) { @@ -318,14 +325,14 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra } else*/ { - for(int subcell=0;subcell= 0) + if (cellID >= 0) { voidfractions[index][subcell] = voidfractionNext_[cellID]; - } + } else { voidfractions[index][subcell] = -1.; diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H index c23f12cb..9f4d91a4 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H @@ -67,7 +67,7 @@ private: const scalar alphaMin_; // min value of voidFraction - mutable bool alphaLimited_; + mutable bool alphaLimited_; mutable scalar tooMuch_; // particle volume which is lost due to voidFraction limitation From 116bf952aba09ed6a837c7c57fac16dc58d4c5fb Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 13:17:26 +0200 Subject: [PATCH 54/99] remove commented out code --- .../dividedVoidFraction/dividedVoidFraction.C | 46 ------------------- .../voidFractionModel/voidFractionModel.C | 16 ------- 2 files changed, 62 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C index b5f13e8a..436f0b15 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C @@ -37,7 +37,6 @@ Description #include "dataExchangeModel.H" #include -//#include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -265,22 +264,6 @@ void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfra particleVolumes[index][0] += volume*centreWeight; particleV[index][0] += volume*centreWeight; } - - /*//OUTPUT - if (index==0 && verbose_) - { - Info << "centre cellID = " << cellID << endl; - Info << "cellsPerParticle_=" << cellsPerParticle_[index][0] << endl; - - for(int i=0;i= 0) - { - position = particleCloud_.position(index); - voidfractionAtPos=voidfractionInterpolator_.interpolate(position,cellI); - }else{ - voidfractionAtPos=-1; - } - - for(int subcell=0;subcell= 0) - { - if(voidfractionAtPos > 0) - voidfractions[index][subcell] = voidfractionAtPos; - else - voidfractions[index][subcell] = voidfractionNext_[cellID]; - } - else - { - voidfractions[index][subcell] = -1.; - } - } - } - else*/ { for (int subcell=0; subcell < cellsPerParticle_[index][0]; subcell++) { diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C index b1ae3e78..38cb8cdd 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C @@ -126,22 +126,6 @@ void voidFractionModel::resetVoidFractions() const voidfractionNext_.ref() = 1.; } -/*void voidFractionModel::undoVoidFractions(double**const& mask) const -{ - voidfractionPrev_.internalField() = voidfractionNext_.internalField(); - - for(int index=0; index< particleCloud_.numberOfParticles(); index++) - { - if(mask[index][0]) - { - // undo voidfraction cause by particle - label cellI = particleCloud_.cellIDs()[index][0]; - scalar cellVolume=voidfractionNext_.mesh().V()[cellI]; - voidfractionNext_[cellI] += particleCloud_.particleVolumes()[index][0]/cellVolume; - } - } -}*/ - int** const& voidFractionModel::cellsPerParticle() const { return cellsPerParticle_; From 579264952ffe71de956a286738209e9062ba3174 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 21 Aug 2017 13:17:52 +0200 Subject: [PATCH 55/99] remove unneeded includes --- .../subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C | 2 -- .../voidFractionModel/dividedVoidFraction/dividedVoidFraction.C | 1 - .../voidFractionModel/voidFractionModel/newVoidFractionModel.C | 1 - 3 files changed, 4 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index cdc33354..5e016a19 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -36,8 +36,6 @@ Description #include "locateModel.H" #include "dataExchangeModel.H" -#include - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C index 436f0b15..3066be22 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.C @@ -35,7 +35,6 @@ Description #include "addToRunTimeSelectionTable.H" #include "locateModel.H" #include "dataExchangeModel.H" -#include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/newVoidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/newVoidFractionModel.C index 1e4125a2..cf97f414 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/newVoidFractionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/newVoidFractionModel.C @@ -32,7 +32,6 @@ Description #include "error.H" #include "voidFractionModel.H" -#include "centreVoidFraction.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From 15b7c4383920a89d3409f2f388b03b8bc1c71322 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Aug 2017 10:36:54 +0200 Subject: [PATCH 56/99] remove unneeded environment variables libraries do not exist or are never used --- etc/bashrc | 20 -------------------- etc/cfdemSystemTest.sh | 1 - etc/cshrc | 15 --------------- 3 files changed, 36 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 836693c6..9f85dedd 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -38,12 +38,6 @@ #- export environment variables (adapt to your paths) #------------------------------------------------------------------------------ -#check if default lammps lib path should be used -if [[ $CFDEM_LAMMPS_LIB_DIR == "" ]]; then - export CFDEM_LAMMPS_LIB_DIR=$CFDEM_LIGGGHTS_SRC_DIR/../lib/ -else - echo "using CFDEM_LAMMPS_LIB_DIR=$CFDEM_LAMMPS_LIB_DIR defined by user." -fi #- LIGGGHTS lib name export CFDEM_LIGGGHTS_LIB_NAME=lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME @@ -68,20 +62,6 @@ fi export CFDEM_Many2ManyLIB_PATH=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library export CFDEM_Many2ManyLIB_MAKEFILENAME=$CFDEM_LIGGGHTS_MAKEFILE_NAME -#- LMP M2M lib path and makefile -export CFDEM_M2MLIB_PATH=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library -export CFDEM_M2MLIB_MAKEFILENAME=$CFDEM_LIGGGHTS_MAKEFILE_NAME - -#- LMP POEMS lib path and makefile -export CFDEM_POEMSLIB_PATH=$CFDEM_LAMMPS_LIB_DIR/poems -export CFDEM_POEMSLIB_MAKEFILENAME=g++ - -#- LMP ASPHERE lib path and makefile -export CFDEM_ASPHERELIB_PATH=$CFDEM_LAMMPS_LIB_DIR/poems -export CFDEM_ASPHERELIB_MAKEFILENAME=g++ - -#-C3PO library -export C3PO_SRC_DIR=$CFDEM_SRC_DIR/c3po #----------------------------------------------------- #- path to test harness diff --git a/etc/cfdemSystemTest.sh b/etc/cfdemSystemTest.sh index 3c3e44b3..70b81bc6 100755 --- a/etc/cfdemSystemTest.sh +++ b/etc/cfdemSystemTest.sh @@ -38,7 +38,6 @@ checkDirComment "$CFDEM_LPP_DIR" '$CFDEM_LPP_DIR' "yes" checkDirComment "$CFDEM_ADD_LIBS_DIR" '$CFDEM_ADD_LIBS_DIR' "yes" checkDirComment "$CFDEM_PIZZA_DIR" '$CFDEM_PIZZA_DIR' "no" checkDirComment "$CFDEM_TEST_HARNESS_PATH" '$CFDEM_TEST_HARNESS_PATH' "no" -#checkDirComment "$C3PO_SRC_DIR" '$C3PO_SRC_DIR' "no" echo "" echo "library names" diff --git a/etc/cshrc b/etc/cshrc index 0571d10c..0923c582 100755 --- a/etc/cshrc +++ b/etc/cshrc @@ -37,13 +37,6 @@ #- export environment variables (adapt to your paths) #------------------------------------------------------------------------------ -#check if default lammps lib path should be used -if ( ! ($?CFDEM_LAMMPS_LIB_DIR) ) then - setenv CFDEM_LAMMPS_LIB_DIR $CFDEM_LIGGGHTS_SRC_DIR"/../lib/" -else - echo "using CFDEM_LAMMPS_LIB_DIR=$CFDEM_LAMMPS_LIB_DIR defined by user." -endif - #- LIGGGHTS lib name setenv CFDEM_LIGGGHTS_LIB_NAME lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME @@ -67,14 +60,6 @@ endif setenv CFDEM_Many2ManyLIB_PATH $CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library setenv CFDEM_Many2ManyLIB_MAKEFILENAME $CFDEM_LIGGGHTS_MAKEFILE_NAME -#- LMP M2M lib path -setenv CFDEM_M2MLIB_PATH $CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayM2M/library -setenv CFDEM_M2MLIB_MAKEFILENAME $CFDEM_LIGGGHTS_MAKEFILE_NAME - -#- LMP POEMS lib path -setenv CFDEM_POEMSLIB_PATH $CFDEM_LIGGGHTS_SRC_DIR/../lib/poems -setenv CFDEM_POEMSLIB_MAKEFILENAME g++ - #- path to test harness setenv CFDEM_TEST_HARNESS_PATH $CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION From 8f11235d080c79ca9e7364933e2d40b8dee5f1ec Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Aug 2017 13:15:13 +0200 Subject: [PATCH 57/99] update make options for compressible library use same flags as for incompressible library --- src/lagrangian/cfdemParticleComp/Make/options | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticleComp/Make/options b/src/lagrangian/cfdemParticleComp/Make/options index e79a9574..a7718b58 100644 --- a/src/lagrangian/cfdemParticleComp/Make/options +++ b/src/lagrangian/cfdemParticleComp/Make/options @@ -4,7 +4,7 @@ sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) sinclude $(RULES)/mplib$(WM_MPLIB) -GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) +GIT_VERSION := $(shell git describe --dirty --always --tags) PFLAGS+= -DGITVERSION=\"$(GIT_VERSION)\" PFLAGS+= -Dcompre @@ -24,6 +24,9 @@ EXE_INC = \ -I$(CFDEM_LIGGGHTS_SRC_DIR) \ -I$(CFDEM_M2MLIB_PATH) \ -I$(CFDEM_SRC_DIR)/cfdTools \ + -Wno-old-style-cast \ + -Wno-unused-result \ + -Wno-literal-suffix LIB_LIBS = \ $(PLIBS) \ From 52eed4b3516882c8443245db8793e7b5b4fb336d Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Aug 2017 13:18:09 +0200 Subject: [PATCH 58/99] remove check for pizza dir from cfdemSysTest we don't use pizza anymore, just lpp --- etc/cfdemSystemTest.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/cfdemSystemTest.sh b/etc/cfdemSystemTest.sh index 70b81bc6..d623077e 100755 --- a/etc/cfdemSystemTest.sh +++ b/etc/cfdemSystemTest.sh @@ -36,7 +36,6 @@ checkDirComment "$CFDEM_LIGGGHTS_SRC_DIR" '$CFDEM_LIGGGHTS_SRC_DIR' "yes" checkEnvComment "$CFDEM_LIGGGHTS_BIN_DIR" '$CFDEM_LIGGGHTS_BIN_DIR' "yes" checkDirComment "$CFDEM_LPP_DIR" '$CFDEM_LPP_DIR' "yes" checkDirComment "$CFDEM_ADD_LIBS_DIR" '$CFDEM_ADD_LIBS_DIR' "yes" -checkDirComment "$CFDEM_PIZZA_DIR" '$CFDEM_PIZZA_DIR' "no" checkDirComment "$CFDEM_TEST_HARNESS_PATH" '$CFDEM_TEST_HARNESS_PATH' "no" echo "" From 9f7c801fbedb0f6cd33f92b942810ba63c6cd064 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Aug 2017 13:19:57 +0200 Subject: [PATCH 59/99] remove output of liggghts lib name in cfdemSysTest with cmake compilation in place, it's always libliggghts.so --- etc/cfdemSystemTest.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/cfdemSystemTest.sh b/etc/cfdemSystemTest.sh index d623077e..e3da8008 100755 --- a/etc/cfdemSystemTest.sh +++ b/etc/cfdemSystemTest.sh @@ -40,7 +40,6 @@ checkDirComment "$CFDEM_TEST_HARNESS_PATH" '$CFDEM_TEST_HARNESS_PATH' "no" echo "" echo "library names" -echo '$CFDEM_LIGGGHTS_LIB_NAME = '"$CFDEM_LIGGGHTS_LIB_NAME" echo '$CFDEM_LIB_NAME = '"$CFDEM_LIB_NAME" echo '$LD_LIBRARY_PATH = '"$LD_LIBRARY_PATH" echo '$WM_NCOMPPROCS = '"$WM_NCOMPPROCS" From a87ed03b61347e83f8e35c179301a0787d925e42 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Aug 2017 13:23:30 +0200 Subject: [PATCH 60/99] display PATH env var in cfdemSysTest We will add bin and library paths for cfdemcoupling binaries and libraries in the future -> display PATH to see if they are set correctly --- etc/cfdemSystemTest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/cfdemSystemTest.sh b/etc/cfdemSystemTest.sh index e3da8008..7cc2bf81 100755 --- a/etc/cfdemSystemTest.sh +++ b/etc/cfdemSystemTest.sh @@ -41,6 +41,7 @@ echo "" echo "library names" echo '$CFDEM_LIB_NAME = '"$CFDEM_LIB_NAME" +echo '$PATH = '"$PATH" echo '$LD_LIBRARY_PATH = '"$LD_LIBRARY_PATH" echo '$WM_NCOMPPROCS = '"$WM_NCOMPPROCS" From df1bf4893836c1d59ddde89e0fdb1b9fa0a76317 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Aug 2017 13:24:54 +0200 Subject: [PATCH 61/99] clean up whitespaces in cfdemSystemTest.sh --- etc/cfdemSystemTest.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/cfdemSystemTest.sh b/etc/cfdemSystemTest.sh index 7cc2bf81..544fc321 100755 --- a/etc/cfdemSystemTest.sh +++ b/etc/cfdemSystemTest.sh @@ -1,7 +1,7 @@ #!/bin/bash #===================================================================# -# sytsem settings test routine for cfdem project +# sytsem settings test routine for cfdem project # Christoph Goniva - May. 2011, DCS Computing GmbH #===================================================================# @@ -42,8 +42,8 @@ echo "" echo "library names" echo '$CFDEM_LIB_NAME = '"$CFDEM_LIB_NAME" echo '$PATH = '"$PATH" -echo '$LD_LIBRARY_PATH = '"$LD_LIBRARY_PATH" -echo '$WM_NCOMPPROCS = '"$WM_NCOMPPROCS" +echo '$LD_LIBRARY_PATH = '"$LD_LIBRARY_PATH" +echo '$WM_NCOMPPROCS = '"$WM_NCOMPPROCS" echo "*******************" @@ -77,6 +77,6 @@ if [ $checkAddOn == "true" ] if [ $(checkDir $filePath) == "true" ]; then source $filePath/etc/$packageName"SystemTest.sh" else - echo "$packageName does not exist." + echo "$packageName does not exist." fi fi From 7ade0c27a7f45563350f962955a6f36cbbebb924 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Aug 2017 14:36:12 +0200 Subject: [PATCH 62/99] Sourcing CFDEMcoupling: one-stop bashrc / cshrc * a single bashrc / cshrc file for CFDEMcoupling, similar to OpenFOAM * user-editable section on top, for: - setting the versions of OpenFOAM and CFDEMcoupling - setting installation paths - setting user directory path * allows to set/unset values from command-line parameters (important for test harness installation) * removed unused and deprecated environment variables --- etc/bashrc | 141 ++++++++++++++++++++++++++++++------------ etc/cshrc | 176 ++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 241 insertions(+), 76 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 9f85dedd..5e90ed8c 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -1,46 +1,76 @@ #----------------------------------*-sh-*-------------------------------------- # CFDEMcoupling -# Christoph Goniva -# June 2012 +# +# Copyright 2009-2012 JKU Linz +# Copyright 2012-2015 DCS Computing GmbH, Linz +# Copyright 2015- JKU Linz #------------------------------------------------------------------------------ # -# Script +# File # etc/bashrc # # Description -# Startup file for cfdem exporting environment variables -# Sourced ~/.bashrc +# Startup file for CFDEMcoupling +# Sourced from ~/.profile or ~/.bashrc # -#- adapt this and add to ./bashrc -#- you can test the correctness using cfdemSystemTest.sh - -##================================================# -##- source cfdem env vars -#export CFDEM_VERSION=PUBLIC -#export CFDEM_PROJECT_DIR=$HOME/CFDEM/CFDEMcoupling-$CFDEM_VERSION-$WM_PROJECT_VERSION -#export CFDEM_SRC_DIR=$CFDEM_PROJECT_DIR/src -#export CFDEM_SOLVER_DIR=$CFDEM_PROJECT_DIR/applications/solvers -#export CFDEM_DOC_DIR=$CFDEM_PROJECT_DIR/doc -#export CFDEM_UT_DIR=$CFDEM_PROJECT_DIR/applications/utilities -#export CFDEM_TUT_DIR=$CFDEM_PROJECT_DIR/tutorials -#export CFDEM_PROJECT_USER_DIR=$HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION -#export CFDEM_bashrc=$CFDEM_PROJECT_DIR/etc/bashrc -#export CFDEM_LIGGGHTS_SRC_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src -#export CFDEM_LIGGGHTS_BIN_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src-build -#export CFDEM_LIGGGHTS_MAKEFILE_NAME=fedora_fpic # obsolete with CMake -#export CFDEM_LPP_DIR=$HOME/LIGGGHTS/mylpp/src -#export CFDEM_PIZZA_DIR=$HOME/LIGGGHTS/PIZZA/gran_pizza_17Aug10/src -#. $CFDEM_bashrc -#================================================# +# you can test the correctness using cfdemSystemTest.sh #------------------------------------------------------------------------------ +export CFDEM_PROJECT=CFDEM +export CFDEM_VERSION=17.02 + +################################################################################ +# USER EDITABLE PART: Changes made here may be lost with the next upgrade +# +# Please set to the appropriate path if the default is not correct. +# +# activate compatible OpenFOAM version +. $HOME/OpenFOAM/OpenFOAM-4.x/etc/bashrc +# +# CFDEMcoupling +export CFDEM_INST_DIR=$HOME/$CFDEM_PROJECT +export CFDEM_PROJECT_DIR=$CFDEM_INST_DIR/CFDEMcoupling +export CFDEM_PROJECT_USER_DIR=$CFDEM_INST_DIR/$USER-$WM_PROJECT_VERSION +# +# LIGGGHTS +export CFDEM_LIGGGHTS_INST_DIR=$CFDEM_INST_DIR/LIGGGHTS +# +# LPP installation path +export CFDEM_LPP_INST_DIR=$CFDEM_INST_DIR/LPP +# +# Path to additional libraries +export CFDEM_ADD_LIBS_DIR= +# +# END OF (NORMAL) USER EDITABLE PART +################################################################################ + +#- The old dirs to be cleaned from the environment variables +cfdemOldDirs="$CFDEM_LIGGGHTS_BIN_DIR $CFDEM_APP_DIR $CFDEM_LIB_DIR" + +export CFDEM_LIGGGHTS_SRC_DIR=$CFDEM_LIGGGHTS_INST_DIR/src +export CFDEM_LIGGGHTS_BIN_DIR=$CFDEM_LIGGGHTS_INST_DIR/src-build + #------------------------------------------------------------------------------ -#- export environment variables (adapt to your paths) +# Source initialization functions +#------------------------------------------------------------------------------ +. $WM_PROJECT_DIR/etc/config.sh/functions + +#------------------------------------------------------------------------------ +# Evaluate command-line parameters +# these can be used to set/unset values +#------------------------------------------------------------------------------ +_foamEval $@ + #------------------------------------------------------------------------------ +export CFDEM_SRC_DIR=$CFDEM_PROJECT_DIR/src +export CFDEM_SOLVER_DIR=$CFDEM_PROJECT_DIR/applications/solvers +export CFDEM_UT_DIR=$CFDEM_PROJECT_DIR/applications/utilities +export CFDEM_DOC_DIR=$CFDEM_PROJECT_DIR/doc +export CFDEM_TUT_DIR=$CFDEM_PROJECT_DIR/tutorials +export CFDEM_LPP_DIR=$CFDEM_LPP_INST_DIR/src -#- LIGGGHTS lib name -export CFDEM_LIGGGHTS_LIB_NAME=lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME +#------------------------------------------------------------------------------ #- CFDEM lib name export CFDEM_LIB_NAME=lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION @@ -48,35 +78,67 @@ export CFDEM_LIB_NAME=lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION #- CFDEM compressible lib name export CFDEM_LIB_COMP_NAME=lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSION -#check if additional libraries should be compiled together with solvers +#- Check if additional libraries should be compiled together with solvers if [[ $CFDEM_ADD_LIBS_DIR == "" ]]; then export CFDEM_ADD_LIBS_DIR=$CFDEM_PROJECT_DIR/etc else echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user." fi -#----------------------------------------------------- -# additional libraries +#------------------------------------------------------------------------------ #- LMP Many2Many lib path and makefile export CFDEM_Many2ManyLIB_PATH=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library -export CFDEM_Many2ManyLIB_MAKEFILENAME=$CFDEM_LIGGGHTS_MAKEFILE_NAME +export CFDEM_Many2ManyLIB_MAKEFILENAME=fedora_fpic -#----------------------------------------------------- +#------------------------------------------------------------------------------ #- path to test harness export CFDEM_TEST_HARNESS_PATH=$CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION #- path to libraries -export CFDEM_LIB_DIR=$FOAM_USER_LIBBIN +export CFDEM_LIB_DIR=$CFDEM_PROJECT_DIR/platforms/$WM_OPTIONS/lib #- path to apps -export CFDEM_APP_DIR=$FOAM_USER_APPBIN +export CFDEM_APP_DIR=$CFDEM_PROJECT_DIR/platforms/$WM_OPTIONS/bin + +#- create directories +mkdir -p $CFDEM_LIB_DIR +mkdir -p $CFDEM_APP_DIR #- path to OF version flag file export CFDEM_OFVERSION_DIR=$CFDEM_PROJECT_DIR/etc/OFversion + #------------------------------------------------------------------------------ -#- settings for lpp postproc tool +# Clean standard environment variables (PATH, LD_LIBRARY_PATH) +#------------------------------------------------------------------------------ +foamClean=$WM_PROJECT_DIR/bin/foamCleanPath + +#- Clean PATH +cleaned=`$foamClean "$PATH" "$cfdemOldDirs"` && PATH="$cleaned" + +#- Clean LD_LIBRARY_PATH +cleaned=`$foamClean "$LD_LIBRARY_PATH" "$cfdemOldDirs"` \ + && LD_LIBRARY_PATH="$cleaned" + +export PATH LD_LIBRARY_PATH + +#- add binary directories to $PATH +_foamAddPath $CFDEM_APP_DIR:$CFDEM_LIGGGHTS_BIN_DIR +_foamAddLib $CFDEM_LIB_DIR + +#------------------------------------------------------------------------------ +# Cleanup environment: +#------------------------------------------------------------------------------ +unset cleaned foamClean cfdemOldDirs + +#------------------------------------------------------------------------------ +# Unload initialization functions: +#------------------------------------------------------------------------------ +. $WM_PROJECT_DIR/etc/config.sh/functions + +#------------------------------------------------------------------------------ +# Settings for lpp postproc tool #------------------------------------------------------------------------------ #- nr of procs for lpp tool @@ -89,8 +151,9 @@ export CFDEM_LPP_CHUNKSIZE=1 alias lpp='python -i $CFDEM_LPP_DIR/lpp.py --cpunum $CFDEM_LPP_NPROCS --chunksize $CFDEM_LPP_CHUNKSIZE' #------------------------------------------------------------------------------ -#- aliases for easy navigation (no changes necessary) +# aliases for easy navigation (no changes necessary) #------------------------------------------------------------------------------ + #- shortcut to cfdem path alias cfdem='cd $CFDEM_PROJECT_DIR' @@ -177,7 +240,7 @@ export -f cfdemGrep cfdemListFiles() { find $1 > listOfFiles.txt; } #keep the dir in list export -f cfdemListFiles -# check if the run directory exists +#- check if the user directory exists if [ -d "$CFDEM_PROJECT_USER_DIR" ]; then : else diff --git a/etc/cshrc b/etc/cshrc index 0923c582..f0a6a532 100755 --- a/etc/cshrc +++ b/etc/cshrc @@ -1,44 +1,109 @@ #----------------------------------*-sh-*-------------------------------------- # CFDEMcoupling -# Christoph Goniva -# June 2012 +# +# Copyright 2009-2012 JKU Linz +# Copyright 2012-2015 DCS Computing GmbH, Linz +# Copyright 2015- JKU Linz #------------------------------------------------------------------------------ # -# Script +# File # etc/cshrc # # Description -# Startup file for cfdem exporting environment variables -# Sourced ~/.cshrc +# Startup file for CFDEMcoupling +# Sourced from ~/.cshrc +#------------------------------------------------------------------------------ + +setenv CFDEM_PROJECT CFDEM +setenv CFDEM_VERSION 17.02 + +################################################################################ +# USER EDITABLE PART: Changes made here may be lost with the next upgrade # -#- adapt this and add to ./cshrc -#- you can test the correctness using cfdemSystemTest.sh +# Please set to the appropriate path if the default is not correct. +# +# activate compatible OpenFOAM version +. $HOME/OpenFOAM/OpenFOAM-4.x/etc/cshrc +# +# CFDEMcoupling +setenv CFDEM_INST_DIR $HOME/$CFDEM_PROJECT +setenv CFDEM_PROJECT_DIR $CFDEM_INST_DIR/CFDEMcoupling +setenv CFDEM_PROJECT_USER_DIR $CFDEM_INST_DIR/$USER-$WM_PROJECT_VERSION +# +# LIGGGHTS +setenv CFDEM_LIGGGHTS_INST_DIR $CFDEM_INST_DIR/LIGGGHTS +# +# LPP installation path +setenv CFDEM_LPP_INST_DIR $CFDEM_INST_DIR/LPP +# +# Path to additional libraries +setenv CFDEM_ADD_LIBS_DIR +# +# END OF (NORMAL) USER EDITABLE PART +################################################################################ -##================================================# -##- source cfdem env vars -#setenv CFDEM_VERSION PUBLIC -#setenv CFDEM_PROJECT_DIR $HOME/CFDEM/CFDEMcoupling-$CFDEM_VERSION-$WM_PROJECT_VERSION -#setenv CFDEM_SRC_DIR $CFDEM_PROJECT_DIR/src/lagrangian/cfdemParticle -#setenv CFDEM_SOLVER_DIR $CFDEM_PROJECT_DIR/applications/solvers -#setenv CFDEM_DOC_DIR $CFDEM_PROJECT_DIR/doc -#setenv CFDEM_UT_DIR $CFDEM_PROJECT_DIR/applications/utilities -#setenv CFDEM_TUT_DIR $CFDEM_PROJECT_DIR/tutorials -#setenv CFDEM_PROJECT_USER_DIR $HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION -#setenv CFDEM_bashrc $CFDEM_PROJECT_DIR/etc/cshrc -#setenv CFDEM_LIGGGHTS_SRC_DIR $HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src -#setenv CFDEM_LIGGGHTS_MAKEFILE_NAME fedora_fpic -#setenv CFDEM_LPP_DIR $HOME/LIGGGHTS/mylpp/src -#setenv CFDEM_PIZZA_DIR $HOME/LIGGGHTS/PIZZA/gran_pizza_17Aug10/src -#source $CFDEM_bashrc -#================================================# -#------------------------------------------------------------------------------ +#- The old dirs to be cleaned from the environment variables +set cfdemOldDirs= +if ( $?CFDEM_LIGGGHTS_BIN_DIR ) then + set cfdemOldDirs="$cfdemOldDirs $CFDEM_LIGGGHTS_BIN_DIR" +endif +if ( $?CFDEM_APP_DIR ) then + set cfdemOldDirs="$cfdemOldDirs $CFDEM_APP_DIR" +endif +if ( $?CFDEM_LIB_DIR ) then + set cfdemOldDirs="$cfdemOldDirs $CFDEM_LIB_DIR" +endif + +setenv CFDEM_LIGGGHTS_SRC_DIR $CFDEM_LIGGGHTS_INST_DIR/src +setenv CFDEM_LIGGGHTS_BIN_DIR $CFDEM_LIGGGHTS_INST_DIR/src-build #------------------------------------------------------------------------------ -#- export environment variables (adapt to your paths) +# Source files, possibly with some verbosity +#------------------------------------------------------------------------------ +alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*' + +#------------------------------------------------------------------------------ +# Evaluate command-line parameters +# these can be used to set/unset values +#------------------------------------------------------------------------------ +while ( $#argv > 0 ) + switch ($argv[1]) + case -*: + # stray option (not meant for us here) -> get out + break + breaksw + case *=: + # name= -> unsetenv name + if ($?FOAM_VERBOSE && $?prompt) echo "unsetenv $argv[1]:s/=//" + eval "unsetenv $argv[1]:s/=//" + breaksw + case *=*: + # name=value -> setenv name value + if ($?FOAM_VERBOSE && $?prompt) echo "setenv $argv[1]:s/=/ /" + eval "setenv $argv[1]:s/=/ /" + breaksw + default: + # filename: source it + if ( -f "$1" ) then + _foamSource "$1" + else + _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"` + endif + breaksw + endsw + shift +end + #------------------------------------------------------------------------------ -#- LIGGGHTS lib name -setenv CFDEM_LIGGGHTS_LIB_NAME lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME +setenv CFDEM_SRC_DIR $CFDEM_PROJECT_DIR/src +setenv CFDEM_SOLVER_DIR $CFDEM_PROJECT_DIR/applications/solvers +setenv CFDEM_UT_DIR $CFDEM_PROJECT_DIR/applications/utilities +setenv CFDEM_DOC_DIR $CFDEM_PROJECT_DIR/doc +setenv CFDEM_TUT_DIR $CFDEM_PROJECT_DIR/tutorials +setenv CFDEM_LPP_DIR $CFDEM_LPP_INST_DIR/src + +#------------------------------------------------------------------------------ #- CFDEM lib name setenv CFDEM_LIB_NAME lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION @@ -46,28 +111,64 @@ setenv CFDEM_LIB_NAME lagrangianCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION #- CFDEM compressible lib name setenv CFDEM_LIB_COMP_NAME lagrangianCFDEMcomp-$CFDEM_VERSION-$WM_PROJECT_VERSION -#check if additional libraries should be compiled together with solvers +#- Check if additional libraries should be compiled together with solvers if ( ! ($?CFDEM_ADD_LIBS_DIR) ) then setenv CFDEM_ADD_LIBS_DIR $CFDEM_PROJECT_DIR/etc else echo "using CFDEM_ADD_LIBS_DIR=$CFDEM_ADD_LIBS_DIR defined by user." endif -#----------------------------------------------------- -# additional libraries +#------------------------------------------------------------------------------ #- LMP Many2Many lib path and makefile setenv CFDEM_Many2ManyLIB_PATH $CFDEM_SRC_DIR/lagrangian/cfdemParticle/subModels/dataExchangeModel/twoWayMany2Many/library -setenv CFDEM_Many2ManyLIB_MAKEFILENAME $CFDEM_LIGGGHTS_MAKEFILE_NAME +setenv CFDEM_Many2ManyLIB_MAKEFILENAME fedora_fpic + +#------------------------------------------------------------------------------ #- path to test harness setenv CFDEM_TEST_HARNESS_PATH $CFDEM_PROJECT_USER_DIR/log/logFilesCFDEM-$CFDEM_VERSION-$WM_PROJECT_VERSION #- path to libraries -setenv CFDEM_LIB_DIR $FOAM_USER_LIBBIN +setenv CFDEM_LIB_DIR $CFDEM_PROJECT_DIR/platforms/$WM_OPTIONS/lib #- path to apps -setenv CFDEM_APP_DIR $FOAM_USER_APPBIN +setenv CFDEM_APP_DIR $CFDEM_PROJECT_DIR/platforms/$WM_OPTIONS/bin + +#- create directories +mkdir -p $CFDEM_LIB_DIR +mkdir -p $CFDEM_APP_DIR + +#- path to OF version flag file +setenv CFDEM_OFVERSION_DIR $CFDEM_PROJECT_DIR/etc/OFversion + +#------------------------------------------------------------------------------ +# Clean standard environment variables (PATH, LD_LIBRARY_PATH) +#------------------------------------------------------------------------------ +set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath + +#- prevent local variables from shadowing setenv variables +unset PATH LD_LIBRARY_PATH + +if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH '' + +#- Clean PATH +set cleaned=`$foamClean "$PATH" "$cfdemOldDirs"` +if ( $status == 0 ) setenv PATH $cleaned + +#- Clean LD_LIBRARY_PATH +set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$cfdemOldDirs"` +if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned + +#- add binary directories to $PATH +_foamAddPath $CFDEM_APP_DIR:$CFDEM_LIGGGHTS_BIN_DIR +_foamAddLib $CFDEM_LIB_DIR + +#------------------------------------------------------------------------------ +# Cleanup environment: +#------------------------------------------------------------------------------ +unset cleaned foamClean cfdemOldDirs +unalias _foamSource #------------------------------------------------------------------------------ #- settings for lpp postproc tool @@ -83,8 +184,9 @@ setenv CFDEM_LPP_CHUNKSIZE 1 alias lpp 'python -i $CFDEM_LPP_DIR/lpp.py --cpunum $CFDEM_LPP_NPROCS --chunksize $CFDEM_LPP_CHUNKSIZE \!:1' #------------------------------------------------------------------------------ -#- aliases for easy navigation (no changes necessary) +# aliases for easy navigation (no changes necessary) #------------------------------------------------------------------------------ + #- shortcut to cfdem path alias cfdem 'cd $CFDEM_PROJECT_DIR' @@ -163,13 +265,13 @@ alias cfdemLiggghtsPar 'echo "mpirun -np xx -machinefile mynodes $CFDEM_LIGGGHTS #- shortcut to run lpp alias lpp 'python -i $CFDEM_LPP_DIR/lpp.py \!:1' -# check if the directory exists +#- check if the user directory exists if ( -d "$CFDEM_PROJECT_USER_DIR" ) then : else if ( -d "$CFDEM_PROJECT_DIR" ) then echo "make new dirs $CFDEM_PROJECT_USER_DIR ? (y/n)" - set YN=$< + set YN=$< if ( $YN == "y" ) then mkdir -p $CFDEM_PROJECT_USER_DIR cd $CFDEM_PROJECT_USER_DIR From dd2e21be64c27d56285da03dd97b18f8d6665b22 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 17:35:08 +0200 Subject: [PATCH 63/99] create OFstream on stack instead of heap --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 0883d0e6..e79a68f7 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -88,8 +88,7 @@ fileName IOModel::buildFilePath(word dirName) const path=fileName("."/dirName); mkDir(path,0777); mkDir(fileName(path/"constant"),0777); - OFstream* stubFile = new OFstream(fileName(path/"particles.foam")); - delete stubFile; + OFstream stubFile(path/"particles.foam"); } return path; } From bce10d17c100374d72d891fd25a2711120ce9265 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 17:36:22 +0200 Subject: [PATCH 64/99] clean up whitespaces --- .../subModels/IOModel/IOModel/IOModel.C | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index e79a68f7..c41deb95 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -78,18 +78,19 @@ fileName IOModel::createLagrangianDir(fileName path) const fileName IOModel::buildFilePath(word dirName) const { // create file structure - fileName path(""); + fileName path(""); if(parOutput_) { - path=fileName(particleCloud_.mesh().time().path()/particleCloud_.mesh().time().timeName()/dirName/"particleCloud"); - mkDir(path,0777); - } else + path = fileName(particleCloud_.mesh().time().path()/particleCloud_.mesh().time().timeName()/dirName/"particleCloud"); + mkDir(path,0777); + } + else { - path=fileName("."/dirName); - mkDir(path,0777); - mkDir(fileName(path/"constant"),0777); - OFstream stubFile(path/"particles.foam"); - } + path = fileName("."/dirName); + mkDir(path,0777); + mkDir(path/"constant",0777); + OFstream stubFile(path/"particles.foam"); + } return path; } From 76b90cc3ccfb76cc73261fa70f738cba2001fab8 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 17:40:17 +0200 Subject: [PATCH 65/99] remove unnecessary copy to temp vector --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index c41deb95..63169078 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -96,7 +96,6 @@ fileName IOModel::buildFilePath(word dirName) const void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className,word finaliser) const { - vector vec; OFstream* fileStream = new OFstream(fileName(path/name)); *fileStream << "FoamFile\n"; *fileStream << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n"; @@ -117,8 +116,7 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam if (type=="scalar"){ *fileStream << array[index][0] << " \n"; }else if (type=="position" || type=="vector"){ - for(int i=0;i<3;i++) vec[i] = array[index][i]; - *fileStream <<"( "<< vec[0] <<" "< Date: Wed, 23 Aug 2017 17:45:58 +0200 Subject: [PATCH 66/99] create OFstream on stack instead of heap --- .../subModels/IOModel/IOModel/IOModel.C | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 63169078..147c88c6 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -96,17 +96,17 @@ fileName IOModel::buildFilePath(word dirName) const void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className,word finaliser) const { - OFstream* fileStream = new OFstream(fileName(path/name)); - *fileStream << "FoamFile\n"; - *fileStream << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n"; - *fileStream << nPProc <<"\n"; + OFstream fileStream(path/name); + fileStream << "FoamFile\n"; + fileStream << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n"; + fileStream << nPProc <<"\n"; - if(type!="origProcId")*fileStream << "(\n"; + if(type!="origProcId") fileStream << "(\n"; else if(type=="origProcId") { - if(nPProc>0) *fileStream <<"{0}"<< "\n"; - else *fileStream <<"{}"<< "\n"; + if(nPProc>0) fileStream <<"{0}"<< "\n"; + else fileStream <<"{}"<< "\n"; } for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) @@ -114,17 +114,16 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam if (particleCloud_.cellIDs()[index][0] > -1) // particle Found { if (type=="scalar"){ - *fileStream << array[index][0] << " \n"; + fileStream << array[index][0] << " \n"; }else if (type=="position" || type=="vector"){ - *fileStream <<"( "<< array[index][0] <<" "< Date: Wed, 23 Aug 2017 17:50:22 +0200 Subject: [PATCH 67/99] simplify logic don't waste any time if type == "origProcId" --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 147c88c6..702af50d 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -101,14 +101,15 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam fileStream << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n"; fileStream << nPProc <<"\n"; - - if(type!="origProcId") fileStream << "(\n"; - else if(type=="origProcId") + if (type == "origProcId") { if(nPProc>0) fileStream <<"{0}"<< "\n"; else fileStream <<"{}"<< "\n"; + return; } + fileStream << token::BEGIN_LIST << nl; + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { if (particleCloud_.cellIDs()[index][0] > -1) // particle Found @@ -123,7 +124,7 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam } } - if(type!="origProcId") fileStream << ")\n"; + fileStream << token::END_LIST << nl; } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // From 2e4c93f8eec19a038110c5897cee03c74bb5746f Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 17:52:51 +0200 Subject: [PATCH 68/99] use info from OFstream to create output file header --- .../subModels/IOModel/IOModel/IOModel.C | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 702af50d..5a6a7054 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -97,8 +97,16 @@ fileName IOModel::buildFilePath(word dirName) const void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className,word finaliser) const { OFstream fileStream(path/name); - fileStream << "FoamFile\n"; - fileStream << "{version 2.0; format ascii;class "<< className << "; location 0;object "<< name <<";}\n"; + + fileStream + << "FoamFile\n{\n" + << " version " << fileStream.version() << ";\n" + << " format " << fileStream.format() << ";\n" + << " class " << className << ";\n" + << " location " << 0 << ";\n" + << " object " << name << ";\n" + << "}" << nl; + fileStream << nPProc <<"\n"; if (type == "origProcId") From 165a2b9611e7d334b7ea3d412637d9bfef91f22a Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 17:55:57 +0200 Subject: [PATCH 69/99] no need for finalizer in case of 'label' --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 5a6a7054..c2e37d8d 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -127,7 +127,7 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam }else if (type=="position" || type=="vector"){ fileStream <<"( "<< array[index][0] <<" "< Date: Wed, 23 Aug 2017 17:58:41 +0200 Subject: [PATCH 70/99] IOModel::streamDataToPath - separate handling of position and vector vector needs no finaliser --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index c2e37d8d..8ddea5fd 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -124,8 +124,10 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam { if (type=="scalar"){ fileStream << array[index][0] << " \n"; - }else if (type=="position" || type=="vector"){ + }else if (type=="position"){ fileStream <<"( "<< array[index][0] <<" "< Date: Wed, 23 Aug 2017 18:00:00 +0200 Subject: [PATCH 71/99] output position as position type instead of vector type --- .../cfdemParticle/subModels/IOModel/basicIO/basicIO.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C index 37214e61..f9a7fe6b 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C @@ -102,7 +102,7 @@ int basicIO::dumpDEMdata() const nPProc_=count; // stream data to file - streamDataToPath(lagPath_, particleCloud_.positions(),nPProc_,"positions","vector","Cloud","0"); + streamDataToPath(lagPath_, particleCloud_.positions(),nPProc_,"positions","position","Cloud","0"); streamDataToPath(lagPath_, particleCloud_.velocities(),nPProc_,"v","vector","vectorField",""); streamDataToPath(lagPath_, particleCloud_.radii(),nPProc_,"r","scalar","scalarField",""); } From adc79029a181c7d43e79b490fc6bf0001cf999be Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 23 Aug 2017 18:01:22 +0200 Subject: [PATCH 72/99] use actual cell id of particles instead of dummy finaliser string --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 8ddea5fd..ac60abdb 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -118,14 +118,15 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam fileStream << token::BEGIN_LIST << nl; + int ** cellIDs = particleCloud_.cellIDs(); for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { - if (particleCloud_.cellIDs()[index][0] > -1) // particle Found + if (cellIDs[index][0] > -1) // particle Found { if (type=="scalar"){ fileStream << array[index][0] << " \n"; }else if (type=="position"){ - fileStream <<"( "<< array[index][0] <<" "< Date: Wed, 23 Aug 2017 18:02:29 +0200 Subject: [PATCH 73/99] clean up whitespaces --- .../subModels/IOModel/IOModel/IOModel.C | 29 ++++++++++++------- .../subModels/IOModel/basicIO/basicIO.C | 8 ++--- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index ac60abdb..4d03d9ac 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -111,25 +111,32 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam if (type == "origProcId") { - if(nPProc>0) fileStream <<"{0}"<< "\n"; - else fileStream <<"{}"<< "\n"; + if (nPProc > 0) fileStream << "{0}" << "\n"; + else fileStream << "{}" << "\n"; return; } fileStream << token::BEGIN_LIST << nl; int ** cellIDs = particleCloud_.cellIDs(); - for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + for (int index = 0; index < particleCloud_.numberOfParticles(); ++index) { if (cellIDs[index][0] > -1) // particle Found { - if (type=="scalar"){ + if (type == "scalar") + { fileStream << array[index][0] << " \n"; - }else if (type=="position"){ - fileStream <<"( "<< array[index][0] <<" "< -1) count++; - nPProc_=count; - + nPProc_ = count; + // stream data to file streamDataToPath(lagPath_, particleCloud_.positions(),nPProc_,"positions","position","Cloud","0"); streamDataToPath(lagPath_, particleCloud_.velocities(),nPProc_,"v","vector","vectorField",""); From 2e2701ccf7d63df5fa3a22b60bbecba271cec665 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 24 Aug 2017 09:58:01 +0200 Subject: [PATCH 74/99] remove unneeded parameter finaliser from IOModel::streamDataToPath --- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.C | 2 +- .../cfdemParticle/subModels/IOModel/IOModel/IOModel.H | 2 +- .../cfdemParticle/subModels/IOModel/basicIO/basicIO.C | 6 +++--- .../cfdemParticle/subModels/IOModel/sophIO/sophIO.C | 8 ++++---- .../cfdemParticle/subModels/IOModel/trackIO/trackIO.C | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C index 4d03d9ac..a6b62e6c 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.C @@ -94,7 +94,7 @@ fileName IOModel::buildFilePath(word dirName) const return path; } -void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className,word finaliser) const +void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className) const { OFstream fileStream(path/name); diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H index d266fc0b..f0329302 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/IOModel/IOModel.H @@ -121,7 +121,7 @@ public: fileName buildFilePath(word) const; - void streamDataToPath(fileName,double**,int,word,word type,word className,word finaliser) const; + void streamDataToPath(fileName,double**,int,word,word type,word className) const; }; diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C index 67f26361..9a3d27f4 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C @@ -102,9 +102,9 @@ int basicIO::dumpDEMdata() const nPProc_ = count; // stream data to file - streamDataToPath(lagPath_, particleCloud_.positions(),nPProc_,"positions","position","Cloud","0"); - streamDataToPath(lagPath_, particleCloud_.velocities(),nPProc_,"v","vector","vectorField",""); - streamDataToPath(lagPath_, particleCloud_.radii(),nPProc_,"r","scalar","scalarField",""); + streamDataToPath(lagPath_, particleCloud_.positions(),nPProc_,"positions","position","Cloud"); + streamDataToPath(lagPath_, particleCloud_.velocities(),nPProc_,"v","vector","vectorField"); + streamDataToPath(lagPath_, particleCloud_.radii(),nPProc_,"r","scalar","scalarField"); } return nPProc_; } diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C index e540c5a6..2a400c79 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/sophIO/sophIO.C @@ -84,10 +84,10 @@ int sophIO::dumpDEMdata() const npProcs=basicIO::dumpDEMdata(); // stream data to file - streamDataToPath(lagPath_, particleCloud_.voidfractions(),npProcs,"voidfractions","scalar","scalarField",""); - streamDataToPath(lagPath_, particleCloud_.impForces(),npProcs,"impForces","vector","vectorField",""); - streamDataToPath(lagPath_, particleCloud_.expForces(),npProcs,"expForces","vector","vectorField",""); - streamDataToPath(lagPath_, particleCloud_.DEMForces(),npProcs,"DEMForces","vector","vectorField",""); + streamDataToPath(lagPath_, particleCloud_.voidfractions(),npProcs,"voidfractions","scalar","scalarField"); + streamDataToPath(lagPath_, particleCloud_.impForces(),npProcs,"impForces","vector","vectorField"); + streamDataToPath(lagPath_, particleCloud_.expForces(),npProcs,"expForces","vector","vectorField"); + streamDataToPath(lagPath_, particleCloud_.DEMForces(),npProcs,"DEMForces","vector","vectorField"); } return npProcs; } diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C index 888a08fc..7fc9caa9 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/trackIO/trackIO.C @@ -82,8 +82,8 @@ int trackIO::dumpDEMdata() const npProcs = sophIO::dumpDEMdata(); // stream data to file - streamDataToPath(lagPath_, particleCloud_.velocities(),npProcs,"origId","label","labelField",""); - streamDataToPath(lagPath_, particleCloud_.velocities(),npProcs,"origProcId","origProcId","labelField",""); + streamDataToPath(lagPath_, particleCloud_.velocities(),npProcs,"origId","label","labelField"); + streamDataToPath(lagPath_, particleCloud_.velocities(),npProcs,"origProcId","origProcId","labelField"); } return npProcs; From 8df363cf97826b03f2923c9b0bf91a378853bb7c Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 24 Aug 2017 17:06:23 +0200 Subject: [PATCH 75/99] add some mathematical constants cf. OpenFOAM mathematicalConstants.H --- .../cfdemParticle/cfdTools/mathExtra.H | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H index fb45ecfd..a48893ef 100644 --- a/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H +++ b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H @@ -44,6 +44,28 @@ Description #define TOLERANCE_ORTHO 1e-10 +namespace Foam +{ +namespace constant +{ +namespace mathematical +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + const scalar piByFour(0.25*pi); + const scalar fourPiByThree(4.0*pi/3.0); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace mathematical +} // End namespace constant + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + + namespace MathExtra { From 9a1abb5f1990fa1037433d4c3f0aceeae4a4e086 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 24 Aug 2017 17:07:33 +0200 Subject: [PATCH 76/99] clean up whitespaces in mathExtra.H --- .../cfdemParticle/cfdTools/mathExtra.H | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H index a48893ef..2699627d 100644 --- a/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H +++ b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H @@ -27,7 +27,7 @@ License Description This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). - + Copyright of this contribution: Copyright 2014- TU Graz, IPPT ------------------------------------------------------------------------- */ @@ -66,7 +66,7 @@ namespace mathematical } // End namespace Foam -namespace MathExtra +namespace MathExtra { // inline void outerProduct(double *vec1, double *vec2, double **m); @@ -103,13 +103,13 @@ inline bool spheroidGeometry(double radius, double aspectRatio, //inputs //INPUT // radius ...volume-equivalent radius of the spheroid // aspectRatio ...major/minor aspect ratio - + //OUTPUT - // ai ... - // bi ... - // ei ... - // Le ... - + // ai ... + // bi ... + // ei ... + // Le ... + if(radius<=0.0) //avoid troubles in case radius is 0 or negative return false; @@ -141,7 +141,7 @@ inline bool spheroidGeometry2(double radius, double aspectRatio, //inputs //INPUT // radius ...volume-equivalent radius of the spheroid // aspectRatio ...major/minor aspect ratio - + //OUTPUT // XAe ...Eccentricity dependet parameter // YAe ...Eccentricity dependet parameter @@ -234,7 +234,7 @@ inline bool permutationDotDyadic( //Generate permutation tensor double permutationT[3][3][3]; permutationTensor(permutationT); - + //Step 1: compute dot prodcut of permutation tensor double permutationDotProd[3][3]; zeroize33(permutationDotProd); @@ -249,7 +249,7 @@ inline bool permutationDotDyadic( for(int iY=0; iY<3; iY++) for(int iZ=0; iZ<3; iZ++) tensor[iX][iY][iZ] = permutationDotProd[iX][iY] - * vector[iZ]; + * vector[iZ]; return true; } @@ -262,7 +262,7 @@ inline bool doubleDotTensor333Tensor33(double tensor333[3][3][3], ) { result[0]=0.0;result[1]=0.0;result[2]=0.0; - + for(int iX=0; iX<3; iX++) for(int iY=0; iY<3; iY++) for(int iZ=0; iZ<3; iZ++) From e6d12f6790cbef913dd291a074d37502a81f7702 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 24 Aug 2017 17:18:40 +0200 Subject: [PATCH 77/99] make debug info live in separate block --- src/lagrangian/cfdemParticle/cfdTools/debugInfo.H | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H b/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H index e2071fbc..5586cf51 100755 --- a/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H +++ b/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H @@ -1,4 +1,4 @@ - +{ //========================================================================// scalar countCell=0; // number of cells touched by particles int points=0; // number of particles and sub-points @@ -93,3 +93,4 @@ Info <<"meanR_array = "<< meanR_array << endl; Info <<"=============================================================================" << endl; Info << endl; +} From bf0ff235b63030a11cf16b43064e5f718b37202e Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 24 Aug 2017 17:19:24 +0200 Subject: [PATCH 78/99] use proper data type for counters --- src/lagrangian/cfdemParticle/cfdTools/debugInfo.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H b/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H index 5586cf51..285e291f 100755 --- a/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H +++ b/src/lagrangian/cfdemParticle/cfdTools/debugInfo.H @@ -1,7 +1,7 @@ { //========================================================================// - scalar countCell=0; // number of cells touched by particles - int points=0; // number of particles and sub-points + label countCell=0; // number of cells touched by particles + label points=0; // number of particles and sub-points scalar totalParticleWeights=0; // total weight of all particles and sub-points vector totalForce_array(0,0,0); // total force on particles based on particle array vector totalForce_field(0,0,0); // forceField of forceM(), used to calc Ksl From 6e23baba7ff2b3d8bbb4311b4f9b63990f113a1e Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 25 Aug 2017 14:33:50 +0200 Subject: [PATCH 79/99] fix Mei lift force The equation was probably taken from the paper of Kurose and Komori 1999, which does not repoduce the original formula given by Mei 1992 correctly (which itself is missing a left parenthesis). The correct formula can be looked up for example in Mei and Klausner 1994 or Loth and Dorgan 2009 --- .../cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C index 0dca7e3b..98b3f05e 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C @@ -190,12 +190,8 @@ void MeiLift::setForce() const else { J_star = 0.3 - *( 1.0 - +tanh( 2.5 * log10(epsilon+0.191) ) - ) - *( 0.667 - +tanh( 6.0 * (epsilon-0.32) ) - ); + * (1.0 + tanh(2.5 * (log10(epsilon) + 0.191))) + * (0.667 + tanh(6.0 * ( epsilon - 0.32 ))); } Cl = J_star * 4.11 * epsilon; //multiply McLaughlin's correction to the basic Saffman model From 2230dcaa57a27949b9d612b2c62e386fa113f19f Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 12:32:11 +0200 Subject: [PATCH 80/99] rearrange code in MeiLift to save some operations --- .../subModels/forceModel/MeiLift/MeiLift.C | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C index 98b3f05e..aa184dc0 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C @@ -124,6 +124,7 @@ void MeiLift::setForce() const scalar J_star(0); scalar Omega_eq(0); scalar alphaStar(0); + scalar epsilonSqr(0.0); scalar epsilon(0); scalar omega_star(0); vector vorticity(0,0,0); @@ -172,16 +173,16 @@ void MeiLift::setForce() const Rep = ds*magUr/nuf; Rew = magVorticity*ds*ds/nuf; - alphaStar = magVorticity*ds/magUr/2.0; - epsilon = sqrt(2.0*alphaStar /Rep ); - omega_star = 2.0*alphaStar; + omega_star = magVorticity * ds / magUr; + alphaStar = 0.5 * omega_star; + epsilonSqr = omega_star / Rep; + epsilon = sqrt(epsilonSqr); //Basic model for the correction to the Saffman lift //Based on McLaughlin (1991) if(epsilon < 0.1) { - J_star = -140 *epsilon*epsilon*epsilon*epsilon*epsilon - *log( 1./(epsilon*epsilon+SMALL) ); + J_star = -140.0 * epsilonSqr * epsilonSqr * epsilon * log(1. / (epsilonSqr+SMALL)); } else if(epsilon > 20) { @@ -198,9 +199,10 @@ void MeiLift::setForce() const //Second order terms given by Loth and Dorgan 2009 if(useSecondOrderTerms_) { - Omega_eq = omega_star/2.0*(1.0-0.0075*Rew)*(1.0-0.062*sqrt(Rep)-0.001*Rep); - Cl_star=1.0-(0.675+0.15*(1.0+tanh(0.28*(omega_star/2.0-2.0))))*tanh(0.18*sqrt(Rep)); - Cl += Omega_eq*Cl_star; + scalar sqrtRep = sqrt(Rep); + Cl_star = 1.0 - (0.675 + 0.15 * (1.0 + tanh(0.28 * (alphaStar - 2.0)))) * tanh(0.18 * sqrtRep); + Omega_eq = alphaStar * (1.0 - 0.0075 * Rew) * (1.0 - 0.062 * sqrtRep - 0.001 * Rep); + Cl += Omega_eq * Cl_star; } lift = 0.125*M_PI From 68d90352255c49d1dd92e42c0e5b26cb869f14df Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 14:20:51 +0200 Subject: [PATCH 81/99] clean up formatting, add some comments --- .../subModels/forceModel/MeiLift/MeiLift.C | 76 ++++++++++++------- .../subModels/forceModel/MeiLift/MeiLift.H | 25 +++--- 2 files changed, 64 insertions(+), 37 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C index aa184dc0..c753e8c1 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.C @@ -5,7 +5,8 @@ www.cfdem.com Christoph Goniva, christoph.goniva@cfdem.com Copyright 2009-2012 JKU Linz - Copyright 2012- DCS Computing GmbH, Linz + Copyright 2012-2015 DCS Computing GmbH, Linz + Copyright 2015- JKU Linz ------------------------------------------------------------------------------- License This file is part of CFDEMcoupling. @@ -27,6 +28,20 @@ License Description This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). + + This function is based on the derivation in R. Mei, + An approximate expression for shear lift force on a spherical particle at a + finite Reynolds number, + Int. J. Multiph. Flow 18 (1992) 145–147 + + The data for this functions is based on J.B. Mclaughlin, + Inertial migration of a small sphere in linear shear flows, + Journal of Fluid Mechanics. 224 (1991) 261-274. + + The second order terms are based on E. Loth and A. J. Dorgan, + An equation of motion for particles of finite Reynolds number and size, + Environ. Fluid Mech. 9 (2009) 187–206 + and can be added to the lift coefficient if desired \*---------------------------------------------------------------------------*/ #include "error.H" @@ -84,11 +99,11 @@ MeiLift::MeiLift //Append the field names to be probed particleCloud_.probeM().initialize(typeName, typeName+".logDat"); particleCloud_.probeM().vectorFields_.append("liftForce"); //first entry must the be the force - particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug - particleCloud_.probeM().vectorFields_.append("vorticity"); //other are debug - particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug - particleCloud_.probeM().scalarFields_.append("Rew"); //other are debug - particleCloud_.probeM().scalarFields_.append("J_star"); //other are debug + particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug + particleCloud_.probeM().vectorFields_.append("vorticity"); //other are debug + particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug + particleCloud_.probeM().scalarFields_.append("Rew"); //other are debug + particleCloud_.probeM().scalarFields_.append("J_star"); //other are debug particleCloud_.probeM().writeHeader(); } @@ -135,7 +150,7 @@ void MeiLift::setForce() const #include "setupProbeModel.H" - for(int index = 0; index < particleCloud_.numberOfParticles(); ++index) + for (int index = 0; index < particleCloud_.numberOfParticles(); ++index) { //if(mask[index][0]) //{ @@ -146,18 +161,16 @@ void MeiLift::setForce() const { Us = particleCloud_.velocity(index); - if( forceSubM(0).interpolation() ) + if (forceSubM(0).interpolation()) { position = particleCloud_.position(index); - Ur = UInterpolator_.interpolate(position,cellI) - - Us; + Ur = UInterpolator_.interpolate(position,cellI) - Us; vorticity = VorticityInterpolator_.interpolate(position,cellI); } else { - Ur = U_[cellI] - - Us; - vorticity=vorticityField[cellI]; + Ur = U_[cellI] - Us; + vorticity = vorticityField[cellI]; } magUr = mag(Ur); @@ -165,7 +178,7 @@ void MeiLift::setForce() const if (magUr > 0 && magVorticity > 0) { - ds = 2*particleCloud_.radius(index); + ds = 2. * particleCloud_.radius(index); nuf = nufField[cellI]; rho = rhoField[cellI]; @@ -179,37 +192,48 @@ void MeiLift::setForce() const epsilon = sqrt(epsilonSqr); //Basic model for the correction to the Saffman lift - //Based on McLaughlin (1991) - if(epsilon < 0.1) + //McLaughlin (1991), Mei (1992), Loth and Dorgan (2009) + //J_star = 0.443 * J + if (epsilon < 0.1) //epsilon << 1 { + //McLaughlin (1991), Eq (3.27): J = 32 * pi^2 * epsilon^5 * ln(1 / epsilon^2) J_star = -140.0 * epsilonSqr * epsilonSqr * epsilon * log(1. / (epsilonSqr+SMALL)); } - else if(epsilon > 20) + else if (epsilon > 20.0) //epsilon >> 1 { - J_star = 1.0-0.287/(epsilon*epsilon+SMALL); + //McLaughlin (1991), Eq (3.26): J = 2.255 - 0.6463 / epsilon^2 + J_star = 1.0 - 0.287 / epsilonSqr; } else { + //Mei (1992), Eq (10) + //Loth and Dorgan (2009), Eq (32) J_star = 0.3 * (1.0 + tanh(2.5 * (log10(epsilon) + 0.191))) * (0.667 + tanh(6.0 * ( epsilon - 0.32 ))); } - Cl = J_star * 4.11 * epsilon; //multiply McLaughlin's correction to the basic Saffman model + //Loth and Dorgan (2009), Eq (31): Saffman lift-coefficient: ClSaff = 12.92 / pi * epsilon ~ 4.11 * epsilon + //Loth and Dorgan (2009), Eq (32) + Cl = J_star * 4.11 * epsilon; //multiply correction to the basic Saffman model - //Second order terms given by Loth and Dorgan 2009 - if(useSecondOrderTerms_) + //Second order terms given by Loth and Dorgan (2009) + if (useSecondOrderTerms_) { scalar sqrtRep = sqrt(Rep); + //Loth and Dorgan (2009), Eq (34) Cl_star = 1.0 - (0.675 + 0.15 * (1.0 + tanh(0.28 * (alphaStar - 2.0)))) * tanh(0.18 * sqrtRep); + //Loth and Dorgan (2009), Eq (38) Omega_eq = alphaStar * (1.0 - 0.0075 * Rew) * (1.0 - 0.062 * sqrtRep - 0.001 * Rep); + //Loth and Dorgan (2009), Eq (39) Cl += Omega_eq * Cl_star; } - lift = 0.125*M_PI - *rho - *Cl - *magUr*Ur^vorticity/magVorticity - *ds*ds; + //Loth and Dorgan (2009), Eq (27) + lift = 0.125 * constant::mathematical::pi + * rho + * Cl + * magUr * Ur ^ vorticity / magVorticity + * ds * ds; if (modelType_ == "B") { diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H index 6a6016b9..81ecfaee 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/MeiLift/MeiLift.H @@ -5,7 +5,8 @@ www.cfdem.com Christoph Goniva, christoph.goniva@cfdem.com Copyright 2009-2012 JKU Linz - Copyright 2012- DCS Computing GmbH, Linz + Copyright 2012-2015 DCS Computing GmbH, Linz + Copyright 2015- JKU Linz ------------------------------------------------------------------------------- License This file is part of CFDEMcoupling. @@ -28,18 +29,20 @@ Description This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER). - This function is based on the derivation in R. Kurose, S. Komori, - Drag and lift forces on a rotating sphere in a linear shear flow, - Journal of Fluid Mechanics. 384 (1999) 183-206. + This function is based on the derivation in R. Mei, + An approximate expression for shear lift force on a spherical particle at a + finite Reynolds number, + Int. J. Multiph. Flow 18 (1992) 145–147 - The data for this functions is based on J.B. Mclaughlin, - Inertial migration of a small sphere in linear shear flows, - Journal of Fluid Mechanics. 224 (1991) 261-274. + The data for this functions is based on J.B. Mclaughlin, + Inertial migration of a small sphere in linear shear flows, + Journal of Fluid Mechanics. 224 (1991) 261-274. - The second order terms are based on: - Mei Lift force following Loth and Dorgan 2009, - and can be added to the lift coefficient if desired - (contribution from RQ) + The second order terms are based on E. Loth and A. J. Dorgan, + An equation of motion for particles of finite Reynolds number and size, + Environ. Fluid Mech. 9 (2009) 187–206 + and can be added to the lift coefficient if desired + (contribution from RQ) - including interpolation of the velocity to the particle position (optional) - including output to file for testing/data analysis (optional) From 1b9f7020ac5cd2253606ef3b9e8566e13decb06c Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 15:30:51 +0200 Subject: [PATCH 82/99] fix parameter in function call --- .../subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index 5e016a19..ffe1e65e 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -249,7 +249,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction label partCellId = particleCloud_.mesh().findNearestCell(particlePosList[iPeriodicImage]); particleLabelList.append(partCellId); - buildLabelHashSet(radius, particlePosList[iPeriodicImage], particleLabelList[iPeriodicImage], hashSett, false); + buildLabelHashSet(index, particlePosList[iPeriodicImage], particleLabelList[iPeriodicImage], hashSett, false); } } //end checkPeriodicCells_ From d5fbf402cbd138154c51e0c220f9dd1578023a38 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 15:37:16 +0200 Subject: [PATCH 83/99] fix missing include --- src/lagrangian/cfdemParticle/cfdTools/mathExtra.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H index 2699627d..ee946de0 100644 --- a/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H +++ b/src/lagrangian/cfdemParticle/cfdTools/mathExtra.H @@ -36,11 +36,11 @@ Description #define CFDEM_MATH_EXTRA_H #include -//#include "math.h" #include #include #include #include +#include "mathematicalConstants.H" #define TOLERANCE_ORTHO 1e-10 From 9650aff31800bebde2e62535a666e364c8456f21 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 15:40:23 +0200 Subject: [PATCH 84/99] protect against division by zero merged from PUBLIC --- .../voidFractionModel/IBVoidFraction/IBVoidFraction.C | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index ffe1e65e..59283ac5 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -129,7 +129,9 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction scalar centreDist = mag(cellCentrePosition - minPeriodicParticlePos); scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[particleCenterCellID], 1./3.); - vector coronaPoint = cellCentrePosition + (cellCentrePosition - minPeriodicParticlePos) * (corona / centreDist); + vector coronaPoint = cellCentrePosition; + if(centreDist > 0.0) + coronaPoint += (cellCentrePosition - minPeriodicParticlePos) * (corona / centreDist); if (pointInParticle(index, minPeriodicParticlePos, coronaPoint) < 0.0) { @@ -317,7 +319,9 @@ void IBVoidFraction::buildLabelHashSet scalar fc = pointInParticle(index, position, cellCentrePosition); scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[neighbor], 1./3.); - vector coronaPoint = cellCentrePosition + (cellCentrePosition - position) * (corona / centreDist); + vector coronaPoint = cellCentrePosition; + if (centreDist > 0.0) + coronaPoint += (cellCentrePosition - position) * (corona / centreDist); if (!hashSett.found(neighbor) && pointInParticle(index, position, coronaPoint) < 0.0) { From 683fd04828cce2eb69762e7132118c4eb0ddd67f Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 15:42:13 +0200 Subject: [PATCH 85/99] pre-calculate sqrt(3.0) merged from PUBLIC --- .../voidFractionModel/IBVoidFraction/IBVoidFraction.C | 7 ++++--- .../voidFractionModel/IBVoidFraction/IBVoidFraction.H | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C index 59283ac5..4bfadbd0 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.C @@ -66,7 +66,8 @@ IBVoidFraction::IBVoidFraction propsDict_(dict.subDict(typeName + "Props")), alphaMin_(readScalar(propsDict_.lookup("alphaMin"))), alphaLimited_(0), - scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))) + scaleUpVol_(readScalar(propsDict_.lookup("scaleUpVol"))), + sqrtThree_(sqrt(3.0)) { Info << "\n\n W A R N I N G - do not use in combination with differentialRegion model!\n\n" << endl; maxCellsPerParticle_ = readLabel(propsDict_.lookup("maxCellsPerParticle")); @@ -128,7 +129,7 @@ void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfraction } scalar centreDist = mag(cellCentrePosition - minPeriodicParticlePos); - scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[particleCenterCellID], 1./3.); + scalar corona = 0.5 * sqrtThree_ * pow(particleCloud_.mesh().V()[particleCenterCellID], 1./3.); vector coronaPoint = cellCentrePosition; if(centreDist > 0.0) coronaPoint += (cellCentrePosition - minPeriodicParticlePos) * (corona / centreDist); @@ -318,7 +319,7 @@ void IBVoidFraction::buildLabelHashSet scalar centreDist = mag(cellCentrePosition-position); scalar fc = pointInParticle(index, position, cellCentrePosition); - scalar corona = 0.5 * sqrt(3.0) * pow(particleCloud_.mesh().V()[neighbor], 1./3.); + scalar corona = 0.5 * sqrtThree_ * pow(particleCloud_.mesh().V()[neighbor], 1./3.); vector coronaPoint = cellCentrePosition; if (centreDist > 0.0) coronaPoint += (cellCentrePosition - position) * (corona / centreDist); diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H index e2072025..0e430dc9 100755 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/IBVoidFraction/IBVoidFraction.H @@ -68,6 +68,8 @@ private: const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle + const scalar sqrtThree_; + public: //- Runtime type information From f946c5765f113d63de854702e1a21199ae4b6bfb Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 15:43:19 +0200 Subject: [PATCH 86/99] use const variable from mathExtra.H --- .../voidFractionModel/GaussVoidFraction/GaussVoidFraction.C | 4 ++-- .../bigParticleVoidFraction/bigParticleVoidFraction.C | 4 ++-- .../centreVoidFraction/centreVoidFraction.C | 4 ++-- .../dividedVoidFraction/dividedVoidFraction.H | 5 +++-- .../trilinearVoidFraction/trilinearVoidFraction.C | 5 ++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C index 231e7e97..3553decf 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C @@ -30,7 +30,7 @@ Description \*---------------------------------------------------------------------------*/ #include "error.H" - +#include "mathExtra.H" #include "GaussVoidFraction.H" #include "addToRunTimeSelectionTable.H" #include "locateModel.H" @@ -115,7 +115,7 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract label particleCenterCellID=particleCloud_.cellIDs()[index][0]; radius = particleCloud_.radius(index); - volume = 4.188790205*radius*radius*radius*scaleVol; + volume = constant::mathematical::fourPiByThree*radius*radius*radius*scaleVol; radius *= scaleRadius; vector positionCenter=particleCloud_.position(index); diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C index 63405dca..d176668f 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/bigParticleVoidFraction/bigParticleVoidFraction.C @@ -30,7 +30,7 @@ Description \*---------------------------------------------------------------------------*/ #include "error.H" - +#include "mathExtra.H" #include "bigParticleVoidFraction.H" #include "addToRunTimeSelectionTable.H" #include "locateModel.H" @@ -113,7 +113,7 @@ void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voi //collecting data label particleCenterCellID=particleCloud_.cellIDs()[index][0]; radius = particleCloud_.radius(index); - volume = 4.188790205*radius*radius*radius*scaleVol; + volume = constant::mathematical::fourPiByThree*radius*radius*radius*scaleVol; radius *= scaleRadius; vector positionCenter=particleCloud_.position(index); diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C index a9237811..0f1fb2bf 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/centreVoidFraction/centreVoidFraction.C @@ -30,8 +30,8 @@ Description \*---------------------------------------------------------------------------*/ #include "error.H" - #include "centreVoidFraction.H" +#include "mathExtra.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -101,7 +101,7 @@ void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfrac { cellVol = voidfractionNext_.mesh().V()[cellI]; radius = particleCloud_.radius(index); - volume = 4.188790205*radius*radius*radius*scaleVol; + volume = constant::mathematical::fourPiByThree*radius*radius*radius*scaleVol; // store volume for each particle particleVolumes[index][0] = volume; diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H index 9f4d91a4..e14062fb 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/dividedVoidFraction/dividedVoidFraction.H @@ -39,6 +39,7 @@ SourceFiles #ifndef dividedVoidFraction_H #define dividedVoidFraction_H +#include "mathExtra.H" #include "voidFractionModel.H" #include "interpolationCellPoint.H" @@ -79,8 +80,8 @@ private: virtual inline scalar Vp(int index, scalar radius, scalar scaleVol) const { - return 4.188790205*radius*radius*radius*scaleVol; //4/3*pi=4.188790205 - }; + return constant::mathematical::fourPiByThree*radius*radius*radius*scaleVol; + } public: diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C index b58e6ad7..5e395e31 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/trilinearVoidFraction/trilinearVoidFraction.C @@ -29,7 +29,7 @@ Description \*---------------------------------------------------------------------------*/ #include "error.H" - +#include "mathExtra.H" #include "trilinearVoidFraction.H" #include "addToRunTimeSelectionTable.H" @@ -95,7 +95,6 @@ void trilinearVoidFraction::setvoidFraction(double** const& mask,double**& voidf scalar radius(-1.); scalar volume(0.); const scalar scaleVol = weight(); - const scalar fourPiByThree = 4.0*constant::mathematical::pi/3.0; vector partPos(0.,0.,0.); vector pt(0.,0.,0.); @@ -141,7 +140,7 @@ void trilinearVoidFraction::setvoidFraction(double** const& mask,double**& voidf if (cellI >= 0) // particel centre is in domain { radius = particleCloud_.radius(index); - volume = fourPiByThree * radius * radius * radius * scaleVol; + volume = constant::mathematical::fourPiByThree * radius * radius * radius * scaleVol; // store volume for each particle particleVolumes[index][0] = volume; From 8b3878de653c20a3d1a83c5b61a1216d74f95e1a Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 15:57:22 +0200 Subject: [PATCH 87/99] abort on Gauss void fraction model merged from PUBLIC --- .../voidFractionModel/GaussVoidFraction/GaussVoidFraction.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C index 3553decf..41dcc94a 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C @@ -69,7 +69,7 @@ GaussVoidFraction::GaussVoidFraction alphaLimited_(0) { Info << "\n\n W A R N I N G - do not use in combination with differentialRegion model! \n\n" << endl; - Info << "\n\n W A R N I N G - this model does not yet work properly! \n\n" << endl; + FatalError << "\n\n This model does not yet work properly! \n\n" << endl; //reading maxCellsPerParticle from dictionary maxCellsPerParticle_=readLabel(propsDict_.lookup("maxCellsPerParticle")); From 4e50b3e06c470b9326783fc6bd21554dd88728e6 Mon Sep 17 00:00:00 2001 From: danielque Date: Mon, 28 Aug 2017 15:57:45 +0200 Subject: [PATCH 88/99] clean up whitespaces --- .../GaussVoidFraction/GaussVoidFraction.C | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C index 41dcc94a..3964b074 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/GaussVoidFraction/GaussVoidFraction.C @@ -119,8 +119,8 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract radius *= scaleRadius; vector positionCenter=particleCloud_.position(index); - scalar core; - scalar dist; + scalar core; + scalar dist; if (particleCenterCellID >= 0) { @@ -151,8 +151,8 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract //==========================// //setting the voidfractions - dist = mag(particleCloud_.mesh().C()[particleCenterCellID]-particleCloud_.position(index)); - core = pow(2.0/radius/radius/M_PI,1.5)*exp(-dist*dist/2.0/radius/radius)*particleCloud_.mesh().V()[particleCenterCellID]; + dist = mag(particleCloud_.mesh().C()[particleCenterCellID]-particleCloud_.position(index)); + core = pow(2.0/radius/radius/M_PI,1.5)*exp(-dist*dist/2.0/radius/radius)*particleCloud_.mesh().V()[particleCenterCellID]; // volume occupied in every covered cell scalar occupiedVolume = volume*core; @@ -164,8 +164,8 @@ void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfract particleVolumes[index][0] += occupiedVolume; particleV[index][0] += occupiedVolume; - //Info << "Centre:set voidfraction in cellI=" << particleCenterCellID - // << ", voidfraction =" << voidfractionNext_[particleCenterCellID] << endl; + //Info << "Centre:set voidfraction in cellI=" << particleCenterCellID + // << ", voidfraction =" << voidfractionNext_[particleCenterCellID] << endl; // correct volumefraction of sub-cells for(label i=0;i Date: Mon, 28 Aug 2017 18:01:56 +0200 Subject: [PATCH 91/99] pre-generate satellite points in engineSearchIB mostly merged from PUBLIC --- .../engineSearchIB/engineSearchIB.C | 63 +++++++++++-------- .../engineSearchIB/engineSearchIB.H | 18 ++++++ 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C index e1876bb7..7450514b 100644 --- a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C +++ b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C @@ -67,8 +67,16 @@ engineSearchIB::engineSearchIB engineSearch(dict.subDict(typeName + "Props"),sm), propsDict_(dict.subDict(typeName + "Props")), zSplit_(readLabel(propsDict_.lookup("zSplit"))), - xySplit_(readLabel(propsDict_.lookup("xySplit"))) + xySplit_(readLabel(propsDict_.lookup("xySplit"))), + thetaSize_(180./zSplit_), + phiSize_(360./xySplit_), + deg2rad_(constant::mathematical::pi/180.), + numberOfSatellitePoints_((zSplit_-1)*xySplit_ + 2) { + for(int countPoints = 0; countPoints < numberOfSatellitePoints_; ++countPoints) + { + satellitePoints_.push_back(generateSatellitePoint(countPoints)); + } } @@ -111,34 +119,11 @@ label engineSearchIB::findCell //mod by alice upon from here if(cellIDs[index][0] < 0) { - vector pos = position; label altStartPos = -1; - label numberOfPoints = (zSplit_-1)*xySplit_ + 2; // 1 point at bottom, 1 point at top - label thetaLevel = 0; - scalar theta, phi; - const scalar thetaSize = 180./zSplit_, phiSize = 360./xySplit_; - const scalar deg2rad = M_PI/180.; - for(int countPoints = 0; countPoints < numberOfPoints; ++countPoints) + for(int countPoints = 0; countPoints < numberOfSatellitePoints_; ++countPoints) { - pos = position; - if(countPoints == 0) - { - pos[2] += radius; - } - else if(countPoints == 1) - { - pos[2] -= radius; - } - else - { - thetaLevel = (countPoints - 2) / xySplit_; - theta = deg2rad * thetaSize * (thetaLevel+1); - phi = deg2rad * phiSize * (countPoints - 2 - thetaLevel*xySplit_); - pos[0] += radius * sin(theta) * cos(phi); - pos[1] += radius * sin(theta) * sin(phi); - pos[2] += radius * cos(theta); - } + vector pos = getSatellitePoint(index, countPoints); altStartPos=findSingleCell(pos,oldID); //particleCloud_.mesh().findCell(pos);// //check for periodic domains @@ -171,6 +156,32 @@ label engineSearchIB::findCell return 1; } +vector engineSearchIB::generateSatellitePoint(int countPoints) const +{ + // 1 point at bottom, 1 point at top + if(countPoints == 0) + { + return vector(0., 0., 1.); + } + else if(countPoints == 1) + { + return vector(0., 0., -1.); + } + else + { + const scalar thetaLevel = (countPoints - 2) / xySplit_; + const scalar theta = deg2rad_ * thetaSize_ * (thetaLevel + 1); + const scalar phi = deg2rad_ * phiSize_ * (countPoints - 2 - thetaLevel * xySplit_); + return vector(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); + } +} + +vector engineSearchIB::getSatellitePoint(int index, int countPoints) const +{ + return particleCloud_.position(index) + + particleCloud_.radius(index) * satellitePoints_[countPoints]; +} + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H index 7faf6785..25ce9c6b 100644 --- a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H +++ b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H @@ -63,6 +63,13 @@ private: const label xySplit_; + const scalar thetaSize_; + const scalar phiSize_; + const scalar deg2rad_; + + const label numberOfSatellitePoints_; + + std::vector satellitePoints_; public: @@ -93,6 +100,17 @@ public: int size ) const; +private: + vector generateSatellitePoint + ( + int countPoints + ) const; + + vector getSatellitePoint + ( + int index, + int countPoints + ) const; }; From c4bb208a6aedfe6634ce3adc232b0f061939ba1c Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 29 Aug 2017 09:26:24 +0200 Subject: [PATCH 92/99] remove unneeded include and clean up whitespaces --- .../engineSearchIB/engineSearchIB.C | 58 +++++++++---------- .../engineSearchIB/engineSearchIB.H | 8 +-- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C index 7450514b..a4b95a3f 100644 --- a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C +++ b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.C @@ -30,14 +30,10 @@ Description \*---------------------------------------------------------------------------*/ #include "error.H" - - #include "engineSearchIB.H" #include "addToRunTimeSelectionTable.H" #include "mathematicalConstants.H" -#include - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -64,16 +60,16 @@ engineSearchIB::engineSearchIB cfdemCloud& sm ) : - engineSearch(dict.subDict(typeName + "Props"),sm), + engineSearch(dict.subDict(typeName + "Props"), sm), propsDict_(dict.subDict(typeName + "Props")), zSplit_(readLabel(propsDict_.lookup("zSplit"))), xySplit_(readLabel(propsDict_.lookup("xySplit"))), thetaSize_(180./zSplit_), phiSize_(360./xySplit_), deg2rad_(constant::mathematical::pi/180.), - numberOfSatellitePoints_((zSplit_-1)*xySplit_ + 2) + numberOfSatellitePoints_((zSplit_-1)*xySplit_+2) { - for(int countPoints = 0; countPoints < numberOfSatellitePoints_; ++countPoints) + for (int countPoints = 0; countPoints < numberOfSatellitePoints_; ++countPoints) { satellitePoints_.push_back(generateSatellitePoint(countPoints)); } @@ -101,69 +97,70 @@ label engineSearchIB::findCell const boundBox& globalBb = particleCloud_.mesh().bounds(); vector position; - for(int index = 0;index < size; ++index) + for (int index = 0; index < size; ++index) { - cellIDs[index][0]=-1; - double radius=particleCloud_.radius(index); - //if(mask[index][0] && radius > SMALL) - if(radius > SMALL) + cellIDs[index][0] = -1; + double radius = particleCloud_.radius(index); + + if (radius > SMALL) { // create pos vector - for(int i=0;i<3;i++) position[i] = positions[index][i]; + for (int i = 0; i < 3; i++) position[i] = positions[index][i]; // find cell label oldID = cellIDs[index][0]; - cellIDs[index][0] = findSingleCell(position,oldID); - //cellIDs[index][0] = particleCloud_.mesh().findCell(position); + cellIDs[index][0] = findSingleCell(position, oldID); - //mod by alice upon from here - if(cellIDs[index][0] < 0) + if (cellIDs[index][0] < 0) { label altStartPos = -1; - for(int countPoints = 0; countPoints < numberOfSatellitePoints_; ++countPoints) + for (int countPoints = 0; countPoints < numberOfSatellitePoints_; ++countPoints) { vector pos = getSatellitePoint(index, countPoints); - altStartPos=findSingleCell(pos,oldID); //particleCloud_.mesh().findCell(pos);// + altStartPos = findSingleCell(pos,oldID); + //check for periodic domains - if(checkPeriodicCells) + if (checkPeriodicCells) { - for(int iDir=0;iDir<3;iDir++) + for (int iDir = 0; iDir < 3; iDir++) { - if( pos[iDir] > globalBb.max()[iDir] ) + if (pos[iDir] > globalBb.max()[iDir]) { - pos[iDir]-=globalBb.max()[iDir]-globalBb.min()[iDir]; + pos[iDir] -= globalBb.max()[iDir] - globalBb.min()[iDir]; } - else if( pos[iDir] < globalBb.min()[iDir] ) + else if (pos[iDir] < globalBb.min()[iDir]) { - pos[iDir]+=globalBb.max()[iDir]-globalBb.min()[iDir]; + pos[iDir] += globalBb.max()[iDir] - globalBb.min()[iDir]; } } - altStartPos=findSingleCell(pos,oldID); //particleCloud_.mesh().findCell(pos);// + + altStartPos = findSingleCell(pos, oldID); } - if(altStartPos >= 0) // found position, we're done + if (altStartPos >= 0) // found position, we're done { cellIDs[index][0] = altStartPos; break; } - } + } } } } + return 1; } vector engineSearchIB::generateSatellitePoint(int countPoints) const { // 1 point at bottom, 1 point at top - if(countPoints == 0) + if (countPoints == 0) { return vector(0., 0., 1.); } - else if(countPoints == 1) + else if (countPoints == 1) { return vector(0., 0., -1.); } @@ -182,7 +179,6 @@ vector engineSearchIB::getSatellitePoint(int index, int countPoints) const + particleCloud_.radius(index) * satellitePoints_[countPoints]; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H index 25ce9c6b..8dbdb4e7 100644 --- a/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H +++ b/src/lagrangian/cfdemParticle/subModels/locateModel/engineSearchIB/engineSearchIB.H @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class noDrag Declaration + Class engineSearchIB Declaration \*---------------------------------------------------------------------------*/ class engineSearchIB @@ -59,10 +59,10 @@ private: dictionary propsDict_; - const label zSplit_; + const label zSplit_; + + const label xySplit_; - const label xySplit_; - const scalar thetaSize_; const scalar phiSize_; const scalar deg2rad_; From 91b84ca607a6b34e35778ae3550e32d7a5a92db3 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 29 Aug 2017 18:33:08 +0200 Subject: [PATCH 93/99] fix calculation of timeStepFraction & voidfraction interpolation merged from PUBLIC --- .../cfdemParticle/cfdemCloud/cfdemCloud.C | 36 ++++++++++++------- .../cfdemParticle/cfdemCloud/cfdemCloud.H | 6 ++++ .../averagingModel/averagingModel.C | 20 ++++------- .../dataExchangeModel/dataExchangeModel.C | 7 +--- .../dataExchangeModel/dataExchangeModel.H | 31 +++++++++------- .../liggghtsCommandModel.C | 16 ++++++--- .../explicitCouple/explicitCouple.C | 24 ++++++------- .../implicitCouple/implicitCouple.C | 22 +++++------- .../voidFractionModel/voidFractionModel.C | 20 +++-------- 9 files changed, 92 insertions(+), 90 deletions(-) diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 79f2a03f..89e2cead 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -81,6 +81,7 @@ cfdemCloud::cfdemCloud solveFlow_(true), verbose_(false), ignore_(false), + allowCFDsubTimestep_(true), limitDEMForces_(false), modelType_(couplingProperties_.lookup("modelType")), positions_(NULL), @@ -251,17 +252,6 @@ cfdemCloud::cfdemCloud else Info << "ignoring ddt(voidfraction)" << endl; - forceModel_ = new autoPtr[nrForceModels()]; - for (int i=0;i[momCoupleModels_.size()]; for (int i=0;i[nrForceModels()]; + for (int i=0;i[liggghtsCommandModelList_.size()]; for (int i=0;i 0 && nPatchesNonCyclic > 0) + + //hard set checkperiodic cells if wished + if(this->couplingProperties().found("checkPeriodicCells")) + { + checkPeriodicCells_ = couplingProperties().lookupOrDefault("checkPeriodicCells", checkPeriodicCells_); + } + + if (nPatchesCyclic > 0 && nPatchesNonCyclic > 0) { if (verbose_) Info << "nPatchesNonCyclic=" << nPatchesNonCyclic << ", nPatchesCyclic=" << nPatchesCyclic << endl; Warning << "Periodic handing is disabled because the domain is not fully periodic!\n" << endl; @@ -612,6 +620,10 @@ bool cfdemCloud::evolve // IMPLICIT FORCE CONTRIBUTION AND SOLVER USE EXACTLY THE SAME AVERAGED // QUANTITIES AT THE GRID! Info << "\n timeStepFraction() = " << dataExchangeM().timeStepFraction() << endl; + if(dataExchangeM().timeStepFraction() > 1.0000001) + { + FatalError << "cfdemCloud::dataExchangeM().timeStepFraction()>1: Do not do this, since dangerous. This might be due to the fact that you used a adjustable CFD time step. Please use a fixed CFD time step." << abort(FatalError); + } clockM().start(24,"interpolateEulerFields"); // update voidFractionField diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index bf014ddf..b17b6381 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -92,6 +92,8 @@ protected: bool ignore_; + bool allowCFDsubTimestep_; + bool limitDEMForces_; scalar maxDEMForce_; @@ -226,6 +228,10 @@ public: // public Member Functions // Access + bool allowCFDsubTimestep() { return allowCFDsubTimestep_; } + + void setAllowCFDsubTimestep(bool b) { allowCFDsubTimestep_ = b; } + void checkCG(bool); void setPos(double **&); diff --git a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C index 1f159643..c8d1cd22 100644 --- a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C +++ b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C @@ -328,20 +328,12 @@ void averagingModel::undoWeightFields(double**const& mask) const tmp averagingModel::UsInterp() const { - if (particleCloud_.dataExchangeM().couplingStep() > 1) - { - return tmp - ( - new volVectorField("Us_averagingModel", (1. - particleCloud_.dataExchangeM().timeStepFraction()) * UsPrev_ + particleCloud_.dataExchangeM().timeStepFraction() * UsNext_) - ); - } - else - { - return tmp - ( - new volVectorField("Us_averagingModel", UsNext_) - ); - } + const scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); + + return tmp + ( + new volVectorField("Us_averagingModel", (1. - tsf) * UsPrev_ + tsf * UsNext_) + ); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C index df0ed4c4..ddee3673 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C @@ -209,12 +209,7 @@ bool dataExchangeModel::couple(int i) const scalar dataExchangeModel::timeStepFraction() const { //return fraction between previous coupling TS and actual TS - //scalar DEMtime = DEMts_ * couplingInterval_; - //scalar frac = ( ( particleCloud_.mesh().time().value()-particleCloud_.mesh().time().startTime().value() ) - (couplingStep_) * DEMtime) / DEMtime; //Chr 05.03.2013 - scalar frac = ( particleCloud_.mesh().time().value()-particleCloud_.mesh().time().startTime().value() - couplingStep_ * couplingTime() ) / couplingTime(); - if (frac < 1e-4) frac = 1.; - - return frac; + return ( particleCloud_.mesh().time().value()-particleCloud_.mesh().time().startTime().value() - (couplingStep_-1) * couplingTime() ) / couplingTime(); } int dataExchangeModel::getNumberOfParticles() const diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H index e6098fb7..e864bfee 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H @@ -198,22 +198,29 @@ public: inline void checkTSsize() const { - if(particleCloud_.mesh().time().deltaT().value() > couplingInterval_ * DEMts_ + SMALL) + if (particleCloud_.mesh().time().deltaT().value() > couplingInterval_ * DEMts_ + SMALL) { Info << "particleCloud_.mesh().time().deltaT().value() = " << particleCloud_.mesh().time().deltaT().value() << endl; Info << "couplingInterval_ = " << couplingInterval_ << endl; Info << "DEMts_ = " << DEMts_ << endl; - FatalError<<"\nError - TS bigger than coupling interval!\n"<< abort(FatalError); + FatalError << "\nError - CFD time-step bigger than coupling time (= DEM time step * coupling interval)!\n" << abort(FatalError); } + if (std::fabs((round(couplingTime()/particleCloud_.mesh().time().deltaT().value())*particleCloud_.mesh().time().deltaT().value())-couplingTime()) > SMALL) + { + Info << "particleCloud_.mesh().time().deltaT().value() = " << particleCloud_.mesh().time().deltaT().value() << endl; + Info << "couplingInterval_ = " << couplingInterval_ << endl; + Info << "DEMts_ = " << DEMts_ << endl; + Warning << "\nWarning - Coupling time (= DEM time step * coupling interval) is not a multiple of CFD time-step!\n" << endl; + } + if (!particleCloud_.allowCFDsubTimestep()) + if (particleCloud_.mesh().time().deltaT().value() < couplingInterval_ * DEMts_ + SMALL) + FatalError << "\nYour models require: CFD time-step = coupling interval (= DEM time step * coupling interval)! \n" << abort(FatalError); + + // warn if sub-TS + if (particleCloud_.mesh().time().deltaT().value() < couplingTime() - SMALL) + Warning << "You are using sub-time-steps (i.e. CFD TS < coupling time)! Check your settings properly." << endl; } - /*inline bool checkExactTiming() const - { - return false; - }*/ - - //void checkNClumpTypes() const {}; - inline void readDEMtsfromDict(dictionary& propsDict) { DEMts_ = readScalar(propsDict.lookup("DEMts")); @@ -222,10 +229,8 @@ public: inline bool doCoupleNow() const { - if (particleCloud_.mesh().time().value()-particleCloud_.mesh().time().startTime().value() - - ((1+couplingStep_)*(DEMts_*couplingInterval_)) - + 1e-10 > 0) // Chr 27.03.2013 : first coupling after DEMts_*couplingInterval_ -// > particleCloud_.mesh().time().deltaT().value()/2) // Chr 27.03.2013 + if (particleCloud_.mesh().time().value()-particleCloud_.mesh().time().startTime().value()-SMALL + > couplingStep_*DEMts_*couplingInterval_) { return true; } diff --git a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C index 7c142ded..9b6ef7f4 100644 --- a/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C +++ b/src/lagrangian/cfdemParticle/subModels/liggghtsCommandModel/liggghtsCommandModel/liggghtsCommandModel.C @@ -104,6 +104,13 @@ void liggghtsCommandModel::checkTimeMode(dictionary& propsDict) } } } + + if(verbose_){ + Info << "runFirst = " << runFirst_ << endl; + Info << "runLast = " << runLast_ << endl; + Info << "runEveryCouplingStep = " << runEveryCouplingStep_ << endl; + Info << "runEveryWriteStep = " << runEveryWriteStep_ << endl; + } } void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict) @@ -112,11 +119,12 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict) { scalar DEMts = particleCloud_.dataExchangeM().DEMts(); scalar couplingInterval = particleCloud_.dataExchangeM().couplingInterval(); + scalar simStartTime = particleCloud_.mesh().time().startTime().value(); if(runLast_) // last run { // read time options from subdict - endTime_ = particleCloud_.mesh().time().endTime().value()-particleCloud_.mesh().time().startTime().value(); + endTime_ = particleCloud_.mesh().time().endTime().value()-simStartTime; startTime_ = endTime_; timeInterval_ = -1; @@ -136,9 +144,9 @@ void liggghtsCommandModel::checkTimeSettings(const dictionary& propsDict) // calculate coupling times // if this makes troubles try floor((startTime_+SMALL)/.. as above - firstCouplingStep_ = floor(startTime_/DEMts/couplingInterval)+1; - lastCouplingStep_ = floor(endTime_/DEMts/couplingInterval)+1; - couplingStepInterval_ = floor(timeInterval_/DEMts/couplingInterval)+1; + firstCouplingStep_ = floor((startTime_+SMALL-simStartTime)/DEMts/couplingInterval); + lastCouplingStep_ = floor((endTime_+SMALL-simStartTime)/DEMts/couplingInterval); + couplingStepInterval_ = floor(timeInterval_+SMALL/DEMts/couplingInterval); } else //runEveryCouplingStep or writeStep { diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C index 190b6c85..46e99223 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/explicitCouple/explicitCouple.C @@ -108,9 +108,13 @@ explicitCouple::~explicitCouple() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // tmp explicitCouple::expMomSource() const { - scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); + const scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); - if (1. - tsf < 1e-4) //tsf==1 + // calc Ksl + + // update KslNext in first subTS + // NOTE: without following if we could update f every subTS (based on current values) and use this value + if(tsf < particleCloud_.mesh().time().deltaT().value()/particleCloud_.dataExchangeM().couplingTime() + 0.000001 ) { // calc fNext forAll(fNext_,cellI) @@ -124,18 +128,12 @@ tmp explicitCouple::expMomSource() const if (magF > fLimit_[i]) fNext_[cellI][i] *= fLimit_[i]/magF; } } - return tmp - ( - new volVectorField("f_explicitCouple", fPrev_) - ); - } - else - { - return tmp - ( - new volVectorField("f_explicitCouple", (1. - tsf) * fPrev_ + tsf * fNext_) - ); } + + return tmp + ( + new volVectorField("f_explicitCouple", (1. - tsf) * fPrev_ + tsf * fNext_) + ); } void explicitCouple::resetMomSourceField() const diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C index 124b7e9b..74f89f83 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C @@ -122,11 +122,13 @@ implicitCouple::~implicitCouple() tmp implicitCouple::impMomSource() const { - scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); + const scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); // calc Ksl - if (1. - tsf < 1e-4) //tsf==1 + // update KslNext in first subTS + // NOTE: without following if we could update Ksl every subTS (based on current values) and use this value + if(tsf < particleCloud_.mesh().time().deltaT().value()/particleCloud_.dataExchangeM().couplingTime() + 0.000001 ) { scalar Ur; @@ -145,18 +147,12 @@ tmp implicitCouple::impMomSource() const // limiter if (KslNext_[cellI] > KslLimit_) KslNext_[cellI] = KslLimit_; } - return tmp - ( - new volScalarField("Ksl_implicitCouple", KslPrev_) - ); - } - else - { - return tmp - ( - new volScalarField("Ksl_implicitCouple", (1. - tsf) * KslPrev_ + tsf * KslNext_) - ); } + + return tmp + ( + new volScalarField("Ksl_implicitCouple", (1. - tsf) * KslPrev_ + tsf * KslNext_) + ); } void implicitCouple::resetMomSourceField() const diff --git a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C index 38cb8cdd..3368fc7a 100644 --- a/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C +++ b/src/lagrangian/cfdemParticle/subModels/voidFractionModel/voidFractionModel/voidFractionModel.C @@ -102,22 +102,12 @@ voidFractionModel::~voidFractionModel() // * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * // tmp voidFractionModel::voidFractionInterp() const { - scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); + const scalar tsf = particleCloud_.dataExchangeM().timeStepFraction(); - if (1. - tsf < 1e-4 && particleCloud_.dataExchangeM().couplingStep() > 1) //tsf==1 - { - return tmp - ( - new volScalarField("alpha_voidFractionModel", voidfractionPrev_) - ); - } - else - { - return tmp - ( - new volScalarField("alpha_voidFractionModel", (1. - tsf) * voidfractionPrev_ + tsf * voidfractionNext_) - ); - } + return tmp + ( + new volScalarField("alpha_voidFractionModel", (1. - tsf) * voidfractionPrev_ + tsf * voidfractionNext_) + ); } void voidFractionModel::resetVoidFractions() const From d1c8707c3e1e6261064320f9780135cae73a057f Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 30 Aug 2017 13:18:31 +0200 Subject: [PATCH 94/99] fix issue with voidfraction slightly > 1 in SyamlalThermCond --- .../thermCondModel/SyamlalThermCond/SyamlalThermCond.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C b/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C index 7a08b85b..0e2b7e9d 100644 --- a/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C +++ b/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C @@ -104,9 +104,9 @@ tmp SyamlalThermCond::thermCond() const ) ); volScalarField& svf = tvf.ref(); - - svf = (1-sqrt(1-voidfraction_)) / (voidfraction_) * kf0_; - + + svf = (1-sqrt(1-voidfraction_+SMALL)) / (voidfraction_) * kf0_; + // if a wallQFactor field is present, use it to scale heat transport through a patch if (hasWallQFactor_) { From 652e7b3f747bb1d5c974aef055402211b73c3a70 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 31 Aug 2017 09:56:50 +0200 Subject: [PATCH 95/99] clean up whitespaces --- .../thermCondModel/SyamlalThermCond/SyamlalThermCond.C | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C b/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C index 0e2b7e9d..c0d450d2 100644 --- a/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C +++ b/src/lagrangian/cfdemParticle/subModels/thermCondModel/SyamlalThermCond/SyamlalThermCond.C @@ -71,7 +71,7 @@ SyamlalThermCond::SyamlalThermCond { if (wallQFactor_.headerOk()) { - Info << "Found field for scaling wall heat flux.\n" << endl; + Info << "Found field for scaling wall heat flux.\n" << endl; hasWallQFactor_ = true; } } @@ -100,9 +100,10 @@ tmp SyamlalThermCond::thermCond() const IOobject::NO_WRITE ), voidfraction_.mesh(), - dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0) + dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0) ) ); + volScalarField& svf = tvf.ref(); svf = (1-sqrt(1-voidfraction_+SMALL)) / (voidfraction_) * kf0_; @@ -114,7 +115,7 @@ tmp SyamlalThermCond::thermCond() const forAll(wallQFactor_.boundaryField(), patchi) svf.boundaryFieldRef()[patchi] *= wallQFactor_.boundaryField()[patchi]; } - + return tvf; } From 006d9c7cd2b9f17056734f5f93ef54164cad738f Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 31 Aug 2017 09:57:12 +0200 Subject: [PATCH 96/99] add comment --- .../subModels/momCoupleModel/implicitCouple/implicitCouple.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C index 74f89f83..fae64de7 100644 --- a/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C +++ b/src/lagrangian/cfdemParticle/subModels/momCoupleModel/implicitCouple/implicitCouple.C @@ -138,6 +138,8 @@ tmp implicitCouple::impMomSource() const if (Ur > SMALL && alpha_[cellI] < maxAlpha_) //momentum exchange switched off if alpha too big { + // NOTE: impParticleForces() are calculated at coupling step based on current values + // therefore the use of Next fields in forceM and here is recommended KslNext_[cellI] = mag(particleCloud_.forceM(0).impParticleForces()[cellI]) / Ur / particleCloud_.mesh().V()[cellI]; From c7ee75839bffc2bb6aa564844e4ddf0183a50088 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 31 Aug 2017 10:05:19 +0200 Subject: [PATCH 97/99] clean up LIGGGHTS scripts --- .../fillCylinder/DEM/in.liggghts_init | 77 ++++++++-------- .../DEM/in.liggghts_run | 9 +- .../ErgunTestCG/DEM/in.liggghts_init | 74 +++++++-------- .../ErgunTestCG/DEM/in.liggghts_run | 71 ++++++++------- .../ErgunTestMPI/DEM/in.liggghts_init | 6 +- .../ErgunTestMPI/DEM/in.liggghts_run | 10 +-- .../ErgunTestMPI_cgs/DEM/in.liggghts_init | 6 +- .../ErgunTestMPI_cgs/DEM/in.liggghts_run | 6 +- .../ErgunTestMPI_restart/DEM/in.liggghts_init | 10 +-- .../DEM/in.liggghts_restart | 6 +- .../ErgunTestMPI_restart/DEM/in.liggghts_run | 6 +- .../settlingTestMPI/DEM/in.liggghts_run | 4 +- .../packedBedTemp/DEM/in.liggghts_init | 6 +- .../packedBedTemp/DEM/in.liggghts_run | 2 +- .../ErgunTestMPI/DEM/in.liggghts_init | 6 +- .../ErgunTestMPI/DEM/in.liggghts_run | 8 +- .../FinesColumn/DEM/in.liggghts_init | 82 ++++++++--------- .../FinesColumn/DEM/in.liggghts_resume | 89 +++++++++---------- 18 files changed, 237 insertions(+), 241 deletions(-) diff --git a/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init b/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init index 164b5eb6..03618065 100644 --- a/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init +++ b/tutorials/cfdemPostproc/fillCylinder/DEM/in.liggghts_init @@ -1,65 +1,64 @@ -# Pour granular particles into chute container, then induce flow -echo both -atom_style granular -atom_modify map array -communicate single vel yes +# Fill granular particles into a cylinder +echo both +atom_style granular +atom_modify map array +communicate single vel yes -boundary m m m -newton off +boundary m m m +newton off -units si +units si -region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box -create_box 1 reg +region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box +create_box 1 reg -neighbor 0.001 bin -neigh_modify delay 0 +neighbor 0.001 bin +neigh_modify delay 0 -#Material properties required for new pair styles +#material properties required for granular pair styles -fix m1 all property/global youngsModulus peratomtype 5.e6 -fix m2 all property/global poissonsRatio peratomtype 0.45 -fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 -fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 +fix m1 all property/global youngsModulus peratomtype 5.e6 +fix m2 all property/global poissonsRatio peratomtype 0.45 +fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 +fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 #pair style -pair_style gran model hertz tangential history -pair_coeff * * +pair_style gran model hertz tangential history +pair_coeff * * #timestep, gravity -timestep 0.00001 -fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 +timestep 0.00001 +fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 #walls -fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 -fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 -fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.0138 0. 0. +fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 +fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 +fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.0138 0. 0. #cfd coupling -#fix cfd all couple/cfd +#fix cfd all couple/cfd #particle insertion -region bc cylinder z 0.0 0.0 0.012 0.02 0.03 units box -fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 200 radius constant 0.001 -fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0 +region bc cylinder z 0.0 0.0 0.012 0.02 0.03 units box +fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 200 radius constant 0.001 +fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0 -fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -1. insert_every once overlapcheck yes all_in yes particles_in_region 1000 region bc +fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -1. insert_every once overlapcheck yes all_in yes particles_in_region 1000 region bc #apply nve integration to all particles that are inserted as single particles -fix integr all nve/sphere +fix integr all nve/sphere #screen output -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol -thermo 1000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic yes +compute rke all erotate/sphere +thermo_style custom step atoms ke c_rke vol +thermo 1000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic yes #insert the first particles so that dump is not empty -run 1 -dump dmp all custom 1000 post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +run 1 +dump dmp all custom 1000 post/dump.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius -run 3000 upto -#write_restart liggghts.restart +run 3000 upto diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/in.liggghts_run b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/in.liggghts_run index c74a4952..f33dc33b 100644 --- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/DEM/in.liggghts_run @@ -19,8 +19,7 @@ neighbor 0.3 bin neigh_modify delay 0 binsize 0.01 -# Material properties required for new pair styles - +# Material properties required for granular pair styles fix m1 all property/global youngsModulus peratomtype 5.e7 fix m2 all property/global poissonsRatio peratomtype 0.45 fix m3 all property/global coefficientRestitution peratomtypepair 1 0.9 @@ -49,8 +48,8 @@ fix cfd2 all couple/cfd/force # create single partciles -create_atoms 1 single .5 .5 3.5 units box -create_atoms 1 single .5 .5 3.16 units box +create_atoms 1 single 0.5 0.5 3.5 units box +create_atoms 1 single 0.5 0.5 3.16 units box set atom 1 diameter 0.167 density 1.5 vx 0 vy 0 vz 0 set atom 2 diameter 0.167 density 1.5 vx 0 vy 0 vz 0 @@ -85,7 +84,7 @@ thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes # insert the first particles so that dump is not empty -dump dmp all custom 100 ../DEM/post/dump.liggghts_run id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +dump dmp all custom 100 ../DEM/post/dump.liggghts_run id type x y z vx vy vz fx fy fz omegax omegay omegaz radius #force : f_couple_cfd[0] f_couple_cfd[1] f_couple_cfd[2] #node : f_couple_cfd[6] diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_init b/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_init index 1df12c38..f98e5c8b 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_init +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_init @@ -13,67 +13,67 @@ variable nPorg equal 71000 variable nPscal equal ${nPorg}/(${cg}*${cg}*${cg}) ####################################################### -atom_style granular -atom_modify map array -communicate single vel yes -coarsegraining ${cg} +atom_style granular +atom_modify map array +communicate single vel yes +coarsegraining ${cg} -boundary m m m -newton off +boundary m m m +newton off -units si -processors 2 2 1 +units si +processors 2 2 1 -region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box -create_box 1 reg +region reg block -0.015 0.015 -0.015 0.015 -0.001 0.0554 units box +create_box 1 reg -neighbor 0.001 bin -neigh_modify delay 0 +neighbor 0.001 bin +neigh_modify delay 0 -#Material properties required for new pair styles +#Material properties required for granular pair styles -fix m1 all property/global youngsModulus peratomtype 5.e6 -fix m2 all property/global poissonsRatio peratomtype 0.45 -fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 -fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 +fix m1 all property/global youngsModulus peratomtype 5.e6 +fix m2 all property/global poissonsRatio peratomtype 0.45 +fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 +fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 #pair style -pair_style gran model hertz tangential history #Hertzian without cohesion -pair_coeff * * +pair_style gran model hertz tangential history +pair_coeff * * #timestep, gravity -timestep 0.00001 -fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 +timestep 0.00001 +fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 #walls -fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 -fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 +fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 +fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0. #particle distributions and insertion -region bc cylinder z 0.0 0.0 0.012 0. 0.055 units box -fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 7000 radius constant ${r0} -fix pdd1 all particledistribution/discrete 1. 1 pts1 1.0 +region bc cylinder z 0.0 0.0 0.012 0. 0.055 units box +fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 7000 radius constant ${r0} +fix pdd1 all particledistribution/discrete 1 1 pts1 1.0 -fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -1. insert_every once overlapcheck yes all_in yes particles_in_region ${nPscal} region bc +fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0. 0. -1. insert_every once overlapcheck yes all_in yes particles_in_region ${nPscal} region bc #apply nve integration to all particles that are inserted as single particles -fix integr all nve/sphere +fix integr all nve/sphere #screen output -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol -thermo 1000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic yes +compute rke all erotate/sphere +thermo_style custom step atoms ke c_rke vol +thermo 1000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic yes #insert the first particles so that dump is not empty -run 1 -dump dmp all custom 5000 post/dump.liggghts_init id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +run 1 +dump dmp all custom 5000 post/dump.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius #force : f_couple_cfd[0] f_couple_cfd[1] f_couple_cfd[2] #node : f_couple_cfd[6] #cell id : f_couple_cfd[7] -run 10000 upto -write_restart ./post/restart/liggghts.restart_coarseGraining_${cg} +run 10000 upto +write_restart ./post/restart/liggghts.restart_coarseGraining_${cg} diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_run index 01daac34..1e8273e9 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/DEM/in.liggghts_run @@ -14,70 +14,69 @@ variable nPorg equal 71000 variable nPscal equal ${nPorg}/(${cg}*${cg}*${cg}) ####################################################### -atom_style granular -atom_modify map array -communicate single vel yes -coarsegraining ${cg} +atom_style granular +atom_modify map array +communicate single vel yes +coarsegraining ${cg} -boundary m m m -newton off +boundary m m m +newton off -units si -processors 2 2 1 +units si +processors 2 2 1 #read the restart file -read_restart ../DEM/post/restart/liggghts.restart_coarseGraining_${cg} +read_restart ../DEM/post/restart/liggghts.restart_coarseGraining_${cg} #_coarseGraining_${cg} -neighbor 0.001 bin -neigh_modify delay 0 +neighbor 0.001 bin +neigh_modify delay 0 -#Material properties required for new pair styles +#Material properties required for granular pair styles -fix m1 all property/global youngsModulus peratomtype 5.e6 -fix m2 all property/global poissonsRatio peratomtype 0.45 -fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 -fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 +fix m1 all property/global youngsModulus peratomtype 5.e6 +fix m2 all property/global poissonsRatio peratomtype 0.45 +fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 +fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 #pair style -pair_style gran model hertz tangential history #Hertzian without cohesion -pair_coeff * * +pair_style gran model hertz tangential history #Hertzian without cohesion +pair_coeff * * #timestep, gravity -timestep 0.00001 -fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 +timestep 0.00001 +fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 #walls -fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 -fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 +fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 +fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0. #cfd coupling -fix cfd all couple/cfd couple_every 100 mpi -fix cfd2 all couple/cfd/force #/implicit +fix cfd all couple/cfd couple_every 100 mpi +fix cfd2 all couple/cfd/force #/implicit #apply nve integration to all particles that are inserted as single particles -fix integr all nve/sphere +fix integr all nve/sphere #center of mass compute centerOfMass all com #compute total dragforce -#compute dragtotal all reduce sum f_dragforce[1] f_dragforce[2] f_dragforce[3] +#compute dragtotal all reduce sum f_dragforce[1] f_dragforce[2] f_dragforce[3] #screen output -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol c_centerOfMass[3] #c_dragtotal[1] c_dragtotal[2] c_dragtotal[3] -thermo 10 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic yes +compute rke all erotate/sphere +thermo_style custom step atoms ke c_rke vol c_centerOfMass[3] #c_dragtotal[1] c_dragtotal[2] c_dragtotal[3] +thermo 10 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic yes #insert the first particles so that dump is not empty -dump myDump all stl 1 post/dump_*.stl -#run 1 -dump dmp all custom 1000 ../DEM/post/dump*.liggghts_restart id type type x y z vx vy vz fx fy fz radius #f_dragforce[1] f_dragforce[2] f_dragforce[3] -undump myDump +dump myDump all stl 1 post/dump_*.stl +dump dmp all custom 1000 ../DEM/post/dump*.liggghts_restart id type x y z vx vy vz fx fy fz radius +undump myDump -run 1 +run 1 diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init index 363df49c..c96f814f 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_init @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow echo both atom_style granular atom_modify map array @@ -24,7 +24,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -55,7 +55,7 @@ compute_modify thermo_temp dynamic yes # insert the first particles so that dump is not empty run 1 -dump dmp all custom 5000 post/dump.liggghts_init id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +dump dmp all custom 5000 post/dump.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius #force : f_couple_cfd[0] f_couple_cfd[1] f_couple_cfd[2] #node : f_couple_cfd[6] #cell id : f_couple_cfd[7] diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_run index 2d498630..1d1306d0 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/DEM/in.liggghts_run @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow log ../DEM/log.liggghts thermo_log ../DEM/post/thermo.txt @@ -26,7 +26,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -34,8 +34,8 @@ timestep 0.00001 fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 # walls -fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 -fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 +fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 +fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0. # change the particles density @@ -63,6 +63,6 @@ thermo 10 thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes -dump dmp all custom 5000 ../DEM/post/dump*.liggghts_run id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius +dump dmp all custom 5000 ../DEM/post/dump*.liggghts_run id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius run 1 diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init index dbb6f114..9bdba7f9 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_init @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow echo both atom_style granular atom_modify map array @@ -24,7 +24,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -55,7 +55,7 @@ compute_modify thermo_temp dynamic yes # insert the first particles so that dump is not empty run 1 -dump dmp all custom 5000 post/dump.liggghts_init id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +dump dmp all custom 5000 post/dump.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius #force : f_couple_cfd[0] f_couple_cfd[1] f_couple_cfd[2] #node : f_couple_cfd[6] #cell id : f_couple_cfd[7] diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_run index 1eeccc1c..747257d0 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/DEM/in.liggghts_run @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow log ../DEM/log.liggghts thermo_log ../DEM/post/thermo.txt @@ -26,7 +26,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -61,6 +61,6 @@ thermo 10 thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes -dump dmp all custom 5000 ../DEM/post/dump*.liggghts_run id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius +dump dmp all custom 5000 ../DEM/post/dump*.liggghts_run id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius run 1 diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init index 5f28012f..25b5ad11 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_init @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow echo both atom_style granular atom_modify map array @@ -24,7 +24,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -32,8 +32,8 @@ timestep 0.00001 fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 # walls -fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 -fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 +fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0.0 +fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.0553 fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder 0.01385 0. 0. # particle distributions and insertion @@ -55,7 +55,7 @@ compute_modify thermo_temp dynamic yes # insert the first particles so that dump is not empty run 1 -dump dmp all custom 5000 post/dump.liggghts_init id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +dump dmp all custom 5000 post/dump.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius #force : f_couple_cfd[0] f_couple_cfd[1] f_couple_cfd[2] #node : f_couple_cfd[6] #cell id : f_couple_cfd[7] diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart index 251ce3e7..89de5c67 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_restart @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow log ../DEM/log.liggghts thermo_log ../DEM/post/thermo.txt @@ -26,7 +26,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -60,6 +60,6 @@ thermo 10 thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes -dump dmp all custom 5000 ../DEM/post/dump*.liggghts_restart id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius +dump dmp all custom 5000 ../DEM/post/dump*.liggghts_restart id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius run 1 diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_run index 1a1d48ce..d0e45708 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/DEM/in.liggghts_run @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow log ../DEM/log.liggghts thermo_log ../DEM/post/thermo.txt @@ -26,7 +26,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -60,6 +60,6 @@ thermo 10 thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes -dump dmp all custom 5000 ../DEM/post/dump*.liggghts_restart id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius +dump dmp all custom 5000 ../DEM/post/dump*.liggghts_restart id type x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] radius run 1 diff --git a/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/in.liggghts_run b/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/in.liggghts_run index e0d3326b..1903158e 100644 --- a/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverPiso/settlingTestMPI/DEM/in.liggghts_run @@ -27,7 +27,7 @@ fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 #fix m5 all property/global characteristicVelocity scalar 2.0 # pair style -pair_style gran model hertz tangential history # hertz without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -68,6 +68,6 @@ compute_modify thermo_temp dynamic yes # insert the first particles so that dump is not empty run 1 -dump dmp all custom 1000 ../DEM/post/dump.liggghts_run id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +dump dmp all custom 1000 ../DEM/post/dump.liggghts_run id type x y z vx vy vz fx fy fz omegax omegay omegaz radius run 1 upto diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init index f739d162..f40681ff 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_init @@ -1,4 +1,4 @@ -# Particle packing by insertion and successive growing of particles +# heattransfer in packed bed atom_style granular atom_modify map array @@ -26,7 +26,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history #Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * timestep 0.00001 @@ -65,7 +65,7 @@ compute_modify thermo_temp dynamic yes #insert the first particles run 1 -dump dmp all custom 1000 post/dump.liggghts_init id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius f_heattransfer[0] f_heatFlux[0] +dump dmp all custom 1000 post/dump.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius f_heattransfer[0] f_heatFlux[0] run 150000 diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_run b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_run index 7350ff11..9eb8fcbc 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/DEM/in.liggghts_run @@ -70,6 +70,6 @@ thermo 1000 thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes -dump dmp all custom 100 ../DEM/post/dump.liggghts_run id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius f_Temp[0] f_heatFlux[0] +dump dmp all custom 100 ../DEM/post/dump.liggghts_run id type x y z vx vy vz fx fy fz omegax omegay omegaz radius f_Temp[0] f_heatFlux[0] run 1 diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_init b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_init index 363df49c..c96f814f 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_init +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_init @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow echo both atom_style granular atom_modify map array @@ -24,7 +24,7 @@ fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # pair style -pair_style gran model hertz tangential history # Hertzian without cohesion +pair_style gran model hertz tangential history pair_coeff * * # timestep, gravity @@ -55,7 +55,7 @@ compute_modify thermo_temp dynamic yes # insert the first particles so that dump is not empty run 1 -dump dmp all custom 5000 post/dump.liggghts_init id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius +dump dmp all custom 5000 post/dump.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius #force : f_couple_cfd[0] f_couple_cfd[1] f_couple_cfd[2] #node : f_couple_cfd[6] #cell id : f_couple_cfd[7] diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_run b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_run index 77943bd6..65262c53 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_run +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/DEM/in.liggghts_run @@ -1,4 +1,4 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow log ../DEM/log.liggghts thermo_log ../DEM/post/thermo.txt @@ -40,7 +40,7 @@ fix cylwalls all wall/gran model hertz tangential history primitive type # heat transfer fix ftco all property/global thermalConductivity peratomtype 1. # lambda in [W/(K*m)] -fix ftca all property/global thermalCapacity peratomtype 1000. # cp in [J/(kg*K)] +fix ftca all property/global thermalCapacity peratomtype 1000. # cp in [J/(kg*K)] fix heattransfer all heat/gran initial_temperature 300. # set particle temperature for the bed @@ -54,7 +54,7 @@ set group all density 2000 # cfd coupling fix cfd all couple/cfd couple_every 25 mpi fix cfd2 all couple/cfd/force/implicit -fix cfd3 all couple/cfd/convection T0 300 +fix cfd3 all couple/cfd/convection T0 300 # apply nve integration to all particles that are inserted as single particles fix integr all nve/sphere @@ -72,6 +72,6 @@ thermo 10 thermo_modify lost ignore norm no compute_modify thermo_temp dynamic yes -dump dmp all custom/vtk 10000 ../DEM/post/dump*.liggghts_run.vtk id type radius x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] f_Temp[0] +dump dmp all custom/vtk 10000 ../DEM/post/dump*.liggghts_run.vtk id type radius x y z vx vy vz fx fy fz f_dragforce[1] f_dragforce[2] f_dragforce[3] f_Temp[0] run 1 diff --git a/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_init b/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_init index 9a96a2a4..e58ceab5 100755 --- a/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_init +++ b/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_init @@ -1,19 +1,19 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow ############################################### #variables # DEM-parameters -variable partDens equal 1732 # density -variable partRad equal 0.00184 # particle radius +variable partDens equal 1732 # density +variable partRad equal 0.00184 # particle radius variable partVol equal 4*3.14/3*${partRad}^3 -variable yM equal 5.e6 # Young's modulus -variable pR equal 0.25 # Poisson ratio -variable rest equal 0.66 # coefficient of restitution -variable fric equal 0.95 # coefficient of friction -variable roll equal 0.15 # for particles and walls with friction -variable noRoll equal 0 # for frictionless walls -variable cV equal 0.1 # characteristic velocity +variable yM equal 5.e6 # Young's modulus +variable pR equal 0.25 # Poisson ratio +variable rest equal 0.66 # coefficient of restitution +variable fric equal 0.95 # coefficient of friction +variable roll equal 0.15 # for particles and walls with friction +variable noRoll equal 0 # for frictionless walls +variable cV equal 0.1 # characteristic velocity # Geometry variable cylrad equal 0.05 @@ -22,7 +22,7 @@ variable fillV equal ${fillH}*${cylrad}^2*3.14 variable nPart equal ceil(${fillV}*0.7/${partVol}) #variable nPart equal 1 -#variable partDens equal 1.13 # density +#variable partDens equal 1.13 # density variable dt equal 0.00005 variable skin equal 0.005 @@ -33,39 +33,39 @@ variable skin equal 0.005 variable vthre equal 0.0005 ############################################### -atom_style granular -atom_modify map array -communicate single vel yes +atom_style granular +atom_modify map array +communicate single vel yes -boundary f f f -newton off -units si +boundary f f f +newton off +units si processors 1 1 4 -region reg block -${cylrad} ${cylrad} -${cylrad} ${cylrad} 0.0 0.9 units box -create_box 1 reg +region reg block -${cylrad} ${cylrad} -${cylrad} ${cylrad} 0.0 0.9 units box +create_box 1 reg -neighbor 0.001 bin -neigh_modify delay 0 +neighbor 0.001 bin +neigh_modify delay 0 -#Material properties required for new pair styles +#Material properties required for granular pair styles -fix m1 all property/global youngsModulus peratomtype ${yM} -fix m2 all property/global poissonsRatio peratomtype ${pR} -fix m3 all property/global coefficientRestitution peratomtypepair 1 ${rest} -fix m4 all property/global coefficientFriction peratomtypepair 1 ${fric} +fix m1 all property/global youngsModulus peratomtype ${yM} +fix m2 all property/global poissonsRatio peratomtype ${pR} +fix m3 all property/global coefficientRestitution peratomtypepair 1 ${rest} +fix m4 all property/global coefficientFriction peratomtypepair 1 ${fric} fix m5 all property/global coefficientRollingFriction peratomtypepair 1 ${roll} fix m6 all property/global characteristicVelocity scalar ${cV} #pair style -pair_style gran model hertz tangential history rolling_friction cdt +pair_style gran model hertz tangential history rolling_friction cdt pair_coeff * * #timestep, gravity timestep ${dt} fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 -fix zwall all wall/gran model hertz tangential history primitive type 1 zplane 0.0 +fix zwall all wall/gran model hertz tangential history primitive type 1 zplane 0.0 fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder ${cylrad} 0. 0. fix pts1 all particletemplate/sphere 1 atom_type 1 density constant ${partDens} radius constant ${partRad} @@ -73,20 +73,20 @@ fix pdd1 all particledistribution/discrete 1.0 1 pts1 1.0 region insReg cylinder z 0. 0. ${cylrad} 0.5 0.9 units box -fix ins all insert/rate/region seed 1001 distributiontemplate pdd1 nparticles ${nPart} particlerate 10000 insert_every 1000 vel constant 0. 0. -0.1 overlapcheck yes all_in yes region insReg ntry_mc 10000 +fix ins all insert/rate/region seed 1001 distributiontemplate pdd1 nparticles ${nPart} particlerate 10000 insert_every 1000 vel constant 0. 0. -0.1 overlapcheck yes all_in yes region insReg ntry_mc 10000 -#fix loadBalancing all balance 10000 z 10 1.05 +#fix loadBalancing all balance 10000 z 10 1.05 -fix integr all nve/sphere +fix integr all nve/sphere -fix ts_check all check/timestep/gran 10000 0.1 0.1 +fix ts_check all check/timestep/gran 10000 0.1 0.1 #screen output -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol -thermo 10000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic yes +compute rke all erotate/sphere +thermo_style custom step atoms ke c_rke vol +thermo 10000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic yes #====================================================================== #- settling @@ -98,14 +98,14 @@ variable vcmz equal vcm(all,z) variable vave equal sqrt(v_vcmx*v_vcmx+v_vcmy*v_vcmy+v_vcmz*v_vcmz) print ${vave} -dump dmp1 all custom/vtk 20000 ../DEM/post/dump*.liggghts_filling.vtk id type type x y z vx vy vz fx fy fz radius +dump dmp1 all custom/vtk 20000 ../DEM/post/dump*.liggghts_filling.vtk id type x y z vx vy vz fx fy fz radius run 200000 label loop print "-----> Checking Velocity..." if "${vave}<${vthre}" then "jump in.liggghts_init endloop" - print "-----> v ave ${vave}, v threshold ${vthre}, continuing run" + print "-----> v ave ${vave}, v threshold ${vthre}, continuing run" run 10000 jump in.liggghts_init loop @@ -117,7 +117,7 @@ label endloop region delReg block -${cylrad} ${cylrad} -${cylrad} ${cylrad} ${fillH} INF units box run 1 every 1 "delete_atoms region delReg" -#write_restart liggghts.restart.prelim +#write_restart liggghts.restart.prelim run 10000 -write_restart liggghts.restart_${partRad} +write_restart liggghts.restart_${partRad} print "everything done" diff --git a/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_resume b/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_resume index 702124ed..1508cda5 100755 --- a/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_resume +++ b/tutorials/cfdemSolverRhoPimple/FinesColumn/DEM/in.liggghts_resume @@ -1,18 +1,18 @@ -# Pour granular particles into chute container, then induce flow +# Pour granular particles into a cylinder, then induce flow #variables # DEM-parameters -variable partDens equal 1732 # density -variable partRad equal 0.00184 # particle radius +variable partDens equal 1732 # density +variable partRad equal 0.00184 # particle radius variable partVol equal 4*3.14/3*${partRad}^3 -variable yM equal 5.e6 # Young's modulus -variable pR equal 0.25 # Poisson ratio -variable rest equal 0.66 # coefficient of restitution -variable fric equal 0.95 # coefficient of friction -variable roll equal 0.15 # for particles and walls with friction -variable noRoll equal 0 # for frictionless walls -variable cV equal 0.1 # characteristic velocity +variable yM equal 5.e6 # Young's modulus +variable pR equal 0.25 # Poisson ratio +variable rest equal 0.66 # coefficient of restitution +variable fric equal 0.95 # coefficient of friction +variable roll equal 0.15 # for particles and walls with friction +variable noRoll equal 0 # for frictionless walls +variable cV equal 0.1 # characteristic velocity variable Tpart equal 293 # Geometry @@ -24,73 +24,72 @@ variable skin equal 0.005 -atom_style granular -atom_modify map array -communicate single vel yes +atom_style granular +atom_modify map array +communicate single vel yes -boundary f f f -newton off -units si +boundary f f f +newton off +units si processors 1 1 4 -read_restart ../DEM/liggghts.restart_${partRad} -reset_timestep 0 +read_restart ../DEM/liggghts.restart_${partRad} +reset_timestep 0 -neighbor 0.01 bin -neigh_modify delay 0 +neighbor 0.01 bin +neigh_modify delay 0 -#Material properties required for new pair styles -fix m1 all property/global youngsModulus peratomtype ${yM} -fix m2 all property/global poissonsRatio peratomtype ${pR} -fix m3 all property/global coefficientRestitution peratomtypepair 1 ${rest} -fix m4 all property/global coefficientFriction peratomtypepair 1 ${fric} +#Material properties required for granular pair styles +fix m1 all property/global youngsModulus peratomtype ${yM} +fix m2 all property/global poissonsRatio peratomtype ${pR} +fix m3 all property/global coefficientRestitution peratomtypepair 1 ${rest} +fix m4 all property/global coefficientFriction peratomtypepair 1 ${fric} fix m5 all property/global coefficientRollingFriction peratomtypepair 1 ${roll} fix m6 all property/global characteristicVelocity scalar ${cV} -fix ftco all property/global thermalConductivity peratomtype 1.4 -fix ftca all property/global thermalCapacity peratomtype 840. -fix heattransfer all heat/gran initial_temperature 293. +fix ftco all property/global thermalConductivity peratomtype 1.4 +fix ftca all property/global thermalCapacity peratomtype 840. +fix heattransfer all heat/gran initial_temperature 293. #pair style -pair_style gran model hertz tangential history rolling_friction cdt -pair_coeff * * +pair_style gran model hertz tangential history rolling_friction cdt +pair_coeff * * #timestep, gravity -timestep ${dt} +timestep ${dt} fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 -fix zwall all wall/gran model hertz tangential history primitive type 1 zplane 0.0 +fix zwall all wall/gran model hertz tangential history primitive type 1 zplane 0.0 fix zwall_top all wall/gran model hertz tangential history primitive type 1 zplane 0.54 -fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder ${cylrad} 0. 0. +fix cylwalls all wall/gran model hertz tangential history primitive type 1 zcylinder ${cylrad} 0. 0. # change the particles density -# set group all density ${partDens} - +# set group all density ${partDens} fix lb all balance 1000 xyz 10 1.05 out tmp.balance #cfd coupling -fix cfd all couple/cfd couple_every 10 mpi -fix cfd2 all couple/cfd/force/implicit -fix cfd3 all couple/cfd/convection T0 ${Tpart} +fix cfd all couple/cfd couple_every 10 mpi +fix cfd2 all couple/cfd/force/implicit +fix cfd3 all couple/cfd/convection T0 ${Tpart} # freeze particles -#fix integr all nve/sphere +#fix integr all nve/sphere #screen output variable totmass equal mass(all) -compute 1 all erotate/sphere -thermo_style custom step atoms ke c_1 vol v_totmass -thermo 1000 -thermo_modify lost ignore norm no -compute_modify thermo_temp dynamic yes +compute rke all erotate/sphere +thermo_style custom step atoms ke c_rke vol v_totmass +thermo 1000 +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic yes #insert the first particles so that dump is not empty -dump dmp all custom/vtk 40000 ../DEM/post/dump*.liggghts_coupled.vtk id type x y z vx vy vz fx fy fz radius f_Temp[0] +dump dmp all custom/vtk 40000 ../DEM/post/dump*.liggghts_coupled.vtk id type x y z vx vy vz fx fy fz radius f_Temp[0] run 1 From 70617eb3608366ff8bee9ac41a7d0454e08bb749 Mon Sep 17 00:00:00 2001 From: danielque Date: Thu, 31 Aug 2017 14:50:59 +0200 Subject: [PATCH 98/99] replace deprecated outputControl and outputInterval replace with writeControl and writeInterval --- .../twoSpheresGlowinskiMPI/CFD/system/controlDict | 4 ++-- .../twoSpheresGlowinskiMPI/CFD/system/controlDict.foam | 4 ++-- tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict | 4 ++-- .../cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict.foam | 4 ++-- tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict | 4 ++-- .../cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict.foam | 4 ++-- .../cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict | 4 ++-- .../ErgunTestMPI_cgs/CFD/system/controlDict.foam | 4 ++-- .../ErgunTestMPI_restart/CFD/system/controlDict | 4 ++-- .../ErgunTestMPI_restart/CFD/system/controlDict.foam | 4 ++-- .../ErgunTestMPI_restart/CFD/system/controlDict_restart | 4 ++-- .../ErgunTestMPI_restart/CFD/system/controlDict_run | 4 ++-- .../cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict | 4 ++-- .../ErgunTestMPI/CFD/system/controlDict.foam | 4 ++-- .../packedBedTemp/CFD/system/controlDict | 4 ++-- .../cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict index 34ace3ee..cf3b6c34 100644 --- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict +++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict @@ -73,8 +73,8 @@ functions fields ( particleForces ); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } diff --git a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict.foam b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict.foam index 8db85574..a383de08 100755 --- a/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict.foam +++ b/tutorials/cfdemSolverIB/twoSpheresGlowinskiMPI/CFD/system/controlDict.foam @@ -73,8 +73,8 @@ functions fields ( particleForces ); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict b/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict index 85ac0cba..24004328 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict @@ -90,8 +90,8 @@ functions fields ( p U voidfraction volAverage_voidfraction voidfractionNext voidfractionPrev); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } // ************************************************************************* // diff --git a/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict.foam b/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict.foam index 59cbc811..677c5bfc 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict.foam +++ b/tutorials/cfdemSolverPiso/ErgunTestCG/CFD/system/controlDict.foam @@ -90,8 +90,8 @@ functions fields ( p U voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict index 31108b0e..697a18b9 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict @@ -89,8 +89,8 @@ functions fields ( p U voidfraction volAverage_voidfraction voidfractionNext voidfractionPrev); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict.foam b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict.foam index 59cbc811..677c5bfc 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict.foam +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI/CFD/system/controlDict.foam @@ -90,8 +90,8 @@ functions fields ( p U voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict index 42f527b3..201e1f70 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict @@ -186,8 +186,8 @@ functions fields ( p U voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } // ************************************************************************* // diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict.foam b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict.foam index 59cbc811..677c5bfc 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict.foam +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_cgs/CFD/system/controlDict.foam @@ -90,8 +90,8 @@ functions fields ( p U voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict index 4b9603a5..b1039aa1 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict @@ -89,8 +89,8 @@ functions fields ( p U voidfraction volAverage_voidfraction voidfractionNext voidfractionPrev); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict.foam b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict.foam index 59cbc811..677c5bfc 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict.foam +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict.foam @@ -90,8 +90,8 @@ functions fields ( p U voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_restart b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_restart index 4b9603a5..b1039aa1 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_restart +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_restart @@ -89,8 +89,8 @@ functions fields ( p U voidfraction volAverage_voidfraction voidfractionNext voidfractionPrev); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_run b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_run index 8bab015c..1571f144 100644 --- a/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_run +++ b/tutorials/cfdemSolverPiso/ErgunTestMPI_restart/CFD/system/controlDict_run @@ -89,8 +89,8 @@ functions fields ( p U voidfraction volAverage_voidfraction voidfractionNext voidfractionPrev); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict index 1b776acd..14afcd26 100644 --- a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict +++ b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict @@ -89,8 +89,8 @@ functions fields ( p U voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } // ************************************************************************* // diff --git a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict.foam b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict.foam index b316d626..5ff5d8e0 100644 --- a/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict.foam +++ b/tutorials/cfdemSolverPisoMS/ErgunTestMPI/CFD/system/controlDict.foam @@ -90,8 +90,8 @@ functions fields ( p U voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } /*pressureDrop diff --git a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict index 4275f170..8d5feaaf 100644 --- a/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict +++ b/tutorials/cfdemSolverPisoScalar/packedBedTemp/CFD/system/controlDict @@ -72,8 +72,8 @@ functions fields ( p T); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } // ************************************************************************* // diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict index a455b4e4..db6a8cdc 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict @@ -89,8 +89,8 @@ functions fields ( p U T voidfraction volAverage_voidfraction); // Write at same frequency as fields - outputControl timeStep;//outputTime; - outputInterval 1; + writeControl timeStep;//outputTime; + writeInterval 1; } } From 69d4e6ff02931c9454ba3690075204feb4d261eb Mon Sep 17 00:00:00 2001 From: Daniel Queteschiner Date: Thu, 31 Aug 2017 16:55:39 +0200 Subject: [PATCH 99/99] bump version number --- etc/bashrc | 2 +- etc/cshrc | 2 +- src/lagrangian/cfdemParticle/cfdTools/versionInfo.H | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 5e90ed8c..00f84d39 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -17,7 +17,7 @@ #------------------------------------------------------------------------------ export CFDEM_PROJECT=CFDEM -export CFDEM_VERSION=17.02 +export CFDEM_VERSION=17.08 ################################################################################ # USER EDITABLE PART: Changes made here may be lost with the next upgrade diff --git a/etc/cshrc b/etc/cshrc index f0a6a532..3ae372da 100755 --- a/etc/cshrc +++ b/etc/cshrc @@ -15,7 +15,7 @@ #------------------------------------------------------------------------------ setenv CFDEM_PROJECT CFDEM -setenv CFDEM_VERSION 17.02 +setenv CFDEM_VERSION 17.08 ################################################################################ # USER EDITABLE PART: Changes made here may be lost with the next upgrade diff --git a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H index b85b7546..bebaac8c 100755 --- a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H +++ b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H @@ -34,8 +34,8 @@ Description #ifndef versionInfo_H #define versionInfo_H -word CFDEMversion="PFM 17.02"; -word compatibleLIGGGHTSversion="PFM 17.02"; +word CFDEMversion="PFM 17.08"; +word compatibleLIGGGHTSversion="PFM 17.08"; word OFversion="4.x"; Info << "\nCFDEMcoupling version: " << CFDEMversion << endl;